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.Action.SquareCurve |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Theory |
| 3 | |
| 4 | /-! |
| 5 | # Actual variations constructed from smooth square families |
| 6 | |
| 7 | Morgan-Tian equation (6.2), Lemmas 6.4 and 6.8, pp. 106-109. A smooth |
| 8 | square family with its prescribed clock gives the exact frozen variation |
| 9 | record. The original family uses the supplied curve outside the interval, |
| 10 | and the actual projected derivative supplies its horizontal velocity. |
| 11 | The construction follows M08 SquareVariationConstruction while permitting |
| 12 | closed square domains and retaining the generalized clock condition. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- Curve equality transports the actual horizontal fibers in the frozen variation record. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 27 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 28 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 29 | |
| 30 | /-- The original-time family obtained from a square family, preserving |
| 31 | the original curve outside the interval, Lemma 6.4, pp. 107-108. -/ |
| 32 | noncomputable def backwardFamilyOfSquare (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 33 | (H : ℝ × ℝ → G.Point) (τ v : ℝ) : G.Point := by |
| 34 | classical |
| 35 | exact if τ ∈ Icc τ₁ τ₂ then H (Real.sqrt τ, v) else p.curve τ |
| 36 | |
| 37 | variable {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 38 | |
| 39 | /-- On the actual time interval the constructed family is the |
| 40 | square-root substitution, equation (6.2), p. 106. -/ |
| 41 | theorem backwardFamilyOfSquare_eq (H : ℝ × ℝ → G.Point) |
| 42 | {τ : ℝ} (hτ : τ ∈ Icc τ₁ τ₂) (v : ℝ) : |
| 43 | backwardFamilyOfSquare p H τ v = H (Real.sqrt τ, v) := by |
| 44 | simp only [backwardFamilyOfSquare, if_pos hτ] |
| 45 | |
| 46 | /-- Squaring recovers the supplied family at every closed square point, |
| 47 | including zero, equation (6.2), p. 106. -/ |
| 48 | theorem backwardFamilyOfSquare_square (H : ℝ × ℝ → G.Point) |
| 49 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) (v : ℝ) : |
| 50 | H (s, v) = backwardFamilyOfSquare p H (s ^ 2) v := by |
| 51 | have hs0 := (Real.sqrt_nonneg τ₁).trans hs.1 |
| 52 | have hτ : s ^ 2 ∈ Icc τ₁ τ₂ := by |
| 53 | constructor |
| 54 | · nlinarith [Real.sq_sqrt p.tau_nonneg, Real.sqrt_nonneg τ₁, hs.1] |
| 55 | · nlinarith [Real.sq_sqrt (p.tau_nonneg.trans p.tau_lt.le), hs.2, |
| 56 | Real.sqrt_nonneg τ₂] |
| 57 | rw [backwardFamilyOfSquare_eq H hτ, Real.sqrt_sq hs0] |
| 58 | |
| 59 | private theorem square_slice_smooth {H : ℝ × ℝ → G.Point} {P : Set ℝ} |
| 60 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 61 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P)) {v : ℝ} (hv : v ∈ P) : |
| 62 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ (fun s => H (s, v)) |
| 63 | (M14SqrtParameterInterval τ₁ τ₂) := |
| 64 | hH.comp (contMDiff_id.prodMk (contMDiff_const (c := v))).contMDiffOn |
| 65 | (fun _ hs => ⟨hs, hv⟩) |
| 66 | |
| 67 | /-- Each constructed original-time slice is smooth on the interior, |
| 68 | the regularity needed in Lemma 6.4, pp. 107-108. -/ |
| 69 | theorem backwardFamilyOfSquare_smooth {H : ℝ × ℝ → G.Point} {P : Set ℝ} |
| 70 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 71 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P)) {v : ℝ} (hv : v ∈ P) : |
| 72 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ |
| 73 | (fun τ => backwardFamilyOfSquare p H τ v) (Ioo τ₁ τ₂) := |
| 74 | (sqrtPullback_contMDiffOn p.tau_nonneg (square_slice_smooth hH hv)).congr |
| 75 | (fun _ hτ => backwardFamilyOfSquare_eq H (Ioo_subset_Icc_self hτ) v) |
| 76 | |
| 77 | /-- The constructed family has the prescribed original backward clock, |
| 78 | including both endpoints, Definitions 6.1-6.2, pp. 105-106. -/ |
| 79 | theorem backwardFamilyOfSquare_time {H : ℝ × ℝ → G.Point} {P : Set ℝ} |
| 80 | (hclock : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ v ∈ P, |
| 81 | G.spacetime.timeFunction (H (s, v)) = T - s ^ 2) |
| 82 | {τ v : ℝ} (hτ : τ ∈ Icc τ₁ τ₂) (hv : v ∈ P) : |
| 83 | G.spacetime.timeFunction (backwardFamilyOfSquare p H τ v) = T - τ := by |
| 84 | rw [backwardFamilyOfSquare_eq H hτ, hclock _ |
| 85 | ⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩ v hv, |
| 86 | Real.sq_sqrt (p.tau_nonneg.trans hτ.1)] |
| 87 | |
| 88 | /-- Smooth square-family slices give integrable actual original actions, |
| 89 | even at zero initial time, equation (6.2), p. 106. -/ |
| 90 | theorem backwardFamilyOfSquare_action_integrable |
| 91 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) {H : ℝ × ℝ → G.Point} {P : Set ℝ} |
| 92 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 93 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P)) {v : ℝ} (hv : v ∈ P) : |
| 94 | IntervalIntegrable (M14RawLIntegrand G (fun τ => backwardFamilyOfSquare p H τ v) |
| 95 | (projectedCurveVelocity G (fun τ => backwardFamilyOfSquare p H τ v))) |
| 96 | MeasureTheory.volume τ₁ τ₂ := by |
| 97 | have hint := sqrtPullback_action_integrable hM12 p.tau_nonneg p.tau_lt |
| 98 | (square_slice_smooth hH hv) |
| 99 | apply hint.congr_uIoo |
| 100 | intro τ hτ |
| 101 | rw [uIoo_of_le p.tau_lt.le] at hτ |
| 102 | apply rawLIntegrand_projectedVelocity_congr |
| 103 | filter_upwards [isOpen_Ioo.mem_nhds hτ] with t ht |
| 104 | exact (backwardFamilyOfSquare_eq H (Ioo_subset_Icc_self ht) v).symm |
| 105 | |
| 106 | /-- A smooth square family with the actual clock constructs every field |
| 107 | of the frozen generalized variation record, Lemma 6.4, pp. 107-108. -/ |
| 108 | noncomputable def variationOfSquare (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 109 | (R : M14SquareRootPath G p) (H : ℝ × ℝ → G.Point) (r : ℝ) (hr : 0 < r) |
| 110 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 111 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ Ioo (-r) r)) |
| 112 | (hclock : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ v ∈ Ioo (-r) r, |
| 113 | G.spacetime.timeFunction (H (s, v)) = T - s ^ 2) |
| 114 | (hzero : ∀ s, H (s, 0) = R.curve s) : M14LVariationData G p R := by |
| 115 | classical |
| 116 | let family := backwardFamilyOfSquare p H |
| 117 | let velocity := fun v => projectedCurveVelocity G (fun τ => family τ v) |
| 118 | have hsquare (s : ℝ) (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) (v : ℝ) : |
| 119 | H (s, v) = family (s ^ 2) v := backwardFamilyOfSquare_square H hs v |
| 120 | refine { |
| 121 | family := family |
| 122 | family_velocity := velocity |
| 123 | family_at_zero := ?_ |
| 124 | radius := r |
| 125 | radius_pos := hr |
| 126 | parameterDomain := Ioo (-r) r |
| 127 | parameterDomain_eq := rfl |
| 128 | parameterDomain_nonempty := ⟨0, neg_lt_zero.mpr hr, hr⟩ |
| 129 | family_time := fun _ hv _ hτ => backwardFamilyOfSquare_time hclock hτ hv |
| 130 | family_derivative := ?_ |
| 131 | squareFamily := fun s v => H (s, v) |
| 132 | squareDomain := M14SqrtParameterInterval τ₁ τ₂ ×ˢ Ioo (-r) r |
| 133 | square_contains := Subset.rfl |
| 134 | square_smooth := hH |
| 135 | square_agrees := fun s hs v _ => hsquare s hs v |
| 136 | square_base := hzero |
| 137 | square_horizontal_velocity := fun s v => if hs : s ∈ M14SqrtParameterInterval τ₁ τ₂ |
| 138 | then (hsquare s hs v).symm ▸ ((2 * s) • velocity v (s ^ 2)) else 0 |
| 139 | square_horizontal_agrees := ?_ |
| 140 | left_endpoint_fixed := ∀ v ∈ Ioo (-r) r, family τ₁ v = p.curve τ₁ |
| 141 | left_endpoint_fixed_spec := Iff.rfl |
| 142 | right_endpoint_fixed := ∀ v ∈ Ioo (-r) r, family τ₂ v = p.curve τ₂ |
| 143 | right_endpoint_fixed_spec := Iff.rfl |
| 144 | action_integrable := fun _ hv => backwardFamilyOfSquare_action_integrable hM12 hH hv } |
| 145 | · intro τ |
| 146 | by_cases hτ : τ ∈ Icc τ₁ τ₂ |
| 147 | · rw [show family τ 0 = H (Real.sqrt τ, 0) from backwardFamilyOfSquare_eq H hτ 0, |
| 148 | hzero, R.agrees _ ⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩, |
| 149 | Real.sq_sqrt (p.tau_nonneg.trans hτ.1)] |
| 150 | · simp only [family, backwardFamilyOfSquare, if_neg hτ] |
| 151 | · intro v hv τ hτ |
| 152 | apply projectedCurveVelocity_derivative_eq (T := T) |
| 153 | (((backwardFamilyOfSquare_smooth hH hv τ hτ).contMDiffAt |
| 154 | (isOpen_Ioo.mem_nhds hτ)).mdifferentiableAt (by simp)) |
| 155 | filter_upwards [isOpen_Ioo.mem_nhds hτ] with t ht |
| 156 | exact backwardFamilyOfSquare_time hclock (Ioo_subset_Icc_self ht) hv |
| 157 | · intro s hs v _ |
| 158 | rw [dif_pos hs] |
| 159 | |
| 160 | /-- Actual fixed square endpoints give the frozen fixed-endpoint |
| 161 | condition for the constructed variation, Lemma 6.4, pp. 107-108. -/ |
| 162 | theorem variationOfSquare_bothEndpointsFixed (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 163 | (R : M14SquareRootPath G p) (H : ℝ × ℝ → G.Point) (r : ℝ) (hr : 0 < r) |
| 164 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 165 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ Ioo (-r) r)) |
| 166 | (hclock : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ v ∈ Ioo (-r) r, |
| 167 | G.spacetime.timeFunction (H (s, v)) = T - s ^ 2) |
| 168 | (hzero : ∀ s, H (s, 0) = R.curve s) |
| 169 | (hleft : ∀ v ∈ Ioo (-r) r, H (Real.sqrt τ₁, v) = p.curve τ₁) |
| 170 | (hright : ∀ v ∈ Ioo (-r) r, H (Real.sqrt τ₂, v) = p.curve τ₂) : |
| 171 | M14BothEndpointsFixed (variationOfSquare hM12 R H r hr hH hclock hzero) := by |
| 172 | constructor |
| 173 | · intro v hv |
| 174 | exact (backwardFamilyOfSquare_eq H ⟨le_rfl, p.tau_lt.le⟩ v).trans (hleft v hv) |
| 175 | · intro v hv |
| 176 | exact (backwardFamilyOfSquare_eq H ⟨p.tau_lt.le, le_rfl⟩ v).trans (hright v hv) |
| 177 | |
| 178 | end PoincareMT.M14 |