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.Curvature.Evolution.Tensor.FlowTensorRegularity |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Evolution.Scalar.SpatialCoefficients |
| 3 | import PoincareLib.Geometry.RicciFlow.Curvature.Calculus.Identities.RicciCommutator |
| 4 | import Mathlib.LinearAlgebra.Multilinear.Curry |
| 5 | |
| 6 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/RicciEvolutionCoefficients.lean`, |
| 7 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 8 | `references/ricci-flow/mapher/curvature/`. -/ |
| 9 | |
| 10 | /-! |
| 11 | # Continuity of the actual Ricci evolution coefficients |
| 12 | |
| 13 | Three partial evaluations of the second Ricci derivative give the Laplacian |
| 14 | and the traced commutator. Their metric traces are continuous on the entire |
| 15 | flow interval, including its included endpoints. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle BigOperators |
| 21 | open Set Topology Filter Function |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.RicciFlowAnalysis |
| 26 | |
| 27 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | {J : Set ℝ} {U : Set M} |
| 30 | |
| 31 | set_option maxHeartbeats 1600000 in |
| 32 | -- The traced curvature and reaction expressions on local fields need extra elaboration. |
| 33 | set_option backward.isDefEq.respectTransparency false in |
| 34 | theorem continuousOn_flow_ricciEvolutionRHS_onFields (F : RicciFlow n M J) |
| 35 | (hU : IsOpen U) {X Y : (y : M) → TangentSpace (𝓡 n) y} |
| 36 | (hX : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X) U) |
| 37 | (hY : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Y) U) : |
| 38 | ContinuousOn |
| 39 | (fun p : ℝ × M ↦ |
| 40 | (F.connection p.1).tensorLaplacian (F.connection p.1).ricciEvaluation |
| 41 | p.2 ![X p.2, Y p.2] + |
| 42 | (F.connection p.1).ricciReaction p.2 (X p.2) (Y p.2)) (J ×ˢ U) := by |
| 43 | classical |
| 44 | let H : ℝ → CovariantTensorEvaluation n M 4 := fun s ↦ |
| 45 | (F.connection s).iteratedCovariantTensorDerivative (F.connection s).ricciEvaluation 2 |
| 46 | have hH (s : ℝ) : IsSmoothCovariantTensor (H s) := |
| 47 | isSmoothCovariantTensor_covariantTensorDerivative (F.connection s) |
| 48 | (isSmoothCovariantTensor_covariantTensorDerivative (F.connection s) |
| 49 | (isSmoothCovariantTensor_ricciEvaluation (F.connection s))) |
| 50 | have hjoint {V : Set M} (hV : IsOpen V) |
| 51 | (Z : Fin 4 → (y : M) → TangentSpace (𝓡 n) y) |
| 52 | (hZ : ∀ i, ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) |
| 53 | ∞ (T% (Z i)) V) : |
| 54 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ |
| 55 | (fun p : ℝ × M ↦ H p.1 p.2 (fun i ↦ Z i p.2)) (J ×ˢ V) := |
| 56 | contMDiffOn_flow_iteratedCovariantTensorDerivative F |
| 57 | (fun s ↦ isSmoothCovariantTensor_ricciEvaluation (F.connection s)) |
| 58 | (fun W hW Z hZ ↦ contMDiffOn_flow_ricciEvaluation F hW hZ) 2 hV hZ |
| 59 | have hfour {V : Set M} (hV : IsOpen V) |
| 60 | (A B C D : (y : M) → TangentSpace (𝓡 n) y) |
| 61 | (hA : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% A) V) |
| 62 | (hB : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% B) V) |
| 63 | (hC : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% C) V) |
| 64 | (hD : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% D) V) : |
| 65 | ContinuousOn (fun p : ℝ × M ↦ H p.1 p.2 ![A p.2, B p.2, C p.2, D p.2]) |
| 66 | (J ×ˢ V) := by |
| 67 | have hZ : ∀ i : Fin 4, |
| 68 | ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) |
| 69 | ∞ (T% (![A, B, C, D] i)) V := by |
| 70 | intro i |
| 71 | fin_cases i |
| 72 | · exact hA |
| 73 | · exact hB |
| 74 | · exact hC |
| 75 | · exact hD |
| 76 | apply (hjoint hV ![A, B, C, D] hZ).continuousOn.congr |
| 77 | intro p hp |
| 78 | apply congrArg (H p.1 p.2) |
| 79 | funext i |
| 80 | fin_cases i <;> rfl |
| 81 | choose A hA using fun p : ℝ × M ↦ (hH p.1).1 p.2 |
| 82 | let S : Fin 3 → (p : ℝ × M) → |
| 83 | MultilinearMap ℝ (fun _ : Fin 2 ↦ TangentSpace (𝓡 n) p.2) ℝ := |
| 84 | fun i p ↦ (((A p).curryMid (Fin.last 3)) (Y p.2)).curryMid i (X p.2) |
| 85 | have hS2 (p : ℝ × M) (r s : TangentSpace (𝓡 n) p.2) : |
| 86 | S 2 p ![r, s] = H p.1 p.2 ![r, s, X p.2, Y p.2] := by |
| 87 | calc |
| 88 | _ = A p ![r, s, X p.2, Y p.2] := by |
| 89 | apply congrArg (A p) |
| 90 | funext i |
| 91 | fin_cases i <;> rfl |
| 92 | _ = _ := (hA p _).symm |
| 93 | have hS0 (p : ℝ × M) (r s : TangentSpace (𝓡 n) p.2) : |
| 94 | S 0 p ![r, s] = H p.1 p.2 ![X p.2, r, s, Y p.2] := by |
| 95 | calc |
| 96 | _ = A p ![X p.2, r, s, Y p.2] := by |
| 97 | apply congrArg (A p) |
| 98 | funext i |
| 99 | fin_cases i <;> rfl |
| 100 | _ = _ := (hA p _).symm |
| 101 | have hS1 (p : ℝ × M) (r s : TangentSpace (𝓡 n) p.2) : |
| 102 | S 1 p ![r, s] = H p.1 p.2 ![r, X p.2, s, Y p.2] := by |
| 103 | calc |
| 104 | _ = A p ![r, X p.2, s, Y p.2] := by |
| 105 | apply congrArg (A p) |
| 106 | funext i |
| 107 | fin_cases i <;> rfl |
| 108 | _ = _ := (hA p _).symm |
| 109 | let D : Fin 3 → ℝ × M → ℝ := fun j p ↦ ∑ i, S j p |
| 110 | ![(F.metric p.1).orthonormalBasis p.2 i, (F.metric p.1).orthonormalBasis p.2 i] |
| 111 | have hD (j : Fin 3) : ContinuousOn (D j) (J ×ˢ U) := by |
| 112 | apply continuousOn_flow_tensorTrace F hU (S j) |
| 113 | intro V hV hVU R Q hR hQ |
| 114 | fin_cases j |
| 115 | · apply (hfour hV X R Q Y (hX.mono hVU) hR hQ (hY.mono hVU)).congr |
| 116 | intro p hp |
| 117 | exact hS0 p (R p.2) (Q p.2) |
| 118 | · apply (hfour hV R X Q Y hR (hX.mono hVU) hQ (hY.mono hVU)).congr |
| 119 | intro p hp |
| 120 | exact hS1 p (R p.2) (Q p.2) |
| 121 | · apply (hfour hV R Q X Y hR hQ (hX.mono hVU) (hY.mono hVU)).congr |
| 122 | intro p hp |
| 123 | exact hS2 p (R p.2) (Q p.2) |
| 124 | have hlap (p : ℝ × M) : |
| 125 | (F.connection p.1).tensorLaplacian (F.connection p.1).ricciEvaluation |
| 126 | p.2 ![X p.2, Y p.2] = D 2 p := by |
| 127 | simp only [LeviCivitaData.tensorLaplacian, D, hS2] |
| 128 | apply Finset.sum_congr rfl |
| 129 | intro i hi |
| 130 | apply congrArg (H p.1 p.2) |
| 131 | funext j |
| 132 | fin_cases j <;> rfl |
| 133 | have hreact (p : ℝ × M) : |
| 134 | (F.connection p.1).ricciReaction p.2 (X p.2) (Y p.2) = |
| 135 | 2 * (D 0 p - D 1 p) := by |
| 136 | simpa only [D, hS0, hS1, H, Finset.sum_sub_distrib] using |
| 137 | (ricci_second_derivative_commutator_trace (F.connection p.1) p.2 |
| 138 | (X p.2) (Y p.2)).symm |
| 139 | have hc : ContinuousOn (fun p ↦ D 2 p + 2 * (D 0 p - D 1 p)) (J ×ˢ U) := |
| 140 | (hD 2).add ((continuousOn_const (c := (2 : ℝ))).mul ((hD 0).sub (hD 1))) |
| 141 | apply hc.congr |
| 142 | intro p hp |
| 143 | exact congrArg₂ (fun a b : ℝ ↦ a + b) (hlap p) (hreact p) |
| 144 | |
| 145 | private theorem continuousOn_fixedFiberInputs {E : M → Type*} |
| 146 | (G : ℝ → (y : M) → E y → E y → ℝ) (X Y : (y : M) → E y) |
| 147 | (hG : ContinuousOn (fun p : ℝ × M ↦ G p.1 p.2 (X p.2) (Y p.2)) (J ×ˢ U)) |
| 148 | (x : M) (hx : x ∈ U) (u v : E x) (hXu : X x = u) (hYv : Y x = v) : |
| 149 | ContinuousOn (fun s ↦ G s x u v) J := by |
| 150 | have hslice : ContinuousOn (fun s ↦ G s x (X x) (Y x)) J := |
| 151 | hG.comp (continuous_id.prodMk continuous_const).continuousOn |
| 152 | (show MapsTo (fun s : ℝ ↦ (s, x)) J (J ×ˢ U) from fun _ hs ↦ ⟨hs, hx⟩) |
| 153 | simpa only [hXu, hYv] using hslice |
| 154 | |
| 155 | set_option maxHeartbeats 1000000 in |
| 156 | -- The local-field extension and fixed-fiber conversion need extra elaboration. |
| 157 | theorem continuousOn_ricciEvolutionRHS_timeSlice (F : RicciFlow n M J) |
| 158 | (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 159 | ContinuousOn |
| 160 | (fun s : ℝ ↦ |
| 161 | (F.connection s).tensorLaplacian (F.connection s).ricciEvaluation x ![u, v] + |
| 162 | (F.connection s).ricciReaction x u v) J := by |
| 163 | let t := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 164 | (TangentSpace (𝓡 n) : M → Type _) x |
| 165 | have hx : x ∈ t.baseSet := FiberBundle.mem_baseSet_trivializationAt' x |
| 166 | let X := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) u |
| 167 | let Y := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v |
| 168 | have hXu : X x = u := FiberBundle.extend_apply_self _ _ |
| 169 | have hYv : Y x = v := FiberBundle.extend_apply_self _ _ |
| 170 | have hjoint := continuousOn_flow_ricciEvolutionRHS_onFields F t.open_baseSet (X := X) (Y := Y) |
| 171 | (contMDiffOn_extend_baseSet u) (contMDiffOn_extend_baseSet v) |
| 172 | exact continuousOn_fixedFiberInputs |
| 173 | (fun s y a b ↦ |
| 174 | (F.connection s).tensorLaplacian (F.connection s).ricciEvaluation y ![a, b] + |
| 175 | (F.connection s).ricciReaction y a b) X Y hjoint x hx u v hXu hYv |
| 176 | |
| 177 | end PoincareMT.RicciFlowAnalysis |
| 178 |