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 Mathlib.Analysis.Calculus.ContDiff.Operations |
| 2 | import Mathlib.Analysis.Calculus.FDeriv.CompCLM |
| 3 | |
| 4 | /-! |
| 5 | # Differentiating the coordinate metric dual |
| 6 | |
| 7 | The inverse metric applied to a scalar differential is continuously |
| 8 | differentiable. Differentiating its defining covector identity avoids |
| 9 | choosing a formula for the derivative of the inverse operator. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Filter |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 20 | |
| 21 | /-- A smooth invertible bilinear form sends the differential of a C2 scalar to a C1 field. -/ |
| 22 | theorem metricDual_contDiffAt {B : E → E →L[ℝ] E →L[ℝ] ℝ} {f : E → ℝ} {y : E} |
| 23 | (hB : ContDiffAt ℝ 1 B y) (hf : ContDiffAt ℝ 2 f y) |
| 24 | (hi : (B y).IsInvertible) : |
| 25 | ContDiffAt ℝ 1 (fun z ↦ (B z).inverse (fderiv ℝ f z)) y := by |
| 26 | exact (hi.contDiffAt_map_inverse.comp y hB).clm_apply |
| 27 | (hf.fderiv_right (by norm_num)) |
| 28 | |
| 29 | /-- The derivative of the metric dual satisfies the differentiated defining identity. -/ |
| 30 | theorem metricDual_fderiv_identity |
| 31 | {B : E → E →L[ℝ] E →L[ℝ] ℝ} {f : E → ℝ} {y : E} |
| 32 | (hB : ContDiffAt ℝ 1 B y) (hf : ContDiffAt ℝ 2 f y) |
| 33 | (hi : (B y).IsInvertible) (v w : E) : |
| 34 | B y (fderiv ℝ (fun z ↦ (B z).inverse (fderiv ℝ f z)) y v) w + |
| 35 | fderiv ℝ B y v ((B y).inverse (fderiv ℝ f y)) w = |
| 36 | fderiv ℝ (fderiv ℝ f) y v w := by |
| 37 | let a := fun z ↦ (B z).inverse (fderiv ℝ f z) |
| 38 | have ha := (metricDual_contDiffAt hB hf hi).differentiableAt one_ne_zero |
| 39 | have hinv : ∀ᶠ z in 𝓝 y, (B z).IsInvertible := |
| 40 | hB.continuousAt (ContinuousLinearEquiv.isOpen.mem_nhds hi) |
| 41 | have heq : (fun z ↦ B z (a z)) =ᶠ[𝓝 y] fderiv ℝ f := by |
| 42 | filter_upwards [hinv] with z hz |
| 43 | exact hz.self_apply_inverse _ |
| 44 | have hd := heq.fderiv_eq (𝕜 := ℝ) |
| 45 | rw [fderiv_clm_apply (hB.differentiableAt one_ne_zero) ha] at hd |
| 46 | exact congrArg (fun L : E →L[ℝ] E →L[ℝ] ℝ ↦ L v w) hd |
| 47 | |
| 48 | end PoincareMT.ReducedVolume |