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.Variation.Fields.FrozenFrame |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.BilinearFamily |
| 3 | import PoincareLib.Geometry.Riemannian.Tensor.Regularity |
| 4 | |
| 5 | /-! |
| 6 | # Metric and tensor forms in the selected local frame |
| 7 | |
| 8 | Pointwise multilinear witnesses give actual bilinear forms. Smoothness is |
| 9 | proved from their evaluations, so no smooth choice of witnesses is needed. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle BigOperators |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | noncomputable def tensorBilinear (g : RiemannianMetric n M) |
| 26 | (T : CovariantTensorEvaluation n M 2) (hT : IsSmoothCovariantTensor T) (q : M) : |
| 27 | TangentSpace (𝓡 n) q →L[ℝ] TangentSpace (𝓡 n) q →L[ℝ] ℝ := by |
| 28 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 29 | ⟨g.toRiemannianMetric⟩ |
| 30 | letI : FiniteDimensional ℝ (TangentSpace (𝓡 n) q) := |
| 31 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 32 | (TangentSpace (𝓡 n) : M → Type _) q |
| 33 | exact bilinearOfMultilinear (hT.1 q).choose |
| 34 | |
| 35 | theorem tensorBilinear_apply (g : RiemannianMetric n M) |
| 36 | (T : CovariantTensorEvaluation n M 2) (hT : IsSmoothCovariantTensor T) (q : M) |
| 37 | (v w : TangentSpace (𝓡 n) q) : tensorBilinear g T hT q v w = T q ![v, w] := by |
| 38 | simp only [tensorBilinear, bilinearOfMultilinear_apply] |
| 39 | exact ((hT.1 q).choose_spec ![v, w]).symm |
| 40 | |
| 41 | noncomputable def frameMetricForm (g : RiemannianMetric n M) (p q : M) : |
| 42 | TangentSpace (𝓡 n) p →L[ℝ] TangentSpace (𝓡 n) p →L[ℝ] ℝ := by |
| 43 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 44 | ⟨g.toRiemannianMetric⟩ |
| 45 | exact (g.inner q).bilinearComp (extensionMap p q) (extensionMap p q) |
| 46 | |
| 47 | theorem frameMetricForm_apply (g : RiemannianMetric n M) (p q : M) |
| 48 | (v w : TangentSpace (𝓡 n) p) : |
| 49 | frameMetricForm g p q v w = g.inner q (extensionMap p q v) (extensionMap p q w) := rfl |
| 50 | |
| 51 | theorem frameMetricForm_self (g : RiemannianMetric n M) (p : M) : |
| 52 | frameMetricForm g p p = g.inner p := by |
| 53 | ext v w |
| 54 | simp only [frameMetricForm_apply, extensionMap_self, ContinuousLinearMap.id_apply] |
| 55 | |
| 56 | noncomputable def frameTensorForm (g : RiemannianMetric n M) |
| 57 | (T : CovariantTensorEvaluation n M 2) (hT : IsSmoothCovariantTensor T) (p q : M) : |
| 58 | TangentSpace (𝓡 n) p →L[ℝ] TangentSpace (𝓡 n) p →L[ℝ] ℝ := by |
| 59 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 60 | ⟨g.toRiemannianMetric⟩ |
| 61 | exact (tensorBilinear g T hT q).bilinearComp (extensionMap p q) (extensionMap p q) |
| 62 | |
| 63 | theorem frameTensorForm_apply (g : RiemannianMetric n M) |
| 64 | (T : CovariantTensorEvaluation n M 2) (hT : IsSmoothCovariantTensor T) (p q : M) |
| 65 | (v w : TangentSpace (𝓡 n) p) : |
| 66 | frameTensorForm g T hT p q v w = T q ![extensionMap p q v, extensionMap p q w] := |
| 67 | tensorBilinear_apply g T hT q _ _ |
| 68 | |
| 69 | theorem frameTensorForm_self (g : RiemannianMetric n M) |
| 70 | (T : CovariantTensorEvaluation n M 2) (hT : IsSmoothCovariantTensor T) (p : M) : |
| 71 | frameTensorForm g T hT p p = tensorBilinear g T hT p := by |
| 72 | ext v w |
| 73 | simp only [frameTensorForm_apply, tensorBilinear_apply, extensionMap_self, |
| 74 | ContinuousLinearMap.id_apply] |
| 75 | |
| 76 | theorem frameMetricForm_smooth (g : RiemannianMetric n M) (p : M) : |
| 77 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 78 | ⟨g.toRiemannianMetric⟩ |
| 79 | ContMDiffOn (𝓡 n) (𝓘(ℝ, TangentSpace (𝓡 n) p →L[ℝ] |
| 80 | TangentSpace (𝓡 n) p →L[ℝ] ℝ)) ∞ (frameMetricForm g p) |
| 81 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p).baseSet := by |
| 82 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 83 | ⟨g.toRiemannianMetric⟩ |
| 84 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) p) := |
| 85 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 86 | (TangentSpace (𝓡 n) : M → Type _) p |
| 87 | apply contMDiffOn_bilinear_iff.mpr |
| 88 | intro v w |
| 89 | have h := g.contMDiff.contMDiffOn.clm_bundle_apply₂ |
| 90 | (extensionMap_smooth p v) (extensionMap_smooth p w) |
| 91 | intro q hq |
| 92 | exact (Bundle.contMDiffWithinAt_totalSpace.mp (h q hq)).2 |
| 93 | |
| 94 | theorem frameTensorForm_smooth (g : RiemannianMetric n M) |
| 95 | (T : CovariantTensorEvaluation n M 2) (hT : IsSmoothCovariantTensor T) (p : M) : |
| 96 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 97 | ⟨g.toRiemannianMetric⟩ |
| 98 | ContMDiffOn (𝓡 n) (𝓘(ℝ, TangentSpace (𝓡 n) p →L[ℝ] |
| 99 | TangentSpace (𝓡 n) p →L[ℝ] ℝ)) ∞ (frameTensorForm g T hT p) |
| 100 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p).baseSet := by |
| 101 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 102 | ⟨g.toRiemannianMetric⟩ |
| 103 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) p) := |
| 104 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) |
| 105 | (TangentSpace (𝓡 n) : M → Type _) p |
| 106 | apply contMDiffOn_bilinear_iff.mpr |
| 107 | intro v w |
| 108 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) p |
| 109 | have h := hT.2 e.baseSet e.open_baseSet |
| 110 | (fun i q ↦ extensionMap p q (![v, w] i)) (fun i ↦ extensionMap_smooth p _) |
| 111 | have heq : (fun q ↦ frameTensorForm g T hT p q v w) = |
| 112 | (fun q ↦ T q (fun i ↦ extensionMap p q (![v, w] i))) := by |
| 113 | funext q |
| 114 | rw [frameTensorForm_apply] |
| 115 | congr 1 |
| 116 | funext i |
| 117 | fin_cases i <;> rfl |
| 118 | rw [heq] |
| 119 | exact h |
| 120 | |
| 121 | theorem frameMetricForm_derivative {g : RiemannianMetric n M} |
| 122 | (D : LeviCivitaData g) (p : M) (X v w : TangentSpace (𝓡 n) p) : |
| 123 | mvfderiv (𝓡 n) (fun q ↦ frameMetricForm g p q v w) p X = |
| 124 | g.inner p (frozenConnectionEndomorphism D p X v) w + |
| 125 | g.inner p v (frozenConnectionEndomorphism D p X w) := |
| 126 | extensionMetric_derivative D p X v w |
| 127 | |
| 128 | theorem frameTensorForm_derivative {g : RiemannianMetric n M} |
| 129 | (D : LeviCivitaData g) (T : CovariantTensorEvaluation n M 2) |
| 130 | (hT : IsSmoothCovariantTensor T) (p : M) (X v w : TangentSpace (𝓡 n) p) : |
| 131 | mvfderiv (𝓡 n) (fun q ↦ frameTensorForm g T hT p q v w) p X = |
| 132 | D.covariantTensorDerivative T p ![X, v, w] + |
| 133 | T p ![frozenConnectionEndomorphism D p X v, w] + |
| 134 | T p ![v, frozenConnectionEndomorphism D p X w] := by |
| 135 | have h := extensionTensor_derivative D T p X ![v, w] |
| 136 | have heq : (fun q ↦ T q (fun i ↦ extensionMap p q (![v, w] i))) = |
| 137 | (fun q ↦ frameTensorForm g T hT p q v w) := by |
| 138 | funext q |
| 139 | rw [frameTensorForm_apply] |
| 140 | congr 1 |
| 141 | funext i |
| 142 | fin_cases i <;> rfl |
| 143 | rw [heq] at h |
| 144 | have hzero (a : TangentSpace (𝓡 n) p) : Function.update ![v, w] (0 : Fin 2) a = ![a, w] := by |
| 145 | funext i |
| 146 | fin_cases i <;> simp |
| 147 | have hone (a : TangentSpace (𝓡 n) p) : Function.update ![v, w] (1 : Fin 2) a = ![v, a] := by |
| 148 | funext i |
| 149 | fin_cases i <;> simp |
| 150 | simpa [Fin.sum_univ_two, hzero, hone, add_assoc] using h |
| 151 | |
| 152 | end PoincareMT.ReducedLength |