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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/PullbackMetricDerivativeNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Gauge.Pullback.PullbackMetric |
| 6 | import Mathlib.Analysis.Calculus.Deriv.Prod |
| 7 | import Mathlib.Analysis.Calculus.Deriv.Comp |
| 8 | |
| 9 | /-! |
| 10 | # Diagonal pullback derivative |
| 11 | |
| 12 | The metric and diffeomorphism time variables are separated before restricting |
| 13 | to the diagonal. This is the elementary chain-rule identity used by the |
| 14 | time-dependent gauge calculation; all geometric regularity is left in the |
| 15 | explicit Frechet derivative hypothesis. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle |
| 21 | |
| 22 | noncomputable section |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} |
| 29 | [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 30 | [IsManifold (𝓡 n) ∞ M] |
| 31 | |
| 32 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 33 | |
| 34 | theorem hasDerivWithinAt_pullbackMetric_of_jointFDeriv |
| 35 | (g : ℝ → RiemannianMetric n M) |
| 36 | (Φ : ℝ → Diffeomorph (𝓡 n) (𝓡 n) M M ∞) |
| 37 | (hsmooth : ∀ s : ℝ, |
| 38 | ContMDiff (𝓡 n) |
| 39 | ((𝓡 n).prod 𝓘(ℝ, E →L[ℝ] E →L[ℝ] ℝ)) ∞ |
| 40 | (fun y : M => Bundle.TotalSpace.mk' |
| 41 | (E →L[ℝ] E →L[ℝ] ℝ) y |
| 42 | (pinner (g s) (Φ s) y))) |
| 43 | {J : Set ℝ} {t : ℝ} {x : M} |
| 44 | {u v : TangentSpace (𝓡 n) x} |
| 45 | {L : (ℝ × ℝ) →L[ℝ] ℝ} |
| 46 | (hF : HasFDerivWithinAt |
| 47 | (fun q : ℝ × ℝ => |
| 48 | (g q.1).inner (Φ q.2 x) |
| 49 | (mfderiv (𝓡 n) (𝓡 n) (Φ q.2) x u) |
| 50 | (mfderiv (𝓡 n) (𝓡 n) (Φ q.2) x v)) |
| 51 | L (J ×ˢ J) (t, t)) : |
| 52 | HasDerivWithinAt |
| 53 | (fun s : ℝ => |
| 54 | (pullbackMetric (g s) (Φ s) (hsmooth s)).inner x u v) |
| 55 | (L (1, 1)) J t := by |
| 56 | let diag : ℝ → ℝ × ℝ := fun s => (s, s) |
| 57 | have hdiag : HasDerivWithinAt diag (1, 1) J t := by |
| 58 | simpa only [diag, id_eq] using |
| 59 | (hasDerivWithinAt_id t J).prodMk (hasDerivWithinAt_id t J) |
| 60 | have hmaps : Set.MapsTo diag J (J ×ˢ J) := by |
| 61 | intro s hs |
| 62 | exact ⟨hs, hs⟩ |
| 63 | have hF' : HasFDerivWithinAt |
| 64 | (fun q : ℝ × ℝ => |
| 65 | (g q.1).inner (Φ q.2 x) |
| 66 | (mfderiv (𝓡 n) (𝓡 n) (Φ q.2) x u) |
| 67 | (mfderiv (𝓡 n) (𝓡 n) (Φ q.2) x v)) |
| 68 | L (J ×ˢ J) (diag t) := by |
| 69 | simpa [diag] using hF |
| 70 | have hcomp := HasFDerivWithinAt.comp_hasDerivWithinAt t hF' hdiag hmaps |
| 71 | apply hcomp.congr |
| 72 | · intro s hs |
| 73 | rw [pullbackMetric_inner] |
| 74 | rfl |
| 75 | · rw [pullbackMetric_inner] |
| 76 | rfl |
| 77 | |
| 78 | end PoincareMT |