Advanced maths

Finite-field basis and span finder

Find an exact row-space basis over a prime field, inspect modular row reduction and visualize every span point in two dimensions.

Your numbers

Use a prime number. Composite moduli do not define the field used by this elimination method.
Use parentheses, or separate vector rows with newlines or semicolons. Enter 1–12 vectors of equal length, with whole coordinates of magnitude at most one billion.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Try it, understand it

Explore the result

Compare modular dependence, the RREF row basis and the exact size of a finite span.

Worked example comparison
ExampleOutputWhat to notice
Dependent rows over F5Dimension of the input span over F51The default rows are all multiples of one vector modulo 5.
Fill the finite planeDimension of the input span over F52Two independent directions span all 25 points.
Zero subspaceDimension of the input span over F50Rank zero means an empty basis and exactly one span vector.
Three coordinatesDimension of the input span over F32Rank two gives nine span vectors; no two-dimensional projection is substituted.

Check your understanding

Does the default list have the same rank over the real numbers?

No. Its first two rows have real determinant −5 but that determinant is zero modulo 5.

Does adding a duplicate row increase the span size?

No. It adds no independent direction.

Behind the numbers

How this calculation works

Reduce coordinates modulo the selected prime, then use modular inverses to perform exact row operations. The nonzero reduced rows form a basis of the input span. A complete residue-grid plot is supplied only for two coordinates, where all ambient and span points can be displayed.

THE FORMULAdimension(span) = number of nonzero RREF rows; |span| = p^rank

A worked example

Over F5, (3,1) is three times (1,2), and (2,4) is twice (1,2). The three entered vectors therefore span one direction, with RREF basis {(1,2)} and exactly five span vectors. Over the real numbers the same integer rows need not have the same rank.

Good to know

Prime modulus 2–31, coordinate dimension 1–8, and 1–12 integer vectors. The basis is made of nonzero RREF rows, not necessarily a subset of the original rows. Only two-dimensional spans are enumerated and plotted. The residue grid is a membership display, not Euclidean geometry or a continuous line.

A little curiosity

The coefficient field changes the question

A vector list does not have a field-independent rank. This page works over Fp, the field of residue classes modulo the selected prime p. The same integer coordinates can describe different dependence relationships over the real numbers and over a finite field. Establish the field before interpreting the rank or comparing another calculator’s output.

For the default rows (1,2), (3,1) and (2,4), arithmetic modulo 5 gives 3 times (1,2) equal to (3,1), because 6 has residue 1. All three vectors are therefore dependent and their span has dimension one. Over the real numbers, the first two rows have determinant −5, which is nonzero there but becomes zero modulo 5.

Follow modular row operations

The input table first replaces every coordinate with its residue from zero through p minus one. A negative entry is not discarded: −1 becomes 4 in F5. A nonzero pivot is scaled by its multiplicative inverse, then its column is cleared from other rows. The working list records swaps, scalings and elimination steps with their modulus.

Division by a pivot is justified because p is prime. For instance, 2 is the inverse of 3 in F5 since their product leaves remainder 1. A composite modulus can have nonzero elements without inverses, so this tool rejects it rather than applying an invalid field algorithm. The linear congruence calculator can inspect an individual modular inverse by solving a·x ≡ 1 modulo p.

Read a row basis without changing the input convention

Each entered row is one vector. The nonzero RREF rows form a basis for the row span, and their number is its dimension. These basis rows can be linear combinations of the original vectors; they do not have to appear verbatim in the input. A zero row contributes no new direction, and repeating an input vector cannot enlarge the span.

The basis and dimension finder uses a separate real or rational coordinate model and its own column-input convention. Do not paste a finite-field problem there and assume that an ordinary rational elimination reproduces reduction modulo p. The ideal and quotient ring calculator studies a different algebraic construction; a ring quotient being finite does not make every modulus a prime coefficient field.

A little curiosity

Count a span before drawing it

A rank-r subspace over Fp contains exactly p raised to r distinct vectors. The coefficients of a basis combination each have p possibilities, and independence makes those combinations distinct. The default rank-one span over F5 therefore has five vectors: (0,0), (1,2), (2,4), (3,1) and (4,3). The ambient plane has twenty-five vectors.

The zero subspace has rank zero, an empty basis and p to the zeroth power equal to one vector. That vector is the zero vector. Empty basis does not mean empty span. A full-rank list in n coordinates spans all p to the nth power ambient vectors, but the number of rows supplied can still exceed n and make the full input list dependent.

Interpret the finite grid and its limits

With two coordinates the SVG shows every ambient residue pair, overlays all span points and marks entered vectors with hollow circles. Repeated input vectors may occupy the same visible point. Residue coordinates wrap modulo p under arithmetic, so a pattern that looks bent or disconnected on this grid can still be one finite-field subspace. A drawn straight line is not the definition of its span.

For more than two coordinates, the exact basis, row operations and span size remain available, but the tool does not substitute a projection and call it the full span. The SVG can be downloaded for two-dimensional cases and the basis can be copied in every supported dimension. Bounds keep the row reduction and complete finite-grid display inspectable without uploading inputs to a server.

A few questions, answered

Why must the modulus be prime?

Elimination divides by nonzero pivots. Every nonzero residue has an inverse in Fp when p is prime; this can fail for composite moduli.

Must the basis be selected from the original vectors?

Not for the basis reported here. Nonzero RREF rows form a row-space basis and may be combinations of the original vectors.

Does rank zero mean there are no vectors in the span?

No. The zero subspace contains the zero vector, has an empty basis and has size one.

Why is no span plot shown for three coordinates?

This page enumerates and displays the full span only in two dimensions. Higher-dimensional cases retain exact rank and basis results without presenting a projection as the whole space.

Find your calculator

Start typing to explore the library.