# Projection Matrix onto null space of a vector

I have a vector summation $x_1 + Ax_2$ where $x_1\in\mathbb{R}^{n\times1}$, $A\in\mathbb{R}^{n\times m}$ and $x_2\in\mathbb{R}^{m\times1}$.

I am wondering if I can find a projection $P\in\mathbb{R}^{n\times n}$ such that $Px_1 + PAx_2 = 0$. If so what is the expression of that matrix.

• Calculate the orthogonal complement of $\operatorname{span} \{x_1, Ax_2\}$, take a normed vector $y$ from this and define $P=yy^T$. Mar 19, 2016 at 20:51
• @Roland I am not very good at linear algebra.. Could you please write explicitly your solution as an answer. I would really appreciate it.. Mar 19, 2016 at 21:04
• Assuming $z = x_1 + Ax_2\ne 0$, what can you say about $Q = zz^T / (z^T z)$ and $I - Q$? Mar 20, 2016 at 1:05
• @user251257 Great minds... :-) Mar 20, 2016 at 1:16

We can mimic Householder transformation. Let $y = x_1 + Ax_2$. Define: $P = {\rm I} - yy^T / y^Ty$ (Householder would have factor $2$ in the $y$ part of the expression).

Check:

• Your condition: $$Px_1 + PAx_2 = Py = ({\rm I} - yy^T / y^Ty) y = y - yy^Ty/y^Ty = y - y = 0,$$

• $P$ is a projection: \begin{align} P^2 &= ({\rm I} - yy^T / y^Ty) ({\rm I} - yy^T / y^Ty) = {\rm I} - yy^T / y^Ty - yy^T / y^Ty + yy^Tyy^T / y^Tyy^Ty \\ &= {\rm I} - 2yy^T / y^Ty + yy^T / y^Ty = {\rm I} - yy^T / y^Ty = P. \end{align}

• (if needed) $P$ is an orthogonal projection (condition explained on the previous link): $$P^T = ({\rm I} - yy^T / y^Ty)^T = {\rm I} - yy^T / y^Ty = P.$$

You sure that these are the only conditions?

• Actually my problem is even more complicated but I am trying to see if I can find a suboptimal choice of P. In my case P has to have binary elements in the diagonals and zeros in the off-diagonal. That is I want to project onto the space spanned by exactly $k$ rows of A because I know that it exists such combination that set the equation to zero.. Mar 20, 2016 at 1:21
• I'd call this the first step of Gram-Schmidt rather than Householder. Mar 20, 2016 at 10:04
• @Roland I agree. What I meant was that the formula is visually similar (like Householder, but without factor $2$). Mar 20, 2016 at 19:37
• @user2987 To get such a specific $P = \operatorname{diag}(p_1,p_2,dots,p_n)$ , you need to set $p_k = 0$ for all $k$ such that $y_k \ne 0$, because $(Py)_k = p_ky_k$. Generally, this will be $P = 0$ (unless you get lucky with zeros in $y$). Mar 20, 2016 at 19:48
• @VedranŠego many thanks for your answer and comment.. I posted a more detailed question here. Mar 20, 2016 at 20:27