import Mathlib.LinearAlgebra.Dimension.Finrank import Mathlib.LinearAlgebra.Dimension.RankNullity import Mathlib.LinearAlgebra.Dimension.Constructions import Mathlib.LinearAlgebra.Dimension.LinearMap import F04Riemann.ComparisonAndPositivity /-! # Exact Codimension `2r - 2`, Infinite Dimensionality, and Cutoff Reconstruction (F04 §7) This module formalizes every result in Section 7 of F04: 1. **Explicit `C^∞` compactly supported bump functions** (`bumpTestFn a b : TestFn`), proved `ContDiff ℝ ⊤` via the polynomial-exponential family `P(x⁻¹) e^{-x⁻¹}`. 2. **Exact surjectivity of the local moment map** `localMomentMap a b : LocalTestSpace a b →ₗ[ℂ] (ℂ × ℂ)` on every positive-length open interval `(a, b)`, together with the dual-functional non-degeneracy argument from Section 7. 3. **Exact complex codimension `2r - 2`** (`local_balance_codimension`): for `r ≥ 1` positive-length intervals `I_i = [a_i, b_i]`, the locally balanced subspace `{ (φ_i) | ∀ i, ℓ_i(φ_i) = (0, 0) }` has complex codimension `2 * r - 2` inside the globally balanced subspace `{ (φ_i) | ∑_i ℓ_i(φ_i) = (0, 0) }`. 4. **Infinite dimensionality** of each local balanced kernel (`local_balanced_infinite_dimensional`) and **uniqueness of decomposition** on disjoint intervals (`disjoint_sum_unique`). 5. **Exact cutoff reconstruction identity (eq. (14))** (`cutoff_product_rule` and `cutoff_reconstruction_sum`): for any smooth cutoff partition `∑_i χ_i = 1` near `supp ψ`, each `f_i = (∂² - 1/4)(χ_i ψ)` equals `χ_i (T ψ) + 2 χ_i' ψ' + χ_i'' ψ`, satisfies both balance conditions individually, and sums back to `T ψ`. -/ namespace F04Riemann open Real Complex MeasureTheory Set Filter Topology /-! ### 1. Explicit `C^∞` Compactly Supported Bump Functions -/ /-- Elementary bound `y^m / m! ≤ exp y` for all `y ≥ 0` and `m : ℕ`. -/ lemma pow_div_factorial_le_exp (m : ℕ) {y : ℝ} (hy : 0 ≤ y) : y ^ m / (Nat.factorial m : ℝ) ≤ Real.exp y := by induction m generalizing y with | zero => simp [Real.one_le_exp hy] | succ k ih => have hftc_lhs : ∫ t in (0 : ℝ)..y, t ^ k / (Nat.factorial k : ℝ) = y ^ (k + 1) / (Nat.factorial (k + 1) : ℝ) := by have hd : ∀ t ∈ uIcc (0 : ℝ) y, HasDerivAt (fun x : ℝ => x ^ (k + 1) / (Nat.factorial (k + 1) : ℝ)) (t ^ k / (Nat.factorial k : ℝ)) t := by intro t _ have h := (hasDerivAt_pow (k + 1) t).div_const (Nat.factorial (k + 1) : ℝ) have hval : ((k + 1 : ℕ) : ℝ) * t ^ (k + 1 - 1) / (Nat.factorial (k + 1) : ℝ) = t ^ k / (Nat.factorial k : ℝ) := by rw [Nat.factorial_succ] push_cast have h1 : (k : ℝ) + 1 ≠ 0 := by positivity have h2 : (Nat.factorial k : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero k) field_simp rwa [hval] at h have hcont : Continuous (fun t : ℝ => t ^ k / (Nat.factorial k : ℝ)) := (continuous_pow k).div_const _ have hres := intervalIntegral.integral_eq_sub_of_hasDerivAt hd (hcont.intervalIntegrable 0 y) simpa using hres have hftc_rhs : ∫ t in (0 : ℝ)..y, Real.exp t = Real.exp y - 1 := by have hres := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => Real.hasDerivAt_exp t) (Real.continuous_exp.intervalIntegrable 0 y) simpa using hres have hmono : ∫ t in (0 : ℝ)..y, t ^ k / (Nat.factorial k : ℝ) ≤ ∫ t in (0 : ℝ)..y, Real.exp t := by refine intervalIntegral.integral_mono_on hy (((continuous_pow k).div_const _).intervalIntegrable 0 y) (Real.continuous_exp.intervalIntegrable 0 y) (fun t ht => ih ht.1) linarith /-- For every `k : ℕ`, `(x⁻¹)^k * exp(-x⁻¹) → 0` as `x → 0⁺`. -/ lemma tendsto_inv_pow_mul_exp_neg_inv (k : ℕ) : Tendsto (fun x : ℝ => x⁻¹ ^ k * Real.exp (-x⁻¹)) (𝓝[>] 0) (𝓝 0) := by have hle : ∀ x : ℝ, 0 < x → 0 ≤ x⁻¹ ^ k * Real.exp (-x⁻¹) ∧ x⁻¹ ^ k * Real.exp (-x⁻¹) ≤ (Nat.factorial (k + 1) : ℝ) * x := by intro x hx refine ⟨mul_nonneg (pow_nonneg (inv_nonneg.mpr (le_of_lt hx)) k) (le_of_lt (Real.exp_pos _)), ?_⟩ have hy : 0 < x⁻¹ := inv_pos.mpr hx have hexp := pow_div_factorial_le_exp (k + 1) (le_of_lt hy) have hfac_pos : (0 : ℝ) < (Nat.factorial (k + 1) : ℝ) := Nat.cast_pos.mpr (Nat.factorial_pos _) have hmul : x⁻¹ ^ (k + 1) ≤ (Nat.factorial (k + 1) : ℝ) * Real.exp (x⁻¹) := by rw [mul_comm]; exact (div_le_iff₀ hfac_pos).mp hexp have hrew : x⁻¹ ^ (k + 1) = x⁻¹ ^ k * x⁻¹ := pow_succ x⁻¹ k rw [Real.exp_neg] have hne_x : x ≠ 0 := ne_of_gt hx have hne_exp : Real.exp x⁻¹ ≠ 0 := ne_of_gt (Real.exp_pos _) rw [← div_eq_mul_inv, div_le_iff₀ (Real.exp_pos _)] have hstep : x⁻¹ ^ k ≤ (Nat.factorial (k + 1) : ℝ) * x * Real.exp x⁻¹ := by have h2 := mul_le_mul_of_nonneg_right hmul (le_of_lt hx) have hlhs : x⁻¹ ^ (k + 1) * x = x⁻¹ ^ k := by rw [hrew, mul_assoc, inv_mul_cancel₀ hne_x, mul_one] rw [hlhs] at h2 linarith exact hstep have hupper : Tendsto (fun x : ℝ => (Nat.factorial (k + 1) : ℝ) * x) (𝓝[>] 0) (𝓝 0) := by have h : Tendsto (fun x : ℝ => (Nat.factorial (k + 1) : ℝ) * x) (𝓝 0) (𝓝 0) := by simpa using (tendsto_id (x := 𝓝 (0 : ℝ))).const_mul (Nat.factorial (k + 1) : ℝ) exact h.mono_left nhdsWithin_le_nhds refine tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds hupper ?_ ?_ · filter_upwards [self_mem_nhdsWithin] with x hx exact (hle x hx).1 · filter_upwards [self_mem_nhdsWithin] with x hx exact (hle x hx).2 /-- Lightweight Horner-form real polynomials represented as coefficient lists. -/ def evalPoly : List ℝ → ℝ → ℝ | [], _ => 0 | c :: cs, y => c + y * evalPoly cs y def addPoly : List ℝ → List ℝ → List ℝ | [], q => q | p, [] => p | a :: ps, b :: qs => (a + b) :: addPoly ps qs def negPoly : List ℝ → List ℝ | [] => [] | a :: ps => (-a) :: negPoly ps def derivPoly : List ℝ → List ℝ | [] => [] | _ :: cs => addPoly cs (0 :: derivPoly cs) lemma evalPoly_add (p q : List ℝ) (y : ℝ) : evalPoly (addPoly p q) y = evalPoly p y + evalPoly q y := by induction p generalizing q with | nil => simp [addPoly, evalPoly] | cons a ps ih => cases q with | nil => simp [addPoly, evalPoly] | cons b qs => simp only [addPoly, evalPoly, ih qs] ring lemma evalPoly_neg (p : List ℝ) (y : ℝ) : evalPoly (negPoly p) y = -evalPoly p y := by induction p with | nil => simp [negPoly, evalPoly] | cons a ps ih => simp only [negPoly, evalPoly, ih] ring lemma hasDerivAt_evalPoly (p : List ℝ) (y : ℝ) : HasDerivAt (evalPoly p) (evalPoly (derivPoly p) y) y := by induction p with | nil => simpa [evalPoly, derivPoly] using hasDerivAt_const y (0 : ℝ) | cons a cs ih => have hmul : HasDerivAt (fun t => t * evalPoly cs t) (1 * evalPoly cs y + y * evalPoly (derivPoly cs) y) y := (hasDerivAt_id' y).mul ih have hadd := hmul.const_add a have hval : 1 * evalPoly cs y + y * evalPoly (derivPoly cs) y = evalPoly (derivPoly (a :: cs)) y := by simp only [derivPoly, evalPoly_add, evalPoly]; ring rw [hval] at hadd exact hadd /-- The polynomial-times-exponential family `P(x⁻¹) e^{-x⁻¹}` extended by `0` on `x ≤ 0`. -/ noncomputable def polyExp (P : List ℝ) (x : ℝ) : ℝ := if x ≤ 0 then 0 else evalPoly P x⁻¹ * Real.exp (-x⁻¹) /-- Algebraic derivative action on the polynomial factor: `(P(x⁻¹) e^{-x⁻¹})' = (X² (P - P'))(x⁻¹) e^{-x⁻¹}`. -/ def polyExpDerivPoly (P : List ℝ) : List ℝ := 0 :: 0 :: addPoly P (negPoly (derivPoly P)) lemma tendsto_polyExp_right_zero : ∀ (P : List ℝ), Tendsto (polyExp P) (𝓝[>] 0) (𝓝 0) := by have hgen : ∀ (k : ℕ) (P : List ℝ), Tendsto (fun x : ℝ => if x ≤ 0 then 0 else x⁻¹ ^ k * evalPoly P x⁻¹ * Real.exp (-x⁻¹)) (𝓝[>] 0) (𝓝 0) := by intro k P induction P generalizing k with | nil => have h0 : (fun x : ℝ => if x ≤ 0 then 0 else x⁻¹ ^ k * evalPoly [] x⁻¹ * Real.exp (-x⁻¹)) = fun _ => 0 := by ext x; simp [evalPoly] rw [h0]; exact tendsto_const_nhds | cons c cs ih => have h1 : Tendsto (fun x : ℝ => c * (x⁻¹ ^ k * Real.exp (-x⁻¹))) (𝓝[>] 0) (𝓝 0) := by simpa using (tendsto_inv_pow_mul_exp_neg_inv k).const_mul c have h2 := ih (k + 1) have hsum := h1.add h2 rw [add_zero] at hsum refine hsum.congr' ?_ filter_upwards [self_mem_nhdsWithin] with x hx have hnot : ¬ (x ≤ 0) := not_le_of_gt hx simp only [hnot, ↓reduceIte, evalPoly, pow_succ] ring intro P unfold polyExp simpa using hgen 0 P lemma hasDerivAt_polyExp (P : List ℝ) (x : ℝ) : HasDerivAt (polyExp P) (polyExp (polyExpDerivPoly P) x) x := by rcases lt_trichotomy x 0 with hneg | rfl | hpos · have hev : polyExp P =ᶠ[𝓝 x] (fun _ => (0 : ℝ)) := by filter_upwards [Iio_mem_nhds hneg] with y hy have hy' : y < 0 := hy simp [polyExp, le_of_lt hy'] have h0 : polyExp (polyExpDerivPoly P) x = 0 := by simp [polyExp, le_of_lt hneg] rw [h0] exact (hasDerivAt_const x (0 : ℝ)).congr_of_eventuallyEq hev · have h0 : polyExp (polyExpDerivPoly P) 0 = 0 := by simp [polyExp] rw [h0, hasDerivAt_iff_tendsto_slope_zero] have hleft : Tendsto (fun t : ℝ => t⁻¹ • (polyExp P (0 + t) - polyExp P 0)) (𝓝[<] 0) (𝓝 0) := by have hev : (fun t : ℝ => t⁻¹ • (polyExp P (0 + t) - polyExp P 0)) =ᶠ[𝓝[<] 0] (fun _ => 0) := by filter_upwards [self_mem_nhdsWithin] with t ht have ht' : t < 0 := ht simp [polyExp, le_of_lt ht'] rw [tendsto_congr' hev] exact tendsto_const_nhds have hright : Tendsto (fun t : ℝ => t⁻¹ • (polyExp P (0 + t) - polyExp P 0)) (𝓝[>] 0) (𝓝 0) := by have hev : (fun t : ℝ => t⁻¹ • (polyExp P (0 + t) - polyExp P 0)) =ᶠ[𝓝[>] 0] polyExp (0 :: P) := by filter_upwards [self_mem_nhdsWithin] with t ht have hnot : ¬ (t ≤ 0) := not_le_of_gt ht simp only [zero_add, polyExp, le_refl, ↓reduceIte, sub_zero, hnot, smul_eq_mul, evalPoly] ring rw [tendsto_congr' hev] exact tendsto_polyExp_right_zero (0 :: P) have hunion : 𝓝[≠] (0 : ℝ) = 𝓝[<] (0 : ℝ) ⊔ 𝓝[>] (0 : ℝ) := by rw [← Set.Iio_union_Ioi, nhdsWithin_union] rw [hunion] exact hleft.sup hright · have hx_ne : x ≠ 0 := ne_of_gt hpos have hinv : HasDerivAt (fun y : ℝ => y⁻¹) (-(x ^ 2)⁻¹) x := hasDerivAt_inv hx_ne have hneg_inv : HasDerivAt (fun y : ℝ => -y⁻¹) (-(-(x ^ 2)⁻¹)) x := hinv.neg have hP := HasDerivAt.comp x (hasDerivAt_evalPoly P x⁻¹) hinv have hexp := HasDerivAt.comp x (Real.hasDerivAt_exp (-x⁻¹)) hneg_inv have hprod := hP.mul hexp simp only [Function.comp_apply] at hprod have hev : polyExp P =ᶠ[𝓝 x] (fun y => evalPoly P y⁻¹ * Real.exp (-y⁻¹)) := by filter_upwards [Ioi_mem_nhds hpos] with y hy have hnot : ¬ (y ≤ 0) := not_le_of_gt hy simp [polyExp, hnot] have hnot_x : ¬ (x ≤ 0) := not_le_of_gt hpos have hval : evalPoly (derivPoly P) x⁻¹ * -(x ^ 2)⁻¹ * Real.exp (-x⁻¹) + evalPoly P x⁻¹ * (Real.exp (-x⁻¹) * -(-(x ^ 2)⁻¹)) = polyExp (polyExpDerivPoly P) x := by simp only [polyExp, hnot_x, ↓reduceIte, polyExpDerivPoly, evalPoly, evalPoly_add, evalPoly_neg] have hsq : (x ^ 2)⁻¹ = x⁻¹ * x⁻¹ := by rw [sq, mul_inv] rw [hsq]; ring rw [hval] at hprod exact hprod.congr_of_eventuallyEq hev lemma contDiff_nat_polyExp (n : ℕ) : ∀ P : List ℝ, ContDiff ℝ (n : WithTop ℕ∞) (polyExp P) := by induction n with | zero => intro P rw [Nat.cast_zero, contDiff_zero] exact continuous_iff_continuousAt.mpr (fun x => (hasDerivAt_polyExp P x).continuousAt) | succ k ih => intro P rw [Nat.cast_succ, contDiff_succ_iff_deriv] refine ⟨fun x => (hasDerivAt_polyExp P x).differentiableAt, fun hk => absurd hk (by simp), ?_⟩ have hderiv_eq : deriv (polyExp P) = polyExp (polyExpDerivPoly P) := by ext x; exact (hasDerivAt_polyExp P x).deriv rw [hderiv_eq] exact ih (polyExpDerivPoly P) /-- The smooth transition function `x ↦ exp(-1/x)` for `x > 0` and `0` for `x ≤ 0`. -/ noncomputable def smoothStep (x : ℝ) : ℝ := polyExp [1] x lemma contDiff_smoothStep : ContDiff ℝ (⊤ : ℕ∞) smoothStep := by rw [contDiff_infty] intro n exact contDiff_nat_polyExp n [1] lemma smoothStep_eq_zero_of_le {x : ℝ} (hx : x ≤ 0) : smoothStep x = 0 := by simp [smoothStep, polyExp, hx] lemma smoothStep_pos_of_pos {x : ℝ} (hx : 0 < x) : 0 < smoothStep x := by have hnot : ¬ (x ≤ 0) := not_le_of_gt hx simp [smoothStep, polyExp, evalPoly, hnot, Real.exp_pos] /-- Explicit real-valued `C^∞` bump function strictly positive on `(a, b)` and `0` outside. -/ noncomputable def bumpReal (a b x : ℝ) : ℝ := smoothStep (x - a) * smoothStep (b - x) lemma contDiff_bumpReal (a b : ℝ) : ContDiff ℝ (⊤ : ℕ∞) (bumpReal a b) := by unfold bumpReal exact (contDiff_smoothStep.comp (contDiff_id.sub contDiff_const)).mul (contDiff_smoothStep.comp (contDiff_const.sub contDiff_id)) lemma bumpReal_nonneg (a b x : ℝ) : 0 ≤ bumpReal a b x := by unfold bumpReal have h1 : 0 ≤ smoothStep (x - a) := by by_cases h : x - a ≤ 0 · rw [smoothStep_eq_zero_of_le h] · exact le_of_lt (smoothStep_pos_of_pos (lt_of_not_ge h)) have h2 : 0 ≤ smoothStep (b - x) := by by_cases h : b - x ≤ 0 · rw [smoothStep_eq_zero_of_le h] · exact le_of_lt (smoothStep_pos_of_pos (lt_of_not_ge h)) exact mul_nonneg h1 h2 lemma bumpReal_pos_of_mem_Ioo {a b x : ℝ} (hx : x ∈ Ioo a b) : 0 < bumpReal a b x := mul_pos (smoothStep_pos_of_pos (by linarith [hx.1])) (smoothStep_pos_of_pos (by linarith [hx.2])) lemma bumpReal_eq_zero_of_notMem_Ioo {a b x : ℝ} (hx : x ∉ Ioo a b) : bumpReal a b x = 0 := by unfold bumpReal by_cases h1 : x ≤ a · rw [smoothStep_eq_zero_of_le (show x - a ≤ 0 by linarith), zero_mul] · push Not at h1 have h2 : b ≤ x := by by_contra hlt; push Not at hlt; exact hx ⟨h1, hlt⟩ rw [smoothStep_eq_zero_of_le (show b - x ≤ 0 by linarith), mul_zero] /-- Explicit complex-valued `TestFn` bump function strictly positive on `(a, b)` and `0` outside. -/ noncomputable def bumpTestFn (a b : ℝ) : TestFn where toFun x := (bumpReal a b x : ℂ) smooth := Complex.ofRealCLM.contDiff.comp (contDiff_bumpReal a b) compactSupport := by refine HasCompactSupport.of_support_subset_isCompact (isCompact_Icc (a := a) (b := b)) ?_ intro x hx rw [Function.mem_support] at hx by_contra hnot have hnot_Ioo : x ∉ Ioo a b := fun h => hnot ⟨le_of_lt h.1, le_of_lt h.2⟩ exact hx (by simp [bumpReal_eq_zero_of_notMem_Ioo hnot_Ioo]) lemma tsupport_bumpTestFn_subset (a b : ℝ) : tsupport (bumpTestFn a b) ⊆ Icc a b := by refine closure_minimal (fun x hx => ?_) isClosed_Icc rw [Function.mem_support] at hx by_contra hnot have hnot_Ioo : x ∉ Ioo a b := fun h => hnot ⟨le_of_lt h.1, le_of_lt h.2⟩ exact hx (by simp [bumpTestFn, bumpReal_eq_zero_of_notMem_Ioo hnot_Ioo]) lemma integral_bumpReal_mul_pos {a b : ℝ} (hab : a < b) {w : ℝ → ℝ} (hw_cont : Continuous w) (hw_pos : ∀ x ∈ Ioo a b, 0 < w x) : 0 < ∫ x, bumpReal a b x * w x := by let m := (a + b) / 2 have hm_mem : m ∈ Ioo a b := ⟨by dsimp [m]; linarith, by dsimp [m]; linarith⟩ have hf_cont : Continuous (fun x => bumpReal a b x * w x) := (contDiff_bumpReal a b).continuous.mul hw_cont have hf_int : Integrable (fun x => bumpReal a b x * w x) volume := integrable_of_continuous_of_vanishes_outside_Icc a b hf_cont (fun x hx => by have hnot : x ∉ Ioo a b := fun h => hx ⟨le_of_lt h.1, le_of_lt h.2⟩ simp [bumpReal_eq_zero_of_notMem_Ioo hnot]) have hf_nn : ∀ x, 0 ≤ bumpReal a b x * w x := by intro x by_cases hx : x ∈ Ioo a b · exact mul_nonneg (bumpReal_nonneg a b x) (le_of_lt (hw_pos x hx)) · rw [bumpReal_eq_zero_of_notMem_Ioo hx, zero_mul] have hpos_m : 0 < bumpReal a b m * w m := mul_pos (bumpReal_pos_of_mem_Ioo hm_mem) (hw_pos m hm_mem) obtain ⟨δ, hδ, hball⟩ := Metric.continuousAt_iff.mp hf_cont.continuousAt (bumpReal a b m * w m / 2) (by linarith) have hlow : ∀ x ∈ Icc (m - δ / 2) (m + δ / 2), bumpReal a b m * w m / 2 ≤ bumpReal a b x * w x := by intro x hx have hdist : dist x m < δ := by rw [Real.dist_eq, abs_lt]; constructor <;> linarith [hx.1, hx.2] have hval := hball hdist rw [Real.dist_eq, abs_lt] at hval linarith [hval.1] have hsub : ∫ x in Icc (m - δ / 2) (m + δ / 2), (bumpReal a b m * w m / 2) ≤ ∫ x in Icc (m - δ / 2) (m + δ / 2), bumpReal a b x * w x := MeasureTheory.setIntegral_mono_on (integrableOn_const (by simp)) hf_int.integrableOn measurableSet_Icc hlow have hle : ∫ x in Icc (m - δ / 2) (m + δ / 2), bumpReal a b x * w x ≤ ∫ x, bumpReal a b x * w x := MeasureTheory.setIntegral_le_integral hf_int (Filter.Eventually.of_forall hf_nn) have hconst : ∫ x in Icc (m - δ / 2) (m + δ / 2), (bumpReal a b m * w m / 2) = δ * (bumpReal a b m * w m / 2) := by rw [MeasureTheory.setIntegral_const, smul_eq_mul, Measure.real, Real.volume_Icc] have hdiff : m + δ / 2 - (m - δ / 2) = δ := by ring rw [hdiff, ENNReal.toReal_ofReal (le_of_lt hδ)] have hprod : 0 < δ * (bumpReal a b m * w m / 2) := by positivity linarith /-! ### 2. Local Interior Test Space `V_i = C_c^∞(int I_i)` and Surjective Moment Map -/ /-- `LocalTestSpace a b` is the complex vector subspace `C_c^∞((a, b), ℂ)` of smooth functions with compact support strictly inside `(a, b)` (Section 7 of F04). -/ def LocalTestSpace (a b : ℝ) : Submodule ℂ TestFn where carrier := {φ | tsupport φ ⊆ Ioo a b} add_mem' {f g} hf hg := (tsupport_add (f := f.toFun) (g := g.toFun)).trans (Set.union_subset hf hg) zero_mem' := by show tsupport (0 : ℝ → ℂ) ⊆ Ioo a b; simp [tsupport_zero] smul_mem' c {f} hf := (tsupport_smul_subset_right (fun _ => c) f.toFun).trans hf /-- The global moment linear map `ℓ(φ) = (ℓ^-(φ), ℓ^+(φ)) ∈ ℂ × ℂ`. -/ noncomputable def momentLinearMap : TestFn →ₗ[ℂ] (ℂ × ℂ) where toFun φ := (momentNeg φ, momentPos φ) map_add' f g := Prod.ext (momentNeg_add f g) (momentPos_add f g) map_smul' c f := Prod.ext (momentNeg_smul c f) (momentPos_smul c f) /-- The local moment linear map `ℓ_i : V_i → ℂ × ℂ` restricted to `LocalTestSpace a b`. -/ noncomputable def localMomentMap (a b : ℝ) : LocalTestSpace a b →ₗ[ℂ] (ℂ × ℂ) := momentLinearMap.comp (LocalTestSpace a b).subtype /-- Dual non-degeneracy argument from Section 7 of F04: If `∫ f(u) (α e^{-u/2} + β e^{u/2}) du = 0` for every `f ∈ C_c^∞((a, b))`, then `α = β = 0`. -/ theorem dual_moment_nondegeneracy {a b : ℝ} (hab : a < b) {α β : ℂ} (hvan : ∀ f : LocalTestSpace a b, ∫ u, f.1 u * (α * ((Real.exp (-(u / 2)) : ℝ) : ℂ) + β * ((Real.exp (u / 2) : ℝ) : ℂ)) = 0) : α = 0 ∧ β = 0 := by let g : ℝ → ℂ := fun u => α * ((Real.exp (-(u / 2)) : ℝ) : ℂ) + β * ((Real.exp (u / 2) : ℝ) : ℂ) have hg_cont : Continuous g := by exact (continuous_const.mul (Complex.continuous_ofReal.comp (Real.continuous_exp.comp (continuous_id.div_const 2).neg))).add (continuous_const.mul (Complex.continuous_ofReal.comp (Real.continuous_exp.comp (continuous_id.div_const 2)))) -- First show `g u = 0` for every `u ∈ Ioo a b`. have hg_zero : ∀ u ∈ Ioo a b, g u = 0 := by intro u₀ hu₀ by_contra hne have hpos_sq : 0 < ‖g u₀‖ ^ 2 := sq_pos_of_pos (norm_pos_iff.mpr hne) let h : ℝ → ℝ := fun u => (starRingEnd ℂ (g u₀) * g u).re have hh_cont : Continuous h := Complex.continuous_re.comp (continuous_const.mul hg_cont) have hh_u0 : h u₀ = ‖g u₀‖ ^ 2 := by simp only [h, mul_comm (starRingEnd ℂ (g u₀)), Complex.mul_conj, Complex.normSq_eq_norm_sq, Complex.ofReal_re] obtain ⟨δ₁, hδ₁, hclose⟩ := Metric.continuousAt_iff.mp hh_cont.continuousAt (‖g u₀‖ ^ 2 / 2) (by linarith) set δ := min (δ₁ / 2) (min ((u₀ - a) / 2) ((b - u₀) / 2)) have hδ_pos : 0 < δ := lt_min (by linarith) (lt_min (by linarith [hu₀.1]) (by linarith [hu₀.2])) have hsub_Ioo : Icc (u₀ - δ) (u₀ + δ) ⊆ Ioo a b := by intro x hx have h1 : δ ≤ (u₀ - a) / 2 := le_trans (min_le_right _ _) (min_le_left _ _) have h2 : δ ≤ (b - u₀) / 2 := le_trans (min_le_right _ _) (min_le_right _ _) exact ⟨by linarith [hx.1, hu₀.1], by linarith [hx.2, hu₀.2]⟩ have hφ_mem : (starRingEnd ℂ (g u₀)) • bumpTestFn (u₀ - δ) (u₀ + δ) ∈ LocalTestSpace a b := by refine (tsupport_smul_subset_right (fun _ : ℝ => starRingEnd ℂ (g u₀)) (bumpTestFn (u₀ - δ) (u₀ + δ)).toFun).trans ?_ exact (tsupport_bumpTestFn_subset (u₀ - δ) (u₀ + δ)).trans hsub_Ioo have hzero := hvan ⟨(starRingEnd ℂ (g u₀)) • bumpTestFn (u₀ - δ) (u₀ + δ), hφ_mem⟩ have hre_zero : (∫ u, ((starRingEnd ℂ (g u₀)) • bumpTestFn (u₀ - δ) (u₀ + δ)) u * g u).re = 0 := by rw [hzero, Complex.zero_re] have hint_C : Integrable (fun u => ((starRingEnd ℂ (g u₀)) • bumpTestFn (u₀ - δ) (u₀ + δ)) u * g u) volume := by refine integrable_of_continuous_of_vanishes_outside_Icc (u₀ - δ) (u₀ + δ) (((starRingEnd ℂ (g u₀)) • bumpTestFn (u₀ - δ) (u₀ + δ)).continuous.mul hg_cont) (fun u hu => ?_) have hnot : u ∉ Ioo (u₀ - δ) (u₀ + δ) := fun h => hu ⟨le_of_lt h.1, le_of_lt h.2⟩ simp [bumpTestFn, bumpReal_eq_zero_of_notMem_Ioo hnot] have hre_eq : (∫ u, ((starRingEnd ℂ (g u₀)) • bumpTestFn (u₀ - δ) (u₀ + δ)) u * g u).re = ∫ u, bumpReal (u₀ - δ) (u₀ + δ) u * h u := by change Complex.reCLM (∫ u, _) = _ rw [← Complex.reCLM.integral_comp_comm hint_C] congr 1; ext u change (starRingEnd ℂ (g u₀) * (bumpReal (u₀ - δ) (u₀ + δ) u : ℂ) * g u).re = _ have hrew : starRingEnd ℂ (g u₀) * (bumpReal (u₀ - δ) (u₀ + δ) u : ℂ) * g u = (bumpReal (u₀ - δ) (u₀ + δ) u : ℂ) * (starRingEnd ℂ (g u₀) * g u) := by ring rw [hrew, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] rw [hre_eq] at hre_zero have hh_pos : ∀ x ∈ Ioo (u₀ - δ) (u₀ + δ), 0 < h x := by intro x hx have hδ_le : δ ≤ δ₁ / 2 := min_le_left _ _ have hdist : dist x u₀ < δ₁ := by rw [Real.dist_eq, abs_lt]; constructor <;> linarith [hx.1, hx.2, hδ_le, hδ₁] have hval := hclose hdist rw [Real.dist_eq, abs_lt, hh_u0] at hval linarith [hval.1] have hpos_int := integral_bumpReal_mul_pos (by linarith : u₀ - δ < u₀ + δ) hh_cont hh_pos linarith let u₁ := (2 * a + b) / 3 let u₂ := (a + 2 * b) / 3 have hu₁ : u₁ ∈ Ioo a b := ⟨by dsimp [u₁]; linarith, by dsimp [u₁]; linarith⟩ have hu₂ : u₂ ∈ Ioo a b := ⟨by dsimp [u₂]; linarith, by dsimp [u₂]; linarith⟩ have h1 : α + β * ((Real.exp u₁ : ℝ) : ℂ) = 0 := by have h0 := hg_zero u₁ hu₁ have hmul := congrArg (fun z : ℂ => z * ((Real.exp (u₁ / 2) : ℝ) : ℂ)) h0 simp only [g, zero_mul, add_mul, mul_assoc] at hmul have he1 : ((Real.exp (-(u₁ / 2)) : ℝ) : ℂ) * ((Real.exp (u₁ / 2) : ℝ) : ℂ) = 1 := by rw [← Complex.ofReal_mul, ← Real.exp_add]; simp have he2 : ((Real.exp (u₁ / 2) : ℝ) : ℂ) * ((Real.exp (u₁ / 2) : ℝ) : ℂ) = ((Real.exp u₁ : ℝ) : ℂ) := by rw [← Complex.ofReal_mul, ← Real.exp_add]; congr 2; ring rw [he1, mul_one, he2] at hmul exact hmul have h2 : α + β * ((Real.exp u₂ : ℝ) : ℂ) = 0 := by have h0 := hg_zero u₂ hu₂ have hmul := congrArg (fun z : ℂ => z * ((Real.exp (u₂ / 2) : ℝ) : ℂ)) h0 simp only [g, zero_mul, add_mul, mul_assoc] at hmul have he1 : ((Real.exp (-(u₂ / 2)) : ℝ) : ℂ) * ((Real.exp (u₂ / 2) : ℝ) : ℂ) = 1 := by rw [← Complex.ofReal_mul, ← Real.exp_add]; simp have he2 : ((Real.exp (u₂ / 2) : ℝ) : ℂ) * ((Real.exp (u₂ / 2) : ℝ) : ℂ) = ((Real.exp u₂ : ℝ) : ℂ) := by rw [← Complex.ofReal_mul, ← Real.exp_add]; congr 2; ring rw [he1, mul_one, he2] at hmul exact hmul have hdiff : β * (((Real.exp u₂ - Real.exp u₁ : ℝ) : ℂ)) = 0 := by rw [Complex.ofReal_sub]; linear_combination h2 - h1 have hexp_ne : ((Real.exp u₂ - Real.exp u₁ : ℝ) : ℂ) ≠ 0 := by have hlt : Real.exp u₁ < Real.exp u₂ := Real.exp_lt_exp.mpr (by dsimp [u₁, u₂]; linarith) exact_mod_cast (show Real.exp u₂ - Real.exp u₁ ≠ 0 by linarith) have hβ : β = 0 := (mul_eq_zero.mp hdiff).resolve_right hexp_ne rw [hβ, zero_mul, add_zero] at h1 exact ⟨h1, hβ⟩ /-- Surjectivity of `localMomentMap a b : LocalTestSpace a b →ₗ[ℂ] (ℂ × ℂ)` for any `a < b` (Section 7). -/ theorem localMomentMap_surjective {a b : ℝ} (hab : a < b) : Function.Surjective (localMomentMap a b) := by let δ := (b - a) / 5 have hδ : 0 < δ := by dsimp [δ]; linarith let a₁ := a + δ let b₁ := a + 2 * δ let a₂ := a + 3 * δ let b₂ := a + 4 * δ have hψ₁_mem : bumpTestFn a₁ b₁ ∈ LocalTestSpace a b := (tsupport_bumpTestFn_subset a₁ b₁).trans (fun x hx => ⟨by dsimp [a₁, δ] at hx ⊢; linarith [hx.1], by dsimp [b₁, δ] at hx ⊢; linarith [hx.2]⟩) have hψ₂_mem : bumpTestFn a₂ b₂ ∈ LocalTestSpace a b := (tsupport_bumpTestFn_subset a₂ b₂).trans (fun x hx => ⟨by dsimp [a₂, δ] at hx ⊢; linarith [hx.1], by dsimp [b₂, δ] at hx ⊢; linarith [hx.2]⟩) let ψ₁ : LocalTestSpace a b := ⟨bumpTestFn a₁ b₁, hψ₁_mem⟩ let ψ₂ : LocalTestSpace a b := ⟨bumpTestFn a₂ b₂, hψ₂_mem⟩ let m1_neg := ∫ u, bumpReal a₁ b₁ u * Real.exp (-(u / 2)) let m1_pos := ∫ u, bumpReal a₁ b₁ u * Real.exp (u / 2) let m2_neg := ∫ u, bumpReal a₂ b₂ u * Real.exp (-(u / 2)) let m2_pos := ∫ u, bumpReal a₂ b₂ u * Real.exp (u / 2) have hm1_neg_pos : 0 < m1_neg := integral_bumpReal_mul_pos (by dsimp [a₁, b₁]; linarith) (Real.continuous_exp.comp (continuous_id.div_const 2).neg) (fun _ _ => Real.exp_pos _) have hm2_neg_pos : 0 < m2_neg := integral_bumpReal_mul_pos (by dsimp [a₂, b₂]; linarith) (Real.continuous_exp.comp (continuous_id.div_const 2).neg) (fun _ _ => Real.exp_pos _) have hratio₁ : m1_pos ≤ Real.exp b₁ * m1_neg := by dsimp only [m1_pos, m1_neg] rw [← MeasureTheory.integral_const_mul] refine MeasureTheory.integral_mono ?_ ?_ (fun u => ?_) · exact integrable_of_continuous_of_vanishes_outside_Icc a₁ b₁ ((contDiff_bumpReal a₁ b₁).continuous.mul (Real.continuous_exp.comp (continuous_id.div_const 2))) (fun u hu => by have hnot : u ∉ Ioo a₁ b₁ := fun h => hu ⟨le_of_lt h.1, le_of_lt h.2⟩ simp [bumpReal_eq_zero_of_notMem_Ioo hnot]) · exact (integrable_of_continuous_of_vanishes_outside_Icc a₁ b₁ ((contDiff_bumpReal a₁ b₁).continuous.mul (Real.continuous_exp.comp (continuous_id.div_const 2).neg)) (fun u hu => by have hnot : u ∉ Ioo a₁ b₁ := fun h => hu ⟨le_of_lt h.1, le_of_lt h.2⟩ simp [bumpReal_eq_zero_of_notMem_Ioo hnot])).const_mul (Real.exp b₁) · by_cases hu : u ∈ Ioo a₁ b₁ · have hexp : Real.exp (u / 2) ≤ Real.exp b₁ * Real.exp (-(u / 2)) := by rw [← Real.exp_add]; exact Real.exp_le_exp.mpr (by linarith [hu.2]) have hmul := mul_le_mul_of_nonneg_left hexp (bumpReal_nonneg a₁ b₁ u) linarith · simp [bumpReal_eq_zero_of_notMem_Ioo hu] have hratio₂ : Real.exp a₂ * m2_neg ≤ m2_pos := by dsimp only [m2_pos, m2_neg] rw [← MeasureTheory.integral_const_mul] refine MeasureTheory.integral_mono ?_ ?_ (fun u => ?_) · exact (integrable_of_continuous_of_vanishes_outside_Icc a₂ b₂ ((contDiff_bumpReal a₂ b₂).continuous.mul (Real.continuous_exp.comp (continuous_id.div_const 2).neg)) (fun u hu => by have hnot : u ∉ Ioo a₂ b₂ := fun h => hu ⟨le_of_lt h.1, le_of_lt h.2⟩ simp [bumpReal_eq_zero_of_notMem_Ioo hnot])).const_mul (Real.exp a₂) · exact integrable_of_continuous_of_vanishes_outside_Icc a₂ b₂ ((contDiff_bumpReal a₂ b₂).continuous.mul (Real.continuous_exp.comp (continuous_id.div_const 2))) (fun u hu => by have hnot : u ∉ Ioo a₂ b₂ := fun h => hu ⟨le_of_lt h.1, le_of_lt h.2⟩ simp [bumpReal_eq_zero_of_notMem_Ioo hnot]) · by_cases hu : u ∈ Ioo a₂ b₂ · have hexp : Real.exp a₂ * Real.exp (-(u / 2)) ≤ Real.exp (u / 2) := by rw [← Real.exp_add]; exact Real.exp_le_exp.mpr (by linarith [hu.1]) have hmul := mul_le_mul_of_nonneg_left hexp (bumpReal_nonneg a₂ b₂ u) linarith · simp [bumpReal_eq_zero_of_notMem_Ioo hu] have hdet_pos : 0 < m1_neg * m2_pos - m1_pos * m2_neg := by have hexp_lt : Real.exp b₁ < Real.exp a₂ := Real.exp_lt_exp.mpr (by dsimp [b₁, a₂]; linarith) have h1 : m1_pos * m2_neg ≤ Real.exp b₁ * (m1_neg * m2_neg) := by nlinarith have h2 : Real.exp a₂ * (m1_neg * m2_neg) ≤ m1_neg * m2_pos := by nlinarith have hprod_pos : 0 < m1_neg * m2_neg := mul_pos hm1_neg_pos hm2_neg_pos nlinarith have hdet_ne : ((m1_neg * m2_pos - m1_pos * m2_neg : ℝ) : ℂ) ≠ 0 := by exact_mod_cast (ne_of_gt hdet_pos) have hm1_eq : localMomentMap a b ψ₁ = ((m1_neg : ℂ), (m1_pos : ℂ)) := by ext · change ∫ u, (bumpReal a₁ b₁ u : ℂ) * ((Real.exp (-(u / 2)) : ℝ) : ℂ) = (m1_neg : ℂ) simp_rw [← Complex.ofReal_mul]; exact integral_ofReal · change ∫ u, (bumpReal a₁ b₁ u : ℂ) * ((Real.exp (u / 2) : ℝ) : ℂ) = (m1_pos : ℂ) simp_rw [← Complex.ofReal_mul]; exact integral_ofReal have hm2_eq : localMomentMap a b ψ₂ = ((m2_neg : ℂ), (m2_pos : ℂ)) := by ext · change ∫ u, (bumpReal a₂ b₂ u : ℂ) * ((Real.exp (-(u / 2)) : ℝ) : ℂ) = (m2_neg : ℂ) simp_rw [← Complex.ofReal_mul]; exact integral_ofReal · change ∫ u, (bumpReal a₂ b₂ u : ℂ) * ((Real.exp (u / 2) : ℝ) : ℂ) = (m2_pos : ℂ) simp_rw [← Complex.ofReal_mul]; exact integral_ofReal intro ⟨z₁, z₂⟩ set detC : ℂ := ((m1_neg * m2_pos - m1_pos * m2_neg : ℝ) : ℂ) set c₁ : ℂ := (z₁ * (m2_pos : ℂ) - z₂ * (m2_neg : ℂ)) / detC set c₂ : ℂ := ((m1_neg : ℂ) * z₂ - (m1_pos : ℂ) * z₁) / detC refine ⟨c₁ • ψ₁ + c₂ • ψ₂, ?_⟩ rw [map_add, map_smul, map_smul, hm1_eq, hm2_eq] ext · change c₁ * (m1_neg : ℂ) + c₂ * (m2_neg : ℂ) = z₁ simp only [c₁, c₂] rw [div_mul_eq_mul_div, div_mul_eq_mul_div, ← add_div, div_eq_iff hdet_ne] dsimp only [detC] rw [Complex.ofReal_sub, Complex.ofReal_mul, Complex.ofReal_mul] ring · change c₁ * (m1_pos : ℂ) + c₂ * (m2_pos : ℂ) = z₂ simp only [c₁, c₂] rw [div_mul_eq_mul_div, div_mul_eq_mul_div, ← add_div, div_eq_iff hdet_ne] dsimp only [detC] rw [Complex.ofReal_sub, Complex.ofReal_mul, Complex.ofReal_mul] ring /-! ### 3. Exact Complex Codimension `2r - 2` (Section 7) -/ /-- The direct sum `∏_i V_i` of local interior test spaces on `r` intervals. -/ abbrev MultiWindowSpace {r : ℕ} (a b : Fin r → ℝ) := ∀ i : Fin r, LocalTestSpace (a i) (b i) /-- The all-pieces moment map `L_all : (∏_i V_i) →ₗ[ℂ] (Fin r → ℂ × ℂ)`. -/ noncomputable def allMomentsMap {r : ℕ} (a b : Fin r → ℝ) : MultiWindowSpace a b →ₗ[ℂ] (Fin r → ℂ × ℂ) where toFun φ i := localMomentMap (a i) (b i) (φ i) map_add' f g := by ext i <;> simp [map_add] map_smul' c f := by ext i <;> simp [map_smul] /-- The summation map `S_sum : (Fin r → ℂ × ℂ) →ₗ[ℂ] (ℂ × ℂ)`. -/ noncomputable def sumMomentsMap (r : ℕ) : (Fin r → ℂ × ℂ) →ₗ[ℂ] (ℂ × ℂ) where toFun v := ∑ i : Fin r, v i map_add' u v := Finset.sum_add_distrib map_smul' c v := by simp only [Pi.smul_apply, RingHom.id_apply, ← Finset.smul_sum] /-- Globally balanced space: `{ (φ_i) | ∑_i ℓ_i(φ_i) = (0, 0) }`. -/ noncomputable def GloballyBalanced {r : ℕ} (a b : Fin r → ℝ) : Submodule ℂ (MultiWindowSpace a b) := LinearMap.ker ((sumMomentsMap r).comp (allMomentsMap a b)) /-- Locally balanced space: `{ (φ_i) | ∀ i, ℓ_i(φ_i) = (0, 0) }`. -/ noncomputable def LocallyBalanced {r : ℕ} (a b : Fin r → ℝ) : Submodule ℂ (MultiWindowSpace a b) := LinearMap.ker (allMomentsMap a b) lemma locallyBalanced_le_globallyBalanced {r : ℕ} (a b : Fin r → ℝ) : LocallyBalanced a b ≤ GloballyBalanced a b := by intro φ hφ rw [GloballyBalanced, LinearMap.mem_ker, LinearMap.comp_apply] rw [LocallyBalanced, LinearMap.mem_ker] at hφ rw [hφ, map_zero] /-- **Exact Complex Codimension Theorem (F04 §7)**: For `r ≥ 1` intervals `[a_i, b_i]` of positive length (`a_i < b_i`), the locally balanced subspace has exact complex codimension `2r - 2` inside the globally balanced subspace. -/ theorem local_balance_codimension {r : ℕ} (hr : 1 ≤ r) {a b : Fin r → ℝ} (hpos : ∀ i : Fin r, a i < b i) : Module.finrank ℂ (GloballyBalanced a b ⧸ (LocallyBalanced a b).comap (GloballyBalanced a b).subtype) = 2 * r - 2 := by -- Define `Φ : GloballyBalanced a b →ₗ[ℂ] LinearMap.ker (sumMomentsMap r)` by `φ ↦ L_all φ`. let Φ : GloballyBalanced a b →ₗ[ℂ] LinearMap.ker (sumMomentsMap r) := { toFun := fun φ => ⟨allMomentsMap a b φ.1, φ.2⟩ map_add' := fun f g => Subtype.ext (map_add (allMomentsMap a b) f.1 g.1) map_smul' := fun c f => Subtype.ext (map_smul (allMomentsMap a b) c f.1) } have hΦ_surj : Function.Surjective Φ := by intro ⟨v, hv⟩ have hcoord : ∀ i : Fin r, ∃ φi : LocalTestSpace (a i) (b i), localMomentMap (a i) (b i) φi = v i := fun i => localMomentMap_surjective (hpos i) (v i) choose φ hφ using hcoord have hL : allMomentsMap a b φ = v := by ext i <;> simp [allMomentsMap, hφ i] have hmem : φ ∈ GloballyBalanced a b := by rw [GloballyBalanced, LinearMap.mem_ker, LinearMap.comp_apply, hL] exact hv exact ⟨⟨φ, hmem⟩, Subtype.ext hL⟩ have hΦ_ker : LinearMap.ker Φ = (LocallyBalanced a b).comap (GloballyBalanced a b).subtype := by ext ⟨φ, hφ⟩ simp [Φ, LocallyBalanced, LinearMap.mem_ker, Subtype.ext_iff] have hequiv : (GloballyBalanced a b ⧸ (LocallyBalanced a b).comap (GloballyBalanced a b).subtype) ≃ₗ[ℂ] LinearMap.ker (sumMomentsMap r) := by rw [← hΦ_ker] exact LinearMap.quotKerEquivOfSurjective Φ hΦ_surj rw [LinearEquiv.finrank_eq hequiv] -- Compute `finrank ℂ (ker (sumMomentsMap r)) = 2 * r - 2` by Rank–Nullity. have hsum_surj : Function.Surjective (sumMomentsMap r) := by intro w let i₀ : Fin r := ⟨0, by omega⟩ refine ⟨fun i => if i = i₀ then w else 0, ?_⟩ simp [sumMomentsMap] have hrange : LinearMap.range (sumMomentsMap r) = ⊤ := LinearMap.range_eq_top.mpr hsum_surj have hrn := LinearMap.finrank_range_add_finrank_ker (sumMomentsMap r) rw [hrange, finrank_top] at hrn have hdim_cod : Module.finrank ℂ (ℂ × ℂ) = 2 := by rw [Module.finrank_prod, Module.finrank_self] have hdim_dom : Module.finrank ℂ (Fin r → ℂ × ℂ) = 2 * r := by rw [Module.finrank_pi_fintype, Finset.sum_const, Finset.card_univ, Fintype.card_fin, hdim_cod, smul_eq_mul, mul_comm] rw [hdim_cod, hdim_dom] at hrn omega /-- Each local balanced kernel `ker(ℓ_i)` on `(a, b)` (`a < b`) is infinite-dimensional (F04 §7). -/ theorem local_balanced_infinite_dimensional {a b : ℝ} (hab : a < b) : ¬ FiniteDimensional ℂ (LinearMap.ker (localMomentMap a b)) := by intro hfin set N := Module.finrank ℂ (LinearMap.ker (localMomentMap a b)) + 1 -- Build `N` disjointly supported nonzero balanced elements `diffOp (bumpTestFn x_k y_k)`. let x : Fin N → ℝ := fun k => a + ((3 * (k : ℕ) + 1 : ℕ) : ℝ) * ((b - a) / (3 * N + 1)) let y : Fin N → ℝ := fun k => a + ((3 * (k : ℕ) + 2 : ℕ) : ℝ) * ((b - a) / (3 * N + 1)) have hstep : 0 < (b - a) / (3 * (N : ℝ) + 1) := by positivity have hxy : ∀ k : Fin N, x k < y k := fun k => by simp only [x, y] have hnat : ((3 * (k : ℕ) + 1 : ℕ) : ℝ) < ((3 * (k : ℕ) + 2 : ℕ) : ℝ) := by exact_mod_cast (show 3 * (k : ℕ) + 1 < 3 * (k : ℕ) + 2 by omega) nlinarith [hstep] have hsub : ∀ k : Fin N, Icc (x k) (y k) ⊆ Ioo a b := by intro k u hu have hk : (k : ℕ) < N := k.2 have hk_le : ((3 * (k : ℕ) + 2 : ℕ) : ℝ) < (3 * (N : ℝ) + 1) := by have : 3 * (k : ℕ) + 2 < 3 * N + 1 := by omega exact_mod_cast this have h1 : a < x k := by simp only [x]; nlinarith [hstep, show (0 : ℝ) < ((3 * (k : ℕ) + 1 : ℕ) : ℝ) by positivity] have h2 : y k < b := by simp only [y] have hfrac : ((3 * (k : ℕ) + 2 : ℕ) : ℝ) * ((b - a) / (3 * (N : ℝ) + 1)) < b - a := by rw [mul_div_assoc', div_lt_iff₀ (by positivity)] nlinarith [sub_pos.mpr hab] linarith exact ⟨lt_of_lt_of_le h1 hu.1, lt_of_le_of_lt hu.2 h2⟩ have hdisj : ∀ j k : Fin N, j ≠ k → Disjoint (Icc (x j) (y j)) (Icc (x k) (y k)) := by intro j k hne rw [Set.disjoint_left] intro u huj huk rcases lt_or_gt_of_ne (Fin.val_ne_of_ne hne) with hlt | hgt · have hsep : y j < x k := by simp only [x, y] have hnat : ((3 * (j : ℕ) + 2 : ℕ) : ℝ) < ((3 * (k : ℕ) + 1 : ℕ) : ℝ) := by exact_mod_cast (show 3 * (j : ℕ) + 2 < 3 * (k : ℕ) + 1 by omega) nlinarith [hstep] linarith [huj.2, huk.1] · have hsep : y k < x j := by simp only [x, y] have hnat : ((3 * (k : ℕ) + 2 : ℕ) : ℝ) < ((3 * (j : ℕ) + 1 : ℕ) : ℝ) := by exact_mod_cast (show 3 * (k : ℕ) + 2 < 3 * (j : ℕ) + 1 by omega) nlinarith [hstep] linarith [huk.2, huj.1] -- Show each `diffOp (bumpTestFn (x k) (y k))` is nonzero, supported in `[x k, y k]`, and balanced. have htsupp_diffOp : ∀ k : Fin N, tsupport (diffOp (bumpTestFn (x k) (y k))) ⊆ Icc (x k) (y k) := by intro k have h1 : tsupport (diffOp (bumpTestFn (x k) (y k))) ⊆ tsupport (deriv (deriv (bumpTestFn (x k) (y k)).toFun)) ∪ tsupport (fun u => ((1 / 4 : ℝ) : ℂ) * (bumpTestFn (x k) (y k)).toFun u) := tsupport_sub (deriv (deriv (bumpTestFn (x k) (y k)).toFun)) (fun u => ((1 / 4 : ℝ) : ℂ) * (bumpTestFn (x k) (y k)).toFun u) refine h1.trans (Set.union_subset ?_ ?_) · refine subset_trans ?_ (tsupport_bumpTestFn_subset (x k) (y k)) refine subset_trans (tsupport_deriv_subset (f := deriv (bumpTestFn (x k) (y k)).toFun)) (tsupport_deriv_subset (f := (bumpTestFn (x k) (y k)).toFun)) · exact (tsupport_smul_subset_right (fun _ : ℝ => ((1 / 4 : ℝ) : ℂ)) _).trans (tsupport_bumpTestFn_subset (x k) (y k)) have hne_zero : ∀ k : Fin N, diffOp (bumpTestFn (x k) (y k)) ≠ 0 := by intro k hzero set ψ := bumpTestFn (x k) (y k) set g := bumpReal (x k) (y k) have hg_smooth : ContDiff ℝ (⊤ : ℕ∞) g := contDiff_bumpReal (x k) (y k) have hg_d1 : ContDiff ℝ (⊤ : ℕ∞) (deriv g) := (contDiff_infty_iff_deriv.mp hg_smooth).2 have hg_d2 : ContDiff ℝ (⊤ : ℕ∞) (deriv (deriv g)) := (contDiff_infty_iff_deriv.mp hg_d1).2 have hode : ∀ u, deriv (deriv g) u - (1 / 4 : ℝ) * g u = 0 := by intro u have h0u := congrArg (fun f : TestFn => (f u).re) hzero have hd1_eq : ∀ t, deriv ψ.toFun t = ((deriv g t : ℝ) : ℂ) := by intro t have hd : HasDerivAt (fun s => (g s : ℂ)) ((deriv g t : ℝ) : ℂ) t := (hg_smooth.differentiable (by simp) t).hasDerivAt.ofReal_comp exact hd.deriv have hd2_eq : deriv (deriv ψ.toFun) u = ((deriv (deriv g) u : ℝ) : ℂ) := by have hfun : deriv ψ.toFun = fun t => ((deriv g t : ℝ) : ℂ) := funext hd1_eq rw [hfun] have hd : HasDerivAt (fun s => ((deriv g s : ℝ) : ℂ)) ((deriv (deriv g) u : ℝ) : ℂ) u := (hg_d1.differentiable (by simp) u).hasDerivAt.ofReal_comp exact hd.deriv change (deriv (deriv ψ.toFun) u - ((1 / 4 : ℝ) : ℂ) * ψ.toFun u).re = 0 at h0u rw [hd2_eq] at h0u change (((deriv (deriv g) u : ℝ) : ℂ) - ((1 / 4 : ℝ) : ℂ) * ((g u : ℝ) : ℂ)).re = 0 at h0u rw [← Complex.ofReal_mul, ← Complex.ofReal_sub, Complex.ofReal_re] at h0u exact h0u set A := x k - 1 set B := y k + 1 have hAB : A ≤ B := by linarith [hxy k] have hg_out : ∀ u, u ∉ Ioo (x k) (y k) → g u = 0 := fun u hu => bumpReal_eq_zero_of_notMem_Ioo hu have hdg_out : ∀ u, u ∉ Icc (x k) (y k) → deriv g u = 0 := by intro u hu have hev : g =ᶠ[𝓝 u] (fun _ => (0 : ℝ)) := by filter_upwards [isClosed_Icc.isOpen_compl.mem_nhds hu] with t ht exact hg_out t (fun h => ht ⟨le_of_lt h.1, le_of_lt h.2⟩) rw [hev.deriv_eq, deriv_const] have hgA : g A = 0 := hg_out A (fun h => by linarith [h.1]) have hgB : g B = 0 := hg_out B (fun h => by linarith [h.2]) have hdgA : deriv g A = 0 := hdg_out A (fun h => by linarith [h.1]) have hdgB : deriv g B = 0 := hdg_out B (fun h => by linarith [h.2]) have hibp := intervalIntegral_mul_deriv_eq_deriv_mul_of_hasDerivAt (a := A) (b := B) (u := g) (v := deriv g) (u' := deriv g) (v' := deriv (deriv g)) (fun t _ => (hg_smooth.differentiable (by simp) t).hasDerivAt) (fun t _ => (hg_d1.differentiable (by simp) t).hasDerivAt) (hg_d1.continuous.intervalIntegrable A B) (hg_d2.continuous.intervalIntegrable A B) rw [hgA, hgB, zero_mul, zero_mul, sub_self, zero_sub] at hibp have heq_int : ∫ t in A..B, g t * deriv (deriv g) t = (1 / 4 : ℝ) * ∫ t in A..B, g t ^ 2 := by rw [← intervalIntegral.integral_const_mul] refine intervalIntegral.integral_congr (fun t _ => ?_) have ht := hode t have : deriv (deriv g) t = (1 / 4 : ℝ) * g t := by linarith rw [this]; ring have hnn1 : 0 ≤ ∫ t in A..B, deriv g t * deriv g t := intervalIntegral.integral_nonneg hAB (fun t _ => mul_self_nonneg _) have hpos_sq : 0 < ∫ t in A..B, g t ^ 2 := by rw [← integral_eq_intervalIntegral_of_vanishes_outside_Icc hAB (fun t ht => by have hnot : t ∉ Ioo (x k) (y k) := fun h => ht ⟨by linarith [h.1], by linarith [h.2]⟩ simp [g, bumpReal_eq_zero_of_notMem_Ioo hnot])] have heq_sq : (fun t => g t ^ 2) = fun t => bumpReal (x k) (y k) t * bumpReal (x k) (y k) t := by ext t; ring rw [heq_sq] exact integral_bumpReal_mul_pos (hxy k) (contDiff_bumpReal (x k) (y k)).continuous (fun t ht => bumpReal_pos_of_mem_Ioo ht) linarith -- Package as `v : Fin N → LinearMap.ker (localMomentMap a b)` and prove `LinearIndependent ℂ v`. let v : Fin N → LinearMap.ker (localMomentMap a b) := fun k => ⟨⟨diffOp (bumpTestFn (x k) (y k)), (htsupp_diffOp k).trans (hsub k)⟩, by rw [LinearMap.mem_ker] exact Prod.ext (isBalanced_diffOp _).1 (isBalanced_diffOp _).2⟩ have hli : LinearIndependent ℂ v := by rw [Fintype.linearIndependent_iff] intro c hc k by_contra hck have hne_k := hne_zero k have hex : ∃ u, diffOp (bumpTestFn (x k) (y k)) u ≠ 0 := by by_contra hall; push Not at hall; exact hne_k (TestFn.ext hall) obtain ⟨u, hu⟩ := hex have hu_mem : u ∈ Icc (x k) (y k) := htsupp_diffOp k (subset_tsupport _ (Function.mem_support.mpr hu)) have hval := congrArg (fun z : LinearMap.ker (localMomentMap a b) => z.1.1 u) hc have hsum_u : (∑ j : Fin N, c j • v j).1.1 u = ∑ j : Fin N, c j * diffOp (bumpTestFn (x j) (y j)) u := by have hsub_sum : (∑ j : Fin N, c j • v j).1.1 = ∑ j : Fin N, c j • diffOp (bumpTestFn (x j) (y j)) := by simp [v] rw [hsub_sum, TestFn.finset_sum_apply] rfl rw [hsum_u] at hval have hother : ∀ j : Fin N, j ≠ k → diffOp (bumpTestFn (x j) (y j)) u = 0 := by intro j hne by_contra hnz have huj : u ∈ Icc (x j) (y j) := htsupp_diffOp j (subset_tsupport _ (Function.mem_support.mpr hnz)) exact Set.disjoint_left.mp (hdisj j k hne) huj hu_mem rw [Finset.sum_eq_single k (fun j _ hne => by simp [hother j hne]) (by simp)] at hval have hzero_rhs : (0 : LinearMap.ker (localMomentMap a b)).1.1 u = 0 := rfl rw [hzero_rhs] at hval exact mul_ne_zero hck hu hval have hcard_le := hli.fintype_card_le_finrank rw [Fintype.card_fin] at hcard_le omega /-- Uniqueness of decomposition on pairwise disjoint intervals (Section 7 of F04). -/ theorem disjoint_sum_unique {r : ℕ} {a b : Fin r → ℝ} (hdisj : ∀ i j : Fin r, i ≠ j → Disjoint (Icc (a i) (b i)) (Icc (a j) (b j))) {φ ψ : Fin r → TestFn} (hφ : ∀ i, SupportedIn (φ i) (a i) (b i)) (hψ : ∀ i, SupportedIn (ψ i) (a i) (b i)) (heq : ∑ i : Fin r, φ i = ∑ i : Fin r, ψ i) : ∀ i : Fin r, φ i = ψ i := by intro i ext u by_cases hu : u ∈ Icc (a i) (b i) · have hval := congrArg (fun f : TestFn => f u) heq rw [TestFn.finset_sum_apply, TestFn.finset_sum_apply] at hval have hother_φ : ∀ j : Fin r, j ≠ i → φ j u = 0 := fun j hne => hφ j u (fun hm => Set.disjoint_left.mp (hdisj j i hne) hm hu) have hother_ψ : ∀ j : Fin r, j ≠ i → ψ j u = 0 := fun j hne => hψ j u (fun hm => Set.disjoint_left.mp (hdisj j i hne) hm hu) rw [Finset.sum_eq_single i (fun j _ hne => hother_φ j hne) (by simp), Finset.sum_eq_single i (fun j _ hne => hother_ψ j hne) (by simp)] at hval exact hval · rw [hφ i u hu, hψ i u hu] /-! ### 4. Exact Cutoff Reconstruction Identity (Section 7, eq. (14)) -/ /-- Pointwise product of a smooth cutoff function `χ : ℝ → ℂ` with a compactly supported `ψ : TestFn`. -/ def mulCutoff (χ : ℝ → ℂ) (hχ : ContDiff ℝ (⊤ : ℕ∞) χ) (ψ : TestFn) : TestFn where toFun u := χ u * ψ u smooth := hχ.mul ψ.smooth compactSupport := ψ.compactSupport.mul_left /-- **Exact cutoff product-rule identity (F04 §7, eq. (14))**: `(∂² - 1/4)(χ ψ) = χ (T ψ) + 2 χ' ψ' + χ'' ψ` pointwise everywhere on `ℝ`. -/ theorem cutoff_product_rule (χ : ℝ → ℂ) (hχ : ContDiff ℝ (⊤ : ℕ∞) χ) (ψ : TestFn) (u : ℝ) : diffOp (mulCutoff χ hχ ψ) u = χ u * diffOp ψ u + 2 * deriv χ u * deriv ψ u + deriv (deriv χ) u * ψ u := by have hχ_d1 : ContDiff ℝ (⊤ : ℕ∞) (deriv χ) := (contDiff_infty_iff_deriv.mp hχ).2 have h1 : deriv (mulCutoff χ hχ ψ).toFun = fun t => deriv χ t * ψ t + χ t * deriv ψ t := by ext t have hd := ((hχ.differentiable (by simp) t).hasDerivAt).mul (ψ.differentiable t).hasDerivAt exact hd.deriv have h2 : deriv (deriv (mulCutoff χ hχ ψ).toFun) u = deriv (deriv χ) u * ψ u + 2 * deriv χ u * deriv ψ u + χ u * deriv (deriv ψ) u := by rw [h1] have hd_a := ((hχ_d1.differentiable (by simp) u).hasDerivAt).mul (ψ.differentiable u).hasDerivAt have hd_b := ((hχ.differentiable (by simp) u).hasDerivAt).mul (ψ.contDiff_deriv.differentiable (by simp) u).hasDerivAt have hd : HasDerivAt (fun t => deriv χ t * ψ t + χ t * deriv ψ t) ((deriv (deriv χ) u * ψ u + deriv χ u * deriv ψ u) + (deriv χ u * deriv ψ u + χ u * deriv (deriv ψ) u)) u := hd_a.add hd_b rw [hd.deriv] ring change deriv (deriv (mulCutoff χ hχ ψ).toFun) u - ((1 / 4 : ℝ) : ℂ) * (χ u * ψ u) = _ rw [h2] simp only [diffOp] ring /-- **Cutoff reconstruction theorem (F04 §7)**: Given `ψ : TestFn` and smooth cutoffs `χ₁, ..., χ_r` summing to `1` on an open neighborhood `U` of `tsupport ψ`, each `f_i = (∂² - 1/4)(χ_i ψ)` individually satisfies both balance conditions (1), obeys eq. (14), and satisfies `∑_i f_i = (∂² - 1/4) ψ` globally on `ℝ`. -/ theorem cutoff_reconstruction_sum {r : ℕ} (χ : Fin r → ℝ → ℂ) (hχ : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (χ i)) (ψ : TestFn) {U : Set ℝ} (hU_open : IsOpen U) (hU_sub : tsupport ψ ⊆ U) (hsum_one : ∀ u ∈ U, ∑ i : Fin r, χ i u = 1) : (∀ i, IsBalanced (diffOp (mulCutoff (χ i) (hχ i) ψ))) ∧ (∑ i : Fin r, diffOp (mulCutoff (χ i) (hχ i) ψ) = diffOp ψ) := by refine ⟨fun i => isBalanced_diffOp _, ?_⟩ ext u rw [TestFn.finset_sum_apply] simp_rw [cutoff_product_rule] by_cases hu : u ∈ U · have hev : (fun t => ∑ i : Fin r, χ i t) =ᶠ[𝓝 u] (fun _ => (1 : ℂ)) := by filter_upwards [hU_open.mem_nhds hu] with t ht exact hsum_one t ht have hderiv_sum_eq : deriv (fun t => ∑ i : Fin r, χ i t) = fun t => ∑ i : Fin r, deriv (χ i) t := by ext t have hd : HasDerivAt (fun s => ∑ i : Fin r, χ i s) (∑ i : Fin r, deriv (χ i) t) t := HasDerivAt.fun_sum (fun i _ => (hχ i).differentiable (by simp) t |>.hasDerivAt) exact hd.deriv have hd1_zero : ∑ i : Fin r, deriv (χ i) u = 0 := by have h0 : deriv (fun t => ∑ i : Fin r, χ i t) u = 0 := by rw [hev.deriv_eq, deriv_const] rw [hderiv_sum_eq] at h0 exact h0 have hev_d1 : (fun t => ∑ i : Fin r, deriv (χ i) t) =ᶠ[𝓝 u] (fun _ => (0 : ℂ)) := by filter_upwards [hU_open.mem_nhds hu] with t ht have hev_t : (fun s => ∑ i : Fin r, χ i s) =ᶠ[𝓝 t] (fun _ => (1 : ℂ)) := by filter_upwards [hU_open.mem_nhds ht] with s hs exact hsum_one s hs have h0 : deriv (fun s => ∑ i : Fin r, χ i s) t = 0 := by rw [hev_t.deriv_eq, deriv_const] rw [hderiv_sum_eq] at h0 exact h0 have hd2_zero : ∑ i : Fin r, deriv (deriv (χ i)) u = 0 := by have hd : HasDerivAt (fun s => ∑ i : Fin r, deriv (χ i) s) (∑ i : Fin r, deriv (deriv (χ i)) u) u := HasDerivAt.fun_sum (fun i _ => ((contDiff_infty_iff_deriv.mp (hχ i)).2.differentiable (by simp) u).hasDerivAt) rw [← hd.deriv, hev_d1.deriv_eq, deriv_const] have hsplit : ∑ i : Fin r, (χ i u * diffOp ψ u + 2 * deriv (χ i) u * deriv ψ u + deriv (deriv (χ i)) u * ψ u) = (∑ i : Fin r, χ i u) * diffOp ψ u + 2 * (∑ i : Fin r, deriv (χ i) u) * deriv ψ u + (∑ i : Fin r, deriv (deriv (χ i)) u) * ψ u := by simp only [Finset.sum_add_distrib, Finset.sum_mul, Finset.mul_sum, mul_assoc] rw [hsplit, hsum_one u hu, hd1_zero, hd2_zero] ring · have hnot_tsupp : u ∉ tsupport ψ := fun h => hu (hU_sub h) have hopen_compl : IsOpen ((tsupport ψ)ᶜ) := (isClosed_tsupport (f := ψ.toFun)).isOpen_compl have hev_ψ : ψ.toFun =ᶠ[𝓝 u] (fun _ => (0 : ℂ)) := by filter_upwards [hopen_compl.mem_nhds hnot_tsupp] with t ht by_contra hne exact ht (subset_tsupport _ (Function.mem_support.mpr hne)) have hψ_u : ψ u = 0 := hev_ψ.self_of_nhds have hdψ_u : deriv ψ u = 0 := by rw [hev_ψ.deriv_eq, deriv_const] have hev_dψ : deriv ψ.toFun =ᶠ[𝓝 u] (fun _ => (0 : ℂ)) := by filter_upwards [hopen_compl.mem_nhds hnot_tsupp] with t ht have hev_t : ψ.toFun =ᶠ[𝓝 t] (fun _ => (0 : ℂ)) := by filter_upwards [hopen_compl.mem_nhds ht] with s hs by_contra hne exact hs (subset_tsupport _ (Function.mem_support.mpr hne)) rw [hev_t.deriv_eq, deriv_const] have hd2ψ_u : deriv (deriv ψ) u = 0 := by rw [hev_dψ.deriv_eq, deriv_const] have hdiff_u : diffOp ψ u = 0 := by simp [diffOp, hd2ψ_u, hψ_u] simp [hdiff_u, hdψ_u, hψ_u] end F04Riemann