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.FiniteEnergyBlend |
| 3 | |
| 4 | /-! |
| 5 | # Integrated energy of a one-sided transition |
| 6 | |
| 7 | The actual derivative of the spatial blend has integrable squared |
| 8 | norm, bounded by a fixed multiple of the two original tail energies. |
| 9 | This is the endpoint approximation estimate in Morgan-Tian |
| 10 | Proposition 6.30, pp. 118-119, without an endpoint derivative assumption. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Topology intervalIntegral |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | open Proofs.M09 |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 23 | |
| 24 | /-- The actual blend energy on [b-2d,b-d] is integrable and bounded |
| 25 | by the original energies on [b-2d,b], with a constant independent of |
| 26 | the width d. This supplies the shrinking-corner estimate for |
| 27 | Proposition 6.30, pp. 118-119. -/ |
| 28 | theorem oneSidedBlend_energy_le {f g : ℝ → E} {b d K : ℝ} |
| 29 | (hd : 0 < d) (hK : 0 ≤ K) |
| 30 | (hKb : ∀ r ∈ Icc (-1 : ℝ) 1, ‖deriv smoothJoinCutoff r‖ ≤ K) |
| 31 | (hf : ContinuousOn f (Icc (b - 2 * d) b)) |
| 32 | (hg : ContinuousOn g (Icc (b - 2 * d) b)) |
| 33 | (hdf : DifferentiableOn ℝ f (Ioo (b - 2 * d) b)) |
| 34 | (hdg : DifferentiableOn ℝ g (Ioo (b - 2 * d) b)) |
| 35 | (hEf : MemLp (deriv f) 2 (volume.restrict (Icc (b - 2 * d) b))) |
| 36 | (hEg : MemLp (deriv g) 2 (volume.restrict (Icc (b - 2 * d) b))) |
| 37 | (heq : f b = g b) : |
| 38 | IntervalIntegrable |
| 39 | (fun s => ‖deriv (smoothJoinBlend f g (b - 3 * d / 2) (d / 2)) s‖ ^ 2) |
| 40 | volume (b - 2 * d) (b - d) ∧ |
| 41 | (∫ s in (b - 2 * d)..(b - d), |
| 42 | ‖deriv (smoothJoinBlend f g (b - 3 * d / 2) (d / 2)) s‖ ^ 2) ≤ |
| 43 | (12 + 48 * K ^ 2) * |
| 44 | ((∫ s in (b - 2 * d)..b, ‖deriv f s‖ ^ 2) + |
| 45 | ∫ s in (b - 2 * d)..b, ‖deriv g s‖ ^ 2) := by |
| 46 | let e := (∫ s in (b - 2 * d)..b, ‖deriv f s‖ ^ 2) + |
| 47 | ∫ s in (b - 2 * d)..b, ‖deriv g s‖ ^ 2 |
| 48 | let H := fun s => 12 * (‖deriv f s‖ ^ 2 + ‖deriv g s‖ ^ 2) + (48 * K ^ 2 / d) * e |
| 49 | let B := fun s => ‖deriv (smoothJoinBlend f g (b - 3 * d / 2) (d / 2)) s‖ ^ 2 |
| 50 | have hab : b - 2 * d ≤ b := by linarith |
| 51 | have hlr : b - 2 * d ≤ b - d := by linarith |
| 52 | have hright : b - d ≤ b := by linarith |
| 53 | have hIf : IntervalIntegrable (fun s => ‖deriv f s‖ ^ 2) volume (b - 2 * d) b := |
| 54 | (intervalIntegrable_iff_integrableOn_Icc_of_le hab).mpr |
| 55 | ((memLp_two_iff_integrable_sq_norm hEf.aestronglyMeasurable).mp hEf) |
| 56 | have hIg : IntervalIntegrable (fun s => ‖deriv g s‖ ^ 2) volume (b - 2 * d) b := |
| 57 | (intervalIntegrable_iff_integrableOn_Icc_of_le hab).mpr |
| 58 | ((memLp_two_iff_integrable_sq_norm hEg.aestronglyMeasurable).mp hEg) |
| 59 | have hsub : uIcc (b - 2 * d) (b - d) ⊆ uIcc (b - 2 * d) b := by |
| 60 | rw [uIcc_of_le hlr, uIcc_of_le hab] |
| 61 | exact Icc_subset_Icc_right hright |
| 62 | have hif := hIf.mono_set hsub |
| 63 | have hig := hIg.mono_set hsub |
| 64 | have hH : IntervalIntegrable H volume (b - 2 * d) (b - d) := |
| 65 | ((hif.add hig).const_mul 12).add intervalIntegrable_const |
| 66 | have hpoint (s : ℝ) (hs : s ∈ Ioo (b - 2 * d) (b - d)) : B s ≤ H s := |
| 67 | oneSidedBlend_deriv_sq_le hd hK hKb hf hg hdf hdg hEf hEg heq hs |
| 68 | have hB : IntervalIntegrable B volume (b - 2 * d) (b - d) := by |
| 69 | apply hH.mono_fun' ((aestronglyMeasurable_deriv _ _).norm.pow 2) |
| 70 | rw [uIoc_of_le hlr, ← Measure.restrict_congr_set Ioo_ae_eq_Ioc] |
| 71 | filter_upwards [ae_restrict_mem measurableSet_Ioo] with s hs |
| 72 | change |B s| ≤ H s |
| 73 | rw [abs_of_nonneg (sq_nonneg _)] |
| 74 | exact hpoint s hs |
| 75 | have hbound := intervalIntegral.integral_mono_on_of_le_Ioo hlr hB hH hpoint |
| 76 | have hformula : (∫ s in (b - 2 * d)..(b - d), H s) = |
| 77 | 12 * ((∫ s in (b - 2 * d)..(b - d), ‖deriv f s‖ ^ 2) + |
| 78 | ∫ s in (b - 2 * d)..(b - d), ‖deriv g s‖ ^ 2) + 48 * K ^ 2 * e := by |
| 79 | dsimp only [H] |
| 80 | rw [intervalIntegral.integral_add ((hif.add hig).const_mul 12) intervalIntegrable_const, |
| 81 | intervalIntegral.integral_const_mul, intervalIntegral.integral_add hif hig, |
| 82 | intervalIntegral.integral_const, smul_eq_mul] |
| 83 | congr 1 |
| 84 | field_simp [hd.ne'] |
| 85 | ring |
| 86 | have hfle := intervalIntegral.integral_mono_interval le_rfl hlr hright |
| 87 | (ae_of_all _ (fun s => sq_nonneg ‖deriv f s‖)) hIf |
| 88 | have hgle := intervalIntegral.integral_mono_interval le_rfl hlr hright |
| 89 | (ae_of_all _ (fun s => sq_nonneg ‖deriv g s‖)) hIg |
| 90 | refine ⟨hB, hbound.trans ?_⟩ |
| 91 | rw [hformula] |
| 92 | change _ ≤ (12 + 48 * K ^ 2) * e |
| 93 | dsimp only [e] |
| 94 | nlinarith |
| 95 | |
| 96 | end PoincareMT.M14 |