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.CurveShortening.Comparison.IntrinsicComparison.Curvature.Loss |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Area.Loss |
| 3 | |
| 4 | /-! |
| 5 | # Length remaining after the three actual exceptional sets |
| 6 | |
| 7 | The high-curvature set, measurable focusing cover, and long normal fibers |
| 8 | are removed from the real boundary parameter interval. Integral partitions |
| 9 | give the remaining weighted length. The final normal metric distortion is |
| 10 | retained explicitly in the three-quarter comparison. |
| 11 | |
| 12 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. The project derivations |
| 13 | implement its intrinsic normal-geodesic, focusing and retained-length comparison |
| 14 | arguments. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open Set Filter MeasureTheory |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | /-- Partitioning the actual boundary gives the retained short-fiber length. Only the |
| 25 | focusing set can overlap previous removals, which improves the estimate by nonnegativity of |
| 26 | boundary speed. Source: MT Proposition 19.35, pp. 480-481; |
| 27 | `reports/2026-09-25-retained-strip-three-losses.md`. -/ |
| 28 | theorem m64Intrinsic_retained_short_base_length_lower |
| 29 | (N : IntrinsicAnnulus) {alpha R : ℝ} {E : Set ℝ} |
| 30 | (hE : MeasurableSet E) (hEsub : E ⊆ Icc (0 : ℝ) rampPeriod) |
| 31 | {height : ℝ → ℝ} (hh : Measurable height) : |
| 32 | let X := Ico (0 : ℝ) rampPeriod ∩ |
| 33 | {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha} |
| 34 | let S := X \ E |
| 35 | intrinsicBoundaryLength N.metric 1 0 rampPeriod - |
| 36 | m64IntrinsicHighCurvatureLength N alpha - |
| 37 | (∫ s in E, intrinsicBoundarySpeed N.metric 1 s) - |
| 38 | m64IntrinsicLongFiberLength N S height R ≤ |
| 39 | ∫ s in S ∩ {s | height s < R}, intrinsicBoundarySpeed N.metric 1 s := by |
| 40 | let speed := intrinsicBoundarySpeed N.metric 1 |
| 41 | let B := Ico (0 : ℝ) rampPeriod |
| 42 | let Y := {s | alpha < intrinsicGeodesicCurvature N.metric N.connection 1 s} |
| 43 | let X := B ∩ {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha} |
| 44 | let S := X \ E |
| 45 | have hspeed : Continuous speed := |
| 46 | (m64Intrinsic_contDiff_boundarySpeed N (by norm_num : (1 : ℝ) ≠ 0)).continuous |
| 47 | have hY : MeasurableSet Y := (isOpen_lt continuous_const |
| 48 | (m64Intrinsic_continuous_geodesicCurvature N (by norm_num : (1 : ℝ) ≠ 0))).measurableSet |
| 49 | have hXB : X ⊆ B := inter_subset_left |
| 50 | have hBI : B ⊆ Icc (0 : ℝ) rampPeriod := Ico_subset_Icc_self |
| 51 | have hXeq : B \ Y = X := by |
| 52 | ext s |
| 53 | simp only [Y, X, Set.mem_sdiff, mem_inter_iff, mem_ofPred_eq, not_lt] |
| 54 | have hhigh : (∫ s in B ∩ Y, speed s) = m64IntrinsicHighCurvatureLength N alpha := by |
| 55 | apply setIntegral_congr_set |
| 56 | exact Ico_ae_eq_Ioc.inter (ae_eq_refl Y) |
| 57 | have hfull : (∫ s in B, speed s) = intrinsicBoundaryLength N.metric 1 0 rampPeriod := by |
| 58 | change (∫ s in Ico (0 : ℝ) rampPeriod, speed s) = ∫ s in (0 : ℝ)..rampPeriod, speed s |
| 59 | rw [intervalIntegral.integral_of_le (show (0 : ℝ) ≤ rampPeriod from Real.two_pi_pos.le)] |
| 60 | exact setIntegral_congr_set Ico_ae_eq_Ioc |
| 61 | have hsplitX := integral_inter_add_sdiff (μ := volume) (s := B) hY |
| 62 | (hspeed.integrableOn_Icc.mono_set hBI) |
| 63 | rw [hXeq, hhigh, hfull] at hsplitX |
| 64 | have hsplitS := integral_inter_add_sdiff (μ := volume) (s := X) hE |
| 65 | (hspeed.integrableOn_Icc.mono_set (hXB.trans hBI)) |
| 66 | have hremove : (∫ s in X ∩ E, speed s) ≤ ∫ s in E, speed s := by |
| 67 | apply setIntegral_mono_set (hspeed.integrableOn_Icc.mono_set hEsub) |
| 68 | (Eventually.of_forall (fun _ => Real.sqrt_nonneg _)) |
| 69 | exact Eventually.of_forall (fun _ hs => hs.2) |
| 70 | have hlong : MeasurableSet {s | R ≤ height s} := measurableSet_le measurable_const hh |
| 71 | have hsplitZ := integral_inter_add_sdiff (μ := volume) (s := S) hlong |
| 72 | (hspeed.integrableOn_Icc.mono_set (sdiff_subset.trans (hXB.trans hBI))) |
| 73 | have hZeq : S \ {s | R ≤ height s} = S ∩ {s | height s < R} := by |
| 74 | ext s |
| 75 | simp only [Set.mem_sdiff, mem_inter_iff, mem_ofPred_eq, not_le] |
| 76 | change (∫ s in S ∩ {s | R ≤ height s}, speed s) + |
| 77 | (∫ s in S \ {s | R ≤ height s}, speed s) = ∫ s in S, speed s at hsplitZ |
| 78 | rw [hZeq] at hsplitZ |
| 79 | change m64IntrinsicLongFiberLength N S height R + |
| 80 | (∫ s in S ∩ {s | height s < R}, speed s) = ∫ s in S, speed s at hsplitZ |
| 81 | change intrinsicBoundaryLength N.metric 1 0 rampPeriod - |
| 82 | m64IntrinsicHighCurvatureLength N alpha - (∫ s in E, speed s) - |
| 83 | m64IntrinsicLongFiberLength N S height R ≤ |
| 84 | ∫ s in S ∩ {s | height s < R}, speed s |
| 85 | linarith |
| 86 | |
| 87 | /-- The three actual losses leave more than three quarters of the first length even after |
| 88 | applying the full normal metric distortion. Source: MT Proposition 19.35, pp. 480-481; |
| 89 | `reports/2026-09-25-retained-strip-three-losses.md`. -/ |
| 90 | theorem m64Intrinsic_retained_short_base_stretched_length_gt |
| 91 | (N : IntrinsicAnnulus) {delta r alpha R : ℝ} |
| 92 | (hdelta : 0 < delta) (hdeltaSmall : delta < 1 / 100) (hr : 0 < r) |
| 93 | (hfirst : r < intrinsicBoundaryLength N.metric 1 0 rampPeriod) |
| 94 | (hturn : N.SmallBoundaryTurning delta r) (halpha : 100 * delta / r ≤ alpha) |
| 95 | {E : Set ℝ} (hE : MeasurableSet E) (hEsub : E ⊆ Icc (0 : ℝ) rampPeriod) |
| 96 | {height : ℝ → ℝ} (hh : Measurable height) |
| 97 | (hfocus : (∫ s in E, intrinsicBoundarySpeed N.metric 1 s) < |
| 98 | 3 * intrinsicBoundaryLength N.metric 1 0 rampPeriod / 50) |
| 99 | (harea : m64IntrinsicLongFiberLength N |
| 100 | ((Ico (0 : ℝ) rampPeriod ∩ |
| 101 | {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha}) \ E) height R < |
| 102 | intrinsicBoundaryLength N.metric 1 0 rampPeriod / 10) : |
| 103 | (3 / 4 : ℝ) * intrinsicBoundaryLength N.metric 1 0 rampPeriod < |
| 104 | (1 - delta) * |
| 105 | ∫ s in ((Ico (0 : ℝ) rampPeriod ∩ |
| 106 | {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha}) \ E) ∩ |
| 107 | {s | height s < R}, intrinsicBoundarySpeed N.metric 1 s := by |
| 108 | have hcurvature := m64Intrinsic_high_curvature_length_lt N hdelta hr hfirst hturn halpha |
| 109 | have hremaining := m64Intrinsic_retained_short_base_length_lower N hE hEsub hh |
| 110 | (alpha := alpha) (R := R) |
| 111 | dsimp only at hremaining |
| 112 | let L := intrinsicBoundaryLength N.metric 1 0 rampPeriod |
| 113 | let Z := ((Ico (0 : ℝ) rampPeriod ∩ |
| 114 | {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha}) \ E) ∩ |
| 115 | {s | height s < R} |
| 116 | have hL : 0 < L := hr.trans hfirst |
| 117 | have hZ : (41 / 50 : ℝ) * L < ∫ s in Z, intrinsicBoundarySpeed N.metric 1 s := by |
| 118 | dsimp only [L, Z] |
| 119 | linarith |
| 120 | have hpositive : 0 < 1 - delta := by linarith |
| 121 | have hscale := mul_lt_mul_of_pos_left hZ hpositive |
| 122 | have hcoefficient : (3 / 4 : ℝ) < (1 - delta) * (41 / 50) := by linarith |
| 123 | have hscaled := mul_lt_mul_of_pos_right hcoefficient hL |
| 124 | change (3 / 4 : ℝ) * L < (1 - delta) * ∫ s in Z, intrinsicBoundarySpeed N.metric 1 s |
| 125 | nlinarith only [hscale, hscaled] |
| 126 | |
| 127 | end PoincareMT |