Positive semi-definite conditional covariance matrix Let $X$ be an $n\times m$ random matrix, where each entry is a real square integrable random variable on the probability space $(\Omega,\mathcal A,P)$. Consider the following matrix:
$$E[XX'\mid\mathcal F],$$ where $\mathcal F$ is a sub-$\sigma$ algebra of $\mathcal A$. If $a\in\mathbb{R}^{n}$, then from the linearity of conditional expectations we have
$$a'E[XX'\mid\mathcal F]a=E[(a'X)^2\mid\mathcal F]\geq 0 \quad P\text{-almost surely,}$$
but the null set might depend on $a$. Can I find a version of $E[XX'\mid\mathcal F]$ which is positive semi-definite almost surely?

The null set might depend on $a$, and therefore let
$$
a'E[XX'|\mathcal F]a=E[(a'X)^2|\mathcal F]\geq 0,
$$
on the set $L_a$, where $P(L_a^c)=0$. Now consider all rational numbers $\mathbf{Q}$, and for each $a\in \mathbf{Q}^n$ you will have an $L_a$, also note that
$$
P(\cup_{a \in \mathbf{Q}^n} L_a^c) \leq \sum_{a \in \mathbf{Q}^n} P(L_a^c)=0,
$$
Therefore $P(\cap_{a \in \mathbf{Q}^n} L_a) =1$. Define $L:=\cap_{a \in \mathbf{Q}^n} L_a$. For each fixed $\omega\in L$,
$$
a'E[XX'|\mathcal F]a\geq 0
$$
for all $a \in \mathbf{Q}^n$. Now take any number $x\in \mathbb{R}^n$ and let $a_n$ be a sequence of rationals (vector) converging to $x$. By the previous argument for each fixed $\omega\in L$,
$$
a_n'E[XX'|\mathcal F]a_n\geq 0.
$$
Now taking the limit $n \to \infty$,
$$
x'E[XX'|\mathcal F]x\geq 0.
$$
