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 Mathlib.MeasureTheory.Integral.IntervalIntegral.DistLEIntegral |
| 2 | import Mathlib.MeasureTheory.Function.L2Space |
| 3 | import Mathlib.MeasureTheory.Integral.DominatedConvergence |
| 4 | |
| 5 | /-! |
| 6 | # Endpoint displacement of finite-energy curves |
| 7 | |
| 8 | The endpoint approximation used in Morgan-Tian Proposition 6.30, |
| 9 | pp. 118-119. The displacement estimate uses only interior derivatives, |
| 10 | closed continuity and finite L2 energy. In particular, no derivative |
| 11 | at the joining endpoint is prescribed. See the strict-prefix derivation |
| 12 | in proof-work/tasks/M14/derivations/2026-09-21-strict-prefix.md. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped Topology intervalIntegral |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | |
| 24 | omit [NormedSpace ℝ E] in |
| 25 | /-- The integral of speed is bounded by the square root of energy times |
| 26 | the square root of interval length, the local estimate in the endpoint |
| 27 | approximation for Proposition 6.30, pp. 118-119. -/ |
| 28 | theorem integral_norm_le_sqrt_energy {d : ℝ → E} {a b : ℝ} (hab : a ≤ b) |
| 29 | (hd : MemLp d 2 (volume.restrict (Icc a b))) : |
| 30 | (∫ s in a..b, ‖d s‖) ≤ |
| 31 | Real.sqrt (∫ s in a..b, ‖d s‖ ^ 2) * Real.sqrt (b - a) := by |
| 32 | have h := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two |
| 33 | (ae_of_all _ (fun s => norm_nonneg (d s))) |
| 34 | (ae_of_all _ (fun _ => (zero_le_one : (0 : ℝ) ≤ 1))) |
| 35 | (by simpa using hd.norm) (memLp_const (1 : ℝ)) |
| 36 | simpa only [mul_one, Real.rpow_two, one_pow, ← Real.sqrt_eq_rpow, |
| 37 | setIntegral_const, smul_eq_mul, mul_one, Real.volume_real_Icc_of_le hab, |
| 38 | integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le hab] using h |
| 39 | |
| 40 | /-- A curve with finite interior L2 velocity has the sharp squared |
| 41 | endpoint displacement bound, including endpoints without derivatives, |
| 42 | as required for the corner approximation in Proposition 6.30, p. 118. -/ |
| 43 | theorem norm_sub_sq_le_interval_energy {f : ℝ → E} {a b : ℝ} (hab : a ≤ b) |
| 44 | (hf : ContinuousOn f (Icc a b)) (hdf : DifferentiableOn ℝ f (Ioo a b)) |
| 45 | (hd : MemLp (deriv f) 2 (volume.restrict (Icc a b))) : |
| 46 | ‖f b - f a‖ ^ 2 ≤ (b - a) * ∫ s in a..b, ‖deriv f s‖ ^ 2 := by |
| 47 | have hi : IntervalIntegrable (fun s => ‖deriv f s‖) volume a b := |
| 48 | (intervalIntegrable_iff_integrableOn_Icc_of_le hab).mpr |
| 49 | (hd.norm.integrable (by norm_num)) |
| 50 | have hdisp := norm_sub_le_integral_of_norm_deriv_le_of_le hab hf hdf |
| 51 | (ae_of_all _ (fun _ _ => le_rfl)) hi |
| 52 | have hbound := hdisp.trans (integral_norm_le_sqrt_energy hab hd) |
| 53 | have henergy : 0 ≤ ∫ s in a..b, ‖deriv f s‖ ^ 2 := |
| 54 | intervalIntegral.integral_nonneg hab (fun _ _ => sq_nonneg _) |
| 55 | have hsq := sq_le_sq₀ (norm_nonneg (f b - f a)) (by positivity) |>.mpr hbound |
| 56 | rw [mul_pow, Real.sq_sqrt henergy, Real.sq_sqrt (sub_nonneg.mpr hab), mul_comm] at hsq |
| 57 | exact hsq |
| 58 | |
| 59 | /-- Every endpoint increment is controlled by the energy on a containing |
| 60 | interval, the uniform local estimate for Proposition 6.30, p. 118. -/ |
| 61 | theorem norm_sub_sq_le_total_interval_energy {f : ℝ → E} {a b s : ℝ} |
| 62 | (hf : ContinuousOn f (Icc a b)) (hdf : DifferentiableOn ℝ f (Ioo a b)) |
| 63 | (hd : MemLp (deriv f) 2 (volume.restrict (Icc a b))) (hs : s ∈ Icc a b) : |
| 64 | ‖f b - f s‖ ^ 2 ≤ (b - s) * ∫ t in a..b, ‖deriv f t‖ ^ 2 := by |
| 65 | have hsub : Icc s b ⊆ Icc a b := Icc_subset_Icc hs.1 le_rfl |
| 66 | have hder := hd.mono_measure (Measure.restrict_mono hsub le_rfl) |
| 67 | have h := norm_sub_sq_le_interval_energy hs.2 (hf.mono hsub) |
| 68 | (hdf.mono (Ioo_subset_Ioo hs.1 le_rfl)) hder |
| 69 | have he : IntervalIntegrable (fun t => ‖deriv f t‖ ^ 2) volume a b := |
| 70 | (intervalIntegrable_iff_integrableOn_Icc_of_le (hs.1.trans hs.2)).mpr |
| 71 | ((memLp_two_iff_integrable_sq_norm hd.aestronglyMeasurable).mp hd) |
| 72 | exact h.trans (mul_le_mul_of_nonneg_left |
| 73 | (intervalIntegral.integral_mono_interval hs.1 hs.2 le_rfl |
| 74 | (ae_of_all _ (fun _ => sq_nonneg _)) he) (sub_nonneg.mpr hs.2)) |
| 75 | |
| 76 | /-- At a finite-energy endpoint, squared displacement divided by the |
| 77 | remaining time tends to zero. This is the error term produced by a |
| 78 | shrinking spatial cutoff in Proposition 6.30, pp. 118-119. -/ |
| 79 | theorem tendsto_endpoint_displacement_quotient {f : ℝ → E} {a b : ℝ} (hab : a ≤ b) |
| 80 | (hf : ContinuousOn f (Icc a b)) (hdf : DifferentiableOn ℝ f (Ioo a b)) |
| 81 | (hd : MemLp (deriv f) 2 (volume.restrict (Icc a b))) : |
| 82 | Tendsto (fun t => ‖f b - f t‖ ^ 2 / (b - t)) (𝓝[Icc a b] b) (𝓝 0) := by |
| 83 | have he : IntegrableOn (fun s => ‖deriv f s‖ ^ 2) (Icc a b) := |
| 84 | (memLp_two_iff_integrable_sq_norm hd.aestronglyMeasurable).mp hd |
| 85 | have he' : IntegrableOn (fun s => ‖deriv f s‖ ^ 2) (uIcc a b) := by |
| 86 | simpa only [uIcc_of_le hab] using he |
| 87 | have hc := intervalIntegral.continuousOn_primitive_interval_left he' |
| 88 | rw [uIcc_of_le hab] at hc |
| 89 | have hlim : Tendsto (fun t => ∫ s in t..b, ‖deriv f s‖ ^ 2) |
| 90 | (𝓝[Icc a b] b) (𝓝 0) := by |
| 91 | simpa only [ContinuousWithinAt, intervalIntegral.integral_same] using hc b ⟨hab, le_rfl⟩ |
| 92 | apply squeeze_zero' ?_ ?_ hlim |
| 93 | · filter_upwards [self_mem_nhdsWithin] with t ht |
| 94 | exact div_nonneg (sq_nonneg _) (sub_nonneg.mpr ht.2) |
| 95 | · filter_upwards [self_mem_nhdsWithin] with t ht |
| 96 | rcases ht.2.eq_or_lt with htb | htb |
| 97 | · subst t |
| 98 | simp |
| 99 | · have hsub : Icc t b ⊆ Icc a b := Icc_subset_Icc ht.1 le_rfl |
| 100 | have hder : MemLp (deriv f) 2 (volume.restrict (Icc t b)) := |
| 101 | hd.mono_measure (Measure.restrict_mono hsub le_rfl) |
| 102 | have h := norm_sub_sq_le_interval_energy htb.le (hf.mono hsub) |
| 103 | (hdf.mono (Ioo_subset_Ioo ht.1 le_rfl)) hder |
| 104 | exact (div_le_iff₀ (sub_pos.mpr htb)).mpr (by simpa only [mul_comm] using h) |
| 105 | |
| 106 | end PoincareMT.M14 |