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.Diffeomorph |
| 2 | |
| 3 | /-! # Transporting a smooth atlas along a homeomorphism -/ |
| 4 | |
| 5 | open Set |
| 6 | open scoped Manifold ContDiff |
| 7 | |
| 8 | namespace Poincare.Manifold.HomeomorphTransport |
| 9 | |
| 10 | variable {H M N : Type*} [TopologicalSpace H] [TopologicalSpace M] |
| 11 | [TopologicalSpace N] [ChartedSpace H M] (e : M ≃ₜ N) |
| 12 | |
| 13 | /-- The direct image atlas, with charts composed with the inverse homeomorphism. -/ |
| 14 | @[reducible] def chartedSpace : ChartedSpace H N where |
| 15 | atlas := (fun c => e.symm.toOpenPartialHomeomorph.trans c) '' atlas H M |
| 16 | chartAt y := e.symm.toOpenPartialHomeomorph.trans (chartAt H (e.symm y)) |
| 17 | mem_chart_source y := by simp |
| 18 | chart_mem_atlas y := ⟨chartAt H (e.symm y), chart_mem_atlas H _, rfl⟩ |
| 19 | |
| 20 | theorem chartAt_eq (y : N) : |
| 21 | letI := chartedSpace (H := H) e |
| 22 | chartAt H y = e.symm.toOpenPartialHomeomorph.trans (chartAt H (e.symm y)) := rfl |
| 23 | |
| 24 | omit [ChartedSpace H M] in |
| 25 | /-- The transported coordinate transitions equal the original transitions. -/ |
| 26 | theorem chart_transition (c c' : OpenPartialHomeomorph M H) : |
| 27 | (e.symm.toOpenPartialHomeomorph.trans c).symm.trans |
| 28 | (e.symm.toOpenPartialHomeomorph.trans c') = c.symm.trans c' := by |
| 29 | ext z <;> simp [Function.comp_def] |
| 30 | |
| 31 | variable {𝕜 E : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] |
| 32 | [NormedSpace 𝕜 E] (I : ModelWithCorners 𝕜 E H) (r : ℕ∞ω) |
| 33 | |
| 34 | /-- Compatibility of the transported atlas follows from the original atlas. -/ |
| 35 | theorem isManifold [IsManifold I r M] : |
| 36 | letI := chartedSpace (H := H) e |
| 37 | IsManifold I r N := by |
| 38 | let := chartedSpace (H := H) e |
| 39 | refine { compatible := ?_ } |
| 40 | rintro _ _ ⟨c, hc, rfl⟩ ⟨c', hc', rfl⟩ |
| 41 | rw [chart_transition] |
| 42 | exact StructureGroupoid.compatible (contDiffGroupoid r I) hc hc' |
| 43 | |
| 44 | /-- A homeomorphism is smooth for the atlas it transports. -/ |
| 45 | theorem contMDiff [IsManifold I r M] : |
| 46 | letI := chartedSpace (H := H) e |
| 47 | ContMDiff I I r e := by |
| 48 | let := chartedSpace (H := H) e |
| 49 | intro x |
| 50 | apply contMDiffAt_iff.mpr |
| 51 | refine ⟨e.continuous.continuousAt, ?_⟩ |
| 52 | have hid := (contMDiffAt_iff.mp |
| 53 | ((contMDiff_id (I := I) (n := r)).contMDiffAt (x := x))).2 |
| 54 | simpa [extChartAt_coe, extChartAt_coe_symm, chartAt_eq e, Function.comp_def] using hid |
| 55 | |
| 56 | /-- The inverse homeomorphism is smooth for the transported atlas. -/ |
| 57 | theorem contMDiff_symm [IsManifold I r M] : |
| 58 | letI := chartedSpace (H := H) e |
| 59 | ContMDiff I I r e.symm := by |
| 60 | let := chartedSpace (H := H) e |
| 61 | intro y |
| 62 | apply contMDiffAt_iff.mpr |
| 63 | refine ⟨e.symm.continuous.continuousAt, ?_⟩ |
| 64 | have hid := (contMDiffAt_iff.mp |
| 65 | ((contMDiff_id (I := I) (n := r)).contMDiffAt (x := e.symm y))).2 |
| 66 | simpa [extChartAt_coe, extChartAt_coe_symm, chartAt_eq e, Function.comp_def] using hid |
| 67 | |
| 68 | /-- A homeomorphism becomes a diffeomorphism for the transported atlas. -/ |
| 69 | def diffeomorph [IsManifold I r M] : |
| 70 | letI := chartedSpace (H := H) e |
| 71 | Diffeomorph I I M N r := by |
| 72 | letI := chartedSpace (H := H) e |
| 73 | exact { e.toEquiv with |
| 74 | contMDiff_toFun := contMDiff e I r |
| 75 | contMDiff_invFun := contMDiff_symm e I r } |
| 76 | |
| 77 | end Poincare.Manifold.HomeomorphTransport |