Survey of Mathematics

4.4 Connectedness and path-connectedness

A space is connected when it cannot be split into two separate open pieces. The connected subsets of the line are exactly the intervals, a continuous map sends connected sets to connected sets, and that one fact is the intermediate value theorem. Path-connected is stronger, and the topologist's sine curve shows the gap.

Beyond the courseRudin, Principles of Mathematical Analysis, Thm 2.45 to 2.47, 4.22 and 4.23Abbott, Understanding Analysis, Sec. 3.4 and 4.5Munkres, Topology, Sec. 23 to 25Apostol Vol. 2, Sec. 8.2 and 10.10

In 1.3 the intermediate value theorem said that a continuous function cannot jump over a value. Its proof used the supremum of the points where the function was still negative. That proof was about the interval [a,b][a, b] and about the real numbers, and it left a question open. Is it a fact about functions, or about the interval? Bolzano’s 1817 proof already used no geometry, but it did use the order of the real line, and a function on a circle, a sphere or a disc has no order on its inputs to use. This chapter finds the property of [a,b][a, b] that the proof used: it is in one piece. We make “one piece” exact with open sets, prove that the connected subsets of the line are the intervals, and show that continuous maps preserve it. The intermediate value theorem then becomes a corollary that holds for functions on any connected metric space.

Before you start

4.1: open sets and closed sets in a metric space, and that a union of open sets is open. 1.3: the intermediate value theorem and continuity with ε\varepsilon and δ\delta. 4.2: convergent sequences in a metric space.

Quick checkIs [0,1]∪[2,3][0, 1] \cup [2, 3] a closed subset of R\mathbb R?
Quick checkff is continuous on [0,1][0, 1] with f(0)=−2f(0) = -2 and f(1)=5f(1) = 5. Which values must ff take?
Quick checkTake the metric space A=[0,1]∪[2,3]A = [0, 1] \cup [2, 3] with the distance ∣x−y∣|x - y|. Is [0,1][0, 1] an open set of this space AA?

The picture: can you cut it in two?

Take a subset AA of the line. A cut at the number zz splits AA into the part to the left of zz and the part to the right. Three things to do in the picture:

  1. Pick [0,1][0, 1] and [2,3][2, 3] and drag the cut into the gap. The cut hits no point of AA, and both pieces are non-empty. Each piece is AA meets an open ray, so each is open in AA. The set has been separated.
  2. Pick [0,3][0, 3] and drag the cut anywhere. Either the cut sits on a point of AA (nothing is cut), or one side is empty. No cut ever works. This is the property that will be called connected.
  3. Pick [0,1)[0, 1) and (1,2](1, 2]. The point 11 is missing from the set, and that missing point is a place where the cut lands. A missing point is enough to separate.
Where this came from· From 'a continuum' to 'no separation'

In 1883 Georg Cantor wanted to say what it means for a set of points to be a continuum, one unbroken piece. His definition used distances: any two points of the set can be joined by a finite chain of points of the set whose consecutive links are shorter than any tolerance you name. Arthur Schoenflies (1904) saw that distance is not needed and defined the notion purely with point sets. The form used today, that a set is connected when it is not the union of two separated non-empty sets, appeared independently with Nels Lennes, Frigyes Riesz and Felix Hausdorff in the first years of the twentieth century, and is often called the Lennes–Hausdorff definition. The problem they solved was to say “in one piece” without drawing a picture. Bernard Bolzano’s 1817 proof of the intermediate value theorem is the earliest result of this kind. It was proved long before anyone had a definition of the property it depends on.

The idea, in words

Why· One piece means: no way to build a fence

Suppose a set AA is in two pieces, like [0,1]∪[2,3][0, 1] \cup [2, 3]. Then you can build a fence in the gap. Each side of the fence is an open set of AA: no point of the left side touches the right side, so every point of the left side has room around it that stays on the left. A set in one piece has no fence. Any attempt to put the points into a “left side” and a “right side” leaves a point on the fence line with room on neither side.

A continuous function cannot tear a set. If ff sent an interval onto two separate pieces of the line, the fence between the pieces would pull back to a fence in the interval, and there is none. That is the whole proof of the intermediate value theorem, and it never mentions the order or the sup of the inputs. It only uses that the domain has no fence.

Definitions and theorems

Separations and connected sets

First we need open sets inside a subset. Take a subset AA of a metric space XX. With the same distance dd, AA is itself a metric space, and 4.1 applies to it: BA(x,r)={y∈A:d(x,y)<r}B_A(x, r) = \{y \in A : d(x, y) < r\}, and a set U⊆AU \subseteq A is open in AA if each of its points has a ball BA(x,r)⊆UB_A(x, r) \subseteq U. The example in the “Before you start” box shows why this matters: [0,1][0, 1] is open in [0,1]∪[2,3][0, 1] \cup [2, 3].

Lemma B standard; Rudin Thm 2.30

Open sets inside a subset

Let A⊆XA \subseteq X and U⊆AU \subseteq A. Then UU is open in AA if and only if there is an open set WW of XX with U=A∩WU = A \cap W.

In one lineUU is open in AA if and only if U=A∩WU = A \cap W for some open set WW of XX.

Why it is trueA ball of AA is a ball of XX with the points outside AA removed.

Proofstandard
The idea: A ball of the subspace A is the intersection of A with a ball of X. Forward: gather the balls of X into one open set W. Backward: shrink the ball of X around a point of A ∩ W so that it sits inside W.
(⇒\Rightarrow) Let UU be open in AA. For each x∈Ux \in U choose rx>0r_x > 0 with A∩B(x,rx)⊆UA \cap B(x, r_x) \subseteq U.
By definition, BA(x,r)=A∩B(x,r)B_A(x, r) = A \cap B(x, r). The ball of XX with its points outside AA removed.
Put W=⋃x∈UB(x,rx)W = \bigcup_{x \in U} B(x, r_x). It is open in XX.
A union of open balls is open (4.1: balls are open, unions of open sets are open).
So A∩W=UA \cap W = U.
Each x∈Ux \in U lies in its own ball, so U⊆A∩WU \subseteq A \cap W. Conversely a point of A∩WA \cap W is in A∩B(x,rx)⊆UA \cap B(x, r_x) \subseteq U for some xx.
(⇐\Leftarrow) Let U=A∩WU = A \cap W with WW open, and x∈Ux \in U. Choose r>0r > 0 with B(x,r)⊆WB(x, r) \subseteq W.
WW is open, so the point x∈A∩Wx \in A \cap W has a ball B(x,r)⊆WB(x, r) \subseteq W.
Then BA(x,r)=A∩B(x,r)⊆A∩W=UB_A(x, r) = A \cap B(x, r) \subseteq A \cap W = U, so UU is open in AA. ■\blacksquare
Intersect both sides of B(x,r)⊆WB(x, r) \subseteq W with AA.
Definition B

Separation

A separation of a metric space AA is a pair of sets U,VU, V with A=U∪VA = U \cup V, U∩V=∅U \cap V = \varnothing, U≠∅U \ne \varnothing, V≠∅V \ne \varnothing, and both UU and VV open in AA. For a subset AA of a bigger space XX, “open in AA” is as in the previous lemma.

In one lineA separation of a set AA is a way of writing A=U∪VA = U \cup V with UU and VV disjoint, non-empty, and both open in AA.

Why it existsIt is the exact form of 'a fence through the gap': two pieces, each with room to move inside itself, with nothing shared.

Definition B

Connected set

A metric space AA is connected if it has no separation. A subset of a metric space is connected if it is connected as a metric space with the inherited distance. A set that is not connected is disconnected.

In one lineA set (a metric space) is connected if it has no separation: it cannot be written as two disjoint non-empty open pieces.

Why it existsIt is the property of 'being in one piece' that continuity preserves and that the intermediate value theorem needs.

Two quick consequences. The empty set and any one-point set are connected, because a separation needs two non-empty disjoint pieces. And because V=A∖UV = A \setminus U is the complement of UU, a separation A=U∪VA = U \cup V makes UU open and also closed in AA (its complement VV is open). That gives a second description.

Proposition B standard

Connected means no proper clopen subset

A metric space AA is connected if and only if its only subsets that are both open and closed (called clopen) are ∅\varnothing and AA.

In one lineA space AA is connected if and only if the only subsets that are both open and closed in AA are ∅\varnothing and AA.

Why it is trueA subset that is both open and closed, and neither empty nor everything, together with its complement is a separation; conversely, a separation gives such a subset.

Proofstandard
The idea: Both directions are the observation that a pair of complementary open sets is the same data as one clopen set.
(Not connected ⇐\Leftarrow a proper clopen set) UU and V=A∖UV = A \setminus U are disjoint, non-empty and open in AA, with union AA: a separation.
Suppose AA has a clopen subset UU with U≠∅U \ne \varnothing and U≠AU \ne A. Its complement V=A∖UV = A \setminus U is open (since UU is closed) and non-empty (since U≠AU \ne A).
(Not connected ⇒\Rightarrow a proper clopen set) Given a separation A=U∪VA = U \cup V, UU is clopen and proper. ■\blacksquare
VV is open, and U=A∖VU = A \setminus V is its complement, so UU is closed. UU is open by definition of a separation. UU is non-empty, and U≠AU \ne A because V≠∅V \ne \varnothing and VV is disjoint from UU.

In 4.1 we noticed that ∅\varnothing and R\mathbb R are the only clopen subsets of R\mathbb R and left it unproved. By this proposition that statement is the same as ”R\mathbb R is connected”, which the next section proves.

Quick checkIs a set with exactly one point connected?

The next lemma is used twice below. It says a connected set cannot straddle a separation of a bigger set.

Lemma B standard

A connected subset lies on one side of a separation

Let ZZ be a metric space with a separation Z=P∪QZ = P \cup Q, and let C⊆ZC \subseteq Z be connected. Then C⊆PC \subseteq P or C⊆QC \subseteq Q.

In one lineIf Z=P∪QZ = P \cup Q is a separation and C⊆ZC \subseteq Z is connected, then C⊆PC \subseteq P or C⊆QC \subseteq Q.

Why it is trueOtherwise C∩PC \cap P and C∩QC \cap Q would be a separation of CC.

Proofstandard
The idea: If C meets both P and Q, the pieces C ∩ P and C ∩ Q separate C.
Suppose CC meets both PP and QQ. Then C∩PC \cap P and C∩QC \cap Q are open in CC.
PP and QQ are open in ZZ. By the lemma on open sets inside a subset (with ZZ as the big space and CC as the subset), C∩PC \cap P and C∩QC \cap Q are open in CC.
So C=(C∩P)∪(C∩Q)C = (C \cap P) \cup (C \cap Q) is a separation of CC, contradicting that CC is connected. So CC misses one of them, and lies in the other. ■\blacksquare
They are non-empty by assumption, disjoint because P∩Q=∅P \cap Q = \varnothing, and their union is C∩(P∪Q)=CC \cap (P \cup Q) = C.

The connected subsets of the line

Definition B

Interval

A set I⊆RI \subseteq \mathbb R is an interval if for all x,y∈Ix, y \in I and every zz with x<z<yx < z < y, we have z∈Iz \in I.

In one lineA set I⊆RI \subseteq \mathbb R such that whenever x<z<yx < z < y and x,y∈Ix, y \in I, also z∈Iz \in I: it has no holes.

Why it existsIt is the exact statement of 'no gaps', and it covers [a,b][a, b], (a,b)(a, b), half-open ones, rays, R\mathbb R, single points and the empty set in one definition.

This definition includes [0,1][0, 1], (0,1)(0, 1), [0,1)[0, 1), [2,∞)[2, \infty), (−∞,3)(-\infty, 3), R\mathbb R, a single point, and ∅\varnothing. It excludes [0,1]∪[2,3][0, 1] \cup [2, 3] (take x=1x = 1, y=2y = 2, z=1.5z = 1.5) and Q\mathbb Q (take x=1x = 1, y=2y = 2, z=2z = \sqrt2).

Theorem B Rudin Thm 2.47; Abbott Sec. 3.4

Connected subsets of the line are the intervals

A subset A⊆RA \subseteq \mathbb R is connected if and only if it is an interval.

In one lineA subset of R\mathbb R is connected if and only if it is an interval.

Why it is trueA hole at zz gives a cut through zz. In the other direction, a separation of an interval would give a last point of the left piece, which contradicts the openness of both pieces.

ProofRudin 2.47; Abbott Sec. 3.4
The idea: Not an interval: cut at the missing point. Interval: if it were separated, take the supremum of the left piece between a left point and a right point, and show the supremum can belong to neither piece. This is the proof of the intermediate value theorem in 1.3.
(⇒\Rightarrow) Suppose AA is not an interval. Pick x<z<yx < z < y with x,y∈Ax, y \in A and z∉Az \notin A.
We prove the contrapositive of (⇒\Rightarrow): not an interval means not connected. Use the definition of interval, negated: there are x,y∈Ax, y \in A and a zz with x<z<yx < z < y and z∉Az \notin A.
Let U=A∩(−∞,z)U = A \cap (-\infty, z) and V=A∩(z,∞)V = A \cap (z, \infty).
Open rays are open sets of R\mathbb R, so these two are open in AA by the lemma on open sets inside a subset. This is the cut in the picture.
They are non-empty, disjoint, and U∪V=AU \cup V = A. So AA has a separation and is not connected.
x∈Ux \in U and y∈Vy \in V. A point of AA is below zz, above zz, or equal to zz, and z∉Az \notin A.
Pick a∈Ua \in U and b∈Vb \in V. By swapping the names UU and VV we may assume a<ba < b (they are different, since U∩V=∅U \cap V = \varnothing).
(⇐\Leftarrow) Suppose II is an interval with a separation I=U∪VI = U \cup V. We will reach a contradiction. Choose a point in each piece.
Then [a,b]⊆I[a, b] \subseteq I, so each point of [a,b][a, b] is in UU or in VV.
II is an interval and a,b∈Ia, b \in I, so every point between them is in II.
Let S=U∩[a,b]S = U \cap [a, b] and c=sup⁡Sc = \sup S. Then a≤c≤ba \le c \le b, so c∈Ic \in I.
SS is non-empty (a∈Sa \in S) and bounded above by bb, so the completeness axiom of 1.1 gives its supremum. This is the same set as in the proof of the intermediate value theorem of 1.3.Where the idea comes from: we want the last point of the left piece before the right piece begins. A last point is a supremum.
Case c∈Uc \in U. Choose r>0r > 0 with (c−r,c+r)∩I⊆U(c - r, c + r) \cap I \subseteq U. Put x=min⁡(c+r2,b)x = \min(c + \frac r2, b). Then c<x≤bc < x \le b, x∈[a,b]⊆Ix \in [a, b] \subseteq I and xx is in the ball, so x∈U∩[a,b]=Sx \in U \cap [a, b] = S. But x>c=sup⁡Sx > c = \sup S, a contradiction.
c∈Uc \in U cannot be bb since b∈Vb \in V and U∩V=∅U \cap V = \varnothing, so c<bc < b. UU is open in II, so some ball (c−r,c+r)∩I(c - r, c + r) \cap I lies in UU.
Case c∈Vc \in V. Choose 0<r≤c−a0 < r \le c - a with (c−r,c+r)∩I⊆V(c - r, c + r) \cap I \subseteq V. Then (c−r,c]⊆[a,c]⊆I(c - r, c] \subseteq [a, c] \subseteq I, so (c−r,c]⊆V(c - r, c] \subseteq V, and (c−r,c](c - r, c] contains no point of UU.
c∈Vc \in V cannot be aa since a∈Ua \in U, so c>ac > a. VV is open in II, so some ball (c−r,c+r)∩I(c - r, c + r) \cap I lies in VV. Shrink rr to at most c−ac - a so the ball stays inside [a,∞)[a, \infty).
So c−rc - r is an upper bound of SS smaller than cc, contradicting that cc is the least upper bound.
Every point of SS is at most cc (as cc is an upper bound) and, by the previous line, not in (c−r,c](c - r, c]. So all points of SS are at most c−rc - r.
Both cases fail, so no separation exists. II is connected. ■\blacksquare
c∈[a,b]⊆I=U∪Vc \in [a, b] \subseteq I = U \cup V, so one of the two cases holds, and each is impossible.

In the picture: the first half is the cut in the visualizer, dragged into a gap. The second half is the visualizer for [0,3][0, 3], where no cut works: the supremum cc is the place the cut would have to go, and it has no side to belong to.

Proof workshopRebuild the proof that an interval is connected

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Quick checkWhich of these subsets of R\mathbb R is connected?
    Worked example
    Is A={x∈R:x2>5}∪{x:x2<3}A = \{x \in \mathbb R : x^2 > 5\} \cup \{x : x^2 < 3\} connected? Into how many pieces does it break?

    Solution.

    1. Write AA as intervals. x2<3x^2 < 3 means −3<x<3-\sqrt3 < x < \sqrt3, and x2>5x^2 > 5 means x<−5x < -\sqrt5 or x>5x > \sqrt5. So A=(−∞,−5)∪(−3,3)∪(5,∞)A = (-\infty, -\sqrt5) \cup (-\sqrt3, \sqrt3) \cup (\sqrt5, \infty). Solving each inequality gives intervals, and a connected subset of R\mathbb R is an interval.
    2. Find a hole. Take x=0x = 0 and y=3y = 3. Both lie in AA, and z=2z = 2 lies between them. But 22=42^2 = 4 is neither below 33 nor above 55, so 2∉A2 \notin A. That is the failure of the interval property, so AA is not an interval.
    3. Separate. U=A∩(−∞,2)=(−∞,−5)∪(−3,3)U = A \cap (-\infty, 2) = (-\infty, -\sqrt5) \cup (-\sqrt3, \sqrt3) and V=A∩(2,∞)=(5,∞)V = A \cap (2, \infty) = (\sqrt5, \infty). The cut at z=2z = 2, as in the theorem.
    4. Count the pieces. Each of the three intervals is itself an interval, hence connected, and there are gaps between them, at [−5,−3][-\sqrt5, -\sqrt3] and [3,5][\sqrt3, \sqrt5]. So AA breaks into three connected pieces.

    Answer. AA is not connected. It has three connected pieces. ■\blacksquare

    Your answerHow many separate connected pieces (maximal intervals) does {x∈R:x2>5}∪{x:x2<3}\{x \in \mathbb R : x^2 > 5\} \cup \{x : x^2 < 3\} have?
    Worked example
    Show that Q\mathbb Q is disconnected, and that its only connected subsets have at most one point.

    Solution.

    1. Suppose a connected subset C⊆QC \subseteq \mathbb Q has two points. Say x<yx < y in CC. We prove the contrapositive of “at most one point”: two points give a contradiction.
    2. Use the theorem. CC is a connected subset of R\mathbb R, so it is an interval, and so every real number between xx and yy is in CC. The theorem applies to every connected subset of the line, rational or not.
    3. Find an irrational number between them. Between any two rationals there is an irrational number (add 2n\frac{\sqrt2}{n} for large nn). That number is in C⊆QC \subseteq \mathbb Q, a contradiction. Irrational numbers are not rational, so they cannot lie in CC.

    Answer. Every connected subset of Q\mathbb Q has at most one point; in particular Q\mathbb Q is disconnected. ■\blacksquare A space like this, with no connected piece bigger than a point, is called totally disconnected.

    Continuous maps and connectedness

    A continuous map f:X→Yf : X \to Y between metric spaces is one for which, at every point aa of XX and for every ε>0\varepsilon > 0, there is a δ>0\delta > 0 with dY(f(x),f(a))<εd_Y(f(x), f(a)) < \varepsilon whenever dX(x,a)<δd_X(x, a) < \delta. That is the definition of 1.3 with the two distances written dXd_X and dYd_Y. Chapter 4.5 gives it its name and studies it; here we need exactly one property, and we prove it from this definition.

    Lemma B Rudin Thm 4.8

    Continuous maps pull open sets back to open sets

    Let f:X→Yf : X \to Y be continuous (in the ε\varepsilon-δ\delta sense above) and let W⊆YW \subseteq Y be open. Then f−1(W)f^{-1}(W) is open in XX.

    In one lineIf f:X→Yf : X \to Y is continuous and WW is open in YY, then f−1(W)={x:f(x)∈W}f^{-1}(W) = \{x : f(x) \in W\} is open in XX.

    Why it is trueAround f(a)f(a) the open set WW contains a ball. Continuity gives a ball around aa that is sent into it.

    ProofRudin 4.8
    The idea: Take a point a in the preimage. Its image has a ball inside W; continuity turns that ball's radius into a δ-ball around a that maps inside it.
    Let a∈f−1(W)a \in f^{-1}(W), so f(a)∈Wf(a) \in W.
    To show the preimage is open we give every point of it a ball. So start with an arbitrary point.
    Choose ε>0\varepsilon > 0 with BY(f(a),ε)⊆WB_Y(f(a), \varepsilon) \subseteq W.
    WW is open in YY, so the point f(a)f(a) of WW has a ball inside WW.
    Choose δ>0\delta > 0 with dY(f(x),f(a))<εd_Y(f(x), f(a)) < \varepsilon whenever dX(x,a)<δd_X(x, a) < \delta.
    Continuity of ff at aa, with this ε\varepsilon.
    So BX(a,δ)⊆f−1(W)B_X(a, \delta) \subseteq f^{-1}(W). Since aa was arbitrary, f−1(W)f^{-1}(W) is open. ■\blacksquare
    If x∈BX(a,δ)x \in B_X(a, \delta) then f(x)∈BY(f(a),ε)⊆Wf(x) \in B_Y(f(a), \varepsilon) \subseteq W, which says x∈f−1(W)x \in f^{-1}(W).

    In the picture of 1.3 (ε-δ visualizer) WW is a horizontal band around f(a)f(a) and B(a,δ)B(a, \delta) is the window of inputs whose graph stays in the band. The lemma says: the set of all inputs whose output lands in the band is a union of such windows.

    Theorem B Rudin Thm 4.22

    The continuous image of a connected set is connected

    If XX is a connected metric space and f:X→Yf : X \to Y is continuous, then the image f(X)f(X) is connected.

    In one lineIf XX is connected and f:X→Yf : X \to Y is continuous, then f(X)f(X) is connected.

    Why it is trueA separation of the image would pull back, through the lemma, to a separation of XX.

    ProofRudin 4.22
    The idea: Contradiction: a separation of f(X) pulls back to a separation of X, because preimages of open sets are open, preimages of disjoint sets are disjoint, and the pieces are non-empty since every point of f(X) has a preimage.
    Suppose P,QP, Q are disjoint, non-empty, open in f(X)f(X), with P∪Q=f(X)P \cup Q = f(X).
    Assume the opposite of what we want: the image has a separation f(X)=P∪Qf(X) = P \cup Q.
    The sets f−1(P)f^{-1}(P) and f−1(Q)f^{-1}(Q) are open in XX.
    View ff as a map into the metric space f(X)f(X); it is still continuous, since the distances are unchanged. Then apply the lemma to the open sets PP and QQ of f(X)f(X).
    They are disjoint, they cover XX, and each is non-empty.
    A point mapped into both PP and QQ would be in P∩Q=∅P \cap Q = \varnothing. Every point of XX is sent into f(X)=P∪Qf(X) = P \cup Q. Every point of PP is a value of ff, so its preimage is non-empty.
    This is a separation of XX, a contradiction. So f(X)f(X) is connected. ■\blacksquare
    That is the definition of a separation of XX, which is connected.
    Proof workshopPick the reason for each line: the continuous image of a connected set

    Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

    1. Suppose f(X)=P∪Qf(X) = P \cup Q with P,QP, Q disjoint, non-empty and open in f(X)f(X).
    2. Then f−1(P)f^{-1}(P) and f−1(Q)f^{-1}(Q) are open in XX.
    3. They are disjoint.
    4. Their union is XX.
    5. Each is non-empty.
    6. So XX has a separation, contradicting that XX is connected.
    Quick checkf:[0,1]→Rf : [0, 1] \to \mathbb R is continuous and every value f(x)f(x) is a rational number. What follows?
    Corollary B Abbott Sec. 4.5; Rudin Thm 4.23

    Intermediate value theorem from connectedness

    Let XX be connected, f:X→Rf : X \to \mathbb R continuous, p,q∈Xp, q \in X, and yy a real number between f(p)f(p) and f(q)f(q). Then there is c∈Xc \in X with f(c)=yf(c) = y. In particular, for X=[a,b]X = [a, b] this is the intermediate value theorem of 1.3.

    In one lineIf XX is a connected metric space and f:X→Rf : X \to \mathbb R is continuous, then ff takes every value between any two of its values.

    Why it is trueThe image of a connected set is an interval, and an interval that contains two numbers contains everything between them.

    ProofAbbott Sec. 4.5
    The idea: The image f(X) is connected, so it is an interval, so it contains everything between f(p) and f(q).
    f(X)f(X) is a connected subset of R\mathbb R.
    The continuous image of a connected set is connected.
    So f(X)f(X) is an interval.
    A connected subset of R\mathbb R is an interval (the theorem above).
    f(p),f(q)∈f(X)f(p), f(q) \in f(X) and yy is between them, so y∈f(X)y \in f(X), which means y=f(c)y = f(c) for some c∈Xc \in X. ■\blacksquare
    The definition of interval: it contains every number strictly between two of its members. If y=f(p)y = f(p) or y=f(q)y = f(q) it is a value already.

    This is the same argument as 1.3’s, repackaged: the supremum is now inside the proof that intervals are connected, and the theorem about functions needs no more. The gain is that XX can be any connected metric space: a circle, a disc, a sphere.

    Worked example
    At every moment there are two opposite points on the equator with the same temperature.

    Solution.

    1. Set up. Let T(θ)T(\theta) be the temperature at the point of the equator at angle θ\theta, so TT is continuous and T(θ+2π)=T(θ)T(\theta + 2\pi) = T(\theta). Temperature varies continuously along a path.
    2. Compare opposite points. Let g(θ)=T(θ)−T(θ+π)g(\theta) = T(\theta) - T(\theta + \pi) for 0≤θ≤π0 \le \theta \le \pi. We want a zero of gg. g(θ)=0g(\theta) = 0 says the point at angle θ\theta and the opposite point (angle θ+π\theta + \pi) have equal temperature.
    3. Look at the ends. g(0)=T(0)−T(π)g(0) = T(0) - T(\pi) and g(π)=T(π)−T(2π)=T(π)−T(0)=−g(0)g(\pi) = T(\pi) - T(2\pi) = T(\pi) - T(0) = -g(0). The end values are negatives of each other, so they have opposite signs (or both are zero).
    4. Apply the theorem. gg is continuous on the connected set [0,π][0, \pi] and takes a value g(0)g(0) and its negative, so it takes the value 00 between them: g(θ∗)=0g(\theta^*) = 0 for some θ∗∈[0,π]\theta^* \in [0, \pi]. The corollary above, with the value y=0y = 0.

    Answer. There is θ∗\theta^* with T(θ∗)=T(θ∗+π)T(\theta^*) = T(\theta^* + \pi). ■\blacksquare The same argument works for any continuous quantity on a circle, such as pressure on a latitude line.

    Your answerSuppose T(θ)=2cos⁡θ+sin⁡2θT(\theta) = 2\cos\theta + \sin 2\theta on the equator. For which θ∈[0,π]\theta \in [0, \pi] is T(θ)=T(θ+π)T(\theta) = T(\theta + \pi)? (Give θ\theta in radians.)
    Worked example classic
    A monk climbs a mountain path from 8:00 to 16:00 on Monday, and descends the same path from 8:00 to 16:00 on Tuesday. Show he is at the same spot at the same time of day on both days.

    Solution.

    1. Measure position along the path. Let u(t)u(t) be his distance from the bottom, as a fraction 00 to 11 of the path, at time tt on Monday, and w(t)w(t) the same on Tuesday. Both are continuous on [8,16][8, 16]. He cannot teleport, so position is continuous in time.
    2. Form the difference. h(t)=u(t)−w(t)h(t) = u(t) - w(t) on [8,16][8, 16]. We want h(t∗)=0h(t^*) = 0. A zero is a time of day when both days found him at the same place on the path.
    3. Check the signs. On Monday he starts at the bottom and on Tuesday at the top: u(8)=0u(8) = 0, w(8)=1w(8) = 1, so h(8)=−1h(8) = -1. At 16:00 he is at the top on Monday and at the bottom on Tuesday: h(16)=1−0=1h(16) = 1 - 0 = 1. The two days have opposite directions, so the difference changes sign.
    4. Apply the theorem. hh is continuous on the connected set [8,16][8, 16] with h(8)=−1<0<1=h(16)h(8) = -1 < 0 < 1 = h(16), so h(t∗)=0h(t^*) = 0 for some t∗t^*. The corollary. Nothing about his speed, rests or direction changes is needed.

    Answer. There is a time t∗t^* when he is at the same point on both days. ■\blacksquare Imagine two monks, one climbing and one descending on the same day: they must meet.

    Your answerSuppose on Monday he climbs at constant speed, u(t)=(t−8)/8u(t) = (t - 8)/8, and on Tuesday he descends so that w(t)=1−s2w(t) = 1 - s^2 where s=(t−8)/8s = (t - 8)/8. At what time tt (in hours, as a decimal) are the two positions equal?

    Paths

    Definition B

    Path

    A path in a metric space XX is a continuous map γ:[0,1]→X\gamma : [0, 1] \to X (continuity as in the paragraph above, with [0,1][0, 1] carrying the distance ∣s−t∣|s - t|). It goes from γ(0)\gamma(0) to γ(1)\gamma(1).

    In one lineA path in a space XX is a continuous map γ\gamma from the interval [0,1][0, 1] into XX: a journey that starts at γ(0)\gamma(0) and ends at γ(1)\gamma(1) without jumping.

    Why it existsIt makes 'you can walk from pp to qq without leaving the set' into a mathematical object.

    Definition B

    Path-connected

    A metric space XX is path-connected if for all p,q∈Xp, q \in X there is a path γ\gamma in XX from pp to qq.

    In one lineA space is path-connected if any two of its points are joined by a path inside it.

    Why it existsIt is connectedness you can check by exhibiting an explicit journey, rather than by ruling out all possible fences.

    The simplest path is a straight line. In a normed space (4.1), the segment from pp to qq is γ(t)=(1−t)p+tq\gamma(t) = (1 - t)p + tq. It is continuous because ∥γ(t)−γ(s)∥=∣t−s∣ ∥q−p∥\lVert \gamma(t) - \gamma(s) \rVert = |t - s|\,\lVert q - p \rVert, so δ=ε/∥q−p∥\delta = \varepsilon / \lVert q - p \rVert works (or any δ\delta if p=qp = q). A set SS in a normed space is convex if the segment between any two of its points stays in SS, and a convex set is path-connected, because the segment between two of its points is a path that stays in the set.

    Paths can be reversed: if γ\gamma goes from pp to qq, then t↦γ(1−t)t \mapsto \gamma(1 - t) goes from qq to pp and is continuous. Paths can also be glued. If α\alpha is a path from pp to mm and β\beta a path from mm to qq, then γ(t)=α(2t)\gamma(t) = \alpha(2t) for t≤12t \le \frac12 and γ(t)=β(2t−1)\gamma(t) = \beta(2t - 1) for t≥12t \ge \frac12 is a path from pp to qq: both formulas give mm at t=12t = \frac12, so there is no jump, and continuity at t=12t = \frac12 is checked by taking the smaller of the two δ\delta values.

    Theorem B Munkres Sec. 24

    Path-connected implies connected

    If XX is path-connected, then XX is connected.

    In one lineA path-connected space is connected.

    Why it is trueA path from one side of a separation to the other would be a connected set (the image of [0,1][0, 1]) that sits on both sides.

    ProofRudin 4.22 with 2.47
    The idea: Suppose X is separated. Join a point of one piece to a point of the other by a path. The path's image is connected, so by the lemma it lies on one side, but it touches both.
    Pick p∈Up \in U and q∈Vq \in V (both pieces are non-empty).
    Contradiction: assume X=U∪VX = U \cup V is a separation.
    Let γ\gamma be a path in XX from pp to qq.
    XX is path-connected.
    C=γ([0,1])C = \gamma([0, 1]) is a connected subset of XX.
    [0,1][0, 1] is an interval, hence connected, and γ\gamma is continuous, so its image is connected.
    So C⊆UC \subseteq U or C⊆VC \subseteq V.
    A connected subset lies on one side of a separation.
    But CC contains p∈Up \in U and q∈Vq \in V, a contradiction. So XX is connected. ■\blacksquare
    p=γ(0)∈Cp = \gamma(0) \in C and p∈Up \in U but p∉Vp \notin V; q=γ(1)∈Cq = \gamma(1) \in C and q∈Vq \in V but q∉Uq \notin U.
    Worked example
    Show that R2∖{(0,0)}\mathbb R^2 \setminus \{(0, 0)\} is path-connected, hence connected, while R∖{0}\mathbb R \setminus \{0\} is not connected.

    Solution.

    1. Two points of the punctured plane. Let p,q≠(0,0)p, q \ne (0, 0). If the segment from pp to qq misses the origin, it is the path. A segment is a path in a normed space.
    2. The bad case. If the segment passes through the origin, then q=−cpq = -cp for some c>0c > 0 (the points are on opposite sides of the origin on one line). Pick any mm not on that line, for example m=(−p2,p1)m = (-p_2, p_1) (the vector pp turned by 90∘90^\circ). The origin is on the line through pp and qq, and mm is chosen off that line.
    3. Go around. The segment from pp to mm misses the origin, since the origin would be on the line through pp and mm only if mm were a multiple of pp, and it is not. Likewise the segment from mm to qq. Glue the two. Two segments joined at mm give a path avoiding the origin.
    4. Conclude. So R2∖{(0,0)}\mathbb R^2 \setminus \{(0,0)\} is path-connected, so connected. Path-connected implies connected.
    5. The line is different. R∖{0}\mathbb R \setminus \{0\} is not an interval (−1<0<1-1 < 0 < 1 and 00 is missing), so it is not connected: U=(−∞,0)U = (-\infty, 0), V=(0,∞)V = (0, \infty). In one dimension there is no way around the missing point.

    Answer. The punctured plane is connected; the punctured line is not. ■\blacksquare This is the observation that R\mathbb R and R2\mathbb R^2 are different shapes, made precise in 4.5.

    Your answerA path from (1,0)(1, 0) to (−1,0)(-1, 0) in the punctured plane goes by way of the point (0,1)(0, 1) along two straight segments. What is its total length?
    Worked example
    Show that the circle S1={(x,y):x2+y2=1}S^1 = \{(x, y) : x^2 + y^2 = 1\} is path-connected.

    Solution.

    1. Write the points by angles. Any two points are p=(cos⁡α,sin⁡α)p = (\cos\alpha, \sin\alpha) and q=(cos⁡β,sin⁡β)q = (\cos\beta, \sin\beta). Every point of the unit circle has an angle.
    2. Define a path. γ(t)=(cos⁡((1−t)α+tβ),sin⁡((1−t)α+tβ))\gamma(t) = (\cos((1 - t)\alpha + t\beta), \sin((1 - t)\alpha + t\beta)). Then γ(0)=p\gamma(0) = p, γ(1)=q\gamma(1) = q, and γ(t)\gamma(t) is on the circle. We move the angle at constant speed from α\alpha to β\beta.
    3. Continuity. Writing ϕ(t)\phi(t) for the angle, ∥γ(t)−γ(s)∥22=2−2cos⁡(ϕ(t)−ϕ(s))=4sin⁡2ϕ(t)−ϕ(s)2\lVert \gamma(t) - \gamma(s) \rVert_2^2 = 2 - 2\cos(\phi(t) - \phi(s)) = 4\sin^2\frac{\phi(t) - \phi(s)}{2}, so the distance is 2∣sin⁡ϕ(t)−ϕ(s)2∣≤∣ϕ(t)−ϕ(s)∣=∣β−α∣ ∣t−s∣2|\sin\frac{\phi(t) - \phi(s)}2| \le |\phi(t) - \phi(s)| = |\beta - \alpha|\,|t - s|. The inequality ∣sin⁡u∣≤∣u∣|\sin u| \le |u| turns this into a bound by ∣t−s∣|t - s|, so δ=ε/(∣β−α∣+1)\delta = \varepsilon / (|\beta - \alpha| + 1) works.

    Answer. The circle is path-connected, hence connected. ■\blacksquare

    Quick checkWhich statement is a theorem?

    Open connected sets of Rn\mathbb R^n are path-connected

    Connected and path-connected differ for strange sets. For the open sets we use (balls, regions where a function is defined), they agree.

    Theorem B standard; Apostol Sec. 10.10

    Open connected sets in R^n are path-connected

    Let U⊆RnU \subseteq \mathbb R^n be open and connected (with the usual distance). Then UU is path-connected.

    In one lineIf U⊆RnU \subseteq \mathbb R^n is open and connected, then any two points of UU can be joined by a path in UU.

    Why it is trueThe set of points reachable from a base point is open (a small ball is all reachable by segments) and so is the set of unreachable points, so connectedness forces everything to be reachable.

    Proofstandard
    The idea: Fix p. Let P be the set of points of U that can be reached from p by a path in U. Show that P and its complement in U are both open. Connectedness leaves only P = U.
    Fix p∈Up \in U and let P={x∈U:some path in U goes from p to x}P = \{x \in U : \text{some path in } U \text{ goes from } p \text{ to } x\}. Then p∈Pp \in P, so P≠∅P \ne \varnothing.
    Constant path at pp.
    For each q∈Uq \in U choose r>0r > 0 with B(q,r)⊆UB(q, r) \subseteq U. Then every x∈B(q,r)x \in B(q, r) is joined to qq by the segment from qq to xx, which lies in B(q,r)⊆UB(q, r) \subseteq U.
    UU is open: every point q∈Uq \in U has B(q,r)⊆UB(q, r) \subseteq U. A ball is convex: for x∈B(q,r)x \in B(q, r) and 0≤t≤10 \le t \le 1, ∥q+t(x−q)−q∥=t∥x−q∥<r\lVert q + t(x - q) - q \rVert = t\lVert x - q \rVert < r.
    If q∈Pq \in P, every x∈B(q,r)x \in B(q, r) is also in PP. So PP is open.
    Glue a path from pp to qq with the segment from qq to xx.
    If q∈U∖Pq \in U \setminus P, no x∈B(q,r)x \in B(q, r) is in PP. So B(q,r)⊆U∖PB(q, r) \subseteq U \setminus P and U∖PU \setminus P is open.
    If x∈B(q,r)x \in B(q, r) were in PP, glue the path from pp to xx with the segment from xx back to qq (a segment run backwards is a segment). Then q∈Pq \in P.
    So U∖P=∅U \setminus P = \varnothing and P=UP = U. Every point of UU is joined to pp by a path. Any two points x,yx, y are joined by going through pp: reverse the path from pp to xx, then follow the path from pp to yy. ■\blacksquare
    UU is connected and P≠∅P \ne \varnothing is open and has an open complement in UU: if U∖PU \setminus P were non-empty, PP and U∖PU \setminus P would be a separation of UU.

    Connected but not path-connected

    Beyond the course: for understanding· The topologist's sine curve (B)

    Let G={(x,sin⁡1x):0<x≤1}G = \{(x, \sin\frac1x) : 0 < x \le 1\} be the graph of sin⁡1x\sin\frac1x, and L={(0,y):−1≤y≤1}L = \{(0, y) : -1 \le y \le 1\} the vertical segment it oscillates toward. The topologist’s sine curve is S=G∪LS = G \cup L with the usual distance of the plane. It is connected but not path-connected: you cannot walk from the segment onto the wiggles.

    Lemma B Munkres Thm 23.4

    Closure of a connected set is connected

    If AA is connected and A⊆B⊆A‾A \subseteq B \subseteq \overline A, then BB is connected.

    In one lineIf AA is connected and A⊆B⊆A‾A \subseteq B \subseteq \overline A, then BB is connected.

    Why it is trueA separation of BB would put all of AA on one side, but every point of the other side is a limit of points of AA.

    ProofMunkres 23.4
    The idea: Suppose B has a separation P, Q. The connected set A lies in one of them, say P. A point of Q is in the closure of A, so a ball around it meets A, but the ball can be taken to lie in Q.
    Suppose B=P∪QB = P \cup Q is a separation. Then A⊆PA \subseteq P or A⊆QA \subseteq Q; say A⊆PA \subseteq P.
    The lemma above: a connected subset of BB lies on one side of a separation of BB.
    Then b∈B⊆A‾b \in B \subseteq \overline A. Choose rr with B(b,r)∩B⊆QB(b, r) \cap B \subseteq Q.
    QQ is non-empty. Take b∈Qb \in Q. QQ is open in BB, so there is r>0r > 0 with BB(b,r)⊆QB_B(b, r) \subseteq Q, a ball of the subspace.
    So a∈B(b,r)∩B⊆Qa \in B(b, r) \cap B \subseteq Q and a∈A⊆Pa \in A \subseteq P. Then a∈P∩Q=∅a \in P \cap Q = \varnothing, a contradiction. ■\blacksquare
    b∈A‾b \in \overline A, so the ball B(b,r)B(b, r) contains a point a∈Aa \in A. Also a∈A⊆Ba \in A \subseteq B.
    Proposition B standard; Munkres Sec. 24

    The topologist's sine curve

    (a) SS is connected. (b) SS is not path-connected.

    In one lineS=G∪LS = G \cup L is connected, but there is no path in SS from (0,0)(0, 0) to (1,sin⁡1)(1, \sin 1).

    Why it is trueGG is connected and every point of LL is a limit of points of GG. A path that leaves LL would have to oscillate between +1+1 and −1-1 infinitely often right after leaving, which no continuous second coordinate can do.

    ProofMunkres Sec. 24
    The idea: (a) G is the continuous image of the interval (0, 1], so connected; L lies in the closure of G; apply the lemma. (b) Take the last time a path is on L and look at what the path does right after it.
    (a) GG is the image of (0,1](0, 1] under this continuous map, so GG is connected.
    t↦(t,sin⁡1t)t \mapsto (t, \sin\frac1t) is continuous on (0,1](0, 1]: the distance in the plane is at most ∣t−s∣+∣sin⁡1t−sin⁡1s∣|t - s| + |\sin\frac1t - \sin\frac1s|, since a2+b2≤∣a∣+∣b∣\sqrt{a^2 + b^2} \le |a| + |b|, and sin⁡1t\sin\frac1t is continuous for t>0t > 0. (0,1](0, 1] is an interval, so connected.
    Every point (0,y)(0, y) of LL is the limit of the points (xn,y)∈G(x_n, y) \in G, so L⊆G‾L \subseteq \overline G.
    For −1≤y≤1-1 \le y \le 1 choose θ∈[−π2,π2]\theta \in [-\frac\pi2, \frac\pi2] with sin⁡θ=y\sin\theta = y and put xn=1/(θ+2πn)x_n = 1/(\theta + 2\pi n) for nn large enough that θ+2πn>1\theta + 2\pi n > 1. Then xn→0x_n \to 0 and sin⁡1xn=y\sin\frac1{x_n} = y.
    By the lemma on closures, SS is connected.
    G⊆SG \subseteq S by definition, and S=G∪L⊆G‾S = G \cup L \subseteq \overline G because G⊆G‾G \subseteq \overline G and L⊆G‾L \subseteq \overline G. So the lemma applies with A=GA = G and B=SB = S.
    Let Z={t:γ1(t)=0}Z = \{t : \gamma_1(t) = 0\}. It contains 00, not 11, and it is closed (a limit of times in ZZ is in ZZ by continuity of γ1\gamma_1). Let t∗=sup⁡Zt^* = \sup Z. Then t∗∈Zt^* \in Z and t∗<1t^* < 1.
    (b) By contradiction. Suppose γ=(γ1,γ2):[0,1]→S\gamma = (\gamma_1, \gamma_2) : [0, 1] \to S is a path from (0,0)(0, 0) to (1,sin⁡1)(1, \sin 1). Each coordinate is continuous, since ∣γi(t)−γi(s)∣|\gamma_i(t) - \gamma_i(s)| is at most the distance between γ(t)\gamma(t) and γ(s)\gamma(s).
    For t∈(t∗,1]t \in (t^*, 1], γ1(t)>0\gamma_1(t) > 0 and γ2(t)=sin⁡1γ1(t)\gamma_2(t) = \sin\frac{1}{\gamma_1(t)}.
    After t∗t^* the path is off LL, so on the graph GG: γ2(t)=sin⁡(1/γ1(t))\gamma_2(t) = \sin(1/\gamma_1(t)) with γ1(t)>0\gamma_1(t) > 0.
    Choose η>0\eta > 0 with t∗+η≤1t^* + \eta \le 1 so that ∣γ2(t)−γ2(t∗)∣<1|\gamma_2(t) - \gamma_2(t^*)| < 1 for all t∈[t∗,t∗+η]t \in [t^*, t^* + \eta]. Let m=γ1(t∗+η)>0m = \gamma_1(t^* + \eta) > 0.
    Continuity of γ2\gamma_2 at t∗t^* with ε=1\varepsilon = 1.
    Choose kk so large that v=1/(π2+2πk)v = 1/(\frac\pi2 + 2\pi k) and v′=1/(3π2+2πk)v' = 1/(\frac{3\pi}2 + 2\pi k) are both at most mm. There are times t,t′∈(t∗,t∗+η]t, t' \in (t^*, t^* + \eta] with γ1(t)=v\gamma_1(t) = v and γ1(t′)=v′\gamma_1(t') = v'.
    The intermediate value theorem for γ1\gamma_1 on [t∗,t∗+η][t^*, t^* + \eta], where it goes from 00 to mm: it takes every value in (0,m](0, m].
    Then γ2(t)=1\gamma_2(t) = 1 and γ2(t′)=−1\gamma_2(t') = -1. Both are within 11 of γ2(t∗)\gamma_2(t^*), but 11 and −1-1 are 22 apart, so no number is within 11 of both. Contradiction. ■\blacksquare
    sin⁡(π2+2πk)=1\sin(\frac\pi2 + 2\pi k) = 1 and sin⁡(3π2+2πk)=−1\sin(\frac{3\pi}2 + 2\pi k) = -1.

    In words: right after a path leaves the vertical segment it must keep oscillating between the top and the bottom, and a continuous function cannot do that on a shrinking window. The set is in one piece (no fence) but there is no road.

    Examples and non-examples

    Worked example
    Is A={(x,y):xy≠0}A = \{(x, y) : xy \ne 0\} connected?

    Solution.

    1. Describe AA. AA is the plane without the two axes: the four open quadrants. xy≠0xy \ne 0 means x≠0x \ne 0 and y≠0y \ne 0.
    2. Try the cut. Let U={(x,y)∈A:x>0}U = \{(x, y) \in A : x > 0\} and V={(x,y)∈A:x<0}V = \{(x, y) \in A : x < 0\}. The line x=0x = 0 is removed from AA, so it acts as the gap.
    3. Check the pieces. U=A∩{x>0}U = A \cap \{x > 0\} and V=A∩{x<0}V = A \cap \{x < 0\} are intersections of AA with open half-planes, so they are open in AA. Both are non-empty ((1,1)∈U(1, 1) \in U, (−1,1)∈V(-1, 1) \in V), disjoint, and their union is AA. The lemma on open sets inside a subset: the half-plane x>0x > 0 is open in R2\mathbb R^2, because the ball of radius xx around (x,y)(x, y) stays in it.

    Answer. AA is not connected: it has a separation, and in fact four connected pieces. ■\blacksquare

    Worked example
    Show that a continuous function f:R→Rf : \mathbb R \to \mathbb R that takes only integer values is constant.

    Solution.

    1. Image is connected. R\mathbb R is an interval, so connected; ff is continuous, so f(R)f(\mathbb R) is connected. Continuous image of a connected set.
    2. Image is an interval inside Z\mathbb Z. A connected subset of R\mathbb R is an interval, and f(R)⊆Zf(\mathbb R) \subseteq \mathbb Z. If it contained two integers m<nm < n, it would contain m+12m + \frac12, which is not an integer.
    3. So one point. f(R)f(\mathbb R) has at most one point, and ff is constant. The image is non-empty and has at most one element.

    Answer. ff is constant. ■\blacksquare The same argument shows a continuous function from a connected space to {0,1}\{0, 1\} is constant, which is how topologists phrase “connected” as a property of functions.

    Worked example
    Show that the union of the two coordinate axes, X={(x,y):xy=0}X = \{(x, y) : xy = 0\}, is path-connected, hence connected.

    Solution.

    1. Each axis is a line. The xx-axis {(x,0)}\{(x, 0)\} and the yy-axis {(0,y)}\{(0, y)\} are convex, so any two points on the same axis are joined by the segment, which stays on that axis. A segment between two points of a line lies in the line.
    2. Points on different axes. Take p=(a,0)p = (a, 0) and q=(0,b)q = (0, b). Go from pp along the xx-axis to the origin, then from the origin along the yy-axis to qq. The origin lies on both axes, so it is a meeting point of the two segments.
    3. Glue. The two segments end and start at OO, so gluing gives a path from pp to qq inside XX. The gluing rule from the paragraph above.
    4. Conclude. Any two points of XX are joined by a path in XX, so XX is path-connected, and path-connected sets are connected. The theorem above.

    Answer. XX is path-connected, hence connected. The same idea proves a general fact: two connected sets that share a point have a connected union (a problem below). ■\blacksquare

    Worked example classic
    Show that every continuous f:[0,1]→[0,1]f : [0, 1] \to [0, 1] has a fixed point: a number cc with f(c)=cf(c) = c.

    Solution.

    1. Turn the goal into a zero. Put g(x)=f(x)−xg(x) = f(x) - x. We want g(c)=0g(c) = 0. f(c)=cf(c) = c exactly when g(c)=0g(c) = 0, and the intermediate value theorem finds zeros.
    2. Look at the ends. g(0)=f(0)−0≥0g(0) = f(0) - 0 \ge 0 because f(0)≥0f(0) \ge 0. g(1)=f(1)−1≤0g(1) = f(1) - 1 \le 0 because f(1)≤1f(1) \le 1. ff takes values in [0,1][0, 1], so it cannot be below 00 at the left end or above 11 at the right end.
    3. Apply the theorem. gg is continuous on the connected set [0,1][0, 1], and 00 lies between g(1)g(1) and g(0)g(0). So g(c)=0g(c) = 0 for some cc. The corollary with y=0y = 0. If g(0)=0g(0) = 0 or g(1)=0g(1) = 0 we already have the fixed point.

    Answer. f(c)=cf(c) = c for some c∈[0,1]c \in [0, 1]. ■\blacksquare The recipe “subtract to make a function that must change sign” is the same one used for the equator and the monk.

    Worked example
    Let XX be a connected metric space and x≠yx \ne y two points of it. Show that for every rr with 0<r<d(x,y)0 < r < d(x, y) there is a point z∈Xz \in X with d(x,z)=rd(x, z) = r.

    Solution.

    1. Make a real function. Let h(z)=d(x,z)h(z) = d(x, z), a map X→RX \to \mathbb R. We want to hit the value rr and the theorem is about real-valued functions.
    2. It is continuous. By the reverse triangle inequality, ∣h(z)−h(z′)∣≤d(z,z′)|h(z) - h(z')| \le d(z, z'), so δ=ε\delta = \varepsilon works. The reverse triangle inequality is from 4.1.
    3. Look at two values. h(x)=0h(x) = 0 and h(y)=d(x,y)h(y) = d(x, y), and rr lies strictly between them. That is the hypothesis 0<r<d(x,y)0 < r < d(x, y).
    4. Apply the theorem. XX is connected, so there is zz with h(z)=rh(z) = r. The corollary, on the connected domain XX.

    Answer. Such a zz exists. So hh takes every value in [0,d(x,y)][0, d(x, y)], and a connected metric space with two points is uncountable (a problem below). ■\blacksquare

    Where it is used

    Used inside maths· Inside maths: zero gradient on a connected open set means constant (a preview of Unit 5)

    In 1.4 a function with zero derivative on an interval is constant. In several variables the analogue needs the right kind of domain. Let U⊆RnU \subseteq \mathbb R^n be open and connected, and f:U→Rf : U \to \mathbb R differentiable with ∇f=0\nabla f = 0 at every point. Then ff is constant. The proof uses only two facts from Unit 5: the chain rule, so that g(t)=f(q+t(x−q))g(t) = f(q + t(x - q)) has g′(t)=∇f(q+t(x−q))⋅(x−q)g'(t) = \nabla f(q + t(x - q)) \cdot (x - q), and the 1.4 result that a function with zero derivative is constant.

    Theorem B standard; the chain rule is in Apostol Sec. 8.20

    Zero gradient on a connected open set means constant

    Let U⊆RnU \subseteq \mathbb R^n be open and connected, and f:U→Rf : U \to \mathbb R differentiable with ∇f=O\nabla f = O on UU. Then ff is constant.

    In one lineIf U⊆RnU \subseteq \mathbb R^n is open and connected and ff is differentiable on UU with ∇f=O\nabla f = O everywhere, then ff is constant on UU.

    Why it is trueThe set where ff equals its value at one point is closed (continuity) and open (a segment inside a small ball, with zero derivative along it), so it is all of UU by connectedness.

    Proofstandard
    The idea: Let S be the set of points where f takes the value c = f(p). Show S is open using the segments in a ball (derivative zero along a segment), and closed because f is continuous. A nonempty clopen subset of a connected set is everything.
    Let c=f(p)c = f(p) and S={x∈U:f(x)=c}S = \{x \in U : f(x) = c\}.
    Fix a point p∈Up \in U. SS contains pp, so S≠∅S \ne \varnothing.
    U∖S=f−1(R∖{c})U \setminus S = f^{-1}(\mathbb R \setminus \{c\}) is open in UU, so SS is closed in UU.
    ff is differentiable, so continuous (1.4 in one variable; the same in several variables, Unit 5). R∖{c}\mathbb R \setminus \{c\} is open, so the preimage under ff is open in UU by the lemma on preimages.
    Let q∈Sq \in S and x∈B(q,r)⊆Ux \in B(q, r) \subseteq U. Put g(t)=f(q+t(x−q))g(t) = f(q + t(x - q)) for t∈[0,1]t \in [0, 1].
    UU is open: choose rr with B(q,r)⊆UB(q, r) \subseteq U. For x∈B(q,r)x \in B(q, r) the segment from qq to xx stays in the ball (balls are convex).
    g′(t)=∇f(q+t(x−q))⋅(x−q)=0g'(t) = \nabla f(q + t(x - q)) \cdot (x - q) = 0 for all tt.
    Chain rule, then ∇f=O\nabla f = O.
    So g(1)=g(0)g(1) = g(0), that is, f(x)=f(q)=cf(x) = f(q) = c. Hence B(q,r)⊆SB(q, r) \subseteq S and SS is open.
    A function with zero derivative on an interval is constant (1.4).
    By the proposition on clopen sets, S=US = U. ■\blacksquare
    SS is non-empty, open and closed in the connected set UU.

    The connectedness cannot be dropped: on U=(0,1)∪(2,3)U = (0, 1) \cup (2, 3) let f=0f = 0 on (0,1)(0, 1) and f=1f = 1 on (2,3)(2, 3). Then f′=0f' = 0 everywhere on UU but ff is not constant.

    Used in the real world· Image segmentation: counting the pieces of a picture

    A scanned page is stored as a grid of black and white pixels. To read it, an OCR program first cuts it into connected components, one for each blob of touching black pixels: the letter “i” has two components (the stem and the dot), “O” has one. Two pixels count as connected when you can walk from one to the other through black pixels that touch, which is path-connectedness in a space with only finitely many points. The count depends on what “touching” means. For the grid below, where 11 is black, 4-neighbour touching (sharing an edge) gives five components, and 8-neighbour touching (sharing an edge or a corner) gives three, because the pixel in the middle touches two blobs diagonally.

    1 1 0 0 1
    0 1 0 1 1
    0 0 1 0 0
    1 0 0 0 0
    1 1 0 1 1
    Your answerIn the grid above, how many connected components do the black pixels form when two pixels count as touching if they share an edge or a corner (8 neighbours)?
    Used in the real world· Neural networks: a decision boundary lies between any two images

    Let s(x)s(x) be the difference between the score a classifier gives to “cat” and to “dog” for an image xx with pixel values in [0,1][0, 1]. For a network built from continuous layers (matrix multiplications, ReLU, and so on) ss is continuous. The set of images is a cube in Rn\mathbb R^n, which is convex, so path-connected. Take a cat image aa with s(a)>0s(a) > 0 and a dog image bb with s(b)<0s(b) < 0. The function t↦s((1−t)a+tb)t \mapsto s((1 - t)a + tb) is continuous on [0,1][0, 1] and changes sign, so by the intermediate value theorem there is an image on the straight segment with s=0s = 0: a decision boundary point exists. Binary search on tt, which is bisection, finds it. Attacks on classifiers that see only the predicted label use this: they repeatedly halve the segment between a correct and a wrong image to land next to the boundary. The existence of the boundary point is the theorem of this chapter. The search works because each halving keeps a sign change.

    Python labFind the equal-temperature pair by bisection
    import numpy as np
    
    rng = np.random.default_rng(1)
    K = 5
    a, b = rng.normal(size=K), rng.normal(size=K)
    
    def T(theta):
        t = sum(a[k]*np.cos((k+1)*theta) + b[k]*np.sin((k+1)*theta) for k in range(K))
        # t = 1.0 if (theta % (2*np.pi)) < np.pi else 0.0   # a temperature with a jump
        return t
    
    def g(theta):
        return T(theta) - T(theta + np.pi)
    
    lo, hi = 0.0, np.pi
    print("g(0) =", round(g(lo), 4), "  g(pi) =", round(g(hi), 4), "  (opposite signs)")
    for _ in range(40):
        mid = (lo + hi) / 2
        if g(lo) * g(mid) <= 0:
            hi = mid
        else:
            lo = mid
    th = (lo + hi) / 2
    print("theta* =", th)
    print("T(theta*)      =", T(th))
    print("T(theta*+pi)   =", T(th + np.pi))

    Try this. First, run it as is and check the last two printed numbers agree. Then change the seed from 1 to 2 and K from 5 to 1: for K = 1 the function T is one sine wave, g is twice T, and the pair is where T is 0. Finally, swap in the broken temperature on the last line of the function T (remove the comment mark in front of it) so that T jumps from 1 to 0. Bisection still converges to a number, but T(theta) and T(theta + pi) now differ by 1. Why does the argument fail? Because a function with a jump is not continuous, and the corollary needs continuity.

    Traps

    Watch out· Connected is not the same as path-connected

    Path-connected implies connected; the converse fails for the topologist’s sine curve. For an open set of Rn\mathbb R^n the two agree. When a problem says “connected”, you may use the theorem about intervals or the clopen test; “path-connected” lets you exhibit a road, which is usually the easier proof of connectedness when it works.

    Watch out· Open in the subset is not open in the whole space

    [0,1][0, 1] is open in the space [0,1]∪[2,3][0, 1] \cup [2, 3] and not open in R\mathbb R. In the definition of separation, “open in AA” means open in the space AA itself, which is why the pieces of [0,1]∪[2,3][0, 1] \cup [2, 3] can be closed intervals. The lemma on open sets inside a subset translates: the pieces are A∩WA \cap W for open WW of the bigger space.

    Watch out· Connected needs one piece, not that the pieces touch

    [0,1]∪(1,2][0, 1] \cup (1, 2] is the interval [0,2][0, 2], connected, though written in two parts: the pieces touch at 11. But [0,1)∪(1,2][0, 1) \cup (1, 2] is not connected, because the common endpoint 11 is missing. Two sets that touch, with the touching point in one of them, join into a connected set (see Problem on unions). Two sets with a missing point between them do not.

    Watch out· The intermediate value theorem needs connected inputs

    A continuous function on [0,1]∪[2,3][0, 1] \cup [2, 3] with f=−1f = -1 on [0,1][0, 1] and f=1f = 1 on [2,3][2, 3] never takes the value 00. The theorem holds for ff on a connected domain. The hypotheses “continuous” and “takes both signs” are not enough.

    Watch out· Do not stretch the intermediate value theorem past connectedness

    A connected set gives you every value between two values, and nothing more. It does not give you a road. The box below shows a problem (two climbers) where knowing a set is connected is not enough and a path is needed.

    Beyond the course: for understanding· The two climbers (B): where connected is not enough

    Two climbers start at the two feet of a mountain range, drawn as a continuous profile f:[0,1]→Rf : [0, 1] \to \mathbb R with f(0)=f(1)=0f(0) = f(1) = 0 and f>0f > 0 in between. Can they move, one from each end, so that at every moment they are at the same height, and meet at the end? Whittaker (1966) gave the problem that name, and Homma (1952) had solved a version of it. For a range with finitely many peaks and valleys they always can, and Whittaker gave a range with infinitely many oscillations where they cannot. The set of pairs of positions (s,t)(s, t) with f(s)=f(t)f(s) = f(t) is a closed set of the square. A route for the climbers is a PATH in that set from (0,1)(0, 1) to a point of the diagonal. Knowing the set is connected, which an intermediate value argument can give, is not enough: you need a road, and that is the difference this chapter has drawn between connected and path-connected. For one peak (rising then falling), the climbers match heights using the inverse of the rising part and the inverse of the falling part, and meet at the summit.

    Problems

    check

    Which of these subsets of R\mathbb R are connected? (a) (0,1)∪{2}(0, 1) \cup \{2\}. (b) [0,1]∪[1,5][0, 1] \cup [1, 5]. (c) R∖{π}\mathbb R \setminus \{\pi\}. (d) {x:x2≤4}\{x : x^2 \le 4\}.

    Solution

    (a) Not connected: x=12x = \frac12, y=2y = 2, z=1.5z = 1.5. (b) Connected: it is [0,5][0, 5]. (c) Not connected: π\pi is missing. (d) Connected: it is [−2,2][-2, 2].

    check

    If f:[0,1]→Rf : [0, 1] \to \mathbb R is continuous with f(0)=3f(0) = 3 and f(1)=−2f(1) = -2, must ff take the value 00? The value 1717?

    Solution

    Yes for 00, because 00 is between −2-2 and 33. Not necessarily for 1717: f(x)=3−5xf(x) = 3 - 5x is continuous with these end values and never reaches 1717.

    check

    Write what ”XX is not connected” says, using the words “open” and “disjoint”.

    Solution

    XX is the union of two disjoint, non-empty, open subsets of XX.

    check

    Is the unit circle {(x,y):x2+y2=1}\{(x, y) : x^2 + y^2 = 1\} connected? Is the circle with the point (1,0)(1, 0) removed connected?

    Solution

    The circle is path-connected (example above), hence connected. Removing (1,0)(1, 0) leaves the points (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta) with 0<θ<2π0 < \theta < 2\pi, the image of the interval (0,2π)(0, 2\pi) under a continuous map, so it is connected.

    use

    Show that cos⁡x=x\cos x = x has a solution in [0,1][0, 1].

    Solution

    Let g(x)=cos⁡x−xg(x) = \cos x - x, continuous on the connected set [0,1][0, 1]. g(0)=1>0g(0) = 1 > 0 and g(1)=cos⁡1−1<0g(1) = \cos 1 - 1 < 0 (since cos⁡1<1\cos 1 < 1). By the corollary, g(c)=0g(c) = 0 for some c∈(0,1)c \in (0, 1).

    use

    Let f:[0,1]→Rf : [0, 1] \to \mathbb R be continuous with f(0)=f(1)f(0) = f(1). Show there is c∈[0,12]c \in [0, \frac12] with f(c)=f(c+12)f(c) = f(c + \frac12).

    Solution

    Let g(c)=f(c+12)−f(c)g(c) = f(c + \frac12) - f(c) on [0,12][0, \frac12]. Then g(0)=f(12)−f(0)g(0) = f(\frac12) - f(0) and g(12)=f(1)−f(12)=f(0)−f(12)=−g(0)g(\frac12) = f(1) - f(\frac12) = f(0) - f(\frac12) = -g(0). So gg takes a value and its negative, hence 00 in between.

    use

    Is A={(x,y)∈R2:x2+y2≠1}A = \{(x, y) \in \mathbb R^2 : x^2 + y^2 \ne 1\} connected? Is it path-connected?

    Solution

    Not connected. U={x2+y2<1}U = \{x^2 + y^2 < 1\} and V={x2+y2>1}V = \{x^2 + y^2 > 1\} are open in the plane (each point has a ball around it inside: radius 1−∥p∥1 - \lVert p \rVert for UU and ∥p∥−1\lVert p \rVert - 1 for VV), non-empty, disjoint, and U∪V=AU \cup V = A. A set that is not connected is not path-connected.

    use

    A function ff on a connected open set U⊆R2U \subseteq \mathbb R^2 has ∂f∂x=0\frac{\partial f}{\partial x} = 0 and ∂f∂y=0\frac{\partial f}{\partial y} = 0 and is differentiable. Is ff constant if UU is the open annulus 1<∥p∥<21 < \lVert p \rVert < 2? If UU is the union of two disjoint discs?

    Solution

    The annulus is open. It is connected because it is the image of the rectangle (1,2)×[0,2π](1, 2) \times [0, 2\pi], which is convex and so connected, under the continuous map (r,θ)↦(rcos⁡θ,rsin⁡θ)(r, \theta) \mapsto (r\cos\theta, r\sin\theta). So ff is constant by the theorem on zero gradient. For two disjoint discs, no: ff can take a different constant value on each disc.

    prove

    Prove: if AA and BB are connected subsets of a metric space and A∩B≠∅A \cap B \ne \varnothing, then A∪BA \cup B is connected.

    Solution

    Plan. Suppose A∪B=P∪QA \cup B = P \cup Q is a separation. Both AA and BB lie on one side, and they share a point, so they lie on the same side.

    By the lemma on connected sets and separations, A⊆PA \subseteq P or A⊆QA \subseteq Q, and B⊆PB \subseteq P or B⊆QB \subseteq Q. Let z∈A∩Bz \in A \cap B. If z∈Pz \in P, then A⊆PA \subseteq P (as AA lies on one side and contains a point of PP) and B⊆PB \subseteq P. Then A∪B⊆PA \cup B \subseteq P, so Q=∅Q = \varnothing, a contradiction. If z∈Qz \in Q the same argument shows P=∅P = \varnothing. So there is no separation. ■\blacksquare

    prove

    Prove: if f:X→Yf : X \to Y is continuous and XX is path-connected, then f(X)f(X) is path-connected.

    Solution

    Plan. Compose paths with ff.

    Let y1=f(x1)y_1 = f(x_1) and y2=f(x2)y_2 = f(x_2) be points of f(X)f(X). Take a path γ\gamma in XX from x1x_1 to x2x_2. Then f∘γ:[0,1]→f(X)f \circ \gamma : [0, 1] \to f(X) is continuous: given ε\varepsilon and tt, continuity of ff at γ(t)\gamma(t) gives η\eta with d(f(x),f(γ(t)))<εd(f(x), f(\gamma(t))) < \varepsilon whenever d(x,γ(t))<ηd(x, \gamma(t)) < \eta, and continuity of γ\gamma at tt gives δ\delta with d(γ(s),γ(t))<ηd(\gamma(s), \gamma(t)) < \eta whenever ∣s−t∣<δ|s - t| < \delta. It goes from y1y_1 to y2y_2. ■\blacksquare

    prove

    Prove that a convex subset of Rn\mathbb R^n is path-connected, and so connected. Deduce that every open ball is connected, and that the punctured line R∖{0}\mathbb R \setminus \{0\} is not convex.

    Solution

    Plan. A convex set contains the segment between any two of its points, and the segment is a path.

    If SS is convex and p,q∈Sp, q \in S, then γ(t)=(1−t)p+tq∈S\gamma(t) = (1 - t)p + tq \in S for all tt. It is continuous because ∥γ(t)−γ(s)∥=∣t−s∣ ∥q−p∥\lVert \gamma(t) - \gamma(s) \rVert = |t - s|\,\lVert q - p \rVert. So SS is path-connected, hence connected. An open ball is convex: for x,y∈B(c,r)x, y \in B(c, r), ∥(1−t)x+ty−c∥≤(1−t)∥x−c∥+t∥y−c∥<r\lVert (1 - t)x + ty - c \rVert \le (1 - t)\lVert x - c \rVert + t\lVert y - c \rVert < r. For R∖{0}\mathbb R \setminus \{0\}: the segment from −1-1 to 11 contains 00. ■\blacksquare

    prove

    Prove: every connected subset of Q\mathbb Q has at most one point, using only the theorem on connected subsets of the line.

    Solution

    Plan. Two points of the subset would force an interval inside Q\mathbb Q.

    Suppose C⊆QC \subseteq \mathbb Q is connected with x<yx < y in CC. Then CC is a connected subset of R\mathbb R, so an interval, so (x,y)⊆C⊆Q(x, y) \subseteq C \subseteq \mathbb Q. But (x,y)(x, y) contains the irrational number x+2nx + \frac{\sqrt2}{n} for nn so large that 2n<y−x\frac{\sqrt2}n < y - x. That number is not in Q\mathbb Q, a contradiction. ■\blacksquare

    proveMATH 375 style (Apostol 8.3)

    Show that {(x,y):y>x2}\{(x, y) : y > x^2\} is open and connected. Is it path-connected?

    Solution

    Plan. It is a convex open set.

    Open: the function F(x,y)=y−x2F(x, y) = y - x^2 is continuous, and the set is F−1((0,∞))F^{-1}((0, \infty)), open by the lemma on preimages (4.5 shows how to see this for functions of two variables). Convex: if y1>x12y_1 > x_1^2 and y2>x22y_2 > x_2^2 then for 0≤t≤10 \le t \le 1, (1−t)y1+ty2>(1−t)x12+tx22≥((1−t)x1+tx2)2(1-t)y_1 + ty_2 > (1-t)x_1^2 + tx_2^2 \ge ((1-t)x_1 + tx_2)^2, because x↦x2x \mapsto x^2 is convex: (1−t)x12+tx22−((1−t)x1+tx2)2=t(1−t)(x1−x2)2≥0(1-t)x_1^2 + tx_2^2 - ((1-t)x_1 + tx_2)^2 = t(1-t)(x_1 - x_2)^2 \ge 0. So the segment stays in the set, which is path-connected, hence connected. ■\blacksquare

    stretch

    Prove that a continuous injective function f:[0,1]→Rf : [0, 1] \to \mathbb R is strictly monotone.

    Solution

    Plan. Move two pairs of points toward each other and watch that the difference of values never reaches 00.

    Since ff is injective, f(0)≠f(1)f(0) \ne f(1). Say f(0)<f(1)f(0) < f(1) (otherwise replace ff by −f-f). Let x<yx < y in [0,1][0, 1]. For t∈[0,1]t \in [0, 1] put p(t)=txp(t) = tx and q(t)=(1−t)+tyq(t) = (1 - t) + ty. Then q(t)−p(t)=(1−t)+t(y−x)>0q(t) - p(t) = (1 - t) + t(y - x) > 0, so p(t)≠q(t)p(t) \ne q(t), and φ(t)=f(q(t))−f(p(t))\varphi(t) = f(q(t)) - f(p(t)) is never 00 by injectivity. It is continuous (compositions of continuous maps), on the connected set [0,1][0, 1]. φ(0)=f(1)−f(0)>0\varphi(0) = f(1) - f(0) > 0. If φ(1)=f(y)−f(x)\varphi(1) = f(y) - f(x) were negative, the intermediate value theorem would give a zero of φ\varphi. So f(y)>f(x)f(y) > f(x). Hence ff is strictly increasing. ■\blacksquare

    stretch

    Prove that a connected metric space with at least two points is uncountable.

    Solution

    Plan. The distance from one fixed point is a continuous function with an interval for its image.

    Let x≠yx \ne y in XX, and h(z)=d(x,z)h(z) = d(x, z). By the reverse triangle inequality (4.1 problems), ∣h(z)−h(z′)∣≤d(z,z′)|h(z) - h(z')| \le d(z, z'), so hh is continuous (δ=ε\delta = \varepsilon). The image h(X)h(X) is connected, so an interval, and contains h(x)=0h(x) = 0 and h(y)=d(x,y)>0h(y) = d(x, y) > 0, hence contains [0,d(x,y)][0, d(x, y)]. This interval is uncountable, and hh maps XX onto a set containing it, so XX is uncountable (a countable set has a countable image). ■\blacksquare

    Summary

    • A separation of a set is a splitting into two disjoint, non-empty pieces, each open in the set itself. A set is connected if it has none, equivalently if its only clopen subsets are the empty set and the whole set.
    • The connected subsets of the line are exactly the intervals. The proof is the supremum argument of 1.3: a separation of an interval would need a last point of the left piece, which belongs to neither piece.
    • A continuous map sends connected sets to connected sets, because it pulls open sets back to open sets. The intermediate value theorem is the special case where the image lies in R\mathbb R.
    • Path-connected (any two points joined by a continuous path) implies connected. Convex sets and balls are path-connected, the punctured plane is path-connected, and the punctured line is not connected.
    • For open sets of Rn\mathbb R^n, connected and path-connected are the same. In general they differ: the topologist’s sine curve is connected, with no path onto its wiggles (B).
    • Zero gradient on a connected open set means constant; connectedness is what carries the information between different pieces, and it fails for two separate discs.
    • Counting connected components is how images are segmented, and the existence of a decision boundary between two classes follows from the intermediate value theorem.

    Where this sits

    Comes from
    4.1 Metric and normed spaces; open and closed sets
    4.2 Convergence, completeness and the contraction mapping theorem
    1.3 Limits and continuity with epsilon and delta
    Leads to
    4.5 Continuity between metric spaces
    Same idea elsewhere
    MATH 375: Apostol 8.3 asks for sets in $\mathbb R^n$ that are open, and 375 never asks whether they are in one piece. The statement 'a function with zero gradient on an open set is constant' needs the open set to be connected. 375 states the version for balls and boxes; this chapter proves what 'one piece' must mean.
    MATH 521: 521 proves that the connected subsets of $\mathbb R$ are the intervals and deduces the intermediate value theorem from it. Everything in the first three sections of this chapter is that lecture.
    MATH 551: Topology defines connected, path-connected and the components of a space using only open sets, exactly as here. The separation of the topologist's sine curve is the standard example that the two notions differ.
    CS 240 / graphs: A graph is connected when you can walk from any vertex to any other. That is path-connected for a discrete space. 'Connected components' of a graph, and of the pixels of an image, count the pieces.