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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.PhasePath |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential |
| 4 | |
| 5 | /-! |
| 6 | # Normalized initial data for reconstructed Euler paths |
| 7 | |
| 8 | Morgan-Tian Lemma 6.8, Definition 6.17 and Lemma 6.18, |
| 9 | pp. 108-109, 113-114. Actual coordinate reconstruction identifies the |
| 10 | initial point and transports the initial velocity to exactly twice the |
| 11 | prescribed horizontal vector, as required by the frozen IVP record. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Reindexing the starting point retains the actual curve and tangent fibers. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | |
| 28 | /-- A closed phase with actual initial coordinate velocity corresponding |
| 29 | to `2Z` reconstructs a frozen initial-value path, Lemma 6.8 and |
| 30 | Definition 6.17, pp. 108-109, 113. -/ |
| 31 | theorem exists_initialValuePath_of_normalized_phase |
| 32 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 33 | (b : G.gaugeCover.index) |
| 34 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 35 | (t₀ : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 36 | (x₀ : G.gaugeCover.spatial b) |
| 37 | (Z : G.Horizontal ((G.gaugeCover.cylinder b).toSpacetime (t₀, x₀))) |
| 38 | {τ : ℝ} (hτ : 0 < τ) |
| 39 | (htime : ∀ s ∈ M14SqrtParameterInterval 0 τ, |
| 40 | t₀.val - s ^ 2 ∈ (G.gaugeCover.interval b).domain) |
| 41 | {q P : ℝ → EuclideanSpace ℝ (Fin n)} |
| 42 | (hq : ContDiffOn ℝ ∞ q (M14SqrtParameterInterval 0 τ)) |
| 43 | (hmap : MapsTo q (M14SqrtParameterInterval 0 τ) (extChartAt (𝓡 n) x₀).target) |
| 44 | (hphase : ∀ s ∈ M14SqrtParameterInterval 0 τ, |
| 45 | HasDerivWithinAt (fun r => (q r, P r)) |
| 46 | (M08.closedChartEulerPhase W.flow t₀.val x₀ (M14SqrtParameterInterval 0 τ) |
| 47 | s (q s, P s)) (M14SqrtParameterInterval 0 τ) s) |
| 48 | (hq₀ : q 0 = x₀.val) |
| 49 | (hv₀ : derivWithin q (M14SqrtParameterInterval 0 τ) 0 = |
| 50 | (2 : ℝ) • ((G.gaugeCover.metric b).spatialTangentEquiv t₀ x₀).symm Z) : |
| 51 | ∃ y : G.Point, Nonempty (M14SquareRootInitialValuePath G t₀.val τ |
| 52 | ((G.gaugeCover.cylinder b).toSpacetime (t₀, x₀)) y Z) := by |
| 53 | obtain ⟨β, _, hclock, hcoord, p, R, E, _, hR, hE, hv⟩ := |
| 54 | exists_gaugeEulerPath_of_phase hM04 hM12 b W t₀ x₀ le_rfl hτ htime hq hmap hphase |
| 55 | have hzero : (0 : ℝ) ∈ M14SqrtParameterInterval 0 τ := |
| 56 | ⟨by simp only [Real.sqrt_zero, le_refl], Real.sqrt_nonneg τ⟩ |
| 57 | have hβ₀ : β 0 = (t₀, x₀) := by |
| 58 | apply Prod.ext |
| 59 | · apply Subtype.ext |
| 60 | simpa only [zero_pow (by decide : 2 ≠ 0), sub_zero] using hclock 0 hzero |
| 61 | · exact Subtype.ext ((hcoord 0 hzero).trans hq₀) |
| 62 | have hstart : (G.gaugeCover.cylinder b).toSpacetime (β (Real.sqrt 0)) = |
| 63 | (G.gaugeCover.cylinder b).toSpacetime (t₀, x₀) := by |
| 64 | rw [Real.sqrt_zero, hβ₀] |
| 65 | let p' : M14BackwardPath G t₀.val 0 τ |
| 66 | ((G.gaugeCover.cylinder b).toSpacetime (t₀, x₀)) |
| 67 | ((G.gaugeCover.cylinder b).toSpacetime (β (Real.sqrt τ))) := |
| 68 | { p with |
| 69 | base_time := by simpa only [sub_zero] using (G.gaugeCover.cylinder b).time_eq (t₀, x₀) |
| 70 | curve_start := p.curve_start.trans hstart } |
| 71 | let R' : M14SquareRootPath G p' := { R with curve := R.curve } |
| 72 | refine ⟨_, ⟨{ |
| 73 | path := p' |
| 74 | square_path := R' |
| 75 | extension := E |
| 76 | euler := hE |
| 77 | initial_velocity := ?_ }⟩⟩ |
| 78 | have hR₀ : R.curve 0 = (G.gaugeCover.cylinder b).toSpacetime (t₀, x₀) := |
| 79 | (hR 0 hzero).trans (congrArg (G.gaugeCover.cylinder b).toSpacetime hβ₀) |
| 80 | refine ⟨hR₀, ?_⟩ |
| 81 | have hvzero := hv 0 hzero |
| 82 | rw [hβ₀, hv₀, map_smul, ContinuousLinearEquiv.apply_symm_apply] at hvzero |
| 83 | have ht : HEq (hR₀ ▸ R.horizontal_velocity 0) (R.horizontal_velocity 0) := eqRec_heq _ _ |
| 84 | exact eq_of_heq (ht.trans hvzero) |
| 85 | |
| 86 | /-- Actual metric momentum encoding `2Z` gives the required normalized |
| 87 | initial-value path, using positive metric inversion in equation (6.5) |
| 88 | and Definition 6.17, pp. 108-109, 113. -/ |
| 89 | theorem exists_initialValuePath_of_momentum_phase |
| 90 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 91 | (b : G.gaugeCover.index) |
| 92 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 93 | (t₀ : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 94 | (x₀ : G.gaugeCover.spatial b) |
| 95 | (Z : G.Horizontal ((G.gaugeCover.cylinder b).toSpacetime (t₀, x₀))) |
| 96 | {τ : ℝ} (hτ : 0 < τ) |
| 97 | (htime : ∀ s ∈ M14SqrtParameterInterval 0 τ, |
| 98 | t₀.val - s ^ 2 ∈ (G.gaugeCover.interval b).domain) |
| 99 | {q P : ℝ → EuclideanSpace ℝ (Fin n)} |
| 100 | (hq : ContDiffOn ℝ ∞ q (M14SqrtParameterInterval 0 τ)) |
| 101 | (hmap : MapsTo q (M14SqrtParameterInterval 0 τ) (extChartAt (𝓡 n) x₀).target) |
| 102 | (hphase : ∀ s ∈ M14SqrtParameterInterval 0 τ, |
| 103 | HasDerivWithinAt (fun r => (q r, P r)) |
| 104 | (M08.closedChartEulerPhase W.flow t₀.val x₀ (M14SqrtParameterInterval 0 τ) |
| 105 | s (q s, P s)) (M14SqrtParameterInterval 0 τ) s) |
| 106 | (hi : (q 0, P 0) = (x₀.val, M08.chartMetricOperator W.flow t₀.val x₀ (0, x₀.val) |
| 107 | ((2 : ℝ) • ((G.gaugeCover.metric b).spatialTangentEquiv t₀ x₀).symm Z))) : |
| 108 | ∃ y : G.Point, Nonempty (M14SquareRootInitialValuePath G t₀.val τ |
| 109 | ((G.gaugeCover.cylinder b).toSpacetime (t₀, x₀)) y Z) := by |
| 110 | have hzero : (0 : ℝ) ∈ M14SqrtParameterInterval 0 τ := |
| 111 | ⟨by simp only [Real.sqrt_zero, le_refl], Real.sqrt_nonneg τ⟩ |
| 112 | have hv : HasDerivWithinAt q |
| 113 | (Ring.inverse (M08.chartMetricOperator W.flow t₀.val x₀ (0, q 0)) (P 0)) |
| 114 | (M14SqrtParameterInterval 0 τ) 0 := (hphase 0 hzero).fst |
| 115 | have hv₀ := hv.derivWithin |
| 116 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt (le_refl (0 : ℝ)) hτ) 0 hzero) |
| 117 | have hq₀ := congrArg Prod.fst hi |
| 118 | have hP₀ := congrArg Prod.snd hi |
| 119 | dsimp only [Prod.fst, Prod.snd] at hq₀ hP₀ |
| 120 | have hx₀ : x₀.val ∈ (extChartAt (𝓡 n) x₀).target := hq₀ ▸ hmap hzero |
| 121 | rw [hq₀, hP₀] at hv₀ |
| 122 | exact exists_initialValuePath_of_normalized_phase hM04 hM12 b W t₀ x₀ Z hτ |
| 123 | htime hq hmap hphase hq₀ (hv₀.trans (M08.inverse_operator_apply _ |
| 124 | (M08.chartMetricOperator_isUnit_of_target W.flow t₀.val x₀ hx₀) _)) |
| 125 | |
| 126 | end PoincareMT.M14 |