Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/DeTurckTameRemainderNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Analysis.Parabolic.Quasilinear.Charts.Coordinates.ChartStateSourceSmooth |
| 6 | import PoincareLib.Geometry.RicciFlow.Local.Existence.CoordinateEllipticity |
| 7 | import Mathlib.Analysis.Calculus.ContDiff.RCLike |
| 8 | import Mathlib.Analysis.Matrix.Normed |
| 9 | import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm |
| 10 | |
| 11 | /-! |
| 12 | # Mixed estimates for the actual native Ricci-DeTurck remainder |
| 13 | |
| 14 | The full native source is affine in the second jet. Subtracting its fixed |
| 15 | background principal part leaves a small coefficient on the highest jet |
| 16 | difference. Compact lower-jet regions give actual Lipschitz constants for |
| 17 | the inverse metric and the true zero-second source, without bounding the |
| 18 | second jets. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | set_option maxHeartbeats 1800000 |
| 23 | |
| 24 | open Set MeasureTheory Filter |
| 25 | open scoped BigOperators Matrix.Norms.Elementwise |
| 26 | |
| 27 | noncomputable section |
| 28 | |
| 29 | namespace PoincareMT.DeTurckNative |
| 30 | |
| 31 | variable {n : ℕ} |
| 32 | |
| 33 | abbrev MetricLowerJet (n : ℕ) := |
| 34 | Matrix (Fin n) (Fin n) ℝ × (Fin n → Matrix (Fin n) (Fin n) ℝ) |
| 35 | |
| 36 | abbrev MetricSecondJet (n : ℕ) := Fin n → Fin n → Matrix (Fin n) (Fin n) ℝ |
| 37 | |
| 38 | def lowerJetState (p : MetricLowerJet n) (Q : MetricSecondJet n) : ChartState (n := n) := |
| 39 | (p.1, p.2, Q) |
| 40 | |
| 41 | def lowerJetSource (background : MetricJet2 (n := n)) |
| 42 | (p : MetricLowerJet n) : Matrix (Fin n) (Fin n) ℝ := |
| 43 | chartStateSource background (lowerJetState p 0) |
| 44 | |
| 45 | def lowerJetContraction (A : Matrix (Fin n) (Fin n) ℝ) |
| 46 | (Q : MetricSecondJet n) : Matrix (Fin n) (Fin n) ℝ := |
| 47 | fun i j => ∑ a, ∑ b, A a b * Q a b i j |
| 48 | |
| 49 | theorem lowerJetContraction_sub_left (A B : Matrix (Fin n) (Fin n) ℝ) |
| 50 | (Q : MetricSecondJet n) : |
| 51 | lowerJetContraction (A - B) Q = lowerJetContraction A Q - lowerJetContraction B Q := by |
| 52 | ext i j |
| 53 | simp only [lowerJetContraction, Matrix.sub_apply, sub_mul, Finset.sum_sub_distrib] |
| 54 | |
| 55 | theorem lowerJetContraction_sub_right (A : Matrix (Fin n) (Fin n) ℝ) |
| 56 | (Q S : MetricSecondJet n) : |
| 57 | lowerJetContraction A (Q - S) = lowerJetContraction A Q - lowerJetContraction A S := by |
| 58 | ext i j |
| 59 | simp only [lowerJetContraction, Pi.sub_apply, Matrix.sub_apply, mul_sub, |
| 60 | Finset.sum_sub_distrib] |
| 61 | |
| 62 | theorem lowerJetContraction_add_right (A : Matrix (Fin n) (Fin n) ℝ) |
| 63 | (Q S : MetricSecondJet n) : |
| 64 | lowerJetContraction A (Q + S) = lowerJetContraction A Q + lowerJetContraction A S := by |
| 65 | ext i j |
| 66 | simp only [lowerJetContraction, Pi.add_apply, Matrix.add_apply, mul_add, |
| 67 | Finset.sum_add_distrib] |
| 68 | |
| 69 | theorem norm_lowerJetContraction_le (A : Matrix (Fin n) (Fin n) ℝ) |
| 70 | (Q : MetricSecondJet n) : |
| 71 | ‖lowerJetContraction A Q‖ ≤ (n : ℝ) ^ 2 * ‖A‖ * ‖Q‖ := by |
| 72 | apply (Matrix.norm_le_iff (by positivity)).mpr |
| 73 | intro i j |
| 74 | have hterm (a b : Fin n) : ‖A a b * Q a b i j‖ ≤ ‖A‖ * ‖Q‖ := by |
| 75 | rw [norm_mul] |
| 76 | have hQ : ‖Q a b i j‖ ≤ ‖Q‖ := |
| 77 | (Matrix.norm_entry_le_entrywise_sup_norm (Q a b)).trans |
| 78 | ((norm_le_pi_norm (Q a) b).trans (norm_le_pi_norm Q a)) |
| 79 | exact mul_le_mul (Matrix.norm_entry_le_entrywise_sup_norm A) hQ |
| 80 | (norm_nonneg _) (norm_nonneg _) |
| 81 | calc |
| 82 | _ ≤ ∑ a : Fin n, ∑ b : Fin n, ‖A a b * Q a b i j‖ := |
| 83 | (norm_sum_le _ _).trans (Finset.sum_le_sum (fun a _ => norm_sum_le _ _)) |
| 84 | _ ≤ ∑ _a : Fin n, ∑ _b : Fin n, ‖A‖ * ‖Q‖ := |
| 85 | Finset.sum_le_sum (fun a _ => Finset.sum_le_sum (fun b _ => hterm a b)) |
| 86 | _ = _ := by simp [pow_two, mul_assoc] |
| 87 | |
| 88 | theorem contDiff_lowerJetState_zero : |
| 89 | ContDiff ℝ 1 (fun p : MetricLowerJet n => lowerJetState p 0) := by |
| 90 | exact contDiff_fst.prodMk (contDiff_snd.prodMk contDiff_const) |
| 91 | |
| 92 | theorem contDiffAt_lowerJetSource (background : MetricJet2 (n := n)) |
| 93 | (p : MetricLowerJet n) (hp : p.1.PosDef) : ContDiffAt ℝ 1 (lowerJetSource background) p := by |
| 94 | apply contDiffAt_pi.mpr |
| 95 | intro i |
| 96 | apply contDiffAt_pi.mpr |
| 97 | intro j |
| 98 | exact (contDiffAt_chartStateSource background (lowerJetState p 0) hp i j).comp p |
| 99 | contDiff_lowerJetState_zero.contDiffAt |
| 100 | |
| 101 | /-- Both coefficient constants are constructed from the actual native formulas. -/ |
| 102 | theorem exists_lowerJet_coefficient_bounds (background : MetricJet2 (n := n)) |
| 103 | (K : Set (MetricLowerJet n)) (hconv : Convex ℝ K) (hcompact : IsCompact K) |
| 104 | (hpos : ∀ p ∈ K, p.1.PosDef) : |
| 105 | ∃ LI L0 : NNReal, |
| 106 | (∀ p ∈ K, ∀ q ∈ K, ‖p.1⁻¹ - q.1⁻¹‖ ≤ (LI : ℝ) * ‖p - q‖) ∧ |
| 107 | (∀ p ∈ K, ∀ q ∈ K, |
| 108 | ‖lowerJetSource background p - lowerJetSource background q‖ ≤ (L0 : ℝ) * ‖p - q‖) := by |
| 109 | have hinv : ContDiffOn ℝ 1 (fun p : MetricLowerJet n => p.1⁻¹) K := by |
| 110 | intro p hp |
| 111 | have hdet : p.1.det ≠ 0 := |
| 112 | (p.1.isUnit_iff_isUnit_det.mp (hpos p hp).isUnit).ne_zero |
| 113 | exact ((contDiffAt_matrix_inv_of_nonsingular p.1 hdet).comp p |
| 114 | contDiffAt_fst).contDiffWithinAt |
| 115 | have hsource : ContDiffOn ℝ 1 (lowerJetSource background) K := by |
| 116 | intro p hp |
| 117 | exact (contDiffAt_lowerJetSource background p (hpos p hp)).contDiffWithinAt |
| 118 | obtain ⟨LI, hLI⟩ := hinv.exists_lipschitzOnWith one_ne_zero hconv hcompact |
| 119 | obtain ⟨L0, hL0⟩ := hsource.exists_lipschitzOnWith one_ne_zero hconv hcompact |
| 120 | refine ⟨LI, L0, ?_, ?_⟩ |
| 121 | · intro p hp q hq |
| 122 | simpa only [dist_eq_norm] using hLI.dist_le_mul p hp q hq |
| 123 | · intro p hp q hq |
| 124 | simpa only [dist_eq_norm] using hL0.dist_le_mul p hp q hq |
| 125 | |
| 126 | /-- The actual source with only the fixed background second-order operator removed. -/ |
| 127 | def fixedPrincipalRemainder (background : MetricJet2 (n := n)) |
| 128 | (p : MetricLowerJet n) (Q : MetricSecondJet n) : Matrix (Fin n) (Fin n) ℝ := |
| 129 | fun i j => chartStateSource background (lowerJetState p Q) i j - |
| 130 | lowerJetContraction background.value⁻¹ Q i j |
| 131 | |
| 132 | theorem fixedPrincipalRemainder_split (background : MetricJet2 (n := n)) |
| 133 | (p : MetricLowerJet n) (Q : MetricSecondJet n) (hp : p.1.PosDef) |
| 134 | (hQm : ∀ a b i j, Q a b i j = Q a b j i) |
| 135 | (hQd : ∀ a b i j, Q a b i j = Q b a i j) : |
| 136 | fixedPrincipalRemainder background p Q = |
| 137 | lowerJetContraction (p.1⁻¹ - background.value⁻¹) Q + lowerJetSource background p := by |
| 138 | have hG : p.1.IsSymm := by |
| 139 | simpa only [Matrix.isHermitian_iff_isSymm] using hp.isHermitian |
| 140 | ext i j |
| 141 | have hsource : chartStateSource background (lowerJetState p Q) i j = |
| 142 | lowerJetContraction p.1⁻¹ Q i j + lowerJetSource background p i j := |
| 143 | ricciDeTurckSource_quasilinear background (chartStateJet (lowerJetState p Q)) |
| 144 | hG (p.1.isUnit_iff_isUnit_det.mp hp.isUnit).ne_zero hQm hQd i j |
| 145 | change chartStateSource background (lowerJetState p Q) i j - |
| 146 | lowerJetContraction background.value⁻¹ Q i j = _ |
| 147 | rw [lowerJetContraction_sub_left, Matrix.add_apply, Matrix.sub_apply, hsource] |
| 148 | ring |
| 149 | |
| 150 | theorem fixedPrincipalRemainder_sub (background : MetricJet2 (n := n)) |
| 151 | (p q : MetricLowerJet n) (Q S : MetricSecondJet n) |
| 152 | (hp : p.1.PosDef) (hq : q.1.PosDef) |
| 153 | (hQm : ∀ a b i j, Q a b i j = Q a b j i) |
| 154 | (hQd : ∀ a b i j, Q a b i j = Q b a i j) |
| 155 | (hSm : ∀ a b i j, S a b i j = S a b j i) |
| 156 | (hSd : ∀ a b i j, S a b i j = S b a i j) : |
| 157 | fixedPrincipalRemainder background p Q - fixedPrincipalRemainder background q S = |
| 158 | lowerJetContraction (p.1⁻¹ - background.value⁻¹) (Q - S) + |
| 159 | lowerJetContraction (p.1⁻¹ - q.1⁻¹) S + |
| 160 | (lowerJetSource background p - lowerJetSource background q) := by |
| 161 | rw [fixedPrincipalRemainder_split background p Q hp hQm hQd, |
| 162 | fixedPrincipalRemainder_split background q S hq hSm hSd] |
| 163 | simp only [lowerJetContraction_sub_left, lowerJetContraction_sub_right] |
| 164 | abel |
| 165 | |
| 166 | theorem norm_fixedPrincipalRemainder_sub_le (background : MetricJet2 (n := n)) |
| 167 | (p q : MetricLowerJet n) (Q S : MetricSecondJet n) |
| 168 | (hp : p.1.PosDef) (hq : q.1.PosDef) |
| 169 | (hQm : ∀ a b i j, Q a b i j = Q a b j i) |
| 170 | (hQd : ∀ a b i j, Q a b i j = Q b a i j) |
| 171 | (hSm : ∀ a b i j, S a b i j = S a b j i) |
| 172 | (hSd : ∀ a b i j, S a b i j = S b a i j) |
| 173 | {LI L0 : NNReal} |
| 174 | (hI : ‖p.1⁻¹ - q.1⁻¹‖ ≤ (LI : ℝ) * ‖p - q‖) |
| 175 | (hL : ‖lowerJetSource background p - lowerJetSource background q‖ ≤ |
| 176 | (L0 : ℝ) * ‖p - q‖) : |
| 177 | ‖fixedPrincipalRemainder background p Q - fixedPrincipalRemainder background q S‖ ≤ |
| 178 | (n : ℝ) ^ 2 * ‖p.1⁻¹ - background.value⁻¹‖ * ‖Q - S‖ + |
| 179 | ((L0 : ℝ) + (n : ℝ) ^ 2 * (LI : ℝ) * ‖S‖) * ‖p - q‖ := by |
| 180 | rw [fixedPrincipalRemainder_sub background p q Q S hp hq hQm hQd hSm hSd] |
| 181 | calc |
| 182 | _ ≤ (‖lowerJetContraction (p.1⁻¹ - background.value⁻¹) (Q - S)‖ + |
| 183 | ‖lowerJetContraction (p.1⁻¹ - q.1⁻¹) S‖) + |
| 184 | ‖lowerJetSource background p - lowerJetSource background q‖ := |
| 185 | (norm_add_le _ _).trans (add_le_add_left (norm_add_le _ _) _) |
| 186 | _ ≤ ((n : ℝ) ^ 2 * ‖p.1⁻¹ - background.value⁻¹‖ * ‖Q - S‖ + |
| 187 | (n : ℝ) ^ 2 * ((LI : ℝ) * ‖p - q‖) * ‖S‖) + (L0 : ℝ) * ‖p - q‖ := by |
| 188 | apply add_le_add _ hL |
| 189 | apply add_le_add (norm_lowerJetContraction_le _ _) |
| 190 | exact (norm_lowerJetContraction_le _ _).trans |
| 191 | (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hI (sq_nonneg _)) |
| 192 | (norm_nonneg S)) |
| 193 | _ = _ := by ring |
| 194 | |
| 195 | /-- The actual native remainder has mixed estimates with no second-jet norm cap. -/ |
| 196 | theorem exists_fixedPrincipalRemainder_tame (background : MetricJet2 (n := n)) |
| 197 | (K : Set (MetricLowerJet n)) (hconv : Convex ℝ K) (hcompact : IsCompact K) |
| 198 | (hpos : ∀ p ∈ K, p.1.PosDef) : |
| 199 | ∃ LI L0 : NNReal, ∀ p ∈ K, ∀ q ∈ K, ∀ Q S : MetricSecondJet n, |
| 200 | (∀ a b i j, Q a b i j = Q a b j i) → |
| 201 | (∀ a b i j, Q a b i j = Q b a i j) → |
| 202 | (∀ a b i j, S a b i j = S a b j i) → |
| 203 | (∀ a b i j, S a b i j = S b a i j) → |
| 204 | ‖fixedPrincipalRemainder background p Q - fixedPrincipalRemainder background q S‖ ≤ |
| 205 | (n : ℝ) ^ 2 * ‖p.1⁻¹ - background.value⁻¹‖ * ‖Q - S‖ + |
| 206 | ((L0 : ℝ) + (n : ℝ) ^ 2 * (LI : ℝ) * ‖S‖) * ‖p - q‖ := by |
| 207 | obtain ⟨LI, L0, hI, hL⟩ := |
| 208 | exists_lowerJet_coefficient_bounds background K hconv hcompact hpos |
| 209 | refine ⟨LI, L0, ?_⟩ |
| 210 | intro p hp q hq Q S hQm hQd hSm hSd |
| 211 | exact norm_fixedPrincipalRemainder_sub_le background p q Q S (hpos p hp) (hpos q hq) |
| 212 | hQm hQd hSm hSd (hI p hp q hq) (hL p hp q hq) |
| 213 | |
| 214 | /-- Recentring at an actual background metric makes the top coefficient small. -/ |
| 215 | theorem exists_centered_fixedPrincipalRemainder_tame (background : MetricJet2 (n := n)) |
| 216 | (K : Set (MetricLowerJet n)) (hconv : Convex ℝ K) (hcompact : IsCompact K) |
| 217 | (hpos : ∀ p ∈ K, p.1.PosDef) (p0 : MetricLowerJet n) (hp0 : p0 ∈ K) |
| 218 | (hbackground : background.value = p0.1) : |
| 219 | ∃ LI L0 : NNReal, ∀ p ∈ K, ∀ q ∈ K, ∀ Q S : MetricSecondJet n, |
| 220 | (∀ a b i j, Q a b i j = Q a b j i) → |
| 221 | (∀ a b i j, Q a b i j = Q b a i j) → |
| 222 | (∀ a b i j, S a b i j = S a b j i) → |
| 223 | (∀ a b i j, S a b i j = S b a i j) → |
| 224 | ‖fixedPrincipalRemainder background p Q - fixedPrincipalRemainder background q S‖ ≤ |
| 225 | ((n : ℝ) ^ 2 * (LI : ℝ) * ‖p - p0‖) * ‖Q - S‖ + |
| 226 | ((L0 : ℝ) + (n : ℝ) ^ 2 * (LI : ℝ) * ‖S‖) * ‖p - q‖ := by |
| 227 | obtain ⟨LI, L0, hI, hL⟩ := |
| 228 | exists_lowerJet_coefficient_bounds background K hconv hcompact hpos |
| 229 | refine ⟨LI, L0, ?_⟩ |
| 230 | intro p hp q hq Q S hQm hQd hSm hSd |
| 231 | have hsmall : ‖p.1⁻¹ - background.value⁻¹‖ ≤ (LI : ℝ) * ‖p - p0‖ := by |
| 232 | rw [hbackground] |
| 233 | exact hI p hp p0 hp0 |
| 234 | apply (norm_fixedPrincipalRemainder_sub_le background p q Q S (hpos p hp) (hpos q hq) |
| 235 | hQm hQd hSm hSd (hI p hp q hq) (hL p hp q hq)).trans |
| 236 | apply add_le_add_left |
| 237 | calc |
| 238 | _ ≤ (n : ℝ) ^ 2 * ((LI : ℝ) * ‖p - p0‖) * ‖Q - S‖ := |
| 239 | mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hsmall (sq_nonneg _)) |
| 240 | (norm_nonneg _) |
| 241 | _ = _ := by ring |
| 242 | |
| 243 | def backgroundLowerJet (background : MetricJet2 (n := n)) : MetricLowerJet n := |
| 244 | (background.value, background.first) |
| 245 | |
| 246 | /-- The exact coordinate forcing for the perturbation h = g - g0. -/ |
| 247 | def perturbationRemainder (background : MetricJet2 (n := n)) |
| 248 | (dp : MetricLowerJet n) (DQ : MetricSecondJet n) : Matrix (Fin n) (Fin n) ℝ := |
| 249 | fun i j => chartStateSource background |
| 250 | (lowerJetState (backgroundLowerJet background + dp) (background.second + DQ)) i j - |
| 251 | lowerJetContraction background.value⁻¹ DQ i j |
| 252 | |
| 253 | theorem perturbationRemainder_eq (background : MetricJet2 (n := n)) |
| 254 | (dp : MetricLowerJet n) (DQ : MetricSecondJet n) : |
| 255 | perturbationRemainder background dp DQ = |
| 256 | fixedPrincipalRemainder background (backgroundLowerJet background + dp) |
| 257 | (background.second + DQ) + lowerJetContraction background.value⁻¹ background.second := by |
| 258 | ext i j |
| 259 | simp only [perturbationRemainder, fixedPrincipalRemainder, |
| 260 | lowerJetContraction_add_right, Matrix.add_apply] |
| 261 | ring |
| 262 | |
| 263 | theorem perturbationRemainder_sub (background : MetricJet2 (n := n)) |
| 264 | (dp dq : MetricLowerJet n) (DQ DS : MetricSecondJet n) : |
| 265 | perturbationRemainder background dp DQ - perturbationRemainder background dq DS = |
| 266 | fixedPrincipalRemainder background (backgroundLowerJet background + dp) |
| 267 | (background.second + DQ) - |
| 268 | fixedPrincipalRemainder background (backgroundLowerJet background + dq) |
| 269 | (background.second + DS) := by |
| 270 | rw [perturbationRemainder_eq, perturbationRemainder_eq, add_sub_add_right_eq_sub] |
| 271 | |
| 272 | /-- Actual perturbation forcing retains the small highest-derivative coefficient. -/ |
| 273 | theorem exists_perturbationRemainder_tame (background : MetricJet2 (n := n)) |
| 274 | (K : Set (MetricLowerJet n)) (hconv : Convex ℝ K) (hcompact : IsCompact K) |
| 275 | (hpos : ∀ p ∈ K, p.1.PosDef) (hbase : backgroundLowerJet background ∈ K) |
| 276 | (hBm : ∀ a b i j, background.second a b i j = background.second a b j i) |
| 277 | (hBd : ∀ a b i j, background.second a b i j = background.second b a i j) : |
| 278 | ∃ LI L0 : NNReal, ∀ dp dq : MetricLowerJet n, |
| 279 | backgroundLowerJet background + dp ∈ K → |
| 280 | backgroundLowerJet background + dq ∈ K → ∀ DQ DS : MetricSecondJet n, |
| 281 | (∀ a b i j, DQ a b i j = DQ a b j i) → |
| 282 | (∀ a b i j, DQ a b i j = DQ b a i j) → |
| 283 | (∀ a b i j, DS a b i j = DS a b j i) → |
| 284 | (∀ a b i j, DS a b i j = DS b a i j) → |
| 285 | ‖perturbationRemainder background dp DQ - perturbationRemainder background dq DS‖ ≤ |
| 286 | ((n : ℝ) ^ 2 * (LI : ℝ) * ‖dp‖) * ‖DQ - DS‖ + |
| 287 | ((L0 : ℝ) + (n : ℝ) ^ 2 * (LI : ℝ) * ‖background.second + DS‖) * ‖dp - dq‖ := by |
| 288 | obtain ⟨LI, L0, htame⟩ := exists_centered_fixedPrincipalRemainder_tame background K |
| 289 | hconv hcompact hpos (backgroundLowerJet background) hbase rfl |
| 290 | refine ⟨LI, L0, ?_⟩ |
| 291 | intro dp dq hdp hdq DQ DS hQm hQd hSm hSd |
| 292 | have hsumQm : ∀ a b i j, |
| 293 | (background.second + DQ) a b i j = (background.second + DQ) a b j i := by |
| 294 | intro a b i j |
| 295 | simp only [Pi.add_apply, Matrix.add_apply, hBm a b i j, hQm a b i j] |
| 296 | have hsumQd : ∀ a b i j, |
| 297 | (background.second + DQ) a b i j = (background.second + DQ) b a i j := by |
| 298 | intro a b i j |
| 299 | simp only [Pi.add_apply, Matrix.add_apply, hBd a b i j, hQd a b i j] |
| 300 | have hsumSm : ∀ a b i j, |
| 301 | (background.second + DS) a b i j = (background.second + DS) a b j i := by |
| 302 | intro a b i j |
| 303 | simp only [Pi.add_apply, Matrix.add_apply, hBm a b i j, hSm a b i j] |
| 304 | have hsumSd : ∀ a b i j, |
| 305 | (background.second + DS) a b i j = (background.second + DS) b a i j := by |
| 306 | intro a b i j |
| 307 | simp only [Pi.add_apply, Matrix.add_apply, hBd a b i j, hSd a b i j] |
| 308 | rw [perturbationRemainder_sub] |
| 309 | simpa only [add_sub_cancel_left, add_sub_add_left_eq_sub] using |
| 310 | htame (backgroundLowerJet background + dp) hdp (backgroundLowerJet background + dq) hdq |
| 311 | (background.second + DQ) (background.second + DS) hsumQm hsumQd hsumSm hsumSd |
| 312 | |
| 313 | /-- The coefficient region respects metric symmetry in the ambient matrix space. -/ |
| 314 | def symmetricLowerJetBall (p0 : MetricLowerJet n) (r : ℝ) : Set (MetricLowerJet n) := |
| 315 | {p | p.1.IsSymm} ∩ Metric.closedBall p0 r |
| 316 | |
| 317 | theorem convex_symmetricLowerJetBall (p0 : MetricLowerJet n) (r : ℝ) : |
| 318 | Convex ℝ (symmetricLowerJetBall p0 r) := by |
| 319 | have hsymm : Convex ℝ {p : MetricLowerJet n | p.1.IsSymm} := by |
| 320 | intro p hp q hq a b _ _ _ |
| 321 | exact (hp.smul a).add (hq.smul b) |
| 322 | exact hsymm.inter (convex_closedBall p0 r) |
| 323 | |
| 324 | theorem isCompact_symmetricLowerJetBall (p0 : MetricLowerJet n) (r : ℝ) : |
| 325 | IsCompact (symmetricLowerJetBall p0 r) := by |
| 326 | have hclosed : IsClosed {p : MetricLowerJet n | p.1.IsSymm} := |
| 327 | isClosed_eq continuous_fst.matrix_transpose continuous_fst |
| 328 | exact (ProperSpace.isCompact_closedBall p0 r).inter_left hclosed |
| 329 | |
| 330 | theorem mem_symmetricLowerJetBall_center (p0 : MetricLowerJet n) {r : ℝ} |
| 331 | (h0 : p0.1.IsSymm) (hr : 0 ≤ r) : p0 ∈ symmetricLowerJetBall p0 r := |
| 332 | ⟨h0, Metric.mem_closedBall_self hr⟩ |
| 333 | |
| 334 | /-- The radius is obtained from the actual positive background quadratic form. -/ |
| 335 | theorem exists_positive_symmetricLowerJetBall (background : MetricJet2 (n := n)) |
| 336 | (hbackground : background.value.PosDef) : |
| 337 | ∃ r : ℝ, 0 < r ∧ |
| 338 | ∀ p ∈ symmetricLowerJetBall (backgroundLowerJet background) r, p.1.PosDef := by |
| 339 | obtain ⟨r, hr, hpos⟩ := exists_uniform_posDef_perturbation |
| 340 | (fun _ : Unit => background.value) (K := {()}) |
| 341 | (isCompact_singleton : IsCompact ({()} : Set Unit)) |
| 342 | continuous_const.continuousOn (fun _ _ => hbackground) |
| 343 | refine ⟨r, hr, ?_⟩ |
| 344 | intro p hp |
| 345 | apply hpos () (mem_singleton ()) p.1 hp.1 |
| 346 | exact (norm_fst_le (p - backgroundLowerJet background)).trans |
| 347 | (by simpa only [Metric.mem_closedBall, dist_eq_norm] using hp.2) |
| 348 | |
| 349 | /-- Actual small symmetric perturbations have coefficient constants and positivity. -/ |
| 350 | theorem exists_local_perturbationRemainder_tame (background : MetricJet2 (n := n)) |
| 351 | (hbackground : background.value.PosDef) |
| 352 | (hBm : ∀ a b i j, background.second a b i j = background.second a b j i) |
| 353 | (hBd : ∀ a b i j, background.second a b i j = background.second b a i j) : |
| 354 | ∃ r : ℝ, 0 < r ∧ ∃ LI L0 : NNReal, |
| 355 | (∀ dp : MetricLowerJet n, dp.1.IsSymm → ‖dp‖ ≤ r → |
| 356 | (background.value + dp.1).PosDef) ∧ |
| 357 | ∀ dp dq : MetricLowerJet n, |
| 358 | dp.1.IsSymm → dq.1.IsSymm → ‖dp‖ ≤ r → ‖dq‖ ≤ r → |
| 359 | ∀ DQ DS : MetricSecondJet n, |
| 360 | (∀ a b i j, DQ a b i j = DQ a b j i) → |
| 361 | (∀ a b i j, DQ a b i j = DQ b a i j) → |
| 362 | (∀ a b i j, DS a b i j = DS a b j i) → |
| 363 | (∀ a b i j, DS a b i j = DS b a i j) → |
| 364 | ‖perturbationRemainder background dp DQ - perturbationRemainder background dq DS‖ ≤ |
| 365 | ((n : ℝ) ^ 2 * (LI : ℝ) * ‖dp‖) * ‖DQ - DS‖ + |
| 366 | ((L0 : ℝ) + (n : ℝ) ^ 2 * (LI : ℝ) * ‖background.second + DS‖) * |
| 367 | ‖dp - dq‖ := by |
| 368 | obtain ⟨r, hr, hpos⟩ := exists_positive_symmetricLowerJetBall background hbackground |
| 369 | have hBsymm : background.value.IsSymm := by |
| 370 | simpa only [Matrix.isHermitian_iff_isSymm] using hbackground.isHermitian |
| 371 | have hbase : backgroundLowerJet background ∈ |
| 372 | symmetricLowerJetBall (backgroundLowerJet background) r := |
| 373 | mem_symmetricLowerJetBall_center _ hBsymm hr.le |
| 374 | obtain ⟨LI, L0, htame⟩ := exists_perturbationRemainder_tame background |
| 375 | (symmetricLowerJetBall (backgroundLowerJet background) r) |
| 376 | (convex_symmetricLowerJetBall _ _) (isCompact_symmetricLowerJetBall _ _) |
| 377 | hpos hbase hBm hBd |
| 378 | have hmem (dp : MetricLowerJet n) (hsymm : dp.1.IsSymm) (hsmall : ‖dp‖ ≤ r) : |
| 379 | backgroundLowerJet background + dp ∈ |
| 380 | symmetricLowerJetBall (backgroundLowerJet background) r := by |
| 381 | refine ⟨hBsymm.add hsymm, ?_⟩ |
| 382 | simpa only [Metric.mem_closedBall, dist_eq_norm, add_sub_cancel_left] using hsmall |
| 383 | refine ⟨r, hr, LI, L0, ?_, ?_⟩ |
| 384 | · intro dp hsymm hsmall |
| 385 | exact hpos _ (hmem dp hsymm hsmall) |
| 386 | · intro dp dq hdp hdq hp hq DQ DS hQm hQd hSm hSd |
| 387 | exact htame dp dq (hmem dp hdp hp) (hmem dq hdq hq) DQ DS hQm hQd hSm hSd |
| 388 | |
| 389 | /-- A prescribed principal-error threshold determines a positive perturbation radius. -/ |
| 390 | theorem exists_small_principal_perturbationRemainder (background : MetricJet2 (n := n)) |
| 391 | (hbackground : background.value.PosDef) |
| 392 | (hBm : ∀ a b i j, background.second a b i j = background.second a b j i) |
| 393 | (hBd : ∀ a b i j, background.second a b i j = background.second b a i j) |
| 394 | {eps : ℝ} (heps : 0 < eps) : |
| 395 | ∃ r : ℝ, 0 < r ∧ ∃ LI L0 : NNReal, |
| 396 | (∀ dp : MetricLowerJet n, dp.1.IsSymm → ‖dp‖ ≤ r → |
| 397 | (background.value + dp.1).PosDef) ∧ |
| 398 | ∀ dp dq : MetricLowerJet n, |
| 399 | dp.1.IsSymm → dq.1.IsSymm → ‖dp‖ ≤ r → ‖dq‖ ≤ r → |
| 400 | ∀ DQ DS : MetricSecondJet n, |
| 401 | (∀ a b i j, DQ a b i j = DQ a b j i) → |
| 402 | (∀ a b i j, DQ a b i j = DQ b a i j) → |
| 403 | (∀ a b i j, DS a b i j = DS a b j i) → |
| 404 | (∀ a b i j, DS a b i j = DS b a i j) → |
| 405 | ‖perturbationRemainder background dp DQ - perturbationRemainder background dq DS‖ ≤ |
| 406 | eps * ‖DQ - DS‖ + |
| 407 | ((L0 : ℝ) + (n : ℝ) ^ 2 * (LI : ℝ) * ‖background.second + DS‖) * |
| 408 | ‖dp - dq‖ := by |
| 409 | obtain ⟨r0, hr0, LI, L0, hpos, htame⟩ := |
| 410 | exists_local_perturbationRemainder_tame background hbackground hBm hBd |
| 411 | let C : ℝ := (n : ℝ) ^ 2 * (LI : ℝ) |
| 412 | have hC : 0 ≤ C := mul_nonneg (sq_nonneg _) LI.coe_nonneg |
| 413 | have hden : 0 < 1 + C := by linarith |
| 414 | let r : ℝ := min r0 (eps / (1 + C)) |
| 415 | have hr : 0 < r := lt_min hr0 (div_pos heps hden) |
| 416 | have hrr0 : r ≤ r0 := min_le_left _ _ |
| 417 | have hsmall {dp : MetricLowerJet n} (hdp : ‖dp‖ ≤ r) : C * ‖dp‖ ≤ eps := by |
| 418 | have hp : ‖dp‖ ≤ eps / (1 + C) := hdp.trans (min_le_right _ _) |
| 419 | have hmul : ‖dp‖ * (1 + C) ≤ eps := (le_div_iff₀ hden).mp hp |
| 420 | nlinarith [norm_nonneg dp] |
| 421 | refine ⟨r, hr, LI, L0, ?_, ?_⟩ |
| 422 | · intro dp hsymm hdp |
| 423 | exact hpos dp hsymm (hdp.trans hrr0) |
| 424 | · intro dp dq hdp hdq hp hq DQ DS hQm hQd hSm hSd |
| 425 | exact (htame dp dq hdp hdq (hp.trans hrr0) (hq.trans hrr0) |
| 426 | DQ DS hQm hQd hSm hSd).trans |
| 427 | (add_le_add_left (mul_le_mul_of_nonneg_right (hsmall hp) (norm_nonneg _)) _) |
| 428 | |
| 429 | section IntegratedRemainder |
| 430 | |
| 431 | variable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] |
| 432 | (μ : Measure X) |
| 433 | |
| 434 | theorem continuous_lowerJetContraction : |
| 435 | Continuous (fun q : Matrix (Fin n) (Fin n) ℝ × MetricSecondJet n => |
| 436 | lowerJetContraction q.1 q.2) := by |
| 437 | unfold lowerJetContraction |
| 438 | fun_prop |
| 439 | |
| 440 | /-- The affine second-slot identity constructs measurability even for merely L2 second jets. -/ |
| 441 | theorem aestronglyMeasurable_fixedPrincipalRemainder |
| 442 | (background : MetricJet2 (n := n)) {p : X → MetricLowerJet n} |
| 443 | (hp : Continuous p) (hpos : ∀ x, (p x).1.PosDef) |
| 444 | {Q : X → MetricSecondJet n} (hQ : AEStronglyMeasurable Q μ) |
| 445 | (hQm : ∀ x a b i j, Q x a b i j = Q x a b j i) |
| 446 | (hQd : ∀ x a b i j, Q x a b i j = Q x b a i j) : |
| 447 | AEStronglyMeasurable (fun x => fixedPrincipalRemainder background (p x) (Q x)) μ := by |
| 448 | letI : TopologicalSpace.PseudoMetrizableSpace (Matrix (Fin n) (Fin n) ℝ) := |
| 449 | inferInstanceAs (TopologicalSpace.PseudoMetrizableSpace (Fin n → Fin n → ℝ)) |
| 450 | letI : SecondCountableTopology (Matrix (Fin n) (Fin n) ℝ) := |
| 451 | inferInstanceAs (SecondCountableTopology (Fin n → Fin n → ℝ)) |
| 452 | have hinv : Continuous (fun x => (p x).1⁻¹) := by |
| 453 | apply continuous_iff_continuousAt.mpr |
| 454 | intro x |
| 455 | exact (continuousAt_matrix_inv_of_posDef (p x).1 (hpos x)).comp |
| 456 | (f := fun y : X => (p y).1) (hp.fst.continuousAt (x := x)) |
| 457 | have hsource : Continuous (fun x => lowerJetSource background (p x)) := by |
| 458 | apply continuous_iff_continuousAt.mpr |
| 459 | intro x |
| 460 | exact (contDiffAt_lowerJetSource background (p x) (hpos x)).continuousAt.comp |
| 461 | (f := p) (hp.continuousAt (x := x)) |
| 462 | have hcoeff : Continuous (fun x => (p x).1⁻¹ - background.value⁻¹) := |
| 463 | hinv.sub continuous_const |
| 464 | have hcoeffAE : AEStronglyMeasurable |
| 465 | (fun x => (p x).1⁻¹ - background.value⁻¹) μ := hcoeff.aestronglyMeasurable |
| 466 | have hprod := (continuous_lowerJetContraction (n := n)).comp_aestronglyMeasurable |
| 467 | (hcoeffAE.prodMk hQ) |
| 468 | have heq : (fun x => fixedPrincipalRemainder background (p x) (Q x)) = |
| 469 | fun x => lowerJetContraction ((p x).1⁻¹ - background.value⁻¹) (Q x) + |
| 470 | lowerJetSource background (p x) := by |
| 471 | funext x |
| 472 | exact fixedPrincipalRemainder_split background (p x) (Q x) (hpos x) (hQm x) (hQd x) |
| 473 | rw [heq] |
| 474 | exact hprod.add hsource.aestronglyMeasurable |
| 475 | |
| 476 | theorem aestronglyMeasurable_perturbationRemainder |
| 477 | (background : MetricJet2 (n := n)) {dp : X → MetricLowerJet n} |
| 478 | (hp : Continuous dp) (hpos : ∀ x, (background.value + (dp x).1).PosDef) |
| 479 | {Q : X → MetricSecondJet n} (hQ : AEStronglyMeasurable Q μ) |
| 480 | (hBm : ∀ a b i j, background.second a b i j = background.second a b j i) |
| 481 | (hBd : ∀ a b i j, background.second a b i j = background.second b a i j) |
| 482 | (hQm : ∀ x a b i j, Q x a b i j = Q x a b j i) |
| 483 | (hQd : ∀ x a b i j, Q x a b i j = Q x b a i j) : |
| 484 | AEStronglyMeasurable (fun x => perturbationRemainder background (dp x) (Q x)) μ := by |
| 485 | have hm : AEStronglyMeasurable (fun x => fixedPrincipalRemainder background |
| 486 | (backgroundLowerJet background + dp x) (background.second + Q x)) μ := |
| 487 | aestronglyMeasurable_fixedPrincipalRemainder μ background (continuous_const.add hp) |
| 488 | hpos (aestronglyMeasurable_const.add hQ) |
| 489 | (by intro x a b i j; simp only [Pi.add_apply, Matrix.add_apply, hBm, hQm]) |
| 490 | (by intro x a b i j; simp only [Pi.add_apply, Matrix.add_apply, hBd, hQd]) |
| 491 | have heq : (fun x => perturbationRemainder background (dp x) (Q x)) = |
| 492 | fun x => fixedPrincipalRemainder background (backgroundLowerJet background + dp x) |
| 493 | (background.second + Q x) + lowerJetContraction background.value⁻¹ background.second := by |
| 494 | funext x |
| 495 | exact perturbationRemainder_eq background (dp x) (Q x) |
| 496 | rw [heq] |
| 497 | exact hm.add aestronglyMeasurable_const |
| 498 | |
| 499 | private theorem lpNorm_const_mul_norm {V : Type*} [NormedAddCommGroup V] |
| 500 | {f : X → V} (hf : AEStronglyMeasurable f μ) {c : ℝ} (hc : 0 ≤ c) : |
| 501 | lpNorm (fun x => c * ‖f x‖) 2 μ = c * lpNorm f 2 μ := by |
| 502 | change lpNorm (c • (fun x => ‖f x‖)) 2 μ = _ |
| 503 | rw [lpNorm_const_smul, lpNorm_norm hf] |
| 504 | simp only [coe_nnnorm, Real.norm_eq_abs, abs_of_nonneg hc] |
| 505 | |
| 506 | theorem memLp_lpNorm_le_three |
| 507 | {V V₁ V₂ V₃ : Type*} [NormedAddCommGroup V] [NormedAddCommGroup V₁] |
| 508 | [NormedAddCommGroup V₂] [NormedAddCommGroup V₃] |
| 509 | {f : X → V} (hf : AEStronglyMeasurable f μ) |
| 510 | {f₁ : X → V₁} {f₂ : X → V₂} {f₃ : X → V₃} |
| 511 | (h₁ : MemLp f₁ 2 μ) (h₂ : MemLp f₂ 2 μ) (h₃ : MemLp f₃ 2 μ) |
| 512 | {c₁ c₂ c₃ : ℝ} (hc₁ : 0 ≤ c₁) (hc₂ : 0 ≤ c₂) (hc₃ : 0 ≤ c₃) |
| 513 | (hbound : ∀ x, ‖f x‖ ≤ c₁ * ‖f₁ x‖ + c₂ * ‖f₂ x‖ + c₃ * ‖f₃ x‖) : |
| 514 | MemLp f 2 μ ∧ lpNorm f 2 μ ≤ |
| 515 | c₁ * lpNorm f₁ 2 μ + c₂ * lpNorm f₂ 2 μ + c₃ * lpNorm f₃ 2 μ := by |
| 516 | let H₁ : X → ℝ := fun x => c₁ * ‖f₁ x‖ |
| 517 | let H₂ : X → ℝ := fun x => c₂ * ‖f₂ x‖ |
| 518 | let H₃ : X → ℝ := fun x => c₃ * ‖f₃ x‖ |
| 519 | have hH₁ : MemLp H₁ 2 μ := h₁.norm.const_mul c₁ |
| 520 | have hH₂ : MemLp H₂ 2 μ := h₂.norm.const_mul c₂ |
| 521 | have hH₃ : MemLp H₃ 2 μ := h₃.norm.const_mul c₃ |
| 522 | have hH : MemLp (H₁ + H₂ + H₃) 2 μ := (hH₁.add hH₂).add hH₃ |
| 523 | have hnonneg (x : X) : 0 ≤ (H₁ + H₂ + H₃) x := |
| 524 | add_nonneg (add_nonneg (mul_nonneg hc₁ (norm_nonneg _)) |
| 525 | (mul_nonneg hc₂ (norm_nonneg _))) (mul_nonneg hc₃ (norm_nonneg _)) |
| 526 | refine ⟨hH.of_le hf (Eventually.of_forall (fun x => ?_)), ?_⟩ |
| 527 | · change ‖f x‖ ≤ ‖(H₁ + H₂ + H₃) x‖ |
| 528 | rw [Real.norm_eq_abs, abs_of_nonneg (hnonneg x)] |
| 529 | exact hbound x |
| 530 | · calc |
| 531 | _ ≤ lpNorm (H₁ + H₂ + H₃) 2 μ := lpNorm_mono_real hH hbound |
| 532 | _ ≤ (lpNorm H₁ 2 μ + lpNorm H₂ 2 μ) + lpNorm H₃ 2 μ := |
| 533 | (lpNorm_add_le (hH₁.add hH₂) (by norm_num)).trans |
| 534 | (add_le_add (lpNorm_add_le (g := H₂) hH₁ (by norm_num)) le_rfl) |
| 535 | _ = _ := by |
| 536 | rw [lpNorm_const_mul_norm μ h₁.aestronglyMeasurable hc₁, |
| 537 | lpNorm_const_mul_norm μ h₂.aestronglyMeasurable hc₂, |
| 538 | lpNorm_const_mul_norm μ h₃.aestronglyMeasurable hc₃] |
| 539 | |
| 540 | /-- The actual native remainder is L2, with no pointwise bound on either second jet. -/ |
| 541 | theorem exists_small_principal_L2_remainder (background : MetricJet2 (n := n)) |
| 542 | (hbackground : background.value.PosDef) |
| 543 | (hBm : ∀ a b i j, background.second a b i j = background.second a b j i) |
| 544 | (hBd : ∀ a b i j, background.second a b i j = background.second b a i j) |
| 545 | {eps : ℝ} (heps : 0 < eps) : |
| 546 | ∃ r : ℝ, 0 < r ∧ ∃ LI L0 : NNReal, |
| 547 | ∀ (dp dq : X → MetricLowerJet n) (Q S : X → MetricSecondJet n), |
| 548 | Continuous dp → Continuous dq → |
| 549 | (∀ x, (dp x).1.IsSymm) → (∀ x, (dq x).1.IsSymm) → |
| 550 | (∀ x, ‖dp x‖ ≤ r) → (∀ x, ‖dq x‖ ≤ r) → |
| 551 | (∀ x a b i j, Q x a b i j = Q x a b j i) → |
| 552 | (∀ x a b i j, Q x a b i j = Q x b a i j) → |
| 553 | (∀ x a b i j, S x a b i j = S x a b j i) → |
| 554 | (∀ x a b i j, S x a b i j = S x b a i j) → |
| 555 | MemLp (fun x => Q x - S x) 2 μ → MemLp (fun x => dp x - dq x) 2 μ → |
| 556 | MemLp (fun x => background.second + S x) 2 μ → |
| 557 | ∀ b : ℝ, 0 ≤ b → (∀ x, ‖dp x - dq x‖ ≤ b) → |
| 558 | MemLp (fun x => perturbationRemainder background (dp x) (Q x) - |
| 559 | perturbationRemainder background (dq x) (S x)) 2 μ ∧ |
| 560 | lpNorm (fun x => perturbationRemainder background (dp x) (Q x) - |
| 561 | perturbationRemainder background (dq x) (S x)) 2 μ ≤ |
| 562 | eps * lpNorm (fun x => Q x - S x) 2 μ + |
| 563 | (L0 : ℝ) * lpNorm (fun x => dp x - dq x) 2 μ + |
| 564 | ((n : ℝ) ^ 2 * (LI : ℝ) * b) * |
| 565 | lpNorm (fun x => background.second + S x) 2 μ := by |
| 566 | obtain ⟨r, hr, LI, L0, hpos, htame⟩ := |
| 567 | exists_small_principal_perturbationRemainder background hbackground hBm hBd heps |
| 568 | refine ⟨r, hr, LI, L0, ?_⟩ |
| 569 | intro dp dq Q S hp hq hps hqs hpr hqr hQm hQd hSm hSd hQS hpq hBS b hb hbpq |
| 570 | have hS : AEStronglyMeasurable S μ := by |
| 571 | have h := hBS.aestronglyMeasurable.sub |
| 572 | (aestronglyMeasurable_const (b := background.second)) |
| 573 | exact h.congr (Eventually.of_forall (fun x => by |
| 574 | change background.second + S x - background.second = S x |
| 575 | abel)) |
| 576 | have hQ : AEStronglyMeasurable Q μ := by |
| 577 | have h := hQS.aestronglyMeasurable.add hS |
| 578 | exact h.congr (Eventually.of_forall (fun x => sub_add_cancel (Q x) (S x))) |
| 579 | have hR := (aestronglyMeasurable_perturbationRemainder μ background hp |
| 580 | (fun x => hpos (dp x) (hps x) (hpr x)) hQ hBm hBd hQm hQd).sub |
| 581 | (aestronglyMeasurable_perturbationRemainder μ background hq |
| 582 | (fun x => hpos (dq x) (hqs x) (hqr x)) hS hBm hBd hSm hSd) |
| 583 | apply memLp_lpNorm_le_three μ hR hQS hpq hBS heps.le L0.coe_nonneg |
| 584 | (mul_nonneg (mul_nonneg (sq_nonneg _) LI.coe_nonneg) hb) |
| 585 | intro x |
| 586 | have ht := htame (dp x) (dq x) (hps x) (hqs x) (hpr x) (hqr x) |
| 587 | (Q x) (S x) (hQm x) (hQd x) (hSm x) (hSd x) |
| 588 | have hcross := mul_le_mul_of_nonneg_left (hbpq x) |
| 589 | (mul_nonneg (mul_nonneg (sq_nonneg (n : ℝ)) LI.coe_nonneg) |
| 590 | (norm_nonneg (background.second + S x))) |
| 591 | simp only [Pi.sub_apply] |
| 592 | nlinarith only [ht, hcross] |
| 593 | |
| 594 | end IntegratedRemainder |
| 595 | |
| 596 | end PoincareMT.DeTurckNative |