Orthogonal projections for minimization problem

I have trouble to understand the existence of a minimization problem in a Hilbert space. Let $(\Omega,\mathcal{F}_T,P)$ be a filtred probability space with filtration $(\mathcal{F}_t),0\le t\le T$. We have a set $K$ of stochastic process, which has the property to be linear (and such that the stochastic integral is well defined, see below). We have to r.v. $X\in L^2(\Omega,\mathcal{F}_T,P)$,$Y\in L^2(\Omega,\mathcal{F}_t,P)$ for $t<T$ and a semimartingale $S$. We are interested in

$$\operatorname{ess}\inf \{\vartheta\in K:E[(X-Y-\int_t^T\vartheta_r dS_r)^2|\mathcal{F}_t]\}$$

Define the space $A:=\overline{\{\vartheta\in K:\int_t^T\vartheta_rdS_r\}}$, where the closure is taken in $L^2$. We assume that there is a minimizer for every $X,Y$ and $t$.Why is this minimizer obtained via projection of $X-Y$ on $A$? Denoting with $\Lambda$ the projection, why do we have the following:

$$\Lambda(X-Y)=\Lambda(X)-Y\Lambda(1)$$

Of course $\Lambda$ is linear, but why could we treat $Y$ as a scalar? I know the Hilbert projection theorem which might help. However, the problem is we want to minimize the conditional expectation, which is not the norm on $L^2$. So I do not see, if one should use this theorem, how we can apply it. Could someone explain why the minimizer is obtained via projection on $A$?

-

There was a mistake in my previous answer. You can use the result for the unconditional problem to solve the initial one. The crucial ingredient is that the set $\{\theta\in K:\int_t^T\theta_rdS_r\}$ is lower directed. For the details, see this brilliant answer on quant.se