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.LGeometry.Variation.Coordinates.ChartPullback |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiFieldPackaging |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Extension.SmoothSectionExtension |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/JacobiRepresentative.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Topology |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.LGeometry |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | theorem curveVelocityWithin_restrict {C D : Set ℝ} (α : ℝ → M) {s : ℝ} |
| 25 | (hC : UniqueDiffWithinAt ℝ C s) (hD : UniqueDiffWithinAt ℝ D s) |
| 26 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 27 | curveVelocityWithin (n := n) α C s = curveVelocityWithin (n := n) α D s := by |
| 28 | unfold curveVelocityWithin |
| 29 | rw [mfderivWithin_eq_mfderiv hC.uniqueMDiffWithinAt hα, |
| 30 | mfderivWithin_eq_mfderiv hD.uniqueMDiffWithinAt hα] |
| 31 | |
| 32 | theorem pullbackCovariantDerivative_restrict {J C D : Set ℝ} |
| 33 | (F : RicciFlow n M J) (time : ℝ → ℝ) {α : ℝ → M} |
| 34 | {Y : ∀ s, TangentSpace (𝓡 n) (α s)} (hDC : D ⊆ C) |
| 35 | (E : ParametricAlongCurveExtensionOn C α Y) {s : ℝ} |
| 36 | (hC : UniqueDiffWithinAt ℝ C s) (hD : UniqueDiffWithinAt ℝ D s) |
| 37 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 38 | pullbackCovariantDerivative F time α Y C E s = |
| 39 | pullbackCovariantDerivative F time α Y D (restrictParametricSectionExtension hDC E) s := by |
| 40 | unfold pullbackCovariantDerivative restrictParametricSectionExtension |
| 41 | rw [curveVelocityWithin_restrict α hC hD hα] |
| 42 | |
| 43 | theorem pullbackCovariantDerivative_restrict_congr {J C D : Set ℝ} |
| 44 | (F : RicciFlow n M J) (time : ℝ → ℝ) {α : ℝ → M} |
| 45 | {Y : ∀ s, TangentSpace (𝓡 n) (α s)} (hDC : D ⊆ C) |
| 46 | (EC : ParametricAlongCurveExtensionOn C α Y) |
| 47 | (ED : ParametricAlongCurveExtensionOn D α Y) {s : ℝ} (hs : s ∈ D) |
| 48 | (hC : UniqueDiffWithinAt ℝ C s) (hD : UniqueDiffWithinAt ℝ D s) |
| 49 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s) : |
| 50 | pullbackCovariantDerivative F time α Y C EC s = |
| 51 | pullbackCovariantDerivative F time α Y D ED s := by |
| 52 | rw [pullbackCovariantDerivative_restrict F time hDC EC hC hD hα] |
| 53 | exact pullbackCovariantDerivative_extension_independent F time |
| 54 | (restrictParametricSectionExtension hDC EC) ED hs hD hα |
| 55 | |
| 56 | theorem tangent_cast_eq {x y : M} (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 57 | ((h ▸ v) : TangentSpace (𝓡 n) y) = v := by |
| 58 | cases h |
| 59 | rfl |
| 60 | |
| 61 | variable {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ τ₂ : ℝ} |
| 62 | {p : BackwardTimePath F T τ₁ τ₂} |
| 63 | |
| 64 | theorem sqrtRegularPath_eqOn (R R' : SqrtRegularPath p) : |
| 65 | EqOn R.curve R'.curve (sqrtParameterInterval τ₁ τ₂) := |
| 66 | fun s hs ↦ (R.agrees s hs).trans (R'.agrees s hs).symm |
| 67 | |
| 68 | theorem sqrtRegularPath_mdifferentiableAt (R : SqrtRegularPath p) {s : ℝ} |
| 69 | (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 70 | MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) R.curve s := |
| 71 | ((R.smooth s (R.interval_subset hs)).contMDiffAt |
| 72 | (R.open_domain.mem_nhds (R.interval_subset hs))).mdifferentiableAt (by simp) |
| 73 | |
| 74 | theorem sqrtRegularField_field_eq {R R' : SqrtRegularPath p} |
| 75 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 76 | (Q : SqrtRegularField R Y) (Q' : SqrtRegularField R' Y) {s : ℝ} |
| 77 | (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : Q.field s = Q'.field s := by |
| 78 | have hQ := (Q.agrees s hs).trans |
| 79 | (tangent_cast_eq (n := n) (R.agrees s hs).symm (Y (s ^ 2))) |
| 80 | have hQ' := (Q'.agrees s hs).trans |
| 81 | (tangent_cast_eq (n := n) (R'.agrees s hs).symm (Y (s ^ 2))) |
| 82 | exact hQ.trans hQ'.symm |
| 83 | |
| 84 | theorem sqrtRegularField_firstDerivative_eq {R R' : SqrtRegularPath p} |
| 85 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 86 | (Q : SqrtRegularField R Y) (Q' : SqrtRegularField R' Y) {s : ℝ} |
| 87 | (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : Q.firstDerivative s = Q'.firstDerivative s := by |
| 88 | exact pullbackCovariantDerivative_congr F (fun r ↦ T - r ^ 2) |
| 89 | (sqrtRegularPath_eqOn R R') (fun r hr ↦ sqrtRegularField_field_eq Q Q' hr) |
| 90 | Q.extension Q'.extension hs |
| 91 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.nonnegative p.ordered) s hs) |
| 92 | (sqrtRegularPath_mdifferentiableAt R' hs) |
| 93 | |
| 94 | theorem sqrtRegularField_secondDerivative_eq {R R' : SqrtRegularPath p} |
| 95 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 96 | (Q : SqrtRegularField R Y) (Q' : SqrtRegularField R' Y) {s : ℝ} |
| 97 | (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : Q.secondDerivative s = Q'.secondDerivative s := by |
| 98 | exact pullbackCovariantDerivative_congr F (fun r ↦ T - r ^ 2) |
| 99 | (sqrtRegularPath_eqOn R R') (fun r hr ↦ sqrtRegularField_firstDerivative_eq Q Q' hr) |
| 100 | Q.derivative_extension Q'.derivative_extension hs |
| 101 | (uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.nonnegative p.ordered) s hs) |
| 102 | (sqrtRegularPath_mdifferentiableAt R' hs) |
| 103 | |
| 104 | def transferSqrtRegularField {R : SqrtRegularPath p} |
| 105 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 106 | (Q : SqrtRegularField R Y) (R' : SqrtRegularPath p) : SqrtRegularField R' Y := by |
| 107 | let E := transferParametricExtension (sqrtRegularPath_eqOn R R') (fun _ _ ↦ rfl) Q.extension |
| 108 | have hfirst : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, Q.firstDerivative s = |
| 109 | pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) R'.curve Q.field |
| 110 | (sqrtParameterInterval τ₁ τ₂) E s := by |
| 111 | intro s hs |
| 112 | exact pullbackCovariantDerivative_transfer F (fun r ↦ T - r ^ 2) |
| 113 | (sqrtRegularPath_eqOn R R') (fun _ _ ↦ rfl) Q.extension hs |
| 114 | exact { |
| 115 | field := Q.field |
| 116 | agrees := fun s hs ↦ ((Q.agrees s hs).trans |
| 117 | (tangent_cast_eq (n := n) (R.agrees s hs).symm (Y (s ^ 2)))).trans |
| 118 | (tangent_cast_eq (n := n) (R'.agrees s hs).symm (Y (s ^ 2))).symm |
| 119 | extension := E |
| 120 | derivative_extension := transferParametricExtension (sqrtRegularPath_eqOn R R') |
| 121 | hfirst Q.derivative_extension } |
| 122 | |
| 123 | theorem regularizedJacobiResidual_representative_eq |
| 124 | (R R' : RegularizedLGeodesicData p) |
| 125 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 126 | (Q : SqrtRegularField R.path Y) (Q' : SqrtRegularField R'.path Y) {s : ℝ} |
| 127 | (hs : s ∈ sqrtParameterInterval τ₁ τ₂) |
| 128 | (W : TangentSpace (𝓡 n) (R.path.curve s)) : |
| 129 | regularizedJacobiResidual R Q s W = regularizedJacobiResidual R' Q' s W := by |
| 130 | have hcurve := sqrtRegularPath_eqOn R.path R'.path |
| 131 | have hfield := sqrtRegularField_field_eq Q Q' hs |
| 132 | have hfirst := sqrtRegularField_firstDerivative_eq Q Q' hs |
| 133 | have hsecond := sqrtRegularField_secondDerivative_eq Q Q' hs |
| 134 | have hvelocity := curveVelocityWithin_congr (n := n) hcurve hs |
| 135 | unfold regularizedJacobiResidual |
| 136 | rw [hcurve hs, hfield, hfirst, hsecond, hvelocity] |
| 137 | |
| 138 | theorem hasLJacobiInitialDerivative_representative_iff |
| 139 | (R R' : RegularizedLGeodesicData p) |
| 140 | (Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)) |
| 141 | (Z : TangentSpace (𝓡 n) (p.curve τ₁)) : |
| 142 | HasLJacobiInitialDerivative R Y Z ↔ HasLJacobiInitialDerivative R' Y Z := by |
| 143 | have htransfer (A B : RegularizedLGeodesicData p) : |
| 144 | HasLJacobiInitialDerivative A Y Z → HasLJacobiInitialDerivative B Y Z := by |
| 145 | rintro ⟨Q, hQ⟩ |
| 146 | let Q' := transferSqrtRegularField Q B.path |
| 147 | refine ⟨Q', ?_⟩ |
| 148 | have hs : Real.sqrt τ₁ ∈ sqrtParameterInterval τ₁ τ₂ := |
| 149 | ⟨le_rfl, Real.sqrt_le_sqrt p.ordered.le⟩ |
| 150 | have heq := sqrtRegularField_firstDerivative_eq Q Q' hs |
| 151 | dsimp only at hQ ⊢ |
| 152 | rw [tangent_cast_eq (n := n)] at hQ ⊢ |
| 153 | exact heq.symm.trans hQ |
| 154 | exact ⟨htransfer R R', htransfer R' R⟩ |
| 155 | |
| 156 | theorem isLJacobiField_residual_for_representative |
| 157 | {Y : ∀ τ, TangentSpace (𝓡 n) (p.curve τ)} |
| 158 | (hY : IsLJacobiField F T τ₁ τ₂ p Y) (R : RegularizedLGeodesicData p) : |
| 159 | ∃ Q : SqrtRegularField R.path Y, Y τ₁ = 0 ∧ |
| 160 | ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 161 | ∀ W : TangentSpace (𝓡 n) (R.path.curve s), regularizedJacobiResidual R Q s W = 0 := by |
| 162 | obtain ⟨R₀, Q₀, hzero, hres⟩ := hY |
| 163 | let Q := transferSqrtRegularField Q₀ R.path |
| 164 | refine ⟨Q, hzero, ?_⟩ |
| 165 | intro s hs W |
| 166 | rw [← regularizedJacobiResidual_representative_eq R₀ R Q₀ Q hs W] |
| 167 | exact hres s hs W |
| 168 | |
| 169 | end PoincareMT.LGeometry |