Fix a probability space $(\Omega,\mathcal A, P)$, and let $\mathcal F$ be a sub-$\sigma$-algebra of $\mathcal A$. Let $\mathcal L^0(\mathcal F)$ denote the set of all $\mathcal F$-measurable real random variables on $(\Omega,\mathcal A, P)$, and let
$$\mathcal L^+:=\{X\in \mathcal L^0(\mathcal A):\|X\|_{\mathcal F}<\infty \,\,P\text{-almost surely}\}$$
with the definition $\|X\|_{\mathcal F}:=E[X^2|\mathcal F]^{1/2}$ using the extended conditional expectation. From the conditional Minkowski's inequality and the pull-out property of conditional expectations, we have that $W_1X_1+W_2X_2\in \mathcal L^+$ whenever $X_1,X_2\in \mathcal L^+$ and $W_1,W_2 \in\mathcal L^0(\mathcal F)$.
For $\mathcal S\subset \mathcal L^+$ define
$$\text{span}_{\mathcal L^0} (\mathcal S):=\bigg\{\sum_{i=1}^n W_iX_i: X_i\in \mathcal S, W_i\in \mathcal L^0(\mathcal F), n\in\mathbb N\bigg\}$$
Proposition. Let $Y,X_1,\dots,X_k \in \mathcal L^+$. There exists $X_0 \in \text{span}_{\mathcal L^0} (\{X_1,\dots,X_k\})$ such that
$$\|Y-X_0\|_{\mathcal F}\leq \|Y-X\|_{\mathcal F} \quad P\text{-almost surely} \quad (1)$$
for all $X\in\text{span}_{\mathcal L^0} (\{X_1,\dots,X_k\})$. Moreover such $X_0$ is $P$-almost surely unique.
My attempt:
Let $Z:=(Y,X_1,\dots,X_k)$ and let $\kappa_{Z,\mathcal F}$ be a regular conditional distribution of $Z$ given $\mathcal F$. From the properties of regular conditional distributions we have
$$E[Y^2|\mathcal F](\omega)=\int y^2 \kappa_{Z,\mathcal F}(\omega,dz)<\infty $$
$$E[X_i^2|\mathcal F](\omega)=\int x_i^2 \kappa_{Z,\mathcal F}(\omega,dz)<\infty \quad i=1,\dots,k$$
for $P$-almost all $\omega$. Let $N$ be a $P$-null set outside of which the above holds. For $\omega \in \Omega \setminus N$ we have that $y,x_1,\dots,x_k\in \mathcal L^2(\mathbb R^{k+1},\mathcal B(\mathbb R^{k+1}),\kappa_{Z,\mathcal F}(\omega,\cdot))$, and since $\mathcal L^2$ is a Hilbert space the projection theorem implies that there exists $\beta(\omega)\in\mathbb R^k$ such that
$$ \int \big[y-\sum_{i=1}^k \beta_i(\omega)x_i\big]^2 \, \kappa_{Z,\mathcal F}(\omega,dz)=\inf_{b\in\mathbb R^k} \int \big[y-\sum_{i=1}^k b_i x_i\big]^2 \, \kappa_{Z,\mathcal F}(\omega,dz)$$
In fact, from the orthogonality condition for projections, we can choose $\beta(\omega)$ to be
$$ \beta(\omega):= \bigg[\int xx^\top\,\kappa_{Z,\mathcal F}(\omega,dz)\bigg]^+ \bigg[\int xy \,\kappa_{Z,\mathcal F}(\omega,dz)\bigg]$$
where $x:=(x_1,\dots,x_k)^\top$ and $A^+$ denotes the Moore-Penrose inverse of a matrix $A$. This defines $\beta (\omega)$ for $\omega \in \Omega \setminus N$ , and we define $\beta (\omega):=0$ on $N$.
I claim that the map $\beta:(\Omega,\mathcal F)\to (\mathbb R^{k},\mathcal B(\mathbb R^{k}))$ is measurable. This is because
The Moore-Penrose inverse is a measurable function of its entries (see here).
The maps $\omega \mapsto \int xx^\top\,\kappa_{Z,\mathcal F}(\omega,dz)$ and $\omega\mapsto \int xy\,\kappa_{Z,\mathcal F}(\omega,dz)$ are $\mathcal F$-measurable on $\Omega\setminus N$.
Now define $X_0:=\sum_{i=1}^k\beta_iX_i \in \text{span}_{\mathcal L^0} (\{X_1,\dots,X_k\})$. I claim that $X_0$ does what is wanted in $(1)$. Let $X:=\sum_{i=1}^k W_iX_i \in \text{span}_{\mathcal L^0} (\{X_1,\dots,X_k\})$. Using the disintegration property from here and the definition of $\beta$ we get
$$\|Y-X_0\|^2_{\mathcal F}(\omega)= \int \big[y-\sum_{i=1}^k \beta_i(\omega)x_i\big]^2 \, \kappa_{Z,\mathcal F}(\omega,dz)\leq \int \big[y-\sum_{i=1}^k W_i(\omega)x_i\big]^2 \, \kappa_{Z,\mathcal F}(\omega,dz)=\|Y-X\|^2_{\mathcal F}(\omega) $$
for $P$-almost all $\omega$.
Question: Is this correct? How can I show uniqueness?
Thanks a lot for your feedback and help.