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.ReducedGeometry.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.LGeometry.CapEntry.FirstExitCompletion |
| 3 | |
| 4 | /-! |
| 5 | # The physical lateral cap-entry action bound |
| 6 | |
| 7 | Proposition 16.13, pp. 377-378. The inverse-cylinder curve crosses |
| 8 | between the physical birth radii A*h/2 and A*h. Its actual finite |
| 9 | energy, the lower birth metric factor, and duration at most h^2 give |
| 10 | the scale-independent lower action mu*A^2/4. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter MeasureTheory |
| 17 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M08 |
| 22 | export PoincareMT.LGeometry (referenceSpeedSq) |
| 23 | end PoincareMT.M08 |
| 24 | namespace PoincareMT.M08 |
| 25 | export PoincareMT.LGeometry (referenceSpeedSq_continuousOn) |
| 26 | end PoincareMT.M08 |
| 27 | namespace PoincareMT.M08 |
| 28 | export PoincareMT.LGeometry (referenceSpeedSq_nonneg) |
| 29 | end PoincareMT.M08 |
| 30 | |
| 31 | namespace PoincareMT.Proofs.M46 |
| 32 | |
| 33 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 34 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] [T3Space M] |
| 35 | |
| 36 | omit [T3Space M] in |
| 37 | /-- The actual moving-metric lower bound and finite action give finite |
| 38 | physical birth energy up to a possibly irregular exit endpoint. |
| 39 | Source: Proposition 16.13, pp. 377-378. -/ |
| 40 | theorem birthEnergy_integrable_of_action_bound (g : RiemannianMetric n M) |
| 41 | {gamma : ℝ → M} {a b mu : ℝ} (hab : a ≤ b) (hmu : 0 < mu) |
| 42 | (hregular : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) 1 gamma (Ioo a b)) |
| 43 | (density : ℝ → ℝ) (hint : IntervalIntegrable density volume a b) |
| 44 | (hbound : ∀ t ∈ Ioo a b, mu * M08.referenceSpeedSq g gamma t ≤ density t) : |
| 45 | IntervalIntegrable (M08.referenceSpeedSq g gamma) volume a b ∧ |
| 46 | mu * (∫ t in a..b, M08.referenceSpeedSq g gamma t) ≤ ∫ t in a..b, density t := by |
| 47 | have hmeas : AEStronglyMeasurable (M08.referenceSpeedSq g gamma) |
| 48 | (volume.restrict (uIoc a b)) := by |
| 49 | rw [uIoc_of_le hab, ← restrict_Ioo_eq_restrict_Ioc] |
| 50 | have hcont := M08.referenceSpeedSq_continuousOn g isOpen_Ioo hregular |
| 51 | exact hcont.aestronglyMeasurable measurableSet_Ioo |
| 52 | have henergy : IntervalIntegrable (M08.referenceSpeedSq g gamma) volume a b := by |
| 53 | apply (hint.const_mul mu⁻¹).mono_fun' hmeas |
| 54 | rw [uIoc_of_le hab, ← restrict_Ioo_eq_restrict_Ioc] |
| 55 | filter_upwards [ae_restrict_mem measurableSet_Ioo] with t ht |
| 56 | rw [Real.norm_eq_abs, abs_of_nonneg (M08.referenceSpeedSq_nonneg g gamma t)] |
| 57 | have h := mul_le_mul_of_nonneg_left (hbound t ht) (inv_nonneg.mpr hmu.le) |
| 58 | simpa only [← mul_assoc, inv_mul_cancel₀ hmu.ne', one_mul] using h |
| 59 | refine ⟨henergy, ?_⟩ |
| 60 | have h := intervalIntegral.integral_mono_on_of_le_Ioo hab (henergy.const_mul mu) hint hbound |
| 61 | rwa [intervalIntegral.integral_const_mul] at h |
| 62 | |
| 63 | omit [T3Space M] in |
| 64 | /-- Inner and outer physical birth balls force half the outer radius |
| 65 | of intrinsic displacement. Source: Proposition 16.13, p. 378. -/ |
| 66 | theorem half_radius_le_exit_edist (g : RiemannianMetric n M) |
| 67 | {center x y : M} {R : ℝ} (hR : 0 < R) |
| 68 | (hx : x ∈ g.ball center (R / 2)) (hy : y ∉ g.ball center R) : |
| 69 | ENNReal.ofReal (R / 2) ≤ g.edist x y := by |
| 70 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 71 | ⟨g.toRiemannianMetric⟩ |
| 72 | have houter : ENNReal.ofReal R ≤ g.edist center y := le_of_not_gt hy |
| 73 | by_contra hnot |
| 74 | have hinner : g.edist center x < ENNReal.ofReal (R / 2) := hx |
| 75 | have hshort : g.edist x y < ENNReal.ofReal (R / 2) := lt_of_not_ge hnot |
| 76 | have hsum : g.edist center x + g.edist x y < ENNReal.ofReal R := by |
| 77 | have h := ENNReal.add_lt_add hinner hshort |
| 78 | simpa only [← ENNReal.ofReal_add (p := R / 2) (q := R / 2) |
| 79 | (by positivity) (by positivity), |
| 80 | add_halves] using h |
| 81 | exact (not_lt_of_ge houter) ((Manifold.riemannianEDist_triangle (I := 𝓡 n) |
| 82 | (x := center) (y := x) (z := y)).trans_lt hsum) |
| 83 | |
| 84 | private theorem capAction_lower_of_separation (g : RiemannianMetric n M) |
| 85 | {gamma : ℝ → M} {a b mu A h : ℝ} (hab : a < b) |
| 86 | (hmu : 0 < mu) (hA : 0 < A) (hh : 0 < h) (hduration : b - a ≤ h ^ 2) |
| 87 | (hcont : ContinuousOn gamma (Icc a b)) |
| 88 | (hregular : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) 1 gamma (Ioo a b)) |
| 89 | (density : ℝ → ℝ) (hint : IntervalIntegrable density volume a b) |
| 90 | (hbound : ∀ t ∈ Ioo a b, mu * M08.referenceSpeedSq g gamma t ≤ density t) |
| 91 | (hsep : ENNReal.ofReal (A * h / 2) ≤ g.edist (gamma a) (gamma b)) : |
| 92 | mu * A ^ 2 / 4 ≤ ∫ t in a..b, density t := by |
| 93 | obtain ⟨henergy, haction⟩ := |
| 94 | birthEnergy_integrable_of_action_bound g hab.le hmu hregular density hint hbound |
| 95 | have hdistance := sq_distance_le_duration_mul_energy g hab (by positivity) |
| 96 | hcont hregular henergy hsep |
| 97 | have hE : 0 ≤ ∫ t in a..b, M08.referenceSpeedSq g gamma t := |
| 98 | intervalIntegral.integral_nonneg hab.le (fun t _ => M08.referenceSpeedSq_nonneg g gamma t) |
| 99 | have hscale : h ^ 2 * (mu * A ^ 2 / 4) ≤ h ^ 2 * ∫ t in a..b, density t := by |
| 100 | calc |
| 101 | _ = mu * (A * h / 2) ^ 2 := by ring |
| 102 | _ ≤ mu * ((b - a) * ∫ t in a..b, M08.referenceSpeedSq g gamma t) := |
| 103 | mul_le_mul_of_nonneg_left hdistance hmu.le |
| 104 | _ ≤ mu * (h ^ 2 * ∫ t in a..b, M08.referenceSpeedSq g gamma t) := |
| 105 | mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hduration hE) hmu.le |
| 106 | _ = h ^ 2 * (mu * ∫ t in a..b, M08.referenceSpeedSq g gamma t) := by ring |
| 107 | _ ≤ _ := mul_le_mul_of_nonneg_left haction (sq_nonneg h) |
| 108 | exact (mul_le_mul_iff_right₀ (sq_pos_of_pos hh)).mp hscale |
| 109 | |
| 110 | /-- The actual lateral exit has unweighted action at least mu*A^2/4. |
| 111 | The physical scale cancels against the maximum physical duration. |
| 112 | Source: Proposition 16.13, pp. 377-378. -/ |
| 113 | theorem capSideAction_lower (g : RiemannianMetric n M) |
| 114 | {gamma : ℝ → M} {a b mu A h : ℝ} (hab : a < b) |
| 115 | (hmu : 0 < mu) (hA : 0 < A) (hh : 0 < h) (hduration : b - a ≤ h ^ 2) |
| 116 | (hcont : ContinuousOn gamma (Icc a b)) |
| 117 | (hregular : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) 1 gamma (Ioo a b)) |
| 118 | (density : ℝ → ℝ) (hint : IntervalIntegrable density volume a b) |
| 119 | (hbound : ∀ t ∈ Ioo a b, mu * M08.referenceSpeedSq g gamma t ≤ density t) |
| 120 | (center : M) (hinner : gamma a ∈ g.ball center (A * h / 2)) |
| 121 | (houter : gamma b ∉ g.ball center (A * h)) : |
| 122 | mu * A ^ 2 / 4 ≤ ∫ t in a..b, density t := |
| 123 | capAction_lower_of_separation g hab hmu hA hh hduration hcont hregular density hint |
| 124 | hbound (half_radius_le_exit_edist g (mul_pos hA hh) hinner houter) |
| 125 | |
| 126 | /-- The same lower bound holds on the last-entry suffix of a backward |
| 127 | path, with its original parameter unchanged. Source: Proposition 16.13, |
| 128 | pp. 377-378. -/ |
| 129 | theorem capEntryAction_lower (g : RiemannianMetric n M) |
| 130 | {gamma : ℝ → M} {a b mu A h : ℝ} (hab : a < b) |
| 131 | (hmu : 0 < mu) (hA : 0 < A) (hh : 0 < h) (hduration : b - a ≤ h ^ 2) |
| 132 | (hcont : ContinuousOn gamma (Icc a b)) |
| 133 | (hregular : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) 1 gamma (Ioo a b)) |
| 134 | (density : ℝ → ℝ) (hint : IntervalIntegrable density volume a b) |
| 135 | (hbound : ∀ t ∈ Ioo a b, mu * M08.referenceSpeedSq g gamma t ≤ density t) |
| 136 | (center : M) (hinner : gamma b ∈ g.ball center (A * h / 2)) |
| 137 | (houter : gamma a ∉ g.ball center (A * h)) : |
| 138 | mu * A ^ 2 / 4 ≤ ∫ t in a..b, density t := by |
| 139 | apply capAction_lower_of_separation g hab hmu hA hh hduration hcont hregular density |
| 140 | hint hbound |
| 141 | have hsep := half_radius_le_exit_edist g (mul_pos hA hh) hinner houter |
| 142 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 143 | ⟨g.toRiemannianMetric⟩ |
| 144 | have hcomm : g.edist (gamma b) (gamma a) = g.edist (gamma a) (gamma b) := |
| 145 | Manifold.riemannianEDist_comm |
| 146 | rwa [hcomm] at hsep |
| 147 | |
| 148 | end PoincareMT.Proofs.M46 |