← LibraryComputing Rank, Kernel and ImageEngineering · MathematicsLesson 156/385← PrevNext →
ArticlePublished 7 Aug 20263 min readBy Kevin Jogin

Engineering  /  Mathematics  — Modules, Vector Spaces and Matrices

Computing Rank, Kernel and Image

Extracting rank, kernel basis and image basis from an echelon form, and the applications to polynomial factorisation.

Page KV-MATH-0428Reading time 4 minReviewed 2026-08-07Author Kevin Jogin

Executive summary

Once a matrix is in echelon form, rank, kernel and image are all read off directly. The kernel basis comes from the free columns, one basis vector per free column.

Berlekamp's factorisation algorithm is exactly a kernel computation, which is why this machinery appears in a number theory collection.

Learning objectives

  1. Extract rank, kernel and image from echelon form.
  2. Construct an explicit kernel basis.
  3. Connect the computation to polynomial factorisation.

01Reading off the invariants

  1. Rank

    The number of pivots in the echelon form.

  2. Image basis

    The pivot columns of the original matrix, not of the reduced one.

  3. Kernel dimension

    The number of free columns, equal to n minus the rank.

  4. Kernel basis

    One vector per free column: set that free variable to 1, all other free variables to 0, and back-substitute for the pivot variables.

rank + nullity = number of columns

02Constructing the kernel basis

Algorithm

Kernel basis from reduced echelon form

Inputmatrix A over a field
Outputa basis for the kernel of A
  1. Reduce A to reduced row echelon form, recording pivot columns.
  2. Identify the free columns as those without a pivot.
  3. For each free column j:
  4.   Create a vector v with vⱼ = 1 and all other free coordinates 0.
  5.   For each pivot row, set the corresponding pivot coordinate to the negative of the entry in column j.
  6.   Add v to the basis.
  7. Return the collection of vectors.
Cost  O(n³) for the reduction, O(n²) per basis vector

The resulting vectors are independent by construction, since each has a 1 in a coordinate where the others have 0, and there are exactly as many as the nullity — so they form a basis.

03Application to polynomial factorisation

Berlekamp's algorithm factors a squarefree polynomial over a finite field by computing the kernel of a specific linear map, the Berlekamp map.

Theorem

Berlekamp's key fact

For a squarefree polynomial f over F_q, the dimension of the kernel of the map v ↦ v^q − v on F_q[X]/(f) equals the number of irreducible factors of f.

So the number of factors is a nullity, computable by elimination before any factor is found. Each non-trivial kernel element then splits f by taking gcds.

  • Count factors first

    The rank computation reveals how many factors exist, which tells the algorithm when it is finished.

  • Split using kernel elements

    Each kernel element v gives gcd(f, v − c) for constants c, and these gcds separate the factors.

  • Cost

    Building the matrix dominates; the elimination is on a matrix of size the degree of f.

04Frequently asked questions

Why take image basis columns from the original matrix?

Because row operations change the column space. They preserve which sets of columns are dependent, so the pivot positions identify an independent set, but the actual vectors must come from the original.

Is the kernel basis unique?

No. Any basis of the kernel is valid, and different elimination orders give different bases. The construction above gives a canonical one relative to the choice of free columns.

How large is the Berlekamp matrix?

Its size is the degree of the polynomial, so factoring a degree-n polynomial costs O(n³) field operations for the elimination. For high degrees the Cantor-Zassenhaus method is preferred, being roughly quadratic.

Sources and method

Structural reference: Victor Shoup, A Computational Introduction to Number Theory and Algebra, Version 1, Cambridge University Press, 2005 — book pages 328-331.

This page carries the durable method layer only: definitions, constructions, algorithms, complexity results and selection criteria, authored originally for KEVOS. No text is transcribed or paraphrased from the source, and no numeric tables or benchmark data are reproduced — these are routed to live authoritative sources instead.

Author: Kevin Jogin. Last reviewed 2026-08-07.

Continue learning

Gaussian EliminationArticle · MathematicsNEXT LESSON →Solving Systems of Linear EquationsArticle · MathematicsThe Inverse of a MatrixArticle · MathematicsAlgebras over a RingArticle · Mathematics