Problem:

> 
> Suppose the matrix $\mathbf A$ is similar to $\mathbf B$, with $\mathbf B=\mathbf S^{-1}\mathbf A\mathbf S$.
> 
> 
> a. Show that if $\mathbf x\in\mathrm{ker}(\mathbf B)$, then $\mathbf {Sx}\in \mathrm{ker}(\mathbf A).$
> 
> 
> b.Show that $\mathrm{nullity}(\mathbf A)=\mathrm{nullity}(\mathbf B)$. *Hint:* If $\{\mathbf v\_1,\mathbf v\_2,\ldots,\mathbf v\_p\}$ is a basis for $\mathrm{ker}(\mathbf B)$, then the vectors $\{\mathbf{Sv\_1}, \mathbf{Sv\_2},\ldots, \mathbf{Sv\_p}\}\subset\mathrm{ker}(A)$ are linearly independent. Now reverse the roles of $\mathbf A$ and $\mathbf B$.
> 
> 
> 

Solution:

> 
> a. Note that $\mathbf{AS}=\mathbf{SB}$. If $\mathbf x\in\mathrm{ker}(B)$, then $\mathbf A(\mathbf{Sx})= \mathbf{SBx}=\mathbf{S0} = \mathbf 0$, so that $\mathbf {Sx}\in\mathrm{ker}(\mathbf A)$, as claimed.
> 
> 
> b.We use the hint and observe that $$\mathrm{nullity}(\mathbf B)=\dim(\mathrm{ker}\ \mathbf B)=p\leqslant\dim(\mathrm{ker}\ \mathbf A)=\mathrm{nullity}(\mathbf A),$$ since $\mathbf {Sv\_1},\ldots,\mathbf{Sv\_p}$ are $p$ linearly independent vectors in $\mathrm{ker}(\mathbf A)$. Reversing the roles of $\mathbf A$ and $\mathbf B$ shows that, conversely, $\mathrm{nullity}(\mathbf A)\leqslant \mathrm{nullity}(\mathbf B)$, so that the equation $\mathrm{nullity}(\mathbf A)= \mathrm{nullity}(\mathbf B)$ holds, as claimed.
> 
> 
> 

Why can we reverse the roles of $\mathbf A$ and $\mathbf B$ in this case? The fact that vectors in $\mathrm{ker}(\mathbf A)$ are linearly independent doesn't mean they are bases of the kernel.

Thank you so much.