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.Surgery.Induction.Noncollapse.Compat.GeneralizedEquation |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.LGeometry.Avoidance.CapBirthAvoidance |
| 3 | |
| 4 | /-! |
| 5 | # Actual cap avoidance including the initial safe interval |
| 6 | |
| 7 | Lemma 16.15, pp. 379-382. Scalar separation excludes cap points during |
| 8 | the safe initial interval, and the positive-action entry estimate excludes |
| 9 | them afterward. The same assertion excludes regular inner birth points. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter Function MeasureTheory |
| 16 | open scoped Manifold ContDiff Topology intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M12 |
| 21 | end PoincareMT.Proofs.M12 |
| 22 | open PoincareMT.EpochExtension.Spacetime |
| 23 | |
| 24 | namespace PoincareMT.Proofs.M46 |
| 25 | |
| 26 | open PoincareMT.Proofs.M12 |
| 27 | |
| 28 | /-- Every parameter is covered, including paths shorter than the safe |
| 29 | interval and the terminal parameter zero. Source: Lemma 16.15, |
| 30 | pp. 379-382. -/ |
| 31 | theorem CapBarrierWindow.avoids_early_inner_of_initial_scalar |
| 32 | {F : GeneralizedRicciFlowData.{u}} {G : FlowBoxRicciGeometry F} |
| 33 | {C : GeneralizedSliceCarrier.{u}} [CompactSpace C.carrier] |
| 34 | {gBirth : RiemannianMetric 3 C.carrier} {center : C.carrier} |
| 35 | {origin T A h c mu theta : ℝ} |
| 36 | (Q : CapBarrierWindow G C gBirth center origin T A h c mu theta) |
| 37 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 38 | (hmu : 0 < mu) (hA : 0 < A) (hh : 0 < h) (hc : 0 < c) (htheta : theta < 1) |
| 39 | {budget a tau safeBound : ℝ} (hbudget0 : 0 ≤ budget) (ha : 0 < a) |
| 40 | (hside : budget / Real.sqrt a < mu * A ^ 2 / 4) |
| 41 | (htop : budget / Real.sqrt a < -(c / 2) * (Real.log (1 - theta) + Real.log 2)) |
| 42 | (hseparation : safeBound < c / (2 * h ^ 2)) |
| 43 | {x y : G.toLGeometry.Point} (p : M14BackwardPath G.toLGeometry T 0 tau x y) |
| 44 | (hscalar : ∀ s ∈ Icc 0 tau, s ≤ a → |
| 45 | horizontalScalarCurvature G.toLGeometry.leafwise (p.curve s) ≤ safeBound) |
| 46 | (hbudget : (∫ t in 0..tau, Real.sqrt t * pathPositiveDensity p t) ≤ budget) |
| 47 | {b : ℝ} (hb : b ∈ Icc 0 tau) |
| 48 | (w : (G.realization.timeIntervals.interval |
| 49 | (cylinderPhysicalInterval origin (h⁻¹ ^ 2) Q.cylinder.scale_pos Q.interval)).Point × |
| 50 | Q.source) |
| 51 | (hinner : w.2.val ∈ gBirth.ball center (A * h / 2)) |
| 52 | (hinnerTime : (w.1.val - origin) / h ^ 2 ≤ 1 / 2) : |
| 53 | p.curve b ≠ rawCylinderMap G.realization Q.cylinder w := by |
| 54 | by_cases hba : b ≤ a |
| 55 | · intro heq |
| 56 | have hlow := Q.scalar_birth_lower hh hc htheta w |
| 57 | rw [← heq] at hlow |
| 58 | exact (not_lt_of_ge (hlow.trans (hscalar b hb hba))) hseparation |
| 59 | · have hab : a < b := lt_of_not_ge hba |
| 60 | exact Q.avoids_early_inner hM12 hmu hA hh hc htheta hbudget0 ha hside htop |
| 61 | hseparation p (hscalar a ⟨ha.le, hab.le.trans hb.2⟩ le_rfl) hbudget |
| 62 | ⟨hab, hb.2⟩ w hinner hinnerTime |
| 63 | |
| 64 | /-- Avoidance holds at every positive backward birth parameter, even |
| 65 | when the entire path lies inside the initial safe interval. Source: |
| 66 | Lemma 16.15, pp. 379-382. -/ |
| 67 | theorem CapBarrierOriginData.avoids_birth_of_initial_scalar |
| 68 | {F : SurgeryFlowData.{u}} {W : M33RegularHistoryWindow F} |
| 69 | (H : M33RegularHistoryData W) {G : FlowBoxRicciGeometry H.generalized} |
| 70 | {origin T A h c mu theta : ℝ} {center : (F.slice origin).carrier} |
| 71 | (Q : CapBarrierWindow G (F.slice origin) (F.metric origin) center |
| 72 | origin T A h c mu theta) |
| 73 | [CompactSpace (F.slice origin).carrier] |
| 74 | (D : CapBarrierOriginData H Q) (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 75 | (hmu : 0 < mu) (hA : 0 < A) (hh : 0 < h) (hc : 0 < c) (htheta : theta < 1) |
| 76 | {budget a tau safeBound : ℝ} (hbudget0 : 0 ≤ budget) (ha : 0 < a) |
| 77 | (hside : budget / Real.sqrt a < mu * A ^ 2 / 4) |
| 78 | (htop : budget / Real.sqrt a < -(c / 2) * (Real.log (1 - theta) + Real.log 2)) |
| 79 | (hseparation : safeBound < c / (2 * h ^ 2)) |
| 80 | {x z : G.toLGeometry.Point} (p : M14BackwardPath G.toLGeometry T 0 tau x z) |
| 81 | (hscalar : ∀ s ∈ Icc 0 tau, s ≤ a → |
| 82 | horizontalScalarCurvature G.toLGeometry.leafwise (p.curve s) ≤ safeBound) |
| 83 | (hbudget : (∫ t in 0..tau, Real.sqrt t * pathPositiveDensity p t) ≤ budget) |
| 84 | {b : ℝ} (hb : b ∈ Ioc 0 tau) (hclock : T - b = origin) |
| 85 | (horigin : origin ∈ H.generalized.interval) |
| 86 | (y : (H.generalized.slice origin).carrier) |
| 87 | (hy : H.history.forward origin horigin y ∈ (F.metric origin).ball center (A * h / 2)) : |
| 88 | p.curve b ≠ (⟨origin, y⟩ : H.generalized.point) := by |
| 89 | intro heq |
| 90 | obtain ⟨width, hwidth, hnear⟩ := D.birth_capture H Q hA hh horigin y hy |
| 91 | rw [← heq] at hnear |
| 92 | obtain ⟨r, hr, w, hinner, hearly, hw⟩ := backwardPath_reaches_future_neighborhood G p |
| 93 | le_rfl hb.1 hb.2 hwidth hclock hnear |
| 94 | exact Q.avoids_early_inner_of_initial_scalar hM12 hmu hA hh hc htheta hbudget0 ha |
| 95 | hside htop hseparation p hscalar hbudget ⟨hr.1.le, hr.2.le.trans hb.2⟩ |
| 96 | w hinner hearly hw.symm |
| 97 | |
| 98 | end PoincareMT.Proofs.M46 |