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.WeakStationarity |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.WeakVelocity |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.ChartRegularity |
| 5 | |
| 6 | /-! |
| 7 | # Continuous derivatives from local weak quadratic minimality |
| 8 | |
| 9 | The weak Euler step in Proposition 16.4, p. 369. Positive actual metric |
| 10 | coefficients invert the weak momentum. M08 then gives a continuous |
| 11 | velocity representative and a C1 primitive on the closed interval. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option synthInstance.maxSize 2048 |
| 17 | |
| 18 | open Set Filter MeasureTheory |
| 19 | open scoped ContDiff Topology intervalIntegral |
| 20 | |
| 21 | namespace PoincareMT.M08 |
| 22 | export PoincareMT.LGeometry (ChartL2) |
| 23 | end PoincareMT.M08 |
| 24 | namespace PoincareMT.M08 |
| 25 | export PoincareMT.LGeometry (positive_form_operator_isUnit) |
| 26 | end PoincareMT.M08 |
| 27 | namespace PoincareMT.M08 |
| 28 | export PoincareMT.LGeometry (continuousOn_inverse_operator) |
| 29 | end PoincareMT.M08 |
| 30 | namespace PoincareMT.M08 |
| 31 | export PoincareMT.LGeometry (chartForceVector) |
| 32 | end PoincareMT.M08 |
| 33 | namespace PoincareMT.M08 |
| 34 | export PoincareMT.LGeometry (chart_momentum_force_intervalIntegrable) |
| 35 | end PoincareMT.M08 |
| 36 | namespace PoincareMT.M08 |
| 37 | export PoincareMT.LGeometry (weak_momentum_of_chart_stationarity) |
| 38 | end PoincareMT.M08 |
| 39 | namespace PoincareMT.M08 |
| 40 | export PoincareMT.LGeometry (weak_velocity_regular) |
| 41 | end PoincareMT.M08 |
| 42 | namespace PoincareMT.M08 |
| 43 | export PoincareMT.LGeometry (inverse_operator_apply) |
| 44 | end PoincareMT.M08 |
| 45 | |
| 46 | namespace PoincareMT.Proofs.M46 |
| 47 | |
| 48 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 49 | [FiniteDimensional ℝ E] [CompleteSpace E] |
| 50 | |
| 51 | private noncomputable local instance : NormedAddCommGroup (E →L[ℝ] ℝ) := |
| 52 | ContinuousLinearMap.toNormedAddCommGroup |
| 53 | private noncomputable local instance : NormedSpace ℝ (E →L[ℝ] ℝ) := |
| 54 | ContinuousLinearMap.toNormedSpace |
| 55 | private noncomputable local instance : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := |
| 56 | ContinuousLinearMap.toNormedAddCommGroup |
| 57 | private noncomputable local instance : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := |
| 58 | ContinuousLinearMap.toNormedSpace |
| 59 | private noncomputable local instance : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) := |
| 60 | ContinuousLinearMap.toNormedAddCommGroup |
| 61 | private noncomputable local instance : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) := |
| 62 | ContinuousLinearMap.toNormedSpace |
| 63 | |
| 64 | /-- A continuous primitive minimizing all compact smooth affine |
| 65 | variations is C1 for positive continuous quadratic coefficients with |
| 66 | continuous spatial derivatives. Source: Proposition 16.4, p. 369. -/ |
| 67 | theorem weak_quadratic_minimum_contDiffOn {a b : ℝ} (hab : a < b) |
| 68 | {S : Set E} (hS : IsOpen S) |
| 69 | (B : ℝ × E → E →L[ℝ] E →L[ℝ] ℝ) (V : ℝ × E → ℝ) |
| 70 | (DB : ℝ × E → E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) |
| 71 | (DV : ℝ × E → E →L[ℝ] ℝ) |
| 72 | (hB : ContinuousOn B (Icc a b ×ˢ S)) (hV : ContinuousOn V (Icc a b ×ˢ S)) |
| 73 | (hDB : ContinuousOn DB (Icc a b ×ˢ S)) (hDV : ContinuousOn DV (Icc a b ×ˢ S)) |
| 74 | (hBd : ∀ z ∈ Icc a b ×ˢ S, HasFDerivAt (fun x => B (z.1, x)) (DB z) z.2) |
| 75 | (hVd : ∀ z ∈ Icc a b ×ˢ S, HasFDerivAt (fun x => V (z.1, x)) (DV z) z.2) |
| 76 | (hsym : ∀ z ∈ Icc a b ×ˢ S, ∀ v w : E, B z v w = B z w v) |
| 77 | (hpos : ∀ z ∈ Icc a b ×ˢ S, ∀ v : E, v ≠ 0 → 0 < B z v v) |
| 78 | (u : ℝ → E) (hu : ContinuousOn u (Icc a b)) (hmem : MapsTo u (Icc a b) S) |
| 79 | (w : M08.ChartL2 E a b) |
| 80 | (hprimitive : ∀ s ∈ Icc a b, u s = u a + ∫ r in a..s, w r) |
| 81 | (hmin : ∀ eta : ℝ → E, ContDiff ℝ ∞ eta → tsupport eta ⊆ Ioo a b → |
| 82 | IsLocalMin (fun e : ℝ => ∫ s in a..b, |
| 83 | B (s, u s + e • eta s) (w s + e • deriv eta s) (w s + e • deriv eta s) / 2 + |
| 84 | V (s, u s + e • eta s)) 0) : |
| 85 | ContDiffOn ℝ 1 u (Icc a b) := by |
| 86 | let graph (s : ℝ) := (s, u s) |
| 87 | have hgraph : ContinuousOn graph (Icc a b) := continuousOn_id.prodMk hu |
| 88 | have hgraphmem : MapsTo graph (Icc a b) (Icc a b ×ˢ S) := |
| 89 | fun _ hs => ⟨hs, hmem hs⟩ |
| 90 | let G := B ∘ graph |
| 91 | let DG := DB ∘ graph |
| 92 | let D := DV ∘ graph |
| 93 | have hG : ContinuousOn G (Icc a b) := hB.comp hgraph hgraphmem |
| 94 | have hDG : ContinuousOn DG (Icc a b) := hDB.comp hgraph hgraphmem |
| 95 | have hD : ContinuousOn D (Icc a b) := hDV.comp hgraph hgraphmem |
| 96 | obtain ⟨C, hC, hbound⟩ := compact_three_norm_bounds isCompact_Icc G DG D hG hDG hD |
| 97 | let A (s : ℝ) := InnerProductSpace.continuousLinearMapOfBilin (G s) |
| 98 | let inverse (s : ℝ) := Ring.inverse (A s) |
| 99 | have hA : ContinuousOn A (Icc a b) := continuousOn_const.clm_comp hG |
| 100 | have hunit (s : ℝ) (hs : s ∈ Icc a b) : IsUnit (A s) := |
| 101 | M08.positive_form_operator_isUnit _ (hpos (graph s) (hgraphmem hs)) |
| 102 | have hinverse : ContinuousOn inverse (Icc a b) := M08.continuousOn_inverse_operator A hA hunit |
| 103 | let Q (s : ℝ) := M08.chartForceVector (DG s) (D s) (w s) |
| 104 | obtain ⟨hP, hQ⟩ := M08.chart_momentum_force_intervalIntegrable hab.le hC w (Lp.memLp w) |
| 105 | G DG D hG hDG hD hbound |
| 106 | have hweak : ∀ phi : ℝ → ℝ, ContDiff ℝ ∞ phi → HasCompactSupport phi → |
| 107 | tsupport phi ⊆ Ioo a b → (∫ s in a..b, deriv phi s • A s (w s)) = |
| 108 | -(∫ s in a..b, phi s • Q s) := by |
| 109 | intro phi hphi _ hsupp |
| 110 | have hstationary (z : E) : |
| 111 | (∫ s in a..b, DG s (phi s • z) (w s) (w s) / 2 + |
| 112 | G s (w s) (deriv phi s • z) + D s (phi s • z)) = 0 := by |
| 113 | let eta (s : ℝ) := phi s • z |
| 114 | have heta : ContDiff ℝ ∞ eta := hphi.smul contDiff_const |
| 115 | have hetasupp : tsupport eta ⊆ Ioo a b := |
| 116 | (tsupport_smul_subset_left phi (fun _ : ℝ => z)).trans hsupp |
| 117 | have hetad : deriv eta = fun s => deriv phi s • z := by |
| 118 | ext s |
| 119 | exact deriv_smul_const ((hphi.differentiable (by simp)) s) z |
| 120 | have h := weak_quadratic_affine_stationary hab.le hS B V DB DV hB hV hDB hDV |
| 121 | hBd hVd hsym u w hu hmem (Lp.memLp w) eta (deriv eta) |
| 122 | heta.continuous.continuousOn (heta.continuous_deriv (by simp)).continuousOn |
| 123 | (hmin eta heta hetasupp) |
| 124 | simpa only [hetad, eta, G, DG, D, Function.comp_apply, graph] using h |
| 125 | exact (M08.weak_momentum_of_chart_stationarity hab.le hC w (Lp.memLp w) |
| 126 | G DG D hG hDG hD hbound phi hphi hstationary).2.2 |
| 127 | obtain ⟨_, _, _, _, _, _, _, _, hreg⟩ := M08.weak_velocity_regular hab u w hprimitive |
| 128 | A inverse hA hinverse (fun s hs v => M08.inverse_operator_apply _ (hunit s hs) v) |
| 129 | Q hQ hP hweak |
| 130 | exact hreg |
| 131 | |
| 132 | end PoincareMT.Proofs.M46 |