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.Gauge.CurvatureTransport |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Differential |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.EquationBridge |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.MetricDerivative |
| 5 | |
| 6 | /-! |
| 7 | # Assembly of moving-gauge calculus |
| 8 | |
| 9 | The slice geometry and curvature producers combine with metric and section |
| 10 | derivatives. The equation field follows from derivative uniqueness on the full |
| 11 | interval, including endpoints, with the prescribed negative drift term. |
| 12 | |
| 13 | Source: Morgan-Tian, Definitions 3.36-3.38 and Remark 3.37, pp. 60-61. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 26 | {S : ∀ t : ℝ, SpacetimeSliceGeometry F t} |
| 27 | {T : SmoothSpacetimeInterval K} {C : Type v} [TopologicalSpace C] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 29 | {e : MovingSpacetimeGauge F T C} |
| 30 | |
| 31 | theorem movingGaugeCalculus_of_derivatives |
| 32 | (D : LeafwiseLeviCivitaFamily F S) (G : MovingSpacetimeGaugeGeometry e) |
| 33 | (c : MetricLeviCivitaFamily G.metric) |
| 34 | (hDrift : ContMDiff (spacetimeModel n) |
| 35 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 36 | (fun p : T.Point × C => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 37 | (E := (TangentSpace (𝓡 n) : C → Type _)) p.2 (movingGaugeDrift G p.1 p.2))) |
| 38 | (hMetricDerivative : ∀ (t : T.Point) (x : C) (u v : TangentSpace (𝓡 n) x), |
| 39 | HasDerivWithinAt (fun s => (G.metric s).inner x u v) |
| 40 | (horizontalMetricLieDerivative F (e.toSpacetime (t, x)) |
| 41 | (G.spatialTangentEquiv t x u) (G.spatialTangentEquiv t x v) - |
| 42 | ordinaryMetricLieDerivative (G.metric t.val) (c t.val) |
| 43 | (movingGaugeDrift G t) x u v) K.domain t.val) |
| 44 | (hLeaf : ∀ (V : HorizontalSection F) (O : Set F.Point), |
| 45 | IsOpen O → IsSmoothHorizontalSectionOn F V O → |
| 46 | ∀ (t : T.Point) (x : C), e.toSpacetime (t, x) ∈ O → |
| 47 | ∀ u : TangentSpace (𝓡 n) x, |
| 48 | rawLeafwiseCovariantDerivative D V (e.toSpacetime (t, x)) |
| 49 | (G.spatialTangentEquiv t x u) = |
| 50 | G.spatialTangentEquiv t x ((c t.val).connection (pullbackHorizontalSection G V t) x u)) |
| 51 | (hHorizontal : ∀ (V : HorizontalSection F) (O : Set F.Point), |
| 52 | IsOpen O → IsSmoothHorizontalSectionOn F V O → |
| 53 | ∀ (t : T.Point) (x : C), e.toSpacetime (t, x) ∈ O → |
| 54 | ∀ (a : ℝ) (u : TangentSpace (𝓡 n) x), |
| 55 | rawHorizontalCovariantDerivative D V (e.toSpacetime (t, x)) |
| 56 | (mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (t, x) |
| 57 | (a • T.positiveTangent t, u)) = |
| 58 | G.spatialTangentEquiv t x |
| 59 | (a • movingGaugeSectionTimeDerivative G V t x + |
| 60 | (c t.val).connection (pullbackHorizontalSection G V t) x u - |
| 61 | a • (c t.val).connection (movingGaugeDrift G t) x |
| 62 | (pullbackHorizontalSection G V t x))) : MovingGaugeCalculus D G c := by |
| 63 | have hs := movingGaugeSliceGeometryFields (S := S) e G |
| 64 | have hc := movingGaugeCurvatureTransportFields D e G c |
| 65 | exact |
| 66 | { slice_localDiffeomorph := hs.slice_localDiffeomorph |
| 67 | slice_tangent_eq := hs.slice_tangent_eq |
| 68 | slice_metric_eq := hs.slice_metric_eq |
| 69 | drift_smooth := hDrift |
| 70 | time_vector_eq := movingGauge_time_vector_eq e G |
| 71 | projection_eq := movingGauge_projection_eq e G |
| 72 | metric_derivative := hMetricDerivative |
| 73 | riemann_eq := hc.riemann_eq |
| 74 | ricci_eq := hc.ricci_eq |
| 75 | scalar_eq := hc.scalar_eq |
| 76 | curvature_norm_eq := hc.curvature_norm_eq |
| 77 | leafwise_derivative_eq := hLeaf |
| 78 | horizontal_derivative_eq := hHorizontal |
| 79 | equation_iff := movingGaugeEquation_iff_of_metric_derivative_ricci_eq D G c |
| 80 | hMetricDerivative hc.ricci_eq } |
| 81 | |
| 82 | /-- The full moving-gauge calculus for the supplied retained connections. -/ |
| 83 | theorem movingGaugeCalculus |
| 84 | (D : LeafwiseLeviCivitaFamily F S) (G : MovingSpacetimeGaugeGeometry e) |
| 85 | (c : MetricLeviCivitaFamily G.metric) : MovingGaugeCalculus D G c := by |
| 86 | have hSection := movingGaugeSectionTransportFields D e G c |
| 87 | exact movingGaugeCalculus_of_derivatives D G c hSection.drift_smooth |
| 88 | (movingGauge_metric_derivative D G c) hSection.leafwise_derivative_eq |
| 89 | hSection.horizontal_derivative_eq |
| 90 | |
| 91 | end PoincareMT |