Primes in progressions, Euclid's way
Lemma.primes_mod_11_eq_1
Proved. 0 attempts so far.
Set.Infinite {p : ℕ | p.Prime ∧ p % 11 = 1}Imports: Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity
Proof
import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity
namespace Lemma.Q111
theorem prime_p : Nat.Prime 11 := by decide
theorem key (x : ℕ) (hx : 11 ∣ x) (q : ℕ) (hq : q.Prime)
(hd : q ∣ x ^ 10 + x ^ 9 + x ^ 8 + x ^ 7 + x ^ 6 + x ^ 5 + x ^ 4 + x ^ 3 + x ^ 2 + x + 1) : q % 11 = 1 ∧ ¬ q ∣ x := by
haveI := Fact.mk hq
haveI : Fact (Nat.Prime 11) := Fact.mk prime_p
have h1 : ((x ^ 10 + x ^ 9 + x ^ 8 + x ^ 7 + x ^ 6 + x ^ 5 + x ^ 4 + x ^ 3 + x ^ 2 + x + 1 : ℕ) : ZMod q) = 0 :=
(CharP.cast_eq_zero_iff (ZMod q) q _).2 hd
push_cast at h1
have hndvd : ¬ q ∣ x := by
intro hqx
have : (x : ZMod q) = 0 := (CharP.cast_eq_zero_iff (ZMod q) q _).2 hqx
rw [this] at h1
simp at h1
refine ⟨?_, hndvd⟩
have hx0 : (x : ZMod q) ≠ 0 := by
intro h
exact hndvd ((CharP.cast_eq_zero_iff (ZMod q) q _).1 h)
have hx1 : (x : ZMod q) ≠ 1 := by
intro h
rw [h] at h1
have h3 : ((11 : ℕ) : ZMod q) = 0 := by push_cast; linear_combination h1
have hq3 : q ∣ 11 := (CharP.cast_eq_zero_iff (ZMod q) q _).1 h3
have : q = 11 := (Nat.prime_dvd_prime_iff_eq hq prime_p).1 hq3
exact hndvd (this ▸ hx)
have hx3 : (x : ZMod q) ^ 11 = 1 := by
linear_combination ((x : ZMod q) - 1) * h1
have hord : orderOf (x : ZMod q) = 11 := orderOf_eq_prime hx3 hx1
have hdvd : 11 ∣ q - 1 := hord ▸ ZMod.orderOf_dvd_card_sub_one hx0
have h2 := hq.two_le
omega
end Lemma.Q111
theorem Lemma.primes_mod_11_eq_1 :
Set.Infinite {p : ℕ | p.Prime ∧ p % 11 = 1} := by
apply Set.infinite_of_forall_exists_gt
intro n
set x := (n + 22).factorial with hxdef
have hx6 : 11 ∣ x := Nat.dvd_factorial (by norm_num) (by omega)
have hN : x ^ 10 + x ^ 9 + x ^ 8 + x ^ 7 + x ^ 6 + x ^ 5 + x ^ 4 + x ^ 3 + x ^ 2 + x + 1 ≠ 1 := by
have : 0 < x := Nat.factorial_pos _
omega
have hq := Nat.minFac_prime hN
have hqd := Nat.minFac_dvd (x ^ 10 + x ^ 9 + x ^ 8 + x ^ 7 + x ^ 6 + x ^ 5 + x ^ 4 + x ^ 3 + x ^ 2 + x + 1)
obtain ⟨h6, hnd⟩ := Lemma.Q111.key x hx6 _ hq hqd
refine ⟨_, ⟨hq, h6⟩, ?_⟩
by_contra hle
push_neg at hle
exact hnd (Nat.dvd_factorial hq.pos (by omega))
Attempts
Nobody has worked on this yet.
Chat about it
No messages yet.
Messages in the program's chat that name primes_mod_11_eq_1 or one of its units.