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.ReducedGeometry.ReducedLength.Calculus.CompactDerivativeExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.VariationFieldSmooth |
| 3 | |
| 4 | /-! |
| 5 | # Square-regular data for an actual variation field |
| 6 | |
| 7 | Reusing the variation extension along any supplied square regularization |
| 8 | preserves its first derivative. A new derivative extension is constructed |
| 9 | from the actual connection on the flow window. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | set_option maxHeartbeats 800000 |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | open Filter |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] |
| 26 | {J : Set ℝ} {F : RicciFlow n M J} {T a b : ℝ} {p : BackwardTimePath F T a b} |
| 27 | |
| 28 | local notation "Q" => EuclideanSpace ℝ (Fin n) |
| 29 | |
| 30 | theorem variation_baseSquareCurve_eq (V : LVariation F T a b p) |
| 31 | (s : ℝ) (hs : s ∈ sqrtParameterInterval a b) : |
| 32 | V.baseSquareCurve s = p.curve (s ^ 2) := |
| 33 | (V.square_agrees s hs 0 ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩).trans |
| 34 | (V.at_zero (s ^ 2)) |
| 35 | |
| 36 | set_option backward.isDefEq.respectTransparency false in |
| 37 | theorem squareVariationField_eq_variationField (V : LVariation F T a b p) |
| 38 | (s : ℝ) (hs : s ∈ sqrtParameterInterval a b) : |
| 39 | (squareVariationField V s : Q) = variationField V (s ^ 2) := by |
| 40 | have heq : V.squareFamily s =ᶠ[𝓝 (0 : ℝ)] V.family (s ^ 2) := by |
| 41 | filter_upwards [isOpen_Ioo.mem_nhds |
| 42 | (show (0 : ℝ) ∈ Set.Ioo (-V.radius) V.radius from |
| 43 | ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩)] with u hu |
| 44 | exact V.square_agrees s hs u hu |
| 45 | have hd := heq.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 46 | have hv := congrArg (fun L : ℝ →L[ℝ] Q ↦ L 1) hd |
| 47 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 48 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 49 | cases h |
| 50 | rfl |
| 51 | unfold variationField |
| 52 | rw [hcast] |
| 53 | exact hv |
| 54 | |
| 55 | theorem exists_sqrtRegularField_of_variation_extension (τmax : ℝ) (hτmax : 0 < τmax) |
| 56 | (hmax : b < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 57 | (R : SqrtRegularPath p) (V : LVariation F T a b p) |
| 58 | (E : ParametricAlongCurveExtensionOn (sqrtParameterInterval a b) |
| 59 | V.baseSquareCurve (squareVariationField V)) : |
| 60 | ∃ D : SqrtRegularField R (variationField V), |
| 61 | ∀ s ∈ sqrtParameterInterval a b, |
| 62 | (D.firstDerivative s : Q) = pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) |
| 63 | V.baseSquareCurve (squareVariationField V) (sqrtParameterInterval a b) E s := by |
| 64 | let K := sqrtParameterInterval a b |
| 65 | have hbase (s : ℝ) (hs : s ∈ K) : R.curve s = V.baseSquareCurve s := |
| 66 | (R.agrees s hs).trans (variation_baseSquareCurve_eq V s hs).symm |
| 67 | let Y : ∀ s, TangentSpace (𝓡 n) (R.curve s) := fun s ↦ E.extension s (R.curve s) |
| 68 | let E' : ParametricAlongCurveExtensionOn K R.curve Y := { |
| 69 | extension := E.extension |
| 70 | domain := E.domain |
| 71 | open_domain := E.open_domain |
| 72 | graph_mem := by |
| 73 | intro s hs |
| 74 | rw [hbase s hs] |
| 75 | exact E.graph_mem s hs |
| 76 | smooth := E.smooth |
| 77 | agrees := fun _ _ ↦ rfl |
| 78 | } |
| 79 | have hKd : UniqueDiffOn ℝ K := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.nonnegative p.ordered) |
| 80 | have htime : K ⊆ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) := by |
| 81 | intro s hs |
| 82 | exact ⟨(neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le |
| 83 | ((Real.sqrt_nonneg a).trans hs.1), |
| 84 | hs.2.trans_lt (Real.sqrt_lt_sqrt (p.nonnegative.trans p.ordered.le) hmax)⟩ |
| 85 | obtain ⟨E2⟩ := nonempty_pullbackDerivativeExtensionOn_compact F T τmax hτmax hwindow |
| 86 | R.curve Y R.domain K R.open_domain R.interval_subset isCompact_Icc hKd htime R.smooth E' |
| 87 | let D : SqrtRegularField R (variationField V) := { |
| 88 | field := Y |
| 89 | agrees := by |
| 90 | intro s hs |
| 91 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 92 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 93 | cases h |
| 94 | rfl |
| 95 | rw [hcast] |
| 96 | change (E.extension s (R.curve s) : Q) = variationField V (s ^ 2) |
| 97 | rw [hbase s hs] |
| 98 | exact (E.agrees s hs).trans (squareVariationField_eq_variationField V s hs) |
| 99 | extension := E' |
| 100 | derivative_extension := E2 |
| 101 | } |
| 102 | refine ⟨D, ?_⟩ |
| 103 | intro s hs |
| 104 | have hd := mfderivWithin_congr_of_mem (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 105 | (fun r hr ↦ hbase r hr) hs |
| 106 | have hvel : (curveVelocityWithin (n := n) R.curve K s : Q) = |
| 107 | curveVelocityWithin (n := n) V.baseSquareCurve K s := |
| 108 | congrArg (fun L : ℝ →L[ℝ] Q ↦ L 1) hd |
| 109 | change (deriv (fun r ↦ E.extension r (R.curve s)) s + |
| 110 | (F.connection (T - s ^ 2)).connection (E.extension s) (R.curve s) |
| 111 | (curveVelocityWithin (n := n) R.curve K s) : Q) = |
| 112 | deriv (fun r ↦ E.extension r (V.baseSquareCurve s)) s + |
| 113 | (F.connection (T - s ^ 2)).connection (E.extension s) (V.baseSquareCurve s) |
| 114 | (curveVelocityWithin (n := n) V.baseSquareCurve K s) |
| 115 | rw [hvel, hbase s hs] |
| 116 | |
| 117 | theorem nonempty_variationFieldExtension (V : LVariation F T a b p) : |
| 118 | Nonempty (ParametricAlongCurveExtensionOn (sqrtParameterInterval a b) |
| 119 | V.baseSquareCurve (squareVariationField V)) := by |
| 120 | let U := (fun s : ℝ ↦ (s, (0 : ℝ))) ⁻¹' V.squareDomain |
| 121 | obtain ⟨hU, hKU, hY⟩ := squareVariationField_smooth V |
| 122 | have hf : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ |
| 123 | (fun z ↦ V.squareFamily z.1 z.2) V.squareDomain := by |
| 124 | convert! V.square_smooth using 1 <;> |
| 125 | simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 126 | have hi : ContMDiff (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ × ℝ)) ∞ (fun s : ℝ ↦ (s, (0 : ℝ))) := |
| 127 | (contDiff_id.prodMk contDiff_const).contMDiff |
| 128 | have hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ V.baseSquareCurve U := |
| 129 | hf.comp hi.contMDiffOn (fun s hs ↦ hs) |
| 130 | exact nonempty_parametricFieldExtensionOn_compact V.baseSquareCurve (squareVariationField V) |
| 131 | U (sqrtParameterInterval a b) hU hKU isCompact_Icc hγ hY |
| 132 | |
| 133 | theorem nonempty_sqrtRegularField_variation (τmax : ℝ) (hτmax : 0 < τmax) |
| 134 | (hmax : b < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 135 | (R : SqrtRegularPath p) (V : LVariation F T a b p) : |
| 136 | Nonempty (SqrtRegularField R (variationField V)) := by |
| 137 | obtain ⟨E⟩ := nonempty_variationFieldExtension V |
| 138 | obtain ⟨D, _⟩ := exists_sqrtRegularField_of_variation_extension τmax hτmax hmax hwindow R V E |
| 139 | exact ⟨D⟩ |
| 140 | |
| 141 | end PoincareMT.ReducedLength |