Dimension of a topological space equals the supremum of the dimension of open subsets in an open cover 
For a topological space $X$ which is covered by a family of open subsets $\{U_i\}$, show that $\dim(X)=\sup (\dim(U_i))$. 

I understand that $\dim(X)\geq \sup(\dim(U_i))$, so it only suffices to show that $\dim(X)\leq \sup(\dim(U_i))$. Any help is appreciated!
 A: We want to show that if $X$ has a chain $\varnothing\neq Z_0\subsetneq\dots\subsetneq Z_n$ of irreducible subsets, then some $U_i$ contains a chain of irreducible subsets of the same length.
Since $Z_0$ is nonempty, it contains some point $z$. Let $U$ be any of the sets $U_i$ which contains $x$. We claim $Z_j\cap U$ is a chain of irreducible subsets of $U$.
First we check $Z_j\cap U$ is irreducible. Indeed, suppose it's a union of two closed sets $A,B$. Then closures of $\bar A,\bar B$ (closures in $X$) and $Z_j\setminus U$ are three closed sets whose union is $Z_j$, hence one of them is equal to $Z_j$. That can't be $Z_j\setminus U$, so it must be one of the other sets, say $\bar A$. But $\bar A\cap U=A$ since $A$ is closed in $U$, so $Z_j\cap U=A$.
Finally, we have to show that the inclusions $Z_j\cap U\subseteq Z_{j+1}\cap U$ are proper. Otherwise, we would get that $Z_j$ and $Z_{j+1}\setminus U$ cover $Z_{j+1}$, so one of them is equal to $Z_{j+1}$ and that must be $Z_j$ since $z\not\in Z_{j+1}\setminus U$.
