How to calculate eigenvalues of a matrix $A = I_d - a_1a_1^T - a_2a_2^T$ I have a question on this specific question from the past entrance examination of a university.
https://www.ism.ac.jp/senkou/kakomon/math_20190820.pdf
$d\geq 3$, $I_d$ is an identity matrix,
and I have a matrix $A = I_d - a_1a_1^T - a_2a_2^T$.
Here, $a_1 (\in R^d)$ and $a_2 (\in R^d)$ are the column unit vectors that are orthogonal to each other.
Then, how to calculate all eigenvalues of$A$?

I tried to solve the eigen equation as below:
$|A - \lambda I_d|$ = 0
$|I_d - a_1a_1^T - a_2a_2^T - \lambda I_d| = 0$
$|(I_d - \lambda)I_d - a_1a_1^T - a_2a_2^T| = 0$
but after that, I don't know what to do.
 A: Use the fact that $u^Tv=u \cdot v$, thus $u^Tu=\|u\|^2$ and note the following:  


*

*$a_ia_i^T$ is a rank one matrix.

*$a_i^Ta_j=0$ for $i \neq j$ because we are given that $a_i \perp a_j$.

*$a_i^Ta_i=1$ because we are given that $a_i$ are unit vectors.


Claim: $A^2=A$.
Proof: 
Let $P_1=a_1a_1^T$ and $P_2=a_2a_2^T$, then $P_1P_2=a_1a_1^Ta_2a_2^T=0$, likewise $P_2P_1=0$ and since $P_i$ are projection matrices, therefore $P_i^2=P_i$ (this can be verified directly as well). 
\begin{align*}
A^2 & = (I-P_1-P_2)^2\\
&=I-2P_1-2P_2+P_1P_2+\color{red}{P_1^2}+P_2P_1+\color{blue}{P_2^2}\\
&=I-2P_1-2P_2+\color{red}{P_1}+\color{blue}{P_2}\\
& = I-P_1-P_2\\
&=A.
\end{align*}
This suggests that the eigenvalues of $A$ are either $0$ or $1$. 
Now consider 
\begin{align*}
Aa_2 & =(I-a_1a_1^T-a_2a_2^T)a_2\\
&=a_2-a_1a_1^Ta_2-a_2a_2^Ta_2\\
& =a_2-0-a_2 && (\because a_1 \perp a_2 \& \|a_2\|=1)\\
& = 0.
\end{align*}
Thus $0$ is an eigen value with $a_2$ as the corresponding eigenvector.
Since $d \geq 3$, this means there is at least one non-zero vector $u$ such that $u \perp a_1$ and $u \perp a_2$ (same as saying $a_i^Tu=0$). Now consider,
\begin{align*}
Au & =(I-a_1a_1^T-a_2a_2^T)u\\
&=u-a_1a_1^Tu-a_2a_2^Tu\\
& =u-0-0 && (\because u \perp a_i)\\
& = u.
\end{align*}
Thus $1$ is also an eigenvalue with eigenvector $u$.
A: Extend $\{a_1,a_2\}$ to an orthonormal basis $\{a_1,a_2,\ldots,a_d\}$ of $\mathbb R^d$. Then
$$
Aa_i=(I-a_1a_1^T-a_2a_2^T)a_i=
\begin{cases}
0,&i=1,2,\\
a_i,&i\ge3.
\end{cases}
$$
Therefore the eigenvalues of $A$ are $0$ (of multiplicity $2$) and $1$ (of multiplicity $d-2$) and the $a_i$s are eigenvectors of $A$.
A: We can also do the job as follows. 
Note that $U_1=a_1a_1^T,U_2=a_2a_2^T$ are real symmetric, then are orthogonally diagonalizable.
$tr(U_1)=tr(U_2)=a_1^Ta_1=a_2^Ta_2=1$ and $rank(U_1)=rank(U_2)=1$ imply that $spectrum(U_1)=spectrum(U_2)=\{1,0,\cdots,0\}$.
$U_1U_2=U_2U_1=0$ imply that $U_1,U_2$ are simultaneously orthogonally similar to $diag((\lambda_i)_i),diag((\mu_i)_i)$ where 
 $\lambda_i\mu_i=0$ and $\lambda_i,\mu_i\in \{0,1\}$.
Finally $A=I-U_1-U_2$ is orthog. similar to $diag(I_{n-2},0_2)$ with $\ker(A)=span(a_1,a_2)$ and $\ker(A-I_n)=(span(a_1,a_2))^{\perp}$.
EDIT. More generally, if $\{a_1,\cdots,a_k\}$ is an orthonormal system, then $I-\sum_{i=1}^ka_ia_i^T$ is the orthogonal projection on $(span(a_1,\cdots,a_k))^{\perp}$.
A: Another approach, to add to the existing list.  Let's suppose that you insist on calculating eigenvalues by finding $|A - \lambda I_d|$.  We can do so using the Weinstein-Aronszajn identity (sometimes called Sylvester's determinant identity).  In particular, note that $A = I_d - a_1a_1^T - a_2a_2^T = I_d - MM^T$, where 
$$
M = \pmatrix{a_1 & a_2}.
$$
It follows that for $\lambda \neq 1$,
$$
|A - \lambda I_d| = 
\left|(1 - \lambda)I_d - MM^T
\right| 
\\ = 
(1 - \lambda)^d \left|
I_d - (1-\lambda)^{-d}MM^T
\right|\\
= (1 - \lambda)^d \left|
I_2 - (1-\lambda)^{-1}M^TM
\right|\\ 
= (1 - \lambda)^d \left|
I_2 - (1-\lambda)^{-1}I_2
\right|\\
= (1 - \lambda)^{d-2} \left|
(1-\lambda)I_2 - I_2
\right|\\
= (1 - \lambda)^{d-2} \left|
-\lambda I_2
\right| \\
= \lambda^2 (1 - \lambda)^{d-2}.
$$
Because $|A - \lambda I_d|$ is a polynomial on $\lambda$, the same must also hold for $\lambda = 1$.
