Find basis for the image and the kernel of a linear map How do I calculate a basis for $\ker (\varphi)$ and $\operatorname{im}(\varphi)$?
Where, given 
$$ A = \begin{pmatrix} 
1 & -1\\
-1 & 1 \\
\end{pmatrix}$$
we define
$$ \begin{matrix}
\varphi: \mathbb{R}^{2 \times 2} \to \mathbb{R}^{2 \times 2} \\
X \mapsto XA+A^t X^t
\end{matrix}$$
Let $B$ be the standard basis for $\mathbb{R}^{2 \times 2}$ :
$$B =\left\{ \begin{pmatrix} 
1 & 0\\
0 & 0 
\end{pmatrix}, \begin{pmatrix} 
0 & 1\\
0 & 0\\ 
\end{pmatrix},\begin{pmatrix} 
0 & 0\\
1 & 0\\ 
\end{pmatrix},\begin{pmatrix} 
0 & 0\\
0 & 1\\ 
\end{pmatrix} \right\}$$
Calculate $\textsf{M}_B(\varphi)$ we come to $$\textsf{M}_B(\varphi) = \begin{pmatrix} 
0 & 0 & 0 & 0\\
-1 & 1 & -1 & 1 \\
1 & -1 & 1 & -1\\
0 & 0 & 0 & 0\\
\end{pmatrix}$$
We calculate a basis for the kernel like this:
If 
$$X:= \begin{pmatrix} 
a & b\\
c & d\\ 
\end{pmatrix}$$
then $$\varphi(X) = \begin{pmatrix} 
a-b & -a+b\\
c-d & -c+d\\ 
\end{pmatrix}+\begin{pmatrix} 
a-b & c-d\\
-a+b & -c+d\\ 
\end{pmatrix} = \begin{pmatrix} 
2a-2b & -a+b+c-d\\
c-d-a+b & -2c+2d\\ 
\end{pmatrix}$$
Now we have to look, for what values $$\begin{pmatrix} 
2a-2b & -a+b+c-d\\
c-d-a+b & -2c+2d\\ 
\end{pmatrix}$$
by definition, the kernel of a linear transformation is $\varphi(X) = 0$, therefore our basis for $\ker(\varphi)$ should be 
$$\left\{ \begin{pmatrix} 1 & 1 \\ 0 & 0  \end{pmatrix}, \begin{pmatrix} 0 & 0 \\ 1 & 1  \end{pmatrix} \right\}$$
Now here comes the part where I'm confused. How do I calculate a basis for $\operatorname{im}(\varphi)$ ?
$\textsf{M}_B(\varphi)$ is the transformation matrix. I've read that you'd just transpose the matrix $\textsf{M}_B(\varphi)$ and row reduce to calculate a basis. I just don't get it.
The solution according to the solution it should be the basis $$ \left\{\begin{pmatrix}
0 & 1 \\
1 & -2  \end{pmatrix}, \begin{pmatrix}
1 & 0 \\
0 & -1  \end{pmatrix} \right\}$$
Also little side questions. I do know about 
$$\dim(A) = \dim(\operatorname{im} A) + \dim(\ker A)$$
but how exactly do you know the dimension of the Kernel/Image?
 A: EDIT: This answer assumes that $\varphi(X) = XA - (XA)^T$, so it only illustrates the method.
Your matrix $M_\varphi$ should be
$$M_B(\varphi) = \begin{pmatrix} 
0 & 0 & 0 & 0\\
-1 & 1 & -1 & 1 \\
1 & -1 & 1 & -1\\
0 & 0 & 0 & 0\\
\end{pmatrix}$$
which implies the basis for $\ker\varphi$ is $b_1+b_2, b_1-b_3, b_1+b_4$, or
$$\left\{\begin{pmatrix} 1 & 1 \\ 0 & 0\end{pmatrix}, \begin{pmatrix} 1 & 0 \\ -1 & 0\end{pmatrix}, \begin{pmatrix} 1 & 0 \\ 0 & 1\end{pmatrix}\right\}$$
where $B = \{b_1, b_2, b_3, b_4\}$.
$\operatorname{Im}\varphi$ should be spanned by images of basis elements:
$$\begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}, \begin{pmatrix} 0 & 1 \\ -1 & 0\end{pmatrix}, \begin{pmatrix} 0 & 1 \\ -1 & 0\end{pmatrix}, \begin{pmatrix} 0 & 1 \\ -1 & 0\end{pmatrix}$$
so the basis is $$\left\{\begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}\right\}$$
A: Observe that $(XA+A^TX^T)$ is a symmetric matrix. So the image will be a subset of the set of symmetric matrices. But the question about a basis for the image set can be resolved as follows:
$$\varphi(X)=\begin{bmatrix} 
2a-2b & -a+b+c-d\\
c-d-a+b & -2c+2d\\ 
\end{bmatrix}=(a-b)\begin{bmatrix}2&-1\\-1&0\end{bmatrix}+(c-d)\begin{bmatrix}0&1\\1&-2\end{bmatrix}.$$
This means that anything that belongs to the image is in the span of the two matrices on the RHS. Observe that both the matrices on the right side are LI. Hence they form a basis for the image set. Furthermore the dimension of the image set is $2$ (because we have $2$ vectors in the basis).
NOTE:
The answer given in your textbook is not different from what I gave above because $$\begin{bmatrix}2&-1\\-1&0\end{bmatrix}+\begin{bmatrix}0&1\\1&-2\end{bmatrix}=2\begin{bmatrix}1&0\\0&-1\end{bmatrix}.$$ 
A: We can represent a $2\times 2$ matrix as a $1\times 4$ vector.
i.e. $\pmatrix{c_1\\c_2\\c_3\\c_4} = c_1\pmatrix{1&0\\0&0}+ c_2\pmatrix{0&1\\0&0}+c_3\pmatrix{0&0\\1&0}+c_4\pmatrix{0&0\\0&1}$
$\phi(X) = \pmatrix{2&-2&0&0\\-1&1&1&-1\\-1&1&1&-1\\0&0&2&-2}$
The linearly independent columns of the matrix above will give the image of the transformation.
A: I think if you take your linear map $\varphi$ and write it as a matrix in terms of the basis you provided, then it becomes
$$\begin{pmatrix}2 & -2&0 &0\\ -1 &1&1&-1\\-1&1&1&-1\\ 0&0&-2&2\end{pmatrix}$$
The column space of this linear map is spanned by two vectors, namely $(2,-1,-1,0)$ and $(0,1,1,-2)$. Rewriting these as matrices will give you your answer.
This also gives you an easier method for finding the basis of the kernel, by row reducing this matrix and studying the resulting linear equations.
A: Working backwards through the actual questions in your post:
1) By definition, the dimension of a vector space is equal to the cardinality of its basis. It’s usually proven as a theorem that this is well-defined: all bases of a finite-dimensional vector space consist of the same number of vectors. Assuming that your calculation of the kernel is correct, its dimension is $2$, and by the rank-nullity theorem so is the dimension of $\varphi$’s range.
2) There are two basic ways to compute a basis for the column space (range) of a matrix $M$ using row-reduction:


*

*Row-reduce the matrix. The columns of the original matrix that correspond to the pivot columns of the reduced matrix form a basis for the column space of $A$.

*Row-reduce the transpose. The nonzero rows of the reduced matrix are a basis for its row space, which of course is the column space of the original matrix.  


The former method is convenient because it also gives you the null space (kernel) of $A$ without any further work. The latter, on the other hand, usually produces a more convenient basis: The first $\operatorname{rank}A$ elements of each basis vector are mostly zero.  
So, you can certainly compute a basis for the image of $\varphi$ by row-reducing $M_B(\varphi)^T$, but first you should make sure that you’ve constructed this matrix correctly. Assuming that the kernel basis that you’ve found is correct, the image should be two-dimensional. Your $M_B(\varphi)$, on the other hand, is obviously a rank-one matrix, so either it or your kernel basis is incorrect.
