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.ReducedLength |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Energy.BlendEnergyIntegral |
| 3 | |
| 4 | /-! |
| 5 | # Vanishing energy of a shrinking endpoint transition |
| 6 | |
| 7 | The local energy estimate and continuity of the actual integral show |
| 8 | that the transition's energy tends to zero. This is the finite-energy |
| 9 | approximation step for Morgan-Tian Proposition 6.30, pp. 118-119. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter MeasureTheory |
| 15 | open scoped Topology intervalIntegral |
| 16 | |
| 17 | namespace PoincareMT.M14 |
| 18 | |
| 19 | open Proofs.M09 |
| 20 | |
| 21 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | |
| 23 | /-- An integrable function has vanishing integral on a left endpoint |
| 24 | interval whose width tends to zero, the tail control in the corner |
| 25 | approximation for Proposition 6.30, pp. 118-119. -/ |
| 26 | theorem tendsto_integral_shrinking_left {F : ℝ → E} {a b : ℝ} (hab : a < b) |
| 27 | (hF : IntervalIntegrable F volume a b) : |
| 28 | Tendsto (fun d => ∫ s in (b - 2 * d)..b, F s) (𝓝[>] (0 : ℝ)) (𝓝 0) := by |
| 29 | have hi : IntegrableOn F (uIcc a b) := by |
| 30 | rw [uIcc_of_le hab.le] |
| 31 | exact (intervalIntegrable_iff_integrableOn_Icc_of_le hab.le).mp hF |
| 32 | have hcont := intervalIntegral.continuousOn_primitive_interval_left hi |
| 33 | rw [uIcc_of_le hab.le] at hcont |
| 34 | have hmap : Tendsto (fun d : ℝ => b - 2 * d) (𝓝[>] 0) (𝓝[Icc a b] b) := by |
| 35 | apply tendsto_nhdsWithin_iff.mpr |
| 36 | refine ⟨?_, ?_⟩ |
| 37 | · have h : Continuous (fun d : ℝ => b - 2 * d) := |
| 38 | continuous_const.sub (continuous_const.mul continuous_id) |
| 39 | simpa only [mul_zero, sub_zero] using |
| 40 | (h.continuousAt (x := 0)).tendsto.mono_left |
| 41 | (show 𝓝[>] (0 : ℝ) ≤ 𝓝 0 from nhdsWithin_le_nhds) |
| 42 | · filter_upwards [Ioo_mem_nhdsGT (by linarith : 0 < (b - a) / 2)] with d hd |
| 43 | exact ⟨by linarith [hd.2], by linarith [hd.1]⟩ |
| 44 | have hlim : Tendsto (fun t => ∫ s in t..b, F s) (𝓝[Icc a b] b) (𝓝 0) := by |
| 45 | simpa only [ContinuousWithinAt, intervalIntegral.integral_same] using hcont b ⟨hab.le, le_rfl⟩ |
| 46 | exact hlim.comp hmap |
| 47 | |
| 48 | variable [CompleteSpace E] |
| 49 | |
| 50 | /-- The actual squared-speed integral of a one-sided blend tends to |
| 51 | zero at a common finite-energy endpoint. No bounded endpoint velocity |
| 52 | or pointwise convergence of endpoint derivatives is assumed in this |
| 53 | approximation for Proposition 6.30, pp. 118-119. -/ |
| 54 | theorem tendsto_oneSidedBlend_energy_zero {f g : ℝ → E} {a b : ℝ} (hab : a < b) |
| 55 | (hf : ContinuousOn f (Icc a b)) (hg : ContinuousOn g (Icc a b)) |
| 56 | (hdf : DifferentiableOn ℝ f (Ioo a b)) (hdg : DifferentiableOn ℝ g (Ioo a b)) |
| 57 | (hEf : MemLp (deriv f) 2 (volume.restrict (Icc a b))) |
| 58 | (hEg : MemLp (deriv g) 2 (volume.restrict (Icc a b))) |
| 59 | (heq : f b = g b) : |
| 60 | Tendsto (fun d => ∫ s in (b - 2 * d)..(b - d), |
| 61 | ‖deriv (smoothJoinBlend f g (b - 3 * d / 2) (d / 2)) s‖ ^ 2) |
| 62 | (𝓝[>] (0 : ℝ)) (𝓝 0) := by |
| 63 | have hIf : IntervalIntegrable (fun s => ‖deriv f s‖ ^ 2) volume a b := |
| 64 | (intervalIntegrable_iff_integrableOn_Icc_of_le hab.le).mpr |
| 65 | ((memLp_two_iff_integrable_sq_norm hEf.aestronglyMeasurable).mp hEf) |
| 66 | have hIg : IntervalIntegrable (fun s => ‖deriv g s‖ ^ 2) volume a b := |
| 67 | (intervalIntegrable_iff_integrableOn_Icc_of_le hab.le).mpr |
| 68 | ((memLp_two_iff_integrable_sq_norm hEg.aestronglyMeasurable).mp hEg) |
| 69 | obtain ⟨K, hK, hKb⟩ := exists_smoothJoinCutoff_deriv_bound |
| 70 | have hbound : Tendsto (fun d => (12 + 48 * K ^ 2) * |
| 71 | ((∫ s in (b - 2 * d)..b, ‖deriv f s‖ ^ 2) + |
| 72 | ∫ s in (b - 2 * d)..b, ‖deriv g s‖ ^ 2)) (𝓝[>] (0 : ℝ)) (𝓝 0) := by |
| 73 | simpa only [add_zero, mul_zero] using |
| 74 | ((tendsto_integral_shrinking_left hab hIf).add |
| 75 | (tendsto_integral_shrinking_left hab hIg)).const_mul (12 + 48 * K ^ 2) |
| 76 | apply squeeze_zero' ?_ ?_ hbound |
| 77 | · filter_upwards [self_mem_nhdsWithin] with d hd |
| 78 | exact intervalIntegral.integral_nonneg (by change 0 < d at hd; linarith) |
| 79 | (fun _ _ => sq_nonneg _) |
| 80 | · filter_upwards [Ioo_mem_nhdsGT (by linarith : 0 < (b - a) / 2)] with d hd |
| 81 | have hleft : a ≤ b - 2 * d := by linarith [hd.2] |
| 82 | have hsub : Icc (b - 2 * d) b ⊆ Icc a b := Icc_subset_Icc hleft le_rfl |
| 83 | exact (oneSidedBlend_energy_le hd.1 hK hKb (hf.mono hsub) (hg.mono hsub) |
| 84 | (hdf.mono (Ioo_subset_Ioo hleft le_rfl)) (hdg.mono (Ioo_subset_Ioo hleft le_rfl)) |
| 85 | (hEf.mono_measure (Measure.restrict_mono hsub le_rfl)) |
| 86 | (hEg.mono_measure (Measure.restrict_mono hsub le_rfl)) heq).2 |
| 87 | |
| 88 | end PoincareMT.M14 |