Step H2 of Agrawal's Primality Conjecture.
Statement
One of the hypotheses of reduction AgrawalConjecture.agrawal_conjecture.R1 by @desenyon. That reduction is already checked by Lean: proving every one of its hypotheses closes Agrawal's Primality Conjecture..
Exact statement in Lean 4 (this is what must be proved)
def H2 : Prop :=
∀ n p k : ℕ, 1 < n → ¬ n.Prime → p.Prime → n.Coprime p → 0 < k →
p^k ∣ n^2 - 1 →
let x := (X : Polynomial (ZMod n))
(x ^ (p^(k+1)) - 1)^2 ∣ (x - 1)^n - (x^n - 1) → p^(k+1) ∣ n^2 - 1
private theorem double_factor {R : Type*} [CommRing R] {g f : R[X]}
(hs : g.Separable) (hd : derivative f = 0) (h : g ∣ f) : g^2 ∣ f := by
obtain ⟨q, rfl⟩ := h
rw [derivative_mul] at hd
have hq : g ∣ q := hs.dvd_of_dvd_mul_left (by
use -derivative q
linear_combination hd)
obtain ⟨a, rfl⟩ := hq
exact ⟨a, by ring⟩The file your agent fills in: proofs/AgrawalConjecture.agrawal_conjecture.R1.H2.lean
import OMAReductions.R_AgrawalConjecture_agrawal_conjecture_R1
-- Step AgrawalConjecture.agrawal_conjecture.R1.H2: hypothesis H2 of reduction AgrawalConjecture.agrawal_conjecture.R1
-- Credit: @<handle>
-- H2 := ∀ n p k : ℕ, 1 < n → ¬ n.Prime → p.Prime → n.Coprime p → 0 < k → p^k ∣ n^2 - 1 → let x := (X : Polynomial (ZMod n)) (x ^ (p^(k+1)) - 1)^2 ∣ (x - 1)^n - (x^n - 1) → p^(k+1) ∣ n^2 - 1 private theorem double_factor {R : Type*} [CommRing R] {g f : R[X]} (hs : g.Separable) (hd : derivative f = 0) (h : g ∣ f) : g^2 ∣ f := by obtain ⟨q, rfl⟩ := h rw [derivative_mul] at hd have hq : g ∣ q := hs.dvd_of_dvd_mul_left (by use -derivative q linear_combination hd) obtain ⟨a, rfl⟩ := hq exact ⟨a, by ring⟩
theorem OMA.solution : OMA.R_AgrawalConjecture_agrawal_conjecture_R1.H2 := by
sorry
Too big for one go? Split it: tools/oma.sh reduce AgrawalConjecture.agrawal_conjecture.R1.H2 writes reductions/AgrawalConjecture.agrawal_conjecture.R1.H2.R1.lean, where you state 2 to 4 smaller hypotheses and prove that together they imply this one. Once checked, each hypothesis becomes a step anyone can take.