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.LGeometry.Basic |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 3 | import Mathlib.Tactic.Ring |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/PathBasics.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | /-! |
| 10 | # Basic consequences of the backward path and variation definitions |
| 11 | |
| 12 | These lemmas identify the action of a minimizer with the defining infimum, |
| 13 | extract a square-root path representative from a variation, and specialize |
| 14 | the supplied M04 metric comparison to the backward-time window. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.LGeometry |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 27 | [IsManifold (𝓡 n) ∞ M] |
| 28 | |
| 29 | /-- A minimizing admissible path realizes the action infimum in reduced length. -/ |
| 30 | theorem reducedLength_eq_of_minimizing {J : Set ℝ} {F : RicciFlow n M J} |
| 31 | {T τ : ℝ} {p q : M} (path : BackwardTimePath F T 0 τ) |
| 32 | (hp : path.curve 0 = p) (hq : path.curve τ = q) |
| 33 | (hmin : IsMinimizingBackwardLPath F T 0 τ path) : |
| 34 | reducedLength F T p q τ = |
| 35 | backwardLLength F T 0 τ path.curve / (2 * Real.sqrt τ) := by |
| 36 | have hleast : IsLeast {L : ℝ | |
| 37 | ∃ other : BackwardTimePath F T 0 τ, |
| 38 | other.curve 0 = p ∧ other.curve τ = q ∧ |
| 39 | L = backwardLLength F T 0 τ other.curve} |
| 40 | (backwardLLength F T 0 τ path.curve) := by |
| 41 | refine ⟨⟨path, hp, hq, rfl⟩, ?_⟩ |
| 42 | rintro L ⟨other, hleft, hright, rfl⟩ |
| 43 | exact hmin other (hleft.trans hp.symm) (hright.trans hq.symm) |
| 44 | simp only [reducedLength, dif_pos path.ordered, hleast.csInf_eq] |
| 45 | |
| 46 | /-- A minimizing-existence witness supplies the full reduced-length attainment clause. -/ |
| 47 | theorem reducedLength_attained_of_exists_minimizing {J : Set ℝ} {F : RicciFlow n M J} |
| 48 | {T τ : ℝ} {p q : M} |
| 49 | (h : ∃ path : BackwardTimePath F T 0 τ, |
| 50 | path.curve 0 = p ∧ path.curve τ = q ∧ |
| 51 | IsMinimizingBackwardLPath F T 0 τ path) : |
| 52 | ∃ path : BackwardTimePath F T 0 τ, |
| 53 | path.curve 0 = p ∧ path.curve τ = q ∧ |
| 54 | IsMinimizingBackwardLPath F T 0 τ path ∧ |
| 55 | reducedLength F T p q τ = |
| 56 | backwardLLength F T 0 τ path.curve / (2 * Real.sqrt τ) := by |
| 57 | obtain ⟨path, hp, hq, hmin⟩ := h |
| 58 | exact ⟨path, hp, hq, hmin, reducedLength_eq_of_minimizing path hp hq hmin⟩ |
| 59 | |
| 60 | /-- Restricting a variation to parameter zero gives a smooth square-root representative. -/ |
| 61 | def variationSqrtRegularPath {J : Set ℝ} {F : RicciFlow n M J} |
| 62 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 63 | (V : LVariation F T τ₁ τ₂ p) : SqrtRegularPath p where |
| 64 | curve := V.baseSquareCurve |
| 65 | domain := (fun s : ℝ ↦ (s, (0 : ℝ))) ⁻¹' V.squareDomain |
| 66 | open_domain := V.square_open.preimage (continuous_id.prodMk continuous_const) |
| 67 | interval_subset := by |
| 68 | intro s hs |
| 69 | exact V.square_contains ⟨hs, neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 70 | smooth := V.square_smooth.comp |
| 71 | (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun _ hs ↦ hs) |
| 72 | agrees := by |
| 73 | intro s hs |
| 74 | exact (V.square_agrees s hs 0 |
| 75 | ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩).trans (V.at_zero (s ^ 2)) |
| 76 | |
| 77 | /-- Every time of a backward subinterval lies in the supplied closed flow window. -/ |
| 78 | theorem backwardTime_mem_window {T τmax τ₁ τ₂ τ : ℝ} |
| 79 | (hτ₁ : 0 ≤ τ₁) (hτ₂ : τ₂ ≤ τmax) (hτ : τ ∈ Set.Icc τ₁ τ₂) : |
| 80 | T - τ ∈ Set.Icc (T - τmax) T := |
| 81 | ⟨sub_le_sub_left (hτ.2.trans hτ₂) T, sub_le_self T (hτ₁.trans hτ.1)⟩ |
| 82 | |
| 83 | /-- The M04 comparison on the two flow times of a backward path interval. -/ |
| 84 | theorem backwardPath_metric_comparison {J : Set ℝ} {F : RicciFlow n M J} |
| 85 | {T τmax τ₁ τ₂ K : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) |
| 86 | (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 87 | (hτ₁ : 0 ≤ τ₁) (hordered : τ₁ ≤ τ₂) (hτ₂ : τ₂ ≤ τmax) |
| 88 | (hK : 0 ≤ K) |
| 89 | (hbound : ∀ t ∈ Set.Icc (T - τmax) T, ∀ x : M, |
| 90 | |(F.connection t).curvatureTensorNorm x| ≤ K) |
| 91 | (x : M) (v : TangentSpace (𝓡 n) x) : |
| 92 | Real.exp (-2 * (n : ℝ) * K * (τ₂ - τ₁)) * |
| 93 | (F.metric (T - τ₂)).inner x v v ≤ (F.metric (T - τ₁)).inner x v v ∧ |
| 94 | (F.metric (T - τ₁)).inner x v v ≤ |
| 95 | Real.exp (2 * (n : ℝ) * K * (τ₂ - τ₁)) * |
| 96 | (F.metric (T - τ₂)).inner x v v := by |
| 97 | have hleft : T - τ₂ ∈ Set.Icc (T - τmax) T := |
| 98 | backwardTime_mem_window hτ₁ hτ₂ ⟨hordered, le_rfl⟩ |
| 99 | have hright : T - τ₁ ∈ Set.Icc (T - τmax) T := |
| 100 | backwardTime_mem_window hτ₁ hτ₂ ⟨le_rfl, hordered⟩ |
| 101 | have hdelta : T - τ₁ - (T - τ₂) = τ₂ - τ₁ := by ring |
| 102 | have hcomparison := hM04.metric_comparison n M J F (T - τ₂) (T - τ₁) K |
| 103 | (hwindow hleft) (hwindow hright) (sub_le_sub_left hordered T) hK |
| 104 | (fun t ht x ↦ (le_abs_self _).trans |
| 105 | (hbound t ⟨hleft.1.trans ht.1, ht.2.trans hright.2⟩ x)) x v |
| 106 | simpa only [hdelta] using hcomparison |
| 107 | |
| 108 | end PoincareMT.LGeometry |