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 Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 2 | |
| 3 | /-! |
| 4 | # Regularity of continuous lifts through local diffeomorphisms |
| 5 | |
| 6 | A continuous lift is locally the smooth inverse composed with its projection. |
| 7 | This supplies the C2 lift in Definition 19.12, MT2007 p. 446; see |
| 8 | `proof-work/tasks/M63/derivations/2026-09-21-positive-degree.md`. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff |
| 14 | |
| 15 | /-- A continuous lift inherits differentiability order from its projection |
| 16 | through a sufficiently regular local diffeomorphism. This is the local |
| 17 | inverse step for the ramp lift in Definition 19.12, MT2007 p. 446. -/ |
| 18 | theorem IsLocalDiffeomorphAt.contMDiffAt_of_comp |
| 19 | {K : Type*} [NontriviallyNormedField K] |
| 20 | {E F G : Type*} [NormedAddCommGroup E] [NormedSpace K E] |
| 21 | [NormedAddCommGroup F] [NormedSpace K F] [NormedAddCommGroup G] [NormedSpace K G] |
| 22 | {H H' H'' : Type*} [TopologicalSpace H] [TopologicalSpace H'] [TopologicalSpace H''] |
| 23 | {I : ModelWithCorners K E H} {J : ModelWithCorners K F H'} |
| 24 | {J' : ModelWithCorners K G H''} |
| 25 | {A B C : Type*} [TopologicalSpace A] [ChartedSpace H A] |
| 26 | [TopologicalSpace B] [ChartedSpace H' B] [TopologicalSpace C] [ChartedSpace H'' C] |
| 27 | {f : A → B} {p : B → C} {x : A} {m k : WithTop ℕ∞} |
| 28 | (hp : IsLocalDiffeomorphAt J J' k p (f x)) (hmk : m ≤ k) |
| 29 | (hf : ContinuousAt f x) (hcomp : ContMDiffAt I J' m (p ∘ f) x) : |
| 30 | ContMDiffAt I J m f x := by |
| 31 | have h := (hp.localInverse_contMDiffAt.of_le hmk).comp x hcomp |
| 32 | apply h.congr_of_eventuallyEq |
| 33 | exact (hp.localInverse_eventuallyEq_left.comp_tendsto hf).symm |