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.ReducedGeometry.ReducedLength.Tensor.FrameForms |
| 2 | |
| 3 | /-! |
| 4 | # Curvature slices in the frozen local frame |
| 5 | |
| 6 | The two remaining slots are the contracted second and fourth curvature |
| 7 | inputs. Smoothness is local on the actual frame domain. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option maxSynthPendingDepth 3 |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle BigOperators |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.ReducedLength |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [IsManifold (𝓡 n) ∞ M] {g : RiemannianMetric n M} |
| 22 | |
| 23 | noncomputable def curvatureSliceBilinear (D : LeviCivitaData g) |
| 24 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (q : M) |
| 25 | (v w : TangentSpace (𝓡 n) q) : |
| 26 | TangentSpace (𝓡 n) q →L[ℝ] TangentSpace (𝓡 n) q →L[ℝ] ℝ := by |
| 27 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 28 | ⟨g.toRiemannianMetric⟩ |
| 29 | letI : FiniteDimensional ℝ (TangentSpace (𝓡 n) q) := |
| 30 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 31 | (TangentSpace (𝓡 n) : M → Type _) q |
| 32 | exact bilinearOfMultilinear (((hR.1 q).choose.curryLeft v).curryMid 1 w) |
| 33 | |
| 34 | theorem curvatureSliceBilinear_apply (D : LeviCivitaData g) |
| 35 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (q : M) |
| 36 | (v w a b : TangentSpace (𝓡 n) q) : |
| 37 | curvatureSliceBilinear D hR q v w a b = D.curvatureTensor q v a w b := by |
| 38 | simp only [curvatureSliceBilinear, bilinearOfMultilinear_apply] |
| 39 | change (hR.1 q).choose (Fin.cons v ((1 : Fin 3).insertNth w ![a, b])) = _ |
| 40 | rw [← (hR.1 q).choose_spec] |
| 41 | rfl |
| 42 | |
| 43 | noncomputable def frameCurvatureSlice (D : LeviCivitaData g) |
| 44 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (p : M) |
| 45 | (v w : TangentSpace (𝓡 n) p) (q : M) : |
| 46 | TangentSpace (𝓡 n) p →L[ℝ] TangentSpace (𝓡 n) p →L[ℝ] ℝ := by |
| 47 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 48 | ⟨g.toRiemannianMetric⟩ |
| 49 | exact (curvatureSliceBilinear D hR q (extensionMap p q v) (extensionMap p q w)).bilinearComp |
| 50 | (extensionMap p q) (extensionMap p q) |
| 51 | |
| 52 | theorem frameCurvatureSlice_apply (D : LeviCivitaData g) |
| 53 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (p : M) |
| 54 | (v w : TangentSpace (𝓡 n) p) (q : M) (a b : TangentSpace (𝓡 n) p) : |
| 55 | frameCurvatureSlice D hR p v w q a b = |
| 56 | D.curvatureTensor q (extensionMap p q v) (extensionMap p q a) |
| 57 | (extensionMap p q w) (extensionMap p q b) := |
| 58 | curvatureSliceBilinear_apply D hR q _ _ _ _ |
| 59 | |
| 60 | theorem frameCurvatureSlice_self (D : LeviCivitaData g) |
| 61 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (p : M) |
| 62 | (v w : TangentSpace (𝓡 n) p) : |
| 63 | frameCurvatureSlice D hR p v w p = curvatureSliceBilinear D hR p v w := by |
| 64 | ext a b |
| 65 | simp only [frameCurvatureSlice_apply, curvatureSliceBilinear_apply, extensionMap_self, |
| 66 | ContinuousLinearMap.id_apply] |
| 67 | |
| 68 | theorem frameCurvatureSlice_smooth (D : LeviCivitaData g) |
| 69 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (p : M) |
| 70 | (v w : TangentSpace (𝓡 n) p) : |
| 71 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 72 | ⟨g.toRiemannianMetric⟩ |
| 73 | ContMDiffOn (𝓡 n) (𝓘(ℝ, TangentSpace (𝓡 n) p →L[ℝ] |
| 74 | TangentSpace (𝓡 n) p →L[ℝ] ℝ)) ∞ (frameCurvatureSlice D hR p v w) |
| 75 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p).baseSet := by |
| 76 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 77 | ⟨g.toRiemannianMetric⟩ |
| 78 | letI : FiniteDimensional ℝ (TangentSpace (𝓡 n) p) := |
| 79 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 80 | (TangentSpace (𝓡 n) : M → Type _) p |
| 81 | apply contMDiffOn_bilinear_iff.mpr |
| 82 | intro a b |
| 83 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p |
| 84 | have h := hR.2 e.baseSet e.open_baseSet |
| 85 | (fun i q ↦ extensionMap p q (![v, a, w, b] i)) (fun i ↦ extensionMap_smooth p _) |
| 86 | simpa [frameCurvatureSlice_apply, LeviCivitaData.riemannEvaluation, e] using h |
| 87 | |
| 88 | theorem frameCurvatureSlice_derivative (D : LeviCivitaData g) |
| 89 | (hR : IsSmoothCovariantTensor D.riemannEvaluation) (p : M) |
| 90 | (X v w a b : TangentSpace (𝓡 n) p) : |
| 91 | mvfderiv (𝓡 n) (fun q ↦ frameCurvatureSlice D hR p v w q a b) p X = |
| 92 | D.covariantTensorDerivative D.riemannEvaluation p ![X, v, a, w, b] + |
| 93 | D.curvatureTensor p (frozenConnectionEndomorphism D p X v) a w b + |
| 94 | D.curvatureTensor p v (frozenConnectionEndomorphism D p X a) w b + |
| 95 | D.curvatureTensor p v a (frozenConnectionEndomorphism D p X w) b + |
| 96 | D.curvatureTensor p v a w (frozenConnectionEndomorphism D p X b) := by |
| 97 | have h := extensionTensor_derivative D D.riemannEvaluation p X ![v, a, w, b] |
| 98 | have hzero (z : TangentSpace (𝓡 n) p) : |
| 99 | Function.update ![v, a, w, b] (0 : Fin 4) z = ![z, a, w, b] := by |
| 100 | funext i |
| 101 | fin_cases i <;> simp |
| 102 | have hone (z : TangentSpace (𝓡 n) p) : |
| 103 | Function.update ![v, a, w, b] (1 : Fin 4) z = ![v, z, w, b] := by |
| 104 | funext i |
| 105 | fin_cases i <;> simp |
| 106 | have htwo (z : TangentSpace (𝓡 n) p) : |
| 107 | Function.update ![v, a, w, b] (2 : Fin 4) z = ![v, a, z, b] := by |
| 108 | funext i |
| 109 | fin_cases i <;> simp |
| 110 | have hthree (z : TangentSpace (𝓡 n) p) : |
| 111 | Function.update ![v, a, w, b] (3 : Fin 4) z = ![v, a, w, z] := by |
| 112 | funext i |
| 113 | fin_cases i <;> simp |
| 114 | simpa [frameCurvatureSlice_apply, Fin.sum_univ_succ, hzero, hone, htwo, hthree, |
| 115 | LeviCivitaData.riemannEvaluation, add_assoc] using h |
| 116 | |
| 117 | end PoincareMT.ReducedLength |