Commuting matrices - unclear on steps I would like to find all matrices that commute with matrix 
$$ A =\begin{pmatrix}1 & -1 \\ 0 & 1 \end{pmatrix}$$
Proposed solution
$\begin{pmatrix}a&b \\c &d\end{pmatrix}\begin{pmatrix}1&-1 \\0 &1\end{pmatrix} = \begin{pmatrix}1& -1\\ 0&1\end{pmatrix}\begin{pmatrix}a&b \\ c&d\end{pmatrix}
= \begin{pmatrix}a& -a+b\\ c&-c+d\end{pmatrix}=\begin{pmatrix}a-c& b-d\\ c&d\end{pmatrix}$
Unclear about the following
$$a=a-c$$
$$-a+b =b-d$$
$$c=c$$
$$-c+d=d$$
So any matrix of the form $\begin{pmatrix}d & 0 \\ 0 & a\end{pmatrix}$
Please could someone review and correct if needs be
Thanks
 A: Somewhat more generally: your matrix is $I - N$ where $N = \pmatrix{0 & 1\cr 0 & 0\cr}$.
Every $2 \times 2$ matrix commutes with $I$, so the question is what commutes with $N$.
We can write $N = u v^T$ where $u$ and $v$ are nonzero (column) vectors, in this case $\pmatrix{1\cr 0\cr}$ and $\pmatrix{0\cr 1\cr}$.  Now $B(u v^T) = (Bu) v^T$ is a matrix whose rows are all scalar multiples of $v^T$ and whose columns are all scalar multiples of $Bu$, while $(uv^T) B = u (v^T B)$ is a matrix whose rows are scalar multiples of $v^T B$ and whose columns are all scalar multiples of $u$.  Thus
for some scalar $\lambda$, we must have $Bu = \lambda u$ and $v^T B = \lambda v^T$, i.e.
$u$ and $v^T$ are right and left eigenvectors of $B$ for the same eigenvalue, and this condition is clearly sufficient as well as necessary.  Now if $B$ is such a matrix,
$C = B-\lambda I$ satisfies the same conditions with eigenvalue $0$.  So the matrices that commutes with $A=I-u v^T$ are those  of the form $B=\lambda I + C$ where $Cu = 0$ and $v^T C = 0$, i.e. all rows of $C$ are orthogonal to $u$ and all columns of $C$ are orthogonal to $v$. 
