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.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.Attainment.Minimum.WeakRegularity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Energy.QuadraticMinimizerRegularity |
| 4 | |
| 5 | /-! |
| 6 | # Smoothness of the weak quadratic minimum |
| 7 | |
| 8 | Proposition 16.4 and Lemma 6.8, pp. 369, 108-109. The weak primitive's |
| 9 | velocity agrees almost everywhere with its now continuous derivative. |
| 10 | The same variations therefore satisfy M14's smooth Euler bootstrap. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | set_option synthInstance.maxSize 2048 |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped ContDiff Topology intervalIntegral |
| 19 | |
| 20 | namespace PoincareMT.M08 |
| 21 | export PoincareMT.LGeometry (ChartL2) |
| 22 | end PoincareMT.M08 |
| 23 | namespace PoincareMT.M08 |
| 24 | export PoincareMT.LGeometry (chart_primitive_ae_hasDerivAt) |
| 25 | end PoincareMT.M08 |
| 26 | namespace PoincareMT.M08 |
| 27 | export PoincareMT.LGeometry (exists_uniform_affine_tube) |
| 28 | end PoincareMT.M08 |
| 29 | |
| 30 | namespace PoincareMT.Proofs.M46 |
| 31 | |
| 32 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 33 | [FiniteDimensional ℝ E] [CompleteSpace E] |
| 34 | |
| 35 | private noncomputable local instance : NormedAddCommGroup (E →L[ℝ] ℝ) := |
| 36 | ContinuousLinearMap.toNormedAddCommGroup |
| 37 | private noncomputable local instance : NormedSpace ℝ (E →L[ℝ] ℝ) := |
| 38 | ContinuousLinearMap.toNormedSpace |
| 39 | private noncomputable local instance : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := |
| 40 | ContinuousLinearMap.toNormedAddCommGroup |
| 41 | private noncomputable local instance : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := |
| 42 | ContinuousLinearMap.toNormedSpace |
| 43 | private noncomputable local instance : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) := |
| 44 | ContinuousLinearMap.toNormedAddCommGroup |
| 45 | private noncomputable local instance : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) := |
| 46 | ContinuousLinearMap.toNormedSpace |
| 47 | |
| 48 | /-- Smooth positive quadratic coefficients regularize the actual |
| 49 | weak minimum on the closed interval. Source: Proposition 16.4 and |
| 50 | the square-time Euler argument of Lemma 6.8, pp. 369, 108-109. -/ |
| 51 | theorem weak_quadratic_minimum_smooth {a b : ℝ} (hab : a < b) |
| 52 | {S : Set E} (hS : IsOpen S) |
| 53 | (B : ℝ × E → E →L[ℝ] E →L[ℝ] ℝ) (V : ℝ × E → ℝ) |
| 54 | (DB : ℝ × E → E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) |
| 55 | (DV : ℝ × E → E →L[ℝ] ℝ) |
| 56 | (hB : ContDiffOn ℝ ∞ B (Icc a b ×ˢ S)) (hV : ContinuousOn V (Icc a b ×ˢ S)) |
| 57 | (hDB : ContDiffOn ℝ ∞ DB (Icc a b ×ˢ S)) (hDV : ContDiffOn ℝ ∞ DV (Icc a b ×ˢ S)) |
| 58 | (hBd : ∀ z ∈ Icc a b ×ˢ S, HasFDerivAt (fun x => B (z.1, x)) (DB z) z.2) |
| 59 | (hVd : ∀ z ∈ Icc a b ×ˢ S, HasFDerivAt (fun x => V (z.1, x)) (DV z) z.2) |
| 60 | (hsym : ∀ z ∈ Icc a b ×ˢ S, ∀ v w : E, B z v w = B z w v) |
| 61 | (hpos : ∀ z ∈ Icc a b ×ˢ S, ∀ v : E, v ≠ 0 → 0 < B z v v) |
| 62 | (u : ℝ → E) (hu : ContinuousOn u (Icc a b)) (hmem : MapsTo u (Icc a b) S) |
| 63 | (w : M08.ChartL2 E a b) |
| 64 | (hprimitive : ∀ s ∈ Icc a b, u s = u a + ∫ r in a..s, w r) |
| 65 | (hmin : ∀ eta : ℝ → E, ContDiff ℝ ∞ eta → tsupport eta ⊆ Ioo a b → |
| 66 | IsLocalMin (fun e : ℝ => ∫ s in a..b, |
| 67 | B (s, u s + e • eta s) (w s + e • deriv eta s) (w s + e • deriv eta s) / 2 + |
| 68 | V (s, u s + e • eta s)) 0) : |
| 69 | ContDiffOn ℝ ∞ u (Icc a b) := by |
| 70 | have hreg := weak_quadratic_minimum_contDiffOn hab hS B V DB DV hB.continuousOn hV |
| 71 | hDB.continuousOn hDV.continuousOn hBd hVd hsym hpos u hu hmem w hprimitive hmin |
| 72 | have hvelocity : (w : ℝ → E) =ᵐ[volume.restrict (Icc a b)] derivWithin u (Icc a b) := by |
| 73 | filter_upwards [M08.chart_primitive_ae_hasDerivAt hab.le u w hprimitive, |
| 74 | ae_restrict_mem measurableSet_Icc] with s hs hmems |
| 75 | exact (hs.hasDerivWithinAt.derivWithin (uniqueDiffOn_Icc hab s hmems)).symm |
| 76 | apply (ODE.contDiffOn_of_quadratic_local_minima hab B V DB DV hB hV hDB hDV |
| 77 | hBd hVd hsym hpos u hreg hmem ?_).1 |
| 78 | intro eta heta hsupp |
| 79 | obtain ⟨K, _, huK, hKS⟩ := exists_compact_between |
| 80 | (isCompact_Icc.image_of_continuousOn hu) hS hmem.image_subset |
| 81 | obtain ⟨delta, hdelta, _, hshift⟩ := |
| 82 | M08.exists_uniform_affine_tube u eta hu heta.continuous.continuousOn huK |
| 83 | refine ⟨delta, hdelta, fun s hs e he => hKS (hshift e (abs_lt.mpr he) hs), ?_⟩ |
| 84 | have heq (e : ℝ) : |
| 85 | (∫ s in a..b, B (s, u s + e • eta s) |
| 86 | (derivWithin u (Icc a b) s + e • deriv eta s) |
| 87 | (derivWithin u (Icc a b) s + e • deriv eta s) / 2 + V (s, u s + e • eta s)) = |
| 88 | ∫ s in a..b, B (s, u s + e • eta s) |
| 89 | (w s + e • deriv eta s) (w s + e • deriv eta s) / 2 + V (s, u s + e • eta s) := by |
| 90 | apply intervalIntegral.integral_congr_ae_restrict |
| 91 | rw [uIoc_of_le hab.le] |
| 92 | filter_upwards [ae_mono (Measure.restrict_mono Ioc_subset_Icc_self le_rfl) hvelocity] with s hs |
| 93 | rw [hs] |
| 94 | simpa only [heq] using hmin eta heta hsupp |
| 95 | |
| 96 | end PoincareMT.Proofs.M46 |