<s>[INST] Deflation of eigenvalue Could you explain to me the deflation?
For example if we have the matrix  $A=\begin{pmatrix}1 & -0.5 & -1.5\\ -15 & -2.5 & 4.5\\ -15 & -4.5 & 2.5\end{pmatrix}$ how do we apply the deflation of the eigenvalue $\lambda_1=4$ ?
$$$$
EDIT :
I have done the following :
We have the eigenvalue $\lambda_1=4$. The corresponding eigenvector is : $v_1=\begin{pmatrix}-1\\ 3 \\ 1\end{pmatrix}$, right?
Since $v_1$ does not have $1$ as the component of largest modulus, we multiply  $v_1$ by a permutation matrix $P$ which interchanges the largest element and the first element: We interchange rows $1$ and $2$ of $A$ : $v_1'=\begin{pmatrix}3 \\-1\\  1\end{pmatrix}$
$$\begin{pmatrix}-15 & -2.5 & 4.5\\1 & -0.5 & -1.5\\  -15 & -4.5 & 2.5\end{pmatrix}$$
We want to transform the vector into the vector $e_1$, so we divide the first row by $3$, add it to the second row and subtract it from the third row : $v_1''=\begin{pmatrix}1 \\0\\  0\end{pmatrix}$
$$\begin{pmatrix}-5 & -5/6 & 1.5\\-4 & -4/3 & 0\\  -10 & -11/3 & 1\end{pmatrix}$$ Since we have interchanged the rows $1$ and $2$, now we have to interchange the columns $1$ and $2$ and so we get the matrix $$\begin{pmatrix} -5/6 & -5 &1.5\\-4/3 & -4 & 0\\   -11/3 & -10 &1\end{pmatrix}$$ Then $\lambda_1=4$ should be an eigenvalue of this matrix with $e_1$ the corresponding eigenvector, but this is not like that. What am I doing wrong?
Is the deflated matrix equal to $$\begin{pmatrix} -4 & 0\\   -10 &1\end{pmatrix}$$ ?
 [/INST] We have $v_1=\begin{pmatrix}-1\\3\\1\end{pmatrix}$.
Let $P$ be the permutation matrix that swaps the first 2 elements.
Then $Pv_1=v_1'=\begin{pmatrix}3\\-1\\1\end{pmatrix}$ has the element with the largest magnitude first.
Let $R$ be the matrix of row operations that transforms $v_1'$ into $e_1$. That is $Rv_1'=e_1$.
Then $R=\begin{pmatrix}1/3\\1/3 & 1\\-1/3 &&1\end{pmatrix}$.
Let $B=RPAP^{-1}R^{-1}$. Then $B$ is similar to $A$ and:
$$Be_1=RPAP^{-1}R^{-1}e_1=RPAP^{-1}v_1'=RPAv_1=RP\lambda_1 v_1=\lambda_1Rv_1'=\lambda_1e_1$$
So $B$ has $\lambda_1$ as eigenvalue with eigenvector $e_1$.
You have found $RPAP^{-1}=\begin{pmatrix} -5/6 & -5 &1.5\\-4/3 & -4 & 0\\   -11/3 & -10 &1\end{pmatrix}$. We can verify that if we multiply it with $v_1'$ we find $\lambda_1 e_1$.
If we multiply it on the right with $R^{-1}=\begin{pmatrix}3\\-1&1\\1&&1\end{pmatrix}$ then we find $B=\begin{pmatrix}4&-5&3/2\\&-4&0\\&-10&1\end{pmatrix}$.
So $B$ has indeed $e_1$ as an eigenvector for $\lambda_1=4$.
The resulting deflated matrix is $B_1=\begin{pmatrix}-4&0\\-10&1\end{pmatrix}$, which we already had in $RPAP^{-1}$ since $R^{-1}$ affected only the leftmost column. This matches your findings.
We can verify that $B_1$ has indeed the same remaining eigenvalues $-4$ and $1$ as $A$, which are on its diagonal since $B_1$ is a triangular matrix.
</s>