Building a Continuous Map from Closed Pieces
Sometimes a map is easiest to define by separate formulas on different parts of its domain. The key question is whether continuity on each part guarantees continuity of the whole map. For a finite cover by closed sets, it does—provided the formulas agree wherever their pieces overlap. Closedness lets us turn relative closedness into closedness in the whole domain, and finiteness lets us take a finite union of closed sets.
Let \((X,\mathcal{T})\) and \((Y,\mathcal{U})\) be topological spaces. Each subset \(A_i\subseteq X\) is given the subspace topology. Recall that a set \(D\subseteq A_i\) is closed in the subspace \(A_i\) precisely when \(D=A_i\cap F\) for some closed set \(F\subseteq X\). We use the closed-set test for continuity: a map \(g:X\to Y\) is continuous if and only if \(g^{-1}(C)\) is closed in \(X\) for every closed \(C\subseteq Y\). This test follows from the open-preimage definition, since \(g^{-1}(Y\setminus C)=X\setminus g^{-1}(C)\).
The overlap condition is what makes the proposed global map unambiguous: if a point belongs to more than one piece, every formula assigned to it gives the same value. The conclusion does not require \(Y\) to be a metric space, or to satisfy any separation condition.
Proof. Since the \(A_i\) cover \(X\), each \(x\in X\) belongs to at least one \(A_i\). Define \(f(x)=f_i(x)\) for any such \(i\). If \(x\) also belongs to \(A_j\), the overlap assumption gives \(f_i(x)=f_j(x)\), so the definition gives the same value whichever piece is chosen. Thus \(f\) is well-defined. Its restriction to each \(A_i\) is \(f_i\) by construction, and any map with those restrictions must have value \(f_i(x)\) at every \(x\in A_i\); since the pieces cover \(X\), this proves uniqueness.
It remains to prove continuity. Let \(C\subseteq Y\) be closed. For each \(i\), continuity of \(f_i\) implies that \(f_i^{-1}(C)\) is closed in \(A_i\). By the subspace description of closed sets, there is a closed set \(F_i\subseteq X\) such that \(f_i^{-1}(C)=A_i\cap F_i\). Since \(A_i\) is closed in \(X\), the intersection \(A_i\cap F_i\) is closed in \(X\). Finally, using the definition of \(f\) on every piece, we have $$ f^{-1}(C)=\bigcup_{i=1}^{n}f_i^{-1}(C). $$ Each set in this union is closed in \(X\), and the union is finite, so \(f^{-1}(C)\) is closed in \(X\). The closed-set test proves that \(f\) is continuous. If some \(A_i\) is empty, its preimage is empty and the argument is unchanged; if \(X\) is empty, the unique map from \(X\) is continuous by the same test. \(\square\)
Two Adjacent Closed Pieces
The most common case has two pieces. If \(X=A\cup B\), with \(A\) and \(B\) closed in \(X\), continuous maps \(f_A:A\to Y\) and \(f_B:B\to Y\) define a continuous map on \(X\) exactly when they agree on \(A\cap B\). In the “exactly when” statement, the necessity follows because a global map has only one value at each point: its restrictions must agree on the overlap. The lemma proves sufficiency.
Worked Example: Pasting the Two Halves of the Absolute-Value Map
Let \(X=\mathbb{R}\) with its standard topology, let \(Y=\mathbb{R}\) with its standard topology, and take \(A_1=(-\infty,0]\) and \(A_2=[0,\infty)\). Both pieces are closed, and their union is \(\mathbb{R}\). Define \(f_1:A_1\to\mathbb{R}\) by \(f_1(x)=-x\), and \(f_2:A_2\to\mathbb{R}\) by \(f_2(x)=x\). Each is a restriction of a continuous linear function, so each is continuous.
The overlap is \(A_1\cap A_2=\{0\}\). At its only point, \(f_1(0)=-0=0\) and \(f_2(0)=0\), so the formulas agree. The lemma gives a continuous map \(f:\mathbb{R}\to\mathbb{R}\). Its formula is $$ f(x)= \begin{cases} -x,&x\leq 0,\\ x,&x\geq 0. \end{cases} $$ For example, \(f(-3)=-(-3)=3\), \(f(0)=0\), and \(f(3)=3\). In each case the value is \(|x|\), so the pasted map is \(f(x)=|x|\). As a check at the joining point, both formulas give \(0\) at \(x=0\); the overlap condition is satisfied, and continuity follows from the lemma, including at that point.
Worked Example: Joining Two Different Formulas on a Closed Interval
Take \(X=[0,2]\) with its subspace topology from \(\mathbb{R}\), and \(Y=\mathbb{R}\) with its standard topology. Let \(A_1=[0,1]\) and \(A_2=[1,2]\), each with the subspace topology. These are closed in \(X\) and cover \(X\). Define \(f_1(x)=x^2\) on \(A_1\) and \(f_2(x)=2x-1\) on \(A_2\). The first formula is a polynomial and the second is linear, so both restrictions are continuous.
The overlap is \(\{1\}\). Evaluating each formula there gives \(f_1(1)=1^2=1\) and \(f_2(1)=2\cdot1-1=1\). They agree, so the lemma gives a continuous map on all of \([0,2]\). For points in the separate pieces, \(f(1/2)=(1/2)^2=1/4\), while \(f(3/2)=2\cdot(3/2)-1=3-1=2\). At the shared endpoint, either formula gives \(1\). Checking that value again from the resulting piecewise definition confirms the match at the join.
More Than Two Pieces
The theorem allows any finite number of closed pieces; the pieces need not be disjoint. It is enough to check agreement on every pairwise overlap. This includes points in three or more pieces: if all the relevant pairs agree, then every formula chosen at such a point has the same value.
Worked Example: Pasting Three Affine Formulas
Let \(X=[0,3]\) with the subspace topology from \(\mathbb{R}\), and \(Y=\mathbb{R}\) with its standard topology. Use the closed cover \(A_1=[0,1]\), \(A_2=[1,2]\), and \(A_3=[2,3]\). Define $$ f_1(x)=2x,\qquad f_2(x)=x+1,\qquad f_3(x)=3x-3 $$ on \(A_1,A_2,A_3\), respectively. Each formula is affine and hence continuous on its piece.
At the first overlap, \(A_1\cap A_2=\{1\}\), and \(f_1(1)=2\cdot1=2\), while \(f_2(1)=1+1=2\). At the second overlap, \(A_2\cap A_3=\{2\}\), and \(f_2(2)=2+1=3\), while \(f_3(2)=3\cdot2-3=6-3=3\). The first and third pieces do not intersect. Thus all overlap checks pass, and the lemma gives a continuous map on \(X\).
For sample values, \(f(1/2)=2\cdot(1/2)=1\), \(f(3/2)=3/2+1=5/2\), and \(f(5/2)=3\cdot(5/2)-3=15/2-6/2=9/2\). The values from adjacent formulas at the joins are \(2\) at \(1\) and \(3\) at \(2\), as computed above. These checks confirm the endpoint calculations used in the pasting argument.
Why the Hypotheses Matter
The proof identifies exactly where the assumptions enter. The closedness of each piece is needed to promote a set closed relative to that piece to a set closed in \(X\). The finite-cover assumption is needed because a finite union of closed sets is closed; an arbitrary union of closed sets need not be closed. The following examples show that the conclusion can fail if either condition is removed.
Common pitfall: treating relative closedness as absolute closedness. In \(\mathbb{R}\) with its standard topology, let \(A_1=(-\infty,0]\) and \(A_2=(0,\infty)\). These pieces cover \(\mathbb{R}\), but \(A_2\) is not closed in \(\mathbb{R}\). Define \(f_1(x)=0\) on \(A_1\) and \(f_2(x)=1\) on \(A_2\). Each restriction is constant, hence continuous, and there is no overlap to check. The resulting map is \(f(x)=0\) for \(x\leq0\) and \(f(x)=1\) for \(x>0\). The closed set \(\{1\}\subseteq\mathbb{R}\) has preimage \(f^{-1}(\{1\})=(0,\infty)\), which is not closed in \(\mathbb{R}\). Therefore \(f\) is not continuous. The incorrect step would be to say that a set closed relative to \(A_2\) must be closed in \(X\); that implication requires \(A_2\) itself to be closed.
Finiteness also matters. Cover \(\mathbb{R}\) by all its singleton sets \(\{x\}\), each of which is closed in the standard topology, and define \(f(x)=0\) for \(x\leq0\) and \(f(x)=1\) for \(x>0\). The restriction to every singleton is continuous, and agreement on overlaps is automatic because two distinct singletons do not overlap. But \(f\) is not continuous: the open set \((-1/2,1/2)\) has preimage \((-\infty,0]\), which is not open in \(\mathbb{R}\). This is an infinite closed cover, and the preimage obtained by combining the local preimages is an infinite union of closed sets, which need not be closed.
There is one more error to avoid: continuity of the restrictions does not replace the overlap condition. If two pieces share a point but their formulas assign different values there, no single function can have both restrictions. First check that the local definitions give one well-defined value at every point; then apply the continuity argument.
Check Your Understanding
For each question, identify the cover and check whether the hypotheses of the lemma hold before drawing a conclusion.
- On \([-1,1]\), use the closed pieces \([-1,0]\) and \([0,1]\). Define \(f_1(x)=x+2\) on the first and \(f_2(x)=2-x\) on the second. Do the formulas agree on the overlap, and what does the lemma imply?
- Why does the proof use the fact that each \(A_i\) is closed when it concludes that \(f_i^{-1}(C)\) is closed in \(X\)?
- Give an example of two continuous maps on closed subsets that cover a space but do not define a single map because they disagree on the overlap.
- For the three-piece example above, verify directly that the formulas agree at each point shared by two pieces.
- Explain which step of the continuity proof fails if a finite closed cover is replaced by an infinite closed cover.