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.MFDeriv.Basic |
| 2 | import Mathlib.Geometry.Manifold.ContMDiff.Basic |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.Operations |
| 4 | |
| 5 | /-! |
| 6 | # Smooth inverses for boundaryless manifold local homeomorphisms |
| 7 | -/ |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | open Set Function |
| 13 | open scoped Manifold ContDiff Topology |
| 14 | |
| 15 | namespace Poincare.Spacetime.Realization |
| 16 | |
| 17 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 18 | {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 19 | {M : Type*} [TopologicalSpace M] [ChartedSpace E M] |
| 20 | {N : Type*} [TopologicalSpace N] [ChartedSpace F N] |
| 21 | |
| 22 | theorem boundaryless_inverse_smooth (e : OpenPartialHomeomorph M N) {a : N} |
| 23 | (ha : a ∈ e.target) (he : ContMDiffAt 𝓘(ℝ, E) 𝓘(ℝ, F) ∞ e (e.symm a)) |
| 24 | (e' : E ≃L[ℝ] F) |
| 25 | (he' : mfderiv 𝓘(ℝ, E) 𝓘(ℝ, F) e (e.symm a) = e'.toContinuousLinearMap) : |
| 26 | ContMDiffAt 𝓘(ℝ, F) 𝓘(ℝ, E) ∞ e.symm a := by |
| 27 | let c₁ := chartAt E (e.symm a) |
| 28 | let c₂ := chartAt F a |
| 29 | let c := c₁.symm.trans (e.trans c₂) |
| 30 | have h₂ : c₂ a ∈ c₂.target := mem_chart_target F a |
| 31 | have hc : c₂ a ∈ c.target := by |
| 32 | change (c₂ a ∈ c₂.target ∧ c₂.symm (c₂ a) ∈ e.target) ∧ |
| 33 | e.symm (c₂.symm (c₂ a)) ∈ c₁.source |
| 34 | rw [c₂.left_inv (mem_chart_source F a)] |
| 35 | exact ⟨⟨h₂, ha⟩, mem_chart_source E (e.symm a)⟩ |
| 36 | have hpoint : c.symm (c₂ a) = c₁ (e.symm a) := by |
| 37 | change c₁ (e.symm (c₂.symm (c₂ a))) = _ |
| 38 | rw [c₂.left_inv (mem_chart_source F a)] |
| 39 | have hs : ContDiffAt ℝ ∞ c (c₁ (e.symm a)) := by |
| 40 | simpa [c, c₁, c₂, extChartAt_coe, extChartAt_coe_symm, e.right_inv ha, |
| 41 | contDiffWithinAt_univ, Function.comp_assoc] |
| 42 | using (contMDiffAt_iff.mp he).2 |
| 43 | have hd : HasFDerivAt c e'.toContinuousLinearMap (c₁ (e.symm a)) := by |
| 44 | have h := (he.mdifferentiableAt (by simp)).hasMFDerivAt.2 |
| 45 | rw [he'] at h |
| 46 | simpa [c, c₁, c₂, writtenInExtChartAt, extChartAt_coe, extChartAt_coe_symm, |
| 47 | e.right_inv ha, Function.comp_assoc] using h |
| 48 | have hinv := c.contDiffAt_symm hc (hpoint ▸ hd) (hpoint ▸ hs) |
| 49 | apply contMDiffAt_iff.mpr |
| 50 | refine ⟨e.continuousOn_symm.continuousAt (e.open_target.mem_nhds ha), ?_⟩ |
| 51 | simpa [c, c₁, c₂, extChartAt_coe, extChartAt_coe_symm, contDiffWithinAt_univ] |
| 52 | using hinv |
| 53 | |
| 54 | end Poincare.Spacetime.Realization |