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 | import PoincareLib.Geometry.Spacetime.Rescaling.Geometry.Carrier |
| 2 | |
| 3 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M13/DomainMaps.lean`, |
| 4 | revision `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See `references/ricci-flow/mapher/rescaling-import.json`. -/ |
| 5 | |
| 6 | /-! |
| 7 | # Bidirectional transport of actual compatible maps |
| 8 | |
| 9 | Both directions use the selected interval diffeomorphism. The inverse |
| 10 | derivative multiplies by Q, cancelling the scaled spacetime time vector. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u v |
| 19 | |
| 20 | open PoincareMT.Homothety |
| 21 | |
| 22 | namespace PoincareMT.ParabolicRescaling |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] |
| 25 | {A : AdaptedMetricAtlas n X} {R : GeneralizedFlowCarrierConclusion A} |
| 26 | {Q : ℝ} {hQ : 0 < Q} {a : ℝ} |
| 27 | |
| 28 | theorem interval_subset_of_parabolic {K L : SpacetimeInterval} |
| 29 | (h : (parabolicInterval Q hQ a K).domain ⊆ |
| 30 | (parabolicInterval Q hQ a L).domain) : K.domain ⊆ L.domain := by |
| 31 | intro t ht |
| 32 | exact (parabolicTime_mem_parabolicInterval_iff Q hQ a L t).1 |
| 33 | (h ((parabolicTime_mem_parabolicInterval_iff Q hQ a K t).2 ht)) |
| 34 | |
| 35 | theorem worldline_ext {time : X → ℝ} {I K : SpacetimeInterval} |
| 36 | {S : GeneralizedFlowSpacetime n X time I} {T : SmoothSpacetimeInterval K} |
| 37 | {e f : SpacetimeWorldline S T} (h : e.curve = f.curve) : e = f := by |
| 38 | cases e |
| 39 | cases f |
| 40 | cases h |
| 41 | rfl |
| 42 | |
| 43 | theorem compatibleEmbedding_ext {time : X → ℝ} {I K : SpacetimeInterval} |
| 44 | {S : GeneralizedFlowSpacetime n X time I} {T : SmoothSpacetimeInterval K} |
| 45 | {C : Type v} [TopologicalSpace C] |
| 46 | {e f : CompatibleSpacetimeEmbedding S T C} (h : e.toSpacetime = f.toSpacetime) : |
| 47 | e = f := by |
| 48 | cases e |
| 49 | cases f |
| 50 | cases h |
| 51 | rfl |
| 52 | |
| 53 | theorem compatibleCylinder_ext {time : X → ℝ} {I K : SpacetimeInterval} |
| 54 | {S : GeneralizedFlowSpacetime n X time I} {T : SmoothSpacetimeInterval K} |
| 55 | {C : Type v} [TopologicalSpace C] |
| 56 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 57 | {e f : CompatibleSpacetimeCylinder S T C} (h : e.toSpacetime = f.toSpacetime) : |
| 58 | e = f := by |
| 59 | cases e with |
| 60 | | mk e he hi => |
| 61 | cases f with |
| 62 | | mk f hf hj => |
| 63 | have hef := compatibleEmbedding_ext h |
| 64 | cases hef |
| 65 | rfl |
| 66 | |
| 67 | noncomputable def transportedWorldline (K : SpacetimeInterval) |
| 68 | (e : SpacetimeWorldline R.spacetime (R.timeIntervals.interval K)) : |
| 69 | SpacetimeWorldline (parabolicSpacetime R.spacetime Q hQ a) |
| 70 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) := by |
| 71 | let P := parabolicIntervalTransport R.timeIntervals Q hQ a |
| 72 | let f := (P.diffeomorph K).symm |
| 73 | refine { |
| 74 | interval_subset := parabolicInterval_subset Q hQ a K A.interval e.interval_subset |
| 75 | curve := e.curve ∘ f |
| 76 | smooth := e.smooth.comp f.contMDiff |
| 77 | time_eq := ?_ |
| 78 | derivative_eq := ?_ } |
| 79 | · intro t |
| 80 | change parabolicTime Q a (R.spacetime.timeFunction (e.curve (f t))) = t.val |
| 81 | rw [e.time_eq] |
| 82 | change parabolicTime Q a (parabolicTimeInv Q a t.val) = t.val |
| 83 | exact parabolicTime_parabolicTimeInv Q hQ a t.val |
| 84 | · intro t |
| 85 | rw [mfderiv_comp t (e.smooth.mdifferentiable (by simp) _) |
| 86 | (f.mdifferentiable (by simp) _)] |
| 87 | change mfderiv (𝓡∂ 1) (spacetimeModel n) e.curve (f t) |
| 88 | (mfderiv (𝓡∂ 1) (𝓡∂ 1) f t |
| 89 | ((R.timeIntervals.interval (parabolicInterval Q hQ a K)).positiveTangent t)) = _ |
| 90 | rw [P.inverse_derivative, map_smul, e.derivative_eq] |
| 91 | rfl |
| 92 | |
| 93 | noncomputable def untransportedWorldline (K : SpacetimeInterval) |
| 94 | (e : SpacetimeWorldline (parabolicSpacetime R.spacetime Q hQ a) |
| 95 | (R.timeIntervals.interval (parabolicInterval Q hQ a K))) : |
| 96 | SpacetimeWorldline R.spacetime (R.timeIntervals.interval K) := by |
| 97 | let P := parabolicIntervalTransport R.timeIntervals Q hQ a |
| 98 | let f := P.diffeomorph K |
| 99 | refine { |
| 100 | interval_subset := interval_subset_of_parabolic e.interval_subset |
| 101 | curve := e.curve ∘ f |
| 102 | smooth := e.smooth.comp f.contMDiff |
| 103 | time_eq := ?_ |
| 104 | derivative_eq := ?_ } |
| 105 | · intro t |
| 106 | have h := e.time_eq (f t) |
| 107 | change parabolicTime Q a (R.spacetime.timeFunction (e.curve (f t))) = |
| 108 | parabolicTime Q a t.val at h |
| 109 | exact (parabolicTimeOrderIso Q hQ a).injective h |
| 110 | · intro t |
| 111 | rw [mfderiv_comp t (e.smooth.mdifferentiable (by simp) _) |
| 112 | (f.mdifferentiable (by simp) _)] |
| 113 | change mfderiv (𝓡∂ 1) (spacetimeModel n) e.curve (f t) |
| 114 | (mfderiv (𝓡∂ 1) (𝓡∂ 1) f t |
| 115 | ((R.timeIntervals.interval K).positiveTangent t)) = _ |
| 116 | rw [P.derivative, map_smul, e.derivative_eq] |
| 117 | change Q • ((1 / Q : ℝ) • R.spacetime.timeVector (e.curve (f t))) = _ |
| 118 | rw [smul_smul, one_div, mul_inv_cancel₀ hQ.ne', one_smul] |
| 119 | rfl |
| 120 | |
| 121 | noncomputable def worldlineEquiv (K : SpacetimeInterval) : |
| 122 | SpacetimeWorldline R.spacetime (R.timeIntervals.interval K) ≃ |
| 123 | SpacetimeWorldline (parabolicSpacetime R.spacetime Q hQ a) |
| 124 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) where |
| 125 | toFun := transportedWorldline K |
| 126 | invFun := untransportedWorldline K |
| 127 | left_inv e := by |
| 128 | apply worldline_ext |
| 129 | funext t |
| 130 | exact congrArg e.curve |
| 131 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K).symm_apply_apply t) |
| 132 | right_inv e := by |
| 133 | apply worldline_ext |
| 134 | funext t |
| 135 | exact congrArg e.curve |
| 136 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K).apply_symm_apply t) |
| 137 | |
| 138 | noncomputable def transportedEmbedding {C : Type v} [TopologicalSpace C] |
| 139 | (K : SpacetimeInterval) |
| 140 | (e : CompatibleSpacetimeEmbedding R.spacetime (R.timeIntervals.interval K) C) : |
| 141 | CompatibleSpacetimeEmbedding (parabolicSpacetime R.spacetime Q hQ a) |
| 142 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) C := by |
| 143 | let P := parabolicIntervalTransport R.timeIntervals Q hQ a |
| 144 | let f := (P.diffeomorph K).symm |
| 145 | refine { |
| 146 | interval_subset := parabolicInterval_subset Q hQ a K A.interval e.interval_subset |
| 147 | toSpacetime := fun p ↦ e.toSpacetime (f p.1, p.2) |
| 148 | embedding := e.embedding.comp (f.toHomeomorph.prodCongr (Homeomorph.refl C)).isEmbedding |
| 149 | time_eq := ?_ |
| 150 | worldline_smooth := fun x ↦ (e.worldline_smooth x).comp f.contMDiff |
| 151 | worldline_derivative := ?_ } |
| 152 | · intro t |
| 153 | change parabolicTime Q a (R.spacetime.timeFunction (e.toSpacetime (f t.1, t.2))) = t.1.val |
| 154 | rw [e.time_eq] |
| 155 | exact parabolicTime_parabolicTimeInv Q hQ a t.1.val |
| 156 | · intro t x |
| 157 | change mfderiv (𝓡∂ 1) (spacetimeModel n) |
| 158 | ((fun s ↦ e.toSpacetime (s, x)) ∘ f) t _ = _ |
| 159 | rw [mfderiv_comp t ((e.worldline_smooth x).mdifferentiable (by simp) _) |
| 160 | (f.mdifferentiable (by simp) _)] |
| 161 | change mfderiv (𝓡∂ 1) (spacetimeModel n) (fun s ↦ e.toSpacetime (s, x)) (f t) |
| 162 | (mfderiv (𝓡∂ 1) (𝓡∂ 1) f t |
| 163 | ((R.timeIntervals.interval (parabolicInterval Q hQ a K)).positiveTangent t)) = _ |
| 164 | rw [P.inverse_derivative, map_smul, e.worldline_derivative] |
| 165 | rfl |
| 166 | |
| 167 | noncomputable def untransportedEmbedding {C : Type v} [TopologicalSpace C] |
| 168 | (K : SpacetimeInterval) |
| 169 | (e : CompatibleSpacetimeEmbedding (parabolicSpacetime R.spacetime Q hQ a) |
| 170 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) C) : |
| 171 | CompatibleSpacetimeEmbedding R.spacetime (R.timeIntervals.interval K) C := by |
| 172 | let P := parabolicIntervalTransport R.timeIntervals Q hQ a |
| 173 | let f := P.diffeomorph K |
| 174 | refine { |
| 175 | interval_subset := interval_subset_of_parabolic e.interval_subset |
| 176 | toSpacetime := fun p ↦ e.toSpacetime (f p.1, p.2) |
| 177 | embedding := e.embedding.comp (f.toHomeomorph.prodCongr (Homeomorph.refl C)).isEmbedding |
| 178 | time_eq := ?_ |
| 179 | worldline_smooth := fun x ↦ (e.worldline_smooth x).comp f.contMDiff |
| 180 | worldline_derivative := ?_ } |
| 181 | · intro t |
| 182 | have h := e.time_eq (f t.1, t.2) |
| 183 | change parabolicTime Q a (R.spacetime.timeFunction (e.toSpacetime (f t.1, t.2))) = |
| 184 | parabolicTime Q a t.1.val at h |
| 185 | exact (parabolicTimeOrderIso Q hQ a).injective h |
| 186 | · intro t x |
| 187 | change mfderiv (𝓡∂ 1) (spacetimeModel n) |
| 188 | ((fun s ↦ e.toSpacetime (s, x)) ∘ f) t _ = _ |
| 189 | rw [mfderiv_comp t ((e.worldline_smooth x).mdifferentiable (by simp) _) |
| 190 | (f.mdifferentiable (by simp) _)] |
| 191 | change mfderiv (𝓡∂ 1) (spacetimeModel n) (fun s ↦ e.toSpacetime (s, x)) (f t) |
| 192 | (mfderiv (𝓡∂ 1) (𝓡∂ 1) f t |
| 193 | ((R.timeIntervals.interval K).positiveTangent t)) = _ |
| 194 | rw [P.derivative, map_smul, e.worldline_derivative] |
| 195 | change Q • ((1 / Q : ℝ) • R.spacetime.timeVector (e.toSpacetime (f t, x))) = _ |
| 196 | rw [smul_smul, one_div, mul_inv_cancel₀ hQ.ne', one_smul] |
| 197 | |
| 198 | noncomputable def embeddingEquiv (C : Type v) [TopologicalSpace C] |
| 199 | (K : SpacetimeInterval) : |
| 200 | CompatibleSpacetimeEmbedding R.spacetime (R.timeIntervals.interval K) C ≃ |
| 201 | CompatibleSpacetimeEmbedding (parabolicSpacetime R.spacetime Q hQ a) |
| 202 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) C where |
| 203 | toFun := transportedEmbedding K |
| 204 | invFun := untransportedEmbedding K |
| 205 | left_inv e := by |
| 206 | apply compatibleEmbedding_ext |
| 207 | funext p |
| 208 | change e.toSpacetime |
| 209 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K).symm |
| 210 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K) p.1), p.2) = _ |
| 211 | rw [Diffeomorph.symm_apply_apply] |
| 212 | right_inv e := by |
| 213 | apply compatibleEmbedding_ext |
| 214 | funext p |
| 215 | change e.toSpacetime |
| 216 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K) |
| 217 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K).symm p.1), p.2) = _ |
| 218 | rw [Diffeomorph.apply_symm_apply] |
| 219 | |
| 220 | noncomputable def untransportedCylinder {C : Type v} [TopologicalSpace C] |
| 221 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 222 | (K : SpacetimeInterval) |
| 223 | (e : CompatibleSpacetimeCylinder (parabolicSpacetime R.spacetime Q hQ a) |
| 224 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) C) : |
| 225 | CompatibleSpacetimeCylinder R.spacetime (R.timeIntervals.interval K) C := by |
| 226 | let f := (parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K |
| 227 | let d := f.prodCongr (Diffeomorph.refl (𝓡 n) C ∞) |
| 228 | refine { |
| 229 | toCompatibleSpacetimeEmbedding := untransportedEmbedding K e.toCompatibleSpacetimeEmbedding |
| 230 | smooth := e.smooth.comp d.contMDiff |
| 231 | differential_injective := ?_ } |
| 232 | intro p v w h |
| 233 | apply (d.mfderivToContinuousLinearEquiv (by simp) p).injective |
| 234 | apply e.differential_injective (d p) |
| 235 | change mfderiv (spacetimeModel n) (spacetimeModel n) (e.toSpacetime ∘ d) p v = |
| 236 | mfderiv (spacetimeModel n) (spacetimeModel n) (e.toSpacetime ∘ d) p w at h |
| 237 | rw [mfderiv_comp p (e.smooth.mdifferentiable (by simp) _) (d.mdifferentiable (by simp) _)] at h |
| 238 | exact h |
| 239 | |
| 240 | noncomputable def cylinderEquiv (C : Type v) [TopologicalSpace C] |
| 241 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 242 | (K : SpacetimeInterval) : |
| 243 | CompatibleSpacetimeCylinder R.spacetime (R.timeIntervals.interval K) C ≃ |
| 244 | CompatibleSpacetimeCylinder (parabolicSpacetime R.spacetime Q hQ a) |
| 245 | (R.timeIntervals.interval (parabolicInterval Q hQ a K)) C where |
| 246 | toFun := transportedCylinder K |
| 247 | invFun := untransportedCylinder K |
| 248 | left_inv e := by |
| 249 | apply compatibleCylinder_ext |
| 250 | funext p |
| 251 | change e.toSpacetime |
| 252 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K).symm |
| 253 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K) p.1), p.2) = _ |
| 254 | rw [Diffeomorph.symm_apply_apply] |
| 255 | right_inv e := by |
| 256 | apply compatibleCylinder_ext |
| 257 | funext p |
| 258 | change e.toSpacetime |
| 259 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K) |
| 260 | (((parabolicIntervalTransport R.timeIntervals Q hQ a).diffeomorph K).symm p.1), p.2) = _ |
| 261 | rw [Diffeomorph.apply_symm_apply] |
| 262 | |
| 263 | end PoincareMT.ParabolicRescaling |