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.Compactness.Coordinates.SpacetimeBounds.Ricci.Pullback |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.Coordinates.SpacetimeBounds.BilinearJets |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.Coordinates.SpacetimeBounds.MixedDerivatives |
| 4 | |
| 5 | /-! # Evolution of arbitrary spatial metric jets in a fixed chart |
| 6 | |
| 7 | The Ricci-flow equation and curvature derivative bounds give a differential |
| 8 | inequality affine in the highest metric jet, uniformly over the flow and chart. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | set_option maxSynthPendingDepth 8 |
| 14 | set_option synthInstance.maxHeartbeats 100000 |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology Bundle |
| 19 | |
| 20 | namespace PoincareMT.SpacetimeBounds |
| 21 | |
| 22 | theorem exists_affine_spatialJet_evolution_bound |
| 23 | (n q : ℕ) (K : ℕ → ℝ) (hK : ∀ j, 0 ≤ K j) |
| 24 | {a b : ℝ} (ha : 0 < a) (hb : 0 ≤ b) (A : ℝ) (hA : 1 ≤ A) : |
| 25 | ∃ C : ℝ, 0 ≤ C ∧ |
| 26 | ∀ {M : Type*} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {J : Set ℝ} (F : RicciFlow n M J), IsOpen J → |
| 29 | ∀ {U : Set (EuclideanSpace ℝ (Fin n))}, IsOpen U → |
| 30 | ∀ {e : EuclideanSpace ℝ (Fin n) → M}, ContMDiffOn (𝓡 n) (𝓡 n) ∞ e U → |
| 31 | (∀ y ∈ U, (mfderiv (𝓡 n) (𝓡 n) e y).IsInvertible) → |
| 32 | ∀ {t : ℝ}, t ∈ J → ∀ {x : EuclideanSpace ℝ (Fin n)}, x ∈ U → |
| 33 | (∀ v, a * ‖v‖ ^ 2 ≤ (F.metric t).pullbackCoefficients e x v v) → |
| 34 | (∀ v, (F.metric t).pullbackCoefficients e x v v ≤ b * ‖v‖ ^ 2) → |
| 35 | (∀ s ≤ q + 1, (F.connection t).curvatureDerivativeNorm s (e x) ≤ K s) → |
| 36 | (∀ j, 1 ≤ j → j ≤ q → |
| 37 | ‖iteratedFDeriv ℝ j ((F.metric t).pullbackCoefficients e) x‖ ≤ A ^ j) → |
| 38 | ‖deriv (fun s => iteratedFDeriv ℝ (q + 1) ((F.metric s).pullbackCoefficients e) x) t‖ ≤ |
| 39 | C * (1 + ‖iteratedFDeriv ℝ (q + 1) ((F.metric t).pullbackCoefficients e) x‖) := by |
| 40 | obtain ⟨C, hC, hric⟩ := exists_affine_pullback_ricci_component_jet_bound n q K hK ha hb A hA |
| 41 | refine ⟨(n : ℝ) * n * (2 * C), by positivity, ?_⟩ |
| 42 | intro M _ _ _ J F hJ U hU e he hi t ht x hx hlower hupper hcurv hjets |
| 43 | let B := fun z : ℝ × EuclideanSpace ℝ (Fin n) => (F.metric z.1).pullbackCoefficients e z.2 |
| 44 | have hB : ContDiffOn ℝ ∞ B (J ×ˢ U) := F.contDiffOn_pullbackCoefficients hJ hU he |
| 45 | let k := fun y => deriv (fun s => B (s, y)) t |
| 46 | have hk : ContDiffAt ℝ ∞ k x := |
| 47 | ((contDiffOn_timeDeriv hB hJ hU).contDiffAt (x := (t, x)) |
| 48 | ((hJ.prod hU).mem_nhds ⟨ht, hx⟩)).comp x (contDiffAt_const.prodMk contDiffAt_id) |
| 49 | have hevol := hasDerivAt_spatialJet hB hJ hU ht |
| 50 | (fun y hy => (F.differentiableAt_pullbackCoefficients_time hJ hU he ht hy).hasDerivAt) |
| 51 | (q + 1) hx |
| 52 | rw [hevol.deriv] |
| 53 | have hcomponents (p r : Fin n) : |
| 54 | ‖iteratedFDeriv ℝ (q + 1) (fun y => k y (EuclideanSpace.basisFun (Fin n) ℝ p) |
| 55 | (EuclideanSpace.basisFun (Fin n) ℝ r)) x‖ ≤ |
| 56 | 2 * C * (1 + ‖iteratedFDeriv ℝ (q + 1) ((F.metric t).pullbackCoefficients e) x‖) := by |
| 57 | let u := EuclideanSpace.basisFun (Fin n) ℝ p |
| 58 | let v := EuclideanSpace.basisFun (Fin n) ℝ r |
| 59 | let R := fun y => (F.connection t).ricci (e y) |
| 60 | (mfderiv (𝓡 n) (𝓡 n) e y u) (mfderiv (𝓡 n) (𝓡 n) e y v) |
| 61 | have hgerm : (fun y => k y u v) =ᶠ[𝓝 x] (fun y => -2 * R y) := by |
| 62 | filter_upwards [hU.mem_nhds hx] with y hy |
| 63 | exact F.deriv_pullbackCoefficients_apply hJ hU he ht hy u v |
| 64 | have hscaled : R =ᶠ[𝓝 x] (fun y => (-1 / 2 : ℝ) * (k y u v)) := by |
| 65 | filter_upwards [hgerm] with y hy |
| 66 | rw [hy] |
| 67 | ring |
| 68 | have hR : ContDiffAt ℝ ∞ R x := |
| 69 | (contDiffAt_const.mul ((hk.clm_apply contDiffAt_const).clm_apply |
| 70 | contDiffAt_const)).congr_of_eventuallyEq hscaled |
| 71 | rw [(hgerm.iteratedFDeriv (𝕜 := ℝ) (q + 1)).eq_of_nhds] |
| 72 | change ‖iteratedFDeriv ℝ (q + 1) (fun y => (-2 : ℝ) • R y) x‖ ≤ _ |
| 73 | rw [iteratedFDeriv_const_smul_apply' (hR.of_le (by exact_mod_cast le_top)), |
| 74 | norm_smul, Real.norm_eq_abs] |
| 75 | norm_num only [abs_neg, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2)] |
| 76 | have hr := hric (F.connection t) hU he hi hx hlower hupper hcurv hjets p r |
| 77 | calc |
| 78 | _ ≤ 2 * (C * (1 + ‖iteratedFDeriv ℝ (q + 1) |
| 79 | ((F.metric t).pullbackCoefficients e) x‖)) := mul_le_mul_of_nonneg_left hr (by norm_num) |
| 80 | _ = _ := by ring |
| 81 | have h := norm_iteratedFDeriv_bilinear_le_of_components |
| 82 | (EuclideanSpace.basisFun (Fin n) ℝ) hk (q + 1) hcomponents |
| 83 | apply h.trans_eq |
| 84 | ring |
| 85 | |
| 86 | end PoincareMT.SpacetimeBounds |