Lemmas of Gauss and Eisenstein #
This file contains the Lemmas of Gauss and Eisenstein on the Legendre symbol.
The main results are ZMod.gauss_lemma and ZMod.eisenstein_lemma.
theorem ZMod.Ico_map_valMinAbs_natAbs_eq_Ico_map_id (p : ℕ) [hp : Fact (Nat.Prime p)] (a : ZMod p) (hap : 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.sum_mul_div_add_sum_mul_div_eq_mul (p q : ℕ) [hp : Fact (Nat.Prime p)] (hq0 : ↑q ≠ 0) :
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.