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.RicciFlow.ReducedGeometry.ReducedLength.Tensor.FrameForms |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.BasisContractions |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.SourceNames.CurvatureCalculus |
| 5 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryInvariants |
| 6 | import PoincareLib.Geometry.Riemannian.ScalarOperators |
| 7 | |
| 8 | /-! |
| 9 | # Ricci norm transport for generalized scalar evolution |
| 10 | |
| 11 | The actual full Ricci contraction is independent of the selected |
| 12 | orthonormal basis and is preserved by the slice local isometry. |
| 13 | This supplies the quadratic term in Morgan-Tian Theorem 3.13, |
| 14 | equation (3.7), p. 41, as used in Section 6.5, pp. 126-127. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | -- The transported orthonormal bases use the selected metric fiber instances. |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set |
| 22 | open scoped Manifold ContDiff Bundle BigOperators |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 27 | normedSpaceTangentSpaceVectorSpace |
| 28 | |
| 29 | variable {n : ℕ} {M N : Type*} [TopologicalSpace M] [TopologicalSpace N] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 32 | [IsManifold (𝓡 n) ∞ M] [IsManifold (𝓡 n) ∞ N] |
| 33 | {g : RiemannianMetric n M} {h : RiemannianMetric n N} |
| 34 | |
| 35 | /-- The retained Ricci norm is the full squared contraction in any |
| 36 | metric orthonormal basis, Theorem 3.13, equation (3.7), p. 41. -/ |
| 37 | theorem ricciNormSq_eq_orthonormal_sum (D : LeviCivitaData g) (x : M) |
| 38 | {ι : Type*} [Fintype ι] : |
| 39 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨g.toRiemannianMetric⟩ |
| 41 | ∀ e : OrthonormalBasis ι ℝ (TangentSpace (𝓡 n) x), |
| 42 | D.ricciNormSq x = ∑ i, ∑ j, (D.ricci x (e i) (e j)) ^ 2 := by |
| 43 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 44 | ⟨g.toRiemannianMetric⟩ |
| 45 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) x) := |
| 46 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 47 | (TangentSpace (𝓡 n) : M → Type _) x |
| 48 | intro e |
| 49 | have hb := Proofs.M09.bilinear_square_basis_eq |
| 50 | (Proofs.M09.tensorBilinear g D.ricciEvaluation |
| 51 | D.normalization_curvatureTensorCalculus.2.1 x) (g.orthonormalBasis x) e |
| 52 | simpa only [Proofs.M09.tensorBilinear_apply, LeviCivitaData.ricciEvaluation, |
| 53 | Matrix.cons_val_zero, Matrix.cons_val_one, LeviCivitaData.ricciNormSq] using hb |
| 54 | |
| 55 | /-- The actual Ricci squared norm is preserved by a smooth local |
| 56 | isometry, Theorem 3.13, equation (3.7), p. 41, and Definition 3.38, p. 61. -/ |
| 57 | theorem ricciNormSq_eq_of_local_isometry |
| 58 | (D : LeviCivitaData g) (D' : LeviCivitaData h) |
| 59 | {f : M → N} {U : Set M} (hU : IsOpen U) |
| 60 | (hf : ContMDiffOn (𝓡 n) (𝓡 n) ∞ f U) |
| 61 | (hmetric : ∀ y ∈ U, ∀ a b : TangentSpace (𝓡 n) y, |
| 62 | g.inner y a b = h.inner (f y) (mfderiv (𝓡 n) (𝓡 n) f y a) |
| 63 | (mfderiv (𝓡 n) (𝓡 n) f y b)) |
| 64 | {x : M} (hx : x ∈ U) : D.ricciNormSq x = D'.ricciNormSq (f x) := by |
| 65 | let e : TangentSpace (𝓡 n) x ≃ₗ[ℝ] TangentSpace (𝓡 n) (f x) := |
| 66 | LinearEquiv.ofBijective (mfderiv (𝓡 n) (𝓡 n) f x).toLinearMap |
| 67 | (g.mfderiv_bijective_of_pullback_eq h x (fun a b => (hmetric x hx a b).symm)) |
| 68 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 69 | ⟨g.toRiemannianMetric⟩ |
| 70 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : N → Type _) := |
| 71 | ⟨h.toRiemannianMetric⟩ |
| 72 | let e' := e.isometryOfInner (fun a b => (hmetric x hx a b).symm) |
| 73 | rw [ricciNormSq_eq_orthonormal_sum D' (f x) ((g.orthonormalBasis x).map e')] |
| 74 | change (∑ i, ∑ j, (D.ricci x (g.orthonormalBasis x i) |
| 75 | (g.orthonormalBasis x j)) ^ 2) = |
| 76 | ∑ i, ∑ j, (D'.ricci (f x) (e (g.orthonormalBasis x i)) |
| 77 | (e (g.orthonormalBasis x j))) ^ 2 |
| 78 | apply Finset.sum_congr rfl |
| 79 | intro i _ |
| 80 | apply Finset.sum_congr rfl |
| 81 | intro j _ |
| 82 | exact congrArg (fun r : ℝ => r ^ 2) |
| 83 | (D.ricci_eq_of_local_isometry D' hU hf hmetric hx _ _) |
| 84 | |
| 85 | end PoincareMT.M14 |