Solution (source code)

= Solution

Expanding the <characteristic polynomial> along the first column gives
$$
\begin{aligned}
\chi_A(\lambda)&=(\lambda-3)\left[(\lambda-4+s)(\lambda-4s+1)+4(s-1)^2\right]\\
&=\boxed{(\lambda-3)^2(\lambda-3s)}.
\end{aligned}
$$
For $s\ne1$, solving the two nullspace equations gives
$$
\boxed{E_3=\operatorname{span}\{(1,0,0)^T,(0,2,1)^T\},\qquad E_{3s}=\operatorname{span}\{(1,s-1,2s-2)^T\}.}
$$
These are all the <eigenvalues> and <eigenvectors>, with nonzero vectors understood. The three displayed spanning vectors form an <eigenbasis>, so $A$ is <diagonalizable>.

At $s=1$, the sole eigenvalue is three, with algebraic multiplicity three but the same two-dimensional $E_3$. Thus \b[$A$ is diagonalizable exactly when $s\ne1$]. Indeed, at the exceptional parameter, $A=3I+N$ with $N\ne0$ and $N^2=0$, so its <Jordan normal form> has one block of size two and one of size one. This illustrates how an <eigenvalue collision> can destroy diagonalizability without changing the two-dimensional eigenspace.