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.Minimum.Variation.Frame.Field |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Geometry.Pullback.Scalar |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Surface |
| 4 | |
| 5 | /-! |
| 6 | # Scaled adapted surface fields |
| 7 | |
| 8 | The intrinsic adapted equation becomes a scalar equation on a surface. |
| 9 | Multiplication by `s / c` gives the fields used in the minimum index trace. |
| 10 | Morgan--Tian, Definition 6.35 and Lemma 6.36, p. 122; Claim 6.44, pp. 128-129. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | noncomputable section |
| 17 | open Set Filter Topology |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | |
| 20 | namespace PoincareMT.ReducedLengthMinimum.Variation.Frame |
| 21 | |
| 22 | open Geometry |
| 23 | |
| 24 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | theorem exists_orthonormalBasis_eq (g : RiemannianMetric n M) (x : M) |
| 28 | (P : Fin n → TangentSpace (𝓡 n) x) |
| 29 | (hP : ∀ i j, g.inner x (P i) (P j) = if i = j then 1 else 0) : |
| 30 | ∃ e : letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 31 | ⟨g.toRiemannianMetric⟩ |
| 32 | OrthonormalBasis (Fin n) ℝ (TangentSpace (𝓡 n) x), ∀ i, e i = P i := by |
| 33 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 34 | ⟨g.toRiemannianMetric⟩ |
| 35 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) x) := |
| 36 | inferInstanceAs (FiniteDimensional ℝ (EuclideanSpace ℝ (Fin n))) |
| 37 | have hon : Orthonormal ℝ P := orthonormal_iff_ite.mpr hP |
| 38 | have hcard : Fintype.card (Fin n) = Module.finrank ℝ (TangentSpace (𝓡 n) x) := by |
| 39 | exact (Fintype.card_fin n).trans (finrank_euclideanSpace_fin (𝕜 := ℝ) (n := n)).symm |
| 40 | let e := OrthonormalBasis.mk hon |
| 41 | (hon.linearIndependent.span_eq_top_of_card_eq_finrank' hcard).ge |
| 42 | exact ⟨e, fun i ↦ congrFun (OrthonormalBasis.coe_mk hon _) i⟩ |
| 43 | |
| 44 | theorem parametricExtension_field_contMDiffOn {U : Set ℝ} {α : ℝ → M} |
| 45 | {P : ∀ s, TangentSpace (𝓡 n) (α s)} |
| 46 | (E : ParametricAlongCurveExtensionOn U α P) |
| 47 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) : |
| 48 | ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 49 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (P s)) U := by |
| 50 | have h := E.smooth.comp (contMDiffOn_id.prodMk hα) (fun s hs ↦ E.graph_mem s hs) |
| 51 | apply h.congr |
| 52 | intro s hs |
| 53 | dsimp only [Function.comp_def, id_eq] |
| 54 | rw [E.agrees s hs] |
| 55 | |
| 56 | end PoincareMT.ReducedLengthMinimum.Variation.Frame |
| 57 | |
| 58 | namespace PoincareMT.ReducedLengthMinimum.Variation.Frame |
| 59 | |
| 60 | open Geometry |
| 61 | |
| 62 | variable {M : Type*} [TopologicalSpace M] |
| 63 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 64 | |
| 65 | theorem pullback_adapted_surface {J C U : Set ℝ} (F : RicciFlow 2 M J) |
| 66 | (T : ℝ) (α : ℝ → M) (P : ∀ s, TangentSpace (𝓡 2) (α s)) |
| 67 | (E : ParametricAlongCurveExtensionOn C α P) (hU : IsOpen U) |
| 68 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ α U) |
| 69 | (hP : IsAdaptedFieldOn F T α P U) {s : ℝ} (hs : s ∈ C) (hsU : s ∈ U) |
| 70 | (hC : UniqueDiffWithinAt ℝ C s) |
| 71 | (htime : s ∈ interior ((fun r : ℝ ↦ T - r ^ 2) ⁻¹' J)) : |
| 72 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α P C E s = |
| 73 | (-(s * (F.connection (T - s ^ 2)).scalarCurvature (α s))) • P s := by |
| 74 | let g := F.metric (T - s ^ 2) |
| 75 | let Q := pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α P C E s |
| 76 | let a := -(s * (F.connection (T - s ^ 2)).scalarCurvature (α s)) |
| 77 | have hpair (Z : TangentSpace (𝓡 2) (α s)) : g.inner (α s) Q Z = g.inner (α s) (a • P s) Z := by |
| 78 | have h := pullback_adapted_of_localAdaptedEquation F T α P E hU hα hP.smooth |
| 79 | hs hsU hC htime (hP.equation s hsU) Z |
| 80 | rw [(F.connection (T - s ^ 2)).ricci_eq_half_scalarCurvature_mul_inner] at h |
| 81 | dsimp only [g, Q, a] |
| 82 | rw [h] |
| 83 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 84 | ring |
| 85 | have hz : g.inner (α s) (Q - a • P s) (Q - a • P s) = 0 := by |
| 86 | rw [(g.inner (α s)).map_sub, sub_apply, hpair, sub_self] |
| 87 | have heq : Q - a • P s = 0 := by |
| 88 | by_contra hn |
| 89 | exact (ne_of_gt (g.pos (α s) _ hn)) hz |
| 90 | exact sub_eq_zero.mp heq |
| 91 | |
| 92 | theorem pullback_scaled_adapted_surface {J C U : Set ℝ} (F : RicciFlow 2 M J) |
| 93 | (T : ℝ) (α : ℝ → M) (P : ∀ s, TangentSpace (𝓡 2) (α s)) |
| 94 | (E : ParametricAlongCurveExtensionOn C α P) (c : ℝ) |
| 95 | (H : ParametricAlongCurveExtensionOn C α (fun s ↦ (s / c) • P s)) |
| 96 | (hU : IsOpen U) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ α U) |
| 97 | (hP : IsAdaptedFieldOn F T α P U) {s : ℝ} (hs : s ∈ C) (hsU : s ∈ U) |
| 98 | (hC : UniqueDiffWithinAt ℝ C s) |
| 99 | (htime : s ∈ interior ((fun r : ℝ ↦ T - r ^ 2) ⁻¹' J)) : |
| 100 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) α |
| 101 | (fun r ↦ (r / c) • P r) C H s = |
| 102 | (1 / c - s * (s / c) * (F.connection (T - s ^ 2)).scalarCurvature (α s)) • P s := by |
| 103 | have hd : deriv (fun r : ℝ ↦ r / c) s = 1 / c := by |
| 104 | simpa only [id_eq] using ((hasDerivAt_id s).div_const c).deriv |
| 105 | rw [pullbackCovariantDerivative_smul F (fun r ↦ T - r ^ 2) E |
| 106 | (fun r ↦ r / c) (contDiff_id.div_const c) H hs hC |
| 107 | (((hα s hsU).contMDiffAt (hU.mem_nhds hsU)).mdifferentiableAt (by simp)), |
| 108 | hd, |
| 109 | pullback_adapted_surface F T α P E hU hα hP hs hsU hC htime, |
| 110 | smul_smul, ← add_smul] |
| 111 | congr 1 |
| 112 | ring |
| 113 | |
| 114 | end PoincareMT.ReducedLengthMinimum.Variation.Frame |