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.Generalized.ReducedGeometry.Calculus.Local.ContinuousParameterIntegral |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.ChartStationarity |
| 4 | |
| 5 | /-! |
| 6 | # Actual quadratic first variation with continuous velocities |
| 7 | |
| 8 | Morgan-Tian Lemma 6.4, pp. 107-108. M08's pointwise quadratic |
| 9 | derivative and a compact rectangle integral bound prove the first |
| 10 | variation before the velocity has been bootstrapped to smoothness. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- The spatial metric derivative has three nested continuous-linear-map codomains. |
| 15 | set_option synthInstance.maxSize 2048 |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped ContDiff Topology intervalIntegral |
| 19 | |
| 20 | namespace intervalIntegral |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | |
| 24 | private noncomputable local instance dualNormedGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := |
| 25 | ContinuousLinearMap.toNormedAddCommGroup |
| 26 | |
| 27 | private noncomputable local instance dualNormedSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := |
| 28 | ContinuousLinearMap.toNormedSpace |
| 29 | |
| 30 | private noncomputable local instance bilinearNormedGroup : |
| 31 | NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup |
| 32 | |
| 33 | private noncomputable local instance bilinearNormedSpace : |
| 34 | NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace |
| 35 | |
| 36 | private noncomputable local instance trilinearNormedGroup : |
| 37 | NormedAddCommGroup (E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup |
| 38 | |
| 39 | /-- Continuous coordinate and velocity curves admit the expected |
| 40 | quadratic action derivative under a common admissible parameter radius, |
| 41 | the local analytic calculation of Lemma 6.4, pp. 107-108. -/ |
| 42 | theorem hasDerivAt_quadratic_variation {a b : ℝ} (hab : a ≤ b) |
| 43 | {Ω : Set (ℝ × E)} {P : Set ℝ} (hP : IsOpen P) (hzero : (0 : ℝ) ∈ P) |
| 44 | (B : ℝ × E → E →L[ℝ] E →L[ℝ] ℝ) (V : ℝ × E → ℝ) |
| 45 | (DB : ℝ × E → E →L[ℝ] E →L[ℝ] E →L[ℝ] ℝ) |
| 46 | (DV : ℝ × E → E →L[ℝ] ℝ) |
| 47 | (hB : ContinuousOn B Ω) (hV : ContinuousOn V Ω) |
| 48 | (hDB : ContinuousOn DB Ω) (hDV : ContinuousOn DV Ω) |
| 49 | (hBd : ∀ z ∈ Ω, HasFDerivAt (fun x => B (z.1, x)) (DB z) z.2) |
| 50 | (hVd : ∀ z ∈ Ω, HasFDerivAt (fun x => V (z.1, x)) (DV z) z.2) |
| 51 | (hsym : ∀ z ∈ Ω, ∀ v w : E, B z v w = B z w v) |
| 52 | (u w η ν : ℝ → E) (hu : ContinuousOn u (Icc a b)) (hw : ContinuousOn w (Icc a b)) |
| 53 | (hη : ContinuousOn η (Icc a b)) (hν : ContinuousOn ν (Icc a b)) |
| 54 | (hmem : ∀ s ∈ Icc a b, ∀ v ∈ P, (s, u s + v • η s) ∈ Ω) : |
| 55 | IntervalIntegrable (fun s => DB (s, u s) (η s) (w s) (w s) / 2 + |
| 56 | B (s, u s) (w s) (ν s) + DV (s, u s) (η s)) volume a b ∧ |
| 57 | HasDerivAt (fun v : ℝ => ∫ s in a..b, |
| 58 | B (s, u s + v • η s) (w s + v • ν s) (w s + v • ν s) / 2 + |
| 59 | V (s, u s + v • η s)) |
| 60 | (∫ s in a..b, DB (s, u s) (η s) (w s) (w s) / 2 + |
| 61 | B (s, u s) (w s) (ν s) + DV (s, u s) (η s)) 0 := by |
| 62 | let C := Icc a b ×ˢ P |
| 63 | let Γ := fun z : ℝ × ℝ => (z.1, u z.1 + z.2 • η z.1) |
| 64 | let W := fun z : ℝ × ℝ => w z.1 + z.2 • ν z.1 |
| 65 | have hu' : ContinuousOn (fun z : ℝ × ℝ => u z.1) C := |
| 66 | hu.comp continuousOn_fst (fun _ hz => hz.1) |
| 67 | have hw' : ContinuousOn (fun z : ℝ × ℝ => w z.1) C := |
| 68 | hw.comp continuousOn_fst (fun _ hz => hz.1) |
| 69 | have hη' : ContinuousOn (fun z : ℝ × ℝ => η z.1) C := |
| 70 | hη.comp continuousOn_fst (fun _ hz => hz.1) |
| 71 | have hν' : ContinuousOn (fun z : ℝ × ℝ => ν z.1) C := |
| 72 | hν.comp continuousOn_fst (fun _ hz => hz.1) |
| 73 | have hΓ : ContinuousOn Γ C := continuousOn_fst.prodMk (hu'.add (continuousOn_snd.smul hη')) |
| 74 | have hW : ContinuousOn W C := hw'.add (continuousOn_snd.smul hν') |
| 75 | have hmap : MapsTo Γ C Ω := fun z hz => hmem z.1 hz.1 z.2 hz.2 |
| 76 | let L := fun z : ℝ × ℝ => B (Γ z) (W z) (W z) / 2 + V (Γ z) |
| 77 | let L' := fun z : ℝ × ℝ => DB (Γ z) (η z.1) (W z) (W z) / 2 + |
| 78 | B (Γ z) (W z) (ν z.1) + DV (Γ z) (η z.1) |
| 79 | have hL : ContinuousOn L C := |
| 80 | ((((hB.comp hΓ hmap).clm_apply hW).clm_apply hW).div_const 2).add (hV.comp hΓ hmap) |
| 81 | have hL' : ContinuousOn L' C := |
| 82 | ((((((hDB.comp hΓ hmap).clm_apply hη').clm_apply hW).clm_apply hW).div_const 2).add |
| 83 | (((hB.comp hΓ hmap).clm_apply hW).clm_apply hν')).add ((hDV.comp hΓ hmap).clm_apply hη') |
| 84 | have hd (s : ℝ) (hs : s ∈ Icc a b) (v : ℝ) (hv : v ∈ P) : |
| 85 | HasDerivAt (fun e => L (s, e)) (L' (s, v)) v := |
| 86 | PoincareMT.M08.affine_chart_density_hasDerivAt (fun x => B (s, x)) (fun x => V (s, x)) |
| 87 | (DB (s, u s + v • η s)) (DV (s, u s + v • η s)) (u s) (η s) (w s) (ν s) v |
| 88 | (hBd _ (hmem s hs v hv)) (hVd _ (hmem s hs v hv)) (hsym _ (hmem s hs v hv)) |
| 89 | simpa only [L, L', Γ, W, zero_smul, add_zero] using |
| 90 | hasDerivAt_integral_of_continuousOn_parameter (μ := volume) hab hP L L' hL hL' hd hzero |
| 91 | |
| 92 | end intervalIntegral |