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.Local.ArcLossBounds |
| 2 | |
| 3 | /-! |
| 4 | # Actual retained short-fiber length on a local arc |
| 5 | |
| 6 | Integral partitions account for the three exceptional sets on an arbitrary |
| 7 | ordered parameter interval. The open base interval omits only its two |
| 8 | null endpoints. This is the local length bookkeeping of Morgan--Tian, |
| 9 | Lemma 19.46, Case (ii), pp. 475-477. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | /-- The actual local curvature, focusing and long-fiber sets account for |
| 20 | all missing length. Overlap between the focusing and curvature removals |
| 21 | only improves the bound; Lemma 19.46, pp. 475-477. -/ |
| 22 | theorem m64Intrinsic_local_retained_short_base_length_lower |
| 23 | (N : IntrinsicAnnulus) {l u : ℝ} (hlu : l ≤ u) {alpha R : ℝ} {E : Set ℝ} |
| 24 | (hE : MeasurableSet E) (hEsub : E ⊆ Icc l u) |
| 25 | {height : ℝ → ℝ} (hh : Measurable height) : |
| 26 | let X := Ioo l u ∩ {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha} |
| 27 | let S := X \ E |
| 28 | intrinsicBoundaryLength N.metric 1 l u - |
| 29 | m64IntrinsicLocalHighCurvatureLength N alpha l u - |
| 30 | (∫ s in E, intrinsicBoundarySpeed N.metric 1 s) - |
| 31 | m64IntrinsicLongFiberLength N S height R ≤ |
| 32 | ∫ s in S ∩ {s | height s < R}, intrinsicBoundarySpeed N.metric 1 s := by |
| 33 | let speed := intrinsicBoundarySpeed N.metric 1 |
| 34 | let B := Ioo l u |
| 35 | let Y := {s | alpha < intrinsicGeodesicCurvature N.metric N.connection 1 s} |
| 36 | let X := B ∩ {s | intrinsicGeodesicCurvature N.metric N.connection 1 s ≤ alpha} |
| 37 | let S := X \ E |
| 38 | have hspeed : Continuous speed := |
| 39 | (m64Intrinsic_contDiff_boundarySpeed N (by norm_num : (1 : ℝ) ≠ 0)).continuous |
| 40 | have hY : MeasurableSet Y := (isOpen_lt continuous_const |
| 41 | (m64Intrinsic_continuous_geodesicCurvature N (by norm_num : (1 : ℝ) ≠ 0))).measurableSet |
| 42 | have hXB : X ⊆ B := inter_subset_left |
| 43 | have hBI : B ⊆ Icc l u := Ioo_subset_Icc_self |
| 44 | have hXeq : B \ Y = X := by |
| 45 | ext s |
| 46 | simp only [Y, X, Set.mem_sdiff, mem_inter_iff, mem_ofPred_eq, not_lt] |
| 47 | have hhigh : (∫ s in B ∩ Y, speed s) = |
| 48 | m64IntrinsicLocalHighCurvatureLength N alpha l u := rfl |
| 49 | have hfull : (∫ s in B, speed s) = intrinsicBoundaryLength N.metric 1 l u := by |
| 50 | change (∫ s in Ioo l u, speed s) = ∫ s in l..u, speed s |
| 51 | rw [intervalIntegral.integral_of_le hlu, integral_Ioc_eq_integral_Ioo] |
| 52 | have hsplitX := integral_inter_add_sdiff (μ := volume) (s := B) hY |
| 53 | (hspeed.integrableOn_Icc.mono_set hBI) |
| 54 | rw [hXeq, hhigh, hfull] at hsplitX |
| 55 | have hsplitS := integral_inter_add_sdiff (μ := volume) (s := X) hE |
| 56 | (hspeed.integrableOn_Icc.mono_set (hXB.trans hBI)) |
| 57 | have hremove : (∫ s in X ∩ E, speed s) ≤ ∫ s in E, speed s := by |
| 58 | apply setIntegral_mono_set (hspeed.integrableOn_Icc.mono_set hEsub) |
| 59 | (Eventually.of_forall (fun _ => Real.sqrt_nonneg _)) |
| 60 | exact Eventually.of_forall (fun _ hs => hs.2) |
| 61 | have hlong : MeasurableSet {s | R ≤ height s} := measurableSet_le measurable_const hh |
| 62 | have hsplitZ := integral_inter_add_sdiff (μ := volume) (s := S) hlong |
| 63 | (hspeed.integrableOn_Icc.mono_set (sdiff_subset.trans (hXB.trans hBI))) |
| 64 | have hZeq : S \ {s | R ≤ height s} = S ∩ {s | height s < R} := by |
| 65 | ext s |
| 66 | simp only [Set.mem_sdiff, mem_inter_iff, mem_ofPred_eq, not_le] |
| 67 | change (∫ s in S ∩ {s | R ≤ height s}, speed s) + |
| 68 | (∫ s in S \ {s | R ≤ height s}, speed s) = ∫ s in S, speed s at hsplitZ |
| 69 | rw [hZeq] at hsplitZ |
| 70 | change m64IntrinsicLongFiberLength N S height R + |
| 71 | (∫ s in S ∩ {s | height s < R}, speed s) = ∫ s in S, speed s at hsplitZ |
| 72 | change intrinsicBoundaryLength N.metric 1 l u - |
| 73 | m64IntrinsicLocalHighCurvatureLength N alpha l u - (∫ s in E, speed s) - |
| 74 | m64IntrinsicLongFiberLength N S height R ≤ ∫ s in S ∩ {s | height s < R}, speed s |
| 75 | linarith |
| 76 | |
| 77 | end PoincareMT |