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.Ends.TubeNeckConfinement |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Paths.ConfinementMinimizers |
| 4 | |
| 5 | /-! |
| 6 | # Actual intrinsic minimizers between selected tube necks |
| 7 | |
| 8 | Claim 10.3, Morgan--Tian pp. 248-249. The actual chain isotopies and |
| 9 | disjoint endpoint necks construct the compact confinement set. Endpoint |
| 10 | shortening then confines near-minimal competitors and produces a finite |
| 11 | C1 regional minimizer. See derivation 28. |
| 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.EpsilonTubeCertificate |
| 22 | |
| 23 | open M28 |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 27 | [IsManifold (𝓡 3) ∞ M] {g : RiemannianMetric 3 M} {X : Set M} |
| 28 | |
| 29 | /-- A finite path between actual selected tube spheres has an actual |
| 30 | regional minimizer. No compact set or minimizing sequence is supplied. -/ |
| 31 | theorem exists_chain_neck_minimizer (T : EpsilonTubeCertificate g X) |
| 32 | (i j : ℤ) (hi : i ∈ T.chain.shape.active) (hj : j ∈ T.chain.shape.active) |
| 33 | (hdisj : Disjoint (T.chain.neck i).carrier (T.chain.neck j).carrier) |
| 34 | (hsmall : T.epsilon ≤ neckShorteningEpsilon) |
| 35 | {η : ℝ → M} {a b L : ℝ} (hab : a ≤ b) |
| 36 | (hη : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 η (Icc a b)) |
| 37 | (hηU : MapsTo η (Icc a b) T.carrier) |
| 38 | (hη0 : η a ∈ (T.chain.neck i).central_sphere) |
| 39 | (hη1 : η b ∈ (T.chain.neck j).central_sphere) |
| 40 | (hηL : g.pathELength η a b < ENNReal.ofReal L) : |
| 41 | ∃ γ : ℝ → M, γ 0 = η a ∧ γ 1 = η b ∧ |
| 42 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc (0 : ℝ) 1) ∧ |
| 43 | MapsTo γ (Icc (0 : ℝ) 1) T.carrier ∧ |
| 44 | g.pathELength γ 0 1 = intrinsicEDist g T.carrier (η a) (η b) ∧ |
| 45 | g.pathELength γ 0 1 ≠ ⊤ ∧ g.pathELength γ 0 1 < ENNReal.ofReal L := by |
| 46 | let N : Bool → EpsilonNeck g := fun k => T.chain.neck (if k then j else i) |
| 47 | have hactive (k : Bool) : (if k then j else i) ∈ T.chain.shape.active := by |
| 48 | cases k |
| 49 | · exact hi |
| 50 | · exact hj |
| 51 | have hNsmall (k : Bool) : (N k).epsilon ≤ neckShorteningEpsilon := by |
| 52 | exact (T.chain.epsilon_eq _ (hactive k)).trans_le hsmall |
| 53 | have hNU (k : Bool) : (N k).carrier ⊆ T.carrier := by |
| 54 | rw [T.carrier_eq_chain_union] |
| 55 | exact subset_iUnion_of_subset ⟨_, hactive k⟩ Subset.rfl |
| 56 | obtain ⟨K, hK, hKU, hcross⟩ := T.exists_chain_neck_confinement i j hi hj hdisj |
| 57 | let U : TopologicalSpace.Opens M := ⟨T.carrier, T.carrier_open⟩ |
| 58 | obtain ⟨α, hα0, hα1, hα, hαU, hαlength⟩ := exists_unit_interval_path g hab hη hηU |
| 59 | have hαL : g.pathELength α 0 1 < ENNReal.ofReal L := hαlength ▸ hηL |
| 60 | have hcross' : ∀ γ : ℝ → M, γ 0 = η a → γ 1 = η b → |
| 61 | ContinuousOn γ (Icc (0 : ℝ) 1) → MapsTo γ (Icc (0 : ℝ) 1) (U : Set M) → |
| 62 | ∀ t ∈ Icc (0 : ℝ) 1, γ t ∉ K → |
| 63 | ∃ (k : Bool) (c d : ℝ), 0 ≤ c ∧ c ≤ t ∧ t ≤ d ∧ d ≤ 1 ∧ |
| 64 | γ c ∈ (N k).central_sphere ∧ γ d ∈ (N k).central_sphere ∧ |
| 65 | γ t ∉ (N k).region (-((N k).epsilon⁻¹ / 2)) ((N k).epsilon⁻¹ / 2) := by |
| 66 | intro γ hγ0 hγ1 hγ hγU t ht hnot |
| 67 | exact hcross γ (hγ0 ▸ hη0) (hγ1 ▸ hη1) hγ hγU t ht hnot |
| 68 | obtain ⟨_, _, _, hmin⟩ := |
| 69 | exists_confined_sequence_and_minimizer_of_endpoint_crossings g U hK hKU N hNsmall |
| 70 | (fun k => (N k).central_sphere_subset.trans (hNU k)) |
| 71 | hcross' hα0 hα1 hα hαU hαL |
| 72 | exact hmin |
| 73 | |
| 74 | end PoincareMT.EpsilonTubeCertificate |