Finite Fields

lean4-prooffield-theoryvisualization
Fpn=pn\lvert \mathbb{F}_{p^n} \rvert = p^n

Statement

For every prime pp and positive integer nn, there exists a unique (up to isomorphism) field with exactly pnp^n elements, denoted Fpn\mathbb{F}_{p^n} or GF(p,n)\text{GF}(p,n). It is the splitting field of xpnxx^{p^n} - x over Fp\mathbb{F}_p.

In Mathlib: GaloisField p n is the concrete construction, and GaloisField.card proves Nat.card (GaloisField p n) = p ^ n.

Key structural facts:

  • Fpn×\mathbb{F}_{p^n}^\times is cyclic of order pn1p^n - 1.
  • Fpn\mathbb{F}_{p^n} is Galois over Fp\mathbb{F}_p with cyclic Galois group generated by the Frobenius ϕ:xxp\phi: x \mapsto x^p.
  • FpmFpn\mathbb{F}_{p^m} \subseteq \mathbb{F}_{p^n} iff mnm \mid n.

Visualization

The field F4=F2[x]/(x2+x+1)\mathbb{F}_4 = \mathbb{F}_2[x]/(x^2+x+1).

Elements: {0,1,α,α+1}\{0, 1, \alpha, \alpha+1\} where α2=α+1\alpha^2 = \alpha + 1 (i.e., α\alpha is a root of x2+x+1x^2 + x + 1).

Addition table (characteristic 2, so a+a=0a + a = 0):

++0011α\alphaα+1\alpha{+}1
000011α\alphaα+1\alpha{+}1
111100α+1\alpha{+}1α\alpha
α\alphaα\alphaα+1\alpha{+}10011
α+1\alpha{+}1α+1\alpha{+}1α\alpha1100

Multiplication table (using α2=α+1\alpha^2 = \alpha + 1):

×\times11α\alphaα+1\alpha{+}1
1111α\alphaα+1\alpha{+}1
α\alphaα\alphaα+1\alpha{+}111
α+1\alpha{+}1α+1\alpha{+}111α\alpha

Note: F4×={1,α,α+1}\mathbb{F}_4^\times = \{1, \alpha, \alpha+1\} is cyclic of order 3 generated by α\alpha.

Proof Sketch

  1. Existence. The polynomial xpnxx^{p^n} - x over Fp\mathbb{F}_p is separable (its derivative is 10-1 \ne 0), so it has pnp^n distinct roots in its splitting field. These roots form a subfield (closed under addition and multiplication by Freshman's dream), which has exactly pnp^n elements.
  2. Uniqueness. If FF is any field with pnp^n elements, then F×F^\times has order pn1p^n - 1, so every aF×a \in F^\times satisfies apn1=1a^{p^n - 1} = 1, hence apn=aa^{p^n} = a for all aFa \in F. Thus FF consists exactly of roots of xpnxx^{p^n} - x, making FF the splitting field.
  3. Subfield lattice. FpmFpn\mathbb{F}_{p^m} \subseteq \mathbb{F}_{p^n} iff every root of xpmxx^{p^m} - x is also a root of xpnxx^{p^n} - x, which holds iff pm1pn1p^m - 1 \mid p^n - 1, iff mnm \mid n.

Connections

Finite fields are the arena for Fermat's Little TheoremFermat's Little Theoremapa(modp)a^p \equiv a \pmod{p}For prime p, a^p is congruent to a mod pRead more → (the statement ap=aa^p = a for aFpa \in \mathbb{F}_p is exactly membership in the splitting field of xpxx^p - x). The multiplicative group structure is central to Quadratic ReciprocityQuadratic Reciprocity(pq)(qp)=(1)p12q12\left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\frac{p-1}{2}\cdot\frac{q-1}{2}}Relationship between solvability of quadratic congruences for two odd primesRead more → via the Legendre symbol over Fp\mathbb{F}_p.

Lean4 Proof

/-- The Galois field GF(p, n) has exactly p^n elements. -/
theorem galoisField_card (p : ) [Fact p.Prime] (n : ) (hn : n  0) :
    Nat.card (GaloisField p n) = p ^ n :=
  GaloisField.card p hn