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.Theory |
| 2 | import Mathlib.Topology.Order.LeftRightNhds |
| 3 | |
| 4 | /-! |
| 5 | # Restricting an Euler path to a positive closed tail |
| 6 | |
| 7 | The total curve and its parametric extension are preserved. On the smaller |
| 8 | open parameter interval the within velocity is unchanged. The extension to |
| 9 | zero service then promotes local terminal agreement to the whole interval. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedVolume |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {J : Set ℝ} {F : RicciFlow n M J} {T a b τmax : ℝ} |
| 24 | |
| 25 | /-- Restriction of a backward path preserves the actual total curve and action integrability. -/ |
| 26 | noncomputable def backwardPathTail (p : BackwardTimePath F T 0 b) |
| 27 | (ha : 0 < a) (hab : a < b) : BackwardTimePath F T a b where |
| 28 | curve := p.curve |
| 29 | nonnegative := ha.le |
| 30 | ordered := hab |
| 31 | terminal_mem := p.terminal_mem |
| 32 | time_mem := fun s hs ↦ p.time_mem s ⟨ha.le.trans hs.1, hs.2⟩ |
| 33 | continuous := p.continuous.mono (Icc_subset_Icc ha.le le_rfl) |
| 34 | regular := p.regular.mono (Ioo_subset_Ioo ha.le le_rfl) |
| 35 | l_integrable := p.l_integrable.mono_set (by |
| 36 | rw [uIcc_of_le hab.le, uIcc_of_le p.ordered.le] |
| 37 | exact Icc_subset_Icc ha.le le_rfl) |
| 38 | |
| 39 | omit [IsManifold (𝓡 n) ∞ M] in |
| 40 | /-- Within velocities at interior times equal the genuine unrestricted velocity. -/ |
| 41 | theorem curveVelocityWithin_Ioo_eq {γ : ℝ → M} {c d s : ℝ} (hs : s ∈ Ioo c d) : |
| 42 | curveVelocityWithin (n := n) γ (Ioo c d) s = curveVelocity γ s := by |
| 43 | unfold curveVelocityWithin curveVelocity |
| 44 | rw [mfderivWithin_of_mem_nhds (isOpen_Ioo.mem_nhds hs)] |
| 45 | |
| 46 | /-- Keeping the same parametric extension restricts the full Euler equation to a positive tail. -/ |
| 47 | theorem isBackwardLGeodesic_tail {p : BackwardTimePath F T 0 b} |
| 48 | (hp : IsBackwardLGeodesic F T 0 b p) (ha : 0 < a) (hab : a < b) : |
| 49 | IsBackwardLGeodesic F T a b (backwardPathTail p ha hab) := by |
| 50 | obtain ⟨E, hE⟩ := hp |
| 51 | have hsub : Ioo a b ⊆ Ioo 0 b := Ioo_subset_Ioo ha.le le_rfl |
| 52 | have hvel (s : ℝ) (hs : s ∈ Ioo a b) : |
| 53 | curveVelocityWithin (n := n) p.curve (Ioo a b) s = |
| 54 | curveVelocityWithin (n := n) p.curve (Ioo 0 b) s := by |
| 55 | rw [curveVelocityWithin_Ioo_eq hs, curveVelocityWithin_Ioo_eq (hsub hs)] |
| 56 | let E' : ParametricAlongCurveExtensionOn (Ioo a b) p.curve |
| 57 | (curveVelocityWithin (n := n) p.curve (Ioo a b)) := { |
| 58 | extension := E.extension |
| 59 | domain := E.domain |
| 60 | open_domain := E.open_domain |
| 61 | graph_mem := fun s hs ↦ E.graph_mem s (hsub hs) |
| 62 | smooth := E.smooth |
| 63 | agrees := fun s hs ↦ (E.agrees s (hsub hs)).trans (hvel s hs).symm } |
| 64 | refine ⟨E', ?_⟩ |
| 65 | intro s hs W |
| 66 | have he := hE s (hsub hs) W |
| 67 | change backwardEulerResidual F T p.curve (Ioo a b) E' s W = 0 |
| 68 | dsimp only [backwardEulerResidual, pullbackCovariantDerivative, E'] |
| 69 | rw [hvel s hs] |
| 70 | exact he |
| 71 | |
| 72 | variable [ConnectedSpace M] |
| 73 | |
| 74 | /-- Two Euler paths agreeing near their terminal time agree on their whole closed interval. -/ |
| 75 | theorem eulerPaths_eqOn_of_eventuallyEq (hL : LGeodesicTheory F T τmax) |
| 76 | {p q : BackwardTimePath F T 0 b} (hmax : b ≤ τmax) |
| 77 | (hp : IsBackwardLGeodesic F T 0 b p) (hq : IsBackwardLGeodesic F T 0 b q) |
| 78 | (heq : p.curve =ᶠ[𝓝 b] q.curve) : EqOn p.curve q.curve (Icc 0 b) := by |
| 79 | have hnear : {s : ℝ | p.curve s = q.curve s ∧ 0 < s} ∈ 𝓝 b := |
| 80 | heq.and (eventually_gt_nhds p.ordered) |
| 81 | obtain ⟨a, hab, htail⟩ := |
| 82 | mem_nhdsLE_iff_exists_Icc_subset.mp (nhdsWithin_le_nhds hnear) |
| 83 | have ha : 0 < a := (htail ⟨le_rfl, hab.le⟩).2 |
| 84 | obtain ⟨r, _, _, huniq⟩ := hL.extension_to_zero a b ha hab hmax |
| 85 | (backwardPathTail p ha hab) (isBackwardLGeodesic_tail hp ha hab) |
| 86 | have hp' := huniq p (fun _ _ ↦ rfl) hp |
| 87 | have hq' := huniq q (fun s hs ↦ (htail hs).1.symm) hq |
| 88 | exact fun s hs ↦ (hp' s hs).trans (hq' s hs).symm |
| 89 | |
| 90 | end PoincareMT.ReducedVolume |