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.Generalized.ReducedGeometry.Variation.Euler.LocalEulerPath |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.InitialValue.InitialValuePasting |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.InitialValue.InitialValueRestriction |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.InitialValue.InitialValueUnique |
| 5 | |
| 6 | /-! |
| 7 | # Continuation of an actual normalized initial-value path |
| 8 | |
| 9 | Morgan-Tian Definition 6.17 and Lemma 6.18, pp. 113-114. |
| 10 | A local Euler path through the final point and actual velocity |
| 11 | agrees with the old path on a closed overlap. Pasting after a |
| 12 | strictly earlier prefix extends the IVP to a physical neighborhood. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {T τ : ℝ} {x y : G.Point} {Z : G.Horizontal x} |
| 27 | |
| 28 | /-- Every actual normalized IVP continues to a relative physical |
| 29 | neighborhood of its final square time and preserves its entire old |
| 30 | trajectory. At a physical earliest time the new endpoint may coincide |
| 31 | with the old one, as allowed in Lemma 6.18, pp. 113-114. -/ |
| 32 | theorem exists_initialValuePath_extension_neighborhood |
| 33 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | (P : M14SquareRootInitialValuePath G T τ x y Z) : |
| 35 | ∃ r : ℝ, Real.sqrt τ ≤ r ∧ |
| 36 | Icc 0 r ∈ 𝓝[{s | 0 ≤ s ∧ T - s ^ 2 ∈ I.domain}] (Real.sqrt τ) ∧ |
| 37 | ∃ z : G.Point, ∃ Q : M14SquareRootInitialValuePath G T (r ^ 2) x z Z, |
| 38 | EqOn Q.square_path.curve P.square_path.curve (M14SqrtParameterInterval 0 τ) := by |
| 39 | have hτ : 0 < τ := P.path.tau_lt |
| 40 | have hs : 0 < Real.sqrt τ := Real.sqrt_pos.mpr hτ |
| 41 | have hT : T ∈ I.domain := by |
| 42 | rw [← G.spacetime.time_range] |
| 43 | refine ⟨x, ?_⟩ |
| 44 | simpa only [GeneralizedFlowSpacetime.timeFunction, sub_zero] using P.path.base_time |
| 45 | have hsC : Real.sqrt τ ∈ M14SqrtParameterInterval 0 τ := by |
| 46 | exact ⟨by simpa only [Real.sqrt_zero] using hs.le, le_rfl⟩ |
| 47 | obtain ⟨l, r, hl, hls, hsr, hnear, x', y', p, R, E, hEuler, hpoint, hvel⟩ := |
| 48 | exists_squareRootEulerPath_through_velocity hM04 hM12 hT hs |
| 49 | (P.square_path.curve (Real.sqrt τ)) (P.square_path.curve_time _ hsC) |
| 50 | (P.square_path.horizontal_velocity (Real.sqrt τ)) |
| 51 | have hr : 0 < r := hs.trans_le hsr |
| 52 | have hC : M14SqrtParameterInterval (l ^ 2) (r ^ 2) = Icc l r := by |
| 53 | rw [M14SqrtParameterInterval, Real.sqrt_sq hl.le, Real.sqrt_sq hr.le] |
| 54 | have hsubP : Icc l (Real.sqrt τ) ⊆ M14SqrtParameterInterval 0 τ := by |
| 55 | simpa only [M14SqrtParameterInterval, Real.sqrt_zero] using |
| 56 | Icc_subset_Icc hl.le (le_refl (Real.sqrt τ)) |
| 57 | have hsubR : Icc l (Real.sqrt τ) ⊆ M14SqrtParameterInterval (l ^ 2) (r ^ 2) := by |
| 58 | rw [hC] |
| 59 | exact Icc_subset_Icc le_rfl hsr |
| 60 | have heq : EqOn P.square_path.curve R.curve (Icc l (Real.sqrt τ)) := by |
| 61 | have h := squareRootEuler_unique hM04 hM12 R P.square_path hls hsubR hsubP |
| 62 | E P.extension (fun s hs' => hEuler s (hsubR hs')) |
| 63 | (fun s hs' => P.euler s (hsubP hs')) ⟨hls.le, le_rfl⟩ hpoint hvel |
| 64 | exact fun s hs' => (h s hs').1.symm |
| 65 | let c := (l + Real.sqrt τ) / 2 |
| 66 | have hlc : l < c := by dsimp only [c]; linarith |
| 67 | have hcs : c < Real.sqrt τ := by dsimp only [c]; linarith |
| 68 | have hc : 0 < c := hl.trans hlc |
| 69 | have hctau : c ^ 2 < τ := by |
| 70 | have h := (sq_lt_sq₀ hc.le hs.le).mpr hcs |
| 71 | rwa [Real.sq_sqrt hτ.le] at h |
| 72 | let P₀ := initialValuePathRestrict P (sq_pos_of_pos hc) hctau.le |
| 73 | have hoverlap : EqOn P₀.square_path.curve R.curve |
| 74 | (M14SqrtParameterInterval (l ^ 2) (c ^ 2)) := by |
| 75 | rw [M14SqrtParameterInterval, Real.sqrt_sq hl.le, Real.sqrt_sq hc.le] |
| 76 | exact fun s hs' => heq ⟨hs'.1, hs'.2.trans hcs.le⟩ |
| 77 | obtain ⟨z, Q, _, _⟩ := exists_initialValuePath_of_overlap hM12 P₀ R E hEuler |
| 78 | ((sq_lt_sq₀ hl.le hc.le).mpr hlc) ((sq_lt_sq₀ hc.le hr.le).mpr (hcs.trans_le hsr)) |
| 79 | hoverlap |
| 80 | have htaur : τ ≤ r ^ 2 := by |
| 81 | have h := (sq_le_sq₀ hs.le hr.le).mpr hsr |
| 82 | rwa [Real.sq_sqrt hτ.le] at h |
| 83 | have hsame := initialValuePath_square_eqOn hM04 hM12 Q P |
| 84 | rw [min_eq_right htaur] at hsame |
| 85 | exact ⟨r, hsr, mem_of_superset hnear (Icc_subset_Icc hl.le le_rfl), z, Q, hsame⟩ |
| 86 | |
| 87 | end PoincareMT.M14 |