Union of Functions Theorem/Corollary

Theorem
Let $X$ be a set.

Let $\sequence {X_i: i \in \N}$ be an exhausting sequence of sets on $X$.

For each $i \in \N$, let $g_i: X_i \to Y$ be a mapping such that:
 * $g_{i + 1} \restriction X_i = g_i$

where $g_{i + 1} \restriction X_i$ denotes the restriction of $g_{i + 1}$ to $g_i$. For each $i \in \N$, let $g_i : X_i \to Y$ be invertible.

Then $\ds \bigcup \set {g_i: i \in \N}$ is invertible and:
 * $\ds \paren {\bigcup \set {g_i: i \in \N} }^{-1} = \bigcup \set {g_i^{-1}: i \in \N}$