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.Surgery.CanonicalInduction.Positive.PositiveGradientAlgebra |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Positive.PositiveWeightedMaximum |
| 3 | import PoincareLib.Geometry.RicciFlow.Tensor.GradientEnergyTime |
| 4 | import PoincareLib.Geometry.RicciFlow.Curvature.Evolution.Scalar.SpatialCoefficients |
| 5 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Hessian.Norm |
| 6 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Divergence.Regularity |
| 7 | |
| 8 | /-! |
| 9 | # Primitive evolution and regularity for the scalar gradient |
| 10 | |
| 11 | The moving-metric variation cancels the Ricci term in Bochner's identity. |
| 12 | All scalar differentials and contractions are those of the retained flow. |
| 13 | These are the primitive gradient identities for Hamilton (1982), Section 11, |
| 14 | and Morgan--Tian, Theorem 4.23, pp. 74-75. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | -- Metric fiber and multilinear component presentations agree definitionally. |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set |
| 22 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M47Positive |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | {g : RiemannianMetric n M} |
| 31 | |
| 32 | /-- The squared gradient is spatially smooth; this regularity supports |
| 33 | the scalar maximum argument in Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 34 | theorem contMDiff_gradient_energy (D : LeviCivitaData g) {f : M → ℝ} |
| 35 | (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f) : |
| 36 | ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ |
| 37 | (fun x => g.inner x (D.gradient f x) (D.gradient f x)) := by |
| 38 | have hgrad := D.contMDiff_gradient hf |
| 39 | intro x |
| 40 | have h := ((g.contMDiff x).clm_bundle_apply (hgrad x)).clm_bundle_apply (hgrad x) |
| 41 | exact (Bundle.contMDiffAt_totalSpace.mp h).2 |
| 42 | |
| 43 | /-- The actual scalar-gradient energy is jointly continuous on the given |
| 44 | time strip. The proof traces the scalar differential tensor, so no |
| 45 | regularity of a chosen orthonormal frame is assumed. This is the |
| 46 | compact-comparison regularity in Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 47 | theorem continuousOn_scalar_gradient_energy |
| 48 | (hC : RicciFlowCurvatureTheory.{u}) {J : Set ℝ} (F : RicciFlow n M J) : |
| 49 | ContinuousOn (fun p : ℝ × M => (F.metric p.1).inner p.2 |
| 50 | ((F.connection p.1).gradient (F.connection p.1).scalarCurvature p.2) |
| 51 | ((F.connection p.1).gradient (F.connection p.1).scalarCurvature p.2)) |
| 52 | (J ×ˢ univ) := by |
| 53 | let T : (p : ℝ × M) → |
| 54 | MultilinearMap ℝ (fun _ : Fin 2 => TangentSpace (𝓡 n) p.2) ℝ := fun p => |
| 55 | { toFun := fun v => mvfderiv (𝓡 n) (F.connection p.1).scalarCurvature p.2 (v 0) * |
| 56 | mvfderiv (𝓡 n) (F.connection p.1).scalarCurvature p.2 (v 1) |
| 57 | map_update_add' := by |
| 58 | intro _ v i a b |
| 59 | fin_cases i <;> simp [map_add, add_mul, mul_add] |
| 60 | map_update_smul' := by |
| 61 | intro _ v i c a |
| 62 | fin_cases i <;> simp [map_smul, mul_assoc, mul_left_comm] } |
| 63 | have htrace := RicciFlowAnalysis.continuousOn_flow_tensorTrace F isOpen_univ T (by |
| 64 | intro V hV _ X Y hX hY |
| 65 | have hscalar := (hC.scalar_regular n M J F).mono |
| 66 | (show J ×ˢ V ⊆ J ×ˢ univ from fun _ hp => ⟨hp.1, mem_univ _⟩) |
| 67 | have hdx := RicciFlowAnalysis.contMDiffOn_mvfderiv_spatial hV hscalar hX |
| 68 | have hdy := RicciFlowAnalysis.contMDiffOn_mvfderiv_spatial hV hscalar hY |
| 69 | apply (hdx.mul hdy).continuousOn.congr |
| 70 | intro p _ |
| 71 | rfl) |
| 72 | have hid (p : ℝ × M) : (∑ i, T p |
| 73 | ![(F.metric p.1).orthonormalBasis p.2 i, (F.metric p.1).orthonormalBasis p.2 i]) = |
| 74 | (F.metric p.1).inner p.2 |
| 75 | ((F.connection p.1).gradient (F.connection p.1).scalarCurvature p.2) |
| 76 | ((F.connection p.1).gradient (F.connection p.1).scalarCurvature p.2) := by |
| 77 | simpa only [T, MultilinearMap.coe_mk, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 78 | pow_two] using |
| 79 | ((F.connection p.1).gradient_normSq_eq_sum_mvfderiv_sq |
| 80 | (F.connection p.1).scalarCurvature p.2).symm |
| 81 | simpa only [hid] using htrace |
| 82 | |
| 83 | /-- Differentiation of the actual gradient square gives twice the |
| 84 | Hessian quadratic form. This is the quotient cross term in Hamilton |
| 85 | (1982), Section 11, used by Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 86 | theorem gradient_energy_pairing (D : LeviCivitaData g) {f : M → ℝ} |
| 87 | (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ f) (x : M) : |
| 88 | g.inner x (D.gradient (fun y => g.inner y (D.gradient f y) (D.gradient f y)) x) |
| 89 | (D.gradient f x) = 2 * D.hessian f x (D.gradient f x) (D.gradient f x) := by |
| 90 | rw [D.inner_gradient, D.mvfderiv_normSq |
| 91 | ((D.contMDiff_gradient hf x).mdifferentiableAt (by simp)), |
| 92 | D.hessian_eq_inner_connection_gradient (hf x)] |
| 93 | |
| 94 | /-- The actual moving scalar-gradient energy satisfies its parabolic |
| 95 | evolution at every interior original time. The inverse-metric variation |
| 96 | cancels Bochner's Ricci term, as in Hamilton (1982), Lemma 11.2, and |
| 97 | Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 98 | theorem hasDerivAt_scalar_gradient_energy |
| 99 | (hC : RicciFlowCurvatureTheory.{u}) {J : Set ℝ} (F : RicciFlow n M J) |
| 100 | {t : ℝ} (ht : t ∈ interior J) (x : M) : |
| 101 | HasDerivAt (fun s => (F.metric s).inner x |
| 102 | ((F.connection s).gradient (F.connection s).scalarCurvature x) |
| 103 | ((F.connection s).gradient (F.connection s).scalarCurvature x)) |
| 104 | ((F.connection t).laplacian (fun y => (F.metric t).inner y |
| 105 | ((F.connection t).gradient (F.connection t).scalarCurvature y) |
| 106 | ((F.connection t).gradient (F.connection t).scalarCurvature y)) x - |
| 107 | 2 * (∑ i, ∑ j, ((F.connection t).hessian (F.connection t).scalarCurvature x |
| 108 | ((F.metric t).orthonormalBasis x i) ((F.metric t).orthonormalBasis x j)) ^ 2) + |
| 109 | 4 * (F.metric t).inner x |
| 110 | ((F.connection t).gradient (F.connection t).scalarCurvature x) |
| 111 | ((F.connection t).gradient (F.connection t).ricciNormSq x)) t := by |
| 112 | let D := F.connection t |
| 113 | have hD := hC.tensor_calculus n M (F.metric t) D |
| 114 | have hRs := hD.contMDiff_scalarCurvature |
| 115 | have hSs := RicciFlow.contMDiff_ricciNormSq D hD |
| 116 | have hspace (s : ℝ) := |
| 117 | (hC.tensor_calculus n M (F.metric s) (F.connection s)).contMDiff_scalarCurvature |
| 118 | have hreg (y : M) : ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ |
| 119 | (fun p : ℝ × M => (F.connection p.1).scalarCurvature p.2) (t, y) := |
| 120 | (hC.scalar_regular n M J F).contMDiffAt |
| 121 | (prod_mem_nhds (mem_interior_iff_mem_nhds.mp ht) Filter.univ_mem) |
| 122 | have hdf (y : M) := (hC.scalar_evolution n M J F t (interior_subset ht) y).hasDerivAt |
| 123 | (mem_interior_iff_mem_nhds.mp ht) |
| 124 | have htime := F.hasDerivAt_gradient_normSq_of_time_derivative ht hspace hreg hdf x |
| 125 | apply htime.congr_deriv |
| 126 | have hB := D.bochner_identity hRs x |
| 127 | have hLs := D.contMDiff_laplacian hRs |
| 128 | have h2S : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun y => (2 : ℝ) * D.ricciNormSq y) := by |
| 129 | have hc : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun _ : M => (2 : ℝ)) := contMDiff_const |
| 130 | exact hc.smul hSs |
| 131 | rw [(F.metric t).symm x (D.gradient D.scalarCurvature x), D.inner_gradient, |
| 132 | mvfderiv_fun_add ((hLs x).mdifferentiableAt (by simp)) |
| 133 | ((h2S x).mdifferentiableAt (by simp))] |
| 134 | simp only [add_apply, mvfderiv_const_mul] |
| 135 | rw [(F.metric t).symm x (D.gradient D.scalarCurvature x), D.inner_gradient] |
| 136 | linarith only [hB] |
| 137 | |
| 138 | end PoincareMT.M47Positive |