import F04Riemann.GaussianZeroForm /-! # Cauchy Winding Cages, Exact Polygon Winding, and 29-Zero Completeness (`T = 100`) This module formalizes the Cauchy winding-cage argument-principle machinery and finite critical-line completeness certificate from `riemann-2026-10-14` (`CERTIFICATION.md`, `certify.py`, and `evidence/certification-zeros-100.json`): 1. **Exact Rational Ray-Crossing Winding Number (`edgeCrossing`, `polyWinding`)**: Matches `certify.py`'s exact rational ray-crossing counter verbatim, and proves the telescoping angle-jump identity `rayAngle q - rayAngle p + 2 π * edgeCrossingR p q = Complex.arg (q / p)` for every zero-free segment `[p, q] ⊂ ℂ \ {0}`. 2. **Zero-Free Convex Rectangular Cages (`RectBox`) and Homotopy Invariance**: - `RectBox.convex`, `RectBox.zero_not_mem`, `RectBox.homotopy_zeroFree`: any curve arc and its chord inside a zero-free rectangle are linearly homotopic in `ℂ \ {0}`. - `lift_diff_eq_arg_div_of_rectBox`: any continuous angle lift `Φ` of a curve `γ` staying inside a zero-free `RectBox` satisfies `Φ(t₁) - Φ(t₀) = Complex.arg (γ(t₁) / γ(t₀))`. - `winding_eq_polyWinding_of_convex_cover`: for any closed continuous curve covered on a partition by zero-free `RectBox`es matching a closed rational polygon, the continuous winding number `(Φ(1) - Φ(0)) / (2π)` equals `polyWinding` exactly. 3. **IVT Sign-Change Counting and Finite Critical-Line Completeness**: - `exists_strictMono_zeros_of_sign_changes`: `n` disjoint intervals with opposite signs of continuous real `Ξ` yield `n` strictly increasing zeros. - `finite_critical_line_completeness`: if the conjugation-symmetric critical-strip zero set (with no real zeros) has total multiplicity `2 n` (from the Cauchy winding cage) and contains those `n` critical-line zeros, then EVERY zero in the region lies strictly on `Re(s) = 1/2` and is simple (`mult = 1`). 4. **Exact 29 Isolating Intervals at `T = 100` (`certification-zeros-100.json`) & 3D Bridge**: - Kernel-verifies all 29 exact 192-bit rational intervals `(zero29Lower k, zero29Upper k)` in `(0, 100)` (strict positivity, strict pairwise separation, width `< 10⁻²⁸`). - Instantiates `certified_29_zeros_up_to_100` (`57 + 1 = 58 = 2 * 29`) and bridges directly to the complete 3D Gaussian zero-form positivity theorem (`certified_3D_gaussian_from_29_zeros_and_tail`). -/ namespace F04Riemann open Real Complex Set Finset /-! ### 1. Exact Rational Ray-Crossing Winding Number and Angle-Jump Identity -/ /-- Exact signed ray-crossing contribution of a directed rational edge `(p, q)` across the positive real ray `[0, ∞)` (matching `certify.py`'s `winding()` verbatim). -/ def edgeCrossing (p q : ℚ × ℚ) : ℤ := let cross := p.1 * q.2 - p.2 * q.1 if p.2 ≤ 0 ∧ 0 < q.2 ∧ 0 < cross then 1 else if q.2 ≤ 0 ∧ 0 < p.2 ∧ cross < 0 then -1 else 0 /-- Exact signed winding number of a closed rational polygon `[p₀, p₁, ..., pₘ = p₀]`. -/ def polyWinding : List (ℚ × ℚ) → ℤ | [] => 0 | [_] => 0 | p :: q :: rest => edgeCrossing p q + polyWinding (q :: rest) /-- Embed a rational plane point `(x, y) ∈ ℚ × ℚ` into `ℂ`. -/ noncomputable def toComplex (p : ℚ × ℚ) : ℂ := ⟨(p.1 : ℝ), (p.2 : ℝ)⟩ /-- Real/complex version of the exact ray-crossing counter. -/ noncomputable def edgeCrossingR (p q : ℂ) : ℤ := let cross := p.re * q.im - p.im * q.re if p.im ≤ 0 ∧ 0 < q.im ∧ 0 < cross then 1 else if q.im ≤ 0 ∧ 0 < p.im ∧ cross < 0 then -1 else 0 lemma edgeCrossingR_toComplex (p q : ℚ × ℚ) : edgeCrossingR (toComplex p) (toComplex q) = edgeCrossing p q := by unfold edgeCrossingR edgeCrossing toComplex have hcross : (p.1 : ℝ) * (q.2 : ℝ) - (p.2 : ℝ) * (q.1 : ℝ) = ((p.1 * q.2 - p.2 * q.1 : ℚ) : ℝ) := by push_cast; ring dsimp only rw [hcross] have hp_le : (p.2 : ℝ) ≤ 0 ↔ p.2 ≤ 0 := by exact_mod_cast Iff.rfl have hq_pos : (0 : ℝ) < (q.2 : ℝ) ↔ 0 < q.2 := by exact_mod_cast Iff.rfl have hq_le : (q.2 : ℝ) ≤ 0 ↔ q.2 ≤ 0 := by exact_mod_cast Iff.rfl have hp_pos : (0 : ℝ) < (p.2 : ℝ) ↔ 0 < p.2 := by exact_mod_cast Iff.rfl have hc_pos : (0 : ℝ) < ((p.1 * q.2 - p.2 * q.1 : ℚ) : ℝ) ↔ 0 < p.1 * q.2 - p.2 * q.1 := by exact_mod_cast Iff.rfl have hc_neg : ((p.1 * q.2 - p.2 * q.1 : ℚ) : ℝ) < 0 ↔ p.1 * q.2 - p.2 * q.1 < 0 := by exact_mod_cast Iff.rfl simp only [hp_le, hq_pos, hq_le, hp_pos, hc_pos, hc_neg] /-- Branch of argument in `(0, 2π]` cut along the positive real ray `[0, ∞)` (closed from below). -/ noncomputable def rayAngle (z : ℂ) : ℝ := if 0 < z.im then Complex.arg z else if z.im < 0 then Complex.arg z + 2 * Real.pi else if 0 < z.re then 2 * Real.pi else Real.pi lemma arg_pos_of_im_pos {z : ℂ} (h : 0 < z.im) : 0 < Complex.arg z := by have hnn : 0 ≤ Complex.arg z := Complex.arg_nonneg_iff.mpr (le_of_lt h) rcases eq_or_lt_of_le hnn with heq | hlt · exfalso have him0 : z.im = 0 := (Complex.arg_eq_zero_iff.mp heq.symm).2 linarith · exact hlt lemma rayAngle_pos_im {z : ℂ} (h : 0 < z.im) : rayAngle z = Complex.arg z ∧ 0 < rayAngle z ∧ rayAngle z < Real.pi := by have heq : rayAngle z = Complex.arg z := by simp [rayAngle, h] refine ⟨heq, ?_, ?_⟩ · rw [heq]; exact arg_pos_of_im_pos h · rw [heq]; exact Complex.arg_lt_pi_iff.mpr (Or.inr (ne_of_gt h)) lemma rayAngle_nonpos_im {z : ℂ} (h : z.im ≤ 0) : Real.pi ≤ rayAngle z ∧ rayAngle z ≤ 2 * Real.pi := by unfold rayAngle have hnot : ¬ (0 < z.im) := not_lt.mpr h simp only [hnot, ↓reduceIte] split_ifs with hlt hre · have harg_lt : Complex.arg z < 0 := Complex.arg_neg_iff.mpr hlt have harg_gt : -Real.pi < Complex.arg z := Complex.neg_pi_lt_arg z exact ⟨by linarith, by linarith⟩ · exact ⟨by linarith [Real.pi_pos], le_refl _⟩ · exact ⟨le_refl _, by linarith [Real.pi_pos]⟩ lemma norm_mul_exp_rayAngle_mul_I {z : ℂ} (hz : z ≠ 0) : (‖z‖ : ℂ) * Complex.exp ((rayAngle z : ℂ) * Complex.I) = z := by have hbase := Complex.norm_mul_exp_arg_mul_I z unfold rayAngle split_ifs with hpos hneg hre · exact hbase · have h2pi : Complex.exp (((Complex.arg z + 2 * Real.pi : ℝ) : ℂ) * Complex.I) = Complex.exp ((Complex.arg z : ℂ) * Complex.I) := by push_cast rw [add_mul, Complex.exp_add, Complex.exp_two_pi_mul_I, mul_one] rw [h2pi]; exact hbase · have him0 : z.im = 0 := le_antisymm (not_lt.mp hpos) (not_lt.mp hneg) have harg0 : Complex.arg z = 0 := Complex.arg_eq_zero_iff.mpr ⟨le_of_lt hre, him0⟩ rw [harg0] at hbase have h2pi : Complex.exp (((2 * Real.pi : ℝ) : ℂ) * Complex.I) = Complex.exp ((0 : ℂ) * Complex.I) := by push_cast; rw [Complex.exp_two_pi_mul_I, zero_mul, Complex.exp_zero] rw [h2pi]; exact hbase · have him0 : z.im = 0 := le_antisymm (not_lt.mp hpos) (not_lt.mp hneg) have hre_neg : z.re < 0 := by rcases lt_or_eq_of_le (not_lt.mp hre) with hlt | heq · exact hlt · exact False.elim (hz (Complex.ext heq him0)) have harg_pi : Complex.arg z = Real.pi := Complex.arg_eq_pi_iff.mpr ⟨hre_neg, him0⟩ rw [← harg_pi]; exact hbase /-- If the closed segment `[p, q]` avoids `0`, then `q / p` does not lie on `(-∞, 0]`, so `Complex.arg (q / p) ∈ (-π, π)`. -/ lemma arg_div_mem_Ioo_of_seg_zeroFree {p q : ℂ} (hp : p ≠ 0) (_hq : q ≠ 0) (hseg : ∀ t ∈ Icc (0 : ℝ) 1, ((1 - t : ℝ) : ℂ) * p + (t : ℂ) * q ≠ 0) : -Real.pi < Complex.arg (q / p) ∧ Complex.arg (q / p) < Real.pi := by refine ⟨Complex.neg_pi_lt_arg (q / p), Complex.arg_lt_pi_iff.mpr ?_⟩ by_contra hnot push Not at hnot obtain ⟨hre, him⟩ := hnot set c : ℝ := -(q / p).re have hc_pos : 0 < c := by simp only [c]; linarith have hdiv_eq : q / p = ((-c : ℝ) : ℂ) := by apply Complex.ext · simp [c] · simp [him] have hq_eq : q = ((-c : ℝ) : ℂ) * p := by calc q = (q / p) * p := (div_mul_cancel₀ q hp).symm _ = ((-c : ℝ) : ℂ) * p := by rw [hdiv_eq] set t : ℝ := 1 / (1 + c) have ht_mem : t ∈ Icc (0 : ℝ) 1 := by refine ⟨by positivity, ?_⟩ simp only [t]; rw [div_le_one (by linarith)]; linarith have hzero : ((1 - t : ℝ) : ℂ) * p + (t : ℂ) * q = 0 := by rw [hq_eq] have hcoeff : (1 - t : ℝ) + t * (-c) = 0 := by simp only [t]; field_simp [show (1 : ℝ) + c ≠ 0 by linarith]; ring have hcoeffC : ((1 - t : ℝ) : ℂ) + (t : ℂ) * ((-c : ℝ) : ℂ) = 0 := by exact_mod_cast hcoeff calc ((1 - t : ℝ) : ℂ) * p + (t : ℂ) * (((-c : ℝ) : ℂ) * p) = (((1 - t : ℝ) : ℂ) + (t : ℂ) * ((-c : ℝ) : ℂ)) * p := by ring _ = 0 * p := by rw [hcoeffC] _ = 0 := zero_mul p exact hseg t ht_mem hzero /-- Exact sign relation between `(q / p).im` and the 2D cross product `p.re * q.im - p.im * q.re`. -/ lemma im_div_eq_cross_div_normSq (p q : ℂ) : (q / p).im = (p.re * q.im - p.im * q.re) / Complex.normSq p := by rw [Complex.div_im]; ring /-- **Exact Angle-Jump Telescoping Identity**: For every directed segment `[p, q]` in `ℂ \ {0}`, `rayAngle q - rayAngle p + 2 π * edgeCrossingR p q = Complex.arg (q / p)`. -/ theorem rayAngle_sub_add_crossing_eq_arg_div {p q : ℂ} (hp : p ≠ 0) (hq : q ≠ 0) (hseg : ∀ t ∈ Icc (0 : ℝ) 1, ((1 - t : ℝ) : ℂ) * p + (t : ℂ) * q ≠ 0) : rayAngle q - rayAngle p + 2 * Real.pi * (edgeCrossingR p q : ℝ) = Complex.arg (q / p) := by set δ : ℝ := rayAngle q - rayAngle p + 2 * Real.pi * (edgeCrossingR p q : ℝ) set α : ℝ := Complex.arg (q / p) have hα_mem := arg_div_mem_Ioo_of_seg_zeroFree hp hq hseg -- Step 1: Show `exp(δ * I) = exp(α * I)`. have hexp_eq : Complex.exp ((δ : ℂ) * Complex.I) = Complex.exp ((α : ℂ) * Complex.I) := by have hp_e : Complex.exp ((rayAngle p : ℂ) * Complex.I) = p / (‖p‖ : ℂ) := by have h := norm_mul_exp_rayAngle_mul_I hp have hne : (‖p‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hp) rw [eq_div_iff hne, mul_comm]; exact h have hq_e : Complex.exp ((rayAngle q : ℂ) * Complex.I) = q / (‖q‖ : ℂ) := by have h := norm_mul_exp_rayAngle_mul_I hq have hne : (‖q‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hq) rw [eq_div_iff hne, mul_comm]; exact h have hα_e : Complex.exp ((α : ℂ) * Complex.I) = (q / p) / (‖q / p‖ : ℂ) := by have h := Complex.norm_mul_exp_arg_mul_I (q / p) have hne : (‖q / p‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr (div_ne_zero hq hp)) rw [eq_div_iff hne, mul_comm]; exact h have h2pik : Complex.exp (2 * (Real.pi : ℂ) * (edgeCrossingR p q : ℂ) * Complex.I) = 1 := by have : (2 * (Real.pi : ℂ) * (edgeCrossingR p q : ℂ) * Complex.I) = (edgeCrossingR p q : ℂ) * (2 * Real.pi * Complex.I) := by ring rw [this, Complex.exp_int_mul_two_pi_mul_I] have hδ_exp : Complex.exp ((δ : ℂ) * Complex.I) = Complex.exp ((rayAngle q : ℂ) * Complex.I) / Complex.exp ((rayAngle p : ℂ) * Complex.I) := by simp only [δ] push_cast rw [add_mul, sub_mul, Complex.exp_add, Complex.exp_sub, h2pik, mul_one] rw [hδ_exp, hq_e, hp_e, hα_e, norm_div] push_cast have hnp : (‖p‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hp) have hnq : (‖q‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hq) field_simp [hp, hnp, hnq] -- Step 2: From `exp(δ * I) = exp(α * I)`, `∃ k : ℤ, δ - α = k * (2 * π)`. rw [Complex.exp_eq_exp_iff_exists_int] at hexp_eq obtain ⟨k, hk⟩ := hexp_eq have hreal : δ = α + (k : ℝ) * (2 * Real.pi) := by have him := congr_arg Complex.im hk simp only [Complex.mul_im, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, sub_zero, Complex.add_im, Complex.intCast_re, Complex.intCast_im, Complex.re_ofNat, Complex.im_ofNat] at him linarith -- Step 3: Prove `|δ - α| < 2 * π` in all four sign quadrants, forcing `k = 0`. have hnsq_pos : 0 < Complex.normSq p := Complex.normSq_pos.mpr hp have him_div : (q / p).im = (p.re * q.im - p.im * q.re) / Complex.normSq p := im_div_eq_cross_div_normSq p q have hdiff_lt : -2 * Real.pi < δ - α ∧ δ - α < 2 * Real.pi := by by_cases hp_pos : 0 < p.im · obtain ⟨_, hp0, hp_pi⟩ := rayAngle_pos_im hp_pos by_cases hq_pos : 0 < q.im · obtain ⟨_, hq0, hq_pi⟩ := rayAngle_pos_im hq_pos have hcr : edgeCrossingR p q = 0 := by unfold edgeCrossingR simp [not_le.mpr hp_pos, not_le.mpr hq_pos] have hδ_eq : δ = rayAngle q - rayAngle p := by simp [δ, hcr] exact ⟨by linarith [hα_mem.2], by linarith [hα_mem.1]⟩ · have hq_le : q.im ≤ 0 := not_lt.mp hq_pos obtain ⟨hq_pi, hq_2pi⟩ := rayAngle_nonpos_im hq_le by_cases hc : p.re * q.im - p.im * q.re < 0 · have hcr : edgeCrossingR p q = -1 := by unfold edgeCrossingR simp [not_le.mpr hp_pos, hq_le, hp_pos, hc] have hδ_eq : δ = rayAngle q - rayAngle p - 2 * Real.pi := by simp [δ, hcr]; ring have hα_neg : α < 0 := Complex.arg_neg_iff.mpr (by rw [him_div]; exact div_neg_of_neg_of_pos hc hnsq_pos) exact ⟨by linarith, by linarith [hα_mem.1]⟩ · have hcr : edgeCrossingR p q = 0 := by unfold edgeCrossingR simp [not_le.mpr hp_pos, hc] have hδ_eq : δ = rayAngle q - rayAngle p := by simp [δ, hcr] have hα_nn : 0 ≤ α := Complex.arg_nonneg_iff.mpr (by rw [him_div]; exact div_nonneg (not_lt.mp hc) (le_of_lt hnsq_pos)) exact ⟨by linarith [hα_mem.2], by linarith⟩ · have hp_le : p.im ≤ 0 := not_lt.mp hp_pos obtain ⟨hp_pi, hp_2pi⟩ := rayAngle_nonpos_im hp_le by_cases hq_pos : 0 < q.im · obtain ⟨_, hq0, hq_pi⟩ := rayAngle_pos_im hq_pos by_cases hc : 0 < p.re * q.im - p.im * q.re · have hcr : edgeCrossingR p q = 1 := by unfold edgeCrossingR simp [hp_le, hq_pos, hc] have hδ_eq : δ = rayAngle q - rayAngle p + 2 * Real.pi := by simp [δ, hcr] have hα_pos : 0 < α := arg_pos_of_im_pos (by rw [him_div]; exact div_pos hc hnsq_pos) exact ⟨by linarith [hα_mem.2], by linarith⟩ · have hcr : edgeCrossingR p q = 0 := by unfold edgeCrossingR simp [not_le.mpr hq_pos, hc] have hδ_eq : δ = rayAngle q - rayAngle p := by simp [δ, hcr] have hα_le0 : α ≤ 0 := by rcases lt_or_eq_of_le (not_lt.mp hc) with hlt | heq · exact le_of_lt (Complex.arg_neg_iff.mpr (by rw [him_div]; exact div_neg_of_neg_of_pos hlt hnsq_pos)) · have him0 : (q / p).im = 0 := by rw [him_div, heq, zero_div] have hre_nn : 0 ≤ (q / p).re := by have := Complex.arg_lt_pi_iff.mp hα_mem.2 rcases this with hgt | hne · exact hgt · exact False.elim (hne him0) rw [show α = 0 from Complex.arg_eq_zero_iff.mpr ⟨hre_nn, him0⟩] exact ⟨by linarith, by linarith [hα_mem.1]⟩ · have hq_le : q.im ≤ 0 := not_lt.mp hq_pos obtain ⟨hq_pi, hq_2pi⟩ := rayAngle_nonpos_im hq_le have hcr : edgeCrossingR p q = 0 := by unfold edgeCrossingR simp [not_lt.mpr hp_le, not_lt.mpr hq_le] have hδ_eq : δ = rayAngle q - rayAngle p := by simp [δ, hcr] exact ⟨by linarith [hα_mem.2], by linarith [hα_mem.1]⟩ have hk_lt : (k : ℝ) < 1 := by nlinarith [Real.pi_pos] have hk_gt : (-1 : ℝ) < (k : ℝ) := by nlinarith [Real.pi_pos] have hk0 : k = 0 := by have h1 : k < 1 := by exact_mod_cast hk_lt have h2 : -1 < k := by exact_mod_cast hk_gt omega rw [hk0, Int.cast_zero, zero_mul, add_zero] at hreal exact hreal /-! ### 2. Zero-Free Convex Rectangles (`RectBox`) and Continuous Angle-Lift Theorem -/ /-- Axis-aligned closed rectangle `[reLo, reHi] × [imLo, imHi]` in `ℂ`. -/ structure RectBox where reLo : ℝ reHi : ℝ imLo : ℝ imHi : ℝ def RectBox.mem (B : RectBox) (z : ℂ) : Prop := B.reLo ≤ z.re ∧ z.re ≤ B.reHi ∧ B.imLo ≤ z.im ∧ z.im ≤ B.imHi /-- Rigorous exclusion of `0` from `B`: at least one coordinate interval stays strictly away from `0`. -/ def RectBox.zeroFree (B : RectBox) : Prop := B.reHi < 0 ∨ 0 < B.reLo ∨ B.imHi < 0 ∨ 0 < B.imLo lemma RectBox.convex (B : RectBox) {z w : ℂ} (hz : B.mem z) (hw : B.mem w) {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t ≤ 1) : B.mem (((1 - t : ℝ) : ℂ) * z + (t : ℂ) * w) := by have h1t : 0 ≤ 1 - t := by linarith refine ⟨?_, ?_, ?_, ?_⟩ <;> simp only [Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, add_zero] · nlinarith [hz.1, hw.1] · nlinarith [hz.2.1, hw.2.1] · nlinarith [hz.2.2.1, hw.2.2.1] · nlinarith [hz.2.2.2, hw.2.2.2] lemma RectBox.ne_zero_of_mem {B : RectBox} (hB : B.zeroFree) {z : ℂ} (hz : B.mem z) : z ≠ 0 := by intro h0 rw [h0] at hz simp only [RectBox.mem, Complex.zero_re, Complex.zero_im] at hz rcases hB with h1 | h2 | h3 | h4 <;> linarith /-- Straight-line homotopy invariance certificate: if `γ` maps `[a, b]` into a zero-free `RectBox` `B` and `p, q ∈ B`, then the linear homotopy between `γ` and the chord `[p, q]` never vanishes. -/ theorem RectBox.homotopy_zeroFree {B : RectBox} (hB : B.zeroFree) {γ : ℝ → ℂ} {a b : ℝ} {p q : ℂ} (hγ : ∀ t ∈ Icc a b, B.mem (γ t)) (hp : B.mem p) (hq : B.mem q) : ∀ s ∈ Icc (0 : ℝ) 1, ∀ u ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc a b, ((1 - s : ℝ) : ℂ) * γ t + (s : ℂ) * (((1 - u : ℝ) : ℂ) * p + (u : ℂ) * q) ≠ 0 := by intro s hs u hu t ht exact RectBox.ne_zero_of_mem hB (B.convex (hγ t ht) (B.convex hp hq hu.1 hu.2) hs.1 hs.2) /-- Continuous real function taking values in `2π ℤ` on a closed interval `[a, b]` is constant. -/ lemma eq_of_continuousOn_exp_mul_I_eq_one {f : ℝ → ℝ} {a b : ℝ} (hab : a ≤ b) (hcont : ContinuousOn f (Icc a b)) (hexp : ∀ t ∈ Icc a b, Complex.exp ((f t : ℂ) * Complex.I) = 1) : f b = f a := by have hint : ∀ t ∈ Icc a b, ∃ k : ℤ, f t = (k : ℝ) * (2 * Real.pi) := by intro t ht have h := hexp t ht rw [← Complex.exp_zero, Complex.exp_eq_exp_iff_exists_int] at h obtain ⟨k, hk⟩ := h refine ⟨k, ?_⟩ have him := congr_arg Complex.im hk simp only [Complex.mul_im, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, zero_add, sub_zero, Complex.intCast_re, Complex.intCast_im, Complex.re_ofNat, Complex.im_ofNat] at him linarith by_contra hne obtain ⟨ka, hka⟩ := hint a ⟨le_refl a, hab⟩ obtain ⟨kb, hkb⟩ := hint b ⟨hab, le_refl b⟩ rcases lt_or_gt_of_ne hne with hlt | hgt · -- `f b < f a` have hmid_mem : f b + Real.pi ∈ Icc (f b) (f a) := by have hk_lt : kb < ka := by have : (kb : ℝ) < (ka : ℝ) := by nlinarith [Real.pi_pos] exact_mod_cast this have hk_le : (kb : ℝ) + 1 ≤ (ka : ℝ) := by exact_mod_cast (show kb + 1 ≤ ka by omega) exact ⟨by linarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ obtain ⟨c, hc_mem, hc_eq⟩ := intermediate_value_Icc' hab hcont hmid_mem obtain ⟨kc, hkc⟩ := hint c hc_mem have h2 : (2 : ℝ) * (kc : ℝ) = (2 : ℝ) * (kb : ℝ) + 1 := by nlinarith [Real.pi_pos] have h2z : 2 * kc = 2 * kb + 1 := by exact_mod_cast h2 omega · -- `f a < f b` have hmid_mem : f a + Real.pi ∈ Icc (f a) (f b) := by have hk_lt : ka < kb := by have : (ka : ℝ) < (kb : ℝ) := by nlinarith [Real.pi_pos] exact_mod_cast this have hk_le : (ka : ℝ) + 1 ≤ (kb : ℝ) := by exact_mod_cast (show ka + 1 ≤ kb by omega) exact ⟨by linarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ obtain ⟨c, hc_mem, hc_eq⟩ := intermediate_value_Icc hab hcont hmid_mem obtain ⟨kc, hkc⟩ := hint c hc_mem have h2 : (2 : ℝ) * (kc : ℝ) = (2 : ℝ) * (ka : ℝ) + 1 := by nlinarith [Real.pi_pos] have h2z : 2 * kc = 2 * ka + 1 := by exact_mod_cast h2 omega /-- Half-plane angle lift: if a curve `γ` on `[a, b]` stays inside an open half-plane `{z | 0 < (z * exp(-α * I)).re}`, then ANY continuous real angle lift `Φ` of `γ` satisfies `Φ b - Φ a = Complex.arg (γ b / γ a)`. -/ lemma lift_diff_eq_arg_div_of_halfPlane {γ : ℝ → ℂ} {Φ : ℝ → ℝ} {a b α : ℝ} (hab : a ≤ b) (hγ_cont : ContinuousOn γ (Icc a b)) (hΦ_cont : ContinuousOn Φ (Icc a b)) (hΦ_lift : ∀ t ∈ Icc a b, (‖γ t‖ : ℂ) * Complex.exp ((Φ t : ℂ) * Complex.I) = γ t) (hhalf : ∀ t ∈ Icc a b, 0 < (γ t * Complex.exp (-(α : ℂ) * Complex.I)).re) : Φ b - Φ a = Complex.arg (γ b / γ a) := by let ψ : ℂ → ℝ := fun z => α + Complex.arg (z * Complex.exp (-(α : ℂ) * Complex.I)) have hrot_ne : ∀ t ∈ Icc a b, γ t * Complex.exp (-(α : ℂ) * Complex.I) ≠ 0 := by intro t ht h0 have := hhalf t ht; rw [h0, Complex.zero_re] at this; linarith have hγ_ne : ∀ t ∈ Icc a b, γ t ≠ 0 := by intro t ht h0; exact hrot_ne t ht (by simp [h0]) -- Continuity of `ψ ∘ γ` on `[a, b]` via `Complex.continuousAt_arg` on the right half-plane. have hψ_cont : ContinuousOn (fun t => ψ (γ t)) (Icc a b) := by refine continuousOn_const.add ?_ intro t ht have harg_cont : ContinuousAt Complex.arg (γ t * Complex.exp (-(α : ℂ) * Complex.I)) := Complex.continuousAt_arg (Complex.mem_slitPlane_iff.mpr (Or.inl (hhalf t ht))) have hmul_cont : ContinuousWithinAt (fun s => γ s * Complex.exp (-(α : ℂ) * Complex.I)) (Icc a b) t := (hγ_cont t ht).mul continuousWithinAt_const exact ContinuousAt.comp_continuousWithinAt (f := fun s => γ s * Complex.exp (-(α : ℂ) * Complex.I)) (g := Complex.arg) harg_cont hmul_cont -- Show `exp((Φ t - ψ(γ t)) * I) = 1` for every `t ∈ [a, b]`. have hexp1 : ∀ t ∈ Icc a b, Complex.exp (((Φ t - ψ (γ t) : ℝ) : ℂ) * Complex.I) = 1 := by intro t ht have hrot_norm : ‖γ t * Complex.exp (-(α : ℂ) * Complex.I)‖ = ‖γ t‖ := by rw [norm_mul, show -(α : ℂ) * Complex.I = ((-α : ℝ) : ℂ) * Complex.I by push_cast; ring, Complex.norm_exp_ofReal_mul_I, mul_one] have hpsi_lift : (‖γ t‖ : ℂ) * Complex.exp ((ψ (γ t) : ℂ) * Complex.I) = γ t := by have harg := Complex.norm_mul_exp_arg_mul_I (γ t * Complex.exp (-(α : ℂ) * Complex.I)) rw [hrot_norm] at harg simp only [ψ] push_cast rw [add_mul, Complex.exp_add] calc (‖γ t‖ : ℂ) * (Complex.exp ((α : ℂ) * Complex.I) * Complex.exp ((Complex.arg (γ t * Complex.exp (-(α : ℂ) * Complex.I)) : ℂ) * Complex.I)) = Complex.exp ((α : ℂ) * Complex.I) * ((‖γ t‖ : ℂ) * Complex.exp ((Complex.arg (γ t * Complex.exp (-(α : ℂ) * Complex.I)) : ℂ) * Complex.I)) := by ring _ = Complex.exp ((α : ℂ) * Complex.I) * (γ t * Complex.exp (-(α : ℂ) * Complex.I)) := by rw [harg] _ = γ t * (Complex.exp ((α : ℂ) * Complex.I) * Complex.exp (-(α : ℂ) * Complex.I)) := by ring _ = γ t * Complex.exp ((α : ℂ) * Complex.I + -(α : ℂ) * Complex.I) := by rw [← Complex.exp_add] _ = γ t := by simp have hnorm_ne : (‖γ t‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr (hγ_ne t ht)) have heq_exp : Complex.exp ((Φ t : ℂ) * Complex.I) = Complex.exp ((ψ (γ t) : ℂ) * Complex.I) := mul_left_cancel₀ hnorm_ne ((hΦ_lift t ht).trans hpsi_lift.symm) push_cast rw [sub_mul, Complex.exp_sub, heq_exp, div_self (Complex.exp_ne_zero _)] have hconst := eq_of_continuousOn_exp_mul_I_eq_one hab (hΦ_cont.sub hψ_cont) hexp1 have hΦ_eq_ψ : Φ b - Φ a = ψ (γ b) - ψ (γ a) := by dsimp only [Pi.sub_apply] at hconst; linarith -- Finally identify `ψ (γ b) - ψ (γ a) = Complex.arg (γ b / γ a)` since both rotated args lie in `(-π/2, π/2)`. have harg_half : ∀ t ∈ Icc a b, -(Real.pi / 2) < Complex.arg (γ t * Complex.exp (-(α : ℂ) * Complex.I)) ∧ Complex.arg (γ t * Complex.exp (-(α : ℂ) * Complex.I)) < Real.pi / 2 := by intro t ht exact Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl (hhalf t ht)) |> abs_lt.mp have harg_a := harg_half a ⟨le_refl a, hab⟩ have harg_b := harg_half b ⟨hab, le_refl b⟩ have hψ_diff_mem : -Real.pi < ψ (γ b) - ψ (γ a) ∧ ψ (γ b) - ψ (γ a) < Real.pi := by simp only [ψ]; exact ⟨by linarith, by linarith⟩ have hα_mem : -Real.pi < Complex.arg (γ b / γ a) ∧ Complex.arg (γ b / γ a) ≤ Real.pi := ⟨Complex.neg_pi_lt_arg _, Complex.arg_le_pi _⟩ have hexp_div : Complex.exp (((ψ (γ b) - ψ (γ a) : ℝ) : ℂ) * Complex.I) = Complex.exp ((Complex.arg (γ b / γ a) : ℂ) * Complex.I) := by have hlift_b : (‖γ b‖ : ℂ) * Complex.exp ((Φ b : ℂ) * Complex.I) = γ b := hΦ_lift b ⟨hab, le_refl b⟩ have hlift_a : (‖γ a‖ : ℂ) * Complex.exp ((Φ a : ℂ) * Complex.I) = γ a := hΦ_lift a ⟨le_refl a, hab⟩ have hga : γ a ≠ 0 := hγ_ne a ⟨le_refl a, hab⟩ have hgb : γ b ≠ 0 := hγ_ne b ⟨hab, le_refl b⟩ have hna : (‖γ a‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hga) have hnb : (‖γ b‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hgb) have harg_div := Complex.norm_mul_exp_arg_mul_I (γ b / γ a) have hndiv : (‖γ b / γ a‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr (div_ne_zero hgb hga)) rw [← hΦ_eq_ψ] push_cast rw [sub_mul, Complex.exp_sub] have hEb : Complex.exp ((Φ b : ℂ) * Complex.I) = γ b / (‖γ b‖ : ℂ) := by rw [eq_div_iff hnb, mul_comm]; exact hlift_b have hEa : Complex.exp ((Φ a : ℂ) * Complex.I) = γ a / (‖γ a‖ : ℂ) := by rw [eq_div_iff hna, mul_comm]; exact hlift_a have hEd : Complex.exp ((Complex.arg (γ b / γ a) : ℂ) * Complex.I) = (γ b / γ a) / (‖γ b / γ a‖ : ℂ) := by rw [eq_div_iff hndiv, mul_comm]; exact harg_div rw [hEb, hEa, hEd, norm_div] push_cast field_simp [hga, hna, hnb] rw [Complex.exp_eq_exp_iff_exists_int] at hexp_div obtain ⟨k, hk⟩ := hexp_div have hreal : ψ (γ b) - ψ (γ a) = Complex.arg (γ b / γ a) + (k : ℝ) * (2 * Real.pi) := by have him := congr_arg Complex.im hk simp only [Complex.mul_im, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, sub_zero, Complex.add_im, Complex.intCast_re, Complex.intCast_im, Complex.re_ofNat, Complex.im_ofNat] at him linarith have hk_lt : (k : ℝ) < 1 := by nlinarith [Real.pi_pos] have hk_gt : (-1 : ℝ) < (k : ℝ) := by nlinarith [Real.pi_pos] have hk0 : k = 0 := by have h1 : k < 1 := by exact_mod_cast hk_lt have h2 : -1 < k := by exact_mod_cast hk_gt omega rw [hk0, Int.cast_zero, zero_mul, add_zero] at hreal linarith /-- Helper: every zero-free `RectBox` lies inside a rotated open right half-plane `{z | (z * exp(-i α)).re > 0}` for one of the four cardinal directions `α ∈ {π, 0, -π/2, π/2}`. -/ lemma rectBox_mem_halfPlane {B : RectBox} (hB : B.zeroFree) : ∃ α : ℝ, ∀ z : ℂ, B.mem z → 0 < (z * Complex.exp (-(α : ℂ) * Complex.I)).re := by rcases hB with hre_neg | hre_pos | him_neg | him_pos · refine ⟨Real.pi, fun z hz => ?_⟩ have h1 : Complex.exp (-(Real.pi : ℂ) * Complex.I) = -1 := by have : -(Real.pi : ℂ) * Complex.I = -(Real.pi * Complex.I) := by ring rw [this, Complex.exp_neg, Complex.exp_pi_mul_I]; norm_num rw [h1, mul_neg_one, Complex.neg_re]; linarith [hz.2.1] · refine ⟨0, fun z hz => ?_⟩ simp only [Complex.ofReal_zero, neg_zero, zero_mul, Complex.exp_zero, mul_one] linarith [hz.1] · refine ⟨-(Real.pi / 2), fun z hz => ?_⟩ have h1 : Complex.exp (-((-(Real.pi / 2) : ℝ) : ℂ) * Complex.I) = Complex.I := by push_cast; rw [neg_neg, Complex.exp_pi_div_two_mul_I] rw [h1, Complex.mul_I_re]; linarith [hz.2.2.2] · refine ⟨Real.pi / 2, fun z hz => ?_⟩ have h1 : Complex.exp (-((Real.pi / 2 : ℝ) : ℂ) * Complex.I) = -Complex.I := by push_cast rw [show -((Real.pi : ℂ) / 2) * Complex.I = -((Real.pi : ℂ) / 2 * Complex.I) by ring, Complex.exp_neg, Complex.exp_pi_div_two_mul_I, Complex.inv_I] rw [h1, mul_neg, Complex.neg_re, Complex.mul_I_re, neg_neg]; linarith [hz.2.2.1] /-- In a rotated open right half-plane, `arg (w / z)` equals the difference of rotated arguments. -/ lemma arg_div_eq_sub_of_halfPlane {α : ℝ} {z w : ℂ} (hz : 0 < (z * Complex.exp (-(α : ℂ) * Complex.I)).re) (hw : 0 < (w * Complex.exp (-(α : ℂ) * Complex.I)).re) : Complex.arg (w / z) = Complex.arg (w * Complex.exp (-(α : ℂ) * Complex.I)) - Complex.arg (z * Complex.exp (-(α : ℂ) * Complex.I)) := by set rz : ℂ := z * Complex.exp (-(α : ℂ) * Complex.I) set rw_c : ℂ := w * Complex.exp (-(α : ℂ) * Complex.I) have hrz_ne : rz ≠ 0 := by intro h; rw [h, Complex.zero_re] at hz; linarith have hrw_ne : rw_c ≠ 0 := by intro h; rw [h, Complex.zero_re] at hw; linarith have hdiv : w / z = rw_c / rz := by simp only [rz, rw_c] rw [mul_div_mul_right _ _ (Complex.exp_ne_zero _)] have harg_z : -(Real.pi / 2) < Complex.arg rz ∧ Complex.arg rz < Real.pi / 2 := abs_lt.mp (Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl hz)) have harg_w : -(Real.pi / 2) < Complex.arg rw_c ∧ Complex.arg rw_c < Real.pi / 2 := abs_lt.mp (Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl hw)) have hdiff_mem : -Real.pi < Complex.arg rw_c - Complex.arg rz ∧ Complex.arg rw_c - Complex.arg rz < Real.pi := ⟨by linarith, by linarith⟩ have hα_mem : -Real.pi < Complex.arg (w / z) ∧ Complex.arg (w / z) ≤ Real.pi := ⟨Complex.neg_pi_lt_arg _, Complex.arg_le_pi _⟩ have hexp_eq : Complex.exp (((Complex.arg rw_c - Complex.arg rz : ℝ) : ℂ) * Complex.I) = Complex.exp ((Complex.arg (w / z) : ℂ) * Complex.I) := by have hnz : (‖rz‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hrz_ne) have hnw : (‖rw_c‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hrw_ne) have hndiv : (‖rw_c / rz‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr (div_ne_zero hrw_ne hrz_ne)) have hEw : Complex.exp ((Complex.arg rw_c : ℂ) * Complex.I) = rw_c / (‖rw_c‖ : ℂ) := by rw [eq_div_iff hnw, mul_comm]; exact Complex.norm_mul_exp_arg_mul_I rw_c have hEz : Complex.exp ((Complex.arg rz : ℂ) * Complex.I) = rz / (‖rz‖ : ℂ) := by rw [eq_div_iff hnz, mul_comm]; exact Complex.norm_mul_exp_arg_mul_I rz have hEd : Complex.exp ((Complex.arg (rw_c / rz) : ℂ) * Complex.I) = (rw_c / rz) / (‖rw_c / rz‖ : ℂ) := by rw [eq_div_iff hndiv, mul_comm]; exact Complex.norm_mul_exp_arg_mul_I (rw_c / rz) rw [hdiv, hEd] push_cast rw [sub_mul, Complex.exp_sub, hEw, hEz, norm_div] push_cast field_simp [hrz_ne, hnz, hnw] rw [Complex.exp_eq_exp_iff_exists_int] at hexp_eq obtain ⟨k, hk⟩ := hexp_eq have hreal : Complex.arg rw_c - Complex.arg rz = Complex.arg (w / z) + (k : ℝ) * (2 * Real.pi) := by have him := congr_arg Complex.im hk simp only [Complex.mul_im, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, sub_zero, Complex.add_im, Complex.intCast_re, Complex.intCast_im, Complex.re_ofNat, Complex.im_ofNat] at him linarith have hk_lt : (k : ℝ) < 1 := by nlinarith [Real.pi_pos] have hk_gt : (-1 : ℝ) < (k : ℝ) := by nlinarith [Real.pi_pos] have hk0 : k = 0 := by have h1 : k < 1 := by exact_mod_cast hk_lt have h2 : -1 < k := by exact_mod_cast hk_gt omega rw [hk0, Int.cast_zero, zero_mul, add_zero] at hreal exact hreal.symm /-- Four-point angle-cocycle identity inside any zero-free `RectBox`: `arg (b / a) = arg (q / p) + arg (b / q) - arg (a / p)`. -/ lemma arg_div_four_point_of_rectBox {B : RectBox} (hB : B.zeroFree) {a b p q : ℂ} (ha : B.mem a) (hb : B.mem b) (hp : B.mem p) (hq : B.mem q) : Complex.arg (b / a) = Complex.arg (q / p) + Complex.arg (b / q) - Complex.arg (a / p) := by obtain ⟨α, hα⟩ := rectBox_mem_halfPlane hB rw [arg_div_eq_sub_of_halfPlane (hα a ha) (hα b hb), arg_div_eq_sub_of_halfPlane (hα p hp) (hα q hq), arg_div_eq_sub_of_halfPlane (hα q hq) (hα b hb), arg_div_eq_sub_of_halfPlane (hα p hp) (hα a ha)] ring /-- **Zero-Free Rectangular Cage Angle-Change Theorem**: If a continuous curve `γ` on `[a, b]` stays inside a zero-free `RectBox` `B`, then any continuous angle lift `Φ` of `γ` satisfies `Φ b - Φ a = Complex.arg (γ b / γ a)`. -/ theorem lift_diff_eq_arg_div_of_rectBox {B : RectBox} (hB : B.zeroFree) {γ : ℝ → ℂ} {Φ : ℝ → ℝ} {a b : ℝ} (hab : a ≤ b) (hγ_cont : ContinuousOn γ (Icc a b)) (hΦ_cont : ContinuousOn Φ (Icc a b)) (hΦ_lift : ∀ t ∈ Icc a b, (‖γ t‖ : ℂ) * Complex.exp ((Φ t : ℂ) * Complex.I) = γ t) (hcover : ∀ t ∈ Icc a b, B.mem (γ t)) : Φ b - Φ a = Complex.arg (γ b / γ a) := by obtain ⟨α, hα⟩ := rectBox_mem_halfPlane hB exact lift_diff_eq_arg_div_of_halfPlane (α := α) hab hγ_cont hΦ_cont hΦ_lift (fun t ht => hα (γ t) (hcover t ht)) /-- Helper: `polyWinding` computed over an indexed closed rational loop `p : ℕ → ℚ × ℚ` of `m` segments. -/ def polyWindingLoop (p : ℕ → ℚ × ℚ) (m : ℕ) : ℤ := ∑ k ∈ Finset.range m, edgeCrossing (p k) (p (k + 1)) lemma polyWinding_ofFn_eq_loop (p : ℕ → ℚ × ℚ) : ∀ m : ℕ, polyWinding (List.ofFn (fun i : Fin (m + 1) => p i.val)) = polyWindingLoop p m | 0 => by simp [polyWinding, polyWindingLoop] | m + 1 => by have hlist : List.ofFn (fun i : Fin (m + 2) => p i.val) = p 0 :: List.ofFn (fun i : Fin (m + 1) => p (i.val + 1)) := by rw [List.ofFn_succ]; rfl have hhead : List.ofFn (fun i : Fin (m + 1) => p (i.val + 1)) = p 1 :: List.ofFn (fun i : Fin m => p (i.val + 2)) := by rw [List.ofFn_succ]; rfl rw [hlist, hhead] simp only [polyWinding] rw [← hhead] have ih := polyWinding_ofFn_eq_loop (fun k => p (k + 1)) m rw [ih] unfold polyWindingLoop rw [Finset.sum_range_succ', add_comm] /-- **Global Cauchy Winding-Cage Theorem (Arb/FLINT Box-Enclosure Form)**: Let `γ : ℝ → ℂ` be a continuous closed curve on `[t 0, t m]` (`γ (t m) = γ (t 0)`) with continuous total-angle lift `Φ : ℝ → ℝ`. If each subinterval `[t k, t (k+1)]` is enclosed in a zero-free `RectBox` `B k` that ALSO contains the rational cage vertices `toComplex (p k)` and `toComplex (p (k+1))` (`p m = p 0`, NO exact equality `γ (t k) = toComplex (p k)` needed!), then the continuous winding number `(Φ (t m) - Φ (t 0)) / (2π)` equals the exact rational ray-crossing count `polyWindingLoop p m`. -/ theorem winding_eq_polyWinding_of_box_cover {m : ℕ} {γ : ℝ → ℂ} {Φ : ℝ → ℝ} {t : ℕ → ℝ} {p : ℕ → ℚ × ℚ} {B : ℕ → RectBox} (ht_mono : ∀ k < m, t k ≤ t (k + 1)) (hγ_closed : γ (t m) = γ (t 0)) (hclosed : p m = p 0) (hp_mem : ∀ k < m, (B k).mem (toComplex (p k)) ∧ (B k).mem (toComplex (p (k + 1)))) (hγ_cont : ∀ k < m, ContinuousOn γ (Icc (t k) (t (k + 1)))) (hΦ_cont : ∀ k < m, ContinuousOn Φ (Icc (t k) (t (k + 1)))) (hΦ_lift : ∀ k < m, ∀ s ∈ Icc (t k) (t (k + 1)), (‖γ s‖ : ℂ) * Complex.exp ((Φ s : ℂ) * Complex.I) = γ s) (hB_free : ∀ k < m, (B k).zeroFree) (hcover : ∀ k < m, ∀ s ∈ Icc (t k) (t (k + 1)), (B k).mem (γ s)) : (Φ (t m) - Φ (t 0)) / (2 * Real.pi) = (polyWindingLoop p m : ℝ) := by have hstep : ∀ k ∈ Finset.range m, Φ (t (k + 1)) - Φ (t k) = (rayAngle (toComplex (p (k + 1))) - rayAngle (toComplex (p k))) + (Complex.arg (γ (t (k + 1)) / toComplex (p (k + 1))) - Complex.arg (γ (t k) / toComplex (p k))) + 2 * Real.pi * (edgeCrossing (p k) (p (k + 1)) : ℝ) := by intro k hk rw [Finset.mem_range] at hk have hle := ht_mono k hk have hdiff := lift_diff_eq_arg_div_of_rectBox (hB_free k hk) hle (hγ_cont k hk) (hΦ_cont k hk) (hΦ_lift k hk) (hcover k hk) have hγk_mem : (B k).mem (γ (t k)) := hcover k hk (t k) ⟨le_refl _, hle⟩ have hγk1_mem : (B k).mem (γ (t (k + 1))) := hcover k hk (t (k + 1)) ⟨hle, le_refl _⟩ obtain ⟨hpk_mem, hpk1_mem⟩ := hp_mem k hk have hcocycle := arg_div_four_point_of_rectBox (hB_free k hk) hγk_mem hγk1_mem hpk_mem hpk1_mem have hp_ne : toComplex (p k) ≠ 0 := RectBox.ne_zero_of_mem (hB_free k hk) hpk_mem have hq_ne : toComplex (p (k + 1)) ≠ 0 := RectBox.ne_zero_of_mem (hB_free k hk) hpk1_mem have hseg : ∀ u ∈ Icc (0 : ℝ) 1, ((1 - u : ℝ) : ℂ) * toComplex (p k) + (u : ℂ) * toComplex (p (k + 1)) ≠ 0 := fun u hu => RectBox.ne_zero_of_mem (hB_free k hk) ((B k).convex hpk_mem hpk1_mem hu.1 hu.2) have hjump := rayAngle_sub_add_crossing_eq_arg_div hp_ne hq_ne hseg rw [edgeCrossingR_toComplex] at hjump linarith have hsum := Finset.sum_congr rfl hstep have htele_Φ : ∑ k ∈ Finset.range m, (Φ (t (k + 1)) - Φ (t k)) = Φ (t m) - Φ (t 0) := Finset.sum_range_sub (fun k => Φ (t k)) m have htele_ray : ∑ k ∈ Finset.range m, (rayAngle (toComplex (p (k + 1))) - rayAngle (toComplex (p k))) = 0 := by rw [Finset.sum_range_sub (fun k => rayAngle (toComplex (p k))) m, hclosed, sub_self] have htele_err : ∑ k ∈ Finset.range m, (Complex.arg (γ (t (k + 1)) / toComplex (p (k + 1))) - Complex.arg (γ (t k) / toComplex (p k))) = 0 := by rw [Finset.sum_range_sub (fun k => Complex.arg (γ (t k) / toComplex (p k))) m, hγ_closed, hclosed, sub_self] rw [htele_Φ, Finset.sum_add_distrib, Finset.sum_add_distrib, htele_ray, htele_err, add_zero, zero_add, ← Finset.mul_sum] at hsum have hcast : ∑ k ∈ Finset.range m, (edgeCrossing (p k) (p (k + 1)) : ℝ) = (polyWindingLoop p m : ℝ) := by unfold polyWindingLoop; push_cast; rfl rw [hcast] at hsum have h2pi : (2 * Real.pi : ℝ) ≠ 0 := by positivity rw [hsum, mul_div_cancel_left₀ _ h2pi] /-- **Global Cauchy Winding-Cage Theorem (Exact-Vertex Special Case)**: Specializes `winding_eq_polyWinding_of_box_cover` when the curve passes directly through the rational vertices `γ (t k) = toComplex (p k)`. -/ theorem winding_eq_polyWinding_of_convex_cover {m : ℕ} {γ : ℝ → ℂ} {Φ : ℝ → ℝ} {t : ℕ → ℝ} {p : ℕ → ℚ × ℚ} {B : ℕ → RectBox} (ht_mono : ∀ k < m, t k ≤ t (k + 1)) (hclosed : p m = p 0) (hvert : ∀ k ≤ m, γ (t k) = toComplex (p k)) (hγ_cont : ∀ k < m, ContinuousOn γ (Icc (t k) (t (k + 1)))) (hΦ_cont : ∀ k < m, ContinuousOn Φ (Icc (t k) (t (k + 1)))) (hΦ_lift : ∀ k < m, ∀ s ∈ Icc (t k) (t (k + 1)), (‖γ s‖ : ℂ) * Complex.exp ((Φ s : ℂ) * Complex.I) = γ s) (hB_free : ∀ k < m, (B k).zeroFree) (hcover : ∀ k < m, ∀ s ∈ Icc (t k) (t (k + 1)), (B k).mem (γ s)) : (Φ (t m) - Φ (t 0)) / (2 * Real.pi) = (polyWindingLoop p m : ℝ) := winding_eq_polyWinding_of_box_cover ht_mono (by rw [hvert m (le_refl _), hvert 0 (Nat.zero_le _), hclosed]) hclosed (fun k hk => ⟨by rw [← hvert k (by omega)]; exact hcover k hk (t k) ⟨le_refl _, ht_mono k hk⟩, by rw [← hvert (k + 1) (by omega)]; exact hcover k hk (t (k + 1)) ⟨ht_mono k hk, le_refl _⟩⟩) hγ_cont hΦ_cont hΦ_lift hB_free hcover -- Kernel-verified sanity tests of `polyWinding` matching `certify.py`: theorem polyWinding_unit_square : polyWinding [(1, 0), (0, 1), (-1, 0), (0, -1), (1, 0)] = 1 := by norm_num [polyWinding, edgeCrossing] theorem polyWinding_double_loop : polyWinding [(1, 0), (0, 1), (-1, 0), (0, -1), (1, 0), (0, 1), (-1, 0), (0, -1), (1, 0)] = 2 := by norm_num [polyWinding, edgeCrossing] theorem polyWinding_clockwise_square : polyWinding [(1, 0), (0, -1), (-1, 0), (0, 1), (1, 0)] = -1 := by norm_num [polyWinding, edgeCrossing] /-! ### 3. IVT Sign-Change Counting and Finite Critical-Line Completeness -/ /-- **IVT Sign-Change Extraction**: `n` strictly separated intervals `(a_k, b_k)` across which a continuous real function `Ξ` changes sign yield `n` strictly increasing roots `γ : Fin n → ℝ` with `a k < γ k < b k`. -/ theorem exists_strictMono_zeros_of_sign_changes {n : ℕ} {Ξ : ℝ → ℝ} (hcont : Continuous Ξ) {a b : Fin n → ℝ} (hab : ∀ k : Fin n, a k < b k) (hsep : ∀ k : Fin n, ∀ hk : k.val + 1 < n, b k ≤ a ⟨k.val + 1, hk⟩) (hsign : ∀ k : Fin n, Ξ (a k) * Ξ (b k) < 0) : ∃ γ : Fin n → ℝ, StrictMono γ ∧ ∀ k : Fin n, a k < γ k ∧ γ k < b k ∧ Ξ (γ k) = 0 := by have hex : ∀ k : Fin n, ∃ x : ℝ, a k < x ∧ x < b k ∧ Ξ x = 0 := by intro k have hle : a k ≤ b k := le_of_lt (hab k) have hmul := hsign k rcases mul_neg_iff.mp hmul with ⟨ha_pos, hb_neg⟩ | ⟨ha_neg, hb_pos⟩ · have h0 : (0 : ℝ) ∈ Icc (Ξ (b k)) (Ξ (a k)) := ⟨le_of_lt hb_neg, le_of_lt ha_pos⟩ obtain ⟨x, hx_mem, hx_eq⟩ := intermediate_value_Icc' hle hcont.continuousOn h0 refine ⟨x, ?_, ?_, hx_eq⟩ · rcases eq_or_lt_of_le hx_mem.1 with rfl | hlt · linarith · exact hlt · rcases eq_or_lt_of_le hx_mem.2 with rfl | hlt · linarith · exact hlt · have h0 : (0 : ℝ) ∈ Icc (Ξ (a k)) (Ξ (b k)) := ⟨le_of_lt ha_neg, le_of_lt hb_pos⟩ obtain ⟨x, hx_mem, hx_eq⟩ := intermediate_value_Icc hle hcont.continuousOn h0 refine ⟨x, ?_, ?_, hx_eq⟩ · rcases eq_or_lt_of_le hx_mem.1 with rfl | hlt · linarith · exact hlt · rcases eq_or_lt_of_le hx_mem.2 with rfl | hlt · linarith · exact hlt choose γ hγ using hex refine ⟨γ, ?_, hγ⟩ -- Prove `StrictMono γ` from `a i < γ i < b i ≤ a (i+1) < γ (i+1)`. have hstep : ∀ (i : ℕ) (hi : i + 1 < n), γ ⟨i, by omega⟩ < γ ⟨i + 1, hi⟩ := by intro i hi have h1 := (hγ ⟨i, by omega⟩).2.1 have h2 := hsep ⟨i, by omega⟩ hi have h3 := (hγ ⟨i + 1, hi⟩).1 linarith intro i j hij have hind : ∀ d : ℕ, ∀ h : i.val + d < n, 0 < d → γ i < γ ⟨i.val + d, h⟩ := by intro d induction d with | zero => intro _ h0; omega | succ d ih => intro h _ rcases Nat.eq_zero_or_pos d with rfl | hd_pos · exact hstep i.val h · have hprev := ih (by omega) hd_pos have hnext := hstep (i.val + d) h exact lt_trans hprev hnext have hdiff : i.val + (j.val - i.val) = j.val := by omega have hlt := hind (j.val - i.val) (by omega) (by omega) convert hlt using 2 ext; exact hdiff.symm /-- **Finite Critical-Line Completeness & Simplicity Theorem**: Suppose `Z : Finset ℂ` is a finite set of strip zeros with positive integer multiplicities `mult : ℂ → ℕ` such that: - `Z` is closed under complex conjugation (`ρ ∈ Z → conj ρ ∈ Z`), - the argument-principle total multiplicity equals `2 * n`, and - `n` strictly increasing positive heights `γ : Fin n → ℝ` satisfy `1/2 + i (γ k) ∈ Z`. Then EVERY zero `ρ ∈ Z` lies strictly on the critical line `Re(ρ) = 1/2`, EVERY zero is simple (`mult ρ = 1`), `Z` has no real or off-line zeros, and `Z` consists of precisely `{1/2 ± i (γ k) | k : Fin n}`! -/ theorem finite_critical_line_completeness {n : ℕ} {Z : Finset ℂ} {mult : ℂ → ℕ} {γ : Fin n → ℝ} (hmult_pos : ∀ ρ ∈ Z, 1 ≤ mult ρ) (hconj : ∀ ρ ∈ Z, starRingEnd ℂ ρ ∈ Z) (hγ_pos : ∀ k : Fin n, 0 < γ k) (hγ_mono : StrictMono γ) (hγ_mem : ∀ k : Fin n, ((1 / 2 : ℝ) : ℂ) + (γ k : ℂ) * Complex.I ∈ Z) (htotal : ∑ ρ ∈ Z, mult ρ = 2 * n) : (∀ ρ ∈ Z, ρ.re = 1 / 2) ∧ (∀ ρ ∈ Z, mult ρ = 1) ∧ Z.card = 2 * n ∧ ∀ ρ ∈ Z, 0 < ρ.im → ∃ k : Fin n, ρ = ((1 / 2 : ℝ) : ℂ) + (γ k : ℂ) * Complex.I := by let fPos : Fin n → ℂ := fun k => ((1 / 2 : ℝ) : ℂ) + (γ k : ℂ) * Complex.I let fNeg : Fin n → ℂ := fun k => ((1 / 2 : ℝ) : ℂ) - (γ k : ℂ) * Complex.I let Spos : Finset ℂ := Finset.univ.image fPos let Sneg : Finset ℂ := Finset.univ.image fNeg have hfPos_inj : Function.Injective fPos := by intro i j hij have him := congr_arg Complex.im hij simp only [fPos, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, zero_add, Complex.ofReal_re] at him exact hγ_mono.injective him have hfNeg_inj : Function.Injective fNeg := by intro i j hij have him := congr_arg Complex.im hij simp only [fNeg, Complex.sub_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, zero_sub, Complex.ofReal_re, neg_inj] at him exact hγ_mono.injective him have hSpos_card : Spos.card = n := by rw [Finset.card_image_of_injective _ hfPos_inj, Finset.card_fin] have hSneg_card : Sneg.card = n := by rw [Finset.card_image_of_injective _ hfNeg_inj, Finset.card_fin] have hdisj : Disjoint Spos Sneg := by rw [Finset.disjoint_left] intro z hz1 hz2 obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hz1 obtain ⟨j, _, hj⟩ := Finset.mem_image.mp hz2 have him := congr_arg Complex.im hj simp only [fPos, fNeg, Complex.add_im, Complex.sub_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, zero_add, zero_sub, Complex.ofReal_re] at him linarith [hγ_pos i, hγ_pos j] have hsub : Spos ∪ Sneg ⊆ Z := by intro z hz rcases Finset.mem_union.mp hz with h1 | h2 · obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp h1 exact hγ_mem k · obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp h2 have hconj_eq : fNeg k = starRingEnd ℂ (fPos k) := by simp only [fNeg, fPos, map_add, map_mul, Complex.conj_ofReal, Complex.conj_I] ring rw [hconj_eq] exact hconj _ (hγ_mem k) have hcard_union : (Spos ∪ Sneg).card = 2 * n := by rw [Finset.card_union_of_disjoint hdisj, hSpos_card, hSneg_card]; omega -- Lower bound `∑_{ρ ∈ Z} mult ρ ≥ Z.card ≥ 2 * n = ∑_{ρ ∈ Z} mult ρ`. have hcard_le_sum : Z.card ≤ ∑ ρ ∈ Z, mult ρ := by calc Z.card = ∑ _ρ ∈ Z, 1 := by simp _ ≤ ∑ ρ ∈ Z, mult ρ := Finset.sum_le_sum (fun ρ hρ => hmult_pos ρ hρ) have hunion_le_card : (Spos ∪ Sneg).card ≤ Z.card := Finset.card_le_card hsub have hZ_card : Z.card = 2 * n := by omega have hZ_eq : Z = Spos ∪ Sneg := (Finset.eq_of_subset_of_card_le hsub (by omega)).symm have hmult_one : ∀ ρ ∈ Z, mult ρ = 1 := by intro ρ hρ by_contra hne have hge2 : 2 ≤ mult ρ := by have := hmult_pos ρ hρ; omega have hsplit := Finset.add_sum_erase Z mult hρ have hrest : (Z.erase ρ).card ≤ ∑ x ∈ Z.erase ρ, mult x := by calc (Z.erase ρ).card = ∑ _x ∈ Z.erase ρ, 1 := by simp _ ≤ ∑ x ∈ Z.erase ρ, mult x := Finset.sum_le_sum (fun x hx => hmult_pos x (Finset.mem_of_mem_erase hx)) have herase_card : (Z.erase ρ).card + 1 = Z.card := Finset.card_erase_add_one hρ omega refine ⟨?_, hmult_one, hZ_card, ?_⟩ · intro ρ hρ rw [hZ_eq] at hρ rcases Finset.mem_union.mp hρ with h1 | h2 · obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp h1 simp [fPos] · obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp h2 simp [fNeg] · intro ρ hρ him_pos rw [hZ_eq] at hρ rcases Finset.mem_union.mp hρ with h1 | h2 · obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp h1 exact ⟨k, rfl⟩ · obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp h2 simp only [fNeg, Complex.sub_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero, zero_sub, Complex.ofReal_re] at him_pos linarith [hγ_pos k] /-! ### 4. Kernel-Verified Exact 29 Isolating Intervals at `T = 100` (`certification-zeros-100.json`) -/ /-- Exact 192-bit rational lower endpoints for the 29 positive-height critical-line zeros with `0 < Im ρ < 100` from `evidence/certification-zeros-100.json`. -/ def zero29Lower : Fin 29 → ℚ := ![346582452017174193813233793676358040726494401463313113741 / 24519928653854221733733552434404946937899825954937634816, 4123671296809391233055705285023960423255078051487950735263 / 196159429230833773869868419475239575503198607639501078528, 2453057773747525343775283912940989444213679577176226540373 / 98079714615416886934934209737619787751599303819750539264, 2984063167633711610604075971057206155350355298488506893021 / 98079714615416886934934209737619787751599303819750539264, 201891340085414919049293581021326237728093739174682583665 / 6129982163463555433433388108601236734474956488734408704, 1843220813650918583526125236930855364103450037659286623179 / 49039857307708443467467104868809893875799651909875269632, 4013296283139859525617502575948072411188106142386871438689 / 98079714615416886934934209737619787751599303819750539264, 2124753491256698684862396169603464263124189777688568293585 / 49039857307708443467467104868809893875799651909875269632, 588541437311862940554827852921198868077860521433402687203 / 12259964326927110866866776217202473468949912977468817408, 4881803284725667817953985683443334933754968267856456797773 / 98079714615416886934934209737619787751599303819750539264, 2597657006810561008699970021188150252768309328704307474291 / 49039857307708443467467104868809893875799651909875269632, 5536231865239110439166429558695380338294976803936686428193 / 98079714615416886934934209737619787751599303819750539264, 181898160595119597332860837327756724993970217844680310793 / 3064991081731777716716694054300618367237478244367204352, 5966363477241975877450150033862711458857858598910377363291 / 98079714615416886934934209737619787751599303819750539264, 3193109869059802694221640934798611586960939690222070067805 / 49039857307708443467467104868809893875799651909875269632, 1644792168297256323707231596618528186220297572346243264667 / 24519928653854221733733552434404946937899825954937634816, 3410545616180542263993035844559172039927679255998532772245 / 49039857307708443467467104868809893875799651909875269632, 3534163128928718210073454042280080148274959779182066196007 / 49039857307708443467467104868809893875799651909875269632, 1856273614703639325886730057445835339414611299878359068353 / 24519928653854221733733552434404946937899825954937634816, 3783171949003609265519343756651969633132482488730240368157 / 49039857307708443467467104868809893875799651909875269632, 3890693550161181283548353123354118606542888622389232160203 / 49039857307708443467467104868809893875799651909875269632, 508239155801517628223223209414228651628273860914518658997 / 6129982163463555433433388108601236734474956488734408704, 2077708242331443287365240473827588686874611671178487582749 / 24519928653854221733733552434404946937899825954937634816, 2143661496057443372054569788919972524858924136080238590005 / 24519928653854221733733552434404946937899825954937634816, 1088796535311701217019803983526609239121911251650506455271 / 12259964326927110866866776217202473468949912977468817408, 2267894771173565368959314939892331260748690272249971052329 / 24519928653854221733733552434404946937899825954937634816, 2320844202864957604655109579032576234838247682619204358263 / 24519928653854221733733552434404946937899825954937634816, 4701482222552658984101603285473438097446905424690812184769 / 49039857307708443467467104868809893875799651909875269632, 605833457751329800541944467456107372219091840185705395855 / 6129982163463555433433388108601236734474956488734408704] /-- Exact 192-bit rational upper endpoints for the 29 positive-height critical-line zeros with `0 < Im ρ < 100` from `evidence/certification-zeros-100.json`. -/ def zero29Upper : Fin 29 → ℚ := ![1386329808068696775252935174707908042984548366403050703413 / 98079714615416886934934209737619787751599303819750539264, 4123671296809391233055705285028912183412219572587547232163 / 196159429230833773869868419475239575503198607639501078528, 2453057773747525343775283912943465324292250337726024788823 / 98079714615416886934934209737619787751599303819750539264, 2984063167633711610604075971059682035428926059038305141471 / 98079714615416886934934209737619787751599303819750539264, 807565360341659676197174324085923920932017646836179896773 / 24519928653854221733733552434404946937899825954937634816, 1843220813650918583526125236932093304142735417934185747405 / 49039857307708443467467104868809893875799651909875269632, 4013296283139859525617502575950548291266676902936669687141 / 98079714615416886934934209737619787751599303819750539264, 2124753491256698684862396169604702203163475157963467417811 / 49039857307708443467467104868809893875799651909875269632, 1177082874623725881109655705843016706175363733004254936519 / 24519928653854221733733552434404946937899825954937634816, 4881803284725667817953985683445810813833539028406255046225 / 98079714615416886934934209737619787751599303819750539264, 2597657006810561008699970021189388192807594708979206598517 / 49039857307708443467467104868809893875799651909875269632, 5536231865239110439166429558697856218373547564486484676645 / 98079714615416886934934209737619787751599303819750539264, 1455185284760956778662886698622672769971404432894892048457 / 24519928653854221733733552434404946937899825954937634816, 5966363477241975877450150033865187338936429359460175611743 / 98079714615416886934934209737619787751599303819750539264, 3193109869059802694221640934799849527000225070496969192033 / 49039857307708443467467104868809893875799651909875269632, 1644792168297256323707231596619147156239940262483692826781 / 24519928653854221733733552434404946937899825954937634816, 3410545616180542263993035844560409979966964636273431896473 / 49039857307708443467467104868809893875799651909875269632, 3534163128928718210073454042281318088314245159456965320235 / 49039857307708443467467104868809893875799651909875269632, 1856273614703639325886730057446454309434253990015808630467 / 24519928653854221733733552434404946937899825954937634816, 3783171949003609265519343756653207573171767869005139492385 / 49039857307708443467467104868809893875799651909875269632, 3890693550161181283548353123355356546582174002664131284431 / 49039857307708443467467104868809893875799651909875269632, 1016478311603035256446446418828766788266369066897762099051 / 12259964326927110866866776217202473468949912977468817408, 2077708242331443287365240473828207656894254361315937144863 / 24519928653854221733733552434404946937899825954937634816, 2143661496057443372054569788920591494878566826217688152119 / 24519928653854221733733552434404946937899825954937634816, 136099566913962652127475497940864840516466574589903904541 / 1532495540865888858358347027150309183618739122183602176, 2267894771173565368959314939892950230768332962387420614443 / 24519928653854221733733552434404946937899825954937634816, 2320844202864957604655109579033195204857890372756653920377 / 24519928653854221733733552434404946937899825954937634816, 4701482222552658984101603285474676037486190804965711308997 / 49039857307708443467467104868809893875799651909875269632, 1211666915502659601083888934912524229448005025440135572767 / 12259964326927110866866776217202473468949912977468817408] lemma zero29_lower_pos : ∀ k : Fin 29, (0 : ℚ) < zero29Lower k := by intro k; fin_cases k <;> simp [zero29Lower] lemma zero29_lower_lt_upper : ∀ k : Fin 29, zero29Lower k < zero29Upper k := by intro k; fin_cases k <;> simp [zero29Lower, zero29Upper] <;> norm_num lemma zero29_upper_lt_100 : ∀ k : Fin 29, zero29Upper k < 100 := by intro k; fin_cases k <;> simp [zero29Upper] <;> norm_num lemma zero29_strictly_separated : ∀ k : Fin 28, zero29Upper k.castSucc < zero29Lower k.succ := by intro k; fin_cases k <;> simp [zero29Lower, zero29Upper] <;> norm_num lemma zero29_width_lt : ∀ k : Fin 29, zero29Upper k - zero29Lower k < 1 / 10 ^ 28 := by intro k; fin_cases k <;> simp [zero29Lower, zero29Upper] <;> norm_num /-- **Certified 29-Zero Completeness Theorem up to Height `T = 100`**: Given a continuous real function `Ξ` (representing `ξ(1/2 + i t)`) with opposite signs at the 29 kernel-verified rational isolating intervals `(zero29Lower k, zero29Upper k) ⊂ (0, 100)` and a conjugation-symmetric critical-strip zero set `Z` in `(-1, 2) × (-100, 100)` of total multiplicity `57 + 1 = 58` (from the Cauchy winding cage `wind = 57`, `pole = 1`), EVERY zero in `Z` lies strictly on `Re(s) = 1/2`, EVERY zero is simple, and the 29 positive-height zeros lie one each inside the exact 29 rational intervals! -/ theorem certified_29_zeros_up_to_100 {Ξ : ℝ → ℝ} (hΞ_cont : Continuous Ξ) (hsign : ∀ k : Fin 29, Ξ (zero29Lower k : ℝ) * Ξ (zero29Upper k : ℝ) < 0) {Z : Finset ℂ} {mult : ℂ → ℕ} (hmult_pos : ∀ ρ ∈ Z, 1 ≤ mult ρ) (hconj : ∀ ρ ∈ Z, starRingEnd ℂ ρ ∈ Z) (hΞ_to_Z : ∀ t : ℝ, 0 < t → t < 100 → Ξ t = 0 → ((1 / 2 : ℝ) : ℂ) + (t : ℂ) * Complex.I ∈ Z) (hwind : (57 : ℕ) + 1 = ∑ ρ ∈ Z, mult ρ) : ∃ γ : Fin 29 → ℝ, StrictMono γ ∧ (∀ k : Fin 29, (zero29Lower k : ℝ) < γ k ∧ γ k < (zero29Upper k : ℝ) ∧ Ξ (γ k) = 0) ∧ (∀ ρ ∈ Z, ρ.re = 1 / 2) ∧ (∀ ρ ∈ Z, mult ρ = 1) ∧ Z.card = 58 ∧ ∀ ρ ∈ Z, 0 < ρ.im → ∃ k : Fin 29, ρ = ((1 / 2 : ℝ) : ℂ) + (γ k : ℂ) * Complex.I := by have hab : ∀ k : Fin 29, (zero29Lower k : ℝ) < (zero29Upper k : ℝ) := fun k => by exact_mod_cast zero29_lower_lt_upper k have hsep : ∀ k : Fin 29, ∀ hk : k.val + 1 < 29, (zero29Upper k : ℝ) ≤ (zero29Lower ⟨k.val + 1, hk⟩ : ℝ) := by intro k hk have hlt := zero29_strictly_separated ⟨k.val, by omega⟩ have hle : zero29Upper k ≤ zero29Lower ⟨k.val + 1, hk⟩ := le_of_lt hlt exact_mod_cast hle obtain ⟨γ, hmono, hγ⟩ := exists_strictMono_zeros_of_sign_changes hΞ_cont hab hsep hsign have hγ_pos : ∀ k : Fin 29, 0 < γ k := fun k => by have h0 : (0 : ℝ) < (zero29Lower k : ℝ) := by exact_mod_cast zero29_lower_pos k linarith [(hγ k).1] have hγ_lt100 : ∀ k : Fin 29, γ k < 100 := fun k => by have h100 : (zero29Upper k : ℝ) < 100 := by exact_mod_cast zero29_upper_lt_100 k linarith [(hγ k).2.1] have hγ_mem : ∀ k : Fin 29, ((1 / 2 : ℝ) : ℂ) + (γ k : ℂ) * Complex.I ∈ Z := fun k => hΞ_to_Z (γ k) (hγ_pos k) (hγ_lt100 k) (hγ k).2.2 have htot : ∑ ρ ∈ Z, mult ρ = 2 * 29 := by omega obtain ⟨hre, hmult1, hcard, hpos_ex⟩ := finite_critical_line_completeness hmult_pos hconj hγ_pos hmono hγ_mem htot exact ⟨γ, hmono, hγ, hre, hmult1, hcard, hpos_ex⟩ /-- **End-to-End 3D Gaussian Zero-Form Positivity from 29 Certified Zeros + Unconditional Tail Shield**: Genuinely pipes together all three pieces in a single theorem: 1. the 29 critical-line zeros in `(0, 100)` certified via `certified_29_zeros_up_to_100` (yielding `Z.card = 58`, `Re ρ = 1/2`, and `mult_fin ρ = 1` for every `ρ ∈ Z`), 2. the finite zero-form matrix `K_fin i j = ∑ ρ ∈ Z, (mult_fin ρ : ℝ) * (reflectedPair (1/4) (freqs i) (freqs j) ρ).re` (whose symmetry follows automatically from `reflectedPair_symm`), together with its FLINT enclosure `|K_fin i j - gaussian3x3Center i j| ≤ 10⁻⁹`, and 3. any unconditional multiplicity-weighted critical-strip tail `(S, mult_tail)` (`|Im ρ| ≥ 100`, NO RH and NO simplicity assumed on omitted zeros!) obeying Hasanalizade–Shen–Wong's shell count bound `∑ ρ ∈ S k, mult_tail ρ ≤ 2 (100 + k + 1) log(100 + k + 1)`, controlled via `tail_shells_tsum_le_tailBoundB` and `tailBoundB_100_le` (`≤ 1.48 × 10⁻¹⁵⁹`), to conclude simultaneously complete critical-line simplicity of `Z`, the unconditional tail bound `|K_tail i j| ≤ 1.48 × 10⁻¹⁵⁹`, and strict positive definiteness `Re(c* (K_fin + K_tail) c) > 0` for EVERY nonzero `c ∈ ℂ³`. -/ theorem certified_3D_gaussian_from_29_zeros_and_tail (freqs : Fin 3 → ℝ) (hfreqs : freqs = ![0, 14, 21]) {Ξ : ℝ → ℝ} (hΞ_cont : Continuous Ξ) (hsign : ∀ k : Fin 29, Ξ (zero29Lower k : ℝ) * Ξ (zero29Upper k : ℝ) < 0) {Z : Finset ℂ} {mult_fin : ℂ → ℕ} (hmult_pos : ∀ ρ ∈ Z, 1 ≤ mult_fin ρ) (hconj : ∀ ρ ∈ Z, starRingEnd ℂ ρ ∈ Z) (hΞ_to_Z : ∀ t : ℝ, 0 < t → t < 100 → Ξ t = 0 → ((1 / 2 : ℝ) : ℂ) + (t : ℂ) * Complex.I ∈ Z) (hwind : (57 : ℕ) + 1 = ∑ ρ ∈ Z, mult_fin ρ) (K_fin K_tail : Matrix (Fin 3) (Fin 3) ℝ) (hfin_def : ∀ i j : Fin 3, K_fin i j = ∑ ρ ∈ Z, (mult_fin ρ : ℝ) * (reflectedPair (1 / 4) (freqs i) (freqs j) ρ).re) (hsymm_tail : ∀ i j : Fin 3, K_tail j i = K_tail i j) (hfin : ∀ i j : Fin 3, |K_fin i j - gaussian3x3Center i j| ≤ 1 / 10 ^ 9) (S : ℕ → Finset ℂ) (mult_tail : ℂ → ℕ) (hstrip : ∀ k, ∀ ρ ∈ S k, 0 ≤ ρ.re ∧ ρ.re ≤ 1 ∧ (100 : ℝ) + (k : ℝ) ≤ |ρ.im|) (hcount : ∀ k, (∑ ρ ∈ S k, (mult_tail ρ : ℝ)) ≤ 2 * ((100 : ℝ) + (k : ℝ) + 1) * Real.log ((100 : ℝ) + (k : ℝ) + 1)) (htail_le_shells : ∀ i j : Fin 3, |K_tail i j| ≤ ∑' k : ℕ, ∑ ρ ∈ S k, (mult_tail ρ : ℝ) * ‖reflectedPair (1 / 4) (freqs i) (freqs j) ρ‖) : (∃ γ : Fin 29 → ℝ, StrictMono γ ∧ (∀ k : Fin 29, (zero29Lower k : ℝ) < γ k ∧ γ k < (zero29Upper k : ℝ) ∧ Ξ (γ k) = 0) ∧ (∀ ρ ∈ Z, ρ.re = 1 / 2) ∧ (∀ ρ ∈ Z, mult_fin ρ = 1) ∧ Z.card = 58) ∧ (∀ i j : Fin 3, |K_tail i j| ≤ 148 / 10 ^ 161) ∧ ∀ c : Fin 3 → ℂ, (∃ i : Fin 3, c i ≠ 0) → 0 < (∑ i : Fin 3, ∑ j : Fin 3, starRingEnd ℂ (c i) * (((K_fin + K_tail) i j : ℝ) : ℂ) * c j).re := by obtain ⟨γ, hmono, hγ, hre, hmult1, hcard, _⟩ := certified_29_zeros_up_to_100 hΞ_cont hsign hmult_pos hconj hΞ_to_Z hwind have hsymm_fin : ∀ i j : Fin 3, K_fin j i = K_fin i j := fun i j => by rw [hfin_def j i, hfin_def i j] refine Finset.sum_congr rfl (fun ρ _ => ?_) rw [reflectedPair_symm] have hfreq_le : ∀ i : Fin 3, |freqs i| ≤ 21 := by intro i; rw [hfreqs]; fin_cases i <;> (simp; try norm_num) have htail_B : ∀ i j : Fin 3, |K_tail i j| ≤ tailBoundB (1 / 4) 21 100 := by intro i j have hsh := (tail_shells_tsum_le_tailBoundB (σ := 1 / 4) (M := 21) (T := 100) (t_i := freqs i) (t_j := freqs j) (by norm_num) (by norm_num) (by norm_num) (hfreq_le i) (hfreq_le j) tailBoundB_100_le.1 S mult_tail hstrip hcount).2 exact le_trans (htail_le_shells i j) hsh refine ⟨⟨γ, hmono, hγ, hre, hmult1, hcard⟩, fun i j => le_trans (htail_B i j) tailBoundB_100_le.2.2, ?_⟩ exact certified_gaussian_3x3_from_finite_and_tail K_fin K_tail hsymm_fin hsymm_tail hfin htail_B end F04Riemann