[Math] Find a matrix so that $A^2$ not equal to 0 but $A^3$ is [Strang P78 2.4.23]

linear algebramatrices

(a) Find a nonzero matrix $A$ for which $A^2 = 0$.
(b) Find a matrix that has $A^2 \neq 0$ but $A^3 = 0$.

Solution for (a): Let $A := \text{column $\times$ row} = \mathbf{cr^T} \neq \mathbf{0}$ where $\mathbf{c,r}$ are column vectors.
I'd like: $A^2 = \mathbf{c\color{green}{r^Tc}r^T} = \mathbf{0}. \mathbf{\color{green}{r^Tc = 0}}$ would imply this.
Thus, for want of a counterexample, choose $\mathbf{r} = (0,k)$ and $\mathbf{c} = (k,0)^T. \quad \blacksquare$

(b) Since I chose $\mathbf{c, r}$ such that $\mathbf{\color{green}{r^Tc = 0}}$, thus $A^3 = \mathbf{c\color{green}{r^Tc}\color{green}{r^Tc}r^T} = 0.$

$\Large{1.}$ Could someone please reveal and expound on the intermediate steps and thoughts towards devising a (counterexample) for $A^3$? Please don't answer with just a counterexample.

$\Large{2.}$ How would one foreknow/previse to define $A := \text{column $\times$ row}$?

Best Answer

You want there to be a vector $v$ with $A^2\cdot v\neq0$ but $A^3\cdot v=0$. You can easily check that then $v,A\cdot v,A^2\cdot v$ must be a free (i.e., linearly independent) family: if there were a nontrivial linear dependence, take one with a minimal number of nonzero coefficients (at least two since the individual vectors cannot be zero); now apply $A$ sufficiently often to kill off the final nonzero coefficient, leaving exactly one less nonzero coefficient, which gives a contradiction.

For an easy example, take the (sub)space generated by $v,A\cdot v,A^2\cdot v$. The matrix of $A$ on this basis will be $$ A'=\begin{pmatrix}0&0&0\\1&0&0\\0&1&0\end{pmatrix} $$ which provides your example.

My argument shows that you need $A$ to have rank at least$~2$ (as $A\cdot v$ and $A^2\cdot v$ are linearly independent elements of the image of $A$); hence taking for $A$ a product $cr^T$ of a $n\times 1$ and a $1\times n$ matrix will never work.