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.ODE.MaximalRegularizedCurve |
| 2 | import Mathlib.Data.Set.Piecewise |
| 3 | |
| 4 | /-! |
| 5 | # Gluing an actual restart to a regularized curve |
| 6 | |
| 7 | Uniqueness on the overlap makes the piecewise curve smooth. Maximality then |
| 8 | includes the restart's entire domain in the maximal domain. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.ReducedLength |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [IsManifold (𝓡 n) ∞ M] [T2Space M] |
| 22 | |
| 23 | theorem exists_regularizedIntervalSolution_union {J : Set ℝ} |
| 24 | {F : RicciFlow n M J} {T b s0 : ℝ} {q0 : TangentBundle (𝓡 n) M} |
| 25 | (hM04 : RicciFlowCurvatureTheory.{u}) (hb : 0 < b) |
| 26 | (hwindow : Set.Icc (T - b) T ⊆ J) |
| 27 | (A : RegularizedIntervalSolution F T b s0 q0) (s : ℝ) (hs : s ∈ A.domain) |
| 28 | (B : RegularizedIntervalSolution F T b s (curvePhase (n := n) A.curve s)) : |
| 29 | ∃ C : RegularizedIntervalSolution F T b s0 q0, |
| 30 | C.domain = A.domain ∪ B.domain ∧ |
| 31 | Set.EqOn C.curve A.curve A.domain ∧ Set.EqOn C.curve B.curve B.domain := by |
| 32 | classical |
| 33 | have hp := localRegularizedCurve_phase_eqOn F hM04 T b hb hwindow A.curve B.curve |
| 34 | (A.domain ∩ B.domain) (A.open_domain.inter B.open_domain) |
| 35 | (A.preconnected_domain.ordConnected.inter B.preconnected_domain.ordConnected).isPreconnected |
| 36 | (fun _ ht ↦ A.time_mem ht.1) (A.isLocal.mono Set.inter_subset_left) |
| 37 | (B.isLocal.mono Set.inter_subset_right) s ⟨hs, B.initial_mem⟩ B.initial_phase.symm |
| 38 | let c := A.domain.piecewise A.curve B.curve |
| 39 | have heA : Set.EqOn c A.curve A.domain := Set.piecewise_eqOn .. |
| 40 | have heB : Set.EqOn c B.curve B.domain := by |
| 41 | intro t ht |
| 42 | by_cases htA : t ∈ A.domain |
| 43 | · exact (heA htA).trans (congrArg Bundle.TotalSpace.proj (hp ⟨htA, ht⟩)) |
| 44 | · exact Set.piecewise_eq_of_notMem A.domain A.curve B.curve htA |
| 45 | have hgA : ∀ t ∈ A.domain, c =ᶠ[𝓝 t] A.curve := by |
| 46 | intro t ht |
| 47 | filter_upwards [A.open_domain.mem_nhds ht] with r hr using heA hr |
| 48 | have hgB : ∀ t ∈ B.domain, c =ᶠ[𝓝 t] B.curve := by |
| 49 | intro t ht |
| 50 | filter_upwards [B.open_domain.mem_nhds ht] with r hr using heB hr |
| 51 | have hc : IsLocalRegularizedCurveOn F T c (A.domain ∪ B.domain) := by |
| 52 | apply IsLocalRegularizedCurveOn.of_locally |
| 53 | intro t ht |
| 54 | rcases ht with ht | ht |
| 55 | · exact ⟨A.curve, A.domain, A.open_domain, ht, A.isLocal, hgA t ht⟩ |
| 56 | · exact ⟨B.curve, B.domain, B.open_domain, ht, B.isLocal, hgB t ht⟩ |
| 57 | let C : RegularizedIntervalSolution F T b s0 q0 := { |
| 58 | domain := A.domain ∪ B.domain |
| 59 | open_domain := A.open_domain.union B.open_domain |
| 60 | preconnected_domain := A.preconnected_domain.union s hs B.initial_mem B.preconnected_domain |
| 61 | initial_mem := Or.inl A.initial_mem |
| 62 | time_mem := fun _ ht ↦ ht.elim (fun h ↦ A.time_mem h) (fun h ↦ B.time_mem h) |
| 63 | curve := c |
| 64 | isLocal := hc |
| 65 | initial_phase := (curvePhase_eventuallyEq (hgA s0 A.initial_mem)).eq_of_nhds.trans |
| 66 | A.initial_phase |
| 67 | } |
| 68 | exact ⟨C, rfl, heA, heB⟩ |
| 69 | |
| 70 | theorem maximalRegularizedDomain_contains_restart {J : Set ℝ} |
| 71 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 72 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 73 | (s0 : ℝ) (hs0 : s0 ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 74 | (q0 : TangentBundle (𝓡 n) M) (s : ℝ) |
| 75 | (hs : s ∈ maximalRegularizedDomain F T b s0 q0) |
| 76 | (B : RegularizedIntervalSolution F T b s |
| 77 | (curvePhase (n := n) (maximalRegularizedCurve F T b s0 q0) s)) : |
| 78 | B.domain ⊆ maximalRegularizedDomain F T b s0 q0 := by |
| 79 | let A := maximalRegularizedSolution F hM04 T b hb hwindow s0 hs0 q0 |
| 80 | obtain ⟨C, hC, _, _⟩ := exists_regularizedIntervalSolution_union hM04 hb hwindow A s hs B |
| 81 | intro t ht |
| 82 | exact C.domain_subset_maximal (hC.symm ▸ Or.inr ht) |
| 83 | |
| 84 | end PoincareMT.ReducedLength |