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.Generalized.ReducedGeometry.SourceNames.ReducedLength |
| 2 | import PoincareLib.Geometry.Riemannian.ScalarOperators.Gradient |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.BasisContractions |
| 4 | |
| 5 | /-! |
| 6 | # Scalar Hessians and their orthonormal traces |
| 7 | |
| 8 | M05 identifies the Hessian with the metric pairing of the gradient's |
| 9 | covariant derivative. M09's generic trace identity then applies to |
| 10 | every orthonormal basis of the actual selected metric. |
| 11 | Morgan-Tian Lemma 6.40 and Proposition 6.43, pp. 126-128. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- The algebraic tangent fibers have the ambient model coordinates before renorming. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle BigOperators |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {g : RiemannianMetric n M} |
| 27 | |
| 28 | /-- Local scalar smoothness gives an actual bilinear Hessian for the |
| 29 | chosen connection, Lemma 6.40, pp. 126-127. -/ |
| 30 | theorem hessian_exists_bilinear (D : LeviCivitaData g) (f : M → ℝ) (x : M) |
| 31 | (hf : ContMDiffAt (𝓡 n) (𝓘(ℝ, ℝ)) ∞ f x) : |
| 32 | ∃ B : EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ, |
| 33 | ∀ v w : TangentSpace (𝓡 n) x, D.hessian f x v w = B v w := by |
| 34 | refine ⟨(g.inner x).comp (D.connection (D.gradient f) x), ?_⟩ |
| 35 | intro v w |
| 36 | exact D.hessian_eq_inner_connection_gradient hf v w |
| 37 | |
| 38 | /-- The actual selected-slice Laplacian is the Hessian trace in every |
| 39 | orthonormal basis, including in dimension zero, Proposition 6.43, p. 128. -/ |
| 40 | theorem laplacian_eq_orthonormal_hessian_trace (D : LeviCivitaData g) |
| 41 | (f : M → ℝ) (x : M) (hf : ContMDiffAt (𝓡 n) (𝓘(ℝ, ℝ)) ∞ f x) |
| 42 | {ι : Type*} [Fintype ι] : |
| 43 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 44 | ⟨g.toRiemannianMetric⟩ |
| 45 | ∀ b : OrthonormalBasis ι ℝ (TangentSpace (𝓡 n) x), |
| 46 | D.laplacian f x = ∑ i, D.hessian f x (b i) (b i) := by |
| 47 | obtain ⟨H, hH⟩ := hessian_exists_bilinear D f x hf |
| 48 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 49 | ⟨g.toRiemannianMetric⟩ |
| 50 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) x) := |
| 51 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 52 | (TangentSpace (𝓡 n) : M → Type _) x |
| 53 | let L : TangentSpace (𝓡 n) x →ₗ[ℝ] TangentSpace (𝓡 n) x →ₗ[ℝ] ℝ := { |
| 54 | toFun := fun v => (H v).toLinearMap |
| 55 | map_add' := by |
| 56 | intro v w |
| 57 | ext z |
| 58 | exact congrArg (fun A : EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ => A z) (H.map_add v w) |
| 59 | map_smul' := by |
| 60 | intro c v |
| 61 | ext z |
| 62 | exact congrArg (fun A : EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ => A z) (H.map_smul c v) } |
| 63 | let B : TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x →L[ℝ] ℝ := |
| 64 | ((LinearMap.toContinuousLinearMap : (TangentSpace (𝓡 n) x →ₗ[ℝ] ℝ) ≃ₗ[ℝ] |
| 65 | (TangentSpace (𝓡 n) x →L[ℝ] ℝ)).toLinearMap.comp L).toContinuousLinearMap |
| 66 | intro b |
| 67 | have h := Proofs.M09.bilinear_trace_basis_eq B (g.orthonormalBasis x) b |
| 68 | change (∑ i, H (g.orthonormalBasis x i) (g.orthonormalBasis x i)) = |
| 69 | ∑ i, H (b i) (b i) at h |
| 70 | change (∑ i, D.hessian f x (g.orthonormalBasis x i) (g.orthonormalBasis x i)) = _ |
| 71 | exact (Finset.sum_congr rfl (fun i _ => hH _ _)).trans |
| 72 | (h.trans (Finset.sum_congr rfl (fun i _ => (hH _ _).symm))) |
| 73 | |
| 74 | end PoincareMT.M14 |