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.Regularity.Formulas.ScalarEvolutionTransportSlice |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.MetricDerivative.Time |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Geometry |
| 4 | import PoincareLib.Geometry.RicciFlow.Curvature.Theory |
| 5 | |
| 6 | /-! |
| 7 | # Actual backward scalar evolution on generalized spacetime |
| 8 | |
| 9 | An actual compatible gauge transports M04's ordinary scalar equation |
| 10 | to every spacetime point, including included time endpoints. |
| 11 | Morgan-Tian Theorem 3.13, equation (3.7), p. 41, Definition 3.38, |
| 12 | p. 61, and the backward-time use in Section 6.5, pp. 126-127. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- The compatible cylinder and its moving presentation share tangent fibers. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 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 | private theorem backwardScalarReaction_eq_slice (q : G.Point) {t : ℝ} |
| 29 | (ht : G.spacetime.timeFunction q = t) : |
| 30 | -(G.leafwise.sliceConnection (G.spacetime.timeFunction q)).laplacian |
| 31 | (G.leafwise.sliceConnection (G.spacetime.timeFunction q)).scalarCurvature |
| 32 | (spacetimeSlicePoint G.slices q) - |
| 33 | 2 * (G.leafwise.sliceConnection (G.spacetime.timeFunction q)).ricciNormSq |
| 34 | (spacetimeSlicePoint G.slices q) = |
| 35 | -(G.leafwise.sliceConnection t).laplacian |
| 36 | (G.leafwise.sliceConnection t).scalarCurvature ⟨q, ht⟩ - |
| 37 | 2 * (G.leafwise.sliceConnection t).ricciNormSq ⟨q, ht⟩ := by |
| 38 | subst t |
| 39 | rfl |
| 40 | |
| 41 | /-- The compatible cylinder transports the scalar evolution at every |
| 42 | interval time, including its included endpoints, Theorem 3.13, |
| 43 | equation (3.7), p. 41, and Definition 3.38, p. 61. -/ |
| 44 | theorem ordinaryGauge_backwardScalarEvolution (b : G.gaugeCover.index) |
| 45 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 46 | (hM04 : RicciFlowCurvatureTheory.{0}) |
| 47 | (hscalar : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ |
| 48 | (horizontalScalarCurvature G.leafwise)) |
| 49 | (W : OrdinaryGaugeWitness G.leafwise |
| 50 | (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 51 | (t : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 52 | (x : G.gaugeCover.spatial b) : |
| 53 | M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 54 | ((G.gaugeCover.cylinder b).toSpacetime (t, x)) = |
| 55 | -(G.leafwise.sliceConnection t.val).laplacian |
| 56 | (G.leafwise.sliceConnection t.val).scalarCurvature |
| 57 | (movingGaugeSliceMap (G.gaugeCover.cylinder b).toMovingSpacetimeGauge |
| 58 | G.slices t x) - |
| 59 | 2 * (G.leafwise.sliceConnection t.val).ricciNormSq |
| 60 | (movingGaugeSliceMap (G.gaugeCover.cylinder b).toMovingSpacetimeGauge |
| 61 | G.slices t x) := by |
| 62 | let K := G.gaugeCover.interval b |
| 63 | let T := G.timeIntervals.interval K |
| 64 | let e := (G.gaugeCover.cylinder b).toMovingSpacetimeGauge |
| 65 | have H := ordinaryGauge_movingCalculus b hCoordinates W |
| 66 | have hd := movingGauge_hasDerivWithinAt_comp e t x |
| 67 | (hscalar.mdifferentiableAt (by simp)) |
| 68 | have heq (s : ℝ) (hs : s ∈ K.domain) : |
| 69 | (W.flow.connection s).scalarCurvature x = |
| 70 | horizontalScalarCurvature G.leafwise (e.toSpacetime (T.realParam s, x)) := by |
| 71 | have h := H.scalar_eq (T.realParam s) x |
| 72 | rwa [T.realParam_val hs] at h |
| 73 | have hd' := hd.congr heq (heq t.val t.property) |
| 74 | have ho := hM04.scalar_evolution n (G.gaugeCover.spatial b) K.domain |
| 75 | W.flow t.val t.property x |
| 76 | have hderiv := (uniqueDiffWithinAt_of_spacetimeInterval K t).eq_deriv K.domain hd' ho |
| 77 | have hvelocity : movingGaugeTimeVelocity e t x = |
| 78 | G.spacetime.timeVector ((G.gaugeCover.cylinder b).toSpacetime (t, x)) := by |
| 79 | unfold movingGaugeTimeVelocity |
| 80 | rw [mfderiv_prod_eq_add_apply (e.smooth.mdifferentiableAt (by simp)), |
| 81 | map_zero, add_zero] |
| 82 | exact (G.gaugeCover.cylinder b).worldline_derivative t x |
| 83 | rw [hvelocity] at hderiv |
| 84 | calc |
| 85 | _ = -((W.flow.connection t.val).laplacian (W.flow.connection t.val).scalarCurvature x + |
| 86 | 2 * (W.flow.connection t.val).ricciNormSq x) := |
| 87 | congrArg (fun r : ℝ => -r) hderiv |
| 88 | _ = _ := by |
| 89 | rw [movingGauge_scalarLaplacian H hscalar t x, movingGauge_ricciNormSq H t x] |
| 90 | ring |
| 91 | |
| 92 | /-- The actual backward scalar equation holds at every generalized |
| 93 | spacetime point, with the retained connection on its selected slice, |
| 94 | Theorem 3.13, equation (3.7), p. 41, and Section 6.5, pp. 126-127. -/ |
| 95 | theorem backwardScalarEvolution (hM04 : RicciFlowCurvatureTheory.{0}) |
| 96 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (q : G.Point) : |
| 97 | let D := G.leafwise.sliceConnection (G.spacetime.timeFunction q) |
| 98 | let qs := spacetimeSlicePoint G.slices q |
| 99 | M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) q = |
| 100 | -D.laplacian D.scalarCurvature qs - 2 * D.ricciNormSq qs := by |
| 101 | have hCoordinates := hM12.coordinate_gauges X time I G.spacetime G.slices |
| 102 | G.timeIntervals G.gaugeCover G.leafwise |
| 103 | have hscalar := ((hM12.leafwise_calculus X time I G.spacetime G.slices |
| 104 | G.timeIntervals G.gaugeCover).2 G.leafwise).scalar_smooth |
| 105 | obtain ⟨b, ⟨t, x⟩, rfl⟩ := G.gaugeCover.covers q |
| 106 | obtain ⟨W⟩ := ordinaryGaugeWitness_nonempty b hCoordinates |
| 107 | dsimp only |
| 108 | rw [backwardScalarReaction_eq_slice _ ((G.gaugeCover.cylinder b).time_eq (t, x))] |
| 109 | exact ordinaryGauge_backwardScalarEvolution b hCoordinates hM04 hscalar W t x |
| 110 | |
| 111 | end PoincareMT.M14 |