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.CurveShortening.Evolution.SpeedEvolution |
| 2 | import PoincareLib.Analysis.Calculus.Parametric.MixedDerivatives |
| 3 | import Mathlib.Analysis.Calculus.Deriv.Inv |
| 4 | |
| 5 | /-! |
| 6 | # The scalar arclength and time commutator |
| 7 | |
| 8 | MT2007 Lemma 19.6, pp. 441-442, and correction Lemma 0.1, p. 3, |
| 9 | express the commutator on the parameter cylinder. The test function here |
| 10 | has precisely the C2 regularity in the frozen contract. |
| 11 | See `references/ricci-flow/mapher/curve-evolution/derivations/2026-09-19-scalar-commutator.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M62 |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {a b : ℝ} (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 25 | |
| 26 | /-- The actual scalar arclength and time operators have the corrected |
| 27 | commutator; MT2007 Lemma 19.6, pp. 441-442, correction Lemma 0.1, p. 3. -/ |
| 28 | theorem arc_time_commutator (hc : M62ShrinkingCurve F c) |
| 29 | (f : ℝ × ℝ → ℝ) |
| 30 | (hf : ContDiffOn ℝ 2 f (Set.univ ×ˢ Set.Ioo a b)) |
| 31 | {t : ℝ} (ht : t ∈ Set.Ioo a b) (x : ℝ) : |
| 32 | deriv (fun s ↦ m62ArcDerivative F c s (fun y ↦ f (y, s)) x) t - |
| 33 | m62ArcDerivative F c t (fun y ↦ deriv (fun s ↦ f (y, s)) t) x = |
| 34 | (m62CurvatureSquared F c t x + m62TangentRicci F c t x) * |
| 35 | m62ArcDerivative F c t (fun y ↦ f (y, t)) x := by |
| 36 | have hmem : (x, t) ∈ (Set.univ ×ˢ Set.Ioo a b : Set (ℝ × ℝ)) := ⟨Set.mem_univ _, ht⟩ |
| 37 | have hfat := (hf (x, t) hmem).contDiffAt |
| 38 | ((isOpen_univ.prod isOpen_Ioo).mem_nhds hmem) |
| 39 | obtain ⟨k, htime, hspace⟩ := hfat.exists_hasDerivAt_mixed |
| 40 | have hv := (speed_pos F c hc (Set.Ioo_subset_Icc_self ht) x).ne' |
| 41 | have hinv := (hasDerivAt_speed F c hc ht x).fun_inv hv |
| 42 | have hprod := hinv.fun_mul htime |
| 43 | change deriv (fun s ↦ (curveSpeed F c s x)⁻¹ * deriv (fun y ↦ f (y, s)) x) t - |
| 44 | (curveSpeed F c t x)⁻¹ * deriv (fun y ↦ deriv (fun s ↦ f (y, s)) t) x = _ |
| 45 | rw [hprod.deriv, hspace.deriv] |
| 46 | unfold m62ArcDerivative |
| 47 | field_simp |
| 48 | ring |
| 49 | |
| 50 | end PoincareMT.M62 |