{"attempts":[{"claim":{"id":11,"notes":"Euclid: N=6*(n+3)!-1. Lemma by strong induction: N%6=5 → ∃ prime q≡5 (mod 6), q∣N (minFac is odd and not 3; if ≡1 then the cofactor ≡5 and smaller). q>n since q∤6x. Elementary, uses only omega/Nat lemmas.","report":null,"status":"verified"},"entry":{"id":11,"kind":"result","title":"Network best: theorems proved 3"},"finished":1791834176,"name":"rgbrgb","node":2,"outcome":"verified: theorems proved 3 (network best), cleared the threshold","started":1791832938,"status":"done","task":17,"unit":39}],"challenge":{"imports":["Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity"],"name":"Lemma.primes_mod_6_eq_5","statement":"Set.Infinite {p : ℕ | p.Prime ∧ p % 6 = 5}"},"chat":[{"created":1791834178,"id":9,"name":"rgbrgb","node":2,"program":"euclid-primes","tags":[],"text":"Verified: Lemma.primes_mod_6_eq_5 (score 3). $N=6(n+3)!-1$; strong induction lemma \"$N\\equiv5 \\pmod 6 \\Rightarrow$ a prime factor $\\equiv5$\": minFac is $\\ne2,3$; if it is $\\equiv1$, the cofactor is $\\equiv5$ and smaller. Tips: an earlier draft with `interval_cases (m % 6) <;> simp_all` hit the 300s compile timeout, and `omega` on Nat.mul_mod after rewriting is fast. The same template should give 3_eq_2, 4_eq_3 and 12_eq_11 (with $N=12x-1$)."}],"disproof":null,"program":{"checked_by":"nodes","id":"euclid-primes","lean":"v4.34.1","mathlib":"v4.34.1","project":null,"title":"Primes in progressions, Euclid's way"},"proof":"import Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity\n\nnamespace Lemma.P65\n\ntheorem exists_factor (N : ℕ) (hN : N % 6 = 5) :\n    ∃ q, q.Prime ∧ q % 6 = 5 ∧ q ∣ N := by\n  induction N using Nat.strong_induction_on with\n  | _ N ih =>\n    have hN1 : N ≠ 1 := by omega\n    have hq := Nat.minFac_prime hN1\n    have hqd := Nat.minFac_dvd N\n    set q := N.minFac with hqdef\n    have hq2 : q % 2 = 1 := by\n      by_contra h\n      have h2 : 2 ∣ q := by omega\n      have : q = 2 := ((Nat.prime_dvd_prime_iff_eq Nat.prime_two hq).1 h2).symm\n      rw [this] at hqd\n      omega\n    have hq3 : q % 3 ≠ 0 := by\n      intro h\n      have h3 : 3 ∣ q := by omega\n      have : q = 3 := ((Nat.prime_dvd_prime_iff_eq Nat.prime_three hq).1 h3).symm\n      rw [this] at hqd\n      omega\n    by_cases h5 : q % 6 = 5\n    · exact ⟨q, hq, h5, hqd⟩\n    · have h1 : q % 6 = 1 := by omega\n      obtain ⟨m, hm⟩ := hqd\n      have hmod := Nat.mul_mod q m 6\n      rw [h1, ← hm, hN] at hmod\n      have hm5 : m % 6 = 5 := by omega\n      have hq2' := hq.two_le\n      have hmlt : m < N := by\n        have hm0 : 0 < m := by\n          apply Nat.pos_of_ne_zero\n          rintro rfl\n          rw [mul_zero] at hm\n          omega\n        rw [hm]\n        calc m = 1 * m := (one_mul m).symm\n          _ < q * m := Nat.mul_lt_mul_of_pos_right hq.one_lt hm0\n      obtain ⟨r, hr, hr5, hrd⟩ := ih m hmlt hm5\n      exact ⟨r, hr, hr5, hrd.trans ⟨q, by rw [hm, mul_comm]⟩⟩\n\nend Lemma.P65\n\ntheorem Lemma.primes_mod_6_eq_5 :\n    Set.Infinite {p : ℕ | p.Prime ∧ p % 6 = 5} := by\n  apply Set.infinite_of_forall_exists_gt\n  intro n\n  set x := (n + 3).factorial with hxdef\n  have hx0 : 0 < x := Nat.factorial_pos _\n  obtain ⟨q, hq, h5, hd⟩ := Lemma.P65.exists_factor (6 * x - 1) (by omega)\n  refine ⟨q, ⟨hq, h5⟩, ?_⟩\n  by_contra hle\n  push_neg at hle\n  have hqx : q ∣ 6 * x := Dvd.dvd.mul_left (Nat.dvd_factorial hq.pos (by omega)) 6\n  have h1 : q ∣ 6 * x - (6 * x - 1) := Nat.dvd_sub hqx hd\n  have : 6 * x - (6 * x - 1) = 1 := by omega\n  rw [this] at h1\n  exact hq.one_lt.ne' (Nat.dvd_one.1 h1)\n","proposals":[],"row":{"attempts":1,"blocker":null,"either":false,"last":1791834176,"name":"Lemma.primes_mod_6_eq_5","statement":null,"status":"proved"}}