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.Analysis.Coordinates.MetricEndRay |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Angles.Geometry.MissingEndComparison |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Angles.Geometry.ChordDefectLimits |
| 5 | |
| 6 | /-! |
| 7 | # Actual chord limits for all retained small end rays |
| 8 | |
| 9 | The proved finite-segment comparison at the missing end produces one |
| 10 | joint chord limit for each pair of actual ray data. The same metric, |
| 11 | completion point, fixed wall and original-cylinder tail remain fixed. |
| 12 | Source: Morgan--Tian Lemmas 10.21-10.22, pp. 259-260; |
| 13 | M28 derivations 151, 152a and 152b. |
| 14 | -/ |
| 15 | |
| 16 | noncomputable section |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M28 |
| 26 | |
| 27 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 29 | [IsManifold (𝓡 3) ∞ M] |
| 30 | {g : RiemannianMetric 3 M} {X : Set M} |
| 31 | |
| 32 | /-- The actual missing-end comparison supplies joint chord limits for |
| 33 | every pair of finite outward ray data. The bound extends to all strict |
| 34 | positive radii, independently of the half-length rectangle used for |
| 35 | the supremum. Source: MT Lemma 10.21, p. 259; derivation 152b. -/ |
| 36 | theorem exists_selected_end_ray_chord_limits |
| 37 | (T : EpsilonTubeCertificate g X) (C : OpenCylinderModel T.carrier) |
| 38 | (U : TopologicalSpace.Opens M) [PreconnectedSpace U] |
| 39 | (hU : (U : Set M) = C.tail true (1 / 2)) (f : M → ℝ) |
| 40 | (hfinite : ∀ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) ≠ ⊤) |
| 41 | (D : LeviCivitaData (intrinsicOpenMetric g U)) |
| 42 | (hsec : D.NonnegativeSectionalCurvature) : |
| 43 | letI := intrinsicOpenMetricSpace g U hfinite |
| 44 | ∀ (E : UniformSpace.Completion U) (alpha : ℝ), 0 < alpha → |
| 45 | (∀ eta : ℝ, 0 < eta → ∃ c : ℝ, 1 / 2 < c ∧ c < 1 ∧ |
| 46 | ∀ x : U, c < (C.inverse x).2 → |
| 47 | dist (x : UniformSpace.Completion U) E < eta) → |
| 48 | (∀ x : U, dist (x : UniformSpace.Completion U) E < alpha → 0 < f x) → |
| 49 | (∀ p q : U, 0 < f p → 0 < f q → |
| 50 | ∃ mu : ℝ → U, mu 0 = p ∧ mu 1 = q ∧ Continuous mu ∧ |
| 51 | (∀ t : ℝ, (3 / 4 : ℝ) ≤ (C.inverse (mu t)).2) ∧ |
| 52 | ∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |
| 53 | (intrinsicOpenMetric g U).edist (mu s) (mu t) = |
| 54 | ENNReal.ofReal |s - t| * (intrinsicOpenMetric g U).edist p q) → |
| 55 | ∃ K : MetricEndRay E alpha → MetricEndRay E alpha → ℝ, |
| 56 | (∀ P Q : MetricEndRay E alpha, K P Q ∈ Icc (0 : ℝ) 4) ∧ |
| 57 | (∀ P Q : MetricEndRay E alpha, |
| 58 | ∀ S ∈ Ioo (0 : ℝ) P.length, ∀ V ∈ Ioo (0 : ℝ) Q.length, |
| 59 | chordDefect (fun s t => dist (P.point s) (Q.point t)) S V ≤ K P Q) ∧ |
| 60 | ∀ P Q : MetricEndRay E alpha, Tendsto |
| 61 | (fun p : ℝ × ℝ => chordDefect (fun s t => dist (P.point s) (Q.point t)) p.1 p.2) |
| 62 | ((𝓝[>] (0 : ℝ)) ×ˢ (𝓝[>] (0 : ℝ))) (𝓝 (K P Q)) := by |
| 63 | classical |
| 64 | let := intrinsicOpenMetricSpace g U hfinite |
| 65 | intro E alpha halpha htail hbarrier hsegments |
| 66 | have hcomparison (P Q : MetricEndRay E alpha) {S V : ℝ} |
| 67 | (hS : 0 < S) (hSP : S < P.length) (hV : 0 < V) (hVQ : V < Q.length) |
| 68 | (s : ℝ) (hs : s ∈ Ioc (0 : ℝ) S) |
| 69 | (t : ℝ) (ht : t ∈ Ioc (0 : ℝ) V) : |
| 70 | dist (P.point s) (Q.point t) ^ 2 ≥ s ^ 2 + t ^ 2 - |
| 71 | 2 * s * t * ((S ^ 2 + V ^ 2 - dist (P.point S) (Q.point V) ^ 2) / |
| 72 | (2 * S * V)) := by |
| 73 | have h := corresponding_side_lower_at_selected_end T C U hU f hfinite D hsec |
| 74 | E alpha halpha htail hbarrier hsegments |
| 75 | P.inward_metric Q.inward_metric P.inward_radius Q.inward_radius |
| 76 | hS hSP (hSP.trans P.length_lt) hV hVQ (hVQ.trans Q.length_lt) s hs t ht |
| 77 | simpa only [MetricEndRay.inward, sub_sub_cancel] using h |
| 78 | have hexists (P Q : MetricEndRay E alpha) : |
| 79 | ∃ k : ℝ, k ∈ Icc (0 : ℝ) 4 ∧ |
| 80 | (∀ s ∈ Ioc (0 : ℝ) (P.length / 2), |
| 81 | ∀ t ∈ Ioc (0 : ℝ) (Q.length / 2), |
| 82 | chordDefect (fun u v => dist (P.point u) (Q.point v)) s t ≤ k) ∧ |
| 83 | Tendsto |
| 84 | (fun p : ℝ × ℝ => chordDefect (fun s t => dist (P.point s) (Q.point t)) p.1 p.2) |
| 85 | ((𝓝[>] (0 : ℝ)) ×ˢ (𝓝[>] (0 : ℝ))) (𝓝 k) := by |
| 86 | apply exists_chordDefect_limit_of_corresponding_side_lower |
| 87 | (half_pos P.length_pos) (half_pos Q.length_pos) |
| 88 | · intro s hs t ht |
| 89 | exact P.completion_triangle Q s |
| 90 | ⟨hs.1, hs.2.trans (half_le_self P.length_pos.le)⟩ t |
| 91 | ⟨ht.1, ht.2.trans (half_le_self Q.length_pos.le)⟩ |
| 92 | · intro S hS V hV s hs t ht |
| 93 | exact hcomparison P Q hS.1 (hS.2.trans_lt (half_lt_self P.length_pos)) |
| 94 | hV.1 (hV.2.trans_lt (half_lt_self Q.length_pos)) s hs t ht |
| 95 | choose K hK _hsmall hlimit using hexists |
| 96 | refine ⟨K, hK, ?_, hlimit⟩ |
| 97 | intro P Q S hS V hV |
| 98 | exact chordDefect_le_joint_limit_of_corresponding_side_lower hS.1 hV.1 |
| 99 | (hlimit P Q) (hcomparison P Q hS.1 hS.2 hV.1 hV.2) |
| 100 | |
| 101 | end PoincareMT.M28 |