Product of connected spaces - Proof

I'm working on the "iff"-relation given by:

$X=\prod_{i\in I}X_i$ is connected iff each $X_i$ non-empty is connected for all $i\in I$.

I could prove the "$\Rightarrow$"-direction very easyly. I also proved that a finite product of connected spaces is connected. Now i want to prove the following:

  • Choose $z=(z_i)\in\prod_{i\in I}X_i$. For every finite subset $J\subset I$ is the set $X_J:=\left\{x\in X:x_i=z_i\ \forall I-J\right\}$ connected.

I have given the follwoing proof: This set is homeomorphic with a finite product $\prod_{j\in J}X_j$ given by the map defined by: $x=(x_j)_{j\in J}$ mapped on $y=(y_i)_{i\in I}$ such that $y_j=x_j$ if $j\in J$ and $y_j=z_j$ if $j\notin J$. This mapping is continuous and injective (and also the inverse is continous since it is the projection map). But then we know that $X_J$ is connected since every finite product is connected (if the components are connected).

Is this proof correct? The only thing i have to prove now is that $Y=\cup_{J\subset I,J\ finite}X_J$ is dense in X. How do I do that? Can someone help? Thank you


What you've done so far looks good. As you note correctly, it suffices to show that the set $Y=\bigcup_{J⊂I, J\text{ finite}}X_J$, which can also be described as $\{y\in X;\ y(i)=z(i)\textrm{ for almost all }i\in I\}$ is dense, since this means that $X=\overline Y$ and is thus connected, being the closure of the connected set $Y$. In order to do this, let $U=p^{-1}_{j_1}(U_{j_1})\cap\dots\cap p^{-1}_{j_n}(U_{j_n})$ be an open basis set. Now choose a $y$ such that $y(j)=p_j(y)\in U_j\ \forall j\in\{j_1,\dots,j_n\}$ and otherwise $y(i)=z(i)$. Then $y\in Y\cap U.$