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.Soliton.ThreeDimensional.Noncompact.PotentialRegularity |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.Basic |
| 3 | import PoincareLib.Geometry.RicciFlow.Soliton.TwoDimensional.Compact.Differential |
| 4 | import PoincareLib.Geometry.Riemannian.Curvature.ContractedBianchi |
| 5 | import PoincareLib.Geometry.Riemannian.Tensor.Linearity |
| 6 | import PoincareLib.Geometry.Manifold.ContDiff.Constancy |
| 7 | |
| 8 | /-! |
| 9 | # Scalar identities of C2 gradient solitons |
| 10 | |
| 11 | The contracted Bianchi identity and Hessian commutator give |
| 12 | `dR = 2 Ric(grad f, -)`. Hamilton's scalar quantity is then constant. |
| 13 | The potential is bootstrapped from its original C2 regularity, so smoothness |
| 14 | is a conclusion and not an additional hypothesis. |
| 15 | |
| 16 | Reference: Morgan--Tian, Proposition 9.46, Section 9.4.4, |
| 17 | equations (9.21)--(9.22), pp. 209-213. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | set_option backward.isDefEq.respectTransparency false |
| 22 | |
| 23 | open scoped Manifold ContDiff Bundle BigOperators |
| 24 | open Bundle |
| 25 | |
| 26 | noncomputable section |
| 27 | |
| 28 | namespace PoincareMT.LeviCivitaData |
| 29 | |
| 30 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 32 | {g : RiemannianMetric n M} |
| 33 | |
| 34 | /-- The scalar differential identity of a C2 gradient Ricci soliton. -/ |
| 35 | theorem mvfderiv_scalarCurvature_of_C2_gradient_soliton |
| 36 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 37 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) 2 f) |
| 38 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 n) x, |
| 39 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 40 | (x : M) (v : TangentSpace (𝓡 n) x) : |
| 41 | mvfderiv (𝓡 n) D.scalarCurvature x v = 2 * D.ricci x (D.gradient f x) v := by |
| 42 | have hfs := D.contMDiff_of_C2_gradient_soliton hf hsol |
| 43 | have hH : ∀ a b c : TangentSpace (𝓡 n) x, |
| 44 | D.covariantTensorDerivative (fun y w => D.hessian f y (w 0) (w 1)) x ![a, b, c] = |
| 45 | -D.covariantTensorDerivative D.ricciEvaluation x ![a, b, c] := by |
| 46 | intro a b c |
| 47 | have heq : (fun y (w : Fin 2 → TangentSpace (𝓡 n) y) => |
| 48 | D.ricciEvaluation y w + D.hessian f y (w 0) (w 1)) = |
| 49 | (fun y w => lambda * g.inner y (w 0) (w 1)) := by |
| 50 | funext y w |
| 51 | exact hsol y (w 0) (w 1) |
| 52 | have hd := congrArg (fun T => D.covariantTensorDerivative T x ![a, b, c]) heq |
| 53 | rw [D.covariantTensorDerivative_add D.ricciEvaluation_isSmooth_manifold |
| 54 | (D.hessian_isSmoothCovariantTensor hfs), |
| 55 | D.covariantTensorDerivative_scalar_mul_metric (a := fun _ : M => lambda) |
| 56 | contMDiff_const] at hd |
| 57 | simp only [mvfderiv_const, zero_apply, zero_mul] at hd |
| 58 | rw [add_comm] at hd |
| 59 | exact eq_neg_of_add_eq_zero_left hd |
| 60 | let b := g.orthonormalBasis x |
| 61 | have hpair (a c : TangentSpace (𝓡 n) x) : D.ricci x a c = D.ricci x c a := |
| 62 | (hD.2.2.2.1 x a c c a).2.2.2 |
| 63 | have hb (i : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 64 | mvfderiv (𝓡 n) D.scalarCurvature x (b i) = |
| 65 | 2 * D.ricci x (D.gradient f x) (b i) := by |
| 66 | have hterm (j : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) := |
| 67 | D.covariantTensorDerivative_hessian_commutator hfs x (b j) (b i) (b j) |
| 68 | have hcurv (j : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x))) : |
| 69 | -mvfderiv (𝓡 n) f x (D.curvature x (b j) (b i) (b j)) = |
| 70 | D.curvatureTensor x (b i) (b j) (D.gradient f x) (b j) := by |
| 71 | rw [← D.inner_gradient, g.symm] |
| 72 | change -D.curvatureTensor x (b j) (b i) (D.gradient f x) (b j) = _ |
| 73 | rw [D.curvatureTensor_swap_first, neg_neg] |
| 74 | simp_rw [hH, hcurv] at hterm |
| 75 | have hsum := congrArg (fun F : Fin (Module.finrank ℝ (TangentSpace (𝓡 n) x)) → ℝ => |
| 76 | ∑ j, F j) (funext hterm) |
| 77 | simp only [Finset.sum_sub_distrib, Finset.sum_neg_distrib] at hsum |
| 78 | change -(∑ j, D.frameRicciDerivative x j i j) - |
| 79 | -(∑ j, D.frameRicciDerivative x i j j) = D.ricci x (b i) (D.gradient f x) at hsum |
| 80 | rw [D.frameRicciDerivative_trace hD, D.frameRicciDerivative_scalar_trace hD, |
| 81 | hpair] at hsum |
| 82 | change -(mvfderiv (𝓡 n) D.scalarCurvature x (b i) / 2) - |
| 83 | -mvfderiv (𝓡 n) D.scalarCurvature x (b i) = _ at hsum |
| 84 | linarith only [hsum] |
| 85 | let B := ∑ i, D.curvatureTensor_bilinear_first_third x (b i) (b i) |
| 86 | have hB (a c : TangentSpace (𝓡 n) x) : B a c = D.ricci x a c := by |
| 87 | simp [B, ricci, b, LinearMap.sum_apply] |
| 88 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 89 | ⟨g.toRiemannianMetric⟩ |
| 90 | have hv : v = ∑ i, (b.repr v i) • b i := (b.sum_repr v).symm |
| 91 | rw [hv, map_sum] |
| 92 | simp only [map_smul, smul_eq_mul, hb] |
| 93 | rw [← hB, map_sum] |
| 94 | simp only [map_smul, smul_eq_mul] |
| 95 | rw [Finset.mul_sum] |
| 96 | exact Finset.sum_congr rfl (fun i _ => by rw [hB]; ring) |
| 97 | |
| 98 | /-- Hamilton's scalar quantity is constant for a C2 gradient soliton. -/ |
| 99 | theorem exists_hamilton_conservation_of_C2_gradient_soliton [PreconnectedSpace M] |
| 100 | (D : LeviCivitaData g) (hD : D.CurvatureTensorCalculus) |
| 101 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) 2 f) |
| 102 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 n) x, |
| 103 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) : |
| 104 | ∃ C : ℝ, ∀ x, D.scalarCurvature x + |
| 105 | g.inner x (D.gradient f x) (D.gradient f x) - 2 * lambda * f x = C := by |
| 106 | have hfs := D.contMDiff_of_C2_gradient_soliton hf hsol |
| 107 | have hnorm : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ |
| 108 | (fun x => g.inner x (D.gradient f x) (D.gradient f x)) := by |
| 109 | intro x |
| 110 | have hgrad := D.contMDiffAt_gradient (hfs x) |
| 111 | simpa using (contMDiffAt_totalSpace.mp |
| 112 | (((g.contMDiff x).clm_bundle_apply hgrad).clm_bundle_apply hgrad)).2 |
| 113 | have hcont : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ |
| 114 | (fun x => D.scalarCurvature x + |
| 115 | g.inner x (D.gradient f x) (D.gradient f x) - 2 * lambda * f x) := |
| 116 | (D.contMDiff_scalarCurvature.add hnorm).sub (contMDiff_const.mul hfs) |
| 117 | apply Poincare.Manifold.exists_eq_const_of_mvfderiv_eq_zero |
| 118 | (fun x => (hcont x).mdifferentiableAt (by simp)) |
| 119 | intro x v |
| 120 | rw [mvfderiv_fun_sub |
| 121 | (g := fun y => D.scalarCurvature y + g.inner y (D.gradient f y) (D.gradient f y)) |
| 122 | (g' := fun y => 2 * lambda * f y) |
| 123 | (((D.contMDiff_scalarCurvature x).add (hnorm x)).mdifferentiableAt (by simp)) |
| 124 | (((contMDiffAt_const (c := 2 * lambda)).mul (hfs x)).mdifferentiableAt (by simp)), |
| 125 | mvfderiv_fun_add ((D.contMDiff_scalarCurvature x).mdifferentiableAt (by simp)) |
| 126 | ((hnorm x).mdifferentiableAt (by simp))] |
| 127 | simp only [sub_apply, add_apply, PoincareMT.mvfderiv_const_mul] |
| 128 | rw [D.mvfderiv_scalarCurvature_of_C2_gradient_soliton hD hf hsol, |
| 129 | D.mvfderiv_gradient_normSq_of_C2 (hf x)] |
| 130 | have hsym := (hD.2.2.2.1 x v (D.gradient f x) (D.gradient f x) v).2.2.2 |
| 131 | have heq := hsol x v (D.gradient f x) |
| 132 | rw [g.symm x v, D.inner_gradient] at heq |
| 133 | linarith only [heq, hsym] |
| 134 | |
| 135 | end PoincareMT.LeviCivitaData |
| 136 | |
| 137 | namespace PoincareMT.GradientShrinkingSolitonData |
| 138 | |
| 139 | variable {M : Type*} [TopologicalSpace M] |
| 140 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 141 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 142 | [SecondCountableTopology M] [ConnectedSpace M] |
| 143 | |
| 144 | /-- The scalar differential identity on the original three-dimensional datum. -/ |
| 145 | theorem mvfderiv_scalarCurvature_threeDimensional |
| 146 | (S : GradientShrinkingSolitonData 3 M) (hD : S.connection.CurvatureTensorCalculus) |
| 147 | (x : M) (v : TangentSpace (𝓡 3) x) : |
| 148 | mvfderiv (𝓡 3) S.connection.scalarCurvature x v = |
| 149 | 2 * S.connection.ricci x (S.connection.gradient S.potential x) v := |
| 150 | S.connection.mvfderiv_scalarCurvature_of_C2_gradient_soliton hD |
| 151 | S.potential_C2 S.soliton_equation x v |
| 152 | |
| 153 | /-- Hamilton conservation with the frozen normalization `Ric + Hess f = g/2`. -/ |
| 154 | theorem exists_hamilton_conservation_threeDimensional |
| 155 | (S : GradientShrinkingSolitonData 3 M) (hD : S.connection.CurvatureTensorCalculus) : |
| 156 | ∃ C : ℝ, ∀ x, S.connection.scalarCurvature x + |
| 157 | S.metric.inner x (S.connection.gradient S.potential x) |
| 158 | (S.connection.gradient S.potential x) - S.potential x = C := by |
| 159 | simpa using S.connection.exists_hamilton_conservation_of_C2_gradient_soliton hD |
| 160 | S.potential_C2 S.soliton_equation |
| 161 | |
| 162 | end PoincareMT.GradientShrinkingSolitonData |