← LibrarySolving Systems of Linear EquationsEngineering · MathematicsLesson 157/385← PrevNext →
ArticlePublished 7 Aug 20263 min readBy Kevin Jogin

Engineering  /  Mathematics  — Modules, Vector Spaces and Matrices

Solving Systems of Linear Equations

Solving linear systems over a field: consistency, the structure of the solution set, and modular methods for exact rational answers.

Page KV-MATH-0429Reading time 3 minReviewed 2026-08-07Author Kevin Jogin

Executive summary

A linear system is consistent when the right-hand side lies in the image, and its solution set is then a coset of the kernel. Elimination decides consistency and produces a solution simultaneously.

Over the rationals, exact solving uses modular computation and rational reconstruction to avoid coefficient growth.

Learning objectives

  1. Determine consistency and describe the solution set.
  2. Solve by elimination on the augmented matrix.
  3. Apply the modular method for exact rational solutions.

01Consistency and solution structure

Theorem

Solution set structure

The system Ax = b is consistent if and only if rank(A) = rank([A | b]).

When consistent, the solution set is x₀ + ker(A) for any particular solution x₀ — a coset of the kernel, of dimension equal to the nullity.

Outcomes by rank comparison
rank(A)rank([A|b])Outcome
rr < nInfinitely many solutions, a coset of dimension n − r
nnUnique solution
rr + 1Inconsistent — no solution

The rank condition is the first isomorphism theorem in practical form: b is reachable exactly when adding it to the columns does not increase the rank, that is, when it already lies in the image.

02Solving by elimination

Algorithm

Solve Ax = b

Inputmatrix A, vector b over a field
Outputa particular solution and a kernel basis, or inconsistency
  1. Form the augmented matrix [A | b].
  2. Reduce to row echelon form.
  3. If a row has all zeros in the A block but a non-zero entry in the b column, report inconsistent.
  4. Set every free variable to zero.
  5. Back-substitute to determine the pivot variables, giving a particular solution.
  6. Compute a kernel basis to describe the full solution set.
Cost  O(n³) field operations

03Exact rational solving

Over the rationals, direct elimination causes severe coefficient growth. The modular method avoids it entirely.

  1. Bound the answer

    Use Cramer's rule with Hadamard's bound to bound numerators and denominators of the true solution.

  2. Choose primes

    Pick word-sized primes whose product exceeds twice the bound.

  3. Solve modulo each prime

    Run elimination in each F_p; all arithmetic is single precision.

  4. Chinese remainder

    Combine the modular solutions componentwise.

  5. Reconstruct rationals

    Apply rational reconstruction to each component.

  6. Verify

    Substitute back into the original system — cheap and complete.

The verification step is worth keeping even when the bound is rigorous. Substituting a candidate solution costs a matrix-vector product, far less than the solve, and catches both unlucky primes and underestimated bounds.

04Frequently asked questions

Why is the solution set a coset rather than a subspace?

Because it contains a particular solution that is generally non-zero, and the difference of any two solutions lies in the kernel. Only a homogeneous system, with b zero, has a subspace as its solution set.

How are the bounds obtained?

By Cramer's rule: each component is a ratio of determinants, and Hadamard's bound limits each determinant by the product of the row norms. This gives a rigorous, if pessimistic, bound.

Is the modular method always faster?

For large systems with small entries, substantially. For very small systems the overhead of multiple modular solves and reconstruction exceeds the direct cost, so implementations switch based on size.

Sources and method

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

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

Computing Rank, Kernel and ImageArticle · MathematicsNEXT LESSON →Algebras over a RingArticle · MathematicsGaussian EliminationArticle · MathematicsThe Field of Fractions of an Integral DomainArticle · Mathematics