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.Calculus.Tensors.RiemannRegularity |
| 3 | |
| 4 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/FlowRiemannRegularity.lean`, |
| 5 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 6 | `references/ricci-flow/mapher/curvature/`. -/ |
| 7 | |
| 8 | /-! |
| 9 | # Joint regularity of actual curvature evaluations |
| 10 | |
| 11 | Scalar connection pairings and metric compatibility express the curvature |
| 12 | commutator by smooth scalar functions on the entire flow interval. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | open Set Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.RicciFlowAnalysis |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {J : Set ℝ} |
| 27 | |
| 28 | set_option maxHeartbeats 2000000 in |
| 29 | -- The curvature expansion through spacetime connection coefficients needs extra elaboration. |
| 30 | set_option backward.isDefEq.respectTransparency false in |
| 31 | theorem contMDiffOn_flow_riemannEvaluation (F : RicciFlow n M J) |
| 32 | {U : Set M} (hU : IsOpen U) |
| 33 | (X : Fin 4 → (x : M) → TangentSpace (𝓡 n) x) |
| 34 | (hX : ∀ i, ContMDiffOn (𝓡 n) |
| 35 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% (X i)) U) : |
| 36 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ |
| 37 | (fun p : ℝ × M ↦ (F.connection p.1).riemannEvaluation p.2 (fun i ↦ X i p.2)) |
| 38 | (J ×ˢ U) := by |
| 39 | let C (s : ℝ) (i j : Fin 4) := fun y ↦ (F.connection s).connection (X j) y (X i y) |
| 40 | let P (i j k : Fin 4) : ℝ × M → ℝ := fun p ↦ |
| 41 | (F.metric p.1).inner p.2 (C p.1 i j p.2) (X k p.2) |
| 42 | have hPair (i j k : Fin 4) : |
| 43 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ (P i j k) (J ×ˢ U) := |
| 44 | contMDiffOn_flow_connection_pairing F hU (hX i) (hX j) (hX k) |
| 45 | have hCross (i j k l : Fin 4) : |
| 46 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) 𝓘(ℝ, ℝ) ∞ |
| 47 | (fun p : ℝ × M ↦ (F.metric p.1).inner p.2 |
| 48 | (C p.1 i j p.2) (C p.1 k l p.2)) (J ×ˢ U) := by |
| 49 | let L : (p : ℝ × M) → TangentSpace (𝓡 n) p.2 →L[ℝ] ℝ := |
| 50 | fun p ↦ (F.metric p.1).inner p.2 (C p.1 i j p.2) |
| 51 | apply contMDiffOn_flow_linear_connection F hU L ?_ (hX k) (hX l) |
| 52 | intro V hV hVU Z hZ |
| 53 | exact contMDiffOn_flow_connection_pairing F hV |
| 54 | ((hX i).mono hVU) ((hX j).mono hVU) hZ |
| 55 | let B := VectorField.mlieBracket (𝓡 n) (X 0) (X 1) |
| 56 | have hB : ContMDiffOn (𝓡 n) |
| 57 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% B) U := by |
| 58 | intro y hy |
| 59 | let : IsManifold (𝓡 n) (minSmoothness ℝ 2) M := by |
| 60 | apply IsManifold.of_le (n := (↑(⊤ : ℕ∞) : ℕ∞ω)) |
| 61 | simpa [minSmoothness_eq_infty] using |
| 62 | (minSmoothness_monotone (𝕜 := ℝ) |
| 63 | (WithTop.coe_le_coe.mpr (show (2 : ℕ∞) ≤ (⊤ : ℕ∞) from le_top))) |
| 64 | let : IsManifold (𝓡 n) (∞ + 1) M := by |
| 65 | simpa using (inferInstance : IsManifold (𝓡 n) ∞ M) |
| 66 | exact (((hX 0).contMDiffAt (hU.mem_nhds hy)).mlieBracket_vectorField |
| 67 | (m := ⊤) (n := ⊤) ((hX 1).contMDiffAt (hU.mem_nhds hy)) (by simp)).contMDiffWithinAt |
| 68 | have hCs (s : ℝ) (i j : Fin 4) : ContMDiffOn (𝓡 n) |
| 69 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% (C s i j)) U := by |
| 70 | intro y hy |
| 71 | apply ContMDiffAt.contMDiffWithinAt |
| 72 | apply contMDiffAt_section_of_metric_pairings (F.metric s) (C s i j) |
| 73 | intro a |
| 74 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 75 | (TangentSpace (𝓡 n) : M → Type _) y |
| 76 | have hye : y ∈ U ∩ e.baseSet := ⟨hy, FiberBundle.mem_baseSet_trivializationAt' y⟩ |
| 77 | exact (contMDiffOn_connection_pairing (F.connection s) (hU.inter e.open_baseSet) |
| 78 | ((hX i).mono inter_subset_left) ((hX j).mono inter_subset_left) |
| 79 | ((contMDiffOn_extend_baseSet a).mono inter_subset_right)).contMDiffAt |
| 80 | ((hU.inter e.open_baseSet).mem_nhds hye) |
| 81 | have hs := ((((contMDiffOn_mvfderiv_spatial hU (hPair 1 3 2) (hX 0)).sub |
| 82 | (contMDiffOn_mvfderiv_spatial hU (hPair 0 3 2) (hX 1))).sub |
| 83 | (hCross 1 3 0 2)).add (hCross 0 3 1 2)).sub |
| 84 | (contMDiffOn_flow_connection_pairing F hU hB (hX 3) (hX 2)) |
| 85 | apply hs.congr |
| 86 | intro p hp |
| 87 | have hVd (i : Fin 4) := ((hX i).contMDiffAt (hU.mem_nhds hp.2)).mdifferentiableAt (by simp) |
| 88 | have hCd (i j : Fin 4) := |
| 89 | ((hCs p.1 i j).contMDiffAt (hU.mem_nhds hp.2)).mdifferentiableAt (by simp) |
| 90 | have h1 := metric_derivative_pairing (F.connection p.1) (X 0) (hCd 1 3) (hVd 2) |
| 91 | have h2 := metric_derivative_pairing (F.connection p.1) (X 1) (hCd 0 3) (hVd 2) |
| 92 | change (F.metric p.1).inner p.2 |
| 93 | ((F.connection p.1).curvature p.2 (X 0 p.2) (X 1 p.2) (X 3 p.2)) (X 2 p.2) = _ |
| 94 | rw [← curvatureOnFields_eq_curvature (F.connection p.1) hU (hX 0) (hX 1) (hX 3) hp.2] |
| 95 | simp only [LeviCivitaData.curvatureOnFields, map_sub, sub_apply, Pi.add_apply] |
| 96 | dsimp only [P, C, B] at h1 h2 ⊢ |
| 97 | linarith only [h1, h2] |
| 98 | |
| 99 | set_option maxHeartbeats 800000 in |
| 100 | -- The fixed-fiber restriction of spacetime curvature smoothness needs extra elaboration. |
| 101 | set_option backward.isDefEq.respectTransparency false in |
| 102 | theorem contDiffOn_curvatureTensor_timeSlice (F : RicciFlow n M J) |
| 103 | (x : M) (u v w z : TangentSpace (𝓡 n) x) : |
| 104 | ContDiffOn ℝ ∞ (fun t ↦ (F.connection t).curvatureTensor x u v w z) J := by |
| 105 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 106 | (TangentSpace (𝓡 n) : M → Type _) x |
| 107 | let U := e.baseSet |
| 108 | have hx : x ∈ U := FiberBundle.mem_baseSet_trivializationAt' x |
| 109 | let X : Fin 4 → (y : M) → TangentSpace (𝓡 n) y := |
| 110 | ![FiberBundle.extend (EuclideanSpace ℝ (Fin n)) u, |
| 111 | FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v, |
| 112 | FiberBundle.extend (EuclideanSpace ℝ (Fin n)) w, |
| 113 | FiberBundle.extend (EuclideanSpace ℝ (Fin n)) z] |
| 114 | have hX (i : Fin 4) : ContMDiffOn (𝓡 n) |
| 115 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% (X i)) U := by |
| 116 | fin_cases i |
| 117 | · exact contMDiffOn_extend_baseSet u |
| 118 | · exact contMDiffOn_extend_baseSet v |
| 119 | · exact contMDiffOn_extend_baseSet w |
| 120 | · exact contMDiffOn_extend_baseSet z |
| 121 | have hslice : ContMDiff 𝓘(ℝ, ℝ) (𝓘(ℝ, ℝ).prod (𝓡 n)) ∞ |
| 122 | (fun t : ℝ ↦ (t, x)) := contMDiff_id.prodMk contMDiff_const |
| 123 | have hs := (contMDiffOn_flow_riemannEvaluation F e.open_baseSet X hX).comp |
| 124 | hslice.contMDiffOn (show MapsTo (fun t : ℝ ↦ (t, x)) J (J ×ˢ U) from |
| 125 | fun _ ht ↦ ⟨ht, hx⟩) |
| 126 | have ht : ContMDiffOn 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ) ∞ |
| 127 | (fun t ↦ (F.connection t).curvatureTensor x u v w z) J := by |
| 128 | apply hs.congr |
| 129 | intro t ht |
| 130 | simp [LeviCivitaData.riemannEvaluation, X] |
| 131 | exact ht.contDiffOn |
| 132 | |
| 133 | end PoincareMT.RicciFlowAnalysis |
| 134 |