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/DeTurckBackgroundVariationNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.DeTurck.Forcing.DeTurckMixedForcing |
| 6 | import PoincareLib.Geometry.RicciFlow.Local.DeTurck.Forcing.DeTurckTensorForcing |
| 7 | |
| 8 | /-! |
| 9 | # Actual variation of the geometric DeTurck background |
| 10 | |
| 11 | The background and current metric have independent native input tuples around |
| 12 | one fixed reference metric. Background derivatives come from a smooth parameter |
| 13 | field; current derivatives retain the lower trace budget after cancellation. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option maxHeartbeats 1800000 |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | open MeasureTheory Set Filter |
| 23 | open scoped Manifold ContDiff Bundle Topology BigOperators Matrix.Norms.Elementwise |
| 24 | |
| 25 | namespace PoincareMT.DeTurckBackgroundVariationNative |
| 26 | |
| 27 | open TensorProbeNative DeTurckNative DeTurckRationalJetNative DeTurckSourceJetNative |
| 28 | DeTurckJetCoordinatesNative DeTurckJetAffineNative DeTurckCompatibleJetNative |
| 29 | DeTurckMetricProducerNative DeTurckTensorForcingNative |
| 30 | |
| 31 | variable {n : ℕ} |
| 32 | |
| 33 | /-- Changing only the background leaves the current second-jet term unchanged. -/ |
| 34 | theorem source_background_difference (B C q : MetricJet2 (n := n)) (i j : Fin n) : |
| 35 | ricciDeTurckSource B q i j - ricciDeTurckSource C q i j = |
| 36 | ricciDeTurckSource B (eraseSecondJet q) i j - |
| 37 | ricciDeTurckSource C (eraseSecondJet q) i j := by |
| 38 | rw [ricciDeTurckSource_split B q, ricciDeTurckSource_split C q] |
| 39 | ring |
| 40 | |
| 41 | variable {M iota : Type*} [TopologicalSpace M] [T2Space M] |
| 42 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 43 | [CompactSpace M] [SecondCountableTopology M] [MeasurableSpace M] [BorelSpace M] |
| 44 | [Fintype iota] (F : iota → SmoothField (n := n) (M := M)) |
| 45 | {base : M} {K : Set M} (C : Cutoffs (n := n) base K) (g0 : RiemannianMetric n M) |
| 46 | |
| 47 | def varyingLowAtom (p : Expr (Fin n ⊕ iota) n) (m kb : ℕ) |
| 48 | (hbg : p.metricOrder true ≤ kb) |
| 49 | (InvB InvC : C(M, Matrix (Fin n) (Fin n) ℝ) → C(M, Matrix (Fin n) (Fin n) ℝ)) : |
| 50 | LowAtom p m → (NativeProbeContinuous (M := M) (iota := iota) kb × |
| 51 | NativeProbeContinuous (M := M) (iota := iota) m) → C(M, ℝ) |
| 52 | | ⟨⟨.metric false word i j, _⟩, hw⟩, Q => matrixWordContinuous F C g0 word hw i j Q.2 |
| 53 | | ⟨⟨.metric true word i j, ha⟩, _⟩, Q => matrixWordContinuous F C g0 word |
| 54 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j Q.1 |
| 55 | | ⟨⟨.inverse false i j, _⟩, _⟩, Q => inverseEntryContinuous F C g0 InvC i j Q.2 |
| 56 | | ⟨⟨.inverse true i j, _⟩, _⟩, Q => inverseEntryContinuous F C g0 InvB i j Q.1 |
| 57 | |
| 58 | theorem contDiff_varyingLowAtom (p : Expr (Fin n ⊕ iota) n) (m kb : ℕ) |
| 59 | (hbg : p.metricOrder true ≤ kb) |
| 60 | (InvB InvC : C(M, Matrix (Fin n) (Fin n) ℝ) → C(M, Matrix (Fin n) (Fin n) ℝ)) |
| 61 | (hInvB : ContDiff ℝ ∞ InvB) (hInvC : ContDiff ℝ ∞ InvC) (a : LowAtom p m) : |
| 62 | ContDiff ℝ ∞ (varyingLowAtom F C g0 p m kb hbg InvB InvC a) := by |
| 63 | rcases a with ⟨⟨a, ha⟩, hw⟩ |
| 64 | cases a with |
| 65 | | metric b word i j => |
| 66 | cases b with |
| 67 | | false => exact (contDiff_matrixWordContinuous F C g0 word hw i j).comp contDiff_snd |
| 68 | | true => exact (contDiff_matrixWordContinuous F C g0 word |
| 69 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j).comp contDiff_fst |
| 70 | | inverse b i j => |
| 71 | cases b with |
| 72 | | false => exact (contDiff_inverseEntryContinuous F C g0 InvC hInvC i j).comp contDiff_snd |
| 73 | | true => exact (contDiff_inverseEntryContinuous F C g0 InvB hInvB i j).comp contDiff_fst |
| 74 | |
| 75 | def varyingLowTuple (p : Expr (Fin n ⊕ iota) n) (m kb : ℕ) |
| 76 | (hbg : p.metricOrder true ≤ kb) |
| 77 | (InvB InvC : C(M, Matrix (Fin n) (Fin n) ℝ) → C(M, Matrix (Fin n) (Fin n) ℝ)) |
| 78 | (Q : NativeProbeContinuous (M := M) (iota := iota) kb × |
| 79 | NativeProbeContinuous (M := M) (iota := iota) m) : C(M, LowAtom p m → ℝ) := |
| 80 | packContinuous (fun a => varyingLowAtom F C g0 p m kb hbg InvB InvC a Q) |
| 81 | |
| 82 | theorem contDiff_varyingLowTuple (p : Expr (Fin n ⊕ iota) n) (m kb : ℕ) |
| 83 | (hbg : p.metricOrder true ≤ kb) |
| 84 | (InvB InvC : C(M, Matrix (Fin n) (Fin n) ℝ) → C(M, Matrix (Fin n) (Fin n) ℝ)) |
| 85 | (hInvB : ContDiff ℝ ∞ InvB) (hInvC : ContDiff ℝ ∞ InvC) : |
| 86 | ContDiff ℝ ∞ (varyingLowTuple F C g0 p m kb hbg InvB InvC) := by |
| 87 | apply (packContinuous (M := M) (A := LowAtom p m)).contDiff.comp |
| 88 | exact contDiff_pi.mpr (contDiff_varyingLowAtom F C g0 p m kb hbg InvB InvC hInvB hInvC) |
| 89 | |
| 90 | theorem varyingLowTuple_eq |
| 91 | (hF : ∀ (x : M) (v : TangentSpace (𝓡 n) x), |
| 92 | (∑ a, g0.inner x (F a x) v • F a x) = v) |
| 93 | (p : Expr (Fin n ⊕ iota) n) (m kb : ℕ) (hbg : p.metricOrder true ≤ kb) |
| 94 | (InvB InvC : C(M, Matrix (Fin n) (Fin n) ℝ) → C(M, Matrix (Fin n) (Fin n) ℝ)) |
| 95 | (QB : NativeProbeContinuous (M := M) (iota := iota) kb) |
| 96 | (QC : NativeProbeContinuous (M := M) (iota := iota) m) |
| 97 | (background g : RiemannianMetric n M) |
| 98 | (hQB : ∀ ab w (hw : w.length ≤ kb) x, |
| 99 | QB ab (wordIndex w hw) x = directionalWord F w (probeDifference F background g0 ab) x) |
| 100 | (hQC : ∀ ab w (hw : w.length ≤ m) x, |
| 101 | QC ab (wordIndex w hw) x = directionalWord F w (probeDifference F g g0 ab) x) |
| 102 | (hInvB : ∀ x, InvB (matrixValueContinuous F C g0 QB) x = |
| 103 | (matrixValueContinuous F C g0 QB x)⁻¹) |
| 104 | (hInvC : ∀ x, InvC (matrixValueContinuous F C g0 QC) x = |
| 105 | (matrixValueContinuous F C g0 QC x)⁻¹) (x : M) (a : LowAtom p m) : |
| 106 | varyingLowTuple F C g0 p m kb hbg InvB InvC (QB, QC) x a = |
| 107 | nativeValues (combinedFields F C) (compatibleMatrix C background g) x a.val.val := by |
| 108 | rw [varyingLowTuple, packContinuous_apply] |
| 109 | rcases a with ⟨⟨a, ha⟩, hw⟩ |
| 110 | cases a with |
| 111 | | metric b word i j => |
| 112 | cases b with |
| 113 | | false => exact matrixWordContinuous_eq F C g0 hF word hw i j QC g hQC x |
| 114 | | true => |
| 115 | exact matrixWordContinuous_eq F C g0 hF word |
| 116 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j QB background hQB x |
| 117 | | inverse b i j => |
| 118 | cases b with |
| 119 | | false => |
| 120 | change InvC (matrixValueContinuous F C g0 QC) x i j = (C.matrix g x)⁻¹ i j |
| 121 | rw [hInvC, matrixValueContinuous_eq F C g0 hF QC g hQC x] |
| 122 | | true => |
| 123 | change InvB (matrixValueContinuous F C g0 QB) x i j = (C.matrix background x)⁻¹ i j |
| 124 | rw [hInvB, matrixValueContinuous_eq F C g0 hF QB background hQB x] |
| 125 | |
| 126 | variable (μ : Measure M) [IsFiniteMeasure μ] |
| 127 | |
| 128 | def varyingHighAtom (p : Expr (Fin n ⊕ iota) n) (m kb kc : ℕ) |
| 129 | (hbg : p.metricOrder true ≤ kb) (hcur : p.metricOrder false ≤ kc) : |
| 130 | HighAtom p m → (NativeProbeContinuous (M := M) (iota := iota) kb × |
| 131 | NativeProbeL2 (iota := iota) μ kc) → Lp ℝ 2 μ |
| 132 | | ⟨⟨.metric false word i j, ha⟩, _⟩, Q => matrixWordL2 F C g0 μ word |
| 133 | ((p.word_length_le_metricOrder_of_mem false word i j ha).trans hcur) i j Q.2 |
| 134 | | ⟨⟨.metric true word i j, ha⟩, _⟩, Q => ContinuousMap.toLp 2 μ ℝ |
| 135 | (matrixWordContinuous F C g0 word |
| 136 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j Q.1) |
| 137 | | ⟨⟨.inverse _ _ _, _⟩, hw⟩, _ => False.elim (hw (Nat.zero_le m)) |
| 138 | |
| 139 | theorem contDiff_varyingHighAtom (p : Expr (Fin n ⊕ iota) n) (m kb kc : ℕ) |
| 140 | (hbg : p.metricOrder true ≤ kb) (hcur : p.metricOrder false ≤ kc) (a : HighAtom p m) : |
| 141 | ContDiff ℝ ∞ (varyingHighAtom F C g0 μ p m kb kc hbg hcur a) := by |
| 142 | rcases a with ⟨⟨a, ha⟩, hw⟩ |
| 143 | cases a with |
| 144 | | metric b word i j => |
| 145 | cases b with |
| 146 | | false => exact (contDiff_matrixWordL2 F C g0 μ word |
| 147 | ((p.word_length_le_metricOrder_of_mem false word i j ha).trans hcur) i j).comp contDiff_snd |
| 148 | | true => |
| 149 | exact (ContinuousMap.toLp 2 μ ℝ : C(M, ℝ) →L[ℝ] Lp ℝ 2 μ).contDiff.comp |
| 150 | ((contDiff_matrixWordContinuous F C g0 word |
| 151 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j).comp contDiff_fst) |
| 152 | | inverse b i j => exact False.elim (hw (Nat.zero_le m)) |
| 153 | |
| 154 | def varyingHighTuple (p : Expr (Fin n ⊕ iota) n) (m kb kc : ℕ) |
| 155 | (hbg : p.metricOrder true ≤ kb) (hcur : p.metricOrder false ≤ kc) |
| 156 | (Q : NativeProbeContinuous (M := M) (iota := iota) kb × |
| 157 | NativeProbeL2 (iota := iota) μ kc) : Lp (HighAtom p m → ℝ) 2 μ := |
| 158 | packL2 μ (fun a => varyingHighAtom F C g0 μ p m kb kc hbg hcur a Q) |
| 159 | |
| 160 | theorem contDiff_varyingHighTuple (p : Expr (Fin n ⊕ iota) n) (m kb kc : ℕ) |
| 161 | (hbg : p.metricOrder true ≤ kb) (hcur : p.metricOrder false ≤ kc) : |
| 162 | ContDiff ℝ ∞ (varyingHighTuple F C g0 μ p m kb kc hbg hcur) := by |
| 163 | apply (packL2 (A := HighAtom p m) μ).contDiff.comp |
| 164 | exact contDiff_pi.mpr (contDiff_varyingHighAtom F C g0 μ p m kb kc hbg hcur) |
| 165 | |
| 166 | theorem varyingHighTuple_ae_eq |
| 167 | (hF : ∀ (x : M) (v : TangentSpace (𝓡 n) x), |
| 168 | (∑ a, g0.inner x (F a x) v • F a x) = v) |
| 169 | (p : Expr (Fin n ⊕ iota) n) (m kb kc : ℕ) |
| 170 | (hbg : p.metricOrder true ≤ kb) (hcur : p.metricOrder false ≤ kc) |
| 171 | (QB : NativeProbeContinuous (M := M) (iota := iota) kb) |
| 172 | (HC : NativeProbeL2 (iota := iota) μ kc) (background g : RiemannianMetric n M) |
| 173 | (hQB : ∀ ab w (hw : w.length ≤ kb) x, |
| 174 | QB ab (wordIndex w hw) x = directionalWord F w (probeDifference F background g0 ab) x) |
| 175 | (hHC : ∀ ab w (hw : w.length ≤ kc), |
| 176 | HC ab (wordIndex w hw) =ᵐ[μ] directionalWord F w (probeDifference F g g0 ab)) : |
| 177 | varyingHighTuple F C g0 μ p m kb kc hbg hcur (QB, HC) =ᵐ[μ] fun x a => |
| 178 | nativeValues (combinedFields F C) (compatibleMatrix C background g) x a.val.val := by |
| 179 | apply packL2_ae_eq |
| 180 | intro a |
| 181 | rcases a with ⟨⟨a, ha⟩, hw⟩ |
| 182 | cases a with |
| 183 | | metric b word i j => |
| 184 | cases b with |
| 185 | | false => |
| 186 | exact matrixWordL2_ae_eq F C g0 μ hF word |
| 187 | ((p.word_length_le_metricOrder_of_mem false word i j ha).trans hcur) i j HC g hHC |
| 188 | | true => |
| 189 | filter_upwards [ContinuousMap.coeFn_toLp (p := (2 : ENNReal)) (μ := μ) (𝕜 := ℝ) |
| 190 | (matrixWordContinuous F C g0 word |
| 191 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j QB)] with x hx |
| 192 | exact hx.trans (matrixWordContinuous_eq F C g0 hF word |
| 193 | ((p.word_length_le_metricOrder_of_mem true word i j ha).trans hbg) i j QB background hQB x) |
| 194 | | inverse b i j => exact False.elim (hw (Nat.zero_le m)) |
| 195 | |
| 196 | /-- Every background atom is reconstructed from the independent smooth background input. -/ |
| 197 | theorem exists_smooth_varying_jet_action |
| 198 | (hF : ∀ (x : M) (v : TangentSpace (𝓡 n) x), |
| 199 | (∑ a, g0.inner x (F a x) v • F a x) = v) |
| 200 | (p : Expr (Fin n ⊕ iota) n) (m kb kc : ℕ) (hp : p.degree ≤ 2 * m) |
| 201 | (hbg : p.metricOrder true ≤ kb) (hcur : p.metricOrder false ≤ kc) : |
| 202 | ∃ delta : ℝ, 0 < delta ∧ |
| 203 | ∃ Phi : (NativeProbeContinuous (M := M) (iota := iota) kb × |
| 204 | (NativeProbeContinuous (M := M) (iota := iota) m × |
| 205 | NativeProbeL2 (iota := iota) μ kc)) → Lp ℝ 2 μ, |
| 206 | ContDiff ℝ ∞ Phi ∧ |
| 207 | ∀ QB : NativeProbeContinuous (M := M) (iota := iota) kb, ‖QB‖ < delta → |
| 208 | ∀ QC : NativeProbeContinuous (M := M) (iota := iota) m, ‖QC‖ < delta → |
| 209 | ∀ HC : NativeProbeL2 (iota := iota) μ kc, ∀ background g : RiemannianMetric n M, |
| 210 | (∀ ab w (hw : w.length ≤ kb) x, |
| 211 | QB ab (wordIndex w hw) x = directionalWord F w (probeDifference F background g0 ab) x) → |
| 212 | (∀ ab w (hw : w.length ≤ m) x, |
| 213 | QC ab (wordIndex w hw) x = directionalWord F w (probeDifference F g g0 ab) x) → |
| 214 | (∀ ab w (hw : w.length ≤ kc), |
| 215 | HC ab (wordIndex w hw) =ᵐ[μ] directionalWord F w (probeDifference F g g0 ab)) → |
| 216 | Phi (QB, QC, HC) =ᵐ[μ] fun x => |
| 217 | p.eval (nativeValues (combinedFields F C) (compatibleMatrix C background g) x) := by |
| 218 | obtain ⟨db, hdb, InvB, hInvB, hInvBEq⟩ := exists_smooth_native_inverse_extension F C g0 kb |
| 219 | obtain ⟨dc, hdc, InvC, hInvC, hInvCEq⟩ := exists_smooth_native_inverse_extension F C g0 m |
| 220 | let low := varyingLowTuple F C g0 p m kb hbg InvB InvC |
| 221 | let high := varyingHighTuple F C g0 μ p m kb kc hbg hcur |
| 222 | let Phi := fun z : NativeProbeContinuous (M := M) (iota := iota) kb × |
| 223 | (NativeProbeContinuous (M := M) (iota := iota) m × NativeProbeL2 (iota := iota) μ kc) => |
| 224 | finiteSpatialJetAction μ p m (low (z.1, z.2.1), high (z.1, z.2.2)) |
| 225 | have hlow : ContDiff ℝ ∞ low := |
| 226 | contDiff_varyingLowTuple F C g0 p m kb hbg InvB InvC hInvB hInvC |
| 227 | have hhigh : ContDiff ℝ ∞ high := contDiff_varyingHighTuple F C g0 μ p m kb kc hbg hcur |
| 228 | refine ⟨min db dc, lt_min hdb hdc, Phi, ?_, ?_⟩ |
| 229 | · exact (contDiff_finiteSpatialJetAction μ p m).comp |
| 230 | ((hlow.comp (contDiff_fst.prodMk (contDiff_fst.comp contDiff_snd))).prodMk |
| 231 | (hhigh.comp (contDiff_fst.prodMk (contDiff_snd.comp contDiff_snd)))) |
| 232 | · intro QB hQBsmall QC hQCsmall HC background g hQB hQC hHC |
| 233 | apply finiteSpatialJetAction_ae_eq_eval μ p m hp |
| 234 | (low (QB, QC), high (QB, HC)) |
| 235 | (fun x => nativeValues (combinedFields F C) (compatibleMatrix C background g) x) |
| 236 | · intro x |
| 237 | funext a |
| 238 | exact (varyingLowTuple_eq F C g0 hF p m kb hbg InvB InvC QB QC background g hQB hQC |
| 239 | (hInvBEq QB (hQBsmall.trans_le (min_le_left _ _))) |
| 240 | (hInvCEq QC (hQCsmall.trans_le (min_le_right _ _))) x a).symm |
| 241 | · exact (varyingHighTuple_ae_eq F C g0 μ hF p m kb kc hbg hcur |
| 242 | QB HC background g hQB hHC).symm |
| 243 | |
| 244 | private theorem ordered_sub (word : List iota) {f q : M → ℝ} |
| 245 | (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f) (hq : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ q) : |
| 246 | directionalWord F word (fun x => f x - q x) = |
| 247 | fun x => directionalWord F word f x - directionalWord F word q x := by |
| 248 | induction word with |
| 249 | | nil => rfl |
| 250 | | cons a word ih => |
| 251 | funext x |
| 252 | rw [directionalWord_cons, ih] |
| 253 | exact scalarDirectional_sub (F a) |
| 254 | ((directionalWord_contMDiff F word hf).mdifferentiable (by simp) x) |
| 255 | ((directionalWord_contMDiff F word hq).mdifferentiable (by simp) x) |
| 256 | |
| 257 | private theorem ordered_zero (word : List iota) : |
| 258 | directionalWord F word (fun _ : M => (0 : ℝ)) = fun _ => 0 := by |
| 259 | induction word with |
| 260 | | nil => rfl |
| 261 | | cons a word ih => |
| 262 | rw [directionalWord_cons, ih] |
| 263 | funext x |
| 264 | simp only [scalarDirectional, mfderiv_const] |
| 265 | rfl |
| 266 | |
| 267 | theorem zero_native_probes (kb : ℕ) (ab : iota × iota) |
| 268 | (word : List iota) (hw : word.length ≤ kb) (x : M) : |
| 269 | (0 : NativeProbeContinuous (M := M) (iota := iota) kb) ab (wordIndex word hw) x = |
| 270 | directionalWord F word (probeDifference F g0 g0 ab) x := by |
| 271 | have hp : probeDifference F g0 g0 ab = fun _ => 0 := by |
| 272 | funext y |
| 273 | exact sub_self _ |
| 274 | rw [hp, ordered_zero] |
| 275 | rfl |
| 276 | |
| 277 | def backgroundDifferenceEntry (background g : RiemannianMetric n M) |
| 278 | (i j : Fin n) (x : M) : ℝ := |
| 279 | ricciDeTurckSource (C.jet background x) (C.jet g x) i j - |
| 280 | ricciDeTurckSource (C.jet g0 x) (C.jet g x) i j |
| 281 | |
| 282 | theorem backgroundDifferenceEntry_eq_lower (background g : RiemannianMetric n M) |
| 283 | (i j : Fin n) (x : M) : |
| 284 | backgroundDifferenceEntry C g0 background g i j x = |
| 285 | lowerJetSource (C.jet background x) (backgroundLowerJet (C.jet g x)) i j - |
| 286 | lowerJetSource (C.jet g0 x) (backgroundLowerJet (C.jet g x)) i j := |
| 287 | source_background_difference (C.jet background x) (C.jet g0 x) (C.jet g x) i j |
| 288 | |
| 289 | include F in |
| 290 | theorem lowerSource_contMDiff (background g : RiemannianMetric n M) (i j : Fin n) : |
| 291 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ |
| 292 | (fun x => lowerJetSource (C.jet background x) (backgroundLowerJet (C.jet g x)) i j) := by |
| 293 | have heq : (fun x => lowerJetSource (C.jet background x) (backgroundLowerJet (C.jet g x)) i j) = |
| 294 | fun x => (sourceExpr (Sum.inl : Fin n → Fin n ⊕ iota) true i j).eval |
| 295 | (nativeValues (combinedFields F C) (compatibleMatrix C background g) x) := by |
| 296 | funext x |
| 297 | exact (eval_lower_sourceExpr_compatible F C background g i j x).symm |
| 298 | rw [heq] |
| 299 | exact Expr.native_contMDiff _ (combinedFields F C) (compatibleMatrix C background g) |
| 300 | (compatibleMatrix_contMDiff C background g) (compatibleMatrix_det_ne_zero C background g) |
| 301 | |
| 302 | include F in |
| 303 | theorem backgroundDifferenceEntry_contMDiff (background g : RiemannianMetric n M) |
| 304 | (i j : Fin n) : |
| 305 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (backgroundDifferenceEntry C g0 background g i j) := by |
| 306 | have heq : backgroundDifferenceEntry C g0 background g i j = fun x => |
| 307 | lowerJetSource (C.jet background x) (backgroundLowerJet (C.jet g x)) i j - |
| 308 | lowerJetSource (C.jet g0 x) (backgroundLowerJet (C.jet g x)) i j := |
| 309 | funext (backgroundDifferenceEntry_eq_lower C g0 background g i j) |
| 310 | rw [heq] |
| 311 | exact (lowerSource_contMDiff F C background g i j).sub (lowerSource_contMDiff F C g0 g i j) |
| 312 | |
| 313 | theorem ordered_backgroundDifferenceEntry (background g : RiemannianMetric n M) |
| 314 | (i j : Fin n) (word : List iota) (x : M) : |
| 315 | ((sourceExpr Sum.inl true i j).orderedDerivative (word.map Sum.inr)).eval |
| 316 | (nativeValues (combinedFields F C) (compatibleMatrix C background g) x) - |
| 317 | ((sourceExpr Sum.inl true i j).orderedDerivative (word.map Sum.inr)).eval |
| 318 | (nativeValues (combinedFields F C) (compatibleMatrix C g0 g) x) = |
| 319 | directionalWord F word (backgroundDifferenceEntry C g0 background g i j) x := by |
| 320 | rw [ordered_lower_sourceExpr_compatible, ordered_lower_sourceExpr_compatible] |
| 321 | have heq : backgroundDifferenceEntry C g0 background g i j = fun y => |
| 322 | lowerJetSource (C.jet background y) (backgroundLowerJet (C.jet g y)) i j - |
| 323 | lowerJetSource (C.jet g0 y) (backgroundLowerJet (C.jet g y)) i j := |
| 324 | funext (backgroundDifferenceEntry_eq_lower C g0 background g i j) |
| 325 | rw [heq, ordered_sub F word (lowerSource_contMDiff F C background g i j) |
| 326 | (lowerSource_contMDiff F C g0 g i j)] |
| 327 | |
| 328 | theorem backgroundDifferenceEntry_eq_intrinsic (background g : RiemannianMetric n M) |
| 329 | (D : LeviCivitaData g) (B : LeviCivitaData background) (B0 : LeviCivitaData g0) |
| 330 | {x : M} (hx : x ∈ K) (i j : Fin n) : |
| 331 | backgroundDifferenceEntry C g0 background g i j x = |
| 332 | (smoothRicciDeTurckTensor D B - smoothRicciDeTurckTensor D B0) x |
| 333 | (C.field i x) (C.field j x) := by |
| 334 | have hsource (b : RiemannianMetric n M) (Db : LeviCivitaData b) : |
| 335 | ricciDeTurckSource (C.jet b x) (C.jet g x) i j = |
| 336 | smoothRicciDeTurckTensor D Db x (C.field i x) (C.field j x) := by |
| 337 | rw [C.jet_eq_on b hx, C.jet_eq_on g hx, |
| 338 | (C.field_eventuallyEq (C.zeta_one x (C.mem_eta_support hx)) i).eq_of_nhds, |
| 339 | (C.field_eventuallyEq (C.zeta_one x (C.mem_eta_support hx)) j).eq_of_nhds, |
| 340 | smoothRicciDeTurckTensor_apply] |
| 341 | exact ricciDeTurckSource_frameMetricJet_eq_intrinsic D Db base |
| 342 | (C.eta_support (C.mem_eta_support hx)) i j |
| 343 | change ricciDeTurckSource (C.jet background x) (C.jet g x) i j - |
| 344 | ricciDeTurckSource (C.jet g0 x) (C.jet g x) i j = |
| 345 | smoothRicciDeTurckTensor D B x (C.field i x) (C.field j x) - |
| 346 | smoothRicciDeTurckTensor D B0 x (C.field i x) (C.field j x) |
| 347 | rw [hsource background B, hsource g0 B0] |
| 348 | |
| 349 | private theorem backgroundOrder_le_degree {jota : Type*} (p : Expr jota n) (b : Bool) : |
| 350 | p.metricOrder b ≤ p.degree := by |
| 351 | induction p with |
| 352 | | constant c => exact le_rfl |
| 353 | | atom a => |
| 354 | cases a with |
| 355 | | metric c word i j => |
| 356 | simp only [Expr.metricOrder, Expr.degree, Atom.weight] |
| 357 | split_ifs <;> omega |
| 358 | | inverse c i j => exact le_rfl |
| 359 | | add p q hp hq => exact max_le_max hp hq |
| 360 | | mul p q hp hq => |
| 361 | change max (p.metricOrder b) (q.metricOrder b) ≤ p.degree + q.degree |
| 362 | omega |
| 363 | | neg p hp => exact hp |
| 364 | |
| 365 | /-- The background correction vanishes at its base on every independent current input. -/ |
| 366 | theorem exists_smooth_background_word_action |
| 367 | (hF : ∀ (x : M) (v : TangentSpace (𝓡 n) x), |
| 368 | (∑ a, g0.inner x (F a x) v • F a x) = v) |
| 369 | (k m : ℕ) (hkm : k + 2 ≤ 2 * m) |
| 370 | (i j : Fin n) (word : List iota) (hw : word.length ≤ k) : |
| 371 | ∃ delta : ℝ, 0 < delta ∧ |
| 372 | ∃ Psi : (NativeProbeContinuous (M := M) (iota := iota) (k + 2) × |
| 373 | (NativeProbeContinuous (M := M) (iota := iota) m × |
| 374 | NativeProbeL2 (iota := iota) μ (k + 1))) → Lp ℝ 2 μ, |
| 375 | ContDiff ℝ ∞ Psi ∧ (∀ QC HC, Psi (0, QC, HC) = 0) ∧ |
| 376 | ∀ QB : NativeProbeContinuous (M := M) (iota := iota) (k + 2), ‖QB‖ < delta → |
| 377 | ∀ QC : NativeProbeContinuous (M := M) (iota := iota) m, ‖QC‖ < delta → |
| 378 | ∀ HC : NativeProbeL2 (iota := iota) μ (k + 1), ∀ background g : RiemannianMetric n M, |
| 379 | (∀ ab w (hw : w.length ≤ k + 2) x, |
| 380 | QB ab (wordIndex w hw) x = directionalWord F w (probeDifference F background g0 ab) x) → |
| 381 | (∀ ab w (hw : w.length ≤ m) x, |
| 382 | QC ab (wordIndex w hw) x = directionalWord F w (probeDifference F g g0 ab) x) → |
| 383 | (∀ ab w (hw : w.length ≤ k + 1), |
| 384 | HC ab (wordIndex w hw) =ᵐ[μ] directionalWord F w (probeDifference F g g0 ab)) → |
| 385 | Psi (QB, QC, HC) =ᵐ[μ] |
| 386 | directionalWord F word (backgroundDifferenceEntry C g0 background g i j) := by |
| 387 | let p : Expr (Fin n ⊕ iota) n := |
| 388 | (sourceExpr Sum.inl true i j).orderedDerivative (word.map Sum.inr) |
| 389 | have hpdeg : p.degree ≤ k + 2 := by |
| 390 | have h := degree_ordered_sourceExpr_le (Sum.inl : Fin n → Fin n ⊕ iota) |
| 391 | true i j (word.map Sum.inr) |
| 392 | simp only [List.length_map] at h |
| 393 | exact h.trans (by omega) |
| 394 | have hpbg : p.metricOrder true ≤ k + 2 := (backgroundOrder_le_degree p true).trans hpdeg |
| 395 | have hpcur : p.metricOrder false ≤ k + 1 := by |
| 396 | have h := currentOrder_ordered_sourceExpr_lower (Sum.inl : Fin n → Fin n ⊕ iota) |
| 397 | i j (word.map Sum.inr) |
| 398 | simp only [List.length_map] at h |
| 399 | exact h.trans (by omega) |
| 400 | obtain ⟨delta, hdelta, Phi, hPhi, hEq⟩ := exists_smooth_varying_jet_action F C g0 μ hF |
| 401 | p m (k + 2) (k + 1) (hpdeg.trans hkm) hpbg hpcur |
| 402 | let Psi := fun z : NativeProbeContinuous (M := M) (iota := iota) (k + 2) × |
| 403 | (NativeProbeContinuous (M := M) (iota := iota) m × |
| 404 | NativeProbeL2 (iota := iota) μ (k + 1)) => Phi z - Phi (0, z.2) |
| 405 | refine ⟨delta, hdelta, Psi, hPhi.sub (hPhi.comp (contDiff_const.prodMk contDiff_snd)), |
| 406 | fun QC HC => sub_self _, ?_⟩ |
| 407 | intro QB hQBsmall QC hQCsmall HC background g hQB hQC hHC |
| 408 | have hbg := hEq QB hQBsmall QC hQCsmall HC background g hQB hQC hHC |
| 409 | have hbase := hEq 0 (by simpa only [norm_zero] using hdelta) QC hQCsmall HC g0 g |
| 410 | (zero_native_probes F g0 (k + 2)) hQC hHC |
| 411 | filter_upwards [Lp.coeFn_sub (Phi (QB, QC, HC)) (Phi (0, QC, HC)), hbg, hbase] |
| 412 | with x hsub hb hc |
| 413 | change (Phi (QB, QC, HC) - Phi (0, QC, HC)) x = _ |
| 414 | rw [hsub, Pi.sub_apply, hb, hc] |
| 415 | exact ordered_backgroundDifferenceEntry F C g0 background g i j word x |
| 416 | |
| 417 | section FiniteCover |
| 418 | |
| 419 | variable (A : CompatibleChartCover (n := n) (M := M)) |
| 420 | |
| 421 | /-- The output coefficients stay fixed at g0 while the geometric background varies. -/ |
| 422 | theorem backgroundDifferenceEntry_reconstruction (background g : RiemannianMetric n M) |
| 423 | (D : LeviCivitaData g) (B : LeviCivitaData background) (B0 : LeviCivitaData g0) |
| 424 | (ab : iota × iota) : |
| 425 | entryReconstruction F A g0 |
| 426 | (fun a ij => backgroundDifferenceEntry (A.cutoffs a) g0 background g ij.1 ij.2) ab = |
| 427 | (fun x => (smoothRicciDeTurckTensor D B - smoothRicciDeTurckTensor D B0) x |
| 428 | (F ab.1 x) (F ab.2 x)) := by |
| 429 | funext x |
| 430 | let R := smoothRicciDeTurckTensor D B - smoothRicciDeTurckTensor D B0 |
| 431 | change (∑ a : A.centers, ∑ ij : Fin n × Fin n, |
| 432 | outputCoefficient (A.cutoffs a) g0 (A.partition a) (F ab.1) (F ab.2) ij.1 ij.2 x * |
| 433 | backgroundDifferenceEntry (A.cutoffs a) g0 background g ij.1 ij.2 x) = |
| 434 | R x (F ab.1 x) (F ab.2 x) |
| 435 | calc |
| 436 | _ = ∑ a : A.centers, A.partition a x * R x (F ab.1 x) (F ab.2 x) := by |
| 437 | apply Finset.sum_congr rfl |
| 438 | intro a _ |
| 439 | have heq := weighted_source_eq (A.cutoffs a) g0 (A.partition a) |
| 440 | (subset_tsupport (A.partition a)) (F ab.1) (F ab.2) R |
| 441 | (fun y i j => backgroundDifferenceEntry (A.cutoffs a) g0 background g i j y) |
| 442 | (fun y hy i j => backgroundDifferenceEntry_eq_intrinsic (A.cutoffs a) g0 |
| 443 | background g D B B0 hy i j) x |
| 444 | simpa only [Fintype.sum_prod_type] using heq.symm |
| 445 | _ = _ := by rw [← Finset.sum_mul, A.weight_sum, one_mul] |
| 446 | |
| 447 | theorem backgroundOutput_ae_eq {k : ℕ} (Q : ChartSourceTuples (iota := iota) A μ k) |
| 448 | (background g : RiemannianMetric n M) |
| 449 | (D : LeviCivitaData g) (B : LeviCivitaData background) (B0 : LeviCivitaData g0) |
| 450 | (hQ : ∀ a ij word (hw : word.length ≤ k), |
| 451 | Q a ij (wordIndex word hw) =ᵐ[μ] directionalWord F word |
| 452 | (backgroundDifferenceEntry (A.cutoffs a) g0 background g ij.1 ij.2)) |
| 453 | (ab : iota × iota) (word : List iota) (hw : word.length ≤ k) : |
| 454 | sourceOutputL2 F A g0 μ k Q ab (wordIndex word hw) =ᵐ[μ] directionalWord F word |
| 455 | (fun x => (smoothRicciDeTurckTensor D B - smoothRicciDeTurckTensor D B0) x |
| 456 | (F ab.1 x) (F ab.2 x)) := by |
| 457 | have heq := sourceOutputL2_ae_reconstruction F A g0 μ Q |
| 458 | (fun a ij => backgroundDifferenceEntry (A.cutoffs a) g0 background g ij.1 ij.2) |
| 459 | (fun a ij => backgroundDifferenceEntry_contMDiff F (A.cutoffs a) g0 background g ij.1 ij.2) |
| 460 | hQ ab word hw |
| 461 | rw [backgroundDifferenceEntry_reconstruction F g0 A background g D B B0 ab] at heq |
| 462 | exact heq |
| 463 | |
| 464 | /-- All entries use the same independently varying background and current tuples. -/ |
| 465 | theorem exists_smooth_background_chart_action |
| 466 | (hF : ∀ (x : M) (v : TangentSpace (𝓡 n) x), |
| 467 | (∑ a, g0.inner x (F a x) v • F a x) = v) |
| 468 | (k m : ℕ) (hkm : k + 2 ≤ 2 * m) : |
| 469 | ∃ delta : ℝ, 0 < delta ∧ |
| 470 | ∃ Psi : (NativeProbeContinuous (M := M) (iota := iota) (k + 2) × |
| 471 | (NativeProbeContinuous (M := M) (iota := iota) m × |
| 472 | NativeProbeL2 (iota := iota) μ (k + 1))) → ChartSourceTuples (iota := iota) A μ k, |
| 473 | ContDiff ℝ ∞ Psi ∧ (∀ QC HC, Psi (0, QC, HC) = 0) ∧ |
| 474 | ∀ QB : NativeProbeContinuous (M := M) (iota := iota) (k + 2), ‖QB‖ < delta → |
| 475 | ∀ QC : NativeProbeContinuous (M := M) (iota := iota) m, ‖QC‖ < delta → |
| 476 | ∀ HC : NativeProbeL2 (iota := iota) μ (k + 1), ∀ background g : RiemannianMetric n M, |
| 477 | (∀ ab w (hw : w.length ≤ k + 2) x, |
| 478 | QB ab (wordIndex w hw) x = directionalWord F w (probeDifference F background g0 ab) x) → |
| 479 | (∀ ab w (hw : w.length ≤ m) x, |
| 480 | QC ab (wordIndex w hw) x = directionalWord F w (probeDifference F g g0 ab) x) → |
| 481 | (∀ ab w (hw : w.length ≤ k + 1), |
| 482 | HC ab (wordIndex w hw) =ᵐ[μ] directionalWord F w (probeDifference F g g0 ab)) → |
| 483 | ∀ a ij word (hw : word.length ≤ k), |
| 484 | Psi (QB, QC, HC) a ij (wordIndex word hw) =ᵐ[μ] |
| 485 | directionalWord F word (backgroundDifferenceEntry (A.cutoffs a) g0 background g ij.1 ij.2) := by |
| 486 | classical |
| 487 | have hdata (a : A.centers) (ij : Fin n × Fin n) (word : WordIndex iota k) := |
| 488 | exists_smooth_background_word_action F (A.cutoffs a) g0 μ hF k m hkm ij.1 ij.2 |
| 489 | (List.ofFn word.2) (by simpa only [List.length_ofFn] using Nat.le_of_lt_succ word.1.isLt) |
| 490 | choose delta hdelta Psi hPsi hPsi0 hPsiEq using hdata |
| 491 | obtain ⟨r, hr, hrd⟩ := exists_common_positive_time |
| 492 | (Finset.univ : Finset (A.centers × (Fin n × Fin n) × WordIndex iota k)) |
| 493 | (fun z => delta z.1 z.2.1 z.2.2) (fun z _ => hdelta z.1 z.2.1 z.2.2) |
| 494 | refine ⟨r, hr, fun z a ij word => Psi a ij word z, |
| 495 | contDiff_pi.mpr (fun a => contDiff_pi.mpr (fun ij => contDiff_pi.mpr (hPsi a ij))), ?_, ?_⟩ |
| 496 | · intro QC HC |
| 497 | funext a ij word |
| 498 | exact hPsi0 a ij word QC HC |
| 499 | · intro QB hQBsmall QC hQCsmall HC background g hQB hQC hHC a ij word hw |
| 500 | have hbound := hrd (a, ij, wordIndex word hw) (Finset.mem_univ _) |
| 501 | have heq := hPsiEq a ij (wordIndex word hw) QB (hQBsmall.trans_le hbound) |
| 502 | QC (hQCsmall.trans_le hbound) HC background g hQB hQC hHC |
| 503 | simpa only [wordIndex_word] using heq |
| 504 | |
| 505 | end FiniteCover |
| 506 | |
| 507 | end PoincareMT.DeTurckBackgroundVariationNative |
| 508 | |
| 509 | end |