Documentation

LeanPool.GranvilleMoore.Defs.TheFermatQuotient

The Fermat quotient #

For a prime p and an integer x, the Fermat quotient is the rational number q_p(x) = (x ^ (p - 1) - 1) / p. It is an integer exactly when p ∤ x, but the quotient is taken in ℚ so that the definition carries no side condition and the integrality is a theorem about it rather than part of it.

Main definitions #

Implementation notes #

fermatUnit is an abbrev: it is notation for x ^ (p - 1) and has nothing to say about itself, so every pow lemma in Mathlib applies to it unchanged.

fermatQuotient is ℚ-valued and unconditional; (p : ℚ) ≠ 0 is needed only to cancel the denominator, see GranvilleMoore.natCast_mul_fermatQuotient.

@[reducible, inline]
abbrev GranvilleMoore.fermatUnit (p : ℕ) (x : ℤ) :

The unit attached to an integer x at p: the power t_x = x ^ (p - 1).

For p prime with p ∤ x this is a principal unit at p, congruent to 1 modulo p by Fermat's little theorem.

Equations
Instances For

    The Fermat quotient of an integer x at p: q_p(x) = (x ^ (p - 1) - 1) / p, the quotient being taken in ℚ.

    For p prime with p ∤ x this rational number is an integer.

    Equations
    Instances For
      theorem GranvilleMoore.fermatQuotient_eq_div (p : ℕ) (x : ℤ) :
      fermatQuotient p x = (↑x ^ (p - 1) - 1) / ↑p

      The Fermat quotient written out with the numerator cast to ℚ termwise.

      theorem GranvilleMoore.natCast_mul_fermatQuotient {p : ℕ} (hp : p ≠ 0) (x : ℤ) :
      ↑p * fermatQuotient p x = ↑x ^ (p - 1) - 1

      Cancelling the denominator in the Fermat quotient: this is the identity x ^ (p - 1) = 1 + p * q_p(x) in ℚ, and the only property of fermatQuotient its consumers need.

      @[simp]

      The Fermat quotient of 1 vanishes: q_p(1) = 0.

      The Frobenius exponent e_k = ∑_{r < k} p ^ r, so that e₀ = 0 and e₁ = 1.

      It is the exponent for which (x ^ (p - 1)) ^ e_k = x ^ (p ^ k - 1), since (p - 1) * e_k = p ^ k - 1.

      Equations
      Instances For

        The Frobenius exponent is the truncated geometric sum, which is how Mathlib's geometric-sum API applies to it.

        @[simp]

        The Frobenius exponent of the empty tower vanishes: e_0 = 0.

        @[simp]

        The first Frobenius exponent is 1: e_1 = 1.

        The recursion e_{k+1} = e_k + p ^ k defining the Frobenius exponent.

        Peeling the recursion off the bottom instead: e_{k+1} = 1 + p * e_k.