import F04Riemann.ComparisonAndPositivity /-! # Worked Examples and Kernel-Checked Certifications (F04 §§1, 6 & Proof Review) This module formally verifies every concrete example in F04 and its accompanying proof review, using rigorous elementary bounds (no floating-point axioms): 1. **Section 1 two-variable counterexample** (`section1_counterexample`): `q(x, y) = x^2 + y^2 - 3xy` gives `1 > 0` on `(1, 0)` and `(0, 1)`, yet `-1 < 0` on `(1, 1)`. 2. **Section 6 arithmetic illustration** (`arithmetic_illustration_L_one_twentieth`): Centers `0, 7/10, 7/5` and width `L = 1/20`: exact prime-power ranges are `primePowerRange (13/20) (3/4) = {2}` (weight `log 2 / √2`) and `primePowerRange (27/20) (29/20) = {4}` (weight `log 2 / 2`). 3. **Certified infinite-dimensional three-window example** (`certified_three_window_L_one_hundredth`): Centers `0, 7/10, 7/5` and width `L = 1/100`: kernel-checked proof that every row margin of the `3 × 3` comparison matrix exceeds `1`, certifying `Q(∑_{i=0}^2 c_i φ_i) ≥ ‖∑_{i=0}^2 c_i φ_i‖_2^2` across the entire infinite-dimensional locally balanced three-window space! -/ namespace F04Riemann open Real Complex MeasureTheory Set Finset /-! ### 1. Section 1 Counterexample -/ /-- The Section 1 two-number example `x^2 + y^2 - 3xy`. -/ def section1Rule (x y : ℝ) : ℝ := x ^ 2 + y ^ 2 - 3 * x * y theorem section1_counterexample : section1Rule 1 0 = 1 ∧ section1Rule 0 1 = 1 ∧ section1Rule 1 1 = -1 := by norm_num [section1Rule] /-! ### 2. Elementary Kernel-Checked Bounds for `exp(-x)`, `log`, `cos`, `π`, and `arctan` -/ /-- Helper: integrating an inequality `f ≤ g` on `[0, x]` via FTC. -/ lemma sub_le_of_deriv_le {x : ℝ} (hx : 0 ≤ x) {f g f' g' : ℝ → ℝ} (hf : ∀ t ∈ uIcc 0 x, HasDerivAt f (f' t) t) (hg : ∀ t ∈ uIcc 0 x, HasDerivAt g (g' t) t) (hcf : Continuous f') (hcg : Continuous g') (hle : ∀ t ∈ Icc 0 x, f' t ≤ g' t) (h0 : f 0 ≤ g 0) : f x ≤ g x := by have h1 := intervalIntegral.integral_eq_sub_of_hasDerivAt hf (hcf.intervalIntegrable (μ := volume) 0 x) have h2 := intervalIntegral.integral_eq_sub_of_hasDerivAt hg (hcg.intervalIntegrable (μ := volume) 0 x) have hm := intervalIntegral.integral_mono_on hx (hcf.intervalIntegrable (μ := volume) 0 x) (hcg.intervalIntegrable (μ := volume) 0 x) hle linarith /-- Alternating Taylor bounds for `exp(-x)` for all `x ≥ 0`: `1 - x + x^2/2 - x^3/6 + x^4/24 - x^5/120 ≤ exp(-x) ≤ 1 - x + x^2/2 - x^3/6 + x^4/24 - x^5/120 + x^6/720`. -/ lemma exp_neg_taylor_bounds {x : ℝ} (hx : 0 ≤ x) : 1 - x + x ^ 2 / 2 - x ^ 3 / 6 + x ^ 4 / 24 - x ^ 5 / 120 ≤ Real.exp (-x) ∧ Real.exp (-x) ≤ 1 - x + x ^ 2 / 2 - x ^ 3 / 6 + x ^ 4 / 24 - x ^ 5 / 120 + x ^ 6 / 720 := by have h0 : ∀ t ≥ 0, Real.exp (-t) ≤ 1 := fun t ht => Real.exp_le_one_iff.mpr (by linarith) have h1 : ∀ t ≥ 0, 1 - t ≤ Real.exp (-t) := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => 1 - Real.exp (-s)) (g := fun s => s) (f' := fun s => Real.exp (-s)) (g' := fun _ => 1) (fun s _ => by simpa using (hasDerivAt_exp_neg s).const_sub 1) (fun s _ => hasDerivAt_id' s) (Real.continuous_exp.comp continuous_neg) continuous_const (fun s hs => h0 s hs.1) (by simp) linarith have h2 : ∀ t ≥ 0, Real.exp (-t) ≤ 1 - t + t ^ 2 / 2 := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => s - s ^ 2 / 2) (g := fun s => 1 - Real.exp (-s)) (f' := fun s => 1 - s) (g' := fun s => Real.exp (-s)) (fun s _ => by have hd := (hasDerivAt_id' s).sub ((hasDerivAt_pow 2 s).div_const 2) have hv : 1 - (2 : ℕ) * s ^ (2 - 1) / 2 = 1 - s := by push_cast; ring rwa [hv] at hd) (fun s _ => by simpa using (hasDerivAt_exp_neg s).const_sub 1) (continuous_const.sub continuous_id) (Real.continuous_exp.comp continuous_neg) (fun s hs => h1 s hs.1) (by simp) linarith have h3 : ∀ t ≥ 0, 1 - t + t ^ 2 / 2 - t ^ 3 / 6 ≤ Real.exp (-t) := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => 1 - Real.exp (-s)) (g := fun s => s - s ^ 2 / 2 + s ^ 3 / 6) (f' := fun s => Real.exp (-s)) (g' := fun s => 1 - s + s ^ 2 / 2) (fun s _ => by simpa using (hasDerivAt_exp_neg s).const_sub 1) (fun s _ => by have hd := ((hasDerivAt_id' s).sub ((hasDerivAt_pow 2 s).div_const 2)).add ((hasDerivAt_pow 3 s).div_const 6) have hv : 1 - (2 : ℕ) * s ^ (2 - 1) / 2 + (3 : ℕ) * s ^ (3 - 1) / 6 = 1 - s + s ^ 2 / 2 := by push_cast; ring rwa [hv] at hd) (Real.continuous_exp.comp continuous_neg) ((continuous_const.sub continuous_id).add ((continuous_pow 2).div_const 2)) (fun s hs => h2 s hs.1) (by simp) linarith have h4 : ∀ t ≥ 0, Real.exp (-t) ≤ 1 - t + t ^ 2 / 2 - t ^ 3 / 6 + t ^ 4 / 24 := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => s - s ^ 2 / 2 + s ^ 3 / 6 - s ^ 4 / 24) (g := fun s => 1 - Real.exp (-s)) (f' := fun s => 1 - s + s ^ 2 / 2 - s ^ 3 / 6) (g' := fun s => Real.exp (-s)) (fun s _ => by have hd := (((hasDerivAt_id' s).sub ((hasDerivAt_pow 2 s).div_const 2)).add ((hasDerivAt_pow 3 s).div_const 6)).sub ((hasDerivAt_pow 4 s).div_const 24) have hv : 1 - (2 : ℕ) * s ^ (2 - 1) / 2 + (3 : ℕ) * s ^ (3 - 1) / 6 - (4 : ℕ) * s ^ (4 - 1) / 24 = 1 - s + s ^ 2 / 2 - s ^ 3 / 6 := by push_cast; ring rwa [hv] at hd) (fun s _ => by simpa using (hasDerivAt_exp_neg s).const_sub 1) (((continuous_const.sub continuous_id).add ((continuous_pow 2).div_const 2)).sub ((continuous_pow 3).div_const 6)) (Real.continuous_exp.comp continuous_neg) (fun s hs => h3 s hs.1) (by simp) linarith have h5 : ∀ t ≥ 0, 1 - t + t ^ 2 / 2 - t ^ 3 / 6 + t ^ 4 / 24 - t ^ 5 / 120 ≤ Real.exp (-t) := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => 1 - Real.exp (-s)) (g := fun s => s - s ^ 2 / 2 + s ^ 3 / 6 - s ^ 4 / 24 + s ^ 5 / 120) (f' := fun s => Real.exp (-s)) (g' := fun s => 1 - s + s ^ 2 / 2 - s ^ 3 / 6 + s ^ 4 / 24) (fun s _ => by simpa using (hasDerivAt_exp_neg s).const_sub 1) (fun s _ => by have hd := ((((hasDerivAt_id' s).sub ((hasDerivAt_pow 2 s).div_const 2)).add ((hasDerivAt_pow 3 s).div_const 6)).sub ((hasDerivAt_pow 4 s).div_const 24)).add ((hasDerivAt_pow 5 s).div_const 120) have hv : 1 - (2 : ℕ) * s ^ (2 - 1) / 2 + (3 : ℕ) * s ^ (3 - 1) / 6 - (4 : ℕ) * s ^ (4 - 1) / 24 + (5 : ℕ) * s ^ (5 - 1) / 120 = 1 - s + s ^ 2 / 2 - s ^ 3 / 6 + s ^ 4 / 24 := by push_cast; ring rwa [hv] at hd) (Real.continuous_exp.comp continuous_neg) ((((continuous_const.sub continuous_id).add ((continuous_pow 2).div_const 2)).sub ((continuous_pow 3).div_const 6)).add ((continuous_pow 4).div_const 24)) (fun s hs => h4 s hs.1) (by simp) linarith have h6 : ∀ t ≥ 0, Real.exp (-t) ≤ 1 - t + t ^ 2 / 2 - t ^ 3 / 6 + t ^ 4 / 24 - t ^ 5 / 120 + t ^ 6 / 720 := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => s - s ^ 2 / 2 + s ^ 3 / 6 - s ^ 4 / 24 + s ^ 5 / 120 - s ^ 6 / 720) (g := fun s => 1 - Real.exp (-s)) (f' := fun s => 1 - s + s ^ 2 / 2 - s ^ 3 / 6 + s ^ 4 / 24 - s ^ 5 / 120) (g' := fun s => Real.exp (-s)) (fun s _ => by have hd := (((((hasDerivAt_id' s).sub ((hasDerivAt_pow 2 s).div_const 2)).add ((hasDerivAt_pow 3 s).div_const 6)).sub ((hasDerivAt_pow 4 s).div_const 24)).add ((hasDerivAt_pow 5 s).div_const 120)).sub ((hasDerivAt_pow 6 s).div_const 720) have hv : 1 - (2 : ℕ) * s ^ (2 - 1) / 2 + (3 : ℕ) * s ^ (3 - 1) / 6 - (4 : ℕ) * s ^ (4 - 1) / 24 + (5 : ℕ) * s ^ (5 - 1) / 120 - (6 : ℕ) * s ^ (6 - 1) / 720 = 1 - s + s ^ 2 / 2 - s ^ 3 / 6 + s ^ 4 / 24 - s ^ 5 / 120 := by push_cast; ring rwa [hv] at hd) (fun s _ => by simpa using (hasDerivAt_exp_neg s).const_sub 1) (((((continuous_const.sub continuous_id).add ((continuous_pow 2).div_const 2)).sub ((continuous_pow 3).div_const 6)).add ((continuous_pow 4).div_const 24)).sub ((continuous_pow 5).div_const 120)) (Real.continuous_exp.comp continuous_neg) (fun s hs => h5 s hs.1) (by simp) linarith exact ⟨h5 x hx, h6 x hx⟩ /-- Self-contained proof of `Real.pi < 3.15` via the 8th-degree Taylor upper bound on `cos`. -/ lemma pi_lt_315 : Real.pi < 3.15 := by have hcos_le : ∀ x ≥ 0, Real.cos x ≤ 1 - x ^ 2 / 2 + x ^ 4 / 24 - x ^ 6 / 720 + x ^ 8 / 40320 := by have h0 : ∀ t ≥ 0, Real.cos t ≤ 1 := fun t _ => Real.cos_le_one t have h1 : ∀ t ≥ 0, Real.sin t ≤ t := by intro t ht exact sub_le_of_deriv_le ht (fun s _ => Real.hasDerivAt_sin s) (fun s _ => hasDerivAt_id' s) Real.continuous_cos continuous_const (fun s hs => h0 s hs.1) (by simp) have h2 : ∀ t ≥ 0, 1 - t ^ 2 / 2 ≤ Real.cos t := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => 1 - Real.cos s) (g := fun s => s ^ 2 / 2) (f' := Real.sin) (g' := id) (fun s _ => by simpa using (Real.hasDerivAt_cos s).const_sub 1) (fun s _ => by have hd := (hasDerivAt_pow 2 s).div_const 2 have hv : (2 : ℕ) * s ^ (2 - 1) / 2 = s := by push_cast; ring rwa [hv] at hd) Real.continuous_sin continuous_id (fun s hs => h1 s hs.1) (by simp) linarith have h3 : ∀ t ≥ 0, t - t ^ 3 / 6 ≤ Real.sin t := by intro t ht exact sub_le_of_deriv_le ht (f := fun s => s - s ^ 3 / 6) (g := Real.sin) (f' := fun s => 1 - s ^ 2 / 2) (g' := Real.cos) (fun s _ => by have hd := (hasDerivAt_id' s).sub ((hasDerivAt_pow 3 s).div_const 6) have hv : 1 - (3 : ℕ) * s ^ (3 - 1) / 6 = 1 - s ^ 2 / 2 := by push_cast; ring rwa [hv] at hd) (fun s _ => Real.hasDerivAt_sin s) (continuous_const.sub ((continuous_pow 2).div_const 2)) Real.continuous_cos (fun s hs => h2 s hs.1) (by simp) have h4 : ∀ t ≥ 0, Real.cos t ≤ 1 - t ^ 2 / 2 + t ^ 4 / 24 := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => s ^ 2 / 2 - s ^ 4 / 24) (g := fun s => 1 - Real.cos s) (f' := fun s => s - s ^ 3 / 6) (g' := Real.sin) (fun s _ => by have hd := ((hasDerivAt_pow 2 s).div_const 2).sub ((hasDerivAt_pow 4 s).div_const 24) have hv : (2 : ℕ) * s ^ (2 - 1) / 2 - (4 : ℕ) * s ^ (4 - 1) / 24 = s - s ^ 3 / 6 := by push_cast; ring rwa [hv] at hd) (fun s _ => by simpa using (Real.hasDerivAt_cos s).const_sub 1) (continuous_id.sub ((continuous_pow 3).div_const 6)) Real.continuous_sin (fun s hs => h3 s hs.1) (by simp) linarith have h5 : ∀ t ≥ 0, Real.sin t ≤ t - t ^ 3 / 6 + t ^ 5 / 120 := by intro t ht exact sub_le_of_deriv_le ht (f := Real.sin) (g := fun s => s - s ^ 3 / 6 + s ^ 5 / 120) (f' := Real.cos) (g' := fun s => 1 - s ^ 2 / 2 + s ^ 4 / 24) (fun s _ => Real.hasDerivAt_sin s) (fun s _ => by have hd := ((hasDerivAt_id' s).sub ((hasDerivAt_pow 3 s).div_const 6)).add ((hasDerivAt_pow 5 s).div_const 120) have hv : 1 - (3 : ℕ) * s ^ (3 - 1) / 6 + (5 : ℕ) * s ^ (5 - 1) / 120 = 1 - s ^ 2 / 2 + s ^ 4 / 24 := by push_cast; ring rwa [hv] at hd) Real.continuous_cos ((continuous_const.sub ((continuous_pow 2).div_const 2)).add ((continuous_pow 4).div_const 24)) (fun s hs => h4 s hs.1) (by simp) have h6 : ∀ t ≥ 0, 1 - t ^ 2 / 2 + t ^ 4 / 24 - t ^ 6 / 720 ≤ Real.cos t := by intro t ht have h := sub_le_of_deriv_le ht (f := fun s => 1 - Real.cos s) (g := fun s => s ^ 2 / 2 - s ^ 4 / 24 + s ^ 6 / 720) (f' := Real.sin) (g' := fun s => s - s ^ 3 / 6 + s ^ 5 / 120) (fun s _ => by simpa using (Real.hasDerivAt_cos s).const_sub 1) (fun s _ => by have hd := (((hasDerivAt_pow 2 s).div_const 2).sub ((hasDerivAt_pow 4 s).div_const 24)).add ((hasDerivAt_pow 6 s).div_const 720) have hv : (2 : ℕ) * s ^ (2 - 1) / 2 - (4 : ℕ) * s ^ (4 - 1) / 24 + (6 : ℕ) * s ^ (6 - 1) / 720 = s - s ^ 3 / 6 + s ^ 5 / 120 := by push_cast; ring rwa [hv] at hd) Real.continuous_sin ((continuous_id.sub ((continuous_pow 3).div_const 6)).add ((continuous_pow 5).div_const 120)) (fun s hs => h5 s hs.1) (by simp) linarith have h7 : ∀ t ≥ 0, t - t ^ 3 / 6 + t ^ 5 / 120 - t ^ 7 / 5040 ≤ Real.sin t := by intro t ht exact sub_le_of_deriv_le ht (f := fun s => s - s ^ 3 / 6 + s ^ 5 / 120 - s ^ 7 / 5040) (g := Real.sin) (f' := fun s => 1 - s ^ 2 / 2 + s ^ 4 / 24 - s ^ 6 / 720) (g' := Real.cos) (fun s _ => by have hd := (((hasDerivAt_id' s).sub ((hasDerivAt_pow 3 s).div_const 6)).add ((hasDerivAt_pow 5 s).div_const 120)).sub ((hasDerivAt_pow 7 s).div_const 5040) have hv : 1 - (3 : ℕ) * s ^ (3 - 1) / 6 + (5 : ℕ) * s ^ (5 - 1) / 120 - (7 : ℕ) * s ^ (7 - 1) / 5040 = 1 - s ^ 2 / 2 + s ^ 4 / 24 - s ^ 6 / 720 := by push_cast; ring rwa [hv] at hd) (fun s _ => Real.hasDerivAt_sin s) (((continuous_const.sub ((continuous_pow 2).div_const 2)).add ((continuous_pow 4).div_const 24)).sub ((continuous_pow 6).div_const 720)) Real.continuous_cos (fun s hs => h6 s hs.1) (by simp) intro t ht have h := sub_le_of_deriv_le ht (f := fun s => s ^ 2 / 2 - s ^ 4 / 24 + s ^ 6 / 720 - s ^ 8 / 40320) (g := fun s => 1 - Real.cos s) (f' := fun s => s - s ^ 3 / 6 + s ^ 5 / 120 - s ^ 7 / 5040) (g' := Real.sin) (fun s _ => by have hd := ((((hasDerivAt_pow 2 s).div_const 2).sub ((hasDerivAt_pow 4 s).div_const 24)).add ((hasDerivAt_pow 6 s).div_const 720)).sub ((hasDerivAt_pow 8 s).div_const 40320) have hv : (2 : ℕ) * s ^ (2 - 1) / 2 - (4 : ℕ) * s ^ (4 - 1) / 24 + (6 : ℕ) * s ^ (6 - 1) / 720 - (8 : ℕ) * s ^ (8 - 1) / 40320 = s - s ^ 3 / 6 + s ^ 5 / 120 - s ^ 7 / 5040 := by push_cast; ring rwa [hv] at hd) (fun s _ => by simpa using (Real.hasDerivAt_cos s).const_sub 1) (((continuous_id.sub ((continuous_pow 3).div_const 6)).add ((continuous_pow 5).div_const 120)).sub ((continuous_pow 7).div_const 5040)) Real.continuous_sin (fun s hs => h7 s hs.1) (by simp) linarith have hcos_neg : Real.cos (63 / 40 : ℝ) < 0 := by have h := hcos_le (63 / 40 : ℝ) (by norm_num) linarith [show (1 : ℝ) - (63 / 40) ^ 2 / 2 + (63 / 40) ^ 4 / 24 - (63 / 40) ^ 6 / 720 + (63 / 40) ^ 8 / 40320 < 0 by norm_num] by_contra hge push Not at hge rcases eq_or_lt_of_le (show (63 / 40 : ℝ) ≤ Real.pi / 2 by linarith) with heq | hlt · rw [heq, Real.cos_pi_div_two] at hcos_neg linarith · have hmem : (63 / 40 : ℝ) ∈ Ioo (-(Real.pi / 2)) (Real.pi / 2) := ⟨by linarith [Real.pi_pos], hlt⟩ have hpos := Real.cos_pos_of_mem_Ioo hmem linarith /-- Sharp rational bounds on `log 2`, `log 3`, `log 4`, `log 5`, and `log 10`. -/ lemma log_two_gt : (69 / 100 : ℝ) < Real.log 2 := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 69 / 100) (by norm_num)).1 have hnum : (1 / 2 : ℝ) < 1 - 69 / 100 + (69 / 100) ^ 2 / 2 - (69 / 100) ^ 3 / 6 + (69 / 100) ^ 4 / 24 - (69 / 100) ^ 5 / 120 := by norm_num have hexp_neg : (1 / 2 : ℝ) < Real.exp (-(69 / 100)) := lt_of_lt_of_le hnum h rw [Real.exp_neg] at hexp_neg have hmul := mul_lt_mul_of_pos_right hexp_neg (Real.exp_pos (69 / 100)) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith lemma log_two_lt : Real.log 2 < 695 / 1000 := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 695 / 1000) (by norm_num)).2 have hnum : 1 - (695 / 1000 : ℝ) + (695 / 1000) ^ 2 / 2 - (695 / 1000) ^ 3 / 6 + (695 / 1000) ^ 4 / 24 - (695 / 1000) ^ 5 / 120 + (695 / 1000) ^ 6 / 720 < 1 / 2 := by norm_num have hexp_neg : Real.exp (-(695 / 1000)) < 1 / 2 := lt_of_le_of_lt h hnum rw [Real.exp_neg] at hexp_neg have hmul := mul_lt_mul_of_pos_right hexp_neg (Real.exp_pos (695 / 1000)) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith lemma log_four_eq : Real.log (4 : ℝ) = 2 * Real.log 2 := by have : (4 : ℝ) = 2 * 2 := by norm_num rw [this, Real.log_mul (by norm_num) (by norm_num)]; ring lemma log_three_gt : (1 : ℝ) < Real.log 3 := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 1 / 2) (by norm_num)).1 have hnum : (6 / 10 : ℝ) < 1 - 1 / 2 + (1 / 2) ^ 2 / 2 - (1 / 2) ^ 3 / 6 + (1 / 2) ^ 4 / 24 - (1 / 2) ^ 5 / 120 := by norm_num have h1 : (6 / 10 : ℝ) < Real.exp (-(1 / 2)) := lt_of_lt_of_le hnum h have hsq : (36 / 100 : ℝ) < Real.exp (-1) := by have heq : Real.exp (-1) = Real.exp (-(1 / 2)) ^ 2 := by rw [sq, ← Real.exp_add]; congr 1; ring rw [heq]; nlinarith rw [Real.exp_neg] at hsq have hmul := mul_lt_mul_of_pos_right hsq (Real.exp_pos 1) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith lemma log_three_lt : Real.log 3 < 6 / 5 := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 3 / 5) (by norm_num)).2 have hnum : 1 - (3 / 5 : ℝ) + (3 / 5) ^ 2 / 2 - (3 / 5) ^ 3 / 6 + (3 / 5) ^ 4 / 24 - (3 / 5) ^ 5 / 120 + (3 / 5) ^ 6 / 720 < 55 / 100 := by norm_num have h1 : Real.exp (-(3 / 5)) < 55 / 100 := lt_of_le_of_lt h hnum have hsq : Real.exp (-(6 / 5)) < 1 / 3 := by have heq : Real.exp (-(6 / 5)) = Real.exp (-(3 / 5)) ^ 2 := by rw [sq, ← Real.exp_add]; congr 1; ring rw [heq] have hpos : 0 < Real.exp (-(3 / 5)) := Real.exp_pos _ nlinarith rw [Real.exp_neg] at hsq have hmul := mul_lt_mul_of_pos_right hsq (Real.exp_pos (6 / 5)) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith lemma log_five_gt : (3 / 2 : ℝ) < Real.log 5 := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 3 / 4) (by norm_num)).1 have hnum : (47 / 100 : ℝ) < 1 - 3 / 4 + (3 / 4) ^ 2 / 2 - (3 / 4) ^ 3 / 6 + (3 / 4) ^ 4 / 24 - (3 / 4) ^ 5 / 120 := by norm_num have h1 : (47 / 100 : ℝ) < Real.exp (-(3 / 4)) := lt_of_lt_of_le hnum h have hsq : (1 / 5 : ℝ) < Real.exp (-(3 / 2)) := by have heq : Real.exp (-(3 / 2)) = Real.exp (-(3 / 4)) ^ 2 := by rw [sq, ← Real.exp_add]; congr 1; ring rw [heq]; nlinarith rw [Real.exp_neg] at hsq have hmul := mul_lt_mul_of_pos_right hsq (Real.exp_pos (3 / 2)) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith lemma log_ten_gt : (23 / 10 : ℝ) < Real.log 10 := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 23 / 40) (by norm_num)).1 have hnum : (5624 / 10000 : ℝ) < 1 - 23 / 40 + (23 / 40) ^ 2 / 2 - (23 / 40) ^ 3 / 6 + (23 / 40) ^ 4 / 24 - (23 / 40) ^ 5 / 120 := by norm_num have h1 : (5624 / 10000 : ℝ) < Real.exp (-(23 / 40)) := lt_of_lt_of_le hnum h have hpow4 : (1 / 10 : ℝ) < Real.exp (-(23 / 10)) := by have heq : Real.exp (-(23 / 10)) = (Real.exp (-(23 / 40)) ^ 2) ^ 2 := by rw [sq, sq, ← Real.exp_add, ← Real.exp_add]; congr 1; ring rw [heq] have h2 : (5624 / 10000 : ℝ) ^ 2 < Real.exp (-(23 / 40)) ^ 2 := by nlinarith have h4 : ((5624 / 10000 : ℝ) ^ 2) ^ 2 < (Real.exp (-(23 / 40)) ^ 2) ^ 2 := by nlinarith have hnum4 : (1 / 10 : ℝ) < ((5624 / 10000 : ℝ) ^ 2) ^ 2 := by norm_num linarith rw [Real.exp_neg] at hpow4 have hmul := mul_lt_mul_of_pos_right hpow4 (Real.exp_pos (23 / 10)) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith /-! ### 3. Section 6 Arithmetic Illustration (`centers = 0, 7/10, 7/5`, `L = 1/20`) -/ /-- Exact prime-power range for adjacent windows at `L = 1/20`: `[13/20, 3/4]` contains only `2`. -/ theorem primePowerRange_illustration_adj : primePowerRange (13 / 20) (3 / 4) = {2} := by ext n rw [mem_primePowerRange_iff, Finset.mem_singleton] constructor · rintro ⟨h2, hd, hD⟩ by_contra hne have h3 : 3 ≤ n := by omega have hlog3 : Real.log 3 ≤ Real.log (n : ℝ) := Real.log_le_log (by norm_num) (by exact_mod_cast h3) linarith [log_three_gt] · rintro rfl exact ⟨le_refl 2, by linarith [log_two_gt], by linarith [log_two_lt]⟩ /-- Exact prime-power range for outer windows at `L = 1/20`: `[27/20, 29/20]` contains only `4`. -/ theorem primePowerRange_illustration_outer : primePowerRange (27 / 20) (29 / 20) = {4} := by ext n rw [mem_primePowerRange_iff, Finset.mem_singleton] constructor · rintro ⟨h2, hd, hD⟩ by_cases hlt : n < 4 · have hle3 : n ≤ 3 := by omega have hlog : Real.log (n : ℝ) ≤ Real.log 3 := Real.log_le_log (by exact_mod_cast (show 0 < n by omega)) (by exact_mod_cast hle3) linarith [log_three_lt] · by_cases hgt : 4 < n · have h5 : 5 ≤ n := by omega have hlog5 : Real.log 5 ≤ Real.log (n : ℝ) := Real.log_le_log (by norm_num) (by exact_mod_cast h5) linarith [log_five_gt] · omega · rintro rfl have h4 : Real.log ((4 : ℕ) : ℝ) = 2 * Real.log 2 := by push_cast; exact log_four_eq rw [h4] exact ⟨by norm_num, by linarith [log_two_gt], by linarith [log_two_lt]⟩ /-- Exact arithmetic weights in the Section 6 illustration (`centers = 0, 7/10, 7/5`, `L = 1/20`): adjacent pairs carry `log 2 / √2` and the outer pair carries `log 2 / 2`. -/ theorem arithmetic_illustration_L_one_twentieth : P_bound (13 / 20) (3 / 4) = Real.log 2 / Real.sqrt 2 ∧ P_bound (27 / 20) (29 / 20) = Real.log 2 / 2 := by constructor · unfold P_bound rw [primePowerRange_illustration_adj, Finset.sum_singleton] simp [arithWeight, vonMangoldt_two] · unfold P_bound rw [primePowerRange_illustration_outer, Finset.sum_singleton] have hsqrt4 : Real.sqrt (4 : ℝ) = 2 := by have : (4 : ℝ) = 2 ^ 2 := by norm_num rw [this, Real.sqrt_sq (by norm_num)] simp [arithWeight, vonMangoldt_four, hsqrt4] /-! ### 4. Certified Infinite-Dimensional Three-Window Example (`L = 1/100`, Margin `ε = 1`) -/ lemma primePowerRange_certified_adj : primePowerRange (69 / 100) (71 / 100) = {2} := by ext n rw [mem_primePowerRange_iff, Finset.mem_singleton] constructor · rintro ⟨h2, _, hD⟩ by_contra hne have h3 : 3 ≤ n := by omega have hlog3 : Real.log 3 ≤ Real.log (n : ℝ) := Real.log_le_log (by norm_num) (by exact_mod_cast h3) linarith [log_three_gt] · rintro rfl exact ⟨le_refl 2, le_of_lt log_two_gt, by linarith [log_two_lt]⟩ lemma primePowerRange_certified_outer : primePowerRange (139 / 100) (141 / 100) = ∅ := by ext n rw [mem_primePowerRange_iff] simp only [Finset.notMem_empty, iff_false, not_and] intro h2 hd hD by_cases hle : n ≤ 4 · have hlog : Real.log (n : ℝ) ≤ Real.log (4 : ℝ) := Real.log_le_log (by exact_mod_cast (show 0 < n by omega)) (by exact_mod_cast hle) linarith [log_four_eq, log_two_lt] · have h5 : 5 ≤ n := by omega have hlog5 : Real.log 5 ≤ Real.log (n : ℝ) := Real.log_le_log (by norm_num) (by exact_mod_cast h5) linarith [log_five_gt] lemma eulerGamma_lt_63_100 : eulerGamma < 63 / 100 := by have h1 := eulerGamma_le_eulerSeq 9 unfold eulerSeq at h1 have hH10 : ∑ k ∈ Finset.range 10, (1 : ℝ) / ((k : ℝ) + 1) = 7381 / 2520 := by norm_num [Finset.sum_range_succ] rw [show (9 + 1 : ℕ) = 10 by rfl, hH10] at h1 push_cast at h1 have h10 : (9 : ℝ) + 1 = 10 := by norm_num rw [h10] at h1 linarith [log_ten_gt] lemma arctan_one_sub_arctan_le {x : ℝ} (hx : x ≤ 1) : arctan 1 - arctan x ≤ 1 - x := by have hftc := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hasDerivAt_arctan t) ((continuous_const.div (continuous_const.add (continuous_pow 2)) (fun t => ne_of_gt (one_add_sq_pos t))).intervalIntegrable x 1) rw [← hftc] have hle : ∫ t in x..1, 1 / (1 + t ^ 2) ≤ ∫ _t in x..1, (1 : ℝ) := by refine intervalIntegral.integral_mono_on hx ((continuous_const.div (continuous_const.add (continuous_pow 2)) (fun t => ne_of_gt (one_add_sq_pos t))).intervalIntegrable x 1) (continuous_const.intervalIntegrable x 1) (fun t _ => ?_) rw [div_le_one (one_add_sq_pos t)] linarith [sq_nonneg t] simpa using hle lemma m_func_one_hundredth_gt : (212 / 100 : ℝ) < m_func (1 / 100) := by unfold m_func B_func weilConstA have hL : (0 : ℝ) < 1 / 100 := by norm_num have hlog_ratio : Real.log 400 ≤ Real.log ((1 + Real.exp (-((1 / 100 : ℝ) / 2))) / (1 - Real.exp (-((1 / 100 : ℝ) / 2)))) := by have hr := ratio_ge_four_div hL have h400 : (4 : ℝ) / (1 / 100) = 400 := by norm_num rw [h400] at hr exact Real.log_le_log (by norm_num) hr -- Cancellation of `π/2` via `2 arctan(e^{-1/200}) ≥ π/2 - 1/100` have hatan_ge : Real.pi / 2 - 1 / 100 ≤ 2 * arctan (Real.exp (-((1 / 100 : ℝ) / 2))) := by have hq_le : Real.exp (-((1 / 100 : ℝ) / 2)) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) have hdiff := arctan_one_sub_arctan_le hq_le rw [arctan_one] at hdiff have hexp_ge : 1 - (1 / 200 : ℝ) ≤ Real.exp (-((1 / 100 : ℝ) / 2)) := by have h := (exp_neg_taylor_bounds (x := 1 / 200) (by norm_num)).1 have hnorm : (1 / 100 : ℝ) / 2 = 1 / 200 := by norm_num rw [hnorm] have hnum : (1 - 1 / 200 : ℝ) ≤ 1 - 1 / 200 + (1 / 200) ^ 2 / 2 - (1 / 200) ^ 3 / 6 + (1 / 200) ^ 4 / 24 - (1 / 200) ^ 5 / 120 := by norm_num linarith linarith -- Combine `log 400 - log (8π) = log (50 / π) > 2.76` have hlog_diff : (276 / 100 : ℝ) < Real.log 400 - Real.log (8 * Real.pi) := by rw [← Real.log_div (by norm_num) (by positivity)] have h50 : (400 : ℝ) / (8 * Real.pi) = 50 / Real.pi := by field_simp; ring rw [h50] have hgt : (1587 / 100 : ℝ) < 50 / Real.pi := by rw [lt_div_iff₀ Real.pi_pos] linarith [pi_lt_315] have hlog_1587 : (276 / 100 : ℝ) < Real.log (1587 / 100) := by rw [← Real.exp_lt_exp, Real.exp_log (by norm_num)] have h := (exp_neg_taylor_bounds (x := 276 / 500) (by norm_num)).1 have hnum : (5757 / 10000 : ℝ) < 1 - 276 / 500 + (276 / 500) ^ 2 / 2 - (276 / 500) ^ 3 / 6 + (276 / 500) ^ 4 / 24 - (276 / 500) ^ 5 / 120 := by norm_num have h1 : (5757 / 10000 : ℝ) < Real.exp (-(276 / 500)) := lt_of_lt_of_le hnum h have hpow5 : (100 / 1587 : ℝ) < Real.exp (-(276 / 100)) := by have heq : Real.exp (-(276 / 100)) = Real.exp (-(276 / 500)) ^ 5 := by rw [← Real.exp_nat_mul]; congr 1; push_cast; ring rw [heq] have hpos : (0 : ℝ) ≤ 5757 / 10000 := by norm_num have hlt5 : (5757 / 10000 : ℝ) ^ 5 < Real.exp (-(276 / 500)) ^ 5 := pow_lt_pow_left₀ h1 hpos (by norm_num) have hnum5 : (100 / 1587 : ℝ) < (5757 / 10000 : ℝ) ^ 5 := by norm_num linarith rw [Real.exp_neg] at hpow5 have hmul := mul_lt_mul_of_pos_right hpow5 (Real.exp_pos (276 / 100)) rw [inv_mul_cancel₀ (ne_of_gt (Real.exp_pos _))] at hmul linarith exact lt_trans hlog_1587 (Real.log_lt_log (by norm_num) hgt) linarith [eulerGamma_lt_63_100] lemma E_bound_certified_adj_lt : E_bound (1 / 100) (1 / 100) (69 / 100) (71 / 100) < 496 / 1000 := by unfold E_bound P_bound R_bound rw [primePowerRange_certified_adj, Finset.sum_singleton] simp only [arithWeight, vonMangoldt_two, Nat.cast_ofNat] -- Bound `log 2 / √2 < 0.493` have hP : Real.log 2 / Real.sqrt 2 < 493 / 1000 := by have hsqrt2 : (141 / 100 : ℝ) < Real.sqrt 2 := by have : (141 / 100 : ℝ) ^ 2 < 2 := by norm_num calc (141 / 100 : ℝ) = Real.sqrt ((141 / 100) ^ 2) := (Real.sqrt_sq (by norm_num)).symm _ < Real.sqrt 2 := Real.sqrt_lt_sqrt (by norm_num) this rw [div_lt_iff₀ (Real.sqrt_pos.mpr (by norm_num))] linarith [log_two_lt] -- Bound `R = (1/100) * e^{-5*0.69/2} / (1 - e^{-2*0.69}) < 0.003` have hR : Real.sqrt ((1 / 100 : ℝ) * (1 / 100)) * (Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ))))) < 3 / 1000 := by rw [Real.sqrt_mul_self (by norm_num)] have hnum_exp : Real.exp (-(5 * (69 / 100 : ℝ) / 2)) < 2 / 10 := by have h := (exp_neg_taylor_bounds (x := 23 / 40) (by norm_num)).2 have h1 : Real.exp (-(23 / 40)) < 57 / 100 := lt_of_le_of_lt h (by norm_num) have heq : Real.exp (-(5 * (69 / 100 : ℝ) / 2)) = Real.exp (-(23 / 40)) ^ 3 := by rw [← Real.exp_nat_mul]; congr 1; push_cast; ring rw [heq] have h3 : Real.exp (-(23 / 40)) ^ 3 < (57 / 100 : ℝ) ^ 3 := pow_lt_pow_left₀ h1 (le_of_lt (Real.exp_pos _)) (by norm_num) have hnum3 : (57 / 100 : ℝ) ^ 3 < 2 / 10 := by norm_num linarith have hden_exp : (7 / 10 : ℝ) < 1 - Real.exp (-(2 * (69 / 100 : ℝ))) := by have h := (exp_neg_taylor_bounds (x := 69 / 100) (by norm_num)).2 have h1 : Real.exp (-(69 / 100)) < 51 / 100 := lt_of_le_of_lt h (by norm_num) have heq : Real.exp (-(2 * (69 / 100 : ℝ))) = Real.exp (-(69 / 100)) ^ 2 := by rw [sq, ← Real.exp_add]; congr 1; ring rw [heq] have hpos : 0 < Real.exp (-(69 / 100)) := Real.exp_pos _ nlinarith have hfrac : Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) < (2 / 10) / (7 / 10) := by calc Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) < (2 / 10) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) := div_lt_div_of_pos_right hnum_exp (by linarith) _ < (2 / 10) / (7 / 10) := div_lt_div_of_pos_left (by norm_num) (by norm_num) hden_exp linarith linarith lemma E_bound_certified_outer_lt : E_bound (1 / 100) (1 / 100) (139 / 100) (141 / 100) < 3 / 1000 := by unfold E_bound P_bound R_bound rw [primePowerRange_certified_outer, Finset.sum_empty, zero_add] have hanti := residualWeight_antiOn (by norm_num : (0 : ℝ) < 69 / 100) (by norm_num : (0 : ℝ) < 139 / 100) (by norm_num : (69 / 100 : ℝ) < 139 / 100) unfold residualWeight at hanti rw [mul_div_assoc (2 : ℝ), mul_div_assoc (2 : ℝ)] at hanti have h1 : Real.exp (-(5 * (139 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (139 / 100 : ℝ)))) < Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) := by linarith have hR_adj : Real.sqrt ((1 / 100 : ℝ) * (1 / 100)) * (Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ))))) < 3 / 1000 := by have hE := E_bound_certified_adj_lt unfold E_bound P_bound R_bound at hE rw [primePowerRange_certified_adj, Finset.sum_singleton] at hE -- Direct bound using the exact same inequality on `residualWeight (69/100)` rw [Real.sqrt_mul_self (by norm_num)] have hnum_exp : Real.exp (-(5 * (69 / 100 : ℝ) / 2)) < 2 / 10 := by have h := (exp_neg_taylor_bounds (x := 23 / 40) (by norm_num)).2 have h1' : Real.exp (-(23 / 40)) < 57 / 100 := lt_of_le_of_lt h (by norm_num) have heq : Real.exp (-(5 * (69 / 100 : ℝ) / 2)) = Real.exp (-(23 / 40)) ^ 3 := by rw [← Real.exp_nat_mul]; congr 1; push_cast; ring rw [heq] have h3 : Real.exp (-(23 / 40)) ^ 3 < (57 / 100 : ℝ) ^ 3 := pow_lt_pow_left₀ h1' (le_of_lt (Real.exp_pos _)) (by norm_num) have hnum3 : (57 / 100 : ℝ) ^ 3 < 2 / 10 := by norm_num linarith have hden_exp : (7 / 10 : ℝ) < 1 - Real.exp (-(2 * (69 / 100 : ℝ))) := by have h := (exp_neg_taylor_bounds (x := 69 / 100) (by norm_num)).2 have h1' : Real.exp (-(69 / 100)) < 51 / 100 := lt_of_le_of_lt h (by norm_num) have heq : Real.exp (-(2 * (69 / 100 : ℝ))) = Real.exp (-(69 / 100)) ^ 2 := by rw [sq, ← Real.exp_add]; congr 1; ring rw [heq] have hpos : 0 < Real.exp (-(69 / 100)) := Real.exp_pos _ nlinarith have hfrac : Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) < (2 / 10) / (7 / 10) := by calc Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) < (2 / 10) / (1 - Real.exp (-(2 * (69 / 100 : ℝ)))) := div_lt_div_of_pos_right hnum_exp (by linarith) _ < (2 / 10) / (7 / 10) := div_lt_div_of_pos_left (by norm_num) (by norm_num) hden_exp linarith have hmul : Real.sqrt ((1 / 100 : ℝ) * (1 / 100)) * (Real.exp (-(5 * (139 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (139 / 100 : ℝ))))) < Real.sqrt ((1 / 100 : ℝ) * (1 / 100)) * (Real.exp (-(5 * (69 / 100 : ℝ) / 2)) / (1 - Real.exp (-(2 * (69 / 100 : ℝ))))) := by rw [Real.sqrt_mul_self (by norm_num)] linarith linarith /-- The three centers `0, 7/10, 7/5` from Section 6 and `PROOF-REVIEW.md`. -/ noncomputable def exampleCenters : Fin 3 → ℝ := ![0, 7 / 10, 7 / 5] /-- **Kernel-checked certification of the three-window `N = 1` example (`L = 1/100`, `ε = 1`)**: On the three windows centered at `0, 7/10, 7/5` with common width `1/100`, EVERY row margin of the `3 × 3` comparison matrix exceeds `1`, certifying `Q(∑_{i=0}^2 c_i φ_i) ≥ ‖∑_{i=0}^2 c_i φ_i‖_2^2` for ALL locally balanced smooth functions supported in those windows and ALL complex coefficients `c ∈ ℂ³`. -/ theorem certified_three_window_L_one_hundredth (φ : Fin 3 → TestFn) (c : Fin 3 → ℂ) (hsupp : ∀ i : Fin 3, SupportedIn (φ i) (exampleCenters i - 1 / 200) (exampleCenters i + 1 / 200)) (hbal : ∀ i : Fin 3, IsBalanced (φ i)) : normSq (∑ i : Fin 3, c i • φ i) ≤ Q_form (∑ i : Fin 3, c i • φ i) := by set a : Fin 3 → ℝ := fun i => exampleCenters i - 1 / 200 set b : Fin 3 → ℝ := fun i => exampleCenters i + 1 / 200 have hL_pos : ∀ i : Fin 3, 0 < b i - a i := fun i => by simp only [a, b]; norm_num have hL_le : ∀ i : Fin 3, b i - a i ≤ Real.log 2 := fun i => by have hlen : b i - a i = 1 / 100 := by simp only [a, b]; ring rw [hlen]; linarith [log_two_gt] have hsep : ∀ i j : Fin 3, i < j → b i < a j := by intro i j hij fin_cases i <;> fin_cases j <;> simp_all [a, b, exampleCenters] <;> norm_num have hE01 : offDiagBound a b 0 1 < 496 / 1000 := by rw [offDiagBound_of_lt a b (by decide : (0 : Fin 3) < 1)] have h : E_bound (b 0 - a 0) (b 1 - a 1) (a 1 - b 0) (b 1 - a 0) = E_bound (1 / 100) (1 / 100) (69 / 100) (71 / 100) := by simp only [a, b, exampleCenters, Matrix.cons_val_zero, Matrix.cons_val_one] norm_num rw [h]; exact E_bound_certified_adj_lt have hE12 : offDiagBound a b 1 2 < 496 / 1000 := by rw [offDiagBound_of_lt a b (by decide : (1 : Fin 3) < 2)] have h : E_bound (b 1 - a 1) (b 2 - a 2) (a 2 - b 1) (b 2 - a 1) = E_bound (1 / 100) (1 / 100) (69 / 100) (71 / 100) := by simp only [a, b, exampleCenters, Matrix.cons_val_one, Matrix.cons_val_two] norm_num rw [h]; exact E_bound_certified_adj_lt have hE02 : offDiagBound a b 0 2 < 3 / 1000 := by rw [offDiagBound_of_lt a b (by decide : (0 : Fin 3) < 2)] have h : E_bound (b 0 - a 0) (b 2 - a 2) (a 2 - b 0) (b 2 - a 0) = E_bound (1 / 100) (1 / 100) (139 / 100) (141 / 100) := by simp only [a, b, exampleCenters, Matrix.cons_val_zero, Matrix.cons_val_two] norm_num rw [h]; exact E_bound_certified_outer_lt have hrow : ∀ i : Fin 3, (1 : ℝ) ≤ rowMargin a b i := by intro i unfold rowMargin have hlen : b i - a i = 1 / 100 := by simp only [a, b]; ring rw [hlen] fin_cases i · change (1 : ℝ) ≤ m_func (1 / 100) - ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 0), offDiagBound a b 0 j have hsum : ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 0), offDiagBound a b 0 j = offDiagBound a b 0 1 + offDiagBound a b 0 2 := by have hset : Finset.univ.filter (fun j : Fin 3 => j ≠ 0) = {1, 2} := by decide rw [hset, Finset.sum_pair (by decide)] rw [hsum] linarith [m_func_one_hundredth_gt] · change (1 : ℝ) ≤ m_func (1 / 100) - ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 1), offDiagBound a b 1 j have hsum : ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 1), offDiagBound a b 1 j = offDiagBound a b 1 0 + offDiagBound a b 1 2 := by have hset : Finset.univ.filter (fun j : Fin 3 => j ≠ 1) = {0, 2} := by decide rw [hset, Finset.sum_pair (by decide)] rw [hsum, offDiagBound_symm a b 1 0] linarith [m_func_one_hundredth_gt] · change (1 : ℝ) ≤ m_func (1 / 100) - ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 2), offDiagBound a b 2 j have hsum : ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 2), offDiagBound a b 2 j = offDiagBound a b 2 0 + offDiagBound a b 2 1 := by have hset : Finset.univ.filter (fun j : Fin 3 => j ≠ 2) = {0, 1} := by decide rw [hset, Finset.sum_pair (by decide)] rw [hsum, offDiagBound_symm a b 2 0, offDiagBound_symm a b 2 1] linarith [m_func_one_hundredth_gt] have hM := row_dominance_implies_matrix_lower_bound hsep hrow have hpos := theorem1_uniform_positivity hL_pos hL_le hsep hsupp hbal hM c simpa using hpos end F04Riemann