Openness condition in Seifert-van Kampen Theorem I'm starting to learn some algebraic topology now, and came across the "classical" version of the Seifert-van Kampen theorem, whose statement is given in Theorem $4.5.2,$ on page $69$ here.

If $X = U_1 \cup U_2$ with $U_1, U_2$ open, and $U_1, U_2, U_1 \cap U_2$ path connected, and if $x_0 \in U_1 \cap U_2$ then $\pi_1(X,x_0) = \pi_1(U_1,x_0)\ *_{\pi_1(U_1 \cap U_2,x_0)} \ \pi_1(U_2,x_0)$, where the amalgamation is defined via the maps induced by inclusions.

(The statement of the theorem in the link said $X = U_1 \cap U_2$, but as Michael correctly pointed out below, this should be $X = U_1 \cup U_2$.)
Does this theorem still hold if $U_1, U_2$ are both closed in $X$ instead$?$ It probably doesn't $($else it would have been mentioned somewhere...$)$, but I don't see a counterexample.
 A: Take $U_1 \cap U_2$ to be the Alexander horned sphere. Let the $U_i$ be the closures of the two components of its complement. As mentioned on the Wikipedia page, one is homeomorphic to the 3-ball, and one is not simply connected. So if there was a van Kampen theorem of this sort, then $\pi_1(U_1 \cup U_2) = \pi_1(S^3)$ would not be zero, which is nonsense.
I suspect if you look at the proof of van Kampen, it should be clear where you need openness.
A: The proof of the Seifert-van Kampen Theorem theorem is dependent on the Lebesgue covering lemma:  If $Y$ is a compact metric space, then for any open cover $\mathcal V$ of $Y$ there is a real number $r>0$ such that for all $y\in Y$ the open ball $B(y,r)$ is contained in a set of $\mathcal V$. This enables us easily to prove that if $a: [0,1] \to X$ is a path in $X$ and $\mathcal U$ is a cover of $X$ by open sets then there is a subdivision $a=a_1+\cdots +a_n$ of $a$, i.e. a finite subdivision,  such that the image of each $a_i$ is contained in a set of $\mathcal U$. (Apply the lemma to the case $Y=[0,1]$  and $\mathcal V$ consists of the sets $a^{-1}(U)$ for $U \in \mathcal U$. Another part of the proof involves a map $I^2 \to X.$) For the details of the proof of a version for the fundamental groupoid $\pi_1(X,A)$ on a set $A$ of base points, see this paper.  
