Kernel (linear algebra) explained

In mathematics, the kernel of a linear map, also known as the null space or nullspace, is the part of the domain which is mapped to the zero vector of the co-domain; the kernel is always a linear subspace of the domain.[1] That is, given a linear map between two vector spaces and, the kernel of is the vector space of all elements of such that, where denotes the zero vector in,[2] or more symbolically:\ker(L) = \left\ = L^(\mathbf).

Properties

The kernel of is a linear subspace of the domain .[3] In the linear map

L:V\toW,

two elements of have the same image in if and only if their difference lies in the kernel of, that is,L\left(\mathbf_1\right) = L\left(\mathbf_2\right) \quad \text \quad L\left(\mathbf_1-\mathbf_2\right) = \mathbf.

From this, it follows that the image of is isomorphic to the quotient of by the kernel:\operatorname(L) \cong V / \ker(L).In the case where is finite-dimensional, this implies the rank–nullity theorem:\dim(\ker L) + \dim(\operatorname L) = \dim(V).where the term refers to the dimension of the image of,

\dim(\operatorname{im}L),

while refers to the dimension of the kernel of,

\dim(\kerL).

[4] That is,\operatorname(L) = \dim(\operatorname L) \qquad \text \qquad \operatorname(L) = \dim(\ker L),so that the rank–nullity theorem can be restated as \operatorname(L) + \operatorname(L) = \dim \left(\operatorname L\right).

When is an inner product space, the quotient

V/\ker(L)

can be identified with the orthogonal complement in of

\ker(L)

. This is the generalization to linear operators of the row space, or coimage, of a matrix.

Generalization to modules

See main article: Module (mathematics). The notion of kernel also makes sense for homomorphisms of modules, which are generalizations of vector spaces where the scalars are elements of a ring, rather than a field. The domain of the mapping is a module, with the kernel constituting a submodule. Here, the concepts of rank and nullity do not necessarily apply.

In functional analysis

See main article: Topological vector space. If and are topological vector spaces such that is finite-dimensional, then a linear operator is continuous if and only if the kernel of is a closed subspace of .

Representation as matrix multiplication

Consider a linear map represented as a matrix with coefficients in a field (typically

R

or

C

), that is operating on column vectors with components over .The kernel of this linear map is the set of solutions to the equation, where is understood as the zero vector. The dimension of the kernel of A is called the nullity of A. In set-builder notation,\operatorname(A) = \operatorname(A) = \operatorname(A) = \left\.The matrix equation is equivalent to a homogeneous system of linear equations:A\mathbf=\mathbf \;\;\Leftrightarrow\;\;\begina_ x_1 &&\; + \;&& a_ x_2 &&\; + \;\cdots\; + \;&& a_ x_n &&\; = \;&&& 0 \\a_ x_1 &&\; + \;&& a_ x_2 &&\; + \;\cdots\; + \;&& a_ x_n &&\; = \;&&& 0 \\ && && && && &&\vdots\ \;&&& \\a_ x_1 &&\; + \;&& a_ x_2 &&\; + \;\cdots\; + \;&& a_ x_n &&\; = \;&&& 0\text \\\endThus the kernel of A is the same as the solution set to the above homogeneous equations.

Subspace properties

The kernel of a matrix over a field is a linear subspace of . That is, the kernel of, the set, has the following three properties:

  1. always contains the zero vector, since .
  2. If and, then . This follows from the distributivity of matrix multiplication over addition.
  3. If and is a scalar, then, since .

The row space of a matrix

See main article: Rank–nullity theorem. The product Ax can be written in terms of the dot product of vectors as follows:A\mathbf = \begin \mathbf_1 \cdot \mathbf \\ \mathbf_2 \cdot \mathbf \\ \vdots \\ \mathbf_m \cdot \mathbf \end.

Here, denote the rows of the matrix . It follows that is in the kernel of, if and only if is orthogonal (or perpendicular) to each of the row vectors of (since orthogonality is defined as having a dot product of 0).

The row space, or coimage, of a matrix is the span of the row vectors of . By the above reasoning, the kernel of is the orthogonal complement to the row space. That is, a vector lies in the kernel of, if and only if it is perpendicular to every vector in the row space of .

The dimension of the row space of is called the rank of A, and the dimension of the kernel of is called the nullity of . These quantities are related by the rank–nullity theorem\operatorname(A) + \operatorname(A) = n.

Left null space

The left null space, or cokernel, of a matrix consists of all column vectors such that, where T denotes the transpose of a matrix. The left null space of is the same as the kernel of . The left null space of is the orthogonal complement to the column space of, and is dual to the cokernel of the associated linear transformation. The kernel, the row space, the column space, and the left null space of are the four fundamental subspaces associated with the matrix .

Nonhomogeneous systems of linear equations

The kernel also plays a role in the solution to a nonhomogeneous system of linear equations:A\mathbf = \mathbf\quad \text \quad \begina_ x_1 &&\; + \;&& a_ x_2 &&\; + \;\cdots\; + \;&& a_ x_n &&\; = \;&&& b_1 \\a_ x_1 &&\; + \;&& a_ x_2 &&\; + \;\cdots\; + \;&& a_ x_n &&\; = \;&&& b_2 \\ && && && && &&\vdots\ \;&&& \\a_ x_1 &&\; + \;&& a_ x_2 &&\; + \;\cdots\; + \;&& a_ x_n &&\; = \;&&& b_m \\\endIf and are two possible solutions to the above equation, thenA(\mathbf - \mathbf) = A\mathbf - A\mathbf = \mathbf - \mathbf = \mathbfThus, the difference of any two solutions to the equation lies in the kernel of .

It follows that any solution to the equation can be expressed as the sum of a fixed solution and an arbitrary element of the kernel. That is, the solution set to the equation is\left\,Geometrically, this says that the solution set to is the translation of the kernel of by the vector . See also Fredholm alternative and flat (geometry).

Illustration

The following is a simple illustration of the computation of the kernel of a matrix (see, below for methods better suited to more complex calculations). The illustration also touches on the row space and its relation to the kernel.

Consider the matrixA = \begin 2 & 3 & 5 \\ -4 & 2 & 3 \end.The kernel of this matrix consists of all vectors for which\begin 2 & 3 & 5 \\ -4 & 2 & 3 \end \begin x \\ y \\ z \end = \begin 0 \\ 0 \end,which can be expressed as a homogeneous system of linear equations involving,, and :\begin 2x + 3y + 5z &= 0, \\-4x + 2y + 3z &= 0.\end

The same linear equations can also be written in matrix form as: \left[\begin{array}{ccc|c} 2 & 3 & 5 & 0 \\ -4 & 2 & 3 & 0 \end{array}\right].

Through Gauss–Jordan elimination, the matrix can be reduced to: \left[\begin{array}{ccc|c} 1 & 0 & 1/16 & 0 \\ 0 & 1 & 13/8 & 0 \end{array}\right].

Rewriting the matrix in equation form yields:\beginx &= -\fracz \\y &= -\fracz.\end

The elements of the kernel can be further expressed in parametric vector form, as follows:\begin x \\ y \\ z\end = c \begin -1/16 \\ -13/8 \\ 1\end\quad (\textc \in \mathbb)

Since is a free variable ranging over all real numbers, this can be expressed equally well as:\begin x \\ y \\ z \end = c \begin -1 \\ -26 \\ 16 \end.The kernel of is precisely the solution set to these equations (in this case, a line through the origin in). Here, since the vector constitutes a basis of the kernel of . The nullity of is 1.

The following dot products are zero: \begin 2 & 3 & 5 \end \begin -1 \\ -26 \\ 16 \end= 0\quad\mathrm\quad \begin -4 & 2 & 3 \end \begin -1 \\ -26 \\ 16 \end= 0,which illustrates that vectors in the kernel of are orthogonal to each of the row vectors of .

These two (linearly independent) row vectors span the row space of —a plane orthogonal to the vector .

With the rank 2 of, the nullity 1 of, and the dimension 3 of, we have an illustration of the rank-nullity theorem.

Examples

2x_1 &\;+\;& 3x_2 &\;+\;& 5x_3 &\;=\;& 0 \\ -4x_1 &\;+\;& 2x_2 &\;+\;& 3x_3 &\;=\;& 0\end

Computation by Gaussian elimination

A basis of the kernel of a matrix may be computed by Gaussian elimination.

\begin{bmatrix}A\\hlineI\end{bmatrix},

where is the identity matrix.

Computing its column echelon form by Gaussian elimination (or any other suitable method), we get a matrix

\begin{bmatrix}B\\\hlineC\end{bmatrix}.

A basis of the kernel of consists in the non-zero columns of such that the corresponding column of is a zero column.

In fact, the computation may be stopped as soon as the upper matrix is in column echelon form: the remainder of the computation consists in changing the basis of the vector space generated by the columns whose upper part is zero.

For example, suppose thatA = \begin1 & 0 & -3 & 0 & 2 & -8 \\0 & 1 & 5 & 0 & -1 & 4 \\0 & 0 & 0 & 1 & 7 & -9 \\0 & 0 & 0 & 0 & 0 & 0\end. Then \begin A \\ \hline I \end =\begin1 & 0 & -3 & 0 & 2 & -8 \\0 & 1 & 5 & 0 & -1 & 4 \\0 & 0 & 0 & 1 & 7 & -9 \\0 & 0 & 0 & 0 & 0 & 0 \\\hline1 & 0 & 0 & 0 & 0 & 0 \\0 & 1 & 0 & 0 & 0 & 0 \\0 & 0 & 1 & 0 & 0 & 0 \\0 & 0 & 0 & 1 & 0 & 0 \\0 & 0 & 0 & 0 & 1 & 0 \\0 & 0 & 0 & 0 & 0 & 1\end.

Putting the upper part in column echelon form by column operations on the whole matrix gives \begin B \\ \hline C \end =\begin1 & 0 & 0 & 0 & 0 & 0 \\0 & 1 & 0 & 0 & 0 & 0 \\0 & 0 & 1 & 0 & 0 & 0 \\0 & 0 & 0 & 0 & 0 & 0 \\\hline1 & 0 & 0 & 3 & -2 & 8 \\0 & 1 & 0 & -5 & 1 & -4 \\0 & 0 & 0 & 1 & 0 & 0 \\0 & 0 & 1 & 0 & -7 & 9 \\0 & 0 & 0 & 0 & 1 & 0 \\0 & 0 & 0 & 0 & 0 & 1\end.

The last three columns of are zero columns. Therefore, the three last vectors of,\left[\!\! \begin{array}{r} 3 \\ -5 \\ 1 \\ 0 \\ 0 \\ 0 \end{array} \right],\;\left[\!\! \begin{array}{r} -2 \\ 1 \\ 0 \\ -7 \\ 1 \\ 0 \end{array} \right],\;\left[\!\! \begin{array}{r} 8 \\ -4 \\ 0 \\ 9 \\ 0 \\ 1 \end{array} \right] are a basis of the kernel of .

Proof that the method computes the kernel: Since column operations correspond to post-multiplication by invertible matrices, the fact that

\begin{bmatrix}A\\hlineI\end{bmatrix}

reduces to

\begin{bmatrix}B\\hlineC\end{bmatrix}

means that there exists an invertible matrix

P

such that

\begin{bmatrix}A\\hlineI\end{bmatrix}P=\begin{bmatrix}B\\hlineC\end{bmatrix},

with

B

in column echelon form. Thus and A column vector

v

belongs to the kernel of

A

(that is

Av=0

) if and only if

Bw=0,

where As

B

is in column echelon form, if and only if the nonzero entries of

w

correspond to the zero columns of By multiplying by one may deduce that this is the case if and only if

v=Cw

is a linear combination of the corresponding columns of

Numerical computation

The problem of computing the kernel on a computer depends on the nature of the coefficients.

Exact coefficients

If the coefficients of the matrix are exactly given numbers, the column echelon form of the matrix may be computed with Bareiss algorithm more efficiently than with Gaussian elimination. It is even more efficient to use modular arithmetic and Chinese remainder theorem, which reduces the problem to several similar ones over finite fields (this avoids the overhead induced by the non-linearity of the computational complexity of integer multiplication).

For coefficients in a finite field, Gaussian elimination works well, but for the large matrices that occur in cryptography and Gröbner basis computation, better algorithms are known, which have roughly the same computational complexity, but are faster and behave better with modern computer hardware.

Floating point computation

For matrices whose entries are floating-point numbers, the problem of computing the kernel makes sense only for matrices such that the number of rows is equal to their rank: because of the rounding errors, a floating-point matrix has almost always a full rank, even when it is an approximation of a matrix of a much smaller rank. Even for a full-rank matrix, it is possible to compute its kernel only if it is well conditioned, i.e. it has a low condition number.[5]

Even for a well conditioned full rank matrix, Gaussian elimination does not behave correctly: it introduces rounding errors that are too large for getting a significant result. As the computation of the kernel of a matrix is a special instance of solving a homogeneous system of linear equations, the kernel may be computed with any of the various algorithms designed to solve homogeneous systems. A state of the art software for this purpose is the Lapack library.

See also

Bibliography

External links

Notes and References

  1. Web site: Kernel. Weisstein. Eric W.. mathworld.wolfram.com. en. 2019-12-09.
  2. Web site: Kernel (Nullspace) Brilliant Math & Science Wiki. brilliant.org. en-us. 2019-12-09.
  3. Linear algebra, as discussed in this article, is a very well established mathematical discipline for which there are many sources. Almost all of the material in this article can be found in,, and Strang's lectures.
  4. Web site: Weisstein. Eric W.. Rank-Nullity Theorem. mathworld.wolfram.com. en. 2019-12-09.
  5. Web site: Archived copy . 2015-04-14 . https://web.archive.org/web/20170829031912/http://www.math.ohiou.edu/courses/math3600/lecture11.pdf . 2017-08-29 . dead .