Search

Search papers and lessons

Closed Set

Level 2 · 11 min read

A closed set is one whose complement is open, so every limit of points inside it is also inside it, which is why closed sets keep limits from escaping.

On this page

  • Colour = topic mix
  • Discrete math
  • ReadReady to readNot yet

TL;DR

A set FF in a metric space is closed when its complement, the set of points outside FF, is open. Equivalently, if a sequence of points in FF converges, its limit is still in FF. Closed sets matter because they keep limits from escaping, which is what makes many existence proofs work.

Builds on: Open Set, Set Operations · Leads to: Compact Set, Continuity, Extreme Value Theorem

Where it's used

Finding the largest and smallest values. A continuous function on a closed and bounded interval such as [0,1][0, 1] always reaches a largest and a smallest value. The extreme value theorem needs the interval to be closed. On the open interval (0,1)(0, 1) the function f(x)=xf(x) = x reaches neither its largest value nor its smallest, because the values approach 1 and 0 without ever reaching them.

Solution sets of equations. Take a continuous function ff and look at the set of inputs where f(x)≤0f(x) \le 0. This set is closed, because its complement, the set where f(x)>0f(x) \gt 0, is open. Engineers use this fact when they describe a safe region by a continuous limit, such as "the pressure stays at or below 3 bar". A sensor reading exactly 3 bar is still safe, so the boundary belongs to the safe set.

Feasible regions in optimisation. An optimisation problem asks for the smallest value of a cost over a set of allowed choices. If the allowed choices form a bounded and closed set in finite dimensions, and the cost is continuous, the best choice is guaranteed to exist. Textbooks state this as a standing assumption before they search for the minimum, and the assumption is checked by showing the allowed set is closed.

How it works

Work on the real line with the ordinary distance d(x,y)=∣x−y∣d(x, y) = |x - y|. Take the set F=[1,3]F = [1, 3], the numbers from 1 to 3 including both ends. To decide whether FF is closed, test its complement for openness.

  1. Write down the complement. The points not in FF are (−∞,1)(-\infty, 1) together with (3,∞)(3, \infty). Check: 0.5 is not in FF, and 3.4 is not in FF.

  2. Pick an outside point and a small ball. Take x=0.5x = 0.5 and radius r=0.25r = 0.25. The ball is (0.25,0.75)(0.25, 0.75). Check: every number in it is below 1, so none of them is in FF.

  3. Try an outside point on the other side. Take x=3.4x = 3.4 and r=0.3r = 0.3. The ball is (3.1,3.7)(3.1, 3.7). Check: every number in it is above 3, so again none of them is in FF.

  4. Look hard at the edges. The point 1 belongs to FF, so it is not part of the complement and needs no test. The point just outside, x=0.9x = 0.9, has ball (0.85,0.95)(0.85, 0.95) with r=0.05r = 0.05, which lies entirely below 1. Check: the highest number in the ball, 0.95, is still below 1.

  5. Conclude. Every point of the complement has a ball lying inside the complement, so the complement is open. Therefore F=[1,3]F = [1, 3] is closed.

Now compare G=(1,3]G = (1, 3], which leaves out its left end. The point 1 is outside GG. Any ball around 1 contains numbers slightly above 1, such as 1.051.05, and those are in GG. So the complement of GG is not open at 1, and GG is not closed.

flowchart LR
    A["Take a set F"] --> B["Form the complement F^c"]
    B --> C["Pick a point x in F^c"]
    C --> D{"Is there a ball around x inside F^c?"}
    D -- yes --> E["Next point of F^c"]
    D -- no --> F["F is not closed"]
    E --> C
    E --> G["Every point passes: F is closed"]

The math

Definition: Closed set

Let (X,d)(X, d) be a metric space and let F⊆XF \subseteq X. The set FF is closed when its complement X∖F={x∈X:x∉F}X \setminus F = \{ x \in X : x \notin F \} is open.

Here ∖\setminus means "without": X∖FX \setminus F is everything in XX that is not in FF. The symbol ∉\notin means "is not an element of".

Step 2 in symbols: the complement

On the real line with F=[1,3]F = [1, 3], the complement is R∖[1,3]=(−∞,1)∪(3,∞)\mathbb{R} \setminus [1, 3] = (-\infty, 1) \cup (3, \infty). A point xx is in the complement exactly when x<1x \lt 1 or x>3x \gt 3.

Step 3 in symbols: the ball test

The complement is open when, for each xx with x<1x \lt 1 or x>3x \gt 3, some radius r>0r \gt 0 makes B(x,r)⊆X∖FB(x, r) \subseteq X \setminus F. For x=0.5x = 0.5 and r=0.25r = 0.25, B(0.5,0.25)={y:∣y−0.5∣<0.25}=(0.25,0.75)B(0.5, 0.25) = \{ y : |y - 0.5| \lt 0.25 \} = (0.25, 0.75), and every yy there satisfies y<1y \lt 1, so it avoids [1,3][1, 3]. For x=0.9x = 0.9 and r=0.05r = 0.05 the same argument gives B(0.9,0.05)=(0.85,0.95)B(0.9, 0.05) = (0.85, 0.95).

Step 4 in symbols: sequences

The same set can be tested with sequences, which is the form many proofs use. FF is closed exactly when this holds: for every sequence xnx_n in FF that converges to a point xx of XX, the limit xx is also in FF. Take xn=1+1nx_n = 1 + \tfrac{1}{n}, which lies in [1,3][1, 3] for every nn and converges to 1. The limit 1 is in [1,3][1, 3], as the test requires. For G=(1,3]G = (1, 3], the sequence xn=1+1nx_n = 1 + \tfrac{1}{n} still lies in GG and converges to 1, but 1 is not in GG, so the test fails.

Step 5 in symbols: combining closed sets

Closed sets follow from open sets through complements, and the rules transfer. If F1F_1 and F2F_2 are closed, then F1∪F2F_1 \cup F_2 is closed. Its complement is (X∖F1)∩(X∖F2)(X \setminus F_1) \cap (X \setminus F_2), by De Morgan's laws, and a finite intersection of open sets is open by the rule from Open Set. Likewise an arbitrary intersection of closed sets is closed, because its complement is a union of open sets, and unions of open sets are open.

Worked examples

Example
Example 1: a tiny closed interval

Is F=[2,5]F = [2, 5] closed in the real line?

  1. The complement is (−∞,2)∪(5,∞)(-\infty, 2) \cup (5, \infty).
  2. Take the outside point x=7x = 7 and radius r=1r = 1. Then B(7,1)=(6,8)B(7, 1) = (6, 8).
  3. Check the containment: every number in (6,8)(6, 8) is above 5, so none is in [2,5][2, 5].
  4. Take the outside point x=1x = 1 and radius r=0.5r = 0.5. Then B(1,0.5)=(0.5,1.5)B(1, 0.5) = (0.5, 1.5), and every number in it is below 2.
  5. The same argument works for any outside point, with radius equal to its distance to the nearest end of [2,5][2, 5].

So [2,5][2, 5] is closed. Check: the complement has a working ball at 7 and at 1.

Example
Example 2: the standard case, three intervals with one end each

Compare A=[0,1]A = [0, 1], B=(0,1]B = (0, 1], and C=(0,1)C = (0, 1) on the real line.

  1. AA is closed. The complement is (−∞,0)∪(1,∞)(-\infty, 0) \cup (1, \infty). For x=−0.5x = -0.5 take r=0.25r = 0.25, giving (−0.75,−0.25)(-0.75, -0.25), all below 0. For x=1.5x = 1.5 take r=0.25r = 0.25, giving (1.25,1.75)(1.25, 1.75), all above 1. Every outside point can be handled the same way.
  2. BB is not closed. The point 0 is outside BB, but every ball around 0 contains a positive number. For r=0.1r = 0.1, B(0,0.1)=(−0.1,0.1)B(0, 0.1) = (-0.1, 0.1) contains 0.050.05, which is in BB.
  3. CC is not closed for the same reason at 0, and also at 1. For r=0.1r = 0.1, B(1,0.1)=(0.9,1.1)B(1, 0.1) = (0.9, 1.1) contains 0.950.95, which is in CC.

Check: only AA contains both of its endpoints, and it is the only one of the three that is closed.

Example
Example 3: a realistic zero set

Let f(x)=x2−2f(x) = x^2 - 2, a continuous function on the real line. Show that S={x:f(x)≤0}S = \{ x : f(x) \le 0 \} is closed.

  1. The complement is {x:f(x)>0}={x:x2>2}=(−∞,−2)∪(2,∞)\{ x : f(x) \gt 0 \} = \{ x : x^2 \gt 2 \} = (-\infty, -\sqrt{2}) \cup (\sqrt{2}, \infty), where 2≈1.414\sqrt{2} \approx 1.414.
  2. Take the outside point x=2x = 2. Here f(2)=2>0f(2) = 2 \gt 0, so 22 is in the complement.
  3. Choose r=0.5r = 0.5. Then B(2,0.5)=(1.5,2.5)B(2, 0.5) = (1.5, 2.5).
  4. Check the containment: 1.5>21.5 \gt \sqrt{2}, because 1.52=2.25>21.5^2 = 2.25 \gt 2. So every number in the ball is above 2\sqrt{2}, and ff is positive there. For example f(1.5)=0.25>0f(1.5) = 0.25 \gt 0.
  5. The same reasoning works at every point of the complement: the ball can be as large as the gap between the point and ±2\pm\sqrt{2}.

Try it: is T={x:x2<2}T = \{ x : x^2 \lt 2 \} closed? Answer: no. The point 2\sqrt{2} is not in TT, but the points 1.4,1.41,1.4141.4, 1.41, 1.414 are in TT and converge to 2\sqrt{2}. Every ball around 2\sqrt{2} contains points of TT, so the complement is not open at 2\sqrt{2}.

Common mistakes and tradeoffs

It is tempting to think closed means "shut off" or "has a boundary". In fact a set can be closed and still have many boundary points, and a set can be both open and closed. The whole space and the empty set are both open and closed in any metric space, and [0,1)[0, 1) is neither. The correct test is the ball test on the complement, not the word.

It is tempting to think closed means finite. In fact [0,1][0, 1] contains infinitely many points and is closed. Closed sets can be very large; the finite sets are closed, but they are only one case.

It is tempting to think a set is closed whenever it contains its own "edge" points in a loose sense. In fact the test is exact: a set is closed only when every limit of its points is in the set. The set (0,1](0, 1] looks like it has its edges, but its left end 0 is a limit of points in the set and is not in it.

When to use it: when you need a limit of points from the set to stay in the set, for example to guarantee that a minimum or maximum exists. When not to use it: when you are working with a set that has no limit points to worry about, or when a set is not closed and you only need its nearby points. Then the closure, the smallest closed set containing your set, is the right object. Alternative: the complement approach and the sequence approach are equivalent in a metric space. Use whichever is easier for the proof at hand; sequences are often quicker for arguments about limits.

History

Georg Cantor studied closed sets of real numbers in the 1880s while working on series and the foundations of analysis. His examples, including the set that now bears his name, showed that sets of points could be far stranger than intervals, and that closedness was the right property for keeping limits inside. Maurice Fréchet introduced metric spaces in 1906, where a set's closedness is defined from the distance alone. Felix Hausdorff's 1914 book on set theory gave the general definition of a topological space, in which closed sets are the complements of open sets. The definition caught on because it worked both for the real line and for the more abstract spaces that later analysis needed.

Recap

  • A metric space has a distance dd, and the ball B(x,r)B(x, r) is the set of points within rr of xx.
  • A set is open when every point in it has a ball around it that lies inside the set.
  • A set FF is closed when its complement is open, and this is equivalent to: every limit of a sequence in FF is in FF.
  • Closed sets are closed under finite unions and arbitrary intersections, by De Morgan's laws and the rules for open sets.
  • Read next: Compact Set, which combines closedness with boundedness, and Extreme Value Theorem, which uses closed and bounded intervals to guarantee a largest and a smallest value.

Check yourself

QuestionIs the interval (4,9)(4, 9) closed in the real line? Justify with the complement.Show answer

No. The point 4 is not in (4,9)(4, 9), so it is in the complement. Every ball around 4 contains numbers above 4, such as 4.14.1 for r=0.5r = 0.5, and those numbers are in (4,9)(4, 9). So the complement is not open at 4, and the set is not closed.

QuestionCompute the ball B(3,0.25)B(3, 0.25) on the real line and state whether it lies entirely inside [1,3][1, 3].Show answer

B(3,0.25)={y:∣y−3∣<0.25}=(2.75,3.25)B(3, 0.25) = \{ y : |y - 3| \lt 0.25 \} = (2.75, 3.25). It does not lie inside [1,3][1, 3], because numbers such as 3.23.2 are above 3. So the ball around the endpoint 3 is not inside [1,3][1, 3], which means [1,3][1, 3] is not open at 3. That is consistent with it being closed: a closed set is allowed to fail openness at its endpoints, and it is the complement that must pass the ball test.

QuestionWhy does the sequence xn=2+1nx_n = 2 + \tfrac{1}{n} show that the set (2,5](2, 5] is not closed?Show answer

Every term 2+1n2 + \tfrac{1}{n} is greater than 2 and at most 3, so every term lies in (2,5](2, 5]. The sequence converges to 2, because 1n\tfrac{1}{n} shrinks to 0. The limit 2 is not in (2,5](2, 5], so the set fails the sequence test, and therefore it is not closed.

QuestionA continuous function gg on the real line has g(x)≥0g(x) \ge 0 exactly on the set KK. Explain in words why KK must be closed.Show answer

The complement of KK is the set where g(x)<0g(x) \lt 0. Continuity means nearby inputs give nearby outputs, so if g(x)<0g(x) \lt 0 at some point, it stays negative on a small ball around that point. That ball lies in the complement, so the complement is open, and therefore KK is closed.

Sources