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 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/PathCongruence.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | /-! |
| 8 | # Equality of backward paths on their parameter domains |
| 9 | |
| 10 | The action ignores changes outside the open integration interval. Within |
| 11 | velocities respect equality on their domain, including constant curves. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.LGeometry |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | /-- Within velocities respect equality of curves on the within domain. -/ |
| 27 | theorem curveVelocityWithin_congr {γ δ : ℝ → M} {I : Set ℝ} |
| 28 | (h : Set.EqOn γ δ I) {s : ℝ} (hs : s ∈ I) : |
| 29 | curveVelocityWithin (n := n) γ I s = curveVelocityWithin (n := n) δ I s := by |
| 30 | unfold curveVelocityWithin |
| 31 | rw [mfderivWithin_congr_of_mem h hs] |
| 32 | rfl |
| 33 | |
| 34 | /-- A curve constant on its parameter domain has zero within velocity there. -/ |
| 35 | theorem curveVelocityWithin_eq_zero_of_constant {γ : ℝ → M} {I : Set ℝ} {x : M} |
| 36 | (h : ∀ s ∈ I, γ s = x) {s : ℝ} (hs : s ∈ I) : |
| 37 | curveVelocityWithin (n := n) γ I s = 0 := by |
| 38 | rw [curveVelocityWithin_congr h hs] |
| 39 | simp only [curveVelocityWithin, mfderivWithin_const, zero_apply] |
| 40 | rfl |
| 41 | |
| 42 | /-- A locally constant curve has zero ordinary velocity. -/ |
| 43 | theorem curveVelocity_eq_zero_of_eventually_constant {γ : ℝ → M} {x : M} {s : ℝ} |
| 44 | (h : γ =ᶠ[𝓝 s] fun _ ↦ x) : curveVelocity (n := n) γ s = 0 := by |
| 45 | unfold curveVelocity |
| 46 | rw [h.mfderiv_eq, mfderiv_const] |
| 47 | rfl |
| 48 | |
| 49 | /-- Backward action depends only on the curve on the open integration interval. -/ |
| 50 | theorem backwardLLength_congr_on_interior {J : Set ℝ} (F : RicciFlow n M J) |
| 51 | (T : ℝ) {a b : ℝ} (hab : a ≤ b) {γ δ : ℝ → M} |
| 52 | (h : Set.EqOn γ δ (Set.Ioo a b)) : |
| 53 | backwardLLength F T a b γ = backwardLLength F T a b δ := by |
| 54 | apply intervalIntegral.integral_congr_Ioo_of_le hab |
| 55 | intro s hs |
| 56 | have hnear : γ =ᶠ[𝓝 s] δ := |
| 57 | Filter.eventually_of_mem (Ioo_mem_nhds hs.1 hs.2) h |
| 58 | have hderiv := hnear.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 59 | simp only [backwardLIntegrand, curveVelocity, hderiv, hnear.eq_of_nhds] |
| 60 | congr 2 |
| 61 | exact congrArg (fun x : M ↦ (F.metric (T - s)).inner x |
| 62 | ((mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) δ s) 1) |
| 63 | ((mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) δ s) 1)) hnear.eq_of_nhds |
| 64 | |
| 65 | /-- Equality on the closed path interval in particular preserves backward action. -/ |
| 66 | theorem backwardLLength_congr {J : Set ℝ} (F : RicciFlow n M J) |
| 67 | (T : ℝ) {a b : ℝ} (hab : a ≤ b) {γ δ : ℝ → M} |
| 68 | (h : Set.EqOn γ δ (Set.Icc a b)) : |
| 69 | backwardLLength F T a b γ = backwardLLength F T a b δ := |
| 70 | backwardLLength_congr_on_interior F T hab (h.mono Set.Ioo_subset_Icc_self) |
| 71 | |
| 72 | end PoincareMT.LGeometry |