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.Splitting.PartialTraceEvolution |
| 2 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.Positive |
| 3 | |
| 4 | /-! |
| 5 | # Ricci-nullity consequences of scalar heat-contact propagation |
| 6 | |
| 7 | Every partial trace detects a threshold for the dimension of the actual |
| 8 | Ricci kernel. Applying scalar strong positivity to all these traces gives |
| 9 | spatially constant nullity at positive times and nonincreasing nullity in |
| 10 | time. The lower heat contacts and continuity remain explicit here so that |
| 11 | their geometric producer can be checked separately. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology Bundle |
| 20 | |
| 21 | namespace PoincareMT.RicciFlow.Splitting |
| 22 | |
| 23 | open Poincare.RicciFlow.Splitting MaximumPrinciple |
| 24 | |
| 25 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {g : RiemannianMetric n M} |
| 28 | |
| 29 | /-- The kernel of the actual Ricci bilinear form, without a choice of raised index. -/ |
| 30 | def ricciKernel (D : LeviCivitaData g) (x : M) : |
| 31 | Submodule ℝ (TangentSpace (𝓡 n) x) := (ricciBilinear D x).ker |
| 32 | |
| 33 | /-- The dimension of the actual Ricci kernel. -/ |
| 34 | def ricciNullity (D : LeviCivitaData g) (x : M) : ℕ := |
| 35 | Module.finrank ℝ (ricciKernel D x) |
| 36 | |
| 37 | @[simp] theorem mem_ricciKernel (D : LeviCivitaData g) (x : M) |
| 38 | (v : TangentSpace (𝓡 n) x) : |
| 39 | v ∈ ricciKernel D x ↔ ∀ w : TangentSpace (𝓡 n) x, D.ricci x v w = 0 := by |
| 40 | change ricciBilinear D x v = 0 ↔ _ |
| 41 | constructor |
| 42 | · intro h w |
| 43 | simpa only [ricciBilinear_apply, LinearMap.zero_apply] using congrArg (fun A => A w) h |
| 44 | · intro h |
| 45 | ext w |
| 46 | simpa only [ricciBilinear_apply, LinearMap.zero_apply] using h w |
| 47 | |
| 48 | theorem metricRicciOperator_ker (D : LeviCivitaData g) (x : M) : |
| 49 | (metricRicciOperator D x).ker = ricciKernel D x := by |
| 50 | ext v |
| 51 | rw [mem_ricciKernel] |
| 52 | change metricRicciOperator D x v = 0 ↔ _ |
| 53 | constructor |
| 54 | · intro hv w |
| 55 | rw [← metricRicciOperator_inner, hv, map_zero, zero_apply] |
| 56 | · intro hv |
| 57 | apply (g.inner_isInvertible x).injective |
| 58 | ext w |
| 59 | rw [map_zero, zero_apply, metricRicciOperator_inner] |
| 60 | exact hv w |
| 61 | |
| 62 | theorem ricciNullity_le (D : LeviCivitaData g) (x : M) : ricciNullity D x ≤ n := by |
| 63 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) x) := by |
| 64 | unfold TangentSpace |
| 65 | infer_instance |
| 66 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) x) = n := finrank_euclideanSpace_fin |
| 67 | exact (Submodule.finrank_le (ricciKernel D x)).trans_eq hdim |
| 68 | |
| 69 | theorem ricciPartialTrace_eq_zero_iff_nullity (D : LeviCivitaData g) |
| 70 | (hD : D.CurvatureTensorCalculus) (x : M) |
| 71 | (hRic : ∀ v : TangentSpace (𝓡 n) x, 0 ≤ D.ricci x v v) |
| 72 | {k : ℕ} (hk : k ≤ n) : ricciPartialTrace D k x = 0 ↔ k ≤ ricciNullity D x := by |
| 73 | rw [ricciPartialTrace_eq_zero_iff D hD x hk hRic] |
| 74 | rw [metricRicciOperator_ker] |
| 75 | rfl |
| 76 | |
| 77 | variable [T2Space M] |
| 78 | |
| 79 | /-- All partial-trace heat contacts force the actual Ricci kernel dimension |
| 80 | to be spatially constant on a connected domain at every positive time. -/ |
| 81 | theorem ricciNullity_eq_of_heatLowerContacts |
| 82 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 83 | {g : ℝ → RiemannianMetric n M} (D : ∀ t, LeviCivitaData (g t)) |
| 84 | {a b : ℝ} (hg : RiemannianMetric.IsSmoothFamilyOn g (Icc a b)) |
| 85 | (hD : ∀ t ∈ Icc a b, (D t).CurvatureTensorCalculus) |
| 86 | (hRic : ∀ t ∈ Icc a b, ∀ x ∈ U, ∀ v : TangentSpace (𝓡 n) x, |
| 87 | 0 ≤ (D t).ricci x v v) |
| 88 | (hv : ∀ k ≤ n, ContinuousOn |
| 89 | (fun z : M × ℝ => ricciPartialTrace (D z.2) k z.1) (U ×ˢ Icc a b)) |
| 90 | (hvs : ∀ k ≤ n, HeatLowerContacts D U (Ioo a b) |
| 91 | (fun x t => ricciPartialTrace (D t) k x)) |
| 92 | {t : ℝ} (ht : t ∈ Ioc a b) {p q : M} (hp : p ∈ U) (hq : q ∈ U) : |
| 93 | ricciNullity (D t) p = ricciNullity (D t) q := by |
| 94 | have ht' : t ∈ Icc a b := ⟨ht.1.le, ht.2⟩ |
| 95 | have hthreshold (k : ℕ) (hk : k ≤ n) : |
| 96 | k ≤ ricciNullity (D t) p ↔ k ≤ ricciNullity (D t) q := by |
| 97 | rw [← ricciPartialTrace_eq_zero_iff_nullity (D t) (hD t ht') p (hRic t ht' p hp) hk, |
| 98 | ← ricciPartialTrace_eq_zero_iff_nullity (D t) (hD t ht') q (hRic t ht' q hq) hk] |
| 99 | exact eq_zero_at_positive_time_iff hU hconn D hg (hv k hk) (hvs k hk) |
| 100 | (fun x hx s hs => ricciPartialTrace_nonneg (D s) (hD s hs) x hk (hRic s hs x hx)) |
| 101 | ht hp hq |
| 102 | exact le_antisymm |
| 103 | ((hthreshold _ (ricciNullity_le (D t) p)).mp le_rfl) |
| 104 | ((hthreshold _ (ricciNullity_le (D t) q)).mpr le_rfl) |
| 105 | |
| 106 | /-- Scalar propagation makes Ricci nullity nonincreasing in time. -/ |
| 107 | theorem ricciNullity_antitoneOn_of_heatLowerContacts |
| 108 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 109 | {g : ℝ → RiemannianMetric n M} (D : ∀ t, LeviCivitaData (g t)) |
| 110 | {a b : ℝ} (hg : RiemannianMetric.IsSmoothFamilyOn g (Icc a b)) |
| 111 | (hD : ∀ t ∈ Icc a b, (D t).CurvatureTensorCalculus) |
| 112 | (hRic : ∀ t ∈ Icc a b, ∀ x ∈ U, ∀ v : TangentSpace (𝓡 n) x, |
| 113 | 0 ≤ (D t).ricci x v v) |
| 114 | (hv : ∀ k ≤ n, ContinuousOn |
| 115 | (fun z : M × ℝ => ricciPartialTrace (D z.2) k z.1) (U ×ˢ Icc a b)) |
| 116 | (hvs : ∀ k ≤ n, HeatLowerContacts D U (Ioo a b) |
| 117 | (fun x t => ricciPartialTrace (D t) k x)) |
| 118 | {p : M} (hp : p ∈ U) : AntitoneOn (fun t => ricciNullity (D t) p) (Icc a b) := by |
| 119 | intro s hs t ht hst |
| 120 | rcases hst.eq_or_lt with heq | hlt |
| 121 | · subst t |
| 122 | exact le_rfl |
| 123 | let k := ricciNullity (D t) p |
| 124 | have hk : k ≤ n := ricciNullity_le (D t) p |
| 125 | have hzero : ricciPartialTrace (D t) k p = 0 := |
| 126 | (ricciPartialTrace_eq_zero_iff_nullity (D t) (hD t ht) p (hRic t ht p hp) hk).mpr le_rfl |
| 127 | apply (ricciPartialTrace_eq_zero_iff_nullity (D s) (hD s hs) p (hRic s hs p hp) hk).mp |
| 128 | have hsub : Icc s t ⊆ Icc a b := Icc_subset_Icc hs.1 ht.2 |
| 129 | exact eq_zero_on_Icc_of_eq_zero hU hconn D hlt (hg.mono (prod_mono_left hsub)) |
| 130 | ((hv k hk).mono (prod_mono_right hsub)) |
| 131 | (fun x hx r hr => hvs k hk x hx r ⟨hs.1.trans_lt hr.1, hr.2.trans_le ht.2⟩) |
| 132 | (fun x hx r hr => ricciPartialTrace_nonneg (D r) (hD r (hsub hr)) x hk |
| 133 | (hRic r (hsub hr) x hx)) |
| 134 | hp hzero ⟨le_rfl, hlt.le⟩ hp |
| 135 | |
| 136 | end PoincareMT.RicciFlow.Splitting |