import F02NavierStokes.LinearAlgebra3D import F02NavierStokes.PhysicalCarrierS13 import F02NavierStokes.SignedShellAndEquivalence import Mathlib.Analysis.Calculus.Deriv.Inv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Tactic.FinCases import Mathlib.Tactic.Linarith import Mathlib.Tactic.Positivity import Mathlib.Tactic.Ring import Mathlib.Tactic.FieldSimp /-! # Sphere Inversion, Kelvin Itô Involution, Reciprocal Stretch, Spin Eversion, # and Exact Upper/Lower-Bound Inversion Formalizes the complete linked-calculations sphere-inversion and upper/lower-bound inversion suite from Paul Cooper's F02 / ESM3 / signed-eversion-inversion archives: - `SPHERE_INVERSION.md` (`SI1`--`SI25`) & `check_sphere_stereographic.py` (4,352 rational checks), - `RECIPROCAL_STRETCH_CHECK.md` (`RS1`--`RS3`) & `check_sphere_inversion.py` (4,544 rational checks), - `UPPER_BOUND_PDE.md` (`UP1`--`UP8`, `Lemma UP-A`), - `COMBINED_CALCULATION.txt` (`EI5`--`EI23`), `INVERSION_REVIEW.txt` (`IR1`--`IR15`), `EVERSION_REVIEW.txt` (`E14`--`E16`), - `01-research_checkpoint.tex` (`prop:breakdown-signed-signature`, `eq:breakdown-signed-lower`). -/ namespace F02NavierStokes.SphereInversionBounds open scoped Matrix BigOperators open Matrix F02NavierStokes.LinearAlgebra3D F02NavierStokes.PhysicalCarrierS13 noncomputable section /-! ## Helper bilinear identities for `dotN` and `sqNormN` -/ section VecHelpers variable {d : ℕ} theorem dotN_comm (x y : Fin d → ℝ) : dotN x y = dotN y x := by simp only [dotN, mul_comm] theorem sqNormN_nonneg (x : Fin d → ℝ) : 0 ≤ sqNormN x := Finset.sum_nonneg fun i _ => sq_nonneg (x i) theorem dotN_scale_left (c : ℝ) (x y : Fin d → ℝ) : dotN (fun i => c * x i) y = c * dotN x y := by simp only [dotN, Finset.mul_sum] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_scale_right (c : ℝ) (x y : Fin d → ℝ) : dotN x (fun i => c * y i) = c * dotN x y := by simp only [dotN, Finset.mul_sum] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_div_left (c : ℝ) (x y : Fin d → ℝ) : dotN (fun i => x i / c) y = dotN x y / c := by simp only [dotN, Finset.sum_div] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_div_right (c : ℝ) (x y : Fin d → ℝ) : dotN x (fun i => y i / c) = dotN x y / c := by simp only [dotN, Finset.sum_div] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_add_left (x y z : Fin d → ℝ) : dotN (fun i => x i + y i) z = dotN x z + dotN y z := by simp only [dotN, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_sub_left (x y z : Fin d → ℝ) : dotN (fun i => x i - y i) z = dotN x z - dotN y z := by simp only [dotN, ← Finset.sum_sub_distrib] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_add_right (x y z : Fin d → ℝ) : dotN x (fun i => y i + z i) = dotN x y + dotN x z := by simp only [dotN, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl; intro i _; ring theorem dotN_sub_right (x y z : Fin d → ℝ) : dotN x (fun i => y i - z i) = dotN x y - dotN x z := by simp only [dotN, ← Finset.sum_sub_distrib] apply Finset.sum_congr rfl; intro i _; ring theorem sqNormN_scale (c : ℝ) (x : Fin d → ℝ) : sqNormN (fun i => c * x i) = c ^ 2 * sqNormN x := by simp only [sqNormN, Finset.mul_sum] apply Finset.sum_congr rfl; intro i _; ring theorem sqNormN_div (c : ℝ) (x : Fin d → ℝ) : sqNormN (fun i => x i / c) = sqNormN x / c ^ 2 := by simp only [sqNormN, Finset.sum_div] apply Finset.sum_congr rfl; intro i _; ring theorem sqNormN_lincomb (a b : ℝ) (x y : Fin d → ℝ) : sqNormN (fun i => a * x i + b * y i) = a ^ 2 * sqNormN x + 2 * a * b * dotN x y + b ^ 2 * sqNormN y := by simp only [sqNormN, dotN, Finset.mul_sum] rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl; intro i _; ring end VecHelpers /-! ## 1. 13D Complementary Stereographic Bounds at Lower & Upper Boundaries (`SI1`--`SI7`, `SI19`, `SI23`) -/ section StereographicBounds variable {d : ℕ} /-- North-chart inverse decoder `x = 2 u / (|u|² - 1)` (`SI6`). -/ def stereoNorthDecode (u : Fin d → ℝ) : Fin d → ℝ := fun i => 2 * u i / (sqNormN u - 1) theorem sqNormN_stereoSouth (x : Fin d → ℝ) (Λ : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hLp : Λ + 1 ≠ 0) : sqNormN (stereoSouth x Λ) = (Λ - 1) / (Λ + 1) := by unfold stereoSouth rw [sqNormN_div] have hxsq : sqNormN x = (Λ - 1) * (Λ + 1) := by nlinarith rw [hxsq] field_simp [hLp] theorem sqNormN_stereoNorth (x : Fin d → ℝ) (Λ : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hLm : Λ - 1 ≠ 0) : sqNormN (stereoNorth x Λ) = (Λ + 1) / (Λ - 1) := by unfold stereoNorth rw [sqNormN_div] have hxsq : sqNormN x = (Λ - 1) * (Λ + 1) := by nlinarith rw [hxsq] field_simp [hLm] /-- Exact complementary stereographic bounds and decoders on the physical spin-plus-anchor image `Λ² = 1 + |x|²`, `Λ ≥ √2` (`SI1`--`SI7`): - Lower physical floor (`Λ ≥ √2`) forces `√2 - 1 ≤ |v|` and `|u| ≤ √2 + 1`. - Upper growth boundary (`Λ → ∞`, `a = 1/Λ ↓ 0`) forces `|v| < 1 < |u|`. - Both charts decode `Λ`, `a = 1/Λ`, and `x` identically and invert into each other. -/ theorem stereo_chart_bounds_and_decoders (x : Fin d → ℝ) (Λ : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛge : Real.sqrt 2 ≤ Λ) : let v := stereoSouth x Λ let u := stereoNorth x Λ sqNormN v = (Λ - 1) / (Λ + 1) ∧ sqNormN u = (Λ + 1) / (Λ - 1) ∧ (Real.sqrt 2 - 1 ≤ Real.sqrt (sqNormN v) ∧ Real.sqrt (sqNormN v) < 1) ∧ (1 < Real.sqrt (sqNormN u) ∧ Real.sqrt (sqNormN u) ≤ Real.sqrt 2 + 1) ∧ (1 + sqNormN v) / (1 - sqNormN v) = Λ ∧ (1 - sqNormN v) / (1 + sqNormN v) = 1 / Λ ∧ (1 + sqNormN u) / (sqNormN u - 1) = Λ ∧ (sqNormN u - 1) / (1 + sqNormN u) = 1 / Λ ∧ stereoDecode v = x ∧ stereoNorthDecode u = x ∧ sphereInv v = u ∧ sphereInv u = v := by intro v u have hsq2_pos : (0 : ℝ) < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num) have hsq2_sq : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num) have hsq2_gt1 : (1 : ℝ) < Real.sqrt 2 := by nlinarith have hΛgt : 1 < Λ := lt_of_lt_of_le hsq2_gt1 hΛge have hΛpos : 0 < Λ := by linarith have hLp : 0 < Λ + 1 := by linarith have hLm : 0 < Λ - 1 := by linarith have hvsq : sqNormN v = (Λ - 1) / (Λ + 1) := sqNormN_stereoSouth x Λ hΛsq (ne_of_gt hLp) have husq : sqNormN u = (Λ + 1) / (Λ - 1) := sqNormN_stereoNorth x Λ hΛsq (ne_of_gt hLm) have hv_lb_sq : (Real.sqrt 2 - 1) ^ 2 ≤ sqNormN v := by rw [hvsq, le_div_iff₀ hLp] have hdiff : (Λ - 1) - (Real.sqrt 2 - 1) ^ 2 * (Λ + 1) = (Λ - Real.sqrt 2) * (2 * Real.sqrt 2 - 2) := by nlinarith [hsq2_sq] nlinarith [hdiff, hΛge, hsq2_gt1] have hv_ub_sq : sqNormN v < 1 := by rw [hvsq, div_lt_one hLp]; linarith have hu_lb_sq : 1 < sqNormN u := by rw [husq, one_lt_div hLm]; linarith have hu_ub_sq : sqNormN u ≤ (Real.sqrt 2 + 1) ^ 2 := by rw [husq, div_le_iff₀ hLm] have hdiff : (Real.sqrt 2 + 1) ^ 2 * (Λ - 1) - (Λ + 1) = (Λ - Real.sqrt 2) * (2 * Real.sqrt 2 + 2) := by nlinarith [hsq2_sq] nlinarith [hdiff, hΛge, hsq2_pos] have hv_bounds : Real.sqrt 2 - 1 ≤ Real.sqrt (sqNormN v) ∧ Real.sqrt (sqNormN v) < 1 := by refine ⟨?_, ?_⟩ · calc Real.sqrt 2 - 1 = Real.sqrt ((Real.sqrt 2 - 1) ^ 2) := (Real.sqrt_sq (by linarith)).symm _ ≤ Real.sqrt (sqNormN v) := Real.sqrt_le_sqrt hv_lb_sq · calc Real.sqrt (sqNormN v) < Real.sqrt 1 := Real.sqrt_lt_sqrt (sqNormN_nonneg v) hv_ub_sq _ = 1 := Real.sqrt_one have hu_bounds : 1 < Real.sqrt (sqNormN u) ∧ Real.sqrt (sqNormN u) ≤ Real.sqrt 2 + 1 := by refine ⟨?_, ?_⟩ · calc (1 : ℝ) = Real.sqrt 1 := Real.sqrt_one.symm _ < Real.sqrt (sqNormN u) := Real.sqrt_lt_sqrt (by norm_num) hu_lb_sq · calc Real.sqrt (sqNormN u) ≤ Real.sqrt ((Real.sqrt 2 + 1) ^ 2) := Real.sqrt_le_sqrt hu_ub_sq _ = Real.sqrt 2 + 1 := Real.sqrt_sq (by linarith) have hinv := stereo_involution_and_decode x Λ hΛsq hΛgt refine ⟨hvsq, husq, hv_bounds, hu_bounds, ?_, ?_, ?_, ?_, hinv.2.2, ?_, hinv.1, hinv.2.1⟩ · rw [hvsq]; field_simp [ne_of_gt hLp]; ring · rw [hvsq]; field_simp [ne_of_gt hLp, ne_of_gt hΛpos]; ring · rw [husq]; field_simp [ne_of_gt hLm]; ring · rw [husq]; field_simp [ne_of_gt hLm, ne_of_gt hΛpos]; ring · funext i simp only [stereoNorthDecode, u, stereoNorth, husq] have hden : (Λ + 1) / (Λ - 1) - 1 = 2 / (Λ - 1) := by field_simp [ne_of_gt hLm]; ring rw [hden]; field_simp [ne_of_gt hLm] /-- Exact physical spin-block norm identity in both stereographic charts (`check_sphere_stereographic.py` line 34): if a unit spin vector `q` (`sqNormN q = 1`) is embedded in `x` and scaled by `1/(Λ ± 1)`, then `|v_spin|² = (1 - |v|²)² / 4` and `|u_spin|² = (|u|² - 1)² / 4`. -/ theorem stereo_spin_block_norm_identity {k : ℕ} (q : Fin k → ℝ) (x : Fin d → ℝ) (Λ : ℝ) (hq : sqNormN q = 1) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛgt : 1 < Λ) : let v := stereoSouth x Λ let u := stereoNorth x Λ sqNormN (fun i => q i / (Λ + 1)) = (1 - sqNormN v) ^ 2 / 4 ∧ sqNormN (fun i => q i / (Λ - 1)) = (sqNormN u - 1) ^ 2 / 4 := by intro v u have hLp : Λ + 1 ≠ 0 := by linarith have hLm : Λ - 1 ≠ 0 := by linarith have hvsq : sqNormN v = (Λ - 1) / (Λ + 1) := sqNormN_stereoSouth x Λ hΛsq hLp have husq : sqNormN u = (Λ + 1) / (Λ - 1) := sqNormN_stereoNorth x Λ hΛsq hLm constructor · rw [sqNormN_div, hq, hvsq]; field_simp [hLp]; ring · rw [sqNormN_div, hq, husq]; field_simp [hLm]; ring /-- Exact upper-growth boundary equivalence (`SI5`--`SI7`, `IR1`): a physical amplitude ceiling `Λ ≤ M` (`M > 1`) is strictly equivalent to a quantitative positive margin separating `|v|²` below `1` (`1 - |v|² ≥ 2/(M+1)`) and separating `|u|²` above `1` (`|u|² - 1 ≥ 2/(M-1)`). -/ theorem stereo_upper_growth_equivalence (x : Fin d → ℝ) (Λ M : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛgt : 1 < Λ) (hMgt : 1 < M) : let v := stereoSouth x Λ let u := stereoNorth x Λ (1 - sqNormN v = 2 / (Λ + 1)) ∧ (sqNormN u - 1 = 2 / (Λ - 1)) ∧ (Λ ≤ M ↔ 2 / (M + 1) ≤ 1 - sqNormN v) ∧ (Λ ≤ M ↔ 2 / (M - 1) ≤ sqNormN u - 1) := by intro v u have hLp : 0 < Λ + 1 := by linarith have hLm : 0 < Λ - 1 := by linarith have hMp : 0 < M + 1 := by linarith have hMm : 0 < M - 1 := by linarith have hvsq : sqNormN v = (Λ - 1) / (Λ + 1) := sqNormN_stereoSouth x Λ hΛsq (ne_of_gt hLp) have husq : sqNormN u = (Λ + 1) / (Λ - 1) := sqNormN_stereoNorth x Λ hΛsq (ne_of_gt hLm) have hdv : 1 - sqNormN v = 2 / (Λ + 1) := by rw [hvsq]; field_simp [ne_of_gt hLp]; ring have hdu : sqNormN u - 1 = 2 / (Λ - 1) := by rw [husq]; field_simp [ne_of_gt hLm]; ring refine ⟨hdv, hdu, ?_, ?_⟩ · rw [hdv, div_le_div_iff₀ hMp hLp] constructor <;> intro h <;> linarith · rw [hdu, div_le_div_iff₀ hMm hLm] constructor <;> intro h <;> linarith /-- Resolved reciprocal-stretch representation of both stereographic denominators (`SI19`, `SI23`): on `ρ > 0`, `σ = ρ⁻¹`, `C ≥ 2` (`C = 2 + |w|² + ψ²`), `Λ = √(1 + C σ²) / σ`, we have `Λ² - ρ² = C`, `Λ > 1`, `1/(Λ + 1) = σ / (√(1 + C σ²) + σ)`, and `1/(Λ - 1) = σ / (√(1 + C σ²) - σ)`. -/ theorem stereo_resolved_reciprocal_stretch (ρ C : ℝ) (hρ : 0 < ρ) (hC : 2 ≤ C) : let σ := ρ⁻¹ let r := Real.sqrt (1 + C * σ ^ 2) let Λ := r / σ Λ ^ 2 - ρ ^ 2 = C ∧ 1 < Λ ∧ 1 / (Λ + 1) = σ / (r + σ) ∧ 1 / (Λ - 1) = σ / (r - σ) := by intro σ r Λ have hσ : 0 < σ := inv_pos.mpr hρ have h1C : 0 < 1 + C * σ ^ 2 := by nlinarith [sq_nonneg σ] have hr_sq : r ^ 2 = 1 + C * σ ^ 2 := Real.sq_sqrt (le_of_lt h1C) have hr_pos : 0 < r := Real.sqrt_pos.mpr h1C have hσ_lt_r : σ < r := by have hsq : σ ^ 2 < r ^ 2 := by rw [hr_sq]; nlinarith [sq_nonneg σ] nlinarith have hΛ_gt1 : 1 < Λ := by dsimp [Λ]; rwa [one_lt_div hσ] have hrp : r + σ ≠ 0 := by linarith have hrm : r - σ ≠ 0 := by linarith have hΛp : Λ + 1 ≠ 0 := by linarith have hΛm : Λ - 1 ≠ 0 := by linarith refine ⟨?_, hΛ_gt1, ?_, ?_⟩ · dsimp only [Λ] rw [div_pow, hr_sq] dsimp only [σ] field_simp [ne_of_gt hρ] ring · dsimp only [Λ] field_simp [ne_of_gt hσ, hrp, hΛp] · dsimp only [Λ] field_simp [ne_of_gt hσ, hrm, hΛm] end StereographicBounds /-! ## 2. 13D Sphere-Inversion Jacobian & Complete Itô Hessian Chain Cancellation (`SI8`--`SI17`, `EI9`--`EI11`) -/ section StereographicItoChain variable {d m : ℕ} /-- First directional derivative `DF_ε(x)[h]` of `F_ε(x) = x / (Λ + ε)` (`SI10`, `IR1`). -/ def stereoDF (x : Fin d → ℝ) (Λ ε : ℝ) (h : Fin d → ℝ) : Fin d → ℝ := fun i => h i / (Λ + ε) - (dotN x h / (Λ * (Λ + ε) ^ 2)) * x i /-- Second directional derivative `D²F_ε(x)[h, h]` of `F_ε(x) = x / (Λ + ε)` (`SI11`, `IR1`). -/ def stereoD2F (x : Fin d → ℝ) (Λ ε : ℝ) (h : Fin d → ℝ) : Fin d → ℝ := fun i => -(2 * dotN x h / (Λ * (Λ + ε) ^ 2)) * h i + (-(sqNormN h) / (Λ * (Λ + ε) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ + ε) ^ 2) + 2 / (Λ ^ 2 * (Λ + ε) ^ 3))) * x i /-- Jacobian `DI(v)[h]` of sphere inversion `I(v) = v / |v|²` (`SI8`, `IR2`). -/ def invDI (v h : Fin d → ℝ) : Fin d → ℝ := fun i => h i / sqNormN v - (2 * dotN v h / (sqNormN v) ^ 2) * v i /-- Second directional derivative `D²I(v)[h, h]` of `I(v) = v / |v|²` (`SI13`, `IR2`). -/ def invD2I (v h : Fin d → ℝ) : Fin d → ℝ := fun i => -(4 * dotN v h / (sqNormN v) ^ 2) * h i + (-(2 * sqNormN h) / (sqNormN v) ^ 2 + 8 * (dotN v h) ^ 2 / (sqNormN v) ^ 3) * v i /-- First directional derivative `Df_+(v)[h]` of south decoder `f_+(v) = 2 v / (1 - |v|²)`. -/ def southDecodeDF (v h : Fin d → ℝ) : Fin d → ℝ := fun i => 2 * h i / (1 - sqNormN v) + (4 * dotN v h / (1 - sqNormN v) ^ 2) * v i /-- Second directional derivative `D²f_+(v)[h, h]` of south decoder `f_+(v) = 2 v / (1 - |v|²)`. -/ def southDecodeD2F (v h : Fin d → ℝ) : Fin d → ℝ := fun i => (8 * dotN v h / (1 - sqNormN v) ^ 2) * h i + (4 * sqNormN h / (1 - sqNormN v) ^ 2 + 16 * (dotN v h) ^ 2 / (1 - sqNormN v) ^ 3) * v i /-- First directional derivative `Df_-(u)[h]` of north decoder `f_-(u) = 2 u / (|u|² - 1)`. -/ def northDecodeDF (u h : Fin d → ℝ) : Fin d → ℝ := fun i => 2 * h i / (sqNormN u - 1) - (4 * dotN u h / (sqNormN u - 1) ^ 2) * u i /-- Second directional derivative `D²f_-(u)[h, h]` of north decoder `f_-(u) = 2 u / (|u|² - 1)`. -/ def northDecodeD2F (u h : Fin d → ℝ) : Fin d → ℝ := fun i => -(8 * dotN u h / (sqNormN u - 1) ^ 2) * h i + (-(4 * sqNormN h) / (sqNormN u - 1) ^ 2 + 16 * (dotN u h) ^ 2 / (sqNormN u - 1) ^ 3) * u i theorem sqNormN_sphereInv (v : Fin d → ℝ) (hv : sqNormN v ≠ 0) : sqNormN (sphereInv v) = 1 / sqNormN v := by unfold sphereInv rw [sqNormN_div] field_simp [hv] /-- Sphere-inversion Jacobian eigenstructure and conformal norm scaling (`SI8`): - radial eigenvalue `-r⁻²`, - tangential eigenvalue `+r⁻²` on `v⊥`, - conformal norm `|DI(v)[h]|² = |h|² / r⁴` (`r² = |v|²`), - Jacobian involution `DI(I(v))[DI(v)[h]] = h`. -/ theorem sphereInv_jacobian_eigenstructure (v h : Fin d → ℝ) (hv : sqNormN v ≠ 0) : invDI v v = (fun i => -(1 / sqNormN v) * v i) ∧ (dotN v h = 0 → invDI v h = fun i => (1 / sqNormN v) * h i) ∧ sqNormN (invDI v h) = sqNormN h / (sqNormN v) ^ 2 ∧ invDI (sphereInv v) (invDI v h) = h := by have hYsq : sqNormN (sphereInv v) = 1 / sqNormN v := sqNormN_sphereInv v hv have hdot_v_dh : dotN v (invDI v h) = -(dotN v h) / sqNormN v := by unfold invDI rw [dotN_sub_right, dotN_div_right, dotN_scale_right, dotN_self] field_simp [hv] ring have hdot_Y_dh : dotN (sphereInv v) (invDI v h) = -(dotN v h) / (sqNormN v) ^ 2 := by conv_lhs => unfold sphereInv rw [dotN_div_left, hdot_v_dh] field_simp [hv] refine ⟨?_, ?_, ?_, ?_⟩ · funext i simp only [invDI, dotN_self] field_simp [hv] ring · intro horth funext i simp only [invDI, horth] field_simp [hv] ring · have hlin : invDI v h = fun i => (1 / sqNormN v) * h i + (-(2 * dotN v h / (sqNormN v) ^ 2)) * v i := by funext i; simp only [invDI]; ring rw [hlin, sqNormN_lincomb, dotN_comm h v] field_simp [hv] ring · funext i simp only [invDI, hYsq, hdot_Y_dh, sphereInv] field_simp [hv] ring /-- Universal first- and second-order overlap chain rule between the south (`v = F_+(x)`) and north (`u = F_-(x)`) stereographic charts (`SI10`--`SI14`, `IR1`--`IR2`, generalizing `check_sphere_stereographic.py` lines 41--42 to arbitrary dimension and all real states): - `DF_-(x)[h] = DI(v)[DF_+(x)[h]]`, - `D²F_-(x)[h,h] = DI(v)[D²F_+(x)[h,h]] + D²I(v)[DF_+(x)[h], DF_+(x)[h]]`. -/ theorem stereo_overlap_ito_chain (x h : Fin d → ℝ) (Λ : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛgt : 1 < Λ) : let v := stereoSouth x Λ stereoDF x Λ (-1) h = invDI v (stereoDF x Λ 1 h) ∧ stereoD2F x Λ (-1) h = fun i => invDI v (stereoD2F x Λ 1 h) i + invD2I v (stereoDF x Λ 1 h) i := by intro v have hΛ : Λ ≠ 0 := by linarith have hLp : Λ + 1 ≠ 0 := by linarith have hLm : Λ - 1 ≠ 0 := by linarith have hadd_neg : Λ + (-1 : ℝ) = Λ - 1 := by ring have hxsq : sqNormN x = (Λ - 1) * (Λ + 1) := by nlinarith have hvsq : sqNormN v = (Λ - 1) / (Λ + 1) := sqNormN_stereoSouth x Λ hΛsq hLp set dv : Fin d → ℝ := stereoDF x Λ 1 h set d2v : Fin d → ℝ := stereoD2F x Λ 1 h have hdot_v_dv : dotN v dv = dotN x h / (Λ * (Λ + 1) ^ 2) := by change dotN (fun i => x i / (Λ + 1)) (fun i => h i / (Λ + 1) - (dotN x h / (Λ * (Λ + 1) ^ 2)) * x i) = _ rw [dotN_div_left, dotN_sub_right, dotN_div_right, dotN_scale_right, dotN_self, hxsq] field_simp [hΛ, hLp] ring have hsq_dv : sqNormN dv = sqNormN h / (Λ + 1) ^ 2 - (dotN x h) ^ 2 / (Λ ^ 2 * (Λ + 1) ^ 2) := by have hlin : dv = fun i => (1 / (Λ + 1)) * h i + (-(dotN x h / (Λ * (Λ + 1) ^ 2))) * x i := by funext i; dsimp [dv, stereoDF]; ring rw [hlin, sqNormN_lincomb, dotN_comm h x, hxsq] field_simp [hΛ, hLp] ring have hdot_v_d2v : dotN v d2v = (-(2 * (dotN x h) ^ 2 / (Λ * (Λ + 1) ^ 2)) + (-(sqNormN h) / (Λ * (Λ + 1) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ + 1) ^ 2) + 2 / (Λ ^ 2 * (Λ + 1) ^ 3))) * ((Λ - 1) * (Λ + 1))) / (Λ + 1) := by change dotN (fun i => x i / (Λ + 1)) (fun i => -(2 * dotN x h / (Λ * (Λ + 1) ^ 2)) * h i + (-(sqNormN h) / (Λ * (Λ + 1) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ + 1) ^ 2) + 2 / (Λ ^ 2 * (Λ + 1) ^ 3))) * x i) = _ rw [dotN_div_left, dotN_add_right, dotN_scale_right, dotN_scale_right, dotN_self, hxsq] ring constructor · funext i simp only [invDI, hvsq, hdot_v_dv] dsimp only [v, dv, stereoSouth, stereoDF] rw [hadd_neg] field_simp [hΛ, hLp, hLm] ring · funext i simp only [invDI, invD2I, hvsq, hdot_v_dv, hsq_dv, hdot_v_d2v] dsimp only [v, dv, d2v, stereoSouth, stereoDF, stereoD2F] rw [hadd_neg] field_simp [hΛ, hLp, hLm] ring /-- Universal south-chart inverse-decoder Itô cancellation (`SI15`--`SI17`, `EI11`, generalizing `check_sphere_stereographic.py` lines 43--44): - `Df_+(v)[DF_+(x)[h]] = h`, - `Df_+(v)[D²F_+(x)[h,h]] + D²f_+(v)[DF_+(x)[h], DF_+(x)[h]] = 0`. -/ theorem stereo_south_decoder_ito_cancel (x h : Fin d → ℝ) (Λ : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛgt : 1 < Λ) : let v := stereoSouth x Λ southDecodeDF v (stereoDF x Λ 1 h) = h ∧ (fun i => southDecodeDF v (stereoD2F x Λ 1 h) i + southDecodeD2F v (stereoDF x Λ 1 h) i) = fun _ => 0 := by intro v have hΛ : Λ ≠ 0 := by linarith have hLp : Λ + 1 ≠ 0 := by linarith have hxsq : sqNormN x = (Λ - 1) * (Λ + 1) := by nlinarith have hvsq : sqNormN v = (Λ - 1) / (Λ + 1) := sqNormN_stereoSouth x Λ hΛsq hLp have h1mv : 1 - sqNormN v = 2 / (Λ + 1) := by rw [hvsq]; field_simp [hLp]; ring set dv : Fin d → ℝ := stereoDF x Λ 1 h set d2v : Fin d → ℝ := stereoD2F x Λ 1 h have hdot_v_dv : dotN v dv = dotN x h / (Λ * (Λ + 1) ^ 2) := by change dotN (fun i => x i / (Λ + 1)) (fun i => h i / (Λ + 1) - (dotN x h / (Λ * (Λ + 1) ^ 2)) * x i) = _ rw [dotN_div_left, dotN_sub_right, dotN_div_right, dotN_scale_right, dotN_self, hxsq] field_simp [hΛ, hLp] ring have hsq_dv : sqNormN dv = sqNormN h / (Λ + 1) ^ 2 - (dotN x h) ^ 2 / (Λ ^ 2 * (Λ + 1) ^ 2) := by have hlin : dv = fun i => (1 / (Λ + 1)) * h i + (-(dotN x h / (Λ * (Λ + 1) ^ 2))) * x i := by funext i; dsimp [dv, stereoDF]; ring rw [hlin, sqNormN_lincomb, dotN_comm h x, hxsq] field_simp [hΛ, hLp] ring have hdot_v_d2v : dotN v d2v = (-(2 * (dotN x h) ^ 2 / (Λ * (Λ + 1) ^ 2)) + (-(sqNormN h) / (Λ * (Λ + 1) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ + 1) ^ 2) + 2 / (Λ ^ 2 * (Λ + 1) ^ 3))) * ((Λ - 1) * (Λ + 1))) / (Λ + 1) := by change dotN (fun i => x i / (Λ + 1)) (fun i => -(2 * dotN x h / (Λ * (Λ + 1) ^ 2)) * h i + (-(sqNormN h) / (Λ * (Λ + 1) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ + 1) ^ 2) + 2 / (Λ ^ 2 * (Λ + 1) ^ 3))) * x i) = _ rw [dotN_div_left, dotN_add_right, dotN_scale_right, dotN_scale_right, dotN_self, hxsq] ring constructor · funext i simp only [southDecodeDF, h1mv, hdot_v_dv] dsimp only [v, dv, stereoSouth, stereoDF] field_simp [hΛ, hLp] ring · funext i simp only [southDecodeDF, southDecodeD2F, h1mv, hdot_v_dv, hsq_dv, hdot_v_d2v] dsimp only [v, dv, d2v, stereoSouth, stereoDF, stereoD2F] field_simp [hΛ, hLp] ring /-- Universal north-chart inverse-decoder Itô cancellation (`SI15`--`SI17`, `EI11`): - `Df_-(u)[DF_-(x)[h]] = h`, - `Df_-(u)[D²F_-(x)[h,h]] + D²f_-(u)[DF_-(x)[h], DF_-(x)[h]] = 0`. -/ theorem stereo_north_decoder_ito_cancel (x h : Fin d → ℝ) (Λ : ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛgt : 1 < Λ) : let u := stereoNorth x Λ northDecodeDF u (stereoDF x Λ (-1) h) = h ∧ (fun i => northDecodeDF u (stereoD2F x Λ (-1) h) i + northDecodeD2F u (stereoDF x Λ (-1) h) i) = fun _ => 0 := by intro u have hΛ : Λ ≠ 0 := by linarith have hLm : Λ - 1 ≠ 0 := by linarith have hadd_neg : Λ + (-1 : ℝ) = Λ - 1 := by ring have hxsq : sqNormN x = (Λ - 1) * (Λ + 1) := by nlinarith have husq : sqNormN u = (Λ + 1) / (Λ - 1) := sqNormN_stereoNorth x Λ hΛsq hLm have hum1 : sqNormN u - 1 = 2 / (Λ - 1) := by rw [husq]; field_simp [hLm]; ring set du : Fin d → ℝ := stereoDF x Λ (-1) h set d2u : Fin d → ℝ := stereoD2F x Λ (-1) h have hdot_u_du : dotN u du = -(dotN x h) / (Λ * (Λ - 1) ^ 2) := by change dotN (fun i => x i / (Λ - 1)) (fun i => h i / (Λ + -1) - (dotN x h / (Λ * (Λ + -1) ^ 2)) * x i) = _ rw [hadd_neg, dotN_div_left, dotN_sub_right, dotN_div_right, dotN_scale_right, dotN_self, hxsq] field_simp [hΛ, hLm] ring have hsq_du : sqNormN du = sqNormN h / (Λ - 1) ^ 2 - (dotN x h) ^ 2 / (Λ ^ 2 * (Λ - 1) ^ 2) := by have hlin : du = fun i => (1 / (Λ - 1)) * h i + (-(dotN x h / (Λ * (Λ - 1) ^ 2))) * x i := by funext i; dsimp [du, stereoDF]; rw [hadd_neg]; ring rw [hlin, sqNormN_lincomb, dotN_comm h x, hxsq] field_simp [hΛ, hLm] ring have hdot_u_d2u : dotN u d2u = (-(2 * (dotN x h) ^ 2 / (Λ * (Λ - 1) ^ 2)) + (-(sqNormN h) / (Λ * (Λ - 1) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ - 1) ^ 2) + 2 / (Λ ^ 2 * (Λ - 1) ^ 3))) * ((Λ - 1) * (Λ + 1))) / (Λ - 1) := by change dotN (fun i => x i / (Λ - 1)) (fun i => -(2 * dotN x h / (Λ * (Λ + -1) ^ 2)) * h i + (-(sqNormN h) / (Λ * (Λ + -1) ^ 2) + (dotN x h) ^ 2 * (1 / (Λ ^ 3 * (Λ + -1) ^ 2) + 2 / (Λ ^ 2 * (Λ + -1) ^ 3))) * x i) = _ rw [hadd_neg, dotN_div_left, dotN_add_right, dotN_scale_right, dotN_scale_right, dotN_self, hxsq] ring constructor · funext i simp only [northDecodeDF, hum1, hdot_u_du] dsimp only [u, du, stereoNorth, stereoDF] rw [hadd_neg] field_simp [hΛ, hLm] ring · funext i simp only [northDecodeDF, northDecodeD2F, hum1, hdot_u_du, hsq_du, hdot_u_d2u] dsimp only [u, du, d2u, stereoNorth, stereoDF, stereoD2F] rw [hadd_neg] field_simp [hΛ, hLm] ring /-- Linearity of `southDecodeDF`, `northDecodeDF`, and `invDI` in their tangent argument `h`. -/ theorem southDecodeDF_add (v h₁ h₂ : Fin d → ℝ) : southDecodeDF v (fun i => h₁ i + h₂ i) = fun i => southDecodeDF v h₁ i + southDecodeDF v h₂ i := by funext i; simp only [southDecodeDF, dotN_add_right]; ring theorem southDecodeDF_scale (v : Fin d → ℝ) (c : ℝ) (h : Fin d → ℝ) : southDecodeDF v (fun i => c * h i) = fun i => c * southDecodeDF v h i := by funext i; simp only [southDecodeDF, dotN_scale_right]; ring theorem southDecodeDF_sum {ι : Type*} (s : Finset ι) (v : Fin d → ℝ) (f : ι → Fin d → ℝ) : southDecodeDF v (fun i => ∑ j ∈ s, f j i) = fun i => ∑ j ∈ s, southDecodeDF v (f j) i := by classical induction s using Finset.induction_on with | empty => funext i; simp [southDecodeDF, dotN] | insert a s ha ih => have hsplit : (fun i => ∑ j ∈ insert a s, f j i) = fun i => f a i + ∑ j ∈ s, f j i := by funext i; rw [Finset.sum_insert ha] rw [hsplit, southDecodeDF_add, ih] funext i; rw [Finset.sum_insert ha] theorem northDecodeDF_add (u h₁ h₂ : Fin d → ℝ) : northDecodeDF u (fun i => h₁ i + h₂ i) = fun i => northDecodeDF u h₁ i + northDecodeDF u h₂ i := by funext i; simp only [northDecodeDF, dotN_add_right]; ring theorem northDecodeDF_scale (u : Fin d → ℝ) (c : ℝ) (h : Fin d → ℝ) : northDecodeDF u (fun i => c * h i) = fun i => c * northDecodeDF u h i := by funext i; simp only [northDecodeDF, dotN_scale_right]; ring theorem northDecodeDF_sum {ι : Type*} (s : Finset ι) (u : Fin d → ℝ) (f : ι → Fin d → ℝ) : northDecodeDF u (fun i => ∑ j ∈ s, f j i) = fun i => ∑ j ∈ s, northDecodeDF u (f j) i := by classical induction s using Finset.induction_on with | empty => funext i; simp [northDecodeDF, dotN] | insert a s ha ih => have hsplit : (fun i => ∑ j ∈ insert a s, f j i) = fun i => f a i + ∑ j ∈ s, f j i := by funext i; rw [Finset.sum_insert ha] rw [hsplit, northDecodeDF_add, ih] funext i; rw [Finset.sum_insert ha] theorem invDI_add (v h₁ h₂ : Fin d → ℝ) : invDI v (fun i => h₁ i + h₂ i) = fun i => invDI v h₁ i + invDI v h₂ i := by funext i; simp only [invDI, dotN_add_right]; ring theorem invDI_scale (v : Fin d → ℝ) (c : ℝ) (h : Fin d → ℝ) : invDI v (fun i => c * h i) = fun i => c * invDI v h i := by funext i; simp only [invDI, dotN_scale_right]; ring theorem invDI_sum {ι : Type*} (s : Finset ι) (v : Fin d → ℝ) (f : ι → Fin d → ℝ) : invDI v (fun i => ∑ j ∈ s, f j i) = fun i => ∑ j ∈ s, invDI v (f j) i := by classical induction s using Finset.induction_on with | empty => funext i; simp [invDI, dotN] | insert a s ha ih => have hsplit : (fun i => ∑ j ∈ insert a s, f j i) = fun i => f a i + ∑ j ∈ s, f j i := by funext i; rw [Finset.sum_insert ha] rw [hsplit, invDI_add, ih] funext i; rw [Finset.sum_insert ha] /-- Full Itô drift and noise recovery from BOTH south and north stereographic charts (`SI12`--`SI16`, `EI10`--`EI11`): for any raw drift `a` and any finite family of noise columns `B : Fin m → Fin d → ℝ`, transforming `(x, a, B)` into either `v = F_+(x)` or `u = F_-(x)` via the complete Itô law and decoding back recovers `(a, B)` identically. In particular, any slot with zero raw noise (such as all five stretch slots) has zero decoded noise in both charts (`d[χ_R(ρ), Φ] = 0`). -/ theorem stereo_full_ito_drift_noise_recovery (ν Λ : ℝ) (x a : Fin d → ℝ) (B : Fin m → Fin d → ℝ) (hΛsq : Λ ^ 2 = 1 + sqNormN x) (hΛgt : 1 < Λ) : let v := stereoSouth x Λ let u := stereoNorth x Λ let av : Fin d → ℝ := fun i => stereoDF x Λ 1 a i + ν * ∑ j : Fin m, stereoD2F x Λ 1 (B j) i let bv : Fin m → Fin d → ℝ := fun j => stereoDF x Λ 1 (B j) let au : Fin d → ℝ := fun i => stereoDF x Λ (-1) a i + ν * ∑ j : Fin m, stereoD2F x Λ (-1) (B j) i let bu : Fin m → Fin d → ℝ := fun j => stereoDF x Λ (-1) (B j) (fun i => invDI v av i + ν * ∑ j : Fin m, invD2I v (bv j) i) = au ∧ (∀ j : Fin m, invDI v (bv j) = bu j) ∧ (fun i => southDecodeDF v av i + ν * ∑ j : Fin m, southDecodeD2F v (bv j) i) = a ∧ (∀ j : Fin m, southDecodeDF v (bv j) = B j) ∧ (fun i => northDecodeDF u au i + ν * ∑ j : Fin m, northDecodeD2F u (bu j) i) = a ∧ (∀ j : Fin m, northDecodeDF u (bu j) = B j) := by intro v u av bv au bu refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · funext i have hadd := congrFun (invDI_add v (stereoDF x Λ 1 a) (fun k => ν * ∑ j : Fin m, stereoD2F x Λ 1 (B j) k)) i have hsc := congrFun (invDI_scale v ν (fun k => ∑ j : Fin m, stereoD2F x Λ 1 (B j) k)) i have hsum := congrFun (invDI_sum Finset.univ v (fun j => stereoD2F x Λ 1 (B j))) i have ha1 := congrFun (stereo_overlap_ito_chain x a Λ hΛsq hΛgt).1 i have hb2 : ∀ j : Fin m, invDI v (stereoD2F x Λ 1 (B j)) i + invD2I v (bv j) i = stereoD2F x Λ (-1) (B j) i := by intro j exact (congrFun (stereo_overlap_ito_chain x (B j) Λ hΛsq hΛgt).2 i).symm dsimp only [av, au] rw [hadd, hsc, hsum, ← ha1] have hcomb : ν * (∑ j : Fin m, invDI v (stereoD2F x Λ 1 (B j)) i) + ν * (∑ j : Fin m, invD2I v (bv j) i) = ν * ∑ j : Fin m, stereoD2F x Λ (-1) (B j) i := by rw [← mul_add, ← Finset.sum_add_distrib] congr 1 apply Finset.sum_congr rfl; intro j _; exact hb2 j linarith · intro j exact (stereo_overlap_ito_chain x (B j) Λ hΛsq hΛgt).1.symm · funext i have hadd := congrFun (southDecodeDF_add v (stereoDF x Λ 1 a) (fun k => ν * ∑ j : Fin m, stereoD2F x Λ 1 (B j) k)) i have hsc := congrFun (southDecodeDF_scale v ν (fun k => ∑ j : Fin m, stereoD2F x Λ 1 (B j) k)) i have hsum := congrFun (southDecodeDF_sum Finset.univ v (fun j => stereoD2F x Λ 1 (B j))) i have ha1 := congrFun (stereo_south_decoder_ito_cancel x a Λ hΛsq hΛgt).1 i have hb2 : ∀ j : Fin m, southDecodeDF v (stereoD2F x Λ 1 (B j)) i + southDecodeD2F v (bv j) i = 0 := by intro j exact congrFun (stereo_south_decoder_ito_cancel x (B j) Λ hΛsq hΛgt).2 i dsimp only [av] rw [hadd, hsc, hsum, ha1] have hzero : ν * (∑ j : Fin m, southDecodeDF v (stereoD2F x Λ 1 (B j)) i) + ν * (∑ j : Fin m, southDecodeD2F v (bv j) i) = 0 := by rw [← mul_add, ← Finset.sum_add_distrib] have hz : ∑ j : Fin m, (southDecodeDF v (stereoD2F x Λ 1 (B j)) i + southDecodeD2F v (bv j) i) = 0 := Finset.sum_eq_zero fun j _ => hb2 j rw [hz, mul_zero] linarith · intro j exact (stereo_south_decoder_ito_cancel x (B j) Λ hΛsq hΛgt).1 · funext i have hadd := congrFun (northDecodeDF_add u (stereoDF x Λ (-1) a) (fun k => ν * ∑ j : Fin m, stereoD2F x Λ (-1) (B j) k)) i have hsc := congrFun (northDecodeDF_scale u ν (fun k => ∑ j : Fin m, stereoD2F x Λ (-1) (B j) k)) i have hsum := congrFun (northDecodeDF_sum Finset.univ u (fun j => stereoD2F x Λ (-1) (B j))) i have ha1 := congrFun (stereo_north_decoder_ito_cancel x a Λ hΛsq hΛgt).1 i have hb2 : ∀ j : Fin m, northDecodeDF u (stereoD2F x Λ (-1) (B j)) i + northDecodeD2F u (bu j) i = 0 := by intro j exact congrFun (stereo_north_decoder_ito_cancel x (B j) Λ hΛsq hΛgt).2 i dsimp only [au] rw [hadd, hsc, hsum, ha1] have hzero : ν * (∑ j : Fin m, northDecodeDF u (stereoD2F x Λ (-1) (B j)) i) + ν * (∑ j : Fin m, northDecodeD2F u (bu j) i) = 0 := by rw [← mul_add, ← Finset.sum_add_distrib] have hz : ∑ j : Fin m, (northDecodeDF u (stereoD2F x Λ (-1) (B j)) i + northDecodeD2F u (bu j) i) = 0 := Finset.sum_eq_zero fun j _ => hb2 j rw [hz, mul_zero] linarith · intro j exact (stereo_north_decoder_ito_cancel x (B j) Λ hΛsq hΛgt).1 end StereographicItoChain /-! ## 3. Raw 14D Kelvin Inversion Itô Involution (`RS2`--`RS3`, `check_sphere_inversion.py`) -/ section KelvinItoInvolution variable {d m : ℕ} /-- Second-order involution identity for Kelvin inversion `I(X) = X / |X|²` in any dimension `d`: `DI(I(X))[D²I(X)[h,h]] + D²I(I(X))[DI(X)[h], DI(X)[h]] = 0`. -/ theorem kelvin_second_order_involution (X h : Fin d → ℝ) (hX : sqNormN X ≠ 0) : let Y := sphereInv X (fun i => invDI Y (invD2I X h) i + invD2I Y (invDI X h) i) = fun _ => 0 := by intro Y have hYsq : sqNormN Y = 1 / sqNormN X := sqNormN_sphereInv X hX have hdot_Y_dh : dotN Y (invDI X h) = -(dotN X h) / (sqNormN X) ^ 2 := by change dotN (fun i => X i / sqNormN X) (fun i => h i / sqNormN X - (2 * dotN X h / (sqNormN X) ^ 2) * X i) = _ rw [dotN_div_left, dotN_sub_right, dotN_div_right, dotN_scale_right, dotN_self] field_simp [hX] ring have hsq_dh : sqNormN (invDI X h) = sqNormN h / (sqNormN X) ^ 2 := (sphereInv_jacobian_eigenstructure X h hX).2.2.1 have hdot_Y_d2h : dotN Y (invD2I X h) = (-(4 * (dotN X h) ^ 2 / (sqNormN X) ^ 2) + (-(2 * sqNormN h) / (sqNormN X) ^ 2 + 8 * (dotN X h) ^ 2 / (sqNormN X) ^ 3) * sqNormN X) / sqNormN X := by change dotN (fun i => X i / sqNormN X) (fun i => -(4 * dotN X h / (sqNormN X) ^ 2) * h i + (-(2 * sqNormN h) / (sqNormN X) ^ 2 + 8 * (dotN X h) ^ 2 / (sqNormN X) ^ 3) * X i) = _ rw [dotN_div_left, dotN_add_right, dotN_scale_right, dotN_scale_right, dotN_self] ring funext i simp only [invDI, invD2I, hYsq, hdot_Y_dh, hsq_dh, hdot_Y_d2h] dsimp only [Y, sphereInv] field_simp [hX] ring /-- Complete raw Kelvin Itô involution (`RS3`, generalizing `check_sphere_inversion.py` lines 49--54 and 105--110 to arbitrary dimension `d`, including the 14D raw record `X = (x, 1)`): applying `(X, b, G) ↦ (I(X), DI(X)b + ½ ∑_j D²I(X)[G_j, G_j], DI(X)G)` twice restores `(X, b, G)` identically, and if `X k = 1` (anchor slot) then `I(X) k = 1 / |X|²`. -/ theorem kelvin_full_ito_involution (X b : Fin d → ℝ) (G : Fin m → Fin d → ℝ) (hX : sqNormN X ≠ 0) : let Y := sphereInv X let bY : Fin d → ℝ := fun i => invDI X b i + (1 / 2 : ℝ) * ∑ j : Fin m, invD2I X (G j) i let GY : Fin m → Fin d → ℝ := fun j => invDI X (G j) let Z := sphereInv Y let bZ : Fin d → ℝ := fun i => invDI Y bY i + (1 / 2 : ℝ) * ∑ j : Fin m, invD2I Y (GY j) i let GZ : Fin m → Fin d → ℝ := fun j => invDI Y (GY j) Z = X ∧ bZ = b ∧ (∀ j : Fin m, GZ j = G j) ∧ (∀ k : Fin d, X k = 1 → Y k = 1 / sqNormN X) := by intro Y bY GY Z bZ GZ have hYsq : sqNormN Y = 1 / sqNormN X := sqNormN_sphereInv X hX refine ⟨?_, ?_, ?_, ?_⟩ · funext i simp only [Z, sphereInv, hYsq] dsimp only [Y, sphereInv] field_simp [hX] · funext i have hadd := congrFun (invDI_add Y (invDI X b) (fun k => (1 / 2 : ℝ) * ∑ j : Fin m, invD2I X (G j) k)) i have hsc := congrFun (invDI_scale Y (1 / 2 : ℝ) (fun k => ∑ j : Fin m, invD2I X (G j) k)) i have hsum := congrFun (invDI_sum Finset.univ Y (fun j => invD2I X (G j))) i have hb1 := congrFun (sphereInv_jacobian_eigenstructure X b hX).2.2.2 i have hsig2 : ∀ j : Fin m, invDI Y (invD2I X (G j)) i + invD2I Y (GY j) i = 0 := fun j => congrFun (kelvin_second_order_involution X (G j) hX) i dsimp only [bZ, bY] rw [hadd, hsc, hsum, hb1] have hzero : (1 / 2 : ℝ) * (∑ j : Fin m, invDI Y (invD2I X (G j)) i) + (1 / 2 : ℝ) * (∑ j : Fin m, invD2I Y (GY j) i) = 0 := by rw [← mul_add, ← Finset.sum_add_distrib] have hz : ∑ j : Fin m, (invDI Y (invD2I X (G j)) i + invD2I Y (GY j) i) = 0 := Finset.sum_eq_zero fun j _ => hsig2 j rw [hz, mul_zero] linarith · intro j exact (sphereInv_jacobian_eigenstructure X (G j) hX).2.2.2 · intro k hk simp only [Y, sphereInv, hk] end KelvinItoInvolution /-! ## 4. Reciprocal Stretch `σ = 1/ρ`, Spatial-Derivative Cancellation, `Lemma UP-A`, & Spin Eversion -/ section ReciprocalStretchAndEversion /-- First- and second-order cutoff-product invariance under reciprocal stretch `σ = ρ⁻¹` (`SI24`--`SI25`, `RS2`, `EI13`, `EI15`, `IR5`, `IR9a`): - `χ̂'(σ) σ' = χ'(ρ) ρ'` (both signs flip together so outward `ρ' > 0` / inward `σ' < 0` yield the identical signed crossing integrand), - `χ̂''(σ) σ_j σ' + χ̂'(σ) σ'_j = χ''(ρ) ρ_j ρ' + χ'(ρ) ρ'_j` (the extra `± 2 σ χ' ρ_j ρ'` spatial-derivative terms cancel identically, preserving physical diffusion `-ν ∑_j |∇_j D|²`). -/ theorem reciprocal_cutoff_first_and_second_cancellation (ρ ρ' ρ_j ρ'_j χ' χ'' : ℝ) (hρ : ρ ≠ 0) : let σ := ρ⁻¹ let σ' := -(σ ^ 2) * ρ' let σ_j := -(σ ^ 2) * ρ_j let σ'_j := 2 * σ ^ 3 * ρ_j * ρ' - σ ^ 2 * ρ'_j let χhat' := -(σ⁻¹ ^ 2) * χ' let χhat'' := 2 * σ⁻¹ ^ 3 * χ' + σ⁻¹ ^ 4 * χ'' χhat' * σ' = χ' * ρ' ∧ χhat'' * σ_j * σ' + χhat' * σ'_j = χ'' * ρ_j * ρ' + χ' * ρ'_j := by intro σ σ' σ_j σ'_j χhat' χhat'' dsimp only [σ, σ', σ_j, σ'_j, χhat', χhat''] constructor · field_simp [hρ] · field_simp [hρ]; ring /-- Real-calculus derivative of the reciprocal-stretch cutoff `χ̂(σ) = χ(σ⁻¹)` on `σ ≠ 0` (`SI25`, `RS2`): `d/dσ [χ(σ⁻¹)] = -σ⁻² χ'(σ⁻¹)`. -/ theorem hasDerivAt_reciprocal_cutoff {χ χ' : ℝ → ℝ} {σ : ℝ} (hσ : σ ≠ 0) (hχ : HasDerivAt χ (χ' σ⁻¹) σ⁻¹) : HasDerivAt (fun s => χ s⁻¹) (-(σ ^ 2)⁻¹ * χ' σ⁻¹) σ := by have hinv : HasDerivAt (fun s : ℝ => s⁻¹) (-(σ ^ 2)⁻¹) σ := hasDerivAt_inv hσ have hc := hχ.comp σ hinv have hval : χ' σ⁻¹ * -(σ ^ 2)⁻¹ = -(σ ^ 2)⁻¹ * χ' σ⁻¹ := by ring simpa [Function.comp_def, hval] using hc /-- Hyperbolic-cotangent upper bound from `Lemma UP-A` (`UP2`, `UP7`--`UP8`): for every `d > 0` and `σ > 0`, `d * (e^(2d/σ) + 1) / (e^(2d/σ) - 1) ≤ d + σ`. -/ theorem coth_bound_upA (d σ : ℝ) (hd : 0 < d) (hσ : 0 < σ) : d * ((Real.exp (2 * d / σ) + 1) / (Real.exp (2 * d / σ) - 1)) ≤ d + σ := by set u : ℝ := 2 * d / σ have hu : 0 < u := by positivity have hexp : 1 + u ≤ Real.exp u := by linarith [Real.add_one_le_exp u] have hden : 0 < Real.exp u - 1 := by linarith have hrewrite : d * ((Real.exp u + 1) / (Real.exp u - 1)) = d + 2 * d / (Real.exp u - 1) := by field_simp [ne_of_gt hden] ring rw [hrewrite] have hfrac : 2 * d / (Real.exp u - 1) ≤ σ := by rw [div_le_iff₀ hden] have hu_le : u ≤ Real.exp u - 1 := by linarith have hmul : σ * u ≤ σ * (Real.exp u - 1) := mul_le_mul_of_nonneg_left hu_le (le_of_lt hσ) have hσu : σ * u = 2 * d := by dsimp [u]; field_simp [ne_of_gt hσ] linarith linarith /-- Sharp eigenvalue-gap bound for any unit-norm traceless 3×3 symmetric tensor (`Lemma UP-A`): if `l₁ + l₂ + l₃ = 0` and `l₁² + l₂² + l₃² = 1`, then `(l_i - l_j)² ≤ 2` for all `i, j`. -/ theorem traceless_unit_eigenvalue_gap_sq_le_two (l₁ l₂ l₃ : ℝ) (htr : l₁ + l₂ + l₃ = 0) (hnorm : l₁ ^ 2 + l₂ ^ 2 + l₃ ^ 2 = 1) : (l₁ - l₂) ^ 2 ≤ 2 ∧ (l₁ - l₃) ^ 2 ≤ 2 ∧ (l₂ - l₃) ^ 2 ≤ 2 := by have h12 : (l₁ - l₂) ^ 2 = 2 - 3 * l₃ ^ 2 := by have hsum : l₁ + l₂ = -l₃ := by linarith have hsq : (l₁ + l₂) ^ 2 = l₃ ^ 2 := by rw [hsum]; ring linarith [show (l₁ - l₂) ^ 2 + (l₁ + l₂) ^ 2 = 2 * (l₁ ^ 2 + l₂ ^ 2) by ring] have h13 : (l₁ - l₃) ^ 2 = 2 - 3 * l₂ ^ 2 := by have hsum : l₁ + l₃ = -l₂ := by linarith have hsq : (l₁ + l₃) ^ 2 = l₂ ^ 2 := by rw [hsum]; ring linarith [show (l₁ - l₃) ^ 2 + (l₁ + l₃) ^ 2 = 2 * (l₁ ^ 2 + l₃ ^ 2) by ring] have h23 : (l₂ - l₃) ^ 2 = 2 - 3 * l₁ ^ 2 := by have hsum : l₂ + l₃ = -l₁ := by linarith have hsq : (l₂ + l₃) ^ 2 = l₁ ^ 2 := by rw [hsum]; ring linarith [show (l₂ - l₃) ^ 2 + (l₂ + l₃) ^ 2 = 2 * (l₂ ^ 2 + l₃ ^ 2) by ring] exact ⟨by nlinarith [sq_nonneg l₃], by nlinarith [sq_nonneg l₂], by nlinarith [sq_nonneg l₁]⟩ /-- `Lemma UP-A` angular speed bounds on the upper domain `ρ ≥ ρ₀ = σ₀⁻¹ > 0` (`UP6`--`UP8`): with `C_ang² = (σ₀ + √2)² + 2`, 1. `(-σ² α)² ≤ σ₀⁴ s²` whenever `0 < σ ≤ σ₀` and `|α| ≤ s`, 2. `((σ₀ + √2) s + √2 w)² ≤ C_ang² (s² + w²)`, 3. `(s + w)² ≤ 2 (s² + w²)` (`‖Ω_Q‖_HS² ≤ 2 ‖∇u‖_HS²`). -/ theorem lemma_UP_A_speed_bounds (σ σ₀ α s w : ℝ) (hσ : 0 < σ) (hσle : σ ≤ σ₀) (hα : |α| ≤ s) : (-(σ ^ 2) * α) ^ 2 ≤ σ₀ ^ 4 * s ^ 2 ∧ ((σ₀ + Real.sqrt 2) * s + Real.sqrt 2 * w) ^ 2 ≤ ((σ₀ + Real.sqrt 2) ^ 2 + 2) * (s ^ 2 + w ^ 2) ∧ (s + w) ^ 2 ≤ 2 * (s ^ 2 + w ^ 2) := by have hsq2 : Real.sqrt 2 ^ 2 = 2 := Real.sq_sqrt (by norm_num) have hσ₀ : 0 ≤ σ₀ := le_trans (le_of_lt hσ) hσle have hαsq : α ^ 2 ≤ s ^ 2 := by have hs : 0 ≤ s := le_trans (abs_nonneg α) hα have h1 : |α| ^ 2 ≤ s ^ 2 := by nlinarith [abs_nonneg α, hα] simpa [sq_abs] using h1 have hσ2 : σ ^ 2 ≤ σ₀ ^ 2 := by nlinarith have hσ4 : σ ^ 4 ≤ σ₀ ^ 4 := by nlinarith [sq_nonneg σ, sq_nonneg σ₀] refine ⟨?_, ?_, ?_⟩ · have : (-(σ ^ 2) * α) ^ 2 = σ ^ 4 * α ^ 2 := by ring rw [this] exact mul_le_mul hσ4 hαsq (sq_nonneg α) (by positivity) · have hcs : ((σ₀ + Real.sqrt 2) ^ 2 + 2) * (s ^ 2 + w ^ 2) - ((σ₀ + Real.sqrt 2) * s + Real.sqrt 2 * w) ^ 2 = (Real.sqrt 2 * s - (σ₀ + Real.sqrt 2) * w) ^ 2 := by nlinarith [hsq2] nlinarith [sq_nonneg (Real.sqrt 2 * s - (σ₀ + Real.sqrt 2) * w)] · nlinarith [sq_nonneg (s - w)] /-- Auxiliary spin eversion map `E_θ : ℝ⁴ → ℝ⁸` (`EI5`, `E14`): `E_θ(q₀, q₁, q₂, q₃) = (q₀ cos θ, q₁, q₂, q₃, q₀ sin θ, 0, 0, 0)`. -/ def spinEvert (θ : ℝ) (q : Fin 4 → ℝ) : Fin 8 → ℝ := ![Real.cos θ * q 0, q 1, q 2, q 3, Real.sin θ * q 0, 0, 0, 0] /-- Adjoint decoder `E_θ* : ℝ⁸ → ℝ⁴` (`EI5`, `E14`): `E_θ*(p) = (p₀ cos θ + p₄ sin θ, p₁, p₂, p₃)`. -/ def spinEvertAdj (θ : ℝ) (p : Fin 8 → ℝ) : Fin 4 → ℝ := ![Real.cos θ * p 0 + Real.sin θ * p 4, p 1, p 2, p 3] /-- Time derivative `(d/dt E_θ) q = (-θ' sin θ q₀, 0, 0, 0, θ' cos θ q₀, 0, 0, 0)`. -/ def spinEvertDeriv (θ θ' : ℝ) (q : Fin 4 → ℝ) : Fin 8 → ℝ := ![-(θ' * Real.sin θ) * q 0, 0, 0, 0, (θ' * Real.cos θ) * q 0, 0, 0, 0] /-- Time derivative `(d/dt E_θ*) p = (-θ' sin θ p₀ + θ' cos θ p₄, 0, 0, 0)`. -/ def spinEvertAdjDeriv (θ θ' : ℝ) (p : Fin 8 → ℝ) : Fin 4 → ℝ := ![-(θ' * Real.sin θ) * p 0 + (θ' * Real.cos θ) * p 4, 0, 0, 0] /-- Exact spin-eversion isometry and moving-decoder derivative cancellation (`EI5`--`EI7`, `E14`--`E16`): 1. `E_θ* E_θ = I₄`, 2. `|E_θ q|² = |q|²` (norm-preserving embedding `S³ → S⁷`), 3. `(d/dt E_θ*) (E_θ q) + E_θ* ((d/dt E_θ) q + E_θ q') = q'` (moving eversion schedule cancels identically upon decoding, introducing neither extra drift nor spurious damping), 4. At `θ = π`, `E_π(q₀, v) = (-q₀, v, 0)` while `E_π*(E_π q) = q`. -/ theorem spin_eversion_isometry_and_deriv_cancel (θ θ' : ℝ) (q q' : Fin 4 → ℝ) : spinEvertAdj θ (spinEvert θ q) = q ∧ sqNormN (spinEvert θ q) = sqNormN q ∧ (fun i => spinEvertAdjDeriv θ θ' (spinEvert θ q) i + spinEvertAdj θ (fun j => spinEvertDeriv θ θ' q j + spinEvert θ q' j) i) = q' ∧ spinEvert Real.pi q = ![-q 0, q 1, q 2, q 3, 0, 0, 0, 0] := by have hcs : Real.cos θ ^ 2 + Real.sin θ ^ 2 = 1 := Real.cos_sq_add_sin_sq θ refine ⟨?_, ?_, ?_, ?_⟩ · funext i fin_cases i <;> simp [spinEvertAdj, spinEvert] calc Real.cos θ * (Real.cos θ * q 0) + Real.sin θ * (Real.sin θ * q 0) = (Real.cos θ ^ 2 + Real.sin θ ^ 2) * q 0 := by ring _ = q 0 := by rw [hcs, one_mul] · simp only [sqNormN, Fin.sum_univ_eight, Fin.sum_univ_four, spinEvert, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val] calc (Real.cos θ * q 0) ^ 2 + q 1 ^ 2 + q 2 ^ 2 + q 3 ^ 2 + (Real.sin θ * q 0) ^ 2 + 0 ^ 2 + 0 ^ 2 + 0 ^ 2 = (Real.cos θ ^ 2 + Real.sin θ ^ 2) * q 0 ^ 2 + q 1 ^ 2 + q 2 ^ 2 + q 3 ^ 2 := by ring _ = q 0 ^ 2 + q 1 ^ 2 + q 2 ^ 2 + q 3 ^ 2 := by rw [hcs, one_mul] · funext i fin_cases i <;> simp [spinEvertAdjDeriv, spinEvertAdj, spinEvertDeriv, spinEvert] calc -(θ' * Real.sin θ * (Real.cos θ * q 0)) + θ' * Real.cos θ * (Real.sin θ * q 0) + (Real.cos θ * (-(θ' * Real.sin θ * q 0) + Real.cos θ * q' 0) + Real.sin θ * (θ' * Real.cos θ * q 0 + Real.sin θ * q' 0)) = (Real.cos θ ^ 2 + Real.sin θ ^ 2) * q' 0 := by ring _ = q' 0 := by rw [hcs, one_mul] · funext i fin_cases i <;> simp [spinEvert, Real.cos_pi, Real.sin_pi] end ReciprocalStretchAndEversion /-! ## 5. Exact Lower- and Upper-Bound Inversion (`prop:breakdown-signed-signature`, `EI22`--`EI23`, `IR12`--`IR15`) -/ section LowerAndUpperMatrixInversion /-- Unconditional lower-bound signature of the original signed shell `D_R` (`prop:breakdown-signed-signature`, `eq:breakdown-signed-lower` in `01-research_checkpoint.tex`): from `D_R = ω ωᵀ - A_χ + V_χ` with `A_χ ⪯ K₀ I` and `V_χ ⪰ 0`: 1. Unconditional lower floor `-K₀ I ⪯ D_R` (negative eigenvalues are uniformly bounded below), 2. Longitudinal divergence lower bound `⟨ω, D_R ω⟩ ≥ |ω|⁴ - K₀ |ω|² + ⟨ω, V_χ ω⟩`, 3. For any `ε > 0`, the shifted positive matrix `M = D_R + (K₀ + ε) I` satisfies `ε I ⪯ M` and `IsPSD M`. -/ theorem signed_shell_lower_bound_signature (ω : Vec3) (A_χ V_χ D_R : Mat3) (K₀ ε : ℝ) (hε : 0 < ε) (hdecomp : D_R = outer ω - A_χ + V_χ) (hAcap : A_χ ⪯ₗ K₀ • (1 : Mat3)) (hVpsd : IsPSD V_χ) : ((-K₀) • (1 : Mat3)) ⪯ₗ D_R ∧ (vecSqNorm ω) ^ 2 - K₀ * vecSqNorm ω + ω ⬝ᵥ (V_χ *ᵥ ω) ≤ ω ⬝ᵥ (D_R *ᵥ ω) ∧ (ε • (1 : Mat3)) ⪯ₗ (D_R + (K₀ + ε) • (1 : Mat3)) ∧ IsPSD (D_R + (K₀ + ε) • (1 : Mat3)) := by have hΩpsd : IsPSD (outer ω) := outer_isPSD ω have hfloor : ((-K₀) • (1 : Mat3)) ⪯ₗ D_R := by change IsPSD (D_R - (-K₀) • (1 : Mat3)) have heq : D_R - (-K₀) • (1 : Mat3) = outer ω + V_χ + (K₀ • (1 : Mat3) - A_χ) := by rw [hdecomp]; ext i j; simp; ring rw [heq] exact isPSD_add (isPSD_add hΩpsd hVpsd) hAcap have hlong : (vecSqNorm ω) ^ 2 - K₀ * vecSqNorm ω + ω ⬝ᵥ (V_χ *ᵥ ω) ≤ ω ⬝ᵥ (D_R *ᵥ ω) := by have hdec : ω ⬝ᵥ (D_R *ᵥ ω) = ω ⬝ᵥ (outer ω *ᵥ ω) - ω ⬝ᵥ (A_χ *ᵥ ω) + ω ⬝ᵥ (V_χ *ᵥ ω) := by rw [hdecomp] simp only [Matrix.add_mulVec, Matrix.sub_mulVec, dotProduct_add, dotProduct_sub] have hΩω : ω ⬝ᵥ (outer ω *ᵥ ω) = (vecSqNorm ω) ^ 2 := by rw [outer_dotProduct, vecDot_self] have hAω := hAcap.2 ω simp only [Matrix.sub_mulVec, Matrix.smul_mulVec, Matrix.one_mulVec, dotProduct_sub, dotProduct_smul, smul_eq_mul, ← vecSqNorm_eq_dotProduct] at hAω linarith have hMfloor : (ε • (1 : Mat3)) ⪯ₗ (D_R + (K₀ + ε) • (1 : Mat3)) := by change IsPSD ((D_R + (K₀ + ε) • (1 : Mat3)) - ε • (1 : Mat3)) have heq : (D_R + (K₀ + ε) • (1 : Mat3)) - ε • (1 : Mat3) = D_R - (-K₀) • (1 : Mat3) := by ext i j; simp; ring rw [heq] exact hfloor have hMpsd : IsPSD (D_R + (K₀ + ε) • (1 : Mat3)) := by have heq : D_R + (K₀ + ε) • (1 : Mat3) = ε • (1 : Mat3) + ((D_R + (K₀ + ε) • (1 : Mat3)) - ε • (1 : Mat3)) := by ext i j; simp rw [heq] exact isPSD_add (isPSD_smul (le_of_lt hε) isPSD_one) hMfloor exact ⟨hfloor, hlong, hMfloor, hMpsd⟩ /-- Dual inverse-Loewner bound in arbitrary finite dimension `n`: a positive lower floor `c I ⪯ M` (`c > 0`) on an invertible PSD matrix `M` (`M J = I`) maps under matrix inversion to the reciprocal upper cap `0 ⪯ J ⪯ c⁻¹ I`. -/ theorem inv_loewner_upper_of_lower {n : Type*} [Fintype n] [DecidableEq n] {M J : Matrix n n ℝ} {c : ℝ} (hc : 0 < c) (hMpsd : IsPSD M) (hMge : (c • (1 : Matrix n n ℝ)) ⪯ₗ M) (hMJ : M * J = 1) : IsPSD J ∧ J ⪯ₗ (c⁻¹ • (1 : Matrix n n ℝ)) := by have hJsym : Jᵀ = J := by have h1 : Jᵀ * M = 1 := by calc Jᵀ * M = Jᵀ * Mᵀ := by rw [hMpsd.1] _ = (M * J)ᵀ := (Matrix.transpose_mul M J).symm _ = 1 := by rw [hMJ, Matrix.transpose_one] calc Jᵀ = Jᵀ * (M * J) := by rw [hMJ, Matrix.mul_one] _ = (Jᵀ * M) * J := by rw [Matrix.mul_assoc] _ = J := by rw [h1, Matrix.one_mul] have hJquad : ∀ x : n → ℝ, x ⬝ᵥ (J *ᵥ x) = (J *ᵥ x) ⬝ᵥ (M *ᵥ (J *ᵥ x)) := by intro x have hMx : M *ᵥ (J *ᵥ x) = x := by simp only [Matrix.mulVec_mulVec, hMJ, Matrix.one_mulVec] rw [hMx, dotProduct_comm] have hJpsd : IsPSD J := ⟨hJsym, fun x => by rw [hJquad x]; exact hMpsd.2 (J *ᵥ x)⟩ refine ⟨hJpsd, ⟨by rw [Matrix.transpose_sub, Matrix.transpose_smul, Matrix.transpose_one, hJsym], fun x => ?_⟩⟩ set y : n → ℝ := J *ᵥ x have hMy : M *ᵥ y = x := by simp only [y, Matrix.mulVec_mulVec, hMJ, Matrix.one_mulVec] have hcs_raw := isPSD_cauchy_schwarz (isPSD_one (n := n)) x y simp only [Matrix.one_mulVec] at hcs_raw have hMlb : c * (y ⬝ᵥ y) ≤ x ⬝ᵥ (J *ᵥ x) := by have hq := hMge.2 y simp only [Matrix.sub_mulVec, Matrix.smul_mulVec, Matrix.one_mulVec, dotProduct_sub, dotProduct_smul, smul_eq_mul, hMy, dotProduct_comm y x] at hq linarith have hxx_nn : 0 ≤ x ⬝ᵥ x := Finset.sum_nonneg fun i _ => mul_self_nonneg (x i) have hxJx_nn : 0 ≤ x ⬝ᵥ (J *ᵥ x) := hJpsd.2 x have hquad : x ⬝ᵥ ((c⁻¹ • (1 : Matrix n n ℝ) - J) *ᵥ x) = c⁻¹ * (x ⬝ᵥ x) - x ⬝ᵥ (J *ᵥ x) := by simp only [Matrix.sub_mulVec, Matrix.smul_mulVec, Matrix.one_mulVec, dotProduct_sub, dotProduct_smul, smul_eq_mul] rw [hquad] by_cases hJx0 : x ⬝ᵥ (J *ᵥ x) = 0 · rw [hJx0, sub_zero] exact mul_nonneg (inv_nonneg.mpr (le_of_lt hc)) hxx_nn · have hJx_pos : 0 < x ⬝ᵥ (J *ᵥ x) := lt_of_le_of_ne hxJx_nn (Ne.symm hJx0) have hprod : c * (x ⬝ᵥ (J *ᵥ x)) ^ 2 ≤ (x ⬝ᵥ x) * (x ⬝ᵥ (J *ᵥ x)) := by calc c * (x ⬝ᵥ (J *ᵥ x)) ^ 2 = c * (x ⬝ᵥ y) ^ 2 := rfl _ ≤ c * ((x ⬝ᵥ x) * (y ⬝ᵥ y)) := mul_le_mul_of_nonneg_left hcs_raw (le_of_lt hc) _ = (x ⬝ᵥ x) * (c * (y ⬝ᵥ y)) := by ring _ ≤ (x ⬝ᵥ x) * (x ⬝ᵥ (J *ᵥ x)) := mul_le_mul_of_nonneg_left hMlb hxx_nn have hle : c * (x ⬝ᵥ (J *ᵥ x)) ≤ x ⬝ᵥ x := by nlinarith have hinv : x ⬝ᵥ (J *ᵥ x) ≤ c⁻¹ * (x ⬝ᵥ x) := by have := mul_le_mul_of_nonneg_left hle (inv_nonneg.mpr (le_of_lt hc)) rwa [← mul_assoc, inv_mul_cancel₀ (ne_of_gt hc), one_mul] at this linarith /-- Exact two-sided lower-and-upper matrix inversion equivalence (`EI22`, `IR13`, `CP12`): for symmetric PSD inverses `M * J = J * M = I` and `0 < ε`, `0 < C`: - The lower bound `ε I ⪯ M` is strictly equivalent to the upper bound `J ⪯ ε⁻¹ I` (automatically satisfied by `M = D_R + (K₀ + ε) I` via `signed_shell_lower_bound_signature`). - The upper bound `M ⪯ C I` is strictly equivalent to the quantitative positive lower barrier `C⁻¹ I ⪯ J`. -/ theorem matrix_two_sided_inversion_equiv {n : Type*} [Fintype n] [DecidableEq n] {M J : Matrix n n ℝ} {ε C : ℝ} (hε : 0 < ε) (hC : 0 < C) (hMpsd : IsPSD M) (hJpsd : IsPSD J) (hMJ : M * J = 1) (hJM : J * M = 1) : ((ε • (1 : Matrix n n ℝ)) ⪯ₗ M ↔ J ⪯ₗ (ε⁻¹ • (1 : Matrix n n ℝ))) ∧ (M ⪯ₗ (C • (1 : Matrix n n ℝ)) ↔ (C⁻¹ • (1 : Matrix n n ℝ)) ⪯ₗ J) := by constructor · constructor · intro hMge; exact (inv_loewner_upper_of_lower hε hMpsd hMge hMJ).2 · intro hJle have h := inv_loewner_lower_bound (inv_pos.mpr hε) hJpsd hJle hJM simpa [inv_inv] using h · constructor · intro hMle; exact inv_loewner_lower_bound hC hMpsd hMle hMJ · intro hJge have h := (inv_loewner_upper_of_lower (inv_pos.mpr hC) hJpsd hJge hJM).2 simpa [inv_inv] using h /-- Sign of the inverse-matrix PDE diffusion sandwich (`EI22`, `IR12`): for symmetric PSD `J`, symmetric `X`, and `ν ≥ 0`, the quadratic diffusion term `J X J X J = (J X) J (J X)ᵀ` is PSD, so `-2ν J X J X J ⪯ 0`. -/ theorem inverse_pde_diffusion_sandwich_nonpos (J X : Mat3) (ν : ℝ) (hν : 0 ≤ ν) (hJ : IsPSD J) (hX : Xᵀ = X) : IsPSD (J * X * J * X * J) ∧ (-(2 * ν) • (J * X * J * X * J)) ⪯ₗ (0 : Mat3) := by have hcong : J * X * J * X * J = (J * X) * J * (J * X)ᵀ := by rw [Matrix.transpose_mul, hJ.1, hX] simp only [Matrix.mul_assoc] have hpsd : IsPSD (J * X * J * X * J) := by rw [hcong]; exact isPSD_congruence hJ (J * X) refine ⟨hpsd, ?_⟩ change IsPSD ((0 : Mat3) - -(2 * ν) • (J * X * J * X * J)) have heq : (0 : Mat3) - -(2 * ν) • (J * X * J * X * J) = (2 * ν) • (J * X * J * X * J) := by ext i j; simp rw [heq] exact isPSD_smul (by linarith) hpsd /-- Reciprocal signed-energy ODE and two-sided ceiling equivalence (`EI23`, `IR14`): for `a > 0`, `E(t) ≥ 0`, `E'(t) = 2 F(t)`, the inverted energy `h(t) = (a + E(t))⁻¹` satisfies: 1. `HasDerivAt h (-2 * (h t)² * F) t`, 2. Automatic upper bound `0 < h(t) ≤ a⁻¹` from `E(t) ≥ 0`, 3. Exact ceiling equivalence: `E(t) ≤ C ↔ (a + C)⁻¹ ≤ h(t)` for any `C ≥ 0`. -/ theorem reciprocal_energy_ode_and_bounds {E : ℝ → ℝ} {a F t C : ℝ} (ha : 0 < a) (hE_nn : 0 ≤ E t) (hC_nn : 0 ≤ C) (hE_deriv : HasDerivAt E (2 * F) t) : let h := fun s => (a + E s)⁻¹ HasDerivAt h (-2 * (h t) ^ 2 * F) t ∧ (0 < h t ∧ h t ≤ a⁻¹) ∧ (E t ≤ C ↔ (a + C)⁻¹ ≤ h t) := by intro h have haE : 0 < a + E t := by linarith have haC : 0 < a + C := by linarith have hderiv : HasDerivAt h (-2 * (h t) ^ 2 * F) t := by have hsum : HasDerivAt (fun s => a + E s) (2 * F) t := by simpa using hE_deriv.const_add a have hinv := (hasDerivAt_inv (ne_of_gt haE)).comp t hsum have hval : -((a + E t) ^ 2)⁻¹ * (2 * F) = -2 * ((a + E t)⁻¹) ^ 2 * F := by field_simp [ne_of_gt haE] simpa [h, Function.comp_def, hval] using hinv have hpos : 0 < h t := inv_pos.mpr haE have hub : h t ≤ a⁻¹ := inv_anti₀ ha (by linarith) have hequiv : E t ≤ C ↔ (a + C)⁻¹ ≤ h t := by dsimp [h] constructor · intro hle; exact inv_anti₀ haE (by linarith) · intro hge have := (inv_le_inv₀ haC haE).mp hge linarith exact ⟨hderiv, ⟨hpos, hub⟩, hequiv⟩ /-- Pointwise reciprocal PDE identity (`IR15`): for `f = (a + e)⁻¹`, given first derivatives `f_j = -f² e_j` and second derivatives `f_jj = -f² e_jj + 2 f³ e_j²`, the parabolic operator `L_phys f = f_t + u·∇f - ν Δf` obeys `L_phys f = -f² (L_phys e) - 2 ν f³ |∇e|²`; substituting `L_phys e = 2 S_term - 2 ν D_term` yields `L_phys f = -2 f² S_term + 2 ν f² D_term - 2 ν f³ |∇e|²`. -/ theorem pointwise_reciprocal_pde_identity (f ν e_t uGradE lapE gradESq S_term D_term : ℝ) (hLe : e_t + uGradE - ν * lapE = 2 * S_term - 2 * ν * D_term) : let f_t := -(f ^ 2) * e_t let uGradF := -(f ^ 2) * uGradE let lapF := -(f ^ 2) * lapE + 2 * f ^ 3 * gradESq f_t + uGradF - ν * lapF = -2 * f ^ 2 * S_term + 2 * ν * f ^ 2 * D_term - 2 * ν * f ^ 3 * gradESq := by intro f_t uGradF lapF dsimp only [f_t, uGradF, lapF] have h1 : -(f ^ 2) * e_t + -(f ^ 2) * uGradE - ν * (-(f ^ 2) * lapE + 2 * f ^ 3 * gradESq) = -(f ^ 2) * (e_t + uGradE - ν * lapE) - 2 * ν * f ^ 3 * gradESq := by ring rw [h1, hLe] ring /-- Constructive diagnosis theorem (`SI4`--`SI7`, `EI22`--`EI23`, `IR1`, `IR13`--`IR14`): chart compactness (`√2 - 1 ≤ |v| < 1 < |u| ≤ √2 + 1`), exact sphere inversion (`I(v) = u`), the unconditional lower floor (`ε I ⪯ M ⟺ J ⪯ ε⁻¹ I`), and strict positivity (`J > 0`, `h > 0`) are jointly satisfied even by states of arbitrarily large physical amplitude `> B`. Hence closing `SignedShellTarget` in the inverted view requires an additional quantitative positive lower barrier (`J ⪰ C⁻¹ I`, `1 - |v|² ≥ δ > 0`, or `h ≥ (a + C)⁻¹`) from the PDE. -/ theorem inversion_compactness_does_not_force_upper_bound (B ε a : ℝ) (hB : 0 < B) (hε : 0 < ε) (ha : 0 < a) : (∃ (x : Fin 13 → ℝ) (Λ : ℝ), Λ ^ 2 = 1 + sqNormN x ∧ Real.sqrt 2 ≤ Λ ∧ Real.sqrt 2 - 1 ≤ Real.sqrt (sqNormN (stereoSouth x Λ)) ∧ Real.sqrt (sqNormN (stereoSouth x Λ)) < 1 ∧ 1 < Real.sqrt (sqNormN (stereoNorth x Λ)) ∧ Real.sqrt (sqNormN (stereoNorth x Λ)) ≤ Real.sqrt 2 + 1 ∧ sphereInv (stereoSouth x Λ) = stereoNorth x Λ ∧ stereoDecode (stereoSouth x Λ) = x ∧ B < Λ) ∧ (∃ (M J : Mat3), IsPSD M ∧ IsPSD J ∧ M * J = 1 ∧ J * M = 1 ∧ (ε • (1 : Mat3)) ⪯ₗ M ∧ J ⪯ₗ (ε⁻¹ • (1 : Mat3)) ∧ (∀ y : Vec3, y ≠ 0 → 0 < y ⬝ᵥ (J *ᵥ y)) ∧ (∃ e : Vec3, e ⬝ᵥ e = 1 ∧ B < e ⬝ᵥ (M *ᵥ e))) ∧ (∃ E : ℝ, 0 ≤ E ∧ 0 < (a + E)⁻¹ ∧ (a + E)⁻¹ ≤ a⁻¹ ∧ B < E) := by refine ⟨?_, ?_, ?_⟩ · let x : Fin 13 → ℝ := fun i => if i.val = 0 then 1 else if i.val = 4 then B + 2 else 0 have hxsq : sqNormN x = 1 + (B + 2) ^ 2 := by simp only [sqNormN, Fin.sum_univ_succ, Fin.sum_univ_zero, x] norm_num let Λ : ℝ := Real.sqrt (2 + (B + 2) ^ 2) have hΛsq : Λ ^ 2 = 1 + sqNormN x := by dsimp [Λ] rw [Real.sq_sqrt (by positivity), hxsq]; ring have hΛge : Real.sqrt 2 ≤ Λ := Real.sqrt_le_sqrt (by nlinarith [sq_nonneg (B + 2)]) have hΛgtB : B < Λ := by have hsq : B ^ 2 < Λ ^ 2 := by rw [hΛsq, hxsq]; nlinarith have hΛpos : 0 ≤ Λ := Real.sqrt_nonneg _ nlinarith have hb := stereo_chart_bounds_and_decoders x Λ hΛsq hΛge exact ⟨x, Λ, hΛsq, hΛge, hb.2.2.1.1, hb.2.2.1.2, hb.2.2.2.1.1, hb.2.2.2.1.2, hb.2.2.2.2.2.2.2.2.2.2.1, hb.2.2.2.2.2.2.2.2.1, hΛgtB⟩ · set m₁ : ℝ := ε + B + 1 have hm₁ : 0 < m₁ := by dsimp [m₁]; linarith have hm₁inv : 0 < m₁⁻¹ := inv_pos.mpr hm₁ have hεinv : 0 < ε⁻¹ := inv_pos.mpr hε let M : Mat3 := Matrix.diagonal ![m₁, ε, ε] let J : Mat3 := Matrix.diagonal ![m₁⁻¹, ε⁻¹, ε⁻¹] have hMquad : ∀ y : Vec3, y ⬝ᵥ (M *ᵥ y) = m₁ * (y 0) ^ 2 + ε * (y 1) ^ 2 + ε * (y 2) ^ 2 := by intro y simp only [M, Matrix.mulVec_diagonal, dotProduct, Fin.sum_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val] ring have hJquad : ∀ y : Vec3, y ⬝ᵥ (J *ᵥ y) = m₁⁻¹ * (y 0) ^ 2 + ε⁻¹ * (y 1) ^ 2 + ε⁻¹ * (y 2) ^ 2 := by intro y simp only [J, Matrix.mulVec_diagonal, dotProduct, Fin.sum_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val] ring have hMpsd : IsPSD M := by refine ⟨by simp [M], fun y => ?_⟩ rw [hMquad y] nlinarith [sq_nonneg (y 0), sq_nonneg (y 1), sq_nonneg (y 2), hm₁, hε] have hJpsd : IsPSD J := by refine ⟨by simp [J], fun y => ?_⟩ rw [hJquad y] nlinarith [sq_nonneg (y 0), sq_nonneg (y 1), sq_nonneg (y 2), hm₁inv, hεinv] have hMJ : M * J = 1 := by ext i j fin_cases i <;> fin_cases j <;> simp [M, J, Matrix.mul_apply, Fin.sum_univ_three, ne_of_gt hm₁, ne_of_gt hε] have hJM : J * M = 1 := by ext i j fin_cases i <;> fin_cases j <;> simp [M, J, Matrix.mul_apply, Fin.sum_univ_three, ne_of_gt hm₁, ne_of_gt hε] have hMge : (ε • (1 : Mat3)) ⪯ₗ M := by refine ⟨by simp [M], fun y => ?_⟩ have hsub : y ⬝ᵥ ((M - ε • (1 : Mat3)) *ᵥ y) = y ⬝ᵥ (M *ᵥ y) - ε * (y ⬝ᵥ y) := by simp only [Matrix.sub_mulVec, Matrix.smul_mulVec, Matrix.one_mulVec, dotProduct_sub, dotProduct_smul, smul_eq_mul] rw [hsub, hMquad y] have hyy : y ⬝ᵥ y = (y 0) ^ 2 + (y 1) ^ 2 + (y 2) ^ 2 := by simp only [dotProduct, Fin.sum_univ_three]; ring rw [hyy] have hm₁_sub : m₁ - ε = B + 1 := by dsimp [m₁]; ring nlinarith [sq_nonneg (y 0), hB, hm₁_sub] have hJle : J ⪯ₗ (ε⁻¹ • (1 : Mat3)) := (inv_loewner_upper_of_lower hε hMpsd hMge hMJ).2 have hJpos : ∀ y : Vec3, y ≠ 0 → 0 < y ⬝ᵥ (J *ᵥ y) := by intro y hy have hne : y 0 ≠ 0 ∨ y 1 ≠ 0 ∨ y 2 ≠ 0 := by by_contra hall push Not at hall apply hy; funext i; fin_cases i <;> simp [hall] rw [hJquad y] rcases hne with h0 | h1 | h2 · nlinarith [sq_pos_of_ne_zero h0, sq_nonneg (y 1), sq_nonneg (y 2)] · nlinarith [sq_nonneg (y 0), sq_pos_of_ne_zero h1, sq_nonneg (y 2)] · nlinarith [sq_nonneg (y 0), sq_nonneg (y 1), sq_pos_of_ne_zero h2] have htop : ∃ e : Vec3, e ⬝ᵥ e = 1 ∧ B < e ⬝ᵥ (M *ᵥ e) := by refine ⟨![1, 0, 0], by simp [dotProduct, Fin.sum_univ_three], ?_⟩ rw [hMquad ![1, 0, 0]] simp only [Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val] dsimp [m₁]; linarith exact ⟨M, J, hMpsd, hJpsd, hMJ, hJM, hMge, hJle, hJpos, htop⟩ · refine ⟨B + 1, by linarith, inv_pos.mpr (by linarith), inv_anti₀ ha (by linarith), by linarith⟩ end LowerAndUpperMatrixInversion end end F02NavierStokes.SphereInversionBounds