import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.MeasureTheory.Integral.Bochner.Basic import Mathlib.Data.Matrix.Mul import LinkedTower.Hopf import F02NavierStokes.LinearAlgebra3D import F02NavierStokes.QuaternionicS4And4DPDE /-! # Sphere Eversion, Inside-Out `S³ ↪ S⁷ → S⁴` History, Moving-Manifold Transport, and `EV2`–`EV3` Formalizes Paul Cooper's complete sphere-eversion calculations across: - `F02/sources/01-research_checkpoint.tex`: - Section *"The `S⁷`–`S⁴`–`S³` linkage and its inside-out history"* (`eq:s3-inside-out`, `eq:s3-inside-out-base`, `eq:s3-inside-out-connection`, `eq:hopf-higher-atlas`, `eq:hopf-higher-history`), - Section *"The inside-out transport and its actual time derivative"* (`eq:hopf-moving-derivative`, `eq:hopf-moving-normal`, `eq:hopf-moving-fiber`); - `signed-eversion-inversion-2026-10-19/CHECK_TRANSFORMS.py` (`eversion_geometry` and `eversion_spin_decoder`, exact normal orthogonality, covariant tangent & endomorphism derivative recovery, and lifted spin links); - `millennium-rainbow/manuscript.tex`: - `Theorem EV2` (`eq:eversion-uniform-metric`, `eq:eversion-uniform-scalar-gap`: uniform positive scalar spectral gap `λ₁(-Δ_{γ_t}) ≥ (c / C²) λ₁(-Δ_{γ₀}) > 0` along any regular `S² → ℝ³` sphere eversion, plus the required collapse failure of the linear homotopy `G_t(p) = (1 - 2t) p` at `t = 1/2`), - `Proposition EV3` (`eq:archived-slice-scalar-spectrum`, `eq:archived-endpoint-conjugation`, `eq:axis-versus-hopf-direction`: the archived conjugation turning family `F_θ(q) = (a + cos θ v, sin θ v)` in `S⁷` and its exact axis–Hopf cross-product flip vs. antipodal invariance). All bundle calculations use the explicit two-chart cover `U_N = {c > -1}`, `U_S = {c < 1}` with non-trivial `Sp(1)` overlap cocycle `g_NS` — zero global sections. -/ namespace F02NavierStokes.SphereEversionAndTransport noncomputable section open LinkedTower.Hopf open F02NavierStokes.LinearAlgebra3D open F02NavierStokes.QuaternionicS4And4DPDE open scoped Matrix MeasureTheory /-! ## 1. Quaternionic Helpers and Inside-Out Family `I_θ : S³ ↪ S⁷ → S⁴` -/ /-- Pure imaginary part of a quaternion `q = q.re + qIm q`. -/ def qIm (q : Q) : Q := ⟨0, q.imI, q.imJ, q.imK⟩ /-- Euclidean inner product on `ℍ ≅ ℝ⁴`. -/ def qInner (p q : Q) : ℝ := p.re * q.re + p.imI * q.imI + p.imJ * q.imJ + p.imK * q.imK /-- Euclidean inner product on `ℍ² ≅ ℝ⁸`. -/ def qInner8 (x y : Q × Q) : ℝ := qInner x.1 y.1 + qInner x.2 y.2 /-- Quaternionic cross product on pure imaginary quaternions `Im ℍ ≅ ℝ³`. -/ def qCross (u v : Q) : Q := ⟨0, u.imJ * v.imK - u.imK * v.imJ, u.imK * v.imI - u.imI * v.imK, u.imI * v.imJ - u.imJ * v.imI⟩ /-- Explicit nonsingular isometric inside-out family `I_θ : S³ → S⁷` (`eq:s3-inside-out`): `I_θ(q₀ + v) = (q₀ cos θ + v, q₀ sin θ)` for `θ = π s ∈ [0, π]`. -/ def insideOutS7 (θ : ℝ) (q : Q) : Q × Q := (((q.re * Real.cos θ : ℝ) : Q) + qIm q, ((q.re * Real.sin θ : ℝ) : Q)) /-- Quaternionic Hopf projection `π_ℍ(a, b) = (2 a b̄, |a|² - |b|²) ∈ S⁴`. -/ def hopfProjS7 (p : Q × Q) : Q × ℝ := ((2 : ℝ) • (p.1 * star p.2), Quaternion.normSq p.1 - Quaternion.normSq p.2) /-- Complete `S⁴` base trajectory `(Q_θ, c_θ)` of `I_θ(q)` (`eq:s3-inside-out-base`): `Q_θ = q₀² sin(2θ) + 2 q₀ sin θ v`, `c_θ = 1 - 2 q₀² sin² θ`. -/ def insideOutBaseS4 (θ : ℝ) (q : Q) : Q × ℝ := (((q.re ^ 2 * Real.sin (2 * θ) : ℝ) : Q) + (2 * q.re * Real.sin θ) • qIm q, 1 - 2 * q.re ^ 2 * Real.sin θ ^ 2) /-- Complete two-chart `S⁷ → S⁴` trajectory of the nonsingular `S³` inside-out family (`eq:s3-inside-out`, `eq:s3-inside-out-base`, `01-research_checkpoint.tex` §"The explicit nonsingular turn inside `S⁷`"): 1. **Exact isometric embedding `S³ ↪ S⁷`**: `|I_θ(q)|² = |q|²`, inner products preserved, endpoints `I_0(q) = (q, 0)` (degree `+1`) and `I_π(q) = (-q₀ + v, 0)` (orientation-reversing reflection of degree `-1`, distinct from the degree-`+1` antipode `-q` whenever `v ≠ 0`). 2. **Complete `S⁴` base trajectory**: `π_ℍ(I_θ(q)) = (Q_θ, c_θ) ∈ S⁴` sweeps from the North Pole `(0, +1)` at `θ = 0` down to the South Pole `(0, -1)` at `θ = π/2, q₀ = ±1` and back to `(0, +1)` at `θ = π`. 3. **Complete two-chart cover with zero global section**: - North chart `U_N` (`1 - B² > 0`, i.e. `c_θ > -1`): `r_N = a_θ / √(1 - B²) ∈ Sp(1)`, `σ_N · r_N = I_θ(q)`; - South chart `U_S` (`B ≠ 0`, i.e. `c_θ < 1`): `r_S = B / |B| ∈ {±1} ⊂ Sp(1)`, `σ_S · r_S = I_θ(q)`; - Overlap `U_N ∩ U_S`: `g_NS = Q_θ / |Q_θ| = (B / |B|) · r_N` satisfies exact `r_S = g_NS⁻¹ r_N`. 4. **Sign flip across the intervening South Pole**: for `q = 1`, `r_N(θ) = +1` on `(0, π/2)` and `r_N(θ) = -1` on `(π/2, π)` — preserved in the full `Sp(1)` fiber record even though invisible in the derived `S²` adjoint label `r_N k r_N⁻¹ = k`. -/ theorem s3_inside_out_S7_S4_two_chart_trajectory : (∀ (θ : ℝ) (p q : Q), Quaternion.normSq (insideOutS7 θ q).1 + Quaternion.normSq (insideOutS7 θ q).2 = Quaternion.normSq q ∧ qInner8 (insideOutS7 θ p) (insideOutS7 θ q) = qInner p q ∧ insideOutS7 0 q = (q, 0) ∧ insideOutS7 Real.pi q = ((-(q.re : Q)) + qIm q, 0)) ∧ (∀ (θ : ℝ) (q : Q), Quaternion.normSq q = 1 → hopfProjS7 (insideOutS7 θ q) = insideOutBaseS4 θ q ∧ Quaternion.normSq (insideOutBaseS4 θ q).1 + (insideOutBaseS4 θ q).2 ^ 2 = 1 ∧ insideOutBaseS4 0 q = (0, 1) ∧ insideOutBaseS4 Real.pi q = (0, 1)) ∧ (insideOutBaseS4 (Real.pi / 2) (1 : Q) = (0, -1)) ∧ (∀ (θ : ℝ) (q : Q), Quaternion.normSq q = 1 → let B : ℝ := q.re * Real.sin θ let a : Q := (insideOutS7 θ q).1 let Qs : Q := (insideOutBaseS4 θ q).1 (0 < 1 - B ^ 2 → let α : ℝ := Real.sqrt (1 - B ^ 2) let rN : Q := (1 / α : ℝ) • a Quaternion.normSq rN = 1 ∧ ((LinkedTower.Hopf.north α Qs).1 * rN, (LinkedTower.Hopf.north α Qs).2 * rN) = insideOutS7 θ q) ∧ (B ≠ 0 → let β : ℝ := |B| let sB : ℝ := B / |B| let rS : Q := (sB : Q) Quaternion.normSq rS = 1 ∧ ((LinkedTower.Hopf.south β Qs).1 * rS, (LinkedTower.Hopf.south β Qs).2 * rS) = insideOutS7 θ q) ∧ (0 < 1 - B ^ 2 → B ≠ 0 → let α : ℝ := Real.sqrt (1 - B ^ 2) let β : ℝ := |B| let sB : ℝ := B / |B| let rN : Q := (1 / α : ℝ) • a let rS : Q := (sB : Q) let g : Q := LinkedTower.Hopf.transition α β Qs g = sB • rN ∧ star g * rN = rS)) ∧ (∀ θ : ℝ, let a : Q := (insideOutS7 θ (1 : Q)).1 let rN : Q := (1 / Real.sqrt (1 - Real.sin θ ^ 2) : ℝ) • a (0 < Real.cos θ → rN = 1 ∧ rN * qk * star rN = qk) ∧ (Real.cos θ < 0 → rN = -1 ∧ rN * qk * star rN = qk)) := by have hnorm_split : ∀ q : Q, Quaternion.normSq q = q.re ^ 2 + q.imI ^ 2 + q.imJ ^ 2 + q.imK ^ 2 := fun q => by simp [Quaternion.normSq_def'] have hpart1 : ∀ (θ : ℝ) (p q : Q), Quaternion.normSq (insideOutS7 θ q).1 + Quaternion.normSq (insideOutS7 θ q).2 = Quaternion.normSq q ∧ qInner8 (insideOutS7 θ p) (insideOutS7 θ q) = qInner p q ∧ insideOutS7 0 q = (q, 0) ∧ insideOutS7 Real.pi q = ((-(q.re : Q)) + qIm q, 0) := by intro θ p q have hcs := Real.cos_sq_add_sin_sq θ refine ⟨?_, ?_, ?_, ?_⟩ · simp [insideOutS7, qIm, Quaternion.normSq_def', -Quaternion.coe_mul] linear_combination q.re ^ 2 * hcs · simp [qInner8, qInner, insideOutS7, qIm, -Quaternion.coe_mul] linear_combination (p.re * q.re) * hcs · ext <;> simp [insideOutS7, qIm] · ext <;> simp [insideOutS7, qIm, Real.cos_pi, Real.sin_pi] have hpart2 : ∀ (θ : ℝ) (q : Q), Quaternion.normSq q = 1 → hopfProjS7 (insideOutS7 θ q) = insideOutBaseS4 θ q ∧ Quaternion.normSq (insideOutBaseS4 θ q).1 + (insideOutBaseS4 θ q).2 ^ 2 = 1 ∧ insideOutBaseS4 0 q = (0, 1) ∧ insideOutBaseS4 Real.pi q = (0, 1) := by intro θ q hq have hq' : q.re ^ 2 + q.imI ^ 2 + q.imJ ^ 2 + q.imK ^ 2 = 1 := by rw [← hnorm_split q]; exact hq have hcs := Real.cos_sq_add_sin_sq θ have hsin2 : Real.sin (2 * θ) = 2 * Real.sin θ * Real.cos θ := Real.sin_two_mul θ have hproj : hopfProjS7 (insideOutS7 θ q) = insideOutBaseS4 θ q := by refine Prod.ext ?_ ?_ · dsimp only [hopfProjS7, insideOutS7, insideOutBaseS4, qIm] ext <;> simp [hsin2, -Quaternion.coe_mul, -Quaternion.coe_pow] <;> ring · dsimp only [hopfProjS7, insideOutS7, insideOutBaseS4, qIm] simp [Quaternion.normSq_def', -Quaternion.coe_mul, -Quaternion.coe_pow] linear_combination hq' + q.re ^ 2 * hcs have hunit : Quaternion.normSq (insideOutBaseS4 θ q).1 + (insideOutBaseS4 θ q).2 ^ 2 = 1 := by dsimp only [insideOutBaseS4, qIm] simp [Quaternion.normSq_def', hsin2, -Quaternion.coe_mul, -Quaternion.coe_pow] linear_combination (4 * q.re ^ 2 * Real.sin θ ^ 2) * hq' + (4 * q.re ^ 4 * Real.sin θ ^ 2) * hcs have h0 : insideOutBaseS4 0 q = (0, 1) := by refine Prod.ext ?_ ?_ · ext <;> simp [insideOutBaseS4, qIm] · simp [insideOutBaseS4] have hpi : insideOutBaseS4 Real.pi q = (0, 1) := by refine Prod.ext ?_ ?_ · ext <;> simp [insideOutBaseS4, qIm, Real.sin_pi, Real.sin_two_mul] · simp [insideOutBaseS4, Real.sin_pi] exact ⟨hproj, hunit, h0, hpi⟩ have hmid : insideOutBaseS4 (Real.pi / 2) (1 : Q) = (0, -1) := by have h2pi : Real.sin (2 * (Real.pi / 2)) = 0 := by rw [show (2 : ℝ) * (Real.pi / 2) = Real.pi by ring, Real.sin_pi] refine Prod.ext ?_ ?_ · ext <;> simp [insideOutBaseS4, qIm, h2pi, -Quaternion.coe_mul, -Quaternion.coe_pow] · simp [insideOutBaseS4, Real.sin_pi_div_two]; norm_num have hpart4 : ∀ (θ : ℝ) (q : Q), Quaternion.normSq q = 1 → let B : ℝ := q.re * Real.sin θ let a : Q := (insideOutS7 θ q).1 let Qs : Q := (insideOutBaseS4 θ q).1 (0 < 1 - B ^ 2 → let α : ℝ := Real.sqrt (1 - B ^ 2) let rN : Q := (1 / α : ℝ) • a Quaternion.normSq rN = 1 ∧ ((LinkedTower.Hopf.north α Qs).1 * rN, (LinkedTower.Hopf.north α Qs).2 * rN) = insideOutS7 θ q) ∧ (B ≠ 0 → let β : ℝ := |B| let sB : ℝ := B / |B| let rS : Q := (sB : Q) Quaternion.normSq rS = 1 ∧ ((LinkedTower.Hopf.south β Qs).1 * rS, (LinkedTower.Hopf.south β Qs).2 * rS) = insideOutS7 θ q) ∧ (0 < 1 - B ^ 2 → B ≠ 0 → let α : ℝ := Real.sqrt (1 - B ^ 2) let β : ℝ := |B| let sB : ℝ := B / |B| let rN : Q := (1 / α : ℝ) • a let rS : Q := (sB : Q) let g : Q := LinkedTower.Hopf.transition α β Qs g = sB • rN ∧ star g * rN = rS) := by intro θ q hq B a Qs have hna : Quaternion.normSq a = 1 - B ^ 2 := by have h1 := (hpart1 θ q q).1 dsimp only [a, B] have hb : Quaternion.normSq (insideOutS7 θ q).2 = (q.re * Real.sin θ) ^ 2 := by simp [insideOutS7, Quaternion.normSq_coe]; ring linarith have hQs_eq : Qs = (2 * B) • a := by have hsin2 : Real.sin (2 * θ) = 2 * Real.sin θ * Real.cos θ := Real.sin_two_mul θ dsimp only [Qs, B, a, insideOutBaseS4, insideOutS7, qIm] ext <;> simp [hsin2, -Quaternion.coe_mul, -Quaternion.coe_pow, -mul_eq_mul_right_iff, -mul_eq_mul_left_iff] <;> ring refine ⟨?_, ?_, ?_⟩ · intro hpos α rN have hα_pos : 0 < α := Real.sqrt_pos.mpr hpos have hα2 : α ^ 2 = 1 - B ^ 2 := Real.sq_sqrt (le_of_lt hpos) refine ⟨?_, ?_⟩ · dsimp only [rN] rw [Quaternion.normSq_smul, hna, div_pow, one_pow, hα2] field_simp [ne_of_gt hpos] · refine Prod.ext ?_ ?_ · dsimp only [LinkedTower.Hopf.north, rN, a] rw [mul_smul_comm, Quaternion.coe_mul_eq_smul, smul_smul] have h1 : 1 / α * α = 1 := by field_simp [ne_of_gt hα_pos] rw [h1, one_smul] · dsimp only [LinkedTower.Hopf.north, rN] rw [hQs_eq, Quaternion.star_smul, smul_smul, smul_mul_assoc, mul_smul_comm, smul_smul, Quaternion.star_mul_self, hna, Quaternion.smul_coe] dsimp only [insideOutS7, B] congr 1 field_simp [ne_of_gt hα_pos] ring_nf rw [hα2] ring · intro hB β sB rS have hβ_pos : 0 < β := abs_pos.mpr hB have hsB2 : sB ^ 2 = 1 := by dsimp only [sB, β] rw [div_pow, sq_abs] field_simp [hB] refine ⟨?_, ?_⟩ · dsimp only [rS]; rw [Quaternion.normSq_coe, hsB2] · refine Prod.ext ?_ ?_ · dsimp only [LinkedTower.Hopf.south, rS] rw [hQs_eq, smul_smul, Quaternion.mul_coe_eq_smul, smul_smul] have h1 : sB * (1 / (2 * β) * (2 * B)) = 1 := by dsimp only [sB, β] have hsq : |B| * |B| = B * B := by rw [← pow_two, sq_abs, pow_two] field_simp [ne_of_gt hβ_pos, hB] linarith [hsq] rw [h1, one_smul] · dsimp only [LinkedTower.Hopf.south, rS, insideOutS7, sB, β, B] rw [← Quaternion.coe_mul] congr 1 have habs : |q.re * Real.sin θ| ≠ 0 := abs_ne_zero.mpr hB field_simp [habs] · intro hpos hB α β sB rN rS g have hα_pos : 0 < α := Real.sqrt_pos.mpr hpos have hβ_pos : 0 < β := abs_pos.mpr hB have hα2 : α ^ 2 = 1 - B ^ 2 := Real.sq_sqrt (le_of_lt hpos) have hg_eq : g = sB • rN := by dsimp only [g, LinkedTower.Hopf.transition, rN] rw [hQs_eq, smul_smul, smul_smul] congr 1 dsimp only [sB, β] field_simp [ne_of_gt hα_pos, ne_of_gt hβ_pos] refine ⟨hg_eq, ?_⟩ rw [hg_eq, Quaternion.star_smul, smul_mul_assoc, Quaternion.star_mul_self] have hrN1 : Quaternion.normSq rN = 1 := by dsimp only [rN] rw [Quaternion.normSq_smul, hna, div_pow, one_pow, hα2] field_simp [ne_of_gt hpos] rw [hrN1, Quaternion.smul_coe, mul_one] have hpart5 : ∀ θ : ℝ, let a : Q := (insideOutS7 θ (1 : Q)).1 let rN : Q := (1 / Real.sqrt (1 - Real.sin θ ^ 2) : ℝ) • a (0 < Real.cos θ → rN = 1 ∧ rN * qk * star rN = qk) ∧ (Real.cos θ < 0 → rN = -1 ∧ rN * qk * star rN = qk) := by intro θ a rN have h1s : 1 - Real.sin θ ^ 2 = Real.cos θ ^ 2 := by linarith [Real.cos_sq_add_sin_sq θ] have ha_eq : a = ((Real.cos θ : ℝ) : Q) := by dsimp only [a, insideOutS7, qIm] ext <;> simp refine ⟨?_, ?_⟩ · intro hcos have hsq : Real.sqrt (1 - Real.sin θ ^ 2) = Real.cos θ := by rw [h1s, Real.sqrt_sq (le_of_lt hcos)] have hr : rN = 1 := by dsimp only [rN]; rw [hsq, ha_eq, Quaternion.smul_coe] have : 1 / Real.cos θ * Real.cos θ = 1 := by field_simp [ne_of_gt hcos] rw [this, Quaternion.coe_one] exact ⟨hr, by rw [hr]; simp⟩ · intro hcos have hsq : Real.sqrt (1 - Real.sin θ ^ 2) = -Real.cos θ := by rw [h1s, Real.sqrt_sq_eq_abs, abs_of_neg hcos] have hr : rN = -1 := by dsimp only [rN]; rw [hsq, ha_eq, Quaternion.smul_coe] have : 1 / (-Real.cos θ) * Real.cos θ = -1 := by field_simp [ne_of_lt hcos] rw [this]; ext <;> simp exact ⟨hr, by rw [hr]; simp⟩ exact ⟨hpart1, hpart2, hmid, hpart4, hpart5⟩ /-! ## 2. Exact `S⁷ → S⁴` Connection Pullbacks and Fiber History Along the Inside-Out Turn -/ /-- Exact canonical connection, north/south chart pullbacks, and fiber-history law along `I_θ(q)` (`eq:s3-inside-out-connection`, `eq:hopf-higher-history`, `01-research_checkpoint.tex` lines 2529–2540; specialized to `ω = π` for `θ = π s`, valid for arbitrary clock speed `ω`). For `q = q₀ + v ∈ S³` (`|q|² = 1`), `B = q₀ sin θ`, `a = q₀ cos θ + v`, `b = q₀ sin θ`: 1. Total canonical `S⁷` connection: `ζ = Im(ā ȧ + b̄ ḃ) = (ω B) • v`. 2. South-chart pullback (`B ≠ 0`): `A_S(γ̇) = Im(Q̄ Q̇)/(2(1-c)) = (ω B) • v`, verifying `ṙ_S = 0 = r_S ζ - A_S(γ̇) r_S`. 3. North-chart pullback (`1 - B² > 0`): - `A_N(γ̇) = Im(Q Q̇̄)/(2(1+c)) = -(ω B³ / (1 - B²)) • v`, - `r_N⁻¹ ṙ_N = (ω B / (1 - B²)) • v`, - exact north-chart fiber-history law `ṙ_N = r_N ζ - A_N(γ̇) r_N`. -/ theorem s3_inside_out_connection_and_fiber_history (θ ω : ℝ) (q : Q) (hq : Quaternion.normSq q = 1) : let B : ℝ := q.re * Real.sin θ let Bd : ℝ := ω * q.re * Real.cos θ let v : Q := qIm q let a : Q := ((q.re * Real.cos θ : ℝ) : Q) + v let ad : Q := ((-(ω * B) : ℝ) : Q) let b : Q := (B : Q) let bd : Q := (Bd : Q) let Qs : Q := (2 * B) • a let Qsd : Q := (2 * Bd) • a + (2 * B) • ad let c : ℝ := 1 - 2 * B ^ 2 let ζ : Q := qIm (star a * ad + star b * bd) ζ = (ω * B) • v ∧ (B ≠ 0 → let AS : Q := (1 / (2 * (1 - c)) : ℝ) • qIm (star Qs * Qsd) let rS : Q := ((B / |B| : ℝ) : Q) AS = (ω * B) • v ∧ (0 : Q) = rS * ζ - AS * rS) ∧ (0 < 1 - B ^ 2 → let α : ℝ := Real.sqrt (1 - B ^ 2) let AN : Q := (1 / (2 * (1 + c)) : ℝ) • qIm (Qs * star Qsd) let rN : Q := (1 / α : ℝ) • a let rNd : Q := (B * Bd / (α * (1 - B ^ 2)) : ℝ) • a + (1 / α : ℝ) • ad AN = (-(ω * B ^ 3 / (1 - B ^ 2)) : ℝ) • v ∧ star rN * rNd = (ω * B / (1 - B ^ 2) : ℝ) • v ∧ rNd = rN * ζ - AN * rN) := by intro B Bd v a ad b bd Qs Qsd c ζ have hnorm_split : q.re ^ 2 + q.imI ^ 2 + q.imJ ^ 2 + q.imK ^ 2 = 1 := by have := hq; simp only [Quaternion.normSq_def'] at this; linarith have hna : Quaternion.normSq a = 1 - B ^ 2 := by dsimp only [a, v, qIm, B] simp [Quaternion.normSq_def', -Quaternion.coe_mul] linear_combination hnorm_split + q.re ^ 2 * Real.cos_sq_add_sin_sq θ have hζ : ζ = (ω * B) • v := by dsimp only [ζ, a, ad, b, bd, v, qIm, B, Bd] ext <;> simp [-Quaternion.coe_mul, -Quaternion.coe_neg] <;> ring refine ⟨hζ, ?_, ?_⟩ · intro hB AS rS have hqre_ne : q.re ≠ 0 := left_ne_zero_of_mul hB have hsin_ne : Real.sin θ ≠ 0 := right_ne_zero_of_mul hB have hAS : AS = (ω * B) • v := by dsimp only [AS, Qs, Qsd, a, ad, c, v, qIm, B, Bd] have hden : 2 * (1 - (1 - 2 * (q.re * Real.sin θ) ^ 2)) = 4 * (q.re * Real.sin θ) ^ 2 := by ring rw [hden] ext <;> simp [-Quaternion.coe_mul, -Quaternion.coe_neg] <;> field_simp [hqre_ne, hsin_ne] <;> ring refine ⟨hAS, ?_⟩ rw [hζ, hAS] dsimp only [rS, v, qIm] ext <;> simp [-Quaternion.coe_div] <;> ring · intro hpos α AN rN rNd have hα_pos : 0 < α := Real.sqrt_pos.mpr hpos have hα_ne : α ≠ 0 := ne_of_gt hα_pos have hpos_ne : 1 - B ^ 2 ≠ 0 := ne_of_gt hpos have hα2 : α ^ 2 = 1 - B ^ 2 := Real.sq_sqrt (le_of_lt hpos) have hAN : AN = (-(ω * B ^ 3 / (1 - B ^ 2)) : ℝ) • v := by dsimp only [AN, Qs, Qsd, a, ad, c, v, qIm, B, Bd] have hden : 2 * (1 + (1 - 2 * (q.re * Real.sin θ) ^ 2)) = 4 * (1 - (q.re * Real.sin θ) ^ 2) := by ring rw [hden] ext <;> simp [-Quaternion.coe_mul, -Quaternion.coe_neg] <;> field_simp [hpos_ne] <;> ring have hinv_dot : star rN * rNd = (ω * B / (1 - B ^ 2) : ℝ) • v := by dsimp only [rN, rNd] rw [Quaternion.star_smul, mul_add, smul_mul_assoc, mul_smul_comm, smul_smul, smul_mul_assoc, mul_smul_comm, smul_smul, Quaternion.star_mul_self, hna] have h1 : 1 / α * (B * Bd / (α * (1 - B ^ 2))) * (1 - B ^ 2) = B * Bd / (1 - B ^ 2) := by field_simp [hα_ne, hpos_ne]; ring_nf; rw [hα2]; ring have h2 : 1 / α * (1 / α) = 1 / (1 - B ^ 2) := by field_simp [hα_ne, hpos_ne]; ring_nf; rw [hα2] rw [Quaternion.smul_coe, h1, h2] dsimp only [a, ad, v, qIm, B, Bd] ext <;> simp [-Quaternion.coe_mul, -Quaternion.coe_div, -Quaternion.coe_sub, -Quaternion.coe_pow, -Quaternion.coe_neg] <;> field_simp [hpos_ne] ring have hhist : rNd = rN * ζ - AN * rN := by rw [hζ, hAN] have hcomm : rN * ((ω * B) • v) - (-(ω * B ^ 3 / (1 - B ^ 2)) : ℝ) • v * rN = rN * ((ω * B / (1 - B ^ 2) : ℝ) • v) := by dsimp only [rN, a, v, qIm] ext <;> simp [-Quaternion.coe_mul] <;> field_simp [hpos_ne] <;> ring have hrN_ms : rN * star rN = ((Quaternion.normSq rN : ℝ) : Q) := by ext <;> simp [Quaternion.normSq_def', -Quaternion.coe_add, -Quaternion.coe_mul, -Quaternion.coe_pow] <;> ring rw [hcomm, ← hinv_dot, ← mul_assoc, hrN_ms] have hrN1 : Quaternion.normSq rN = 1 := by dsimp only [rN]; rw [Quaternion.normSq_smul, hna, div_pow, one_pow, hα2] field_simp [hpos_ne] rw [hrN1, Quaternion.coe_one, one_mul] exact ⟨hAN, hinv_dot, hhist⟩ /-! ## 3. Moving-Manifold Inside-Out Transport & Normal Orthogonality (`eq:hopf-moving-derivative`, `CHECK_TRANSFORMS.py`) -/ /-- `8 × 4` isometric embedding matrix `J_θ` of `I_θ : ℝ⁴ ↪ ℝ⁸`. -/ def eversionMat (θ : ℝ) : Matrix (Fin 8) (Fin 4) ℝ := Matrix.of fun i j => if i = 0 ∧ j = 0 then Real.cos θ else if i = 4 ∧ j = 0 then Real.sin θ else if i = 1 ∧ j = 1 then 1 else if i = 2 ∧ j = 2 then 1 else if i = 3 ∧ j = 3 then 1 else 0 /-- Time derivative `J̇_θ = ω (d/dθ J_θ)` along a turning schedule `θ'(t) = ω`. -/ def eversionMatDeriv (θ ω : ℝ) : Matrix (Fin 8) (Fin 4) ℝ := Matrix.of fun i j => if i = 0 ∧ j = 0 then -(ω * Real.sin θ) else if i = 4 ∧ j = 0 then ω * Real.cos θ else 0 /-- Exact moving-manifold eversion geometry and Navier–Stokes tangent/endomorphism transport (`eq:hopf-moving-derivative`, `eq:hopf-moving-normal`, `CHECK_TRANSFORMS.py` `eversion_geometry` & `eversion_spin_decoder`): 1. `J_θᵀ J_θ = I₄` (isometry) and `J_θᵀ J̇_θ = 0` (**normal orthogonality**: both the geometric velocity `V_t = J̇_θ q` and differential drift `(∂_t L_t) w = J̇_θ w` are strictly orthogonal to the embedded `S³` tangent space `M_t = I_t(S³)`). 2. For any orthonormal `S³` tangent frame `E ∈ ℝ^{4×3}` (`Eᵀ E = I₃`), putting `L = J_θ E` and `L̇ = J̇_θ E`: - `Lᵀ L = I₃`, `Lᵀ L̇ = 0`, `L̇ᵀ L = 0`, - moving covariant time derivative `D_t^I U_t = L ∂_t(L⁻¹ U_t)` cancels `L̇` identically: `Lᵀ (L̇ v + L v') = v'`, - pushed-forward strain/stress endomorphism `D̃ = L D Lᵀ` satisfies exact derivative recovery `Lᵀ (L̇ D Lᵀ + L D L̇ᵀ + L D' Lᵀ) L = D'` and Hilbert–Schmidt norm invariance `‖L D Lᵀ‖_HS² = ‖D‖_HS²`. 3. Retained-spin link covariance: for any unit quaternion left-link `S_L = quatLeftMat r`, the lifted operator `S̃_L = J_θ S_L J_θᵀ` intertwines `J_θ`, decodes faithfully via `J_θᵀ`, and is isometric on the embedded carrier (`J_θᵀ (S̃_Lᵀ S̃_L) J_θ = I₄`). -/ theorem moving_manifold_eversion_transport_and_normal_orthogonality (θ ω : ℝ) (E : Matrix (Fin 4) (Fin 3) ℝ) (hE : Eᵀ * E = 1) (v v' : Fin 3 → ℝ) (D D' : Mat3) (r : Q) (hr : Quaternion.normSq r = 1) (s : Fin 4 → ℝ) : let J := eversionMat θ let Jd := eversionMatDeriv θ ω let L := J * E let Ld := Jd * E let SL := quatLeftMat r let tildeSL := J * SL * Jᵀ (Jᵀ * J = 1 ∧ Jᵀ * Jd = 0 ∧ Jdᵀ * J = 0) ∧ (Lᵀ * L = 1 ∧ Lᵀ * Ld = 0 ∧ Ldᵀ * L = 0) ∧ (Lᵀ.mulVec (Ld.mulVec v + L.mulVec v') = v') ∧ (Lᵀ * (Ld * D * Lᵀ + L * D * Ldᵀ + L * D' * Lᵀ) * L = D' ∧ ((L * D * Lᵀ)ᵀ * (L * D * Lᵀ)).trace = (Dᵀ * D).trace) ∧ (tildeSL.mulVec (J.mulVec s) = J.mulVec (SL.mulVec s) ∧ Jᵀ.mulVec (tildeSL.mulVec (J.mulVec s)) = SL.mulVec s ∧ Jᵀ * (tildeSLᵀ * tildeSL) * J = 1) := by intro J Jd L Ld SL tildeSL have hcs := Real.cos_sq_add_sin_sq θ have hJTJ : Jᵀ * J = 1 := by ext i j fin_cases i <;> fin_cases j <;> simp [J, eversionMat, Matrix.mul_apply, Fin.sum_univ_eight] linarith [hcs] have hJTJd : Jᵀ * Jd = 0 := by ext i j fin_cases i <;> fin_cases j <;> simp [J, Jd, eversionMat, eversionMatDeriv, Matrix.mul_apply, Fin.sum_univ_eight] ring have hJdTJ : Jdᵀ * J = 0 := by have h1 : (Jᵀ * Jd)ᵀ = (0 : Matrix (Fin 4) (Fin 4) ℝ)ᵀ := congrArg Matrix.transpose hJTJd simpa [Matrix.transpose_mul, Matrix.transpose_transpose] using h1 have hLTL : Lᵀ * L = 1 := by dsimp only [L] rw [Matrix.transpose_mul, Matrix.mul_assoc, ← Matrix.mul_assoc Jᵀ J E, hJTJ, Matrix.one_mul, hE] have hLTLd : Lᵀ * Ld = 0 := by dsimp only [L, Ld] rw [Matrix.transpose_mul, Matrix.mul_assoc, ← Matrix.mul_assoc Jᵀ Jd E, hJTJd, Matrix.zero_mul, Matrix.mul_zero] have hLdTL : Ldᵀ * L = 0 := by dsimp only [L, Ld] rw [Matrix.transpose_mul, Matrix.mul_assoc, ← Matrix.mul_assoc Jdᵀ J E, hJdTJ, Matrix.zero_mul, Matrix.mul_zero] have hcov : Lᵀ.mulVec (Ld.mulVec v + L.mulVec v') = v' := by rw [Matrix.mulVec_add, Matrix.mulVec_mulVec, Matrix.mulVec_mulVec, hLTLd, hLTL, Matrix.zero_mulVec, Matrix.one_mulVec, zero_add] have hendo : Lᵀ * (Ld * D * Lᵀ + L * D * Ldᵀ + L * D' * Lᵀ) * L = D' := by have h1 : Lᵀ * (Ld * D * Lᵀ) * L = 0 := by calc Lᵀ * (Ld * D * Lᵀ) * L = (Lᵀ * Ld) * D * (Lᵀ * L) := by simp only [Matrix.mul_assoc] _ = 0 := by rw [hLTLd]; simp have h2 : Lᵀ * (L * D * Ldᵀ) * L = 0 := by calc Lᵀ * (L * D * Ldᵀ) * L = (Lᵀ * L) * D * (Ldᵀ * L) := by simp only [Matrix.mul_assoc] _ = 0 := by rw [hLdTL]; simp have h3 : Lᵀ * (L * D' * Lᵀ) * L = D' := by calc Lᵀ * (L * D' * Lᵀ) * L = (Lᵀ * L) * D' * (Lᵀ * L) := by simp only [Matrix.mul_assoc] _ = D' := by rw [hLTL, Matrix.one_mul, Matrix.mul_one] rw [Matrix.mul_add, Matrix.mul_add, Matrix.add_mul, Matrix.add_mul, h1, h2, h3, zero_add, zero_add] have hhs : ((L * D * Lᵀ)ᵀ * (L * D * Lᵀ)).trace = (Dᵀ * D).trace := by have hprod : (L * D * Lᵀ)ᵀ * (L * D * Lᵀ) = L * (Dᵀ * D) * Lᵀ := by have hgen : ∀ (M : Matrix (Fin 8) (Fin 3) ℝ), Mᵀ * M = 1 → (M * D * Mᵀ)ᵀ * (M * D * Mᵀ) = M * (Dᵀ * D) * Mᵀ := by intro M hM rw [Matrix.transpose_mul, Matrix.transpose_mul, Matrix.transpose_transpose] calc M * (Dᵀ * Mᵀ) * (M * D * Mᵀ) = M * Dᵀ * (Mᵀ * M) * D * Mᵀ := by simp only [Matrix.mul_assoc] _ = M * (Dᵀ * D) * Mᵀ := by rw [hM]; simp only [Matrix.mul_one, Matrix.mul_assoc] exact hgen L hLTL rw [hprod, Matrix.trace_mul_comm (L * (Dᵀ * D)) Lᵀ, ← Matrix.mul_assoc, hLTL, Matrix.one_mul] have hSL_orth : SLᵀ * SL = 1 := by have hq_split : r.re ^ 2 + r.imI ^ 2 + r.imJ ^ 2 + r.imK ^ 2 = 1 := by have := hr; simp only [Quaternion.normSq_def'] at this; linarith ext i j fin_cases i <;> fin_cases j <;> simp [SL, quatLeftMat, Matrix.mul_apply, Fin.sum_univ_four] <;> linarith [hq_split] have hlink1 : tildeSL.mulVec (J.mulVec s) = J.mulVec (SL.mulVec s) := by dsimp only [tildeSL] rw [Matrix.mulVec_mulVec, Matrix.mul_assoc (J * SL) Jᵀ J, hJTJ, Matrix.mul_one, ← Matrix.mulVec_mulVec] have hlink2 : Jᵀ.mulVec (tildeSL.mulVec (J.mulVec s)) = SL.mulVec s := by rw [hlink1, Matrix.mulVec_mulVec, hJTJ, Matrix.one_mulVec] have hlink3 : Jᵀ * (tildeSLᵀ * tildeSL) * J = 1 := by have hmul : tildeSLᵀ * tildeSL = J * (SLᵀ * SL) * Jᵀ := by have hgen : ∀ (M : Matrix (Fin 8) (Fin 4) ℝ) (A : Mat4), Mᵀ * M = 1 → (M * A * Mᵀ)ᵀ * (M * A * Mᵀ) = M * (Aᵀ * A) * Mᵀ := by intro M A hM rw [Matrix.transpose_mul, Matrix.transpose_mul, Matrix.transpose_transpose] calc M * (Aᵀ * Mᵀ) * (M * A * Mᵀ) = M * Aᵀ * (Mᵀ * M) * A * Mᵀ := by simp only [Matrix.mul_assoc] _ = M * (Aᵀ * A) * Mᵀ := by rw [hM]; simp only [Matrix.mul_one, Matrix.mul_assoc] exact hgen J SL hJTJ rw [hmul, hSL_orth, Matrix.mul_one] calc Jᵀ * (J * Jᵀ) * J = (Jᵀ * J) * (Jᵀ * J) := by simp only [Matrix.mul_assoc] _ = 1 := by rw [hJTJ, Matrix.one_mul] exact ⟨⟨hJTJ, hJTJd, hJdTJ⟩, ⟨hLTL, hLTLd, hLdTL⟩, hcov, ⟨hendo, hhs⟩, ⟨hlink1, hlink2, hlink3⟩⟩ /-! ## 4. Archived `S³` Conjugation Motion (`EV3`) & Exact Axis–Hopf Relation -/ /-- Archived `S³` conjugation turning family `F_θ(a + v) = (a + cos θ v, sin θ v)` (`EV3`, `millennium-rainbow/manuscript.tex` `eq:archived-slice-scalar-spectrum`). -/ def conjTurnS7 (θ : ℝ) (q : Q) : Q × Q := ((q.re : Q) + Real.cos θ • qIm q, Real.sin θ • qIm q) /-- Unit imaginary quaternion `i`. -/ def qi : Q := ⟨0, 1, 0, 0⟩ /-- `Proposition EV3` & Axis–Hopf relation (`eq:archived-slice-scalar-spectrum`, `eq:archived-endpoint-conjugation`, `eq:axis-versus-hopf-direction`): 1. `F_θ : S³ ↪ S⁷` is an isometric embedding for every `θ` (`|F_θ(q)|² = |q|²`, inner products preserved), starting at `F_0(q) = (q, 0)` and ending at conjugation `F_π(q) = (q̄, 0)` (orientation reversal of degree `-1`, distinct from antipode `-q`: `Re(q̄) = Re(q)` while `Re(-q) = -Re(q)`). 2. Exact Axis–Hopf relation: for `q = a + b ν` (`ν ∈ Im ℍ`, `|ν|² = 1`), `q i q̄ = (a² - b²) i + (2 b² ⟨ν, i⟩) ν + (2 a b) (ν × i)`. 3. Conjugation `q̄` flips ONLY the cross-product term (`2 a b ↦ -2 a b`), whereas the antipodal map `-q` leaves the Hopf direction `q i q̄` completely unchanged. -/ theorem archived_S3_conjugation_and_axis_hopf_EV3 : (∀ (θ : ℝ) (p q : Q), Quaternion.normSq (conjTurnS7 θ q).1 + Quaternion.normSq (conjTurnS7 θ q).2 = Quaternion.normSq q ∧ qInner8 (conjTurnS7 θ p) (conjTurnS7 θ q) = qInner p q ∧ conjTurnS7 0 q = (q, 0) ∧ conjTurnS7 Real.pi q = (star q, 0) ∧ (star q).re = q.re ∧ (-q).re = -q.re) ∧ (∀ (a b : ℝ) (ν : Q), ν.re = 0 → Quaternion.normSq ν = 1 → let q : Q := (a : Q) + b • ν q * qi * star q = (a ^ 2 - b ^ 2) • qi + (2 * b ^ 2 * qInner ν qi) • ν + (2 * a * b) • qCross ν qi ∧ star q * qi * star (star q) = (a ^ 2 - b ^ 2) • qi + (2 * b ^ 2 * qInner ν qi) • ν - (2 * a * b) • qCross ν qi ∧ (-q) * qi * star (-q) = q * qi * star q) := by refine ⟨?_, ?_⟩ · intro θ p q have hcs := Real.cos_sq_add_sin_sq θ refine ⟨?_, ?_, ?_, ?_, by simp, by simp⟩ · simp [conjTurnS7, qIm, Quaternion.normSq_def'] linear_combination (q.imI ^ 2 + q.imJ ^ 2 + q.imK ^ 2) * hcs · simp [qInner8, qInner, conjTurnS7, qIm] linear_combination (p.imI * q.imI + p.imJ * q.imJ + p.imK * q.imK) * hcs · ext <;> simp [conjTurnS7, qIm] · ext <;> simp [conjTurnS7, qIm, Real.cos_pi, Real.sin_pi] · intro a b ν hνre hν1 q have hνsq : ν.imI ^ 2 + ν.imJ ^ 2 + ν.imK ^ 2 = 1 := by have := hν1; simp only [Quaternion.normSq_def', hνre] at this; linarith refine ⟨?_, ?_, ?_⟩ · dsimp only [q, qi, qInner, qCross] ext <;> simp [hνre] <;> nlinarith [hνsq] · dsimp only [q, qi, qInner, qCross] ext <;> simp [hνre] <;> nlinarith [hνsq] · simp /-! ## 5. Regular `S²` Sphere Eversion Spectral Gap (`EV2`) & Collapse Failure Control -/ /-- Linear collapse homotopy metric factor `(1 - 2 t)²` for `G_t(p) = (1 - 2 t) p`. -/ def linearCollapseMetricFactor (t : ℝ) : ℝ := (1 - 2 * t) ^ 2 /-- `Theorem EV2` (uniform intrinsic scalar spectral gap along a regular `S² → ℝ³` sphere eversion, `eq:eversion-uniform-metric` & `eq:eversion-uniform-scalar-gap`) plus the required rank-loss collapse failure of `G_t(p) = (1 - 2 t) p`: 1. **Uniform EV2 Rayleigh-quotient spectral gap**: On any measure space `(X, μ)` representing `(S², dvol_{γ₀})`, if a smooth regular homotopy `E_t` satisfies uniform 2D metric comparability `c γ₀ ≤ γ_t ≤ C γ₀` (`0 < c ≤ C`) — so the area Jacobian `J` satisfies `c ≤ J x ≤ C` and the intrinsic squared gradient satisfies `C⁻¹ g₀(x) ≤ g_t(x)` — then for any observable `f` with `γ₀`-mean `m₀` and `γ_t`-mean `m_t` (`∫ (f - m_t) J dμ = 0`): - Dirichlet energy comparison: `(c / C) ∫ g₀ dμ ≤ ∫ g_t J dμ`, - Variance minimization & comparison: `∫ (f - m_t)² J dμ ≤ ∫ (f - m₀)² J dμ ≤ C ∫ (f - m₀)² dμ`, - Uniform positive spectral gap: whenever `lam₁ ∫ (f - m₀)² dμ ≤ ∫ g₀ dμ` and `0 < Var_t(f)`, `(c / C²) * lam₁ ≤ (∫ g_t J dμ) / (∫ (f - m_t)² J dμ)`. 2. **Collapse failure control**: The straight-line inside-out map `G_t(p) = (1 - 2 t) p` has metric factor `(1 - 2 t)²`, which vanishes identically at `t = 1/2`, so NO positive lower metric constant `c > 0` exists across `[0, 1]`. -/ theorem regular_S2_eversion_spectral_gap_EV2_and_collapse_obstruction {X : Type*} [MeasurableSpace X] (μ : MeasureTheory.Measure X) {c C lam₁ m₀ m_t : ℝ} (hc : 0 < c) (hC : 0 < C) {J g₀ g_t f : X → ℝ} (hJ_lo : ∀ x, c ≤ J x) (hJ_hi : ∀ x, J x ≤ C) (hg0_nonneg : ∀ x, 0 ≤ g₀ x) (hg_cmp : ∀ x, C⁻¹ * g₀ x ≤ g_t x) (hInt_g0 : MeasureTheory.Integrable g₀ μ) (hInt_gtJ : MeasureTheory.Integrable (fun x => g_t x * J x) μ) (hInt_v0 : MeasureTheory.Integrable (fun x => (f x - m₀) ^ 2) μ) (hInt_vtJ : MeasureTheory.Integrable (fun x => (f x - m_t) ^ 2 * J x) μ) (hInt_v0J : MeasureTheory.Integrable (fun x => (f x - m₀) ^ 2 * J x) μ) (hInt_lin : MeasureTheory.Integrable (fun x => (f x - m_t) * J x) μ) (hInt_J : MeasureTheory.Integrable J μ) (hmean_t : ∫ x, (f x - m_t) * J x ∂μ = 0) (hpoinc : lam₁ * ∫ x, (f x - m₀) ^ 2 ∂μ ≤ ∫ x, g₀ x ∂μ) : ((c / C) * ∫ x, g₀ x ∂μ ≤ ∫ x, g_t x * J x ∂μ) ∧ (∫ x, (f x - m_t) ^ 2 * J x ∂μ ≤ ∫ x, (f x - m₀) ^ 2 * J x ∂μ) ∧ (∫ x, (f x - m₀) ^ 2 * J x ∂μ ≤ C * ∫ x, (f x - m₀) ^ 2 ∂μ) ∧ (0 < ∫ x, (f x - m_t) ^ 2 * J x ∂μ → (c / C ^ 2) * lam₁ ≤ (∫ x, g_t x * J x ∂μ) / (∫ x, (f x - m_t) ^ 2 * J x ∂μ)) ∧ (linearCollapseMetricFactor (1 / 2) = 0 ∧ ¬ ∃ c₀ : ℝ, 0 < c₀ ∧ ∀ t ∈ Set.Icc (0 : ℝ) 1, c₀ ≤ linearCollapseMetricFactor t) := by have hdir : (c / C) * ∫ x, g₀ x ∂μ ≤ ∫ x, g_t x * J x ∂μ := by rw [← MeasureTheory.integral_const_mul] refine MeasureTheory.integral_mono (hInt_g0.const_mul (c / C)) hInt_gtJ fun x => ?_ have hJx : 0 ≤ J x := le_trans (le_of_lt hc) (hJ_lo x) have hgt : 0 ≤ g_t x := le_trans (mul_nonneg (inv_nonneg.mpr (le_of_lt hC)) (hg0_nonneg x)) (hg_cmp x) have hstep1 : (c / C) * g₀ x = (C⁻¹ * g₀ x) * c := by ring rw [hstep1] exact mul_le_mul (hg_cmp x) (hJ_lo x) (le_of_lt hc) hgt have hvar_min : ∫ x, (f x - m_t) ^ 2 * J x ∂μ ≤ ∫ x, (f x - m₀) ^ 2 * J x ∂μ := by have hsplit : (fun x => (f x - m₀) ^ 2 * J x) = (fun x => ((f x - m_t) ^ 2 * J x + (2 * (m_t - m₀)) * ((f x - m_t) * J x)) + ((m_t - m₀) ^ 2) * J x) := by funext x; ring rw [hsplit] have hInt12 : MeasureTheory.Integrable (fun x => (f x - m_t) ^ 2 * J x + (2 * (m_t - m₀)) * ((f x - m_t) * J x)) μ := hInt_vtJ.add (hInt_lin.const_mul (2 * (m_t - m₀))) have hInt3 : MeasureTheory.Integrable (fun x => ((m_t - m₀) ^ 2) * J x) μ := hInt_J.const_mul ((m_t - m₀) ^ 2) rw [MeasureTheory.integral_add hInt12 hInt3, MeasureTheory.integral_add hInt_vtJ (hInt_lin.const_mul (2 * (m_t - m₀))), MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, hmean_t, mul_zero, add_zero] have hJ_nn : 0 ≤ ∫ x, J x ∂μ := MeasureTheory.integral_nonneg fun x => le_trans (le_of_lt hc) (hJ_lo x) nlinarith [sq_nonneg (m_t - m₀), hJ_nn] have hvar_hi : ∫ x, (f x - m₀) ^ 2 * J x ∂μ ≤ C * ∫ x, (f x - m₀) ^ 2 ∂μ := by rw [← MeasureTheory.integral_const_mul] refine MeasureTheory.integral_mono hInt_v0J (hInt_v0.const_mul C) fun x => ?_ have hsq := sq_nonneg (f x - m₀) have h1 := mul_le_mul_of_nonneg_left (hJ_hi x) hsq linarith have hrayleigh : 0 < ∫ x, (f x - m_t) ^ 2 * J x ∂μ → (c / C ^ 2) * lam₁ ≤ (∫ x, g_t x * J x ∂μ) / (∫ x, (f x - m_t) ^ 2 * J x ∂μ) := by intro hvt_pos rw [le_div_iff₀ hvt_pos] have hvt_le : ∫ x, (f x - m_t) ^ 2 * J x ∂μ ≤ C * ∫ x, (f x - m₀) ^ 2 ∂μ := le_trans hvar_min hvar_hi have hnum : (c / C) * (lam₁ * ∫ x, (f x - m₀) ^ 2 ∂μ) ≤ ∫ x, g_t x * J x ∂μ := le_trans (mul_le_mul_of_nonneg_left hpoinc (div_nonneg (le_of_lt hc) (le_of_lt hC))) hdir by_cases hlam : 0 ≤ lam₁ · have h1 : (c / C ^ 2) * lam₁ * (∫ x, (f x - m_t) ^ 2 * J x ∂μ) ≤ (c / C ^ 2) * lam₁ * (C * ∫ x, (f x - m₀) ^ 2 ∂μ) := mul_le_mul_of_nonneg_left hvt_le (mul_nonneg (div_nonneg (le_of_lt hc) (sq_nonneg C)) hlam) have h2 : (c / C ^ 2) * lam₁ * (C * ∫ x, (f x - m₀) ^ 2 ∂μ) = (c / C) * (lam₁ * ∫ x, (f x - m₀) ^ 2 ∂μ) := by field_simp [ne_of_gt hC] linarith · push Not at hlam have hLHS_neg : (c / C ^ 2) * lam₁ * (∫ x, (f x - m_t) ^ 2 * J x ∂μ) ≤ 0 := by have hpos1 : 0 ≤ (c / C ^ 2) * (∫ x, (f x - m_t) ^ 2 * J x ∂μ) := mul_nonneg (div_nonneg (le_of_lt hc) (sq_nonneg C)) (le_of_lt hvt_pos) nlinarith have hRHS_nn : 0 ≤ ∫ x, g_t x * J x ∂μ := MeasureTheory.integral_nonneg fun x => mul_nonneg (le_trans (mul_nonneg (inv_nonneg.mpr (le_of_lt hC)) (hg0_nonneg x)) (hg_cmp x)) (le_trans (le_of_lt hc) (hJ_lo x)) linarith have hcollapse : linearCollapseMetricFactor (1 / 2) = 0 ∧ ¬ ∃ c₀ : ℝ, 0 < c₀ ∧ ∀ t ∈ Set.Icc (0 : ℝ) 1, c₀ ≤ linearCollapseMetricFactor t := by have hzero : linearCollapseMetricFactor (1 / 2) = 0 := by dsimp [linearCollapseMetricFactor]; norm_num refine ⟨hzero, ?_⟩ rintro ⟨c₀, hc₀, hbound⟩ have hmem : (1 / 2 : ℝ) ∈ Set.Icc (0 : ℝ) 1 := by norm_num have := hbound (1 / 2) hmem linarith exact ⟨hdir, hvar_min, hvar_hi, hrayleigh, hcollapse⟩ end end F02NavierStokes.SphereEversionAndTransport