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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Topology.Manifold.NeckCap.Theory |
| 3 | |
| 4 | /-! |
| 5 | # Local retractions for the actual embedded spheres |
| 6 | |
| 7 | Hirsch, Differential Topology, Chapter 8, Section 1, proof of Theorem 1.3, |
| 8 | p. 180: extend the isotopy locally near its embedded image before cutting |
| 9 | off inside the ambient carrier. Here the supplied immersion's rectifying |
| 10 | charts construct the needed local retraction. The embedding condition |
| 11 | excludes every other source sheet from the selected ambient neighborhood. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M28 |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | |
| 26 | /-- A supplied sphere embedding has a genuine smooth local retraction |
| 27 | inside any prescribed open carrier (Hirsch 8.1.3, p. 180). -/ |
| 28 | theorem exists_sphere_embedding_local_retraction |
| 29 | {f : UnitTwoSphere → M} |
| 30 | (hf : Manifold.IsSmoothEmbedding (𝓡 2) (𝓡 3) ∞ f) |
| 31 | (q : UnitTwoSphere) {U : Set M} (hU : IsOpen U) (hqU : f q ∈ U) : |
| 32 | ∃ (V : Set M) (r : M → UnitTwoSphere), |
| 33 | IsOpen V ∧ f q ∈ V ∧ V ⊆ U ∧ |
| 34 | ContMDiffOn (𝓡 3) (𝓡 2) ∞ r V ∧ |
| 35 | ∀ z : UnitTwoSphere, f z ∈ V → r (f z) = z := by |
| 36 | let h : Manifold.IsImmersionAt (𝓡 2) (𝓡 3) ∞ f q := |
| 37 | hf.isImmersion.isImmersionAt q |
| 38 | let P : EuclideanSpace ℝ (Fin 3) →L[ℝ] EuclideanSpace ℝ (Fin 2) := |
| 39 | (ContinuousLinearMap.fst ℝ (EuclideanSpace ℝ (Fin 2)) h.complement).comp |
| 40 | h.equiv.symm.toContinuousLinearMap |
| 41 | let p : M → EuclideanSpace ℝ (Fin 2) := |
| 42 | fun y => P ((h.codChart.extend (𝓡 3)) y) |
| 43 | let r : M → UnitTwoSphere := fun y => (h.domChart.extend (𝓡 2)).symm (p y) |
| 44 | have hp : ContMDiffOn (𝓡 3) 𝓘(ℝ, EuclideanSpace ℝ (Fin 2)) ∞ p |
| 45 | h.codChart.source := |
| 46 | P.contMDiff.comp_contMDiffOn |
| 47 | (h.codChart.contMDiffOn_extend h.codChart_mem_maximalAtlas) |
| 48 | have hpf (z : UnitTwoSphere) (hz : z ∈ h.domChart.source) : |
| 49 | p (f z) = (h.domChart.extend (𝓡 2)) z := by |
| 50 | have hzt : (h.domChart.extend (𝓡 2)) z ∈ (h.domChart.extend (𝓡 2)).target := |
| 51 | (h.domChart.extend (𝓡 2)).map_source (by simpa using hz) |
| 52 | have heq := h.writtenInCharts hzt |
| 53 | change (h.codChart.extend (𝓡 3)) |
| 54 | (f ((h.domChart.extend (𝓡 2)).symm ((h.domChart.extend (𝓡 2)) z))) = |
| 55 | h.equiv ((h.domChart.extend (𝓡 2)) z, 0) at heq |
| 56 | rw [h.domChart.extend_left_inv hz] at heq |
| 57 | change P ((h.codChart.extend (𝓡 3)) (f z)) = _ |
| 58 | rw [heq] |
| 59 | simp [P] |
| 60 | obtain ⟨O, hO, hOf⟩ := |
| 61 | hf.isEmbedding.isInducing.isOpen_iff.mp h.domChart.open_source |
| 62 | let V : Set M := (U ∩ O) ∩ |
| 63 | (h.codChart.source ∩ p ⁻¹' (h.domChart.extend (𝓡 2)).target) |
| 64 | have hV : IsOpen V := |
| 65 | (hU.inter hO).inter |
| 66 | (hp.continuousOn.isOpen_inter_preimage h.codChart.open_source |
| 67 | h.domChart.isOpen_extend_target) |
| 68 | have hqO : f q ∈ O := by |
| 69 | have : q ∈ f ⁻¹' O := by rw [hOf]; exact h.mem_domChart_source |
| 70 | exact this |
| 71 | have hqV : f q ∈ V := by |
| 72 | refine ⟨⟨hqU, hqO⟩, h.mem_codChart_source, ?_⟩ |
| 73 | change p (f q) ∈ (h.domChart.extend (𝓡 2)).target |
| 74 | rw [hpf q h.mem_domChart_source] |
| 75 | exact (h.domChart.extend (𝓡 2)).map_source (by simpa using h.mem_domChart_source) |
| 76 | have hrs : ContMDiffOn 𝓘(ℝ, EuclideanSpace ℝ (Fin 2)) (𝓡 2) ∞ |
| 77 | (h.domChart.extend (𝓡 2)).symm (h.domChart.extend (𝓡 2)).target := by |
| 78 | rw [h.domChart.extend_target'] |
| 79 | exact contMDiffOn_extend_symm h.domChart_mem_maximalAtlas |
| 80 | refine ⟨V, r, hV, hqV, fun _ hy => hy.1.1, |
| 81 | hrs.comp (hp.mono fun _ hy => hy.2.1) (fun _ hy => hy.2.2), ?_⟩ |
| 82 | intro z hz |
| 83 | have hzdom : z ∈ h.domChart.source := by |
| 84 | rw [← hOf] |
| 85 | exact hz.1.2 |
| 86 | change (h.domChart.extend (𝓡 2)).symm (p (f z)) = z |
| 87 | rw [hpf z hzdom] |
| 88 | exact h.domChart.extend_left_inv hzdom |
| 89 | |
| 90 | end PoincareMT.M28 |