Skip to main content

Linear Algebra with SageMath Learn math with open-source software

Section 13.2 Kernel and Image

The kernel of a linear transformation \(T: V β†’ W\text{,}\) denoted Ker \(T\text{,}\) is the subset of \(V\) consisting of those vectors that \(T\) maps to 0:
\begin{equation*} \text{Ker } T = \{v \in V : Tv = 0\} \end{equation*}
The kernel is also called the null space. The term null space is commonly used in the context of matrices, while kernel is more often used for linear transformations, but the two terms are interchangeable.
Sage provides the method kernel() to compute this subspace.
The output is the subspace \(\text{Ker } T\text{.}\) Sage provides by default the dimension and the echelonized basis of this space.
A linear transformation \(T: Vβ†’ W\) is called injective if whenever \(u,v ∈ V\) and \(Tu= Tv\text{,}\) we have \(u = v\text{.}\) We have that \(T\) is injective if and only if \(\text{Ker } T = 0\text{.}\) This happens only when the dimension of the kernel is zero.
We can study if a linear transformation is injective by calculating the kernel as before and checking if its dimension is zero.
We obtained that the linear transformation \(T\) is not injective since the kernel is not zero.
Alternatively, we can ask Sage to directly decide if a linear transformation is injective by using the method is_injective().
The dimension of the kernel is called the nullity of \(T\text{.}\) Sage can compute directly this number:
The image of a linear transformation \(T: V β†’ W\text{,}\) denoted Im \(T\text{,}\) is the subset of \(W\) consisting of vectors of the form \(Tv\) for some \(v∈V\text{:}\)
\begin{equation*} \text{Im } T = \{Tv : v \in V\}. \end{equation*}
The image is also called the range space. Sage provides the method image() to compute this subspace.
The output is the subspace \(\text{Im } T\text{.}\) Sage provides by default the dimension and the echelonized basis of this space.
A linear transformation \(T: Vβ†’ W\) is called surjective if every vector \(w ∈ W\) is the image of some vector \(v ∈ V\text{.}\) We have that \(T\) is surjective if and only if \(\text{Im } T = W\text{.}\) This happens only when the dimension of the image equals the dimension of \(W\text{.}\)
We can study if a linear transformation is surjective by calculating the image as before and checking if its dimension is the same as the dimension of \(W\text{.}\)
We obtained that the linear transformation \(T\) is surjective since the image is the whole codomain.
Alternatively, we can ask Sage to directly decide if a linear transformation is surjective by using the is_surjective() method.
The dimension of the image is called the rank of \(T\text{.}\) Sage can compute directly this number:
The Rank-Nullity theorem states that
\begin{equation*} \text{rank } T + \text{nullity } T = \dim V \end{equation*}
We can verify this result with the dimensions calculated manually:
Or directly: