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.Surgery.Comparison.Basic |
| 2 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 3 | |
| 4 | /-! |
| 5 | # Smooth inverses on the surgery regions |
| 6 | |
| 7 | The region identifications in Morgan--Tian Proposition 15.12, p. 365, |
| 8 | are local diffeomorphisms only on their displayed open domains. These |
| 9 | adapters retain that domain membership explicitly. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- The inverse of a selected component is a right inverse on the range of |
| 22 | the inclusion, the domain used in Proposition 15.12, p. 365. -/ |
| 23 | theorem m57Component_inverse_right |
| 24 | {A : GeneralizedSliceCarrier.{u}} (C : SurgerySelectedComponent A) |
| 25 | {x : A.carrier} (hx : x ∈ range C.inclusion) : C.inclusion (C.inverse x) = x := by |
| 26 | obtain ⟨y, rfl⟩ := hx |
| 27 | exact congrArg C.inclusion (C.left_inverse y) |
| 28 | |
| 29 | /-- An open region identification has a smooth local inverse precisely on |
| 30 | the displayed target region; Proposition 15.12, p. 365. -/ |
| 31 | theorem m57RegionInverse_localDiffeomorph |
| 32 | {A B : GeneralizedSliceCarrier.{u}} {U : Set A.carrier} {V : Set B.carrier} |
| 33 | (e : SurgeryRegionEquivalence A B U V) (hU : IsOpen U) (hV : IsOpen V) |
| 34 | (y : B.carrier) (hy : y ∈ V) : |
| 35 | IsLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ e.inverse y := by |
| 36 | let d : PartialDiffeomorph (𝓡 3) (𝓡 3) B.carrier A.carrier ∞ := |
| 37 | { toFun := e.inverse |
| 38 | invFun := e.map |
| 39 | source := V |
| 40 | target := U |
| 41 | map_source' := by |
| 42 | intro x hx |
| 43 | exact e.inverse_image.subset ⟨x, hx, rfl⟩ |
| 44 | map_target' := by |
| 45 | intro x hx |
| 46 | exact e.map_image.subset ⟨x, hx, rfl⟩ |
| 47 | left_inv' := e.right_inverse |
| 48 | right_inv' := e.left_inverse |
| 49 | open_source := hV |
| 50 | open_target := hU |
| 51 | contMDiffOn_toFun := e.inverse_smooth |
| 52 | contMDiffOn_invFun := e.map_smooth } |
| 53 | exact ⟨d, hy, fun _ _ => rfl⟩ |
| 54 | |
| 55 | /-- The component inverse is locally a diffeomorphism on the inclusion |
| 56 | range, as used in Proposition 15.12, p. 365, with no assertion about its |
| 57 | arbitrary values outside that range. -/ |
| 58 | theorem m57ComponentInverse_localDiffeomorph |
| 59 | {A : GeneralizedSliceCarrier.{u}} (C : SurgerySelectedComponent A) |
| 60 | (x : A.carrier) (hx : x ∈ range C.inclusion) : |
| 61 | IsLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ C.inverse x := by |
| 62 | let d : PartialDiffeomorph (𝓡 3) (𝓡 3) A.carrier C.carrier.carrier ∞ := |
| 63 | { toFun := C.inverse |
| 64 | invFun := C.inclusion |
| 65 | source := range C.inclusion |
| 66 | target := univ |
| 67 | map_source' := fun _ _ => mem_univ _ |
| 68 | map_target' := fun y _ => ⟨y, rfl⟩ |
| 69 | left_inv' := fun _ hy => m57Component_inverse_right C hy |
| 70 | right_inv' := fun y _ => C.left_inverse y |
| 71 | open_source := C.inclusion_openEmbedding.isOpen_range |
| 72 | open_target := isOpen_univ |
| 73 | contMDiffOn_toFun := C.inverse_smooth |
| 74 | contMDiffOn_invFun := C.inclusion_smooth.contMDiffOn } |
| 75 | exact ⟨d, hx, fun _ _ => rfl⟩ |
| 76 | |
| 77 | end PoincareMT |