Approximation by orthogonal polynomials of real functions in Hilbert space Is it possible to assert in the Hilbert space of real functions, if two orthogonal real functions on the interval are approximated by polynomials, then the polynomials are also orthogonal (according to the principle of minimizing properties of Fourier coefficients).
In other words, will finite series of orthogonal polynomials be orthogonal to each other if they approximate orthogonal real functions.
i.e., will finite series of orthogonal polynomials themselves be orthogonal polynomials if they approximate orthogonal real functions in Hilbert space.
Or they will endlessly strive for these orthogonal functions, and they themselves will not be orthogonal.
What can we say about the zeros of finite series of polynomials that approximate orthogonal real functions with Hilbert space.
Will they all be simple and real by the theorem on zeros of orthogonal polynomials.
Comment
Thank you, I realized where I was wrong, of course, I did not formulate it exactly, I just a view of sum  like polynomials now I realized that these are not polynomials, but just a finite sum of infinite sums.
That's what I meant.
In a separable, of course, Hilbert space $H=L^2(a,b)_r$ of real functions summable with a square on the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$ there exists a complete orthonormal basis $\{\phi_n\}_{n=1}^{\infty}$ then any function in $H$ will be defined by its Fourier series $f=\sum_{k=1}^{\infty}c_k\phi_k$ , of course, $c_k= \frac{(f,\phi_k)}{\parallel\phi_k\parallel^2}$ and $f\in \mathbb{R}$
Thus, $|f-\sum_{k=1}^{N}c_k\phi_k|\rightarrow0$ when $N\rightarrow\infty$
This is the sum $\sum_{k=1}^{N}c_k\phi_k$ I mistakenly counted as a polynomial, although it will become a polynomial only if we present in turn $\phi_k=\sum_{n=0}^{\infty}a_nx^n$
Then the polynomial will be the following double sum $\sum_{k=1}^{N}c_k\sum_{n=0}^{M}a_nx^n$
such that $|f-\sum_{k=1}^{N}c_k\sum_{n=0}^{M}a_nx^n|\rightarrow0$ when $N\rightarrow\infty$ and $M\rightarrow\infty$
Let us now have a countable number of linearly independent functions $\{f(\lambda_m,x)\}_{m=1}^{\infty}\in H$ where $\lambda_m\in\mathbb{Q}$ on the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$
Of course we can get a second complete orthonormal system $\{g_m(x)\}_{m=1}^{\infty}\in H$ by the Gram-Schmidt procedure
But then $|g_m(x)-\sum_{k=1}^{N}c_{km}\sum_{n=0}^{M}a_nx^n|\rightarrow0$ when $N\rightarrow\infty$ and $M\rightarrow\infty$ on any $(a,b)\in \mathbb{R}$
Now let $g_1(x)$ has simple real zeros of course on the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$ and $g_2(x)$ has simple real zeros of course on the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$ with the exception of $(a,b)_k$ where $g_2(x)$ has two complex zeros
Consider both functions $g_1(x)$ and $g_2(x)$ on the interval $(a,b)_k$
Let $P_1(x)=P_M(g_1(x))=\sum_{k=1}^{N}c_{k1}\sum_{n=0}^{M}a_nx^n$ and $P_2(x)=P_M(g_2(x))=\sum_{k=1}^{N}c_{k2}\sum_{n=0}^{M}a_nx^n$ are polynomals of degree M
Then clearly $P_1(x)$ has simple real zeros on $(a,b)_k$ and $P_2(x)$ has two complex zeros on $(a,b)_k$
But $(P_1(x),P_2(x))\rightarrow\int_{a_k}^{b_k}g_1(x)g_2(x)dx=0$ when $N\rightarrow\infty$ and $M\rightarrow\infty$
So $P_1(x)\bot P_2(x)$ on $(c,d)$ but in this case $P_2(x)$ should also have simle real zeros on $(a,b)_k$
Thus if $\{g_m(x)\}_{m=1}^{\infty}$ is complete orthonormal system in $H=L^2(a,b)_r$ and one of $g_m(x)$ has simple real zeros on the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$
then all other $g_m(x)$ has simple real zeros oon the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$
Of course, we had to require that both functions belong not only to a Hilbert space $H=L^2(a,b)_r$, but to a countable set of linearly independent functions $\{f(\lambda_m,x)\}_{m=1}^{\infty}\in H$ where $\lambda_m\in\mathbb{Q}$ on the each interval $(a,b)\in\{(a,b)_r\}_{r=1}^{\infty}\in\mathbb{R}$.
But this was the question of whether it is possible to assume such a thing and, if possible, in what case.
Thank you again for the detailed answer, which led me to a more correct formulation of the condition for the presence of simple real zeros in real functions.
 A: Let $p_n(x)$ be a system of orthonormal polynomials, say in $L^2(\mu)$ for some measure such that $$\int\limits_{\mathbb{R}}x^{2k}\,dx<\infty,\qquad k\ge 0$$
Assume also that the polynomials are dense in $L^2(\mu).$ This is the case when the support of $\mu$ is a bounded subset of the real line. It is also true if the measure $\mu$ is determinate, which means the moments $m_n=\int x^nd\mu(x)$ determine the measure.
We assume that $p_n$ are obtained from the sequence of monomials $\{x^m\}_{m=0}^\infty$ by the Gram-Schmidt procedure. For  $f,g\in L^2(\mu)$ and $f\perp g$ Let
$$P_n(f)=\sum_{k=0}^n\langle f,p_k\rangle p_k,\qquad P_n(g)=\sum_{k=0}^n\langle g,p_k\rangle p_k$$ The polynomials $P_n(f)$ and $P_n(g)$ are not always orthogonal. Indeed
$$\langle P_n(f),P_n(g)\rangle =\sum_{k=0}^n \langle f,p_k\rangle\langle g,p_k\rangle\underset{n}{\longrightarrow} \int\limits_{\mathbb{R}} f(x)g(x)d\mu(x)=0 $$
But if $\langle f,p_0\rangle \neq 0$ and $\langle g,p_0\rangle\neq 0,$ then $P_0(f) $ is not orthogonal to $P_0(g).$ The conclusion may hold. For example, assume the measure $\mu $ is symmetric with respect to the origin. If $f$ is an even function, while $g$ is odd, then if $f\perp p_{2k+1}$ for any $k$ and $g\perp p_{2k}$ for any $k\ge 0.$
Concerning zeros, the conclusion is not true. For example, let $f(x)=x^2$ and $g(x)=x^3.$ When the measure is symmetric we get $P_3(f)=f\perp g=P_3(g).$ Hence $P_3(f)$ and $P_3(g)$ have no simple roots.
