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.RicciFlow.Compactness.Embedding.LocalDiffeomorphism |
| 2 | |
| 3 | /-! |
| 4 | # Spatial partial homeomorphisms of convergence embeddings |
| 5 | |
| 6 | The stored spacetime inverse restricts to an actual smooth inverse on each |
| 7 | interior time slice. This realizes the coordinate changes used in |
| 8 | Kleiner--Lott, Appendix E, pp. 2848--2849. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | open Set |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | |
| 15 | namespace PoincareMT.SmoothSpacetimeEmbedding |
| 16 | |
| 17 | variable {n : ℕ} {T' T : ℝ} {C D : FlowCarrier n} |
| 18 | {F : BasedFlow n T' T C} {G : BasedFlow n T' T D} {U : Set C.carrier} |
| 19 | |
| 20 | /-- The spatial map and its stored inverse on an interior slice. -/ |
| 21 | noncomputable def spatialHomeomorph |
| 22 | (e : SmoothSpacetimeEmbedding F G (Ioo T' T ×ˢ U)) |
| 23 | (hU : @IsOpen C.carrier C.topologicalSpace U) {t : ℝ} (ht : t ∈ Ioo T' T) : |
| 24 | letI : TopologicalSpace C.carrier := C.topologicalSpace |
| 25 | letI : TopologicalSpace D.carrier := D.topologicalSpace |
| 26 | OpenPartialHomeomorph C.carrier D.carrier := by |
| 27 | let : TopologicalSpace C.carrier := C.topologicalSpace |
| 28 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) C.carrier := C.chartedSpace |
| 29 | let : IsManifold (𝓡 n) ∞ C.carrier := C.isManifold |
| 30 | let : TopologicalSpace D.carrier := D.topologicalSpace |
| 31 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) D.carrier := D.chartedSpace |
| 32 | let : IsManifold (𝓡 n) ∞ D.carrier := D.isManifold |
| 33 | let f := fun x => (e.toFun (t, x)).2 |
| 34 | let f' := fun y => (e.inverse (t, y)).2 |
| 35 | have hleft (x : C.carrier) (hx : x ∈ U) : f' (f x) = x := by |
| 36 | have hp : e.toFun (t, x) = (t, f x) := Prod.ext (e.time_preserving t x) rfl |
| 37 | simpa only [hp] using congrArg Prod.snd (e.left_inverse (t, x) ⟨ht, hx⟩) |
| 38 | exact |
| 39 | { toFun := f |
| 40 | invFun := f' |
| 41 | source := U |
| 42 | target := f '' U |
| 43 | map_source' := fun x hx => mem_image_of_mem f hx |
| 44 | map_target' := by rintro _ ⟨x, hx, rfl⟩; simpa only [hleft x hx] using hx |
| 45 | left_inv' := hleft |
| 46 | right_inv' := by rintro _ ⟨x, hx, rfl⟩; rw [hleft x hx] |
| 47 | open_source := hU |
| 48 | open_target := e.spatialMap_isOpen_image hU ht |
| 49 | continuousOn_toFun := fun x hx => |
| 50 | (e.spatialMap_contMDiffAt hU ht hx).continuousAt.continuousWithinAt |
| 51 | continuousOn_invFun := by |
| 52 | rintro _ ⟨x, hx, rfl⟩ |
| 53 | exact (e.spatialInverse_contMDiffAt hU ht hx).continuousAt.continuousWithinAt } |
| 54 | |
| 55 | end PoincareMT.SmoothSpacetimeEmbedding |
| 56 | |
| 57 | namespace PoincareMT.RiemannianMetric |
| 58 | |
| 59 | theorem inverse_tangentNorm_le_of_le |
| 60 | {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 61 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 62 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] [IsManifold (𝓡 n) ∞ N] |
| 63 | (g : RiemannianMetric n M) (h : RiemannianMetric n N) |
| 64 | (e : OpenPartialHomeomorph M N) (he : e.MDifferentiable (𝓡 n) (𝓡 n)) |
| 65 | {V : Set M} (hV : V ⊆ e.source) {C : ℝ} |
| 66 | (hbound : ∀ x ∈ V, ∀ v : TangentSpace (𝓡 n) x, |
| 67 | g.tangentNorm x v ≤ C * h.tangentNorm (e x) (mfderiv (𝓡 n) (𝓡 n) e x v)) : |
| 68 | ∀ y ∈ e '' V, ∀ v : TangentSpace (𝓡 n) y, |
| 69 | g.tangentNorm (e.symm y) (mfderiv (𝓡 n) (𝓡 n) e.symm y v) ≤ |
| 70 | C * h.tangentNorm y v := by |
| 71 | rintro _ ⟨x, hx, rfl⟩ v |
| 72 | obtain ⟨w, hw⟩ := (he.mfderiv (hV hx)).surjective v |
| 73 | change mfderiv (𝓡 n) (𝓡 n) e x w = v at hw |
| 74 | have hback := congrArg (fun L => L w) (he.symm_comp_deriv (hV hx)) |
| 75 | change mfderiv (𝓡 n) (𝓡 n) e.symm (e x) |
| 76 | (mfderiv (𝓡 n) (𝓡 n) e x w) = w at hback |
| 77 | rw [← hw, hback, e.left_inv (hV hx)] |
| 78 | exact hbound x hx w |
| 79 | |
| 80 | end PoincareMT.RiemannianMetric |