import F04Riemann.SchurLDLAndSevenWindows import F04Riemann.CodimensionAndCutoff /-! # Closing the Codimension `2r - 2` Local-Balance Gap on Separated Windows In the baseline multi-window theory (`WindowBounds.lean`, `ComparisonAndPositivity.lean`, `FiniteChainBounds.lean`, `SchurLDLAndSevenWindows.lean`), individual windows `φ_i` were assumed to be locally balanced (`∀ i, IsBalanced (φ_i)`), a subspace of complex codimension `2r - 2` inside the globally balanced space (`CodimensionAndCutoff.lean`). Local balance was used only in `lemma2_interwindow_bound` to annihilate the leading archimedean term `2 e^{-t/2}` via the Fubini identity `fubini_exp_corr_eq_moments`. This module removes the local-balance hypothesis completely on separated windows by directly controlling the uncancelled Fubini moment product via exact weighted Cauchy–Schwarz bounds: 1. **Exact Cauchy–Schwarz Moment Bounds (`norm_momentNeg_le`, `norm_momentPos_le`, `norm_momentNeg_mul_conj_momentPos_le`, `norm_momentNeg_mul_conj_momentPos_le_simple`)**: For any smooth `φ` supported in `[a, b]` (`a ≤ b`), `‖momentNeg φ‖ ≤ √(e^{-a} - e^{-b}) ‖φ‖_2` and `‖momentPos φ‖ ≤ √(e^{b} - e^{a}) ‖φ‖_2`. For two separated windows `[a₁, b₁]` and `[a₂, b₂]` with lengths `L₁, L₂` and gap `d = a₂ - b₁`, `‖momentNeg φ₂ * conj(momentPos φ₁)‖ ≤ F_unbal L₁ L₂ d * ‖φ₁‖_2 * ‖φ₂‖_2` `≤ e^{-d/2} √(L₁ L₂) ‖φ₁‖_2 ‖φ₂‖_2`, where `F_unbal L₁ L₂ d = e^{-d/2} √((1 - e^{-L₁})(1 - e^{-L₂}))`. 2. **Unbalanced Lemma 2 (`exact_interwindow_interaction_split`, `lemma2_interwindow_bound_unbalanced`, `lemma2_interwindow_bound_unbalanced_simple`)**: With `E_unbal L₁ L₂ d D = E_bound L₁ L₂ d D + F_unbal L₁ L₂ d`, every pair of smooth functions `φ₁, φ₂` supported in strictly separated intervals `[a₁, b₁]` and `[a₂, b₂]` (`b₁ < a₂`) — with NO `IsBalanced` assumption on either `φ₁` or `φ₂` — satisfies `‖B_form φ₂ φ₁‖ ≤ E_unbal L₁ L₂ d D * l2Norm φ₁ * l2Norm φ₂`. 3. **Unbalanced Comparison Matrices & General Positivity (`compMatrixUnbal`, `compMatrixChainUnbal`, `theorem1_unbalanced_comparison`, `theorem1_unbalanced_uniform_positivity`, `theorem1_chain_unbalanced_comparison`, `theorem1_chain_unbalanced_uniform_positivity`)**: Comparison inequalities and uniform positivity without local-balance assumptions. 4. **Global-Balance Theorem 2 (`theorem2_fixed_centers_unbalanced_explicit`, `theorem2_fixed_centers_global_balance`, `theorem2_globally_balanced_subspace`)**: For any fixed strictly increasing real centers `c_0 < ... < c_{r-1}` (`r ≥ 1`) and any margin `η > 0`, there is an explicit `L₀ > 0` such that for all `0 < L ≤ L₀`, every family `φ : Fin r → TestFn` supported in `[c_i - L/2, c_i + L/2]` — and in particular every globally balanced function across all `2r - 2` non-locally-balanced directions — satisfies `η * normSq (∑ i, φ i) ≤ Q_form (∑ i, φ i)` and strict positivity when nonzero. 5. **Kernel-Checked Unbalanced Certificates and Strict-Extension Witness**: - `certified_three_window_L_one_hundredth_unbalanced`: centers `0, 7/10, 7/5`, `L = 1/100`, sharp margin `ε = 1`, no local balance. - `certified_three_window_L_one_twentieth_unbalanced`: centers `0, 7/10, 7/5`, `L = 1/20`, `N = 64`, exact `3 × 3` rational `LDLᵀ` certificate with margin `ε = 1/6`, no local balance. - `exists_globally_balanced_not_locally_balanced_positive`: explicit nonzero globally balanced sum `φ₀ + φ₁` on separated narrow windows where neither `φ₀` nor `φ₁` is locally balanced, yet `0 < Q_form (φ₀ + φ₁)`. -/ namespace F04Riemann open Real Complex MeasureTheory Set Finset Matrix /-! ### 1. Exact Cauchy–Schwarz Moment Bounds -/ /-- Exact weighted Cauchy–Schwarz bound for `momentNeg` on `[a, b]` (`a ≤ b`): `‖∫ φ(u) e^{-u/2} du‖ ≤ √(e^{-a} - e^{-b}) ‖φ‖_2`. -/ lemma norm_momentNeg_le {φ : TestFn} {a b : ℝ} (hab : a ≤ b) (hsupp : SupportedIn φ a b) : ‖momentNeg φ‖ ≤ Real.sqrt (Real.exp (-a) - Real.exp (-b)) * l2Norm φ := by have h1 : ‖momentNeg φ‖ ≤ ∫ u, ‖φ u‖ * Real.exp (-(u / 2)) := by calc ‖momentNeg φ‖ ≤ ∫ u, ‖φ u * ((Real.exp (-(u / 2)) : ℝ) : ℂ)‖ := MeasureTheory.norm_integral_le_integral_norm _ _ = ∫ u, ‖φ u‖ * Real.exp (-(u / 2)) := by congr 1; ext u rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (le_of_lt (Real.exp_pos _))] let g : ℝ → ℝ := (Icc a b).indicator (fun u => Real.exp (-(u / 2))) have hprod : (fun u => ‖φ u‖ * g u) = fun u => ‖φ u‖ * Real.exp (-(u / 2)) := by ext u by_cases hu : u ∈ Icc a b · simp [g, hu] · simp [g, hu, hsupp u hu] have hg_sq : (fun u => g u ^ 2) = (Icc a b).indicator (fun u => Real.exp (-u)) := by ext u by_cases hu : u ∈ Icc a b · simp only [g, Set.indicator_of_mem hu] rw [sq, ← Real.exp_add]; congr 1; ring · simp [g, hu] have hg2_int : Integrable (fun u => g u ^ 2) volume := by rw [hg_sq] exact (integrable_indicator_iff measurableSet_Icc).mpr (Real.continuous_exp.comp continuous_neg).continuousOn.integrableOn_Icc have hfg_int : Integrable (fun u => ‖φ u‖ * g u) volume := by rw [hprod] have hnorm := φ.integrable_mul_exp_neg_half.norm have hfun : (fun u => ‖φ u * ((Real.exp (-(u / 2)) : ℝ) : ℂ)‖) = fun u => ‖φ u‖ * Real.exp (-(u / 2)) := by ext u rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (le_of_lt (Real.exp_pos _))] rwa [hfun] at hnorm have hcs := integral_mul_le_sqrt_mul_sqrt hfg_int φ.integrable_norm_sq hg2_int rw [hprod] at hcs have hg_val : ∫ u, g u ^ 2 = Real.exp (-a) - Real.exp (-b) := by rw [hg_sq, MeasureTheory.integral_indicator measurableSet_Icc, ← MeasureTheory.setIntegral_congr_set Ioc_ae_eq_Icc, ← intervalIntegral.integral_of_le hab] have hderiv : ∀ x ∈ uIcc a b, HasDerivAt (fun u => -Real.exp (-u)) (Real.exp (-x)) x := by intro x _ have h := (hasDerivAt_exp_neg x).neg rwa [neg_neg] at h have hint : IntervalIntegrable (fun u => Real.exp (-u)) volume a b := (Real.continuous_exp.comp continuous_neg).intervalIntegrable a b have hftc := intervalIntegral.integral_eq_sub_of_hasDerivAt hderiv hint linarith rw [hg_val, mul_comm] at hcs exact le_trans h1 hcs /-- Exact weighted Cauchy–Schwarz bound for `momentPos` on `[a, b]` (`a ≤ b`): `‖∫ φ(u) e^{u/2} du‖ ≤ √(e^{b} - e^{a}) ‖φ‖_2`. -/ lemma norm_momentPos_le {φ : TestFn} {a b : ℝ} (hab : a ≤ b) (hsupp : SupportedIn φ a b) : ‖momentPos φ‖ ≤ Real.sqrt (Real.exp b - Real.exp a) * l2Norm φ := by have h1 : ‖momentPos φ‖ ≤ ∫ u, ‖φ u‖ * Real.exp (u / 2) := by calc ‖momentPos φ‖ ≤ ∫ u, ‖φ u * ((Real.exp (u / 2) : ℝ) : ℂ)‖ := MeasureTheory.norm_integral_le_integral_norm _ _ = ∫ u, ‖φ u‖ * Real.exp (u / 2) := by congr 1; ext u rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (le_of_lt (Real.exp_pos _))] let g : ℝ → ℝ := (Icc a b).indicator (fun u => Real.exp (u / 2)) have hprod : (fun u => ‖φ u‖ * g u) = fun u => ‖φ u‖ * Real.exp (u / 2) := by ext u by_cases hu : u ∈ Icc a b · simp [g, hu] · simp [g, hu, hsupp u hu] have hg_sq : (fun u => g u ^ 2) = (Icc a b).indicator (fun u => Real.exp u) := by ext u by_cases hu : u ∈ Icc a b · simp only [g, Set.indicator_of_mem hu] rw [sq, ← Real.exp_add]; congr 1; ring · simp [g, hu] have hg2_int : Integrable (fun u => g u ^ 2) volume := by rw [hg_sq] exact (integrable_indicator_iff measurableSet_Icc).mpr Real.continuous_exp.continuousOn.integrableOn_Icc have hfg_int : Integrable (fun u => ‖φ u‖ * g u) volume := by rw [hprod] have hnorm := φ.integrable_mul_exp_pos_half.norm have hfun : (fun u => ‖φ u * ((Real.exp (u / 2) : ℝ) : ℂ)‖) = fun u => ‖φ u‖ * Real.exp (u / 2) := by ext u rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (le_of_lt (Real.exp_pos _))] rwa [hfun] at hnorm have hcs := integral_mul_le_sqrt_mul_sqrt hfg_int φ.integrable_norm_sq hg2_int rw [hprod] at hcs have hg_val : ∫ u, g u ^ 2 = Real.exp b - Real.exp a := by rw [hg_sq, MeasureTheory.integral_indicator measurableSet_Icc, ← MeasureTheory.setIntegral_congr_set Ioc_ae_eq_Icc, ← intervalIntegral.integral_of_le hab] exact intervalIntegral.integral_eq_sub_of_hasDerivAt (fun x _ => Real.hasDerivAt_exp x) (Real.continuous_exp.intervalIntegrable a b) rw [hg_val, mul_comm] at hcs exact le_trans h1 hcs /-- Sharp unbalanced Fubini moment-coupling bound: `F_unbal L₁ L₂ d = e^{-d/2} √((1 - e^{-L₁})(1 - e^{-L₂}))`. -/ noncomputable def F_unbal (L₁ L₂ d : ℝ) : ℝ := Real.exp (-(d / 2)) * Real.sqrt ((1 - Real.exp (-L₁)) * (1 - Real.exp (-L₂))) /-- Simplified unbalanced Fubini moment-coupling bound: `F_unbal_simple L₁ L₂ d = e^{-d/2} √(L₁ L₂)`. -/ noncomputable def F_unbal_simple (L₁ L₂ d : ℝ) : ℝ := Real.exp (-(d / 2)) * Real.sqrt (L₁ * L₂) lemma F_unbal_nonneg (L₁ L₂ d : ℝ) : 0 ≤ F_unbal L₁ L₂ d := mul_nonneg (le_of_lt (Real.exp_pos _)) (Real.sqrt_nonneg _) lemma F_unbal_simple_nonneg (L₁ L₂ d : ℝ) : 0 ≤ F_unbal_simple L₁ L₂ d := mul_nonneg (le_of_lt (Real.exp_pos _)) (Real.sqrt_nonneg _) lemma F_unbal_symm (L₁ L₂ d : ℝ) : F_unbal L₁ L₂ d = F_unbal L₂ L₁ d := by unfold F_unbal rw [mul_comm (1 - Real.exp (-L₁))] lemma one_sub_exp_neg_nonneg {x : ℝ} (hx : 0 ≤ x) : 0 ≤ 1 - Real.exp (-x) := by have hle : Real.exp (-x) ≤ 1 := Real.exp_le_one_iff.mpr (by linarith) linarith lemma one_sub_exp_neg_le (x : ℝ) : 1 - Real.exp (-x) ≤ x := by have h := Real.add_one_le_exp (-x) linarith /-- Sharp-to-simple comparison: `F_unbal L₁ L₂ d ≤ e^{-d/2} √(L₁ L₂)` for `L₁, L₂ ≥ 0`. -/ lemma F_unbal_le_simple {L₁ L₂ d : ℝ} (hL₁ : 0 ≤ L₁) (hL₂ : 0 ≤ L₂) : F_unbal L₁ L₂ d ≤ F_unbal_simple L₁ L₂ d := by unfold F_unbal F_unbal_simple refine mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt ?_) (le_of_lt (Real.exp_pos _)) exact mul_le_mul (one_sub_exp_neg_le L₁) (one_sub_exp_neg_le L₂) (one_sub_exp_neg_nonneg hL₂) hL₁ lemma F_unbal_anti_d {L₁ L₂ d₁ d₂ : ℝ} (hd : d₁ ≤ d₂) : F_unbal L₁ L₂ d₂ ≤ F_unbal L₁ L₂ d₁ := by unfold F_unbal exact mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr (by linarith)) (Real.sqrt_nonneg _) /-- Exact separated-window Cauchy–Schwarz bound on the Fubini moment product: `‖momentNeg φ₂ * conj(momentPos φ₁)‖ ≤ e^{-d/2} √((1 - e^{-L₁})(1 - e^{-L₂})) ‖φ₁‖_2 ‖φ₂‖_2`. -/ theorem norm_momentNeg_mul_conj_momentPos_le {φ₁ φ₂ : TestFn} {a₁ b₁ a₂ b₂ : ℝ} (h1 : a₁ ≤ b₁) (h2 : a₂ ≤ b₂) (hsupp₁ : SupportedIn φ₁ a₁ b₁) (hsupp₂ : SupportedIn φ₂ a₂ b₂) : ‖momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)‖ ≤ F_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) * l2Norm φ₁ * l2Norm φ₂ := by have hm2 := norm_momentNeg_le h2 hsupp₂ have hm1 := norm_momentPos_le h1 hsupp₁ have hprod_le : ‖momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)‖ ≤ (Real.sqrt (Real.exp (-a₂) - Real.exp (-b₂)) * Real.sqrt (Real.exp b₁ - Real.exp a₁)) * l2Norm φ₁ * l2Norm φ₂ := by rw [norm_mul, Complex.norm_conj] have hmul := mul_le_mul hm2 hm1 (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (l2Norm_nonneg _)) linarith have hnn2 : 0 ≤ Real.exp (-a₂) - Real.exp (-b₂) := by have : Real.exp (-b₂) ≤ Real.exp (-a₂) := Real.exp_le_exp.mpr (by linarith) linarith have hfac2 : Real.exp (-a₂) - Real.exp (-b₂) = Real.exp (-a₂) * (1 - Real.exp (-(b₂ - a₂))) := by rw [mul_sub, mul_one, ← Real.exp_add]; congr 2; ring have hfac1 : Real.exp b₁ - Real.exp a₁ = Real.exp b₁ * (1 - Real.exp (-(b₁ - a₁))) := by rw [mul_sub, mul_one, ← Real.exp_add]; congr 2; ring have hsqrt_eq : Real.sqrt (Real.exp (-a₂) - Real.exp (-b₂)) * Real.sqrt (Real.exp b₁ - Real.exp a₁) = F_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) := by rw [← Real.sqrt_mul hnn2, hfac2, hfac1] have hcomb : (Real.exp (-a₂) * (1 - Real.exp (-(b₂ - a₂)))) * (Real.exp b₁ * (1 - Real.exp (-(b₁ - a₁)))) = Real.exp (-((a₂ - b₁) / 2)) ^ 2 * ((1 - Real.exp (-(b₁ - a₁))) * (1 - Real.exp (-(b₂ - a₂)))) := by have hexp : Real.exp (-a₂) * Real.exp b₁ = Real.exp (-((a₂ - b₁) / 2)) ^ 2 := by rw [sq, ← Real.exp_add, ← Real.exp_add]; congr 1; ring calc (Real.exp (-a₂) * (1 - Real.exp (-(b₂ - a₂)))) * (Real.exp b₁ * (1 - Real.exp (-(b₁ - a₁)))) = (Real.exp (-a₂) * Real.exp b₁) * ((1 - Real.exp (-(b₁ - a₁))) * (1 - Real.exp (-(b₂ - a₂)))) := by ring _ = Real.exp (-((a₂ - b₁) / 2)) ^ 2 * ((1 - Real.exp (-(b₁ - a₁))) * (1 - Real.exp (-(b₂ - a₂)))) := by rw [hexp] rw [hcomb, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq (le_of_lt (Real.exp_pos _))] rfl rwa [hsqrt_eq] at hprod_le /-- Simplified separated-window Cauchy–Schwarz bound on the Fubini moment product: `‖momentNeg φ₂ * conj(momentPos φ₁)‖ ≤ e^{-d/2} √(L₁ L₂) ‖φ₁‖_2 ‖φ₂‖_2`. -/ theorem norm_momentNeg_mul_conj_momentPos_le_simple {φ₁ φ₂ : TestFn} {a₁ b₁ a₂ b₂ : ℝ} (h1 : a₁ ≤ b₁) (h2 : a₂ ≤ b₂) (hsupp₁ : SupportedIn φ₁ a₁ b₁) (hsupp₂ : SupportedIn φ₂ a₂ b₂) : ‖momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)‖ ≤ Real.exp (-((a₂ - b₁) / 2)) * Real.sqrt ((b₁ - a₁) * (b₂ - a₂)) * l2Norm φ₁ * l2Norm φ₂ := by have hsharp := norm_momentNeg_mul_conj_momentPos_le h1 h2 hsupp₁ hsupp₂ have hle : F_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) ≤ F_unbal_simple (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) := F_unbal_le_simple (sub_nonneg.mpr h1) (sub_nonneg.mpr h2) have hmul : F_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) * l2Norm φ₁ * l2Norm φ₂ ≤ F_unbal_simple (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) * l2Norm φ₁ * l2Norm φ₂ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hle (l2Norm_nonneg φ₁)) (l2Norm_nonneg φ₂) exact le_trans hsharp hmul /-! ### 2. Unbalanced Lemma 2: Inter-Window Bound Without Local Balance -/ /-- Total pairwise interaction bound without local-balance hypotheses: `E_unbal L₁ L₂ d D = E_bound L₁ L₂ d D + F_unbal L₁ L₂ d`. -/ noncomputable def E_unbal (L₁ L₂ d D : ℝ) : ℝ := E_bound L₁ L₂ d D + F_unbal L₁ L₂ d lemma E_unbal_nonneg {L₁ L₂ d D : ℝ} (hd : 0 < d) : 0 ≤ E_unbal L₁ L₂ d D := add_nonneg (E_bound_nonneg hd) (F_unbal_nonneg L₁ L₂ d) /-- Exact inter-window interaction decomposition separating the uncancelled Fubini moment product, the residual archimedean integral, and the finite prime-power sum. -/ theorem exact_interwindow_interaction_split {φ₁ φ₂ : TestFn} {a₁ b₁ a₂ b₂ : ℝ} (h1 : a₁ ≤ b₁) (hgap : b₁ < a₂) (h2 : a₂ ≤ b₂) (hsupp₁ : SupportedIn φ₁ a₁ b₁) (hsupp₂ : SupportedIn φ₂ a₂ b₂) : B_form φ₂ φ₁ = -(momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)) - (1 / 2 : ℂ) * (∫ t in (a₂ - b₁)..(b₂ - a₁), (residualWeight t : ℂ) * corr φ₂ φ₁ t) - ∑ n ∈ primePowerRange (a₂ - b₁) (b₂ - a₁), ((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ)) := by set d := a₂ - b₁ set D := b₂ - a₁ have hd_pos : 0 < d := by linarith have hdD : d ≤ D := by linarith rw [exact_interwindow_interaction h1 hgap h2 hsupp₁ hsupp₂] have hfub : ∫ t in d..D, ((Real.exp (-(t / 2)) : ℝ) : ℂ) * corr φ₂ φ₁ t = momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁) := by have hsupp_corr : ∀ t, t ∉ Icc d D → ((Real.exp (-(t / 2)) : ℝ) : ℂ) * corr φ₂ φ₁ t = 0 := by intro t ht have hc0 : corr φ₂ φ₁ t = 0 := by by_cases hlt : t ≤ d · exact corr_eq_zero_of_le hsupp₂ hsupp₁ hlt · push Not at hlt have hgt : D ≤ t := by by_contra hlt2; push Not at hlt2; exact ht ⟨le_of_lt hlt, le_of_lt hlt2⟩ exact corr_eq_zero_of_ge hsupp₂ hsupp₁ hgt simp [hc0] rw [← integral_eq_intervalIntegral_of_vanishes_outside_Icc hdD hsupp_corr, fubini_exp_corr_eq_moments] have hint_split : ∫ t in d..D, (weilWeight t : ℂ) * corr φ₂ φ₁ t = (2 : ℂ) * (momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)) + ∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t := by have hcongr : ∫ t in d..D, (weilWeight t : ℂ) * corr φ₂ φ₁ t = ∫ t in d..D, ((2 : ℂ) * (((Real.exp (-(t / 2)) : ℝ) : ℂ) * corr φ₂ φ₁ t) + (residualWeight t : ℂ) * corr φ₂ φ₁ t) := by refine intervalIntegral.integral_congr (fun t ht => ?_) rw [uIcc_of_le hdD] at ht have htpos : 0 < t := lt_of_lt_of_le hd_pos ht.1 rw [weilWeight_split htpos] push_cast; ring have hint1 : IntervalIntegrable (fun t => (2 : ℂ) * (((Real.exp (-(t / 2)) : ℝ) : ℂ) * corr φ₂ φ₁ t)) volume d D := (continuous_const.mul ((Complex.continuous_ofReal.comp (Real.continuous_exp.comp (continuous_id.div_const 2).neg)).mul (continuous_corr φ₂ φ₁))).intervalIntegrable d D have hint2 : IntervalIntegrable (fun t => (residualWeight t : ℂ) * corr φ₂ φ₁ t) volume d D := by refine ContinuousOn.intervalIntegrable ?_ rw [uIcc_of_le hdD] exact (Complex.continuous_ofReal.comp_continuousOn (continuousOn_residualWeight.mono (fun t ht => lt_of_lt_of_le hd_pos ht.1))).mul (continuous_corr φ₂ φ₁).continuousOn rw [hcongr, intervalIntegral.integral_add hint1 hint2, intervalIntegral.integral_const_mul, hfub] rw [hint_split] ring /-- **Unbalanced Lemma 2**: For ANY two smooth functions `φ₁, φ₂` supported in strictly separated intervals `[a₁, b₁]` and `[a₂, b₂]` (`b₁ < a₂`) — with NO local-balance assumption on either `φ₁` or `φ₂` — `‖B_form φ₂ φ₁‖ ≤ E_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) * l2Norm φ₁ * l2Norm φ₂`. -/ theorem lemma2_interwindow_bound_unbalanced {φ₁ φ₂ : TestFn} {a₁ b₁ a₂ b₂ : ℝ} (h1 : a₁ ≤ b₁) (hgap : b₁ < a₂) (h2 : a₂ ≤ b₂) (hsupp₁ : SupportedIn φ₁ a₁ b₁) (hsupp₂ : SupportedIn φ₂ a₂ b₂) : ‖B_form φ₂ φ₁‖ ≤ E_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) * l2Norm φ₁ * l2Norm φ₂ := by set d := a₂ - b₁ set D := b₂ - a₁ have hd_pos : 0 < d := by linarith have hdD : d ≤ D := by linarith rw [exact_interwindow_interaction_split h1 hgap h2 hsupp₁ hsupp₂] have htri : ‖-(momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)) - (1 / 2 : ℂ) * (∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t) - ∑ n ∈ primePowerRange d D, ((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ))‖ ≤ ‖momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)‖ + ‖(1 / 2 : ℂ) * (∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t)‖ + ‖∑ n ∈ primePowerRange d D, ((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ))‖ := by have htri1 := norm_sub_le (-(momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)) - (1 / 2 : ℂ) * (∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t)) (∑ n ∈ primePowerRange d D, ((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ))) have htri2 := norm_sub_le (-(momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁))) ((1 / 2 : ℂ) * (∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t)) rw [norm_neg] at htri2 linarith -- Part A: Fubini moment bound `≤ F_unbal L₁ L₂ d * l2Norm φ₁ * l2Norm φ₂`. have hF : ‖momentNeg φ₂ * starRingEnd ℂ (momentPos φ₁)‖ ≤ F_unbal (b₁ - a₁) (b₂ - a₂) d * l2Norm φ₁ * l2Norm φ₂ := norm_momentNeg_mul_conj_momentPos_le h1 h2 hsupp₁ hsupp₂ -- Part B: Arithmetic bound `≤ P_bound d D * l2Norm φ₁ * l2Norm φ₂`. have hP : ‖∑ n ∈ primePowerRange d D, ((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ))‖ ≤ P_bound d D * l2Norm φ₁ * l2Norm φ₂ := by calc ‖∑ n ∈ primePowerRange d D, ((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ))‖ ≤ ∑ n ∈ primePowerRange d D, ‖((arithWeight n : ℝ) : ℂ) * corr φ₂ φ₁ (Real.log (n : ℝ))‖ := norm_sum_le _ _ _ ≤ ∑ n ∈ primePowerRange d D, arithWeight n * (l2Norm φ₁ * l2Norm φ₂) := by refine Finset.sum_le_sum (fun n _ => ?_) rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (arithWeight_nonneg n), mul_comm (l2Norm φ₁)] exact mul_le_mul_of_nonneg_left (norm_corr_le φ₂ φ₁ (Real.log (n : ℝ))) (arithWeight_nonneg n) _ = P_bound d D * l2Norm φ₁ * l2Norm φ₂ := by unfold P_bound; rw [← Finset.sum_mul, mul_assoc] -- Part C: Residual continuous bound `≤ R_bound L₁ L₂ d * l2Norm φ₁ * l2Norm φ₂`. have hR : ‖(1 / 2 : ℂ) * (∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t)‖ ≤ R_bound (b₁ - a₁) (b₂ - a₂) d * l2Norm φ₁ * l2Norm φ₂ := by rw [norm_mul] have hhalf : ‖(1 / 2 : ℂ)‖ = 1 / 2 := by norm_num rw [hhalf] have hbound1 : ‖∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t‖ ≤ residualWeight d * ∫ t in d..D, ‖corr φ₂ φ₁ t‖ := by have h1' := intervalIntegral.norm_integral_le_integral_norm (μ := volume) (f := fun t => (residualWeight t : ℂ) * corr φ₂ φ₁ t) hdD have hint_lhs : IntervalIntegrable (fun t => ‖(residualWeight t : ℂ) * corr φ₂ φ₁ t‖) volume d D := by refine ContinuousOn.intervalIntegrable ?_ rw [uIcc_of_le hdD] exact ((Complex.continuous_ofReal.comp_continuousOn (continuousOn_residualWeight.mono (fun t ht => lt_of_lt_of_le hd_pos ht.1))).mul (continuous_corr φ₂ φ₁).continuousOn).norm have hint_rhs : IntervalIntegrable (fun t => residualWeight d * ‖corr φ₂ φ₁ t‖) volume d D := (continuous_const.mul (continuous_corr φ₂ φ₁).norm).intervalIntegrable d D have hmono := intervalIntegral.integral_mono_on hdD hint_lhs hint_rhs (fun t ht => ?_) · rw [intervalIntegral.integral_const_mul] at hmono exact le_trans h1' hmono · have htpos : 0 < t := lt_of_lt_of_le hd_pos ht.1 rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (le_of_lt (residualWeight_pos htpos))] have hw_le : residualWeight t ≤ residualWeight d := by rcases eq_or_lt_of_le ht.1 with rfl | hlt · exact le_refl _ · exact le_of_lt (residualWeight_antiOn hd_pos htpos hlt) exact mul_le_mul_of_nonneg_right hw_le (norm_nonneg _) have hcorr_full : ∫ t in d..D, ‖corr φ₂ φ₁ t‖ = ∫ t, ‖corr φ₂ φ₁ t‖ := by symm refine integral_eq_intervalIntegral_of_vanishes_outside_Icc hdD (fun t ht => ?_) have hc0 : corr φ₂ φ₁ t = 0 := by by_cases hlt : t ≤ d · exact corr_eq_zero_of_le hsupp₂ hsupp₁ hlt · push Not at hlt have hgt : D ≤ t := by by_contra hlt2; push Not at hlt2; exact ht ⟨le_of_lt hlt, le_of_lt hlt2⟩ exact corr_eq_zero_of_ge hsupp₂ hsupp₁ hgt simp [hc0] have hl1_1 : l1Norm φ₁ ≤ Real.sqrt (b₁ - a₁) * l2Norm φ₁ := l1Norm_le_sqrt_mul_l2Norm h1 hsupp₁ have hl1_2 : l1Norm φ₂ ≤ Real.sqrt (b₂ - a₂) * l2Norm φ₂ := l1Norm_le_sqrt_mul_l2Norm h2 hsupp₂ have hprod_l1 : l1Norm φ₂ * l1Norm φ₁ ≤ Real.sqrt ((b₁ - a₁) * (b₂ - a₂)) * l2Norm φ₁ * l2Norm φ₂ := by have hmul : l1Norm φ₂ * l1Norm φ₁ ≤ (Real.sqrt (b₂ - a₂) * l2Norm φ₂) * (Real.sqrt (b₁ - a₁) * l2Norm φ₁) := mul_le_mul hl1_2 hl1_1 (MeasureTheory.integral_nonneg fun _ => norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (l2Norm_nonneg _)) have hsqrt : Real.sqrt (b₁ - a₁) * Real.sqrt (b₂ - a₂) = Real.sqrt ((b₁ - a₁) * (b₂ - a₂)) := (Real.sqrt_mul (by linarith : 0 ≤ b₁ - a₁) (b₂ - a₂)).symm calc l1Norm φ₂ * l1Norm φ₁ ≤ (Real.sqrt (b₂ - a₂) * l2Norm φ₂) * (Real.sqrt (b₁ - a₁) * l2Norm φ₁) := hmul _ = (Real.sqrt (b₁ - a₁) * Real.sqrt (b₂ - a₂)) * l2Norm φ₁ * l2Norm φ₂ := by ring _ = Real.sqrt ((b₁ - a₁) * (b₂ - a₂)) * l2Norm φ₁ * l2Norm φ₂ := by rw [hsqrt] have hhalf_w0 : (1 / 2 : ℝ) * residualWeight d = Real.exp (-(5 * d / 2)) / (1 - Real.exp (-(2 * d))) := by unfold residualWeight; ring have hw_nn : 0 ≤ residualWeight d := le_of_lt (residualWeight_pos hd_pos) calc (1 / 2 : ℝ) * ‖∫ t in d..D, (residualWeight t : ℂ) * corr φ₂ φ₁ t‖ ≤ (1 / 2 : ℝ) * (residualWeight d * ∫ t in d..D, ‖corr φ₂ φ₁ t‖) := mul_le_mul_of_nonneg_left hbound1 (by norm_num) _ = ((1 / 2 : ℝ) * residualWeight d) * ∫ t, ‖corr φ₂ φ₁ t‖ := by rw [hcorr_full]; ring _ ≤ ((1 / 2 : ℝ) * residualWeight d) * (l1Norm φ₂ * l1Norm φ₁) := mul_le_mul_of_nonneg_left (integral_norm_corr_le_l1_mul_l1 φ₂ φ₁) (by positivity) _ ≤ ((1 / 2 : ℝ) * residualWeight d) * (Real.sqrt ((b₁ - a₁) * (b₂ - a₂)) * l2Norm φ₁ * l2Norm φ₂) := mul_le_mul_of_nonneg_left hprod_l1 (by positivity) _ = R_bound (b₁ - a₁) (b₂ - a₂) d * l2Norm φ₁ * l2Norm φ₂ := by unfold R_bound; rw [hhalf_w0]; ring unfold E_unbal E_bound linarith /-- Simplified corollary of Unbalanced Lemma 2 using `e^{-d/2} √(L₁ L₂)` in place of `F_unbal`. -/ theorem lemma2_interwindow_bound_unbalanced_simple {φ₁ φ₂ : TestFn} {a₁ b₁ a₂ b₂ : ℝ} (h1 : a₁ ≤ b₁) (hgap : b₁ < a₂) (h2 : a₂ ≤ b₂) (hsupp₁ : SupportedIn φ₁ a₁ b₁) (hsupp₂ : SupportedIn φ₂ a₂ b₂) : ‖B_form φ₂ φ₁‖ ≤ (E_bound (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) + Real.exp (-((a₂ - b₁) / 2)) * Real.sqrt ((b₁ - a₁) * (b₂ - a₂))) * l2Norm φ₁ * l2Norm φ₂ := by have hsharp := lemma2_interwindow_bound_unbalanced h1 hgap h2 hsupp₁ hsupp₂ have hF := F_unbal_le_simple (d := a₂ - b₁) (sub_nonneg.mpr h1) (sub_nonneg.mpr h2) have hE : E_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) ≤ E_bound (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) + Real.exp (-((a₂ - b₁) / 2)) * Real.sqrt ((b₁ - a₁) * (b₂ - a₂)) := by unfold E_unbal unfold F_unbal_simple at hF linarith have hmul : E_unbal (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) * l2Norm φ₁ * l2Norm φ₂ ≤ (E_bound (b₁ - a₁) (b₂ - a₂) (a₂ - b₁) (b₂ - a₁) + Real.exp (-((a₂ - b₁) / 2)) * Real.sqrt ((b₁ - a₁) * (b₂ - a₂))) * l2Norm φ₁ * l2Norm φ₂ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hE (l2Norm_nonneg φ₁)) (l2Norm_nonneg φ₂) exact le_trans hsharp hmul /-! ### 3. Unbalanced Comparison Matrices and General Positivity -/ /-- Symmetric unbalanced off-diagonal interaction bound `E_unbal` for ordered separated windows. -/ noncomputable def offDiagBoundUnbal {r : ℕ} (a b : Fin r → ℝ) (i j : Fin r) : ℝ := if i < j then E_unbal (b i - a i) (b j - a j) (a j - b i) (b j - a i) else if j < i then E_unbal (b j - a j) (b i - a i) (a i - b j) (b i - a j) else 0 lemma offDiagBoundUnbal_symm {r : ℕ} (a b : Fin r → ℝ) (i j : Fin r) : offDiagBoundUnbal a b i j = offDiagBoundUnbal a b j i := by unfold offDiagBoundUnbal rcases lt_trichotomy i j with hlt | rfl | hgt · have hnot : ¬ (j < i) := not_lt_of_gt hlt simp [hlt, hnot] · simp · have hnot : ¬ (i < j) := not_lt_of_gt hgt simp [hgt, hnot] lemma offDiagBoundUnbal_of_lt {r : ℕ} (a b : Fin r → ℝ) {i j : Fin r} (h : i < j) : offDiagBoundUnbal a b i j = E_unbal (b i - a i) (b j - a j) (a j - b i) (b j - a i) := by simp [offDiagBoundUnbal, h] lemma offDiagBoundUnbal_nonneg {r : ℕ} {a b : Fin r → ℝ} (hsep : ∀ i j : Fin r, i < j → b i < a j) (i j : Fin r) : 0 ≤ offDiagBoundUnbal a b i j := by unfold offDiagBoundUnbal split_ifs with h1 h2 · exact E_unbal_nonneg (by linarith [hsep i j h1]) · exact E_unbal_nonneg (by linarith [hsep j i h2]) · exact le_refl 0 /-- Symmetric unbalanced `N = 1` comparison matrix: `M_{ii} = m(L_i)` and `M_{ij} = -E_unbal_{ij}` for `i ≠ j`. -/ noncomputable def compMatrixUnbal {r : ℕ} (a b : Fin r → ℝ) : Matrix (Fin r) (Fin r) ℝ := fun i j => if i = j then m_func (b i - a i) else -offDiagBoundUnbal a b i j lemma compMatrixUnbal_isSymm {r : ℕ} (a b : Fin r → ℝ) : (compMatrixUnbal a b).IsSymm := by ext i j simp only [Matrix.transpose_apply, compMatrixUnbal] by_cases h : i = j · subst h; simp · have h' : j ≠ i := Ne.symm h simp [h, h', offDiagBoundUnbal_symm] lemma quadForm_compMatrixUnbal {r : ℕ} (a b : Fin r → ℝ) (v : Fin r → ℝ) : quadForm (compMatrixUnbal a b) v = (∑ i : Fin r, m_func (b i - a i) * v i ^ 2) - 2 * ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j := by unfold quadForm have hrow : ∀ i : Fin r, ∑ j : Fin r, v i * compMatrixUnbal a b i j * v j = m_func (b i - a i) * v i ^ 2 - (∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j) - (∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * v i * v j) := by intro i have hunion : (Finset.univ : Finset (Fin r)) = ({i} ∪ Finset.univ.filter (fun j => i < j)) ∪ Finset.univ.filter (fun j => j < i) := by ext j simp only [Finset.mem_univ, Finset.mem_union, Finset.mem_singleton, Finset.mem_filter, true_and, true_iff] rcases lt_trichotomy i j with hlt | rfl | hgt · exact Or.inl (Or.inr hlt) · exact Or.inl (Or.inl rfl) · exact Or.inr hgt have hd1 : Disjoint ({i} : Finset (Fin r)) (Finset.univ.filter (fun j => i < j)) := by rw [Finset.disjoint_singleton_left]; simp have hd2 : Disjoint ({i} ∪ Finset.univ.filter (fun j => i < j)) (Finset.univ.filter (fun j => j < i)) := by rw [Finset.disjoint_left] intro j hj1 hj2 simp only [Finset.mem_union, Finset.mem_singleton, Finset.mem_filter, Finset.mem_univ, true_and] at hj1 hj2 rcases hj1 with rfl | hgt · exact lt_irrefl _ hj2 · exact lt_asymm hgt hj2 conv_lhs => rw [hunion] rw [Finset.sum_union hd2, Finset.sum_union hd1, Finset.sum_singleton] have hdiag : v i * compMatrixUnbal a b i i * v i = m_func (b i - a i) * v i ^ 2 := by simp [compMatrixUnbal]; ring have hgt_sum : ∑ j ∈ Finset.univ.filter (fun j => i < j), v i * compMatrixUnbal a b i j * v j = -∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j := by rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl (fun j hj => ?_) have hne : i ≠ j := ne_of_lt (Finset.mem_filter.mp hj).2 simp only [compMatrixUnbal, hne, ↓reduceIte]; ring have hlt_sum : ∑ j ∈ Finset.univ.filter (fun j => j < i), v i * compMatrixUnbal a b i j * v j = -∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * v i * v j := by rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl (fun j hj => ?_) have hne : i ≠ j := ne_of_gt (Finset.mem_filter.mp hj).2 simp only [compMatrixUnbal, hne, ↓reduceIte]; ring rw [hdiag, hgt_sum, hlt_sum] ring simp_rw [hrow, Finset.sum_sub_distrib] have hswap : ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * v i * v j = ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j := by simp_rw [Finset.sum_filter] rw [Finset.sum_comm] refine Finset.sum_congr rfl (fun i _ => Finset.sum_congr rfl (fun j _ => ?_)) split_ifs with h · rw [offDiagBoundUnbal_symm]; ring · rfl rw [hswap] ring /-- Symmetric unbalanced finite-chain comparison matrix with diagonal `m_chain N (L_i)` and off-diagonal `-offDiagBoundUnbal a b i j`. -/ noncomputable def compMatrixChainUnbal {r : ℕ} (N : ℕ) (a b : Fin r → ℝ) : Matrix (Fin r) (Fin r) ℝ := Matrix.of fun i j => if i = j then m_chain N (b i - a i) else -offDiagBoundUnbal a b i j lemma compMatrixChainUnbal_symm {r : ℕ} (N : ℕ) (a b : Fin r → ℝ) : (compMatrixChainUnbal N a b).transpose = compMatrixChainUnbal N a b := by ext i j simp only [Matrix.transpose_apply, compMatrixChainUnbal, Matrix.of_apply] by_cases h : j = i · subst h; simp · have h' : i ≠ j := Ne.symm h simp [h, h', offDiagBoundUnbal_symm] lemma quadForm_compMatrixChainUnbal {r : ℕ} (N : ℕ) (a b : Fin r → ℝ) (v : Fin r → ℝ) : quadForm (compMatrixChainUnbal N a b) v = (∑ i : Fin r, m_chain N (b i - a i) * v i ^ 2) - 2 * ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j := by unfold quadForm have hsplit : ∀ i : Fin r, ∑ j : Fin r, v i * compMatrixChainUnbal N a b i j * v j = m_chain N (b i - a i) * v i ^ 2 - (∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j) - (∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * v i * v j) := by intro i have hunion : (Finset.univ : Finset (Fin r)) = ({i} ∪ Finset.univ.filter (fun j => i < j)) ∪ Finset.univ.filter (fun j => j < i) := by ext j simp only [Finset.mem_univ, Finset.mem_union, Finset.mem_singleton, Finset.mem_filter, true_and, true_iff] rcases lt_trichotomy i j with hlt | rfl | hgt · exact Or.inl (Or.inr hlt) · exact Or.inl (Or.inl rfl) · exact Or.inr hgt have hd1 : Disjoint ({i} : Finset (Fin r)) (Finset.univ.filter (fun j => i < j)) := by rw [Finset.disjoint_singleton_left]; simp have hd2 : Disjoint ({i} ∪ Finset.univ.filter (fun j => i < j)) (Finset.univ.filter (fun j => j < i)) := by rw [Finset.disjoint_left] intro j hj1 hj2 simp only [Finset.mem_union, Finset.mem_singleton, Finset.mem_filter, Finset.mem_univ, true_and] at hj1 hj2 rcases hj1 with rfl | hgt · exact lt_irrefl _ hj2 · exact lt_asymm hgt hj2 conv_lhs => rw [hunion] rw [Finset.sum_union hd2, Finset.sum_union hd1, Finset.sum_singleton] have hdiag : v i * compMatrixChainUnbal N a b i i * v i = m_chain N (b i - a i) * v i ^ 2 := by simp [compMatrixChainUnbal]; ring have hgt : ∑ j ∈ Finset.univ.filter (fun j => i < j), v i * compMatrixChainUnbal N a b i j * v j = -(∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j) := by rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl (fun j hj => ?_) have hne : i ≠ j := ne_of_lt (Finset.mem_filter.mp hj).2 simp only [compMatrixChainUnbal, Matrix.of_apply, hne, ↓reduceIte]; ring have hlt : ∑ j ∈ Finset.univ.filter (fun j => j < i), v i * compMatrixChainUnbal N a b i j * v j = -(∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * v i * v j) := by rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl (fun j hj => ?_) have hne : i ≠ j := ne_of_gt (Finset.mem_filter.mp hj).2 simp only [compMatrixChainUnbal, Matrix.of_apply, hne, ↓reduceIte]; ring rw [hdiag, hgt, hlt] ring simp_rw [hsplit, Finset.sum_sub_distrib] have hswap : ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * v i * v j = ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * v i * v j := by simp_rw [Finset.sum_filter] rw [Finset.sum_comm] refine Finset.sum_congr rfl (fun i _ => Finset.sum_congr rfl (fun j _ => ?_)) split_ifs with h · rw [offDiagBoundUnbal_symm]; ring · rfl rw [hswap] ring /-- Unbalanced Gershgorin row margin `m(L_i) - ∑_{j ≠ i} E_unbal_{ij}`. -/ noncomputable def rowMarginUnbal {r : ℕ} (a b : Fin r → ℝ) (i : Fin r) : ℝ := m_func (b i - a i) - ∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j /-- Gershgorin / row-dominance criterion for the unbalanced comparison matrix. -/ theorem row_dominance_implies_matrix_lower_bound_unbal {r : ℕ} {a b : Fin r → ℝ} {ε : ℝ} (hsep : ∀ i j : Fin r, i < j → b i < a j) (hrow : ∀ i : Fin r, ε ≤ rowMarginUnbal a b i) (z : Fin r → ℝ) : ε * ∑ i : Fin r, z i ^ 2 ≤ quadForm (compMatrixUnbal a b) z := by rw [quadForm_compMatrixUnbal] have hpair : 2 * ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * z i * z j ≤ ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * (z i ^ 2 + z j ^ 2) := by rw [Finset.mul_sum] refine Finset.sum_le_sum (fun i _ => ?_) rw [Finset.mul_sum] refine Finset.sum_le_sum (fun j _ => ?_) have hE : 0 ≤ offDiagBoundUnbal a b i j := offDiagBoundUnbal_nonneg hsep i j have hsq : 0 ≤ (z i - z j) ^ 2 := sq_nonneg _ nlinarith have hsum_split : ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * (z i ^ 2 + z j ^ 2) = ∑ i : Fin r, (∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j) * z i ^ 2 := by have hexpand : ∀ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * (z i ^ 2 + z j ^ 2) = (∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * z i ^ 2) + (∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * z j ^ 2) := by intro i; rw [← Finset.sum_add_distrib]; refine Finset.sum_congr rfl (fun j _ => by ring) simp_rw [hexpand, Finset.sum_add_distrib] have hswap : ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * z j ^ 2 = ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => j < i), offDiagBoundUnbal a b i j * z i ^ 2 := by simp_rw [Finset.sum_filter] rw [Finset.sum_comm] refine Finset.sum_congr rfl (fun i _ => Finset.sum_congr rfl (fun j _ => ?_)) split_ifs · rw [offDiagBoundUnbal_symm] · rfl rw [hswap, ← Finset.sum_add_distrib] refine Finset.sum_congr rfl (fun i _ => ?_) rw [← Finset.sum_mul, ← Finset.sum_mul, ← add_mul] congr 1 have hunion : Finset.univ.filter (fun j : Fin r => j ≠ i) = Finset.univ.filter (fun j => i < j) ∪ Finset.univ.filter (fun j => j < i) := by ext j simp only [Finset.mem_filter, Finset.mem_univ, Finset.mem_union, true_and] exact ne_iff_lt_or_gt.trans or_comm have hdisj : Disjoint (Finset.univ.filter (fun j : Fin r => i < j)) (Finset.univ.filter (fun j : Fin r => j < i)) := by rw [Finset.disjoint_left] intro j h1 h2 exact lt_asymm (Finset.mem_filter.mp h1).2 (Finset.mem_filter.mp h2).2 rw [hunion, Finset.sum_union hdisj] have hmargin : ε * ∑ i : Fin r, z i ^ 2 ≤ (∑ i : Fin r, m_func (b i - a i) * z i ^ 2) - ∑ i : Fin r, (∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j) * z i ^ 2 := by rw [Finset.mul_sum, ← Finset.sum_sub_distrib] refine Finset.sum_le_sum (fun i _ => ?_) have hri := hrow i unfold rowMarginUnbal at hri have hsub : m_func (b i - a i) * z i ^ 2 - (∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j) * z i ^ 2 = (m_func (b i - a i) - ∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j) * z i ^ 2 := by ring rw [hsub] exact mul_le_mul_of_nonneg_right hri (sq_nonneg _) linarith /-- **Unbalanced Comparison Theorem (`N = 1`)**: For `r` ordered strictly separated windows `[a_i, b_i]` of lengths `0 < L_i ≤ log 2` and ANY smooth functions `φ_i` supported in `[a_i, b_i]` — with NO local-balance hypothesis — `vᵀ (compMatrixUnbal a b) v ≤ Q_form (∑ i, c_i • φ_i)` where `v_i = ‖c_i‖ * l2Norm (φ_i)`. -/ theorem theorem1_unbalanced_comparison {r : ℕ} {a b : Fin r → ℝ} {φ : Fin r → TestFn} (hL_pos : ∀ i, 0 < b i - a i) (hL_le : ∀ i, b i - a i ≤ Real.log 2) (hsep : ∀ i j : Fin r, i < j → b i < a j) (hsupp : ∀ i, SupportedIn (φ i) (a i) (b i)) (c : Fin r → ℂ) : quadForm (compMatrixUnbal a b) (fun i => ‖c i‖ * l2Norm (φ i)) ≤ Q_form (∑ i : Fin r, c i • φ i) := by rw [quadForm_compMatrixUnbal, Q_form_sum_expansion] have hdiag : ∑ i : Fin r, m_func (b i - a i) * (‖c i‖ * l2Norm (φ i)) ^ 2 ≤ ∑ i : Fin r, ‖c i‖ ^ 2 * Q_form (φ i) := by refine Finset.sum_le_sum (fun i _ => ?_) have h1 := lemma1_single_interval_lower_bound (hL_pos i) (hL_le i) (hsupp i) have hsq : m_func (b i - a i) * (‖c i‖ * l2Norm (φ i)) ^ 2 = ‖c i‖ ^ 2 * (m_func (b i - a i) * normSq (φ i)) := by rw [mul_pow, sq_l2Norm]; ring rw [hsq] exact mul_le_mul_of_nonneg_left h1 (sq_nonneg _) have hoff : -(∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * (‖c i‖ * l2Norm (φ i)) * (‖c j‖ * l2Norm (φ j))) ≤ ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), (c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)).re := by rw [← Finset.sum_neg_distrib] refine Finset.sum_le_sum (fun i _ => ?_) rw [← Finset.sum_neg_distrib] refine Finset.sum_le_sum (fun j hj => ?_) have hij : i < j := (Finset.mem_filter.mp hj).2 have h2 := lemma2_interwindow_bound_unbalanced (sub_nonneg.mp (le_of_lt (hL_pos i))) (hsep i j hij) (sub_nonneg.mp (le_of_lt (hL_pos j))) (hsupp i) (hsupp j) have hre_ge : -‖c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)‖ ≤ (c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)).re := by have := Complex.abs_re_le_norm (c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)) linarith [(abs_le.mp this).1] have hnorm_eq : ‖c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)‖ = ‖c i‖ * ‖c j‖ * ‖B_form (φ j) (φ i)‖ := by rw [norm_mul, norm_mul, Complex.norm_conj]; ring rw [hnorm_eq] at hre_ge rw [offDiagBoundUnbal_of_lt a b hij] have hmul : ‖c i‖ * ‖c j‖ * ‖B_form (φ j) (φ i)‖ ≤ E_unbal (b i - a i) (b j - a j) (a j - b i) (b j - a i) * (‖c i‖ * l2Norm (φ i)) * (‖c j‖ * l2Norm (φ j)) := by have := mul_le_mul_of_nonneg_left h2 (mul_nonneg (norm_nonneg (c i)) (norm_nonneg (c j))) linarith linarith linarith /-- **Unbalanced Uniform Positivity (`N = 1`)**: If `compMatrixUnbal a b` dominates `ε • I` on nonnegative vectors `v ≥ 0`, then `ε * normSq (∑ i, c_i • φ_i) ≤ Q_form (∑ i, c_i • φ_i)` with NO local-balance hypothesis on any `φ_i`. -/ theorem theorem1_unbalanced_uniform_positivity {r : ℕ} {a b : Fin r → ℝ} {φ : Fin r → TestFn} {ε : ℝ} (hL_pos : ∀ i, 0 < b i - a i) (hL_le : ∀ i, b i - a i ≤ Real.log 2) (hsep : ∀ i j : Fin r, i < j → b i < a j) (hsupp : ∀ i, SupportedIn (φ i) (a i) (b i)) (hM : ∀ v : Fin r → ℝ, (∀ i, 0 ≤ v i) → ε * ∑ i : Fin r, v i ^ 2 ≤ quadForm (compMatrixUnbal a b) v) (c : Fin r → ℂ) : ε * normSq (∑ i : Fin r, c i • φ i) ≤ Q_form (∑ i : Fin r, c i • φ i) := by have h1 := theorem1_unbalanced_comparison hL_pos hL_le hsep hsupp c have hv_nn : ∀ i : Fin r, 0 ≤ ‖c i‖ * l2Norm (φ i) := fun i => mul_nonneg (norm_nonneg _) (l2Norm_nonneg _) have h2 := hM (fun i => ‖c i‖ * l2Norm (φ i)) hv_nn have hnorm : ∑ i : Fin r, (‖c i‖ * l2Norm (φ i)) ^ 2 = normSq (∑ i : Fin r, c i • φ i) := by rw [normSq_sum_disjoint hsep hsupp c] refine Finset.sum_congr rfl (fun i _ => ?_) rw [mul_pow, sq_l2Norm] rw [hnorm] at h2 exact le_trans h2 h1 /-- **Unbalanced Finite-Chain Comparison Theorem**: For any `N ≥ 1` and ordered disjoint windows `[a_i, b_i]` of lengths `0 < L_i ≤ log 2`, EVERY family `φ_i` supported in `[a_i, b_i]` — with NO local-balance hypothesis — satisfies `vᵀ (compMatrixChainUnbal N a b) v ≤ Q_form (∑ i, c_i • φ_i)`. -/ theorem theorem1_chain_unbalanced_comparison {r : ℕ} (N : ℕ) (hN : 1 ≤ N) {a b : Fin r → ℝ} {φ : Fin r → TestFn} (hL_pos : ∀ i, 0 < b i - a i) (hL_le : ∀ i, b i - a i ≤ Real.log 2) (hsep : ∀ i j : Fin r, i < j → b i < a j) (hsupp : ∀ i, SupportedIn (φ i) (a i) (b i)) (c : Fin r → ℂ) : quadForm (compMatrixChainUnbal N a b) (fun i => ‖c i‖ * l2Norm (φ i)) ≤ Q_form (∑ i : Fin r, c i • φ i) := by rw [Q_form_sum_expansion, quadForm_compMatrixChainUnbal] have hdiag : ∑ i : Fin r, m_chain N (b i - a i) * (‖c i‖ * l2Norm (φ i)) ^ 2 ≤ ∑ i : Fin r, ‖c i‖ ^ 2 * Q_form (φ i) := by refine Finset.sum_le_sum (fun i _ => ?_) have h1 := lemma1_finite_chain_lower_bound N hN (hL_pos i) (hL_le i) (hsupp i) calc m_chain N (b i - a i) * (‖c i‖ * l2Norm (φ i)) ^ 2 = ‖c i‖ ^ 2 * (m_chain N (b i - a i) * normSq (φ i)) := by rw [mul_pow, sq_l2Norm]; ring _ ≤ ‖c i‖ ^ 2 * Q_form (φ i) := mul_le_mul_of_nonneg_left h1 (sq_nonneg _) have hoff : -(∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), offDiagBoundUnbal a b i j * (‖c i‖ * l2Norm (φ i)) * (‖c j‖ * l2Norm (φ j))) ≤ ∑ i : Fin r, ∑ j ∈ Finset.univ.filter (fun j => i < j), (c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)).re := by rw [← Finset.sum_neg_distrib] refine Finset.sum_le_sum (fun i _ => ?_) rw [← Finset.sum_neg_distrib] refine Finset.sum_le_sum (fun j hj => ?_) have hij : i < j := (Finset.mem_filter.mp hj).2 have h2 := lemma2_interwindow_bound_unbalanced (le_of_lt (sub_pos.mp (hL_pos i))) (hsep i j hij) (le_of_lt (sub_pos.mp (hL_pos j))) (hsupp i) (hsupp j) rw [offDiagBoundUnbal_of_lt a b hij] have hre : -(‖c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)‖) ≤ (c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)).re := by have habs : |(c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)).re| ≤ ‖c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)‖ := Complex.abs_re_le_norm _ linarith [(abs_le.mp habs).1] have hnorm : ‖c j * starRingEnd ℂ (c i) * B_form (φ j) (φ i)‖ ≤ E_unbal (b i - a i) (b j - a j) (a j - b i) (b j - a i) * (‖c i‖ * l2Norm (φ i)) * (‖c j‖ * l2Norm (φ j)) := by rw [norm_mul, norm_mul, Complex.norm_conj] calc ‖c j‖ * ‖c i‖ * ‖B_form (φ j) (φ i)‖ ≤ ‖c j‖ * ‖c i‖ * (E_unbal (b i - a i) (b j - a j) (a j - b i) (b j - a i) * l2Norm (φ i) * l2Norm (φ j)) := mul_le_mul_of_nonneg_left h2 (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ = E_unbal (b i - a i) (b j - a j) (a j - b i) (b j - a i) * (‖c i‖ * l2Norm (φ i)) * (‖c j‖ * l2Norm (φ j)) := by ring linarith linarith /-- **Unbalanced Finite-Chain Uniform Positivity Theorem**: If `compMatrixChainUnbal N a b` dominates `ε • I` on nonnegative vectors `v ≥ 0`, then `ε * normSq (∑ i, c_i • φ_i) ≤ Q_form (∑ i, c_i • φ_i)` with NO local-balance hypothesis. -/ theorem theorem1_chain_unbalanced_uniform_positivity {r : ℕ} (N : ℕ) (hN : 1 ≤ N) {a b : Fin r → ℝ} {φ : Fin r → TestFn} {ε : ℝ} (hL_pos : ∀ i, 0 < b i - a i) (hL_le : ∀ i, b i - a i ≤ Real.log 2) (hsep : ∀ i j : Fin r, i < j → b i < a j) (hsupp : ∀ i, SupportedIn (φ i) (a i) (b i)) (hM : ∀ v : Fin r → ℝ, (∀ i, 0 ≤ v i) → ε * (∑ i : Fin r, v i ^ 2) ≤ quadForm (compMatrixChainUnbal N a b) v) (c : Fin r → ℂ) : ε * normSq (∑ i : Fin r, c i • φ i) ≤ Q_form (∑ i : Fin r, c i • φ i) := by have hcomp := theorem1_chain_unbalanced_comparison N hN hL_pos hL_le hsep hsupp c have hv_nn : ∀ i : Fin r, 0 ≤ ‖c i‖ * l2Norm (φ i) := fun i => mul_nonneg (norm_nonneg _) (l2Norm_nonneg _) have hmat := hM (fun i => ‖c i‖ * l2Norm (φ i)) hv_nn have hnorm : normSq (∑ i : Fin r, c i • φ i) = ∑ i : Fin r, (‖c i‖ * l2Norm (φ i)) ^ 2 := by rw [normSq_sum_disjoint hsep hsupp c] refine Finset.sum_congr rfl (fun i _ => ?_) rw [mul_pow, sq_l2Norm] rw [hnorm] linarith /-! ### 4. Global-Balance Theorem 2: Recovering All `2r - 2` Missing Directions -/ /-- Unbalanced continuous gap constant `C_δ^{unbal} = C_δ + e^{-δ/4}`. -/ noncomputable def C_delta_unbal (δ : ℝ) : ℝ := C_delta δ + Real.exp (-(δ / 4)) lemma C_delta_unbal_pos {δ : ℝ} (hδ : 0 < δ) : 0 < C_delta_unbal δ := add_pos (C_delta_pos hδ) (Real.exp_pos _) /-- Uniform upper bound `E_unbal_{ij} ≤ P_D + C_δ + e^{-δ/4}` for common-width separated windows `I_i = [c_i - L/2, c_i + L/2]` when `0 < L ≤ min(δ/2, 1)`. -/ lemma offDiagBoundUnbal_le_fixed_center_bound {r : ℕ} {centers : Fin r → ℝ} {δ D L : ℝ} (hδ_pos : 0 < δ) (hgap : ∀ i j : Fin r, i < j → δ ≤ centers j - centers i) (hspan : ∀ i j : Fin r, i < j → centers j - centers i ≤ D) (hL_pos : 0 < L) (hL_δ : L ≤ δ / 2) (hL_1 : L ≤ 1) {i j : Fin r} (hne : i ≠ j) : offDiagBoundUnbal (fun k => centers k - L / 2) (fun k => centers k + L / 2) i j ≤ P_D_bound D + C_delta_unbal δ := by suffices hlt_case : ∀ p q : Fin r, p < q → offDiagBoundUnbal (fun k => centers k - L / 2) (fun k => centers k + L / 2) p q ≤ P_D_bound D + C_delta_unbal δ by rcases lt_or_gt_of_ne hne with hlt | hgt · exact hlt_case i j hlt · rw [offDiagBoundUnbal_symm]; exact hlt_case j i hgt intro p q hpq have hE := offDiagBound_le_fixed_center_bound hδ_pos hgap hspan hL_pos hL_δ hL_1 (ne_of_lt hpq) rw [offDiagBound_of_lt _ _ hpq] at hE rw [offDiagBoundUnbal_of_lt _ _ hpq] unfold E_unbal C_delta_unbal have hlen_p : (centers p + L / 2) - (centers p - L / 2) = L := by ring have hlen_q : (centers q + L / 2) - (centers q - L / 2) = L := by ring have hd_eq : (centers q - L / 2) - (centers p + L / 2) = centers q - centers p - L := by ring have hd_ge : δ / 2 ≤ centers q - centers p - L := by linarith [hgap p q hpq] have hF : F_unbal ((centers p + L / 2) - (centers p - L / 2)) ((centers q + L / 2) - (centers q - L / 2)) ((centers q - L / 2) - (centers p + L / 2)) ≤ Real.exp (-(δ / 4)) := by rw [hlen_p, hlen_q, hd_eq] calc F_unbal L L (centers q - centers p - L) ≤ F_unbal_simple L L (centers q - centers p - L) := F_unbal_le_simple (le_of_lt hL_pos) (le_of_lt hL_pos) _ = Real.exp (-((centers q - centers p - L) / 2)) * L := by unfold F_unbal_simple; rw [Real.sqrt_mul_self (le_of_lt hL_pos)] _ ≤ Real.exp (-(δ / 4)) * 1 := mul_le_mul (Real.exp_le_exp.mpr (by linarith)) hL_1 (le_of_lt hL_pos) (le_of_lt (Real.exp_pos _)) _ = Real.exp (-(δ / 4)) := mul_one _ linarith /-- Explicit sufficient common width for unconditional / global-balance positivity: `L_suff^{unbal}(r, δ, D, η) = min { δ/2, (log 2)/2, 1, 4 exp(-A - (r - 1)(P_D + C_δ + e^{-δ/4}) - η) }`. -/ noncomputable def explicitWidthBoundUnbal (r : ℕ) (δ D η : ℝ) : ℝ := min (δ / 2) (min (Real.log 2 / 2) (min 1 (4 * Real.exp (-weilConstA - ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) - η)))) lemma explicitWidthBoundUnbal_pos (r : ℕ) {δ : ℝ} (hδ : 0 < δ) (D η : ℝ) : 0 < explicitWidthBoundUnbal r δ D η := by unfold explicitWidthBoundUnbal have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) exact lt_min (by positivity) (lt_min (by positivity) (lt_min zero_lt_one (by positivity))) /-- **Unbalanced / Global-Balance Theorem 2 (explicit width formula)**: For `r ≥ 1` distinct ordered centers `c_0 < ... < c_{r-1}` with minimum gap `δ > 0` and total span `≤ D`, and any desired margin `η > 0`, EVERY common width `L` with `0 < L ≤ explicitWidthBoundUnbal r δ D η` certifies: 1. Unbalanced row dominance `rowMarginUnbal a b i ≥ η` for every `i`, 2. Uniform positivity `η * normSq (∑ i, φ i) ≤ Q_form (∑ i, φ i)` for ALL smooth `φ_i` supported in `[c_i - L/2, c_i + L/2]` (NO local-balance hypothesis), 3. Strict positivity `0 < Q_form (∑ i, φ i)` whenever `∑ i, φ i ≠ 0`. -/ theorem theorem2_fixed_centers_unbalanced_explicit {r : ℕ} (hr : 1 ≤ r) {centers : Fin r → ℝ} {δ D η L : ℝ} (hδ_pos : 0 < δ) (hη_pos : 0 < η) (hgap : ∀ i j : Fin r, i < j → δ ≤ centers j - centers i) (hspan : ∀ i j : Fin r, i < j → centers j - centers i ≤ D) (hL_pos : 0 < L) (hL_le : L ≤ explicitWidthBoundUnbal r δ D η) : (∀ i : Fin r, η ≤ rowMarginUnbal (fun k => centers k - L / 2) (fun k => centers k + L / 2) i) ∧ (∀ φ : Fin r → TestFn, (∀ i, SupportedIn (φ i) (centers i - L / 2) (centers i + L / 2)) → η * normSq (∑ i : Fin r, φ i) ≤ Q_form (∑ i : Fin r, φ i) ∧ (∑ i : Fin r, φ i ≠ 0 → 0 < Q_form (∑ i : Fin r, φ i))) := by set a := fun k : Fin r => centers k - L / 2 set b := fun k : Fin r => centers k + L / 2 have hL_δ : L ≤ δ / 2 := le_trans hL_le (min_le_left _ _) have hL_log2_half : L ≤ Real.log 2 / 2 := le_trans hL_le (le_trans (min_le_right _ _) (min_le_left _ _)) have hL_1 : L ≤ 1 := le_trans hL_le (le_trans (min_le_right _ _) (le_trans (min_le_right _ _) (min_le_left _ _))) have hL_exp : L ≤ 4 * Real.exp (-weilConstA - ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) - η) := le_trans hL_le (le_trans (min_le_right _ _) (le_trans (min_le_right _ _) (min_le_right _ _))) have hL_log2 : L ≤ Real.log 2 := by have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) linarith have hlen : ∀ i : Fin r, b i - a i = L := fun i => by simp only [a, b]; ring have hsep : ∀ i j : Fin r, i < j → b i < a j := by intro i j hij simp only [a, b] linarith [hgap i j hij] have hm_ge : ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) + η ≤ m_func L := by have h1 := m_func_ge_log_four_div_sub_A hL_pos have hdiv : Real.exp (weilConstA + ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) + η) ≤ 4 / L := by rw [le_div_iff₀ hL_pos] have hinv : Real.exp (-weilConstA - ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) - η) = (Real.exp (weilConstA + ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) + η))⁻¹ := by rw [← Real.exp_neg]; congr 1; ring rw [hinv] at hL_exp have hexp_pos : 0 < Real.exp (weilConstA + ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) + η) := Real.exp_pos _ have hmul := mul_le_mul_of_nonneg_left hL_exp (le_of_lt hexp_pos) have hcancel : Real.exp (weilConstA + ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) + η) * (4 * (Real.exp (weilConstA + ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) + η))⁻¹) = 4 := by field_simp [ne_of_gt hexp_pos] linarith have hlog := Real.log_le_log (Real.exp_pos _) hdiv rw [Real.log_exp] at hlog linarith have hrow : ∀ i : Fin r, η ≤ rowMarginUnbal a b i := by intro i unfold rowMarginUnbal rw [hlen i] have hsum_le : ∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j ≤ ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) := by have hcard : (Finset.univ.filter (fun j : Fin r => j ≠ i)).card = r - 1 := by have hcompl : Finset.univ.filter (fun j : Fin r => j ≠ i) = Finset.univ.erase i := by ext j; simp [Finset.mem_erase] rw [hcompl, Finset.card_erase_of_mem (Finset.mem_univ i), Finset.card_fin] calc ∑ j ∈ Finset.univ.filter (fun j => j ≠ i), offDiagBoundUnbal a b i j ≤ ∑ _j ∈ Finset.univ.filter (fun j => j ≠ i), (P_D_bound D + C_delta_unbal δ) := Finset.sum_le_sum (fun j hj => offDiagBoundUnbal_le_fixed_center_bound hδ_pos hgap hspan hL_pos hL_δ hL_1 (Finset.mem_filter.mp hj).2.symm) _ = ((Finset.univ.filter (fun j : Fin r => j ≠ i)).card : ℝ) * (P_D_bound D + C_delta_unbal δ) := by rw [Finset.sum_const, nsmul_eq_mul] _ = ((r : ℝ) - 1) * (P_D_bound D + C_delta_unbal δ) := by rw [hcard, Nat.cast_sub hr, Nat.cast_one] linarith refine ⟨hrow, fun φ hsupp => ?_⟩ have hM : ∀ v : Fin r → ℝ, (∀ i, 0 ≤ v i) → η * ∑ i : Fin r, v i ^ 2 ≤ quadForm (compMatrixUnbal a b) v := fun v _ => row_dominance_implies_matrix_lower_bound_unbal hsep hrow v have hpos := theorem1_unbalanced_uniform_positivity (fun i => by rw [hlen i]; exact hL_pos) (fun i => by rw [hlen i]; exact hL_log2) hsep hsupp hM (fun _ => (1 : ℂ)) have hsum_one : (∑ i : Fin r, (1 : ℂ) • φ i) = ∑ i : Fin r, φ i := by refine Finset.sum_congr rfl (fun i _ => one_smul ℂ (φ i)) rw [hsum_one] at hpos refine ⟨hpos, fun hne => ?_⟩ exact lt_of_lt_of_le (mul_pos hη_pos (normSq_pos_of_ne_zero hne)) hpos /-- **Global-Balance Theorem 2**: For ANY fixed strictly increasing real centers `c_0 < ... < c_{r-1}` (`r ≥ 1`) and ANY margin `η > 0`, there exists an explicit `L₀ > 0` such that for every `0 < L ≤ L₀`, EVERY family `φ : Fin r → TestFn` supported in `[c_i - L/2, c_i + L/2]` — and in particular every globally balanced sum `IsBalanced (∑ i, φ i)` regardless of whether individual `φ i` are locally balanced — satisfies `η * normSq (∑ i, φ i) ≤ Q_form (∑ i, φ i)` and strict positivity when nonzero. -/ theorem theorem2_fixed_centers_global_balance {r : ℕ} (hr : 1 ≤ r) (centers : Fin r → ℝ) (hmono : StrictMono centers) {η : ℝ} (hη : 0 < η) : ∃ L₀ > 0, ∀ L : ℝ, 0 < L → L ≤ L₀ → ∀ φ : Fin r → TestFn, (∀ i, SupportedIn (φ i) (centers i - L / 2) (centers i + L / 2)) → η * normSq (∑ i : Fin r, φ i) ≤ Q_form (∑ i : Fin r, φ i) ∧ (∑ i : Fin r, φ i ≠ 0 → 0 < Q_form (∑ i : Fin r, φ i)) := by let pairs : Finset (Fin r × Fin r) := Finset.univ.filter (fun p => p.1 < p.2) have hδ_ex : ∃ δ > 0, ∀ i j : Fin r, i < j → δ ≤ centers j - centers i := by by_cases hne : pairs.Nonempty · refine ⟨pairs.inf' hne (fun p => centers p.2 - centers p.1), ?_, ?_⟩ · show 0 < pairs.inf' hne (fun p => centers p.2 - centers p.1) rw [Finset.lt_inf'_iff] intro p hp have hlt : p.1 < p.2 := (Finset.mem_filter.mp hp).2 linarith [hmono hlt] · intro i j hij exact Finset.inf'_le (fun p : Fin r × Fin r => centers p.2 - centers p.1) (Finset.mem_filter.mpr ⟨Finset.mem_univ (i, j), hij⟩) · refine ⟨1, zero_lt_one, fun i j hij => ?_⟩ exfalso exact hne ⟨(i, j), Finset.mem_filter.mpr ⟨Finset.mem_univ (i, j), hij⟩⟩ obtain ⟨δ, hδ_pos, hgap⟩ := hδ_ex set D := centers ⟨r - 1, by omega⟩ - centers ⟨0, by omega⟩ have hspan : ∀ i j : Fin r, i < j → centers j - centers i ≤ D := by intro i j _ have hi : centers ⟨0, by omega⟩ ≤ centers i := hmono.monotone (show (⟨0, by omega⟩ : Fin r) ≤ i from Nat.zero_le i.val) have hj : centers j ≤ centers ⟨r - 1, by omega⟩ := hmono.monotone (show j ≤ ⟨r - 1, by omega⟩ from Nat.le_sub_one_of_lt j.2) linarith refine ⟨explicitWidthBoundUnbal r δ D η, explicitWidthBoundUnbal_pos r hδ_pos D η, fun L hL_pos hL_le => ?_⟩ exact (theorem2_fixed_centers_unbalanced_explicit hr hδ_pos hη hgap hspan hL_pos hL_le).2 /-- Every element of `LocalTestSpace a b` is supported in `[a, b]`. -/ lemma supportedIn_of_mem_localTestSpace {a b : ℝ} (f : LocalTestSpace a b) : SupportedIn f.1 a b := by intro u hu by_contra hne have hmem : u ∈ Ioo a b := f.2 (subset_tsupport f.1.toFun (Function.mem_support.mpr hne)) exact hu ⟨le_of_lt hmem.1, le_of_lt hmem.2⟩ /-- Moments of finite sums of test functions add linearly. -/ lemma momentNeg_finset_sum {ι : Type*} (s : Finset ι) (f : ι → TestFn) : momentNeg (∑ i ∈ s, f i) = ∑ i ∈ s, momentNeg (f i) := by classical induction s using Finset.induction_on with | empty => simp [momentNeg] | insert a s ha ih => rw [Finset.sum_insert ha, momentNeg_add, ih, Finset.sum_insert ha] lemma momentPos_finset_sum {ι : Type*} (s : Finset ι) (f : ι → TestFn) : momentPos (∑ i ∈ s, f i) = ∑ i ∈ s, momentPos (f i) := by classical induction s using Finset.induction_on with | empty => simp [momentPos] | insert a s ha ih => rw [Finset.sum_insert ha, momentPos_add, ih, Finset.sum_insert ha] /-- Every tuple in `GloballyBalanced a b` sums to a globally balanced `TestFn`. -/ lemma isBalanced_sum_of_mem_globallyBalanced {r : ℕ} {a b : Fin r → ℝ} {φ : MultiWindowSpace a b} (hgb : φ ∈ GloballyBalanced a b) : IsBalanced (∑ i : Fin r, (φ i).1) := by rw [GloballyBalanced, LinearMap.mem_ker, LinearMap.comp_apply] at hgb have h1 := congrArg Prod.fst hgb have h2 := congrArg Prod.snd hgb simp only [sumMomentsMap, allMomentsMap, localMomentMap, momentLinearMap, LinearMap.coe_mk, AddHom.coe_mk, LinearMap.comp_apply, Submodule.coe_subtype, Prod.fst_sum, Prod.snd_sum, Prod.fst_zero, Prod.snd_zero] at h1 h2 exact ⟨by rw [momentNeg_finset_sum]; exact h1, by rw [momentPos_finset_sum]; exact h2⟩ /-- **Positivity on the Entire Globally Balanced Subspace (`CodimensionAndCutoff.GloballyBalanced`)**: For any `r ≥ 1` strictly increasing centers and `η > 0`, once `0 < L ≤ L₀`, EVERY element `φ ∈ GloballyBalanced a b` (spanning all `2r - 2` non-locally-balanced codimension directions) satisfies `IsBalanced (∑ i, (φ i).1)` and `η * normSq (∑ i, (φ i).1) ≤ Q_form (∑ i, (φ i).1)`. -/ theorem theorem2_globally_balanced_subspace {r : ℕ} (hr : 1 ≤ r) (centers : Fin r → ℝ) (hmono : StrictMono centers) {η : ℝ} (hη : 0 < η) : ∃ L₀ > 0, ∀ L : ℝ, 0 < L → L ≤ L₀ → ∀ φ : GloballyBalanced (fun k => centers k - L / 2) (fun k => centers k + L / 2), IsBalanced (∑ i : Fin r, (φ.1 i).1) ∧ η * normSq (∑ i : Fin r, (φ.1 i).1) ≤ Q_form (∑ i : Fin r, (φ.1 i).1) ∧ (∑ i : Fin r, (φ.1 i).1 ≠ 0 → 0 < Q_form (∑ i : Fin r, (φ.1 i).1)) := by obtain ⟨L₀, hL₀, hmain⟩ := theorem2_fixed_centers_global_balance hr centers hmono hη refine ⟨L₀, hL₀, fun L hL_pos hL_le φ => ?_⟩ have hbal := isBalanced_sum_of_mem_globallyBalanced φ.2 have hpos := hmain L hL_pos hL_le (fun i => (φ.1 i).1) (fun i => supportedIn_of_mem_localTestSpace (φ.1 i)) exact ⟨hbal, hpos.1, hpos.2⟩ /-! ### 5. Kernel-Checked 3-Window Unbalanced Certificate (`L = 1/100`, Margin `ε = 1`) -/ lemma F_unbal_one_hundredth_adj_lt : F_unbal (1 / 100) (1 / 100) (69 / 100) < 8 / 1000 := by have hle : F_unbal (1 / 100) (1 / 100) (69 / 100) ≤ F_unbal_simple (1 / 100) (1 / 100) (69 / 100) := F_unbal_le_simple (by norm_num) (by norm_num) have hsimp : F_unbal_simple (1 / 100) (1 / 100) (69 / 100) = Real.exp (-(69 / 200)) * (1 / 100) := by unfold F_unbal_simple rw [Real.sqrt_mul_self (by norm_num)] congr 2; norm_num have hexp : Real.exp (-(69 / 200)) < 71 / 100 := by have h := (exp_neg_taylor_bounds (x := 69 / 200) (by norm_num)).2 have hnum : (1 : ℝ) - 69 / 200 + (69 / 200) ^ 2 / 2 - (69 / 200) ^ 3 / 6 + (69 / 200) ^ 4 / 24 - (69 / 200) ^ 5 / 120 + (69 / 200) ^ 6 / 720 < 71 / 100 := by norm_num linarith linarith lemma F_unbal_one_hundredth_outer_lt : F_unbal (1 / 100) (1 / 100) (139 / 100) < 5 / 1000 := by have hle : F_unbal (1 / 100) (1 / 100) (139 / 100) ≤ F_unbal_simple (1 / 100) (1 / 100) (139 / 100) := F_unbal_le_simple (by norm_num) (by norm_num) have hsimp : F_unbal_simple (1 / 100) (1 / 100) (139 / 100) = Real.exp (-(139 / 200)) * (1 / 100) := by unfold F_unbal_simple rw [Real.sqrt_mul_self (by norm_num)] congr 2; norm_num have hexp : Real.exp (-(139 / 200)) < 1 / 2 := by have h := (exp_neg_taylor_bounds (x := 139 / 200) (by norm_num)).2 have hnum : (1 : ℝ) - 139 / 200 + (139 / 200) ^ 2 / 2 - (139 / 200) ^ 3 / 6 + (139 / 200) ^ 4 / 24 - (139 / 200) ^ 5 / 120 + (139 / 200) ^ 6 / 720 < 1 / 2 := by norm_num linarith linarith lemma E_unbal_certified_adj_lt : E_unbal (1 / 100) (1 / 100) (69 / 100) (71 / 100) < 504 / 1000 := by unfold E_unbal linarith [E_bound_certified_adj_lt, F_unbal_one_hundredth_adj_lt] lemma E_unbal_certified_outer_lt : E_unbal (1 / 100) (1 / 100) (139 / 100) (141 / 100) < 8 / 1000 := by unfold E_unbal linarith [E_bound_certified_outer_lt, F_unbal_one_hundredth_outer_lt] /-- **Kernel-checked 3-window unbalanced certificate (`L = 1/100`, margin `ε = 1`)**: On the three windows centered at `0, 7/10, 7/5` with common width `1/100`, EVERY row margin of the unbalanced `3 × 3` comparison matrix still exceeds `1` (middle row `> 1.112`, outer rows `> 1.608`), certifying `normSq (∑ i, c_i • φ_i) ≤ Q_form (∑ i, c_i • φ_i)` for ALL smooth functions supported in those windows — with NO local-balance hypothesis! -/ theorem certified_three_window_L_one_hundredth_unbalanced (φ : Fin 3 → TestFn) (c : Fin 3 → ℂ) (hsupp : ∀ i : Fin 3, SupportedIn (φ i) (exampleCenters i - 1 / 200) (exampleCenters i + 1 / 200)) : 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 : offDiagBoundUnbal a b 0 1 < 504 / 1000 := by rw [offDiagBoundUnbal_of_lt a b (by decide : (0 : Fin 3) < 1)] have h : E_unbal (b 0 - a 0) (b 1 - a 1) (a 1 - b 0) (b 1 - a 0) = E_unbal (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_unbal_certified_adj_lt have hE12 : offDiagBoundUnbal a b 1 2 < 504 / 1000 := by rw [offDiagBoundUnbal_of_lt a b (by decide : (1 : Fin 3) < 2)] have h : E_unbal (b 1 - a 1) (b 2 - a 2) (a 2 - b 1) (b 2 - a 1) = E_unbal (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_unbal_certified_adj_lt have hE02 : offDiagBoundUnbal a b 0 2 < 8 / 1000 := by rw [offDiagBoundUnbal_of_lt a b (by decide : (0 : Fin 3) < 2)] have h : E_unbal (b 0 - a 0) (b 2 - a 2) (a 2 - b 0) (b 2 - a 0) = E_unbal (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_unbal_certified_outer_lt have hrow : ∀ i : Fin 3, (1 : ℝ) ≤ rowMarginUnbal a b i := by intro i unfold rowMarginUnbal 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), offDiagBoundUnbal a b 0 j have hsum : ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 0), offDiagBoundUnbal a b 0 j = offDiagBoundUnbal a b 0 1 + offDiagBoundUnbal 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), offDiagBoundUnbal a b 1 j have hsum : ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 1), offDiagBoundUnbal a b 1 j = offDiagBoundUnbal a b 1 0 + offDiagBoundUnbal 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, offDiagBoundUnbal_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), offDiagBoundUnbal a b 2 j have hsum : ∑ j ∈ Finset.univ.filter (fun j : Fin 3 => j ≠ 2), offDiagBoundUnbal a b 2 j = offDiagBoundUnbal a b 2 0 + offDiagBoundUnbal 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, offDiagBoundUnbal_symm a b 2 0, offDiagBoundUnbal_symm a b 2 1] linarith [m_func_one_hundredth_gt] have hM : ∀ v : Fin 3 → ℝ, (∀ i, 0 ≤ v i) → (1 : ℝ) * ∑ i : Fin 3, v i ^ 2 ≤ quadForm (compMatrixUnbal a b) v := fun v _ => row_dominance_implies_matrix_lower_bound_unbal hsep hrow v have hpos := theorem1_unbalanced_uniform_positivity hL_pos hL_le hsep hsupp hM c simpa using hpos /-! ### 6. Kernel-Checked 3-Window `N = 64` Unbalanced Certificate (`L = 1/20`, Margin `ε = 1/6`) -/ lemma F_unbal_one_twentieth_adj_lt : F_unbal (1 / 20) (1 / 20) (13 / 20) < 37 / 1000 := by have hle : F_unbal (1 / 20) (1 / 20) (13 / 20) ≤ F_unbal_simple (1 / 20) (1 / 20) (13 / 20) := F_unbal_le_simple (by norm_num) (by norm_num) have hsimp : F_unbal_simple (1 / 20) (1 / 20) (13 / 20) = Real.exp (-(13 / 40)) * (1 / 20) := by unfold F_unbal_simple rw [Real.sqrt_mul_self (by norm_num)] congr 2; norm_num have hexp : Real.exp (-(13 / 40)) < 73 / 100 := by have h := (exp_neg_taylor_bounds (x := 13 / 40) (by norm_num)).2 have hnum : (1 : ℝ) - 13 / 40 + (13 / 40) ^ 2 / 2 - (13 / 40) ^ 3 / 6 + (13 / 40) ^ 4 / 24 - (13 / 40) ^ 5 / 120 + (13 / 40) ^ 6 / 720 < 73 / 100 := by norm_num linarith linarith lemma F_unbal_one_twentieth_outer_lt : F_unbal (1 / 20) (1 / 20) (27 / 20) < 26 / 1000 := by have hle : F_unbal (1 / 20) (1 / 20) (27 / 20) ≤ F_unbal_simple (1 / 20) (1 / 20) (27 / 20) := F_unbal_le_simple (by norm_num) (by norm_num) have hsimp : F_unbal_simple (1 / 20) (1 / 20) (27 / 20) = Real.exp (-(27 / 40)) * (1 / 20) := by unfold F_unbal_simple rw [Real.sqrt_mul_self (by norm_num)] congr 2; norm_num have hexp : Real.exp (-(27 / 40)) < 51 / 100 := by have h := (exp_neg_taylor_bounds (x := 27 / 40) (by norm_num)).2 have hnum : (1 : ℝ) - 27 / 40 + (27 / 40) ^ 2 / 2 - (27 / 40) ^ 3 / 6 + (27 / 40) ^ 4 / 24 - (27 / 40) ^ 5 / 120 + (27 / 40) ^ 6 / 720 < 51 / 100 := by norm_num linarith linarith lemma E_unbal_13_20_3_4_lt : E_unbal (1 / 20) (1 / 20) (13 / 20) (3 / 4) < 544 / 1000 := by unfold E_unbal linarith [E_bound_13_20_3_4_lt, F_unbal_one_twentieth_adj_lt] lemma E_unbal_27_20_29_20_lt : E_unbal (1 / 20) (1 / 20) (27 / 20) (29 / 20) < 376 / 1000 := by unfold E_unbal linarith [E_bound_27_20_29_20_lt, F_unbal_one_twentieth_outer_lt] /-- Exact rational lower-bound comparison matrix for the unbalanced 3-window `L = 1/20` certificate (`diag = 1175/1000`, `adj = 544/1000`, `outer = 376/1000`). -/ noncomputable def threeWindowUnbalRatMat : Matrix (Fin 3) (Fin 3) ℝ := !![1175 / 1000, -(544 / 1000), -(376 / 1000); -(544 / 1000), 1175 / 1000, -(544 / 1000); -(376 / 1000), -(544 / 1000), 1175 / 1000] /-- Exact unit lower triangular `L` factor for `threeWindowUnbalRatMat - (1/6) I = L D Lᵀ`. -/ noncomputable def threeWindowUnbalL : Matrix (Fin 3) (Fin 3) ℝ := !![1, 0, 0; -(1632 / 3025), 1, 0; -(1128 / 3025), -(6777696 / 6487201), 1] /-- Exact strictly positive Schur pivots `D` for `threeWindowUnbalRatMat - (1/6) I = L D Lᵀ`. -/ noncomputable def threeWindowUnbalD : Fin 3 → ℝ := ![121 / 120, 6487201 / 9075000, 1709279281 / 19461603000] lemma threeWindowUnbal_ldl_identity : ∀ i j : Fin 3, threeWindowUnbalRatMat i j - (if i = j then (1 / 6 : ℝ) else 0) = ∑ k : Fin 3, threeWindowUnbalL i k * threeWindowUnbalD k * threeWindowUnbalL j k := by intro i j fin_cases i <;> fin_cases j <;> simp [threeWindowUnbalRatMat, threeWindowUnbalL, threeWindowUnbalD, Fin.sum_univ_three] <;> norm_num lemma threeWindowUnbalD_pos : ∀ k : Fin 3, 0 < threeWindowUnbalD k := by intro k; fin_cases k <;> simp [threeWindowUnbalD] /-- **Kernel-checked 3-window `N = 64` unbalanced certificate (`L = 1/20`, margin `ε = 1/6`)**: On the three windows centered at `0, 7/10, 7/5` with width `L = 1/20` (span `29/20`, prime links `{2, 4, 2}`), the finite-chain `N = 64` unbalanced comparison matrix has an exact `3 × 3` rational `LDLᵀ` factorization with strictly positive Schur pivots, certifying `(1/6) * normSq (∑ i, c_i • φ_i) ≤ Q_form (∑ i, c_i • φ_i)` for ALL smooth functions supported in those windows and ALL `c ∈ ℂ³`, with NO local-balance hypothesis! -/ theorem certified_three_window_L_one_twentieth_unbalanced (φ : Fin 3 → TestFn) (c : Fin 3 → ℂ) (hsupp : ∀ i : Fin 3, SupportedIn (φ i) (exampleCenters i - 1 / 40) (exampleCenters i + 1 / 40)) : (1 / 6 : ℝ) * 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 / 40 set b : Fin 3 → ℝ := fun i => exampleCenters i + 1 / 40 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 / 20 := 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 hdiag : ∀ i : Fin 3, (1175 / 1000 : ℝ) < m_chain 64 (b i - a i) := by intro i have hlen : b i - a i = 1 / 20 := by simp only [a, b]; ring rw [hlen]; exact m_chain_64_one_twentieth_gt have hupper : ∀ i j : Fin 3, i < j → offDiagBoundUnbal a b i j < -threeWindowUnbalRatMat i j := by intro i j hij rw [offDiagBoundUnbal_of_lt a b hij] fin_cases i <;> fin_cases j <;> try (exfalso; exact (by decide : ¬ _) hij) all_goals simp only [a, b, exampleCenters, threeWindowUnbalRatMat] · convert E_unbal_13_20_3_4_lt using 2 <;> norm_num · convert E_unbal_27_20_29_20_lt using 2 <;> norm_num · convert E_unbal_13_20_3_4_lt using 2 <;> norm_num have hsymm_rat : ∀ i j : Fin 3, threeWindowUnbalRatMat j i = threeWindowUnbalRatMat i j := by intro i j; fin_cases i <;> fin_cases j <;> simp [threeWindowUnbalRatMat] have hentry : ∀ i j : Fin 3, threeWindowUnbalRatMat i j ≤ compMatrixChainUnbal 64 a b i j := by intro i j rcases lt_trichotomy i j with hlt | rfl | hgt · have hne : i ≠ j := ne_of_lt hlt simp only [compMatrixChainUnbal, Matrix.of_apply, hne, ↓reduceIte] linarith [hupper i j hlt] · simp only [compMatrixChainUnbal, Matrix.of_apply, ↓reduceIte] have hdiag_rat : threeWindowUnbalRatMat i i = 1175 / 1000 := by fin_cases i <;> simp [threeWindowUnbalRatMat] rw [hdiag_rat] exact le_of_lt (hdiag i) · have hne : i ≠ j := ne_of_gt hgt simp only [compMatrixChainUnbal, Matrix.of_apply, hne, ↓reduceIte] rw [offDiagBoundUnbal_symm, ← hsymm_rat i j] linarith [hupper j i hgt] have hM : ∀ v : Fin 3 → ℝ, (∀ i, 0 ≤ v i) → (1 / 6 : ℝ) * ∑ i : Fin 3, v i ^ 2 ≤ quadForm (compMatrixChainUnbal 64 a b) v := fun v hv => le_trans (quadForm_ge_of_ldl threeWindowUnbalRatMat threeWindowUnbalL threeWindowUnbalD (1 / 6) threeWindowUnbal_ldl_identity (fun k => le_of_lt (threeWindowUnbalD_pos k)) v) (quadForm_mono_entrywise_nonneg threeWindowUnbalRatMat (compMatrixChainUnbal 64 a b) hentry hv) exact theorem1_chain_unbalanced_uniform_positivity 64 (by norm_num) hL_pos hL_le hsep hsupp hM c /-! ### 7. Explicit Witness Strictly Extending F04 Across the `2r - 2` Missing Directions -/ /-- **Strict Extension Beyond Local Balance**: There exist smooth compactly supported functions `φ₀, φ₁ : TestFn` supported in the strictly separated narrow windows `[-1/200, 1/200]` and `[139/200, 141/200]` (centers `0` and `7/10`, width `1/100`, gap `69/100 > 0`) such that: 1. Neither `φ₀` nor `φ₁` is locally balanced (`¬ IsBalanced φ₀` and `¬ IsBalanced φ₁`), 2. Their sum `φ₀ + φ₁` IS globally balanced (`IsBalanced (φ₀ + φ₁)`), 3. Their sum is nonzero (`φ₀ + φ₁ ≠ 0`), and 4. The Weil quadratic form is strictly positive on `φ₀ + φ₁` (`0 < Q_form (φ₀ + φ₁)`). Thus the unbalanced multi-window theorems genuinely certify positivity on the codimension `2r - 2` non-locally-balanced directions outside the scope of locally balanced F04. -/ theorem exists_globally_balanced_not_locally_balanced_positive : ∃ φ₀ φ₁ : TestFn, SupportedIn φ₀ (-(1 / 200)) (1 / 200) ∧ SupportedIn φ₁ (139 / 200) (141 / 200) ∧ ¬ IsBalanced φ₀ ∧ ¬ IsBalanced φ₁ ∧ IsBalanced (φ₀ + φ₁) ∧ φ₀ + φ₁ ≠ 0 ∧ 0 < Q_form (φ₀ + φ₁) := by obtain ⟨ψ₀, hψ₀⟩ := localMomentMap_surjective (a := -(1 / 200)) (b := 1 / 200) (by norm_num) ((1 : ℂ), (0 : ℂ)) obtain ⟨ψ₁, hψ₁⟩ := localMomentMap_surjective (a := 139 / 200) (b := 141 / 200) (by norm_num) ((-(1 : ℂ)), (0 : ℂ)) set φ₀ : TestFn := ψ₀.1 set φ₁ : TestFn := ψ₁.1 have hsupp₀ : SupportedIn φ₀ (-(1 / 200)) (1 / 200) := supportedIn_of_mem_localTestSpace ψ₀ have hsupp₁ : SupportedIn φ₁ (139 / 200) (141 / 200) := supportedIn_of_mem_localTestSpace ψ₁ have hm₀_neg : momentNeg φ₀ = 1 := congrArg Prod.fst hψ₀ have hm₀_pos : momentPos φ₀ = 0 := congrArg Prod.snd hψ₀ have hm₁_neg : momentNeg φ₁ = -1 := congrArg Prod.fst hψ₁ have hm₁_pos : momentPos φ₁ = 0 := congrArg Prod.snd hψ₁ have hnb₀ : ¬ IsBalanced φ₀ := by intro h have h01 : (1 : ℂ) = 0 := hm₀_neg.symm.trans h.1 exact one_ne_zero h01 have hnb₁ : ¬ IsBalanced φ₁ := by intro h have h01 : (-1 : ℂ) = 0 := hm₁_neg.symm.trans h.1 exact neg_ne_zero.mpr one_ne_zero h01 have hbal_sum : IsBalanced (φ₀ + φ₁) := by constructor · rw [momentNeg_add, hm₀_neg, hm₁_neg]; ring · rw [momentPos_add, hm₀_pos, hm₁_pos]; ring have hne : φ₀ + φ₁ ≠ 0 := by intro hzero have hφ₀_zero : φ₀ = 0 := by ext u by_cases hu : u ∈ Icc (-(1 / 200 : ℝ)) (1 / 200) · have hnot1 : u ∉ Icc (139 / 200 : ℝ) (141 / 200) := fun hm => by linarith [hu.2, hm.1] have h1u : φ₁ u = 0 := hsupp₁ u hnot1 have hsum := congrArg (fun f : TestFn => f u) hzero simp only [TestFn.add_apply, TestFn.zero_apply, h1u, add_zero] at hsum exact hsum · exact hsupp₀ u hu have hm0 : momentNeg φ₀ = 0 := by rw [hφ₀_zero]; simp [momentNeg] exact one_ne_zero (hm₀_neg.symm.trans hm0) have hcert : normSq (φ₀ + φ₁) ≤ Q_form (φ₀ + φ₁) := by let φ : Fin 3 → TestFn := ![φ₀, φ₁, 0] let c : Fin 3 → ℂ := ![1, 1, 0] have hsupp_all : ∀ i : Fin 3, SupportedIn (φ i) (exampleCenters i - 1 / 200) (exampleCenters i + 1 / 200) := by intro i fin_cases i · change SupportedIn φ₀ (0 - 1 / 200) (0 + 1 / 200) convert hsupp₀ using 1 <;> norm_num · change SupportedIn φ₁ (7 / 10 - 1 / 200) (7 / 10 + 1 / 200) convert hsupp₁ using 1 <;> norm_num · intro u _; rfl have hpos := certified_three_window_L_one_hundredth_unbalanced φ c hsupp_all have hsum_eq : (∑ i : Fin 3, c i • φ i) = φ₀ + φ₁ := by simp [Fin.sum_univ_three, φ, c] rwa [hsum_eq] at hpos have hQ_pos : 0 < Q_form (φ₀ + φ₁) := lt_of_lt_of_le (normSq_pos_of_ne_zero hne) hcert exact ⟨φ₀, φ₁, hsupp₀, hsupp₁, hnb₀, hnb₁, hbal_sum, hne, hQ_pos⟩ end F04Riemann