[step:Verify every chain in $\mathcal{P}$ has an upper bound]
Let $\mathcal{C} = \{(h_i, Z_i)\}_{i \in I}$ be a chain in $(\mathcal{P}, \preceq)$. Define
\begin{align*}
Z &:= \bigcup_{i \in I} Z_i, \\
h: Z &\to \mathbb{R}, \qquad h(z) := h_i(z) \text{ if } z \in Z_i.
\end{align*}
We check that $(h, Z) \in \mathcal{P}$ and dominates every $(h_i, Z_i)$.
**$Z$ is a subspace.** Given $z_1, z_2 \in Z$ and scalars $\lambda_1, \lambda_2 \in \mathbb{R}$, there are $i_1, i_2 \in I$ with $z_k \in Z_{i_k}$. Since $\mathcal{C}$ is a chain, either $Z_{i_1} \subseteq Z_{i_2}$ or $Z_{i_2} \subseteq Z_{i_1}$; without loss of generality the former, so both $z_1, z_2 \in Z_{i_2}$ and hence $\lambda_1 z_1 + \lambda_2 z_2 \in Z_{i_2} \subseteq Z$.
**$h$ is well-defined.** If $z \in Z_i \cap Z_j$, by the chain condition one of $Z_i, Z_j$ is contained in the other, say $Z_i \subseteq Z_j$. Since $(h_i, Z_i) \preceq (h_j, Z_j)$, we have $h_j|_{Z_i} = h_i$, so $h_j(z) = h_i(z)$.
**$h$ is linear.** For $z_1, z_2 \in Z$, find $i \in I$ with $z_1, z_2 \in Z_i$ as above; linearity follows from linearity of $h_i$.
**$h|_Y = g$.** For $y \in Y \subseteq Z_i$ for any $i$, $h(y) = h_i(y) = g(y)$.
**$h \le p$ on $Z$.** For $z \in Z$, choose $i$ with $z \in Z_i$; then $h(z) = h_i(z) \le p(z)$ since $(h_i, Z_i) \in \mathcal{P}$.
Hence $(h, Z) \in \mathcal{P}$, and by construction $(h_i, Z_i) \preceq (h, Z)$ for every $i$.
[/step]