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.Tensor.TimeDerivative.General |
| 2 | import PoincareLib.Geometry.Manifold.ContDiff.SpatialDerivative |
| 3 | import PoincareLib.Geometry.RicciFlow.Connection.Variation |
| 4 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 5 | import PoincareLib.Geometry.Riemannian.Hessian.Tensor |
| 6 | import PoincareLib.Geometry.Riemannian.Tensor.TraceRegularity |
| 7 | |
| 8 | /-! |
| 9 | # Time differentiation of the scalar Hessian |
| 10 | |
| 11 | The time derivative of the Hessian has the Hessian of the scalar time |
| 12 | derivative and the connection variation paired with the differential. |
| 13 | Specializing to scalar curvature supplies the Hessian term in Hamilton's |
| 14 | two-tensor evolution (Chow et al., Part II, Lemma 15.19, (15.46), |
| 15 | printed p. 274, PDF p. 301). |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.RicciFlow |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | {J : Set ℝ} |
| 30 | |
| 31 | /-- The Hessian time derivative on fixed tangent inputs. -/ |
| 32 | lemma hasDerivAt_hessian_time |
| 33 | (F : RicciFlow n M J) {f : ℝ × M → ℝ} {df : M → ℝ} |
| 34 | {t : ℝ} (ht : t ∈ interior J) |
| 35 | (hspace : ∀ s, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun y => f (s, y))) |
| 36 | (hreg : ∀ y, ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ f (t, y)) |
| 37 | (hdf : ∀ y, HasDerivAt (fun s => f (s, y)) (df y) t) |
| 38 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 39 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 41 | let A := deriv (fun s => (F.connection s).connection |
| 42 | (FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v) x) t |
| 43 | HasDerivAt (fun s => (F.connection s).hessian (fun y => f (s, y)) x u v) |
| 44 | ((F.connection t).hessian df x u v - |
| 45 | mvfderiv (𝓡 n) (fun y => f (t, y)) x (A u)) t := by |
| 46 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 47 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 48 | let T : ℝ → CovariantTensorEvaluation n M 1 := fun s => differentialEvaluation (fun y => f (s, y)) |
| 49 | let W : ℝ → CovariantTensorEvaluation n M 1 := fun _ => differentialEvaluation df |
| 50 | have h := F.hasDerivAt_covariantTensorDerivative_time_all (T := T) (W := W) ht x |
| 51 | (fun s => differentialEvaluation_isSmooth (hspace s)) |
| 52 | (fun y X hX => Poincare.Manifold.contMDiffAt_mvfderiv_spatial (hreg y) (hX 0)) |
| 53 | (fun y z => Poincare.Manifold.hasDerivAt_mvfderiv_time (hreg y) hdf (z 0)) u ![v] |
| 54 | simpa only [T, W, Matrix.Fin.cons_vecCons, Fin.sum_univ_one, |
| 55 | ← LeviCivitaData.hessian_eq_covariantTensorDerivative, |
| 56 | differentialEvaluation, Function.update_self, Matrix.cons_val_zero] using h |
| 57 | |
| 58 | private lemma scalarCurvature_smooth |
| 59 | {g : RiemannianMetric n M} (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) : |
| 60 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ D.scalarCurvature := by |
| 61 | intro x |
| 62 | have h := (hD.2.1.tensorTrace (g := g)).contMDiffAt_apply |
| 63 | (x := x) (X := fun i : Fin 0 => Fin.elim0 i) (fun i => Fin.elim0 i) |
| 64 | convert h using 1 |
| 65 | funext y |
| 66 | unfold RiemannianMetric.tensorTrace LeviCivitaData.scalarCurvature |
| 67 | apply Finset.sum_congr rfl |
| 68 | intro i _ |
| 69 | rfl |
| 70 | |
| 71 | /-- The scalar-curvature specialization uses exactly the M04 scalar |
| 72 | evolution and regularity fields; no Hessian-evolution premise is needed. -/ |
| 73 | lemma hasDerivAt_hessian_scalarCurvature |
| 74 | (hC : RicciFlowCurvatureTheory.{u}) (F : RicciFlow n M J) |
| 75 | {t : ℝ} (ht : t ∈ interior J) (x : M) |
| 76 | (u v : TangentSpace (𝓡 n) x) : |
| 77 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 78 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 79 | let D := F.connection t |
| 80 | let A := deriv (fun s => (F.connection s).connection |
| 81 | (FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v) x) t |
| 82 | HasDerivAt (fun s => (F.connection s).hessian (F.connection s).scalarCurvature x u v) |
| 83 | (D.hessian (fun y => D.laplacian D.scalarCurvature y + 2 * D.ricciNormSq y) x u v - |
| 84 | mvfderiv (𝓡 n) D.scalarCurvature x (A u)) t := by |
| 85 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 86 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 87 | have hspace (s : ℝ) : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (F.connection s).scalarCurvature := |
| 88 | scalarCurvature_smooth (n := n) (M := M) (g := F.metric s) (F.connection s) |
| 89 | (hC.tensor_calculus n M (F.metric s) (F.connection s)) |
| 90 | dsimp only |
| 91 | refine F.hasDerivAt_hessian_time |
| 92 | (f := fun p => (F.connection p.1).scalarCurvature p.2) |
| 93 | (df := fun y => (F.connection t).laplacian (F.connection t).scalarCurvature y + |
| 94 | 2 * (F.connection t).ricciNormSq y) ht |
| 95 | hspace |
| 96 | ?_ ?_ x u v |
| 97 | · intro y |
| 98 | exact (hC.scalar_regular n M J F (t, y) ⟨interior_subset ht, Set.mem_univ y⟩).contMDiffAt |
| 99 | (prod_mem_nhds (mem_interior_iff_mem_nhds.mp ht) Filter.univ_mem) |
| 100 | · intro y |
| 101 | exact (hC.scalar_evolution n M J F t (interior_subset ht) y).hasDerivAt |
| 102 | (mem_interior_iff_mem_nhds.mp ht) |
| 103 | |
| 104 | /-- The scalar-curvature Hessian derivative with connection variation |
| 105 | expanded into covariant Ricci derivatives. -/ |
| 106 | lemma hasDerivAt_hessian_scalarCurvature_contractions |
| 107 | (hC : RicciFlowCurvatureTheory.{u}) (F : RicciFlow n M J) |
| 108 | {t : ℝ} (ht : t ∈ interior J) (x : M) |
| 109 | (u v : TangentSpace (𝓡 n) x) : |
| 110 | let D := F.connection t |
| 111 | let b := (F.metric t).orthonormalBasis x |
| 112 | HasDerivAt (fun s => (F.connection s).hessian (F.connection s).scalarCurvature x u v) |
| 113 | (D.hessian (fun y => D.laplacian D.scalarCurvature y + 2 * D.ricciNormSq y) x u v + |
| 114 | ∑ i, (D.covariantTensorDerivative D.ricciEvaluation x ![u, v, b i] + |
| 115 | D.covariantTensorDerivative D.ricciEvaluation x ![v, u, b i] - |
| 116 | D.covariantTensorDerivative D.ricciEvaluation x ![b i, u, v]) * |
| 117 | mvfderiv (𝓡 n) D.scalarCurvature x (b i)) t := by |
| 118 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 119 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 120 | let D := F.connection t |
| 121 | let b := (F.metric t).orthonormalBasis x |
| 122 | let A := deriv (fun s => (F.connection s).connection |
| 123 | (FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v) x) t |
| 124 | have hD := hC.tensor_calculus n M (F.metric t) D |
| 125 | have h := F.hasDerivAt_hessian_scalarCurvature hC ht x u v |
| 126 | have hexp := congrArg (mvfderiv (𝓡 n) D.scalarCurvature x) (b.sum_repr' (A u)) |
| 127 | simp only [map_sum, map_smul, smul_eq_mul] at hexp |
| 128 | have hcoef (i) : inner ℝ (b i) (A u) = |
| 129 | -D.covariantTensorDerivative D.ricciEvaluation x ![u, v, b i] - |
| 130 | D.covariantTensorDerivative D.ricciEvaluation x ![v, u, b i] + |
| 131 | D.covariantTensorDerivative D.ricciEvaluation x ![b i, u, v] := by |
| 132 | rw [real_inner_comm] |
| 133 | exact F.inner_deriv_connection_extend ht hD x u v (b i) |
| 134 | simp only [hcoef] at hexp |
| 135 | apply h.congr_deriv |
| 136 | rw [← hexp, sub_eq_add_neg, ← Finset.sum_neg_distrib] |
| 137 | congr 1 |
| 138 | apply Finset.sum_congr rfl |
| 139 | intro i _ |
| 140 | ring |
| 141 | |
| 142 | end PoincareMT.RicciFlow |