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.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckShortening |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckExcursionSubarcs |
| 4 | |
| 5 | /-! |
| 6 | # Endpoint-neck replacement from an actual excursion |
| 7 | |
| 8 | Morgan--Tian Lemma A.1, pp. 497-498, with the smaller positive saving |
| 9 | needed in Claim 10.3. An actual excursion outside the middle neck produces |
| 10 | its own half-neck subarc and an admissible shorter path. The full curve is |
| 11 | only required to lie in its actual minimization region. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M28 |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | [IsManifold (𝓡 3) ∞ M] [T2Space M] {g : RiemannianMetric 3 M} |
| 26 | |
| 27 | /-- An actual middle-neck excursion between two central-sphere points |
| 28 | admits a C1 replacement in the same region with a fixed positive saving. |
| 29 | No neck-contained subarc or length-saving hypothesis is supplied (A.1). -/ |
| 30 | theorem exists_endpoint_neck_shortening (N : EpsilonNeck g) |
| 31 | (hepsilon : N.epsilon ≤ neckShorteningEpsilon) |
| 32 | {U : Set M} (hNU : N.central_sphere ⊆ U) |
| 33 | {γ : ℝ → M} {a b c d t : ℝ} |
| 34 | (hac : a ≤ c) (hct : c ≤ t) (htd : t ≤ d) (hdb : d ≤ b) |
| 35 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc a b)) |
| 36 | (hγU : MapsTo γ (Icc a b) U) |
| 37 | (hc : γ c ∈ N.central_sphere) (hd : γ d ∈ N.central_sphere) |
| 38 | (hexcursion : γ t ∉ N.region (-(N.epsilon⁻¹ / 2)) (N.epsilon⁻¹ / 2)) : |
| 39 | ∃ σ : ℝ → M, σ 0 = γ a ∧ σ 1 = γ b ∧ |
| 40 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 σ (Icc (0 : ℝ) 1) ∧ |
| 41 | MapsTo σ (Icc (0 : ℝ) 1) U ∧ |
| 42 | g.pathELength σ 0 1 + ENNReal.ofReal (N.scale * N.epsilon⁻¹ / 8) ≤ |
| 43 | g.pathELength γ a b := by |
| 44 | obtain ⟨w, hcw, hwt, hprefix, hheight⟩ := N.exists_first_half_neck_subarc hct |
| 45 | (hγ.continuousOn.mono (Icc_subset_Icc hac (htd.trans hdb))) hc hexcursion |
| 46 | exact exists_neck_excursion_replacement N hepsilon hNU hac le_rfl hcw.le |
| 47 | (hwt.trans htd) hdb hγ hγU hc hd hprefix hheight.ge |
| 48 | |
| 49 | end PoincareMT.M28 |