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.Realization |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.PotentialCoefficient |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeCoordinates |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareEnergy |
| 5 | |
| 6 | /-! |
| 7 | # Actual closed square-time metric and potential coefficients |
| 8 | |
| 9 | Morgan-Tian equation (6.2) and Lemma 6.8, pp. 106, 108-109. |
| 10 | The regularized quadratic density has metric coefficient g(T-s^2) |
| 11 | and potential 2s^2 R. Their smoothness uses the actual closed time |
| 12 | domain and the interval-valued cylinder clock, including s=0. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- Open spatial tangent fibers are the prescribed Euclidean model. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | -- The metric coefficient is a nested continuous operator space. |
| 19 | set_option synthInstance.maxSize 2048 |
| 20 | |
| 21 | open Set |
| 22 | open scoped Manifold ContDiff |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | section Metric |
| 27 | |
| 28 | variable {n : ℕ} (U : TopologicalSpace.Opens (EuclideanSpace ℝ (Fin n))) |
| 29 | (g : ℝ → RiemannianMetric n U) |
| 30 | |
| 31 | /-- The actual coefficient of the half-quadratic square-time kinetic |
| 32 | density, equation (6.2), p. 106. -/ |
| 33 | noncomputable def squareMetricCoefficient (T : ℝ) (x : U) |
| 34 | (z : ℝ × EuclideanSpace ℝ (Fin n)) : |
| 35 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ := |
| 36 | Proofs.M11.ordinaryChartMetric g x (T - z.1 ^ 2, z.2) |
| 37 | |
| 38 | /-- The square coefficient evaluates to the prescribed spatial metric, |
| 39 | equation (6.2), p. 106. -/ |
| 40 | theorem squareMetricCoefficient_apply (T : ℝ) (x y : U) (s : ℝ) |
| 41 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 42 | squareMetricCoefficient U g T x (s, y.val) v w = (g (T - s ^ 2)).inner y v w := |
| 43 | ordinaryChartMetric_openSubset_apply U g x y (T - s ^ 2) v w |
| 44 | |
| 45 | /-- The square metric coefficient is smooth within its actual closed |
| 46 | parameter product, including zero, Lemma 6.8, pp. 108-109. -/ |
| 47 | theorem squareMetricCoefficient_contDiffOn {K J : Set ℝ} |
| 48 | (hg : RiemannianMetric.IsSmoothFamilyOn g K) (T : ℝ) (x : U) |
| 49 | (htime : ∀ s ∈ J, T - s ^ 2 ∈ K) : |
| 50 | ContDiffOn ℝ ∞ (squareMetricCoefficient U g T x) (J ×ˢ (U : Set _)) := by |
| 51 | let : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 52 | ContinuousLinearMap.toNormedAddCommGroup |
| 53 | let : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 54 | ContinuousLinearMap.toNormedSpace |
| 55 | let : NormedAddCommGroup |
| 56 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 57 | ContinuousLinearMap.toNormedAddCommGroup |
| 58 | let : NormedSpace ℝ |
| 59 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 60 | ContinuousLinearMap.toNormedSpace |
| 61 | have hm := Proofs.M11.ordinaryChartMetric_smooth g K hg x |
| 62 | apply hm.comp ((contDiffOn_const.sub (contDiffOn_fst.pow 2)).prodMk contDiffOn_snd) |
| 63 | intro z hz |
| 64 | refine ⟨htime z.1 hz.1, ?_⟩ |
| 65 | change z.2 ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).target |
| 66 | rw [U.chartAt_target_eq] |
| 67 | exact hz.2 |
| 68 | |
| 69 | /-- The square metric stays strictly positive at every actual spatial |
| 70 | point, including zero square time, Lemma 6.8, pp. 108-109. -/ |
| 71 | theorem squareMetricCoefficient_pos (T : ℝ) (x : U) (s : ℝ) |
| 72 | {y : EuclideanSpace ℝ (Fin n)} (hy : y ∈ U) (v : EuclideanSpace ℝ (Fin n)) (hv : v ≠ 0) : |
| 73 | 0 < squareMetricCoefficient U g T x (s, y) v v := by |
| 74 | rw [show y = (⟨y, hy⟩ : U).val from rfl, squareMetricCoefficient_apply] |
| 75 | exact (g (T - s ^ 2)).pos _ v hv |
| 76 | |
| 77 | /-- The old metric coefficient is twice square time times the new |
| 78 | coefficient, the momentum transport in Lemma 6.8, pp. 108-109. -/ |
| 79 | theorem backwardMetricCoefficient_square (T : ℝ) (x : U) {s : ℝ} (hs : 0 ≤ s) |
| 80 | (z : EuclideanSpace ℝ (Fin n)) : |
| 81 | backwardMetricCoefficient U g T x (s ^ 2, z) = |
| 82 | (2 * s) • squareMetricCoefficient U g T x (s, z) := by |
| 83 | simp only [backwardMetricCoefficient, squareMetricCoefficient, Real.sqrt_sq hs] |
| 84 | |
| 85 | end Metric |
| 86 | |
| 87 | universe u |
| 88 | |
| 89 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 90 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 91 | (b : G.gaugeCover.index) |
| 92 | (θ : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 93 | (x : G.gaugeCover.spatial b) |
| 94 | |
| 95 | /-- The actual regularized scalar potential in the supplied cylinder, |
| 96 | equation (6.2), p. 106. -/ |
| 97 | noncomputable def squarePotentialCoefficient (z : ℝ × EuclideanSpace ℝ (Fin n)) : ℝ := |
| 98 | 2 * z.1 ^ 2 * horizontalScalarCurvature G.leafwise |
| 99 | ((G.gaugeCover.cylinder b).toSpacetime |
| 100 | (θ z.1, (chartAt (EuclideanSpace ℝ (Fin n)) x).symm z.2)) |
| 101 | |
| 102 | /-- The actual lifted clock gives a smooth potential on the closed |
| 103 | parameter product, including time boundaries, Lemma 6.8, pp. 108-109. -/ |
| 104 | theorem squarePotentialCoefficient_contDiffOn |
| 105 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) {J : Set ℝ} |
| 106 | (hθ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡∂ 1) ∞ θ J) : |
| 107 | ContDiffOn ℝ ∞ (squarePotentialCoefficient b θ x) |
| 108 | (J ×ˢ (G.gaugeCover.spatial b : Set _)) := by |
| 109 | have ht : ContMDiffOn (𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n))) (𝓡∂ 1) ∞ |
| 110 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => θ z.1) |
| 111 | (J ×ˢ (G.gaugeCover.spatial b : Set (EuclideanSpace ℝ (Fin n)))) := by |
| 112 | have hf : ContDiff ℝ ∞ (Prod.fst : ℝ × EuclideanSpace ℝ (Fin n) → ℝ) := contDiff_fst |
| 113 | exact hθ.comp hf.contMDiff.contMDiffOn (fun _ hz => hz.1) |
| 114 | have hc : ContMDiffOn (𝓡 n) (𝓡 n) ∞ |
| 115 | (chartAt (EuclideanSpace ℝ (Fin n)) x).symm |
| 116 | (G.gaugeCover.spatial b : Set _) := by |
| 117 | simpa only [(G.gaugeCover.spatial b).chartAt_target_eq] using |
| 118 | (contMDiffOn_chart_symm (I := 𝓡 n) (x := x)) |
| 119 | have hs : ContMDiffOn (𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n))) (𝓡 n) ∞ |
| 120 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 121 | (chartAt (EuclideanSpace ℝ (Fin n)) x).symm z.2) |
| 122 | (J ×ˢ (G.gaugeCover.spatial b : Set (EuclideanSpace ℝ (Fin n)))) := by |
| 123 | have hf : ContDiff ℝ ∞ |
| 124 | (Prod.snd : ℝ × EuclideanSpace ℝ (Fin n) → EuclideanSpace ℝ (Fin n)) := contDiff_snd |
| 125 | exact hc.comp hf.contMDiff.contMDiffOn (fun _ hz => hz.2) |
| 126 | have H := (hM12.leafwise_calculus X time I G.spacetime G.slices |
| 127 | G.timeIntervals G.gaugeCover).2 G.leafwise |
| 128 | have hscalar := (H.scalar_smooth.comp (G.gaugeCover.cylinder b).smooth).comp_contMDiffOn |
| 129 | (ht.prodMk hs) |
| 130 | exact (contDiffOn_const.mul (contDiffOn_fst.pow 2)).mul hscalar.contDiffOn |
| 131 | |
| 132 | /-- The regularized potential is twice square time times the old |
| 133 | potential at the squared parameter, Lemma 6.8, pp. 108-109. -/ |
| 134 | theorem squarePotentialCoefficient_eq_backward {s : ℝ} (hs : 0 ≤ s) |
| 135 | (z : EuclideanSpace ℝ (Fin n)) : |
| 136 | squarePotentialCoefficient b (fun r => θ (r ^ 2)) x (s, z) = |
| 137 | (2 * s) * backwardPotentialCoefficient b θ x (s ^ 2, z) := by |
| 138 | simp only [squarePotentialCoefficient, backwardPotentialCoefficient, Real.sqrt_sq hs] |
| 139 | ring |
| 140 | |
| 141 | /-- The actual square-time gauge lift supplies smooth metric and |
| 142 | potential coefficients on every closed source segment, including its |
| 143 | endpoints, Lemma 6.8, pp. 108-109. -/ |
| 144 | theorem squareGauge_coefficients_contDiffOn |
| 145 | {T τ₁ τ₂ : ℝ} {q r : G.Point} (p : M14BackwardPath G T τ₁ τ₂ q r) |
| 146 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 147 | G.gaugeCover.spatial b) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 148 | {U : Set G.Point} |
| 149 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 150 | {C : Set ℝ} (hC : C ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 151 | (hsrc : ∀ s ∈ C, p.curve (s ^ 2) ∈ U) : |
| 152 | ContDiffOn ℝ ∞ |
| 153 | (squareMetricCoefficient (G.gaugeCover.spatial b) (G.gaugeCover.metric b).metric T x) |
| 154 | (C ×ˢ (G.gaugeCover.spatial b : Set _)) ∧ |
| 155 | ContDiffOn ℝ ∞ |
| 156 | (squarePotentialCoefficient b (fun s => (lift (p.curve (s ^ 2))).1) x) |
| 157 | (C ×ˢ (G.gaugeCover.spatial b : Set _)) := by |
| 158 | have hclock (s : ℝ) (hs : s ∈ C) : (lift (p.curve (s ^ 2))).1.val = T - s ^ 2 := |
| 159 | gaugeLift_time_eq p b lift hright (squarePath_parameter_mem p (hC hs)) (hsrc s hs) |
| 160 | have hθ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡∂ 1) ∞ |
| 161 | (fun s => (lift (p.curve (s ^ 2))).1) C := by |
| 162 | apply intervalLift_contMDiffOn (𝓘(ℝ, ℝ)) |
| 163 | (G.timeIntervals.interval (G.gaugeCover.interval b)) |
| 164 | have hc : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ (fun s : ℝ => T - s ^ 2) C := |
| 165 | (contDiff_const.sub (contDiff_id.pow 2)).contMDiff.contMDiffOn |
| 166 | exact hc.congr hclock |
| 167 | refine ⟨squareMetricCoefficient_contDiffOn (G.gaugeCover.spatial b) |
| 168 | (G.gaugeCover.metric b).metric (G.gaugeCover.metric b).smooth T x ?_, |
| 169 | squarePotentialCoefficient_contDiffOn b _ x hM12 hθ⟩ |
| 170 | intro s hs |
| 171 | rw [← hclock s hs] |
| 172 | exact (lift (p.curve (s ^ 2))).1.property |
| 173 | |
| 174 | end PoincareMT.M14 |