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/DeTurckParameterBackgroundNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.DeTurck.Construction.DeTurckCompletedOutput |
| 6 | import PoincareLib.Geometry.RicciFlow.Local.DeTurck.Jets.DeTurckJetAffine |
| 7 | import PoincareLib.Geometry.RicciFlow.Local.DeTurck.Gauge.DeTurckPullbackSource |
| 8 | import PoincareLib.Analysis.Parabolic.Quasilinear.FixedPoint.ContinuousPathComposition |
| 9 | |
| 10 | /-! |
| 11 | # Actual background parameters for the native DeTurck equation |
| 12 | |
| 13 | The background is the pullback of the fixed metric. Compact spatial |
| 14 | currying turns its jointly smooth ordered probes into smooth native tuples. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option maxHeartbeats 1800000 |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | noncomputable section |
| 22 | |
| 23 | open Set Filter Metric MeasureTheory |
| 24 | open scoped Manifold ContDiff Bundle Topology |
| 25 | |
| 26 | namespace PoincareMT.DeTurckParameterBackgroundNative |
| 27 | |
| 28 | open ContinuousPathCompositionNative TensorProbeNative TensorHilbertNative ParsevalTensorNative |
| 29 | DeTurckJetAffineNative DeTurckJetCoordinatesNative DeTurckCompletedOutputNative |
| 30 | DeTurckPullbackSourceNative SpectralHeatNative |
| 31 | |
| 32 | universe u v |
| 33 | |
| 34 | section CompactCurrying |
| 35 | |
| 36 | variable {P F : Type v} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 37 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 38 | {K : Type u} [TopologicalSpace K] [CompactSpace K] |
| 39 | |
| 40 | set_option synthInstance.maxHeartbeats 100000 in |
| 41 | /-- Sup-norm continuity of the derivative gives the uniform remainder. -/ |
| 42 | theorem hasFDerivAt_compact_curry {U : Set P} (hU : IsOpen U) |
| 43 | (f : P → C(K, F)) (A : P → C(K, P →L[ℝ] F)) {p : P} (hp : p ∈ U) |
| 44 | (hA : ContinuousAt A p) |
| 45 | (hder : ∀ q ∈ U, ∀ x : K, HasFDerivAt (fun a => f a x) (A q x) q) : |
| 46 | HasFDerivAt f |
| 47 | ((pointwiseOperator K (A p)).comp (ContinuousLinearMap.const ℝ K)) p := by |
| 48 | rw [hasFDerivAt_iff_isLittleO, Asymptotics.isLittleO_iff] |
| 49 | intro eps heps |
| 50 | obtain ⟨r, hr, hclose⟩ := (Metric.continuousAt_iff (f := A) (a := p)).mp hA eps heps |
| 51 | obtain ⟨s, hs, hsU⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hp) |
| 52 | let d : ℝ := min r s |
| 53 | have hd : 0 < d := lt_min hr hs |
| 54 | have hdU : ball p d ⊆ U := fun q hq => |
| 55 | hsU ((ball_subset_ball (min_le_right r s)) hq) |
| 56 | filter_upwards [ball_mem_nhds p hd] with q hq |
| 57 | apply (ContinuousMap.norm_le _ (mul_nonneg heps.le (norm_nonneg _))).mpr |
| 58 | intro x |
| 59 | have hbound : ∀ a ∈ ball p d, ‖A a x - A p x‖ ≤ eps := by |
| 60 | intro a ha |
| 61 | have haa : dist a p < r := (mem_ball.mp ha).trans_le (min_le_left r s) |
| 62 | have hnorm : ‖A a - A p‖ < eps := by |
| 63 | have hdist := hclose haa |
| 64 | rw [dist_eq_norm (A a) (A p)] at hdist |
| 65 | exact hdist |
| 66 | exact ((A a - A p).norm_coe_le_norm x).trans hnorm.le |
| 67 | have hrem := (convex_ball p d).norm_image_sub_le_of_norm_hasFDerivWithin_le' |
| 68 | (f := fun a => f a x) (f' := fun a => A a x) (φ := A p x) |
| 69 | (fun a ha => (hder a (hdU ha) x).hasFDerivWithinAt) |
| 70 | hbound (mem_ball_self hd) hq |
| 71 | change ‖f q x - f p x - A p x (q - p)‖ ≤ eps * ‖q - p‖ |
| 72 | exact hrem |
| 73 | |
| 74 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [CompactSpace M] |
| 75 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 76 | |
| 77 | local notation "I" => 𝓡 n |
| 78 | |
| 79 | theorem contMDiffOn_parameter_fderiv {U : Set P} (hU : IsOpen U) |
| 80 | (f : P × M → F) (k : ℕ) |
| 81 | (hf : ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, F) (k + 1) f (U ×ˢ univ)) : |
| 82 | ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, P →L[ℝ] F) k |
| 83 | (fun q => fderiv ℝ (fun a => f (a, q.2)) q.1) (U ×ˢ univ) := by |
| 84 | intro q hq |
| 85 | have hfa := hf.contMDiffAt ((hU.prod isOpen_univ).mem_nhds hq) |
| 86 | have hcomp : ContMDiffAt ((𝓘(ℝ, P).prod I).prod 𝓘(ℝ, P)) 𝓘(ℝ, F) |
| 87 | (k + 1) (fun z : (P × M) × P => f (z.2, z.1.2)) (q, q.1) := |
| 88 | hfa.comp (q, q.1) (contMDiffAt_snd.prodMk contMDiffAt_fst.snd) |
| 89 | have hd := hcomp.mfderiv (fun z : P × M => fun a : P => f (a, z.2)) |
| 90 | Prod.fst (contMDiffAt_fst (n := (k : WithTop ℕ∞))) (by simp) |
| 91 | simpa only [inTangentCoordinates_model_space, mfderiv_eq_fderiv] using |
| 92 | hd.contMDiffWithinAt |
| 93 | |
| 94 | set_option synthInstance.maxHeartbeats 100000 in |
| 95 | theorem contDiffOn_compact_curry_nat {U : Set P} (hU : IsOpen U) |
| 96 | (k : ℕ) (f : P × M → F) |
| 97 | (hf : ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, F) k f (U ×ˢ univ)) : |
| 98 | ContDiffOn ℝ k (fun p => ContinuousMap.mkD (fun x => f (p, x)) 0) U := by |
| 99 | induction k generalizing F with |
| 100 | | zero => |
| 101 | exact contDiffOn_zero.mpr (ContinuousMap.continuousOn_mkD_of_uncurry |
| 102 | (fun p x => f (p, x)) 0 hf.continuousOn) |
| 103 | | succ k ih => |
| 104 | let D : P × M → P →L[ℝ] F := fun q => fderiv ℝ (fun a => f (a, q.2)) q.1 |
| 105 | let A : P → C(M, P →L[ℝ] F) := fun p => |
| 106 | ContinuousMap.mkD (fun x => D (p, x)) 0 |
| 107 | let fbar : P → C(M, F) := fun p => ContinuousMap.mkD (fun x => f (p, x)) 0 |
| 108 | have hD : ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, P →L[ℝ] F) k |
| 109 | D (U ×ˢ univ) := contMDiffOn_parameter_fderiv hU f k hf |
| 110 | have hA : ContDiffOn ℝ k A U := ih D hD |
| 111 | have hf_slice (p : P) (hp : p ∈ U) : Continuous (fun x => f (p, x)) := |
| 112 | hf.continuousOn.comp_continuous (continuous_const.prodMk continuous_id) |
| 113 | (fun x => ⟨hp, mem_univ x⟩) |
| 114 | have hD_slice (p : P) (hp : p ∈ U) : Continuous (fun x => D (p, x)) := |
| 115 | hD.continuousOn.comp_continuous (continuous_const.prodMk continuous_id) |
| 116 | (fun x => ⟨hp, mem_univ x⟩) |
| 117 | have hder (p : P) (hp : p ∈ U) (x : M) : |
| 118 | HasFDerivAt (fun a => fbar a x) (A p x) p := by |
| 119 | have hfa := hf.contMDiffAt |
| 120 | ((hU.prod isOpen_univ).mem_nhds (show (p, x) ∈ U ×ˢ univ from ⟨hp, mem_univ x⟩)) |
| 121 | have hsmooth : ContDiffAt ℝ (k + 1) (fun a => f (a, x)) p := |
| 122 | (hfa.comp p (contMDiffAt_id.prodMk contMDiffAt_const)).contDiffAt |
| 123 | have heq : (fun a => fbar a x) =ᶠ[𝓝 p] (fun a => f (a, x)) := by |
| 124 | filter_upwards [hU.mem_nhds hp] with a ha |
| 125 | exact ContinuousMap.mkD_apply_of_continuous (hf_slice a ha) |
| 126 | have hd := (hsmooth.differentiableAt (by simp)).hasFDerivAt |
| 127 | have hAp : A p x = fderiv ℝ (fun a => f (a, x)) p := |
| 128 | ContinuousMap.mkD_apply_of_continuous (hD_slice p hp) |
| 129 | rw [hAp] |
| 130 | exact hd.congr_of_eventuallyEq heq |
| 131 | rw [show (↑(k + 1) : WithTop ℕ∞) = (k : WithTop ℕ∞) + 1 by simp] |
| 132 | apply (contDiffOn_succ_iff_hasFDerivWithinAt_of_uniqueDiffOn hU.uniqueDiffOn).mpr |
| 133 | refine ⟨by simp, fun p => |
| 134 | (pointwiseOperator M (A p)).comp (ContinuousLinearMap.const ℝ M), ?_, ?_⟩ |
| 135 | · have hpoint : ContDiffOn ℝ k |
| 136 | (fun p => (pointwiseOperator M (A p) : C(M, P) →L[ℝ] C(M, F))) U := by |
| 137 | simpa only [Function.comp_def, pointwiseOperatorCLM_apply] using |
| 138 | (pointwiseOperatorCLM M : |
| 139 | C(M, P →L[ℝ] F) →L[ℝ] (C(M, P) →L[ℝ] C(M, F))).contDiff.comp_contDiffOn hA |
| 140 | exact hpoint.clm_comp (show ContDiffOn ℝ k |
| 141 | (fun _ : P => (ContinuousLinearMap.const ℝ M : P →L[ℝ] C(M, P))) U from |
| 142 | contDiffOn_const) |
| 143 | · intro p hp |
| 144 | exact (hasFDerivAt_compact_curry hU fbar A hp |
| 145 | ((hA.continuousOn p hp).continuousAt (hU.mem_nhds hp)) hder).hasFDerivWithinAt |
| 146 | |
| 147 | /-- Joint smoothness on an open parameter set gives sup-norm smoothness. -/ |
| 148 | theorem contDiffOn_compact_curry {U : Set P} (hU : IsOpen U) |
| 149 | (f : P × M → F) |
| 150 | (hf : ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, F) ∞ f (U ×ˢ univ)) : |
| 151 | ContDiffOn ℝ ∞ (fun p => ContinuousMap.mkD (fun x => f (p, x)) 0) U := by |
| 152 | apply contDiffOn_infty.mpr |
| 153 | intro k |
| 154 | exact contDiffOn_compact_curry_nat (n := n) hU k f |
| 155 | (hf.of_le (by exact_mod_cast (le_top : (k : ℕ∞) ≤ ⊤))) |
| 156 | |
| 157 | end CompactCurrying |
| 158 | |
| 159 | section JointPullback |
| 160 | |
| 161 | variable {P : Type v} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 162 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 163 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 164 | |
| 165 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 166 | local notation "I" => 𝓡 n |
| 167 | |
| 168 | theorem contMDiffOn_parameter_pushforward {U : Set P} |
| 169 | (Phi : P → Diffeomorph I I M M ∞) |
| 170 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 171 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) |
| 172 | (X : SmoothField (n := n) (M := M)) : |
| 173 | ContMDiffOn (𝓘(ℝ, P).prod I) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ |
| 174 | (fun q : P × M => (⟨Phi q.1 q.2, |
| 175 | mfderiv I I (Phi q.1) q.2 (X q.2)⟩ : TangentBundle I M)) |
| 176 | (U ×ˢ univ) := by |
| 177 | intro q hq |
| 178 | have hf : ContMDiffWithinAt ((𝓘(ℝ, P).prod I).prod I) I ∞ |
| 179 | (fun z : (P × M) × M => Phi z.1.1 z.2) |
| 180 | ((U ×ˢ univ) ×ˢ univ) (q, q.2) := |
| 181 | (hPhi q hq).comp (q, q.2) |
| 182 | (f := fun z : (P × M) × M => (z.1.1, z.2)) |
| 183 | (contMDiffWithinAt_fst.fst.prodMk contMDiffWithinAt_snd) |
| 184 | (fun (z : (P × M) × M) (hz : z ∈ (U ×ˢ univ) ×ˢ univ) => ⟨hz.1.1, hz.2⟩) |
| 185 | have hd := ContMDiffWithinAt.mfderivWithin |
| 186 | (n := ∞) (m := ∞) (f := fun z : P × M => (Phi z.1 : M → M)) |
| 187 | (g := Prod.snd) hf contMDiffWithinAt_snd hq |
| 188 | (fun _ _ => mem_univ _) (by simp) uniqueMDiffOn_univ |
| 189 | have hsnd : ContMDiff (𝓘(ℝ, P).prod (𝓡 n)) (𝓡 n) ∞ |
| 190 | (Prod.snd : P × M → M) := contMDiff_snd |
| 191 | have hfield : ContMDiffWithinAt (𝓘(ℝ, P).prod I) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ |
| 192 | (fun z : P × M => (⟨z.2, X z.2⟩ : TangentBundle I M)) (U ×ˢ univ) q := |
| 193 | ((X.contMDiff.comp hsnd) q).contMDiffWithinAt |
| 194 | have happ := ContMDiffWithinAt.clm_apply_of_inCoordinates |
| 195 | (IB₁ := I) (IB₂ := I) (IM := 𝓘(ℝ, P).prod I) |
| 196 | (b₁ := Prod.snd) (b₂ := fun z : P × M => Phi z.1 z.2) hd hfield (hPhi q hq) |
| 197 | simpa only [mfderivWithin_univ] using happ |
| 198 | |
| 199 | theorem contMDiffOn_parameter_pullback_pair {U : Set P} |
| 200 | (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 201 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 202 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) |
| 203 | (X Y : SmoothField (n := n) (M := M)) : |
| 204 | ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ |
| 205 | (fun q : P × M => g0.inner (Phi q.1 q.2) |
| 206 | (mfderiv I I (Phi q.1) q.2 (X q.2)) |
| 207 | (mfderiv I I (Phi q.1) q.2 (Y q.2))) (U ×ˢ univ) := by |
| 208 | have hmetric := g0.contMDiff.comp_contMDiffOn hPhi |
| 209 | have hpair := ContMDiffOn.clm_bundle_apply₂ |
| 210 | (F₁ := E) (F₂ := E) (F₃ := ℝ) |
| 211 | (E₁ := TangentSpace I) (E₂ := TangentSpace I) (E₃ := fun _ : M => ℝ) |
| 212 | (b := fun q : P × M => Phi q.1 q.2) |
| 213 | (ψ := fun q => g0.inner (Phi q.1 q.2)) hmetric |
| 214 | (contMDiffOn_parameter_pushforward Phi hPhi X) |
| 215 | (contMDiffOn_parameter_pushforward Phi hPhi Y) |
| 216 | intro q hq |
| 217 | exact (Bundle.contMDiffWithinAt_totalSpace.mp (hpair q hq)).2 |
| 218 | |
| 219 | theorem contMDiffOn_parameter_directional {U : Set P} |
| 220 | (f : P × M → ℝ) |
| 221 | (hf : ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ f (U ×ˢ univ)) |
| 222 | (X : SmoothField (n := n) (M := M)) : |
| 223 | ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ |
| 224 | (fun q : P × M => scalarDirectional X (fun x => f (q.1, x)) q.2) |
| 225 | (U ×ˢ univ) := by |
| 226 | intro q hq |
| 227 | have hcomp : ContMDiffWithinAt ((𝓘(ℝ, P).prod I).prod I) 𝓘(ℝ, ℝ) ∞ |
| 228 | (fun z : (P × M) × M => f (z.1.1, z.2)) |
| 229 | ((U ×ˢ univ) ×ˢ univ) (q, q.2) := |
| 230 | (hf q hq).comp (q, q.2) |
| 231 | (f := fun z : (P × M) × M => (z.1.1, z.2)) |
| 232 | (contMDiffWithinAt_fst.fst.prodMk contMDiffWithinAt_snd) |
| 233 | (fun (z : (P × M) × M) (hz : z ∈ (U ×ˢ univ) ×ˢ univ) => ⟨hz.1.1, hz.2⟩) |
| 234 | have hd := ContMDiffWithinAt.mfderivWithin |
| 235 | (n := ∞) (m := ∞) (f := fun z : P × M => fun x : M => f (z.1, x)) |
| 236 | (g := Prod.snd) hcomp contMDiffWithinAt_snd hq |
| 237 | (fun _ _ => mem_univ _) (by simp) uniqueMDiffOn_univ |
| 238 | have hsnd : ContMDiff (𝓘(ℝ, P).prod (𝓡 n)) (𝓡 n) ∞ |
| 239 | (Prod.snd : P × M → M) := contMDiff_snd |
| 240 | have hfield : ContMDiffWithinAt (𝓘(ℝ, P).prod I) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ |
| 241 | (fun z : P × M => (⟨z.2, X z.2⟩ : TangentBundle I M)) (U ×ˢ univ) q := |
| 242 | ((X.contMDiff.comp hsnd) q).contMDiffWithinAt |
| 243 | have happ := ContMDiffWithinAt.clm_apply_of_inCoordinates |
| 244 | (IB₁ := I) (IB₂ := 𝓘(ℝ, ℝ)) (IM := 𝓘(ℝ, P).prod I) |
| 245 | (b₁ := Prod.snd) (b₂ := f) hd hfield (hf q hq) |
| 246 | have hscalar := (contMDiff_snd_tangentBundle_modelSpace ℝ 𝓘(ℝ, ℝ)).contMDiffAt.comp_contMDiffWithinAt |
| 247 | q happ |
| 248 | simpa only [Function.comp_def, mfderivWithin_univ, scalarDirectional] using hscalar |
| 249 | |
| 250 | theorem contMDiffOn_parameter_word {iota : Type*} {U : Set P} |
| 251 | (V : iota → SmoothField (n := n) (M := M)) (w : List iota) |
| 252 | (f : P × M → ℝ) |
| 253 | (hf : ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ f (U ×ˢ univ)) : |
| 254 | ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ |
| 255 | (fun q : P × M => directionalWord V w (fun x => f (q.1, x)) q.2) |
| 256 | (U ×ˢ univ) := by |
| 257 | induction w with |
| 258 | | nil => exact hf |
| 259 | | cons i w ih => |
| 260 | exact contMDiffOn_parameter_directional _ ih (V i) |
| 261 | |
| 262 | end JointPullback |
| 263 | |
| 264 | section ActualBackground |
| 265 | |
| 266 | set_option synthInstance.maxHeartbeats 100000 |
| 267 | |
| 268 | variable {P : Type} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 269 | {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 270 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 271 | [CompactSpace M] [SecondCountableTopology M] [MeasurableSpace M] [BorelSpace M] |
| 272 | |
| 273 | local notation "I" => 𝓡 n |
| 274 | |
| 275 | variable (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 276 | |
| 277 | def background (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 278 | (p : P) : RiemannianMetric n M := smoothPullbackMetric g0 (Phi p) |
| 279 | |
| 280 | theorem background_inner (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 281 | (p : P) (x : M) (v w : TangentSpace I x) : |
| 282 | (background g0 Phi p).inner x v w = |
| 283 | g0.inner (Phi p x) (mfderiv I I (Phi p) x v) (mfderiv I I (Phi p) x w) := |
| 284 | smoothPullbackMetric_inner g0 (Phi p) x v w |
| 285 | |
| 286 | /-- The metric seed is the actual pulled metric minus the fixed reference metric. -/ |
| 287 | def seed (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 288 | (p : P) : SmoothTensor (n := n) (M := M) := |
| 289 | metricTensor (background g0 Phi p) - metricTensor g0 |
| 290 | |
| 291 | theorem seed_apply (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 292 | (p : P) (x : M) (v w : TangentSpace I x) : |
| 293 | seed g0 Phi p x v w = |
| 294 | g0.inner (Phi p x) (mfderiv I I (Phi p) x v) (mfderiv I I (Phi p) x w) - |
| 295 | g0.inner x v w := by |
| 296 | change (background g0 Phi p).inner x v w - g0.inner x v w = _ |
| 297 | rw [background_inner] |
| 298 | |
| 299 | theorem seed_symm (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 300 | (p : P) (x : M) (v w : TangentSpace I x) : |
| 301 | seed g0 Phi p x v w = seed g0 Phi p x w v := by |
| 302 | change (background g0 Phi p).inner x v w - g0.inner x v w = |
| 303 | (background g0 Phi p).inner x w v - g0.inner x w v |
| 304 | rw [(background g0 Phi p).symm x v w, g0.symm x v w] |
| 305 | |
| 306 | theorem background_eq_add_seed (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 307 | (p : P) (x : M) (v w : TangentSpace I x) : |
| 308 | (background g0 Phi p).inner x v w = g0.inner x v w + seed g0 Phi p x v w := by |
| 309 | change (background g0 Phi p).inner x v w = |
| 310 | g0.inner x v w + ((background g0 Phi p).inner x v w - g0.inner x v w) |
| 311 | ring |
| 312 | |
| 313 | theorem seed_zero (g0 : RiemannianMetric n M) (Phi : P → Diffeomorph I I M M ∞) |
| 314 | (hPhi0 : Phi 0 = Diffeomorph.refl I M ∞) : seed g0 Phi 0 = 0 := by |
| 315 | ext x v w |
| 316 | rw [seed_apply, hPhi0] |
| 317 | simp only [Diffeomorph.coe_refl, mfderiv_id, ContinuousLinearMap.id_apply, id_eq, sub_self] |
| 318 | rfl |
| 319 | |
| 320 | variable {g0} (d : Data g0) |
| 321 | |
| 322 | theorem seed_probe_eq (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 323 | (p : P) (ab : d.ProbeIndex) : |
| 324 | scalarProbe d.fields (seed g0 Phi p) ab = |
| 325 | probeDifference d.fields (background g0 Phi p) g0 ab := rfl |
| 326 | |
| 327 | theorem contMDiffOn_seed_probe (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) {U : Set P} |
| 328 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 329 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) (ab : d.ProbeIndex) : |
| 330 | ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ |
| 331 | (fun q : P × M => scalarProbe d.fields (seed g0 Phi q.1) ab q.2) (U ×ˢ univ) := by |
| 332 | have hpull := contMDiffOn_parameter_pullback_pair g0 Phi hPhi |
| 333 | (d.fields ab.1) (d.fields ab.2) |
| 334 | have hsnd : ContMDiff (𝓘(ℝ, P).prod (𝓡 n)) (𝓡 n) ∞ |
| 335 | (Prod.snd : P × M → M) := contMDiff_snd |
| 336 | have hbase := (contMDiff_pairing (metricTensor g0) (d.fields ab.1) (d.fields ab.2)).comp |
| 337 | hsnd |
| 338 | simpa only [scalarProbe, seed_apply, metricTensor_apply, Function.comp_def] using |
| 339 | hpull.sub hbase.contMDiffOn |
| 340 | |
| 341 | theorem contMDiffOn_seed_word (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) {U : Set P} |
| 342 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 343 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) |
| 344 | (ab : d.ProbeIndex) (w : List (Fin d.fieldCount)) : |
| 345 | ContMDiffOn (𝓘(ℝ, P).prod I) 𝓘(ℝ, ℝ) ∞ |
| 346 | (fun q : P × M => directionalWord d.fields w |
| 347 | (scalarProbe d.fields (seed g0 Phi q.1) ab) q.2) (U ×ˢ univ) := |
| 348 | contMDiffOn_parameter_word d.fields w _ (contMDiffOn_seed_probe Phi d hPhi ab) |
| 349 | |
| 350 | def backgroundTuples (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) (k : ℕ) (p : P) : |
| 351 | NativeProbeContinuous (M := M) (iota := Fin d.fieldCount) k := |
| 352 | fun ab w => ⟨directionalWord d.fields (List.ofFn w.2) |
| 353 | (scalarProbe d.fields (seed g0 Phi p) ab), |
| 354 | (directionalWord_contMDiff d.fields (List.ofFn w.2) |
| 355 | (scalarProbe_contMDiff d.fields (seed g0 Phi p) ab)).continuous⟩ |
| 356 | |
| 357 | theorem backgroundTuples_apply (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 358 | (k : ℕ) (p : P) (ab : d.ProbeIndex) |
| 359 | (w : List (Fin d.fieldCount)) (hw : w.length ≤ k) (x : M) : |
| 360 | backgroundTuples Phi d k p ab (wordIndex w hw) x = |
| 361 | directionalWord d.fields w (probeDifference d.fields (background g0 Phi p) g0 ab) x := by |
| 362 | simp only [backgroundTuples, wordIndex_word, ContinuousMap.coe_mk, seed_probe_eq] |
| 363 | |
| 364 | theorem backgroundTuples_contDiffOn (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 365 | {U : Set P} (hU : IsOpen U) |
| 366 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 367 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) (k : ℕ) : |
| 368 | ContDiffOn ℝ ∞ (backgroundTuples Phi d k) U := by |
| 369 | apply contDiffOn_pi.mpr |
| 370 | intro ab |
| 371 | apply contDiffOn_pi.mpr |
| 372 | intro w |
| 373 | have hc := contDiffOn_compact_curry hU |
| 374 | (fun q : P × M => directionalWord d.fields (List.ofFn w.2) |
| 375 | (scalarProbe d.fields (seed g0 Phi q.1) ab) q.2) |
| 376 | (contMDiffOn_seed_word Phi d hPhi ab (List.ofFn w.2)) |
| 377 | have heq : (fun p => backgroundTuples Phi d k p ab w) = |
| 378 | (fun p => ContinuousMap.mkD (directionalWord d.fields (List.ofFn w.2) |
| 379 | (scalarProbe d.fields (seed g0 Phi p) ab)) 0) := by |
| 380 | funext p |
| 381 | exact (ContinuousMap.mkD_of_continuous |
| 382 | (directionalWord_contMDiff d.fields (List.ofFn w.2) |
| 383 | (scalarProbe_contMDiff d.fields (seed g0 Phi p) ab)).continuous).symm |
| 384 | rw [heq] |
| 385 | exact hc |
| 386 | |
| 387 | theorem backgroundTuples_zero (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 388 | (hPhi0 : Phi 0 = Diffeomorph.refl I M ∞) (k : ℕ) : |
| 389 | backgroundTuples Phi d k 0 = 0 := by |
| 390 | funext ab w |
| 391 | apply ContinuousMap.ext |
| 392 | intro x |
| 393 | change directionalWord d.fields (List.ofFn w.2) |
| 394 | (scalarProbe d.fields (seed g0 Phi 0) ab) x = 0 |
| 395 | rw [seed_zero g0 Phi hPhi0] |
| 396 | change directionalWord d.fields (List.ofFn w.2) (0 : M → ℝ) x = 0 |
| 397 | have hz (word : List (Fin d.fieldCount)) : directionalWord d.fields word (0 : M → ℝ) = 0 := by |
| 398 | induction word with |
| 399 | | nil => rfl |
| 400 | | cons i word ih => |
| 401 | rw [directionalWord_cons, ih] |
| 402 | funext y |
| 403 | change mfderiv I 𝓘(ℝ, ℝ) (fun _ : M => (0 : ℝ)) y (d.fields i y) = 0 |
| 404 | simp |
| 405 | exact congrFun (hz _) x |
| 406 | |
| 407 | theorem smoothProbeTuples_seed_eq (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 408 | (k : ℕ) (p : P) : |
| 409 | smoothProbeTuples d k (seed g0 Phi p) = |
| 410 | fun ab w => ContinuousMap.toLp 2 d.charts.measure ℝ (backgroundTuples Phi d k p ab w) := rfl |
| 411 | |
| 412 | theorem smoothProbeTuples_seed_contDiffOn (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 413 | {U : Set P} (hU : IsOpen U) |
| 414 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 415 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) (k : ℕ) : |
| 416 | ContDiffOn ℝ ∞ (fun p => smoothProbeTuples d k (seed g0 Phi p)) U := by |
| 417 | apply contDiffOn_pi.mpr |
| 418 | intro ab |
| 419 | apply contDiffOn_pi.mpr |
| 420 | intro w |
| 421 | exact (ContinuousMap.toLp 2 d.charts.measure ℝ : |
| 422 | C(M, ℝ) →L[ℝ] Lp ℝ 2 d.charts.measure).contDiff.comp_contDiffOn |
| 423 | (contDiffOn_pi.mp (contDiffOn_pi.mp (backgroundTuples_contDiffOn Phi d hU hPhi k) ab) w) |
| 424 | |
| 425 | /-- The seed is encoded at the exact requested even native level. -/ |
| 426 | def seedCoordinates (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 427 | (r : ℕ) (p : P) : State d.SymmetricIndex := |
| 428 | evenOutput d r (smoothProbeTuples d (2 * r) (seed g0 Phi p)) |
| 429 | |
| 430 | theorem seedCoordinates_eq (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 431 | (r : ℕ) (p : P) : |
| 432 | seedCoordinates Phi d r p = |
| 433 | d.smoothTensorCoordinates (2 * r) (seed g0 Phi p) (seed_symm g0 Phi p) := |
| 434 | evenOutput_smoothProbeTuples d r (seed g0 Phi p) (seed_symm g0 Phi p) |
| 435 | |
| 436 | theorem seedCoordinates_contDiffOn (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 437 | {U : Set P} (hU : IsOpen U) |
| 438 | (hPhi : ContMDiffOn (𝓘(ℝ, P).prod I) I ∞ |
| 439 | (fun q : P × M => Phi q.1 q.2) (U ×ˢ univ)) (r : ℕ) : |
| 440 | ContDiffOn ℝ ∞ (seedCoordinates Phi d r) U := |
| 441 | (evenOutput d r).contDiff.comp_contDiffOn |
| 442 | (smoothProbeTuples_seed_contDiffOn Phi d hU hPhi (2 * r)) |
| 443 | |
| 444 | theorem seedCoordinates_zero (Phi : P → Diffeomorph I I M M ∞) (d : Data g0) |
| 445 | (hPhi0 : Phi 0 = Diffeomorph.refl I M ∞) (r : ℕ) : |
| 446 | seedCoordinates Phi d r 0 = 0 := by |
| 447 | have htuple : smoothProbeTuples d (2 * r) (seed g0 Phi 0) = 0 := by |
| 448 | rw [smoothProbeTuples_seed_eq, backgroundTuples_zero Phi d hPhi0] |
| 449 | funext ab w |
| 450 | exact map_zero _ |
| 451 | rw [seedCoordinates, htuple, map_zero] |
| 452 | |
| 453 | end ActualBackground |
| 454 | |
| 455 | end PoincareMT.DeTurckParameterBackgroundNative |
| 456 | |
| 457 | end |