The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V12. Number theory

Mathlib.NumberTheory.LegendreSymbol.GaussEisensteinLemmas

7 declarations. Mathlib docs · Source

theorem ZMod.Ico_map_valMinAbs_natAbs_eq_Ico_map_id E1 #

∀ (p : ℕ) [hp : Fact (Nat.Prime p)] (a : ZMod p),
  a ≠ 0 →
    Multiset.map (fun x ↦ (a * ↑x).valMinAbs.natAbs) (Finset.Ico 1 (p / 2).succ).val =
      Multiset.map (fun a ↦ a) (Finset.Ico 1 (p / 2).succ).val

The image of the map sending a nonzero natural number x ≤ p / 2 to the absolute value of the integer in (-p/2, p/2] that is congruent to a * x mod p is the set of nonzero natural numbers x such that x ≤ p / 2.

theorem ZMod.gauss_lemma_aux E0 #

∀ (p : ℕ) [hp : Fact (Nat.Prime p)] {a : ℤ},
  ↑a ≠ 0 → ↑a ^ (p / 2) = ↑((-1) ^ {x ∈ Finset.Ico 1 (p / 2).succ | p / 2 < (↑a * ↑x).val}.card)

theorem ZMod.gauss_lemma E1 #

∀ {p : ℕ} [h : Fact (Nat.Prime p)] {a : ℤ},
  p ≠ 2 → ↑a ≠ 0 → legendreSym p a = (-1) ^ {x ∈ Finset.Ico 1 (p / 2).succ | p / 2 < (↑a * ↑x).val}.card

Gauss' lemma. The Legendre symbol can be computed by considering the number of naturals less than p/2 such that (a * x) % p > p / 2.

theorem ZMod.eisenstein_lemma_aux E0 #

∀ (p : ℕ) [inst : Fact (Nat.Prime p)] [Fact (p % 2 = 1)] {a : ℕ},
  a % 2 = 1 →
    ↑a ≠ 0 →
      {x ∈ Finset.Ico 1 (p / 2).succ | p / 2 < (↑a * ↑x).val}.card ≡ ∑ x ∈ Finset.Ico 1 (p / 2).succ, x * a / p [MOD 2]

theorem ZMod.div_eq_filter_card E1 #

∀ {a b c : ℕ}, 0 < b → a / b ≤ c → a / b = {x ∈ Finset.Ico 1 c.succ | x * b ≤ a}.card

theorem ZMod.sum_mul_div_add_sum_mul_div_eq_mul E1 #

∀ (p q : ℕ) [hp : Fact (Nat.Prime p)],
  ↑q ≠ 0 → ∑ a ∈ Finset.Ico 1 (p / 2).succ, a * q / p + ∑ a ∈ Finset.Ico 1 (q / 2).succ, a * p / q = p / 2 * (q / 2)

Each of the sums in this lemma is the cardinality of the set of integer points in each of the two triangles formed by the diagonal of the rectangle (0, p/2) × (0, q/2). Adding them gives the number of points in the rectangle.

theorem ZMod.eisenstein_lemma E2 #

∀ {p : ℕ} [inst : Fact (Nat.Prime p)],
  p ≠ 2 → ∀ {a : ℕ}, a % 2 = 1 → ↑a ≠ 0 → legendreSym p ↑a = (-1) ^ ∑ x ∈ Finset.Ico 1 (p / 2).succ, x * a / p

Eisenstein's lemma