Proof that $\vec{v} \in U \iff \text{proj}_U(\vec{v})=\vec{v}$

inner-productslinear algebraprojectionvector-spaces

Problem

Let $V$ be finite-dimensional inner product space and $U$ it's subspace. Let's
assume that $\vec{v} \in V$. Show that $\vec{v} \in U \iff \text{proj}_U(\vec{v}) = \vec{v}$

Attempt to show

Let's assume subspace $U$ has orthogonal basis ($\vec{u}_1,\vec{u}_2,\vec{u}_3,\dots \vec{u}_n$) when $n \in \mathbb{N}$ and $\vec{v} \in U$. Then $\vec{v}$ can be written as linear combination when $(c_1,c_2,c_3 \dots c_n)$ when $c_n \in \mathbb{R}$

$$ \vec{v} = c_1 \vec{u}_1 + c_2 \vec{u}_2 + c_3 \vec{u}_3 \dots c_n \vec{u}_n $$

If we take inner product with $\vec{u}_i$ for $i \in \{1, \ldots, i\}$ from this equation we have

$$ \langle \vec{v}, \vec{u}_i \rangle = \langle c_1 \vec{u}_1, \vec{u}_i \rangle + \langle c_2 \vec{u}_2, \vec{u}_i \rangle + \langle c_3 \vec{u}_3, \vec{u}_i \rangle + \dots + \langle c_i \vec{u}_i, \vec{u}_i \rangle + \dots + \langle c_n \vec{u}_n, \vec{u}_i \rangle $$
Then the equation can be rewritten using sum

$$ \langle \vec{v}, \vec{u}_i \rangle = \underbrace{\langle \sum_j c_j \vec{u}_j, \vec{u}_i \rangle =c_i \langle \vec{u}_i, \vec{u}_i \rangle}_{\text{someone explain this?}} \iff c_i = \frac{\langle \vec{v}, \vec{u}_i \rangle}{\langle \vec{u}_i, \vec{u}_i \rangle} $$
Now by projecting $\vec{v}$ onto subspace U, we can write (by definition of projection)

$$ \text{proj}_U(\vec{v}) = \frac{\langle \vec{v}, \vec{u}_1 \rangle}{\langle \vec{u}_1, \vec{u}_1 \rangle } \vec{u}_1 + \frac{\langle \vec{v}, \vec{u}_2 \rangle}{\langle \vec{u}_2, \vec{u}_2 \rangle } \vec{u}_2 + \dots + \frac{\langle \vec{v}, \vec{u}_n \rangle}{\langle \vec{u}_n, \vec{u}_n \rangle } \vec{u}_n $$

Now the projection can be rewritten using the fact that $c_i = \frac{\langle \vec{v}, \vec{u}_i \rangle}{\langle \vec{u}_i, \vec{u}_i \rangle} $

$$ \text{proj}_U{\vec{v}} = c_1 \vec{u}_1 + c_2 \vec{u}_2 + c_3 \vec{u}_3 \dots c_n \vec{u}_n = \vec{v}$$


I've been told that my attempt only shows $\vec{v} \in U \implies \text{proj}_U(\vec{v}) = \vec{v}$ but not the case $\text{proj}_U(\vec{v}) = \vec{v} \implies \vec{v} \in U$. For some unknown reason, I can't exactly think why the reasoning would go only one way in this? Also the part with sum in it confuses me quite a bit. Why exactly these two are equal? I made another post about this same problem but I don't think I understand the answer completely.

Also, feel free to point anything that seems off in my "attempt".

Best Answer

Are you looking for a way to solve the problem or are you only interested in fixing your solution? If it's the former, try the following: it can be shown that for every subspace $U$, the vector space $V$ is a direct sum of $U$ and it's orthogonal complement $U^\perp$, i.e. $V=U\oplus U^\perp$. That means that every vector $v$ can be uniquely expressed as a sum of $u$ and $u^\perp$. The projection linear transformation $P_U$ takes every vector $v$ to the element of $U$ that is in its representation. According to the definition, $U$ is invariant under $P_U$ (that's the only if part) and since the image of $P_U$ is $U$, $P_U(v)=v$ implies that $v\in U$ ($P_U(v)\in im(P_U)\Rightarrow v\in U)$.