mathlib documentation

field_theory.​finite

field_theory.​finite

Finite fields

This file contains basic results about finite fields. Throughout most of this file, K denotes a finite field and q is notation for the cardinality of K.

Main results

  1. Every finite integral domain is a field (field_of_integral_domain).
  2. The unit group of a finite field is a cyclic group of order q - 1. (finite_field.is_cyclic and card_units)
  3. sum_pow_units: The sum of x^i, where x ranges over the units of K, is
    • q-1 if q-1 ∣ i
    • 0 otherwise
  4. finite_field.card: The cardinality q is a power of the characteristic of K. See card' for a variant.

Notation

Throughout most of this file, K denotes a finite field and q is notation for the cardinality of K.

The cardinality of a field is at most n times the cardinality of the image of a degree n polynomial

theorem finite_field.​exists_root_sum_quadratic {R : Type u_2} [integral_domain R] [fintype R] {f g : polynomial R} :
f.degree = 2g.degree = 2fintype.card R % 2 = 1(∃ (a b : R), polynomial.eval a f + polynomial.eval b g = 0)

If f and g are quadratic polynomials, then the f.eval a + g.eval b = 0 has a solution.

theorem finite_field.​card_units {K : Type u_1} [field K] [fintype K] :

theorem finite_field.​prod_univ_units_id_eq_neg_one {K : Type u_1} [field K] [fintype K] :
finset.univ.prod (λ (x : units K), x) = -1

theorem finite_field.​pow_card_sub_one_eq_one {K : Type u_1} [field K] [fintype K] (a : K) :
a 0a ^ (fintype.card K - 1) = 1

theorem finite_field.​card (K : Type u_1) [field K] [fintype K] (p : ) [char_p K p] :
∃ (n : ℕ+), nat.prime p fintype.card K = p ^ n

theorem finite_field.​card' {K : Type u_1} [field K] [fintype K] :
∃ (p : ) (n : ℕ+), nat.prime p fintype.card K = p ^ n

@[simp]
theorem finite_field.​cast_card_eq_zero (K : Type u_1) [field K] [fintype K] :

theorem finite_field.​forall_pow_eq_one_iff (K : Type u_1) [field K] [fintype K] (i : ) :
(∀ (x : units K), x ^ i = 1) fintype.card K - 1 i

theorem finite_field.​sum_pow_units (K : Type u_1) [field K] [fintype K] (i : ) :
finset.univ.sum (λ (x : units K), x ^ i) = ite (fintype.card K - 1 i) (-1) 0

The sum of x ^ i as x ranges over the units of a finite field of cardinality q is equal to 0 unless (q - 1) ∣ i, in which case the sum is q - 1.

theorem finite_field.​sum_pow_lt_card_sub_one {K : Type u_1} [field K] [fintype K] (i : ) :
i < fintype.card K - 1finset.univ.sum (λ (x : K), x ^ i) = 0

The sum of x ^ i as x ranges over a finite field of cardinality q is equal to 0 if i < q - 1.

theorem zmod.​sum_two_squares (p : ) [hp : fact (nat.prime p)] (x : zmod p) :
∃ (a b : zmod p), a ^ 2 + b ^ 2 = x

theorem char_p.​sum_two_squares (R : Type u_1) [integral_domain R] (p : ) [fact (0 < p)] [char_p R p] (x : ) :
∃ (a b : ), a ^ 2 + b ^ 2 = x

@[simp]
theorem zmod.​pow_totient {n : } [fact (0 < n)] (x : units (zmod n)) :
x ^ n.totient = 1

The Fermat-Euler totient theorem. nat.modeq.pow_totient is an alternative statement of the same theorem.

theorem nat.​modeq.​pow_totient {x n : } :
x.coprime nx ^ n.totient 1 [MOD n]

The Fermat-Euler totient theorem. zmod.pow_totient is an alternative statement of the same theorem.