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.Paths.SquareRoot.Equation.SquareCoordinateMomentum |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Families.SquareGaugeEnergy |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Energy.FiniteQuadraticMomentum |
| 4 | |
| 5 | /-! |
| 6 | # Closed endpoint smoothness in an actual square-time gauge |
| 7 | |
| 8 | Morgan-Tian Lemma 6.8, pp. 108-109. Finite action gives the actual |
| 9 | coordinate L2 velocity, and the transported Euler equation gives its |
| 10 | momentum derivative. Smooth positive closed coefficients then recover |
| 11 | all endpoint derivatives. The actual cylinder reconstructs the curve. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Open spatial tangent models and Riesz operator spaces retain their supplied instances. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | -- The endpoint theorem contains nested spatial metric derivatives. |
| 18 | set_option synthInstance.maxSize 2048 |
| 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 | {T τ₁ τ₂ : ℝ} {x y : G.Point} (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 30 | (b : G.gaugeCover.index) |
| 31 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 32 | G.gaugeCover.spatial b) |
| 33 | |
| 34 | private noncomputable local instance dualNormedGroup : |
| 35 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 36 | ContinuousLinearMap.toNormedAddCommGroup |
| 37 | |
| 38 | private noncomputable local instance dualNormedSpace : |
| 39 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace |
| 40 | |
| 41 | private noncomputable local instance bilinearNormedGroup : |
| 42 | NormedAddCommGroup |
| 43 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 44 | ContinuousLinearMap.toNormedAddCommGroup |
| 45 | |
| 46 | private noncomputable local instance bilinearNormedSpace : |
| 47 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 48 | ContinuousLinearMap.toNormedSpace |
| 49 | |
| 50 | private noncomputable local instance trilinearNormedGroup : |
| 51 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 52 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 53 | ContinuousLinearMap.toNormedAddCommGroup |
| 54 | |
| 55 | private noncomputable local instance trilinearNormedSpace : |
| 56 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 57 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 58 | ContinuousLinearMap.toNormedSpace |
| 59 | |
| 60 | /-- The actual square-time spatial coordinates of every Euler path |
| 61 | are smooth through the endpoints of every compact gauge segment, |
| 62 | including initial time zero, Lemma 6.8, pp. 108-109. -/ |
| 63 | theorem squareGauge_spatial_contDiffOn |
| 64 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 65 | (E : M14PullbackExtension G p.curve (Ioo τ₁ τ₂) p.horizontal_velocity) |
| 66 | (heuler : M14EulerEquation G p E) |
| 67 | {U : Set G.Point} (hU : IsOpen U) |
| 68 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 69 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 70 | {a c : ℝ} (hac : a < c) (hAa : Real.sqrt τ₁ ≤ a) (hcB : c ≤ Real.sqrt τ₂) |
| 71 | (hsrc : ∀ s ∈ Icc a c, p.curve (s ^ 2) ∈ U) : |
| 72 | ContDiffOn ℝ ∞ (fun s => (lift (p.curve (s ^ 2))).2.val) (Icc a c) := by |
| 73 | let u := fun s => (lift (p.curve (s ^ 2))).2.val |
| 74 | let x₀ := (lift (p.curve (a ^ 2))).2 |
| 75 | let B := squareMetricCoefficient (G.gaugeCover.spatial b) (G.gaugeCover.metric b).metric T x₀ |
| 76 | let V := squarePotentialCoefficient b (fun s => (lift (p.curve (s ^ 2))).1) x₀ |
| 77 | obtain ⟨hB, hV⟩ := squareGauge_coefficients_contDiffOn b x₀ p lift hM12 hright |
| 78 | (Icc_subset_Icc hAa hcB) hsrc |
| 79 | obtain ⟨hu, hud, hd⟩ := squarePath_gauge_derivative_memLp p b lift hM12 hlift hright |
| 80 | hac hAa hcB hsrc |
| 81 | have hPd := squareGauge_coordinate_momentum p b lift x₀ hCoordinates hM12 E heuler |
| 82 | hU hlift hright hAa hcB hsrc |
| 83 | exact (ODE.contDiffOn_of_finite_quadratic_momentum hac (G.gaugeCover.spatial b).isOpen B V |
| 84 | hB hV (fun z hz v hv => squareMetricCoefficient_pos (G.gaugeCover.spatial b) |
| 85 | (G.gaugeCover.metric b).metric T x₀ z.1 hz.2 v hv) u (deriv u) hu |
| 86 | (fun s _ => (lift (p.curve (s ^ 2))).2.property) hud hd hPd).1 |
| 87 | |
| 88 | /-- The actual cylinder reconstructs a square-time Euler path smoothly |
| 89 | on the entire compact gauge segment, Lemma 6.8, pp. 108-109. -/ |
| 90 | theorem squareGauge_curve_contMDiffOn |
| 91 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 92 | (E : M14PullbackExtension G p.curve (Ioo τ₁ τ₂) p.horizontal_velocity) |
| 93 | (heuler : M14EulerEquation G p E) |
| 94 | {U : Set G.Point} (hU : IsOpen U) |
| 95 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 96 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 97 | {a c : ℝ} (hac : a < c) (hAa : Real.sqrt τ₁ ≤ a) (hcB : c ≤ Real.sqrt τ₂) |
| 98 | (hsrc : ∀ s ∈ Icc a c, p.curve (s ^ 2) ∈ U) : |
| 99 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ (fun s => p.curve (s ^ 2)) (Icc a c) := by |
| 100 | have hu := squareGauge_spatial_contDiffOn p b lift hCoordinates hM12 E heuler |
| 101 | hU hlift hright hac hAa hcB hsrc |
| 102 | have hspace : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ |
| 103 | (fun s => (lift (p.curve (s ^ 2))).2) (Icc a c) := by |
| 104 | intro s hs |
| 105 | exact (ContMDiffWithinAt.subtypeVal_comp_iff (G.gaugeCover.spatial b) _ _ s).mp |
| 106 | (hu.contMDiffOn s hs) |
| 107 | have hθ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡∂ 1) ∞ |
| 108 | (fun s => (lift (p.curve (s ^ 2))).1) (Icc a c) := by |
| 109 | apply intervalLift_contMDiffOn (𝓘(ℝ, ℝ)) |
| 110 | (G.timeIntervals.interval (G.gaugeCover.interval b)) |
| 111 | have hc : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ (fun s : ℝ => T - s ^ 2) (Icc a c) := |
| 112 | (contDiff_const.sub (contDiff_id.pow 2)).contMDiff.contMDiffOn |
| 113 | exact hc.congr (fun s hs => gaugeLift_time_eq p b lift hright |
| 114 | (squarePath_parameter_mem p (Icc_subset_Icc hAa hcB hs)) (hsrc s hs)) |
| 115 | have hcyl := (G.gaugeCover.cylinder b).smooth.comp_contMDiffOn (hθ.prodMk hspace) |
| 116 | exact hcyl.congr (fun s hs => (hright _ (hsrc s hs)).symm) |
| 117 | |
| 118 | end PoincareMT.M14 |