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 | /-! Adapted from Mapher `PoincareMT/Proofs/M15/Mathlib/InverseOnRange.lean` at |
| 4 | `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in |
| 5 | `references/ricci-flow/mapher/noncollapse/import.json`. -/ |
| 6 | |
| 7 | /-! |
| 8 | # Smooth inverse on an injective local diffeomorphism's range |
| 9 | |
| 10 | The inverse is identified with an actual local inverse on each open |
| 11 | inverse chart. This supplies terminal coordinates in Morgan-Tian Claim |
| 12 | 8.8, pp. 174-175, without requiring a charted open-subtype construction. |
| 13 | See `references/ricci-flow/mapher/noncollapse/derivations/2026-09-21-inverse-on-range.md`. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | /-- The chosen inverse of an injective local diffeomorphism is smooth |
| 22 | on its actual range. This is the inverse-coordinate step used in |
| 23 | Morgan-Tian Claim 8.8, pp. 174-175. -/ |
| 24 | theorem IsLocalDiffeomorph.contMDiffOn_invFun_of_injective |
| 25 | {𝕜 : Type*} [NontriviallyNormedField 𝕜] |
| 26 | {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] |
| 27 | {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] |
| 28 | {H : Type*} [TopologicalSpace H] |
| 29 | {H' : Type*} [TopologicalSpace H'] |
| 30 | {I : ModelWithCorners 𝕜 E H} {J : ModelWithCorners 𝕜 F H'} |
| 31 | {M : Type*} [TopologicalSpace M] [ChartedSpace H M] [Nonempty M] |
| 32 | {N : Type*} [TopologicalSpace N] [ChartedSpace H' N] |
| 33 | {k : WithTop ℕ∞} {f : M → N} |
| 34 | (hf : IsLocalDiffeomorph I J k f) (hinj : Function.Injective f) : |
| 35 | ContMDiffOn J I k (Function.invFun f) (Set.range f) := by |
| 36 | rintro _ ⟨x, rfl⟩ |
| 37 | apply ContMDiffAt.contMDiffWithinAt |
| 38 | apply (hf x).localInverse_contMDiffAt.congr_of_eventuallyEq |
| 39 | filter_upwards [(hf x).localInverse.open_source.mem_nhds |
| 40 | (hf x).localInverse_mem_source] with y hy |
| 41 | apply hinj |
| 42 | exact (Function.invFun_eq ⟨(hf x).localInverse y, (hf x).localInverse_right_inv hy⟩).trans |
| 43 | ((hf x).localInverse_right_inv hy).symm |