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.Ordinary.Capture.OrdinaryCapturePaths |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Measure.Density.InteriorDensity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.IntervalLift |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Theory |
| 5 | |
| 6 | /-! |
| 7 | # Action through the actual captured cylinder |
| 8 | |
| 9 | Morgan-Tian Definition 3.38, p. 61, and Definitions 6.1-6.2, |
| 10 | pp. 105-106. The actual cylinder differential identifies spatial velocity |
| 11 | with horizontal velocity. The supplied ordinary metric and connection |
| 12 | then give exactly the generalized action, including at physical times |
| 13 | on the boundary of the selected interval. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- Cylinder product tangent fibers retain the frozen spacetime model. |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 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 | {C : Type u} [TopologicalSpace C] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] [IsManifold (𝓡 n) ∞ C] |
| 31 | [T3Space C] [ConnectedSpace C] [SecondCountableTopology C] |
| 32 | [MeasurableSpace C] [BorelSpace C] {K : SpacetimeInterval} |
| 33 | {e : CompatibleSpacetimeCylinder G.spacetime (G.timeIntervals.interval K) C} |
| 34 | {g : SpacetimeCylinderMetric e} {F : RicciFlow n C K.domain} {T τmax : ℝ} |
| 35 | (D : M14OrdinaryCaptureData G C K e g F T τmax) |
| 36 | |
| 37 | /-- Use the supplied ordinary metric representative with the actual |
| 38 | captured spatial tangent equivalence, Definition 3.38, p. 61. -/ |
| 39 | def ordinaryCaptureGeometry : MovingSpacetimeGaugeGeometry e.toMovingSpacetimeGauge where |
| 40 | metric := F.metric |
| 41 | smooth := F.smooth |
| 42 | spatialTangentEquiv := g.spatialTangentEquiv |
| 43 | spatialTangentEquiv_eq := g.spatialTangentEquiv_eq |
| 44 | metric_eq := by |
| 45 | intro t c v w |
| 46 | rw [D.metric_eq t.property] |
| 47 | exact g.metric_eq t c v w |
| 48 | |
| 49 | /-- M12's moving calculus applies to the given ordinary connection and |
| 50 | the exact captured cylinder, Definition 3.38, p. 61. -/ |
| 51 | theorem ordinaryCapture_movingCalculus |
| 52 | (hCoordinates : SpacetimeGaugeTheory.{u, u} G.leafwise G.timeIntervals) : |
| 53 | MovingGaugeCalculus G.leafwise (ordinaryCaptureGeometry D) F.connection := |
| 54 | hCoordinates.moving_calculus C K e.toMovingSpacetimeGauge |
| 55 | (ordinaryCaptureGeometry D) F.connection |
| 56 | |
| 57 | omit [T3Space C] [ConnectedSpace C] [SecondCountableTopology C] |
| 58 | [MeasurableSpace C] [BorelSpace C] in |
| 59 | /-- The horizontal projection of a compatible cylinder curve is its |
| 60 | actual spatial velocity, Definition 3.38 and Definition 6.1, pp. 61, 105. -/ |
| 61 | theorem ordinaryCapture_cylinderVelocity |
| 62 | (θ : ℝ → (G.timeIntervals.interval K).Point) (q : ℝ → C) {s : ℝ} |
| 63 | (hθ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡∂ 1) θ s) |
| 64 | (hq : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) q s) : |
| 65 | projectedCurveVelocity G (fun r => e.toSpacetime (θ r, q r)) s = |
| 66 | g.spatialTangentEquiv (θ s) (q s) (curveVelocity q s) := by |
| 67 | let J := G.timeIntervals.interval K |
| 68 | let vt := mfderiv (𝓘(ℝ, ℝ)) (𝓡∂ 1) θ s (1 : ℝ) |
| 69 | have ht : vt = J.inclusionDerivative (θ s) vt • J.positiveTangent (θ s) := by |
| 70 | apply (J.inclusionDerivative (θ s)).injective |
| 71 | simp only [map_smul, SmoothSpacetimeInterval.positiveTangent, |
| 72 | ContinuousLinearEquiv.apply_symm_apply, smul_eq_mul, mul_one] |
| 73 | have he := e.smooth.mdifferentiableAt (by simp : (∞ : ℕ∞ω) ≠ 0) |
| 74 | (x := (θ s, q s)) |
| 75 | have hd := mfderiv_comp_apply s he (hθ.prodMk hq) (1 : ℝ) |
| 76 | rw [mfderiv_prodMk hθ hq] at hd |
| 77 | change mfderiv (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 78 | (fun r => e.toSpacetime (θ r, q r)) s (1 : ℝ) = |
| 79 | mfderiv (spacetimeModel n) (spacetimeModel n) e.toSpacetime (θ s, q s) |
| 80 | (vt, curveVelocity q s) at hd |
| 81 | rw [mfderiv_prod_eq_add_apply he, ht, map_smul, e.worldline_derivative, |
| 82 | ← g.spatialTangentEquiv_eq] at hd |
| 83 | have hzero : G.spacetime.horizontalProjection (e.toSpacetime (θ s, q s)) |
| 84 | (G.spacetime.timeVector (e.toSpacetime (θ s, q s))) = 0 := by |
| 85 | apply Subtype.ext |
| 86 | simp only [G.spacetime.horizontalProjection_eq, G.spacetime.timeVector_normalized, |
| 87 | one_smul, sub_self, ZeroMemClass.coe_zero] |
| 88 | unfold projectedCurveVelocity |
| 89 | rw [hd, map_add, map_smul, hzero, |
| 90 | smul_zero, zero_add, G.spacetime.horizontalProjection_identity] |
| 91 | |
| 92 | include D in |
| 93 | /-- Scalar and kinetic terms in the captured cylinder are the terms |
| 94 | of the supplied ordinary flow, Definition 6.2, p. 106. -/ |
| 95 | theorem ordinaryCapture_cylinderDensity |
| 96 | (hCoordinates : SpacetimeGaugeTheory.{u, u} G.leafwise G.timeIntervals) |
| 97 | (θ : ℝ → (G.timeIntervals.interval K).Point) (q : ℝ → C) {s : ℝ} |
| 98 | (hθ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡∂ 1) θ s) |
| 99 | (hq : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) q s) : |
| 100 | M14RawLIntegrand G (fun r => e.toSpacetime (θ r, q r)) |
| 101 | (projectedCurveVelocity G (fun r => e.toSpacetime (θ r, q r))) s = |
| 102 | Real.sqrt s * ((F.connection (θ s).val).scalarCurvature (q s) + |
| 103 | (F.metric (θ s).val).inner (q s) (curveVelocity q s) (curveVelocity q s)) := by |
| 104 | unfold M14RawLIntegrand |
| 105 | rw [ordinaryCapture_cylinderVelocity θ q hθ hq, ← g.metric_eq, |
| 106 | ← D.metric_eq (θ s).property] |
| 107 | have hscalar := (ordinaryCapture_movingCalculus D hCoordinates).scalar_eq (θ s) (q s) |
| 108 | change (F.connection (θ s).val).scalarCurvature (q s) = |
| 109 | horizontalScalarCurvature G.leafwise (e.toSpacetime (θ s, q s)) at hscalar |
| 110 | rw [← hscalar] |
| 111 | |
| 112 | /-- Every captured generalized path has exactly the ordinary action of |
| 113 | its supplied mapped path, Definitions 6.1-6.2, pp. 105-106. -/ |
| 114 | theorem ordinaryCapture_action_transport |
| 115 | (hCoordinates : SpacetimeGaugeTheory.{u, u} G.leafwise G.timeIntervals) |
| 116 | {τ₁ τ₂ : ℝ} {x y : G.Point} (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 117 | (hcaptured : ∀ s ∈ Icc τ₁ τ₂, p.curve s ∈ range e.toSpacetime) : |
| 118 | backwardLLength F T τ₁ τ₂ (D.path_map τ₁ τ₂ x y p hcaptured).curve = |
| 119 | M14BackwardLAction G p := by |
| 120 | classical |
| 121 | let q := D.path_map τ₁ τ₂ x y p hcaptured |
| 122 | let θ : ℝ → (G.timeIntervals.interval K).Point := fun s => |
| 123 | if hs : s ∈ Icc τ₁ τ₂ then ⟨T - s, q.time_mem s hs⟩ |
| 124 | else ⟨T - τ₁, q.time_mem τ₁ ⟨le_rfl, q.ordered.le⟩⟩ |
| 125 | have hθval (s : ℝ) (hs : s ∈ Icc τ₁ τ₂) : (θ s).val = T - s := by |
| 126 | simp only [θ, dif_pos hs] |
| 127 | have hθsmooth : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡∂ 1) ∞ θ (Ioo τ₁ τ₂) := by |
| 128 | apply intervalLift_contMDiffOn |
| 129 | exact (contMDiff_const.sub contMDiff_id).contMDiffOn.congr |
| 130 | (fun s hs => hθval s (Ioo_subset_Icc_self hs)) |
| 131 | apply intervalIntegral.integral_congr_Ioo_of_le p.tau_lt.le |
| 132 | intro s hs |
| 133 | have hθ := ((hθsmooth s hs).contMDiffAt (isOpen_Ioo.mem_nhds hs)).mdifferentiableAt |
| 134 | (by simp) |
| 135 | have hq := ((q.regular s hs).contMDiffAt (isOpen_Ioo.mem_nhds hs)).mdifferentiableAt |
| 136 | (by simp) |
| 137 | have hnear : p.curve =ᶠ[𝓝 s] (fun r => e.toSpacetime (θ r, q.curve r)) := by |
| 138 | filter_upwards [isOpen_Ioo.mem_nhds hs] with r hr |
| 139 | have hr' := Ioo_subset_Icc_self hr |
| 140 | simpa only [θ, dif_pos hr'] using |
| 141 | (D.path_capture_eq τ₁ τ₂ x y p hcaptured r hr').symm |
| 142 | have hraw : M14BackwardLIntegrand G p s = |
| 143 | M14RawLIntegrand G p.curve (projectedCurveVelocity G p.curve) s := by |
| 144 | unfold M14BackwardLIntegrand M14RawLIntegrand |
| 145 | rw [backwardPath_velocity_eq_projected p hs] |
| 146 | rw [hraw, rawLIntegrand_projectedVelocity_congr hnear, |
| 147 | ordinaryCapture_cylinderDensity D hCoordinates θ q.curve hθ hq, |
| 148 | hθval s (Ioo_subset_Icc_self hs)] |
| 149 | rfl |
| 150 | |
| 151 | end PoincareMT.M14 |