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.Jacobi.JacobiGaugeFields |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCoefficients |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeFirstDerivatives |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackRestriction |
| 6 | |
| 7 | /-! |
| 8 | # The actual Euler equation in a closed compatible gauge |
| 9 | |
| 10 | Morgan-Tian equation (6.5), Lemma 6.8 and Lemma 6.18, |
| 11 | pp. 108-109, 113-114. Actual velocity and covariant acceleration |
| 12 | give the closed coordinate Euler residual. Its potential and metric |
| 13 | time derivatives retain the frozen 2s^2 and 4s coefficients. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- Base reconstruction identifies the actual horizontal tangent fibers. |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Manifold ContDiff |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M14 |
| 26 | |
| 27 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 28 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 29 | |
| 30 | private theorem horizontal_three_eval_heq |
| 31 | (F : ∀ q, G.Horizontal q → G.Horizontal q → G.Horizontal q → ℝ) |
| 32 | {q r : G.Point} (h : q = r) |
| 33 | {A D Z : G.Horizontal q} {A' D' Z' : G.Horizontal r} |
| 34 | (hA : HEq A A') (hD : HEq D D') (hZ : HEq Z Z') : F q A D Z = F r A' D' Z' := by |
| 35 | cases h |
| 36 | cases hA |
| 37 | cases hD |
| 38 | cases hZ |
| 39 | rfl |
| 40 | |
| 41 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 42 | (R : M14SquareRootPath G p) (b : G.gaugeCover.index) |
| 43 | |
| 44 | /-- The frozen square-root Euler residual equals the actual closed |
| 45 | coordinate expression for every supplied velocity extension, |
| 46 | equation (6.5) and Lemma 6.18, pp. 108-109, 113-114. -/ |
| 47 | theorem squareRootEulerResidual_gauge |
| 48 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 49 | (hscalar : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ |
| 50 | (horizontalScalarCurvature G.leafwise)) |
| 51 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 52 | (hM04 : RicciFlowCurvatureTheory.{0}) (x₀ : G.gaugeCover.spatial b) |
| 53 | {a c : ℝ} (hac : a < c) (hsub : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 54 | {β : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 55 | G.gaugeCover.spatial b} |
| 56 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (Icc a c)) |
| 57 | (hrec : ∀ s ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β s) = R.curve s) |
| 58 | (hclock : ∀ s ∈ Icc a c, (β s).1.val = T - s ^ 2) |
| 59 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 60 | R.horizontal_velocity) |
| 61 | {s : ℝ} (hs : s ∈ Icc a c) {Z : G.Horizontal (R.curve s)} |
| 62 | (w : EuclideanSpace ℝ (Fin n)) |
| 63 | (hZ : HEq Z ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 w)) : |
| 64 | let q := fun r => (β r).2.val |
| 65 | let v := derivWithin q (Icc a c) |
| 66 | M14SquareRootEulerResidual G R E s Z = |
| 67 | M08.chartActionMetric W.flow T x₀ (s, q s) |
| 68 | (derivWithin v (Icc a c) s + |
| 69 | M08.closedChartConnection W.flow T x₀ (Icc a c) (s, q s) (v s) (v s)) w - |
| 70 | M08.spatialWithinFDeriv (Icc a c) (extChartAt (𝓡 n) x₀).target |
| 71 | (M08.chartActionPotential W.flow T x₀) (s, q s) w + |
| 72 | M08.timeWithinFDeriv (Icc a c) (extChartAt (𝓡 n) x₀).target |
| 73 | (M08.chartActionMetric W.flow T x₀) (s, q s) (v s) w := by |
| 74 | dsimp only |
| 75 | let q := fun r => (β r).2.val |
| 76 | let v := derivWithin q (Icc a c) |
| 77 | have hC := uniqueDiffOn_Icc hac |
| 78 | have htime (r : ℝ) (hr : r ∈ Icc a c) : T - r ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 79 | rw [← hclock r hr] |
| 80 | exact (β r).1.property |
| 81 | have hA (r : ℝ) (hr : r ∈ Icc a c) := |
| 82 | squareRootVelocity_gauge_subset b R hsub hβ hrec hr (hC r hr) |
| 83 | have hD := horizontalCovariantDerivative_lifted_gauge b hCoordinates W T x₀ hβ hrec hclock |
| 84 | (pullbackExtensionRestrict E hsub) v hA hs (hC s hs) |
| 85 | have hres := horizontalCovariantDerivative_restrict_subset E hsub (hC s hs) |
| 86 | ((R.smooth.mono R.interval_subset s (hsub hs)).mdifferentiableWithinAt (by simp)) |
| 87 | have hD' := (heq_of_eq hres).trans hD |
| 88 | let φ := fun (z : G.Point) (A D Z : G.Horizontal z) => |
| 89 | G.spacetime.horizontalMetric.inner z D Z - |
| 90 | 2 * s ^ 2 * M14HorizontalScalarDifferential G z Z.val + |
| 91 | 4 * s * horizontalRicci G.leafwise z A Z |
| 92 | have hgeom := horizontal_three_eval_heq φ (hrec s hs).symm (hA s hs) hD' hZ |
| 93 | change φ (R.curve s) (R.horizontal_velocity s) _ Z = _ |
| 94 | rw [hgeom] |
| 95 | have hy : (β s).2 ∈ (extChartAt (𝓡 n) x₀).source := by |
| 96 | rw [extChartAt_source, (G.gaugeCover.spatial b).chartAt_source_eq_univ] |
| 97 | exact mem_univ _ |
| 98 | have hval : extChartAt (𝓡 n) x₀ (β s).2 = (β s).2.val := by |
| 99 | rw [extChartAt_coe] |
| 100 | rfl |
| 101 | have hy' : (β s).2.val ∈ (extChartAt (𝓡 n) x₀).target := by |
| 102 | rw [← hval] |
| 103 | exact (extChartAt (𝓡 n) x₀).map_source hy |
| 104 | have hpot := gauge_chartActionPotential_differential b W hCoordinates hscalar hM04 T htime |
| 105 | x₀ (β s).2 hs (β s).1 (hclock s hs).symm w |
| 106 | rw [(M08.hasFDerivAt_spatialWithin (isOpen_extChartAt_target (I := 𝓡 n) x₀) _ |
| 107 | (M08.chartActionPotential_closed_contDiffOn W.flow hM04 T x₀ htime) hs hy').fderiv] at hpot |
| 108 | rw [gauge_chartActionMetric b W T x₀ (β s).2 s (β s).1 (hclock s hs).symm, hpot, |
| 109 | gauge_chartActionMetric_timeWithin_pair b hCoordinates W hM04 T hac htime x₀ (β s).2 hs |
| 110 | (β s).1 (hclock s hs).symm] |
| 111 | |
| 112 | end PoincareMT.M14 |