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.Topology.Manifold.Poincare.Final.Compatibility.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Limit.Finite.LimitFiniteEndpointSourceSign |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Limit.Finite.LimitFiniteEndpointFlow |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Curvature.TerminalCurvatureSectionalLimit |
| 5 | |
| 6 | /-! |
| 7 | # The operator sign on the actual extracted backward chart flow |
| 8 | |
| 9 | The retained mixed jets and vanishing source sectional error give the |
| 10 | operator on the whole open raw interval, including the new past. |
| 11 | MT Proposition 17.1; endpoint-germ-sign.md, AL3. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter Poincare.Gluing |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M47 |
| 23 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 25 | local notation "V" => E →L[ℝ] E →L[ℝ] ℝ |
| 26 | |
| 27 | private noncomputable local instance endpointSignDualAdd : |
| 28 | NormedAddCommGroup (E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup |
| 29 | private noncomputable local instance endpointSignDualSpace : |
| 30 | NormedSpace ℝ (E →L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace |
| 31 | private noncomputable local instance endpointSignBilinAdd : |
| 32 | NormedAddCommGroup V := ContinuousLinearMap.toNormedAddCommGroup |
| 33 | private noncomputable local instance endpointSignBilinSpace : |
| 34 | NormedSpace ℝ V := ContinuousLinearMap.toNormedSpace |
| 35 | |
| 36 | private theorem operator_of_open_bilinear_jets |
| 37 | {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold (𝓡 3) ∞ M] |
| 38 | {J : Set ℝ} (hJ : IsOpen J) |
| 39 | (A : ℕ → RicciFlow 3 M J) (F : RicciFlow 3 M J) |
| 40 | (hjet : ∀ (x : M) (r : ℕ) (K : Set (ℝ × E)), IsCompact K → |
| 41 | K ⊆ J ×ˢ (extChartAt (𝓡 3) x).target → TendstoUniformlyOn |
| 42 | (fun k => iteratedFDeriv ℝ r (fun p : ℝ × E => |
| 43 | ((A k).metric p.1).pullbackCoefficients (extChartAt (𝓡 3) x).symm p.2)) |
| 44 | (iteratedFDeriv ℝ r (fun p : ℝ × E => |
| 45 | (F.metric p.1).pullbackCoefficients (extChartAt (𝓡 3) x).symm p.2)) atTop K) |
| 46 | (hlower : ∀ eta : ℝ, 0 < eta → ∀ᶠ k in atTop, ∀ t ∈ J, |
| 47 | ∀ (x : M) (v w : TangentSpace (𝓡 3) x), |
| 48 | -eta ≤ ((A k).connection t).sectionalCurvature x v w) : |
| 49 | ∀ t ∈ J, ∀ x, (F.connection t).NonnegativeCurvatureOperator x := by |
| 50 | have hscalar (x : M) (r : ℕ) (j b : Fin 3) (K : Set (ℝ × E)) |
| 51 | (hK : IsCompact K) (hKU : K ⊆ J ×ˢ (extChartAt (𝓡 3) x).target) : |
| 52 | TendstoUniformlyOn |
| 53 | (fun k => iteratedFDeriv ℝ r (fun p : ℝ × E => |
| 54 | ((A k).metric p.1).pullbackCoefficients (extChartAt (𝓡 3) x).symm p.2 |
| 55 | (EuclideanSpace.basisFun (Fin 3) ℝ j) (EuclideanSpace.basisFun (Fin 3) ℝ b))) |
| 56 | (iteratedFDeriv ℝ r (fun p : ℝ × E => |
| 57 | (F.metric p.1).pullbackCoefficients (extChartAt (𝓡 3) x).symm p.2 |
| 58 | (EuclideanSpace.basisFun (Fin 3) ℝ j) (EuclideanSpace.basisFun (Fin 3) ℝ b))) |
| 59 | atTop K := by |
| 60 | let Ω := J ×ˢ (extChartAt (𝓡 3) x).target |
| 61 | have hΩ : IsOpen Ω := hJ.prod (isOpen_extChartAt_target x) |
| 62 | have hsmooth (G : RicciFlow 3 M J) : |
| 63 | ContDiffOn ℝ ∞ (fun p : ℝ × E => |
| 64 | (G.metric p.1).pullbackCoefficients (extChartAt (𝓡 3) x).symm p.2) Ω := by |
| 65 | intro p hp |
| 66 | exact (G.smooth.contDiffAt_spacetime_pullbackCoefficients hJ |
| 67 | ((contMDiffWithinAt_extChartAt_symm_target (n := ∞) x hp.2).contMDiffAt |
| 68 | (extChartAt_target_mem_nhds' hp.2)) hp.1).contDiffWithinAt |
| 69 | let L : V →L[ℝ] ℝ := |
| 70 | (ContinuousLinearMap.apply ℝ ℝ (EuclideanSpace.basisFun (Fin 3) ℝ b)).comp |
| 71 | (ContinuousLinearMap.apply ℝ (E →L[ℝ] ℝ) (EuclideanSpace.basisFun (Fin 3) ℝ j)) |
| 72 | have h := Poincare.Analysis.Calculus.smooth_convergence_continuousLinearMap_comp |
| 73 | L hΩ (hsmooth F) (fun p hp => ⟨Ω, hΩ, hp, |
| 74 | Eventually.of_forall fun k => hsmooth (A k)⟩) (hjet x) |
| 75 | exact h.2 r K hK hKU |
| 76 | intro t ht x |
| 77 | have hj := RiemannianMetric.spatial_and_time_jets_of_spacetime_jets |
| 78 | (fun k => (A k).metric) F.metric (fun k => (A k).smooth) F.smooth hJ ht x |
| 79 | (fun r _ a b => RiemannianMetric.tendsto_spacetime_jet_of_compact_uniform r |
| 80 | (hscalar x r a b) ⟨ht, mem_extChartAt_target x⟩) |
| 81 | apply terminalCurvature_operator_of_coordinate_jets |
| 82 | (fun k => (A k).connection t) (F.connection t) x hj.1 |
| 83 | intro eta heta |
| 84 | exact (hlower eta heta).mono fun k hk => hk t ht |
| 85 | |
| 86 | private theorem operator_of_open_chart_jets |
| 87 | {ι : Type*} (U : ι → Set E) (hU : ∀ i, IsOpen (U i)) |
| 88 | [∀ i, Nonempty (Piece U i)] |
| 89 | {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold (𝓡 3) ∞ M] |
| 90 | {J : Set ℝ} (hJ : IsOpen J) (A : ℕ → RicciFlow 3 M J) |
| 91 | (i : ι) (e : Piece U i → M) |
| 92 | (he : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 93 | IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ e) |
| 94 | (F : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 95 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 96 | RicciFlow 3 (Piece U i) J) |
| 97 | (B : ℝ × E → V) |
| 98 | (hcoeff : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 99 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 100 | ∀ t ∈ J, ∀ (x : Piece U i) v w, (F.metric t).inner x v w = B (t, x) v w) |
| 101 | (hjet : ∀ m K, IsCompact K → K ⊆ J ×ˢ U i → TendstoUniformlyOn |
| 102 | (fun k => iteratedFDeriv ℝ m (fun p : ℝ × E => |
| 103 | ((A k).metric p.1).pullbackCoefficients |
| 104 | (ChartDistance.chartParametrization U hU e) p.2)) |
| 105 | (iteratedFDeriv ℝ m B) atTop K) |
| 106 | (hlower : ∀ eta : ℝ, 0 < eta → ∀ᶠ k in atTop, ∀ t ∈ J, |
| 107 | ∀ (x : M) (v w : TangentSpace (𝓡 3) x), |
| 108 | -eta ≤ ((A k).connection t).sectionalCurvature x v w) : |
| 109 | letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 110 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 111 | ∀ t ∈ J, ∀ x, (F.connection t).NonnegativeCurvatureOperator x := by |
| 112 | let := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 113 | let := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 114 | let Achart := fun k => (A k).pullbackToCanonicalDomain (U i) (hU i) e he |
| 115 | apply operator_of_open_bilinear_jets hJ Achart F |
| 116 | · intro x m K hK hKU |
| 117 | rw [ChartDistance.canonical_extChartAt_target U hU] at hKU |
| 118 | have hseq (k : ℕ) : EqOn |
| 119 | (fun p : ℝ × E => ((A k).metric p.1).pullbackCoefficients |
| 120 | (ChartDistance.chartParametrization U hU e) p.2) |
| 121 | (fun p : ℝ × E => ((Achart k).metric p.1).pullbackCoefficients |
| 122 | (extChartAt (𝓡 3) x).symm p.2) (J ×ˢ U i) := by |
| 123 | intro p hp |
| 124 | exact (ChartDistance.canonical_pullbackMetric_coefficients U hU |
| 125 | ((A k).metric p.1) e he x ⟨p.2, hp.2⟩).symm |
| 126 | have hlim : EqOn B (fun p : ℝ × E => (F.metric p.1).pullbackCoefficients |
| 127 | (extChartAt (𝓡 3) x).symm p.2) (J ×ˢ U i) := by |
| 128 | intro p hp |
| 129 | have hform : B p = (F.metric p.1).inner ⟨p.2, hp.2⟩ := by |
| 130 | ext v w |
| 131 | exact (hcoeff p.1 hp.1 ⟨p.2, hp.2⟩ v w).symm |
| 132 | exact hform.trans (RiemannianMetric.pullbackCoefficients_canonicalChart |
| 133 | (U i) (hU i) (F.metric p.1) x ⟨p.2, hp.2⟩).symm |
| 134 | exact ((hjet m K hK hKU).congr (Eventually.of_forall fun k => |
| 135 | (Poincare.Analysis.Calculus.eqOn_iteratedFDeriv_of_isOpen |
| 136 | (hJ.prod (hU i)) (hseq k) m).mono hKU)).congr_right |
| 137 | ((Poincare.Analysis.Calculus.eqOn_iteratedFDeriv_of_isOpen |
| 138 | (hJ.prod (hU i)) hlim m).mono hKU) |
| 139 | · intro eta heta |
| 140 | filter_upwards [hlower eta heta] with k hk t ht x v w |
| 141 | rw [M36.sectionalCurvature_eq_of_local_isometry ((Achart k).connection t) |
| 142 | ((A k).connection t) (f := e) isOpen_univ he.contMDiff.contMDiffOn |
| 143 | (fun _ _ _ _ => rfl) (mem_univ x) v w] |
| 144 | exact hk t ht _ _ _ |
| 145 | |
| 146 | /-- The actual selected chart flow has nonnegative operator throughout |
| 147 | its original open raw interval, using the same source family and jets. -/ |
| 148 | theorem limitFinite_endpoint_chart_operator |
| 149 | {M : Type u} [TopologicalSpace M] [ChartedSpace E M] [IsManifold (𝓡 3) ∞ M] |
| 150 | {T d R ρ : ℝ} (hd : 0 < d) (hc : -T + d / 4 ≤ 0) |
| 151 | (hρ : 0 < ρ) (hρR : ρ < R) |
| 152 | (A : ℕ → RicciFlow 3 M (Icc (-(T + d / 2)) 0)) |
| 153 | (Φ : PartialDiffeomorph (𝓡 3) (𝓡 3) E M ∞) |
| 154 | (hsource : Φ.source = Metric.ball 0 R) (B : ℝ × E → V) |
| 155 | (hjets : ∀ m K, IsCompact K → |
| 156 | K ⊆ Ioo (-((3 * d / 4) / 2)) 0 ×ˢ Metric.ball 0 ρ → TendstoUniformlyOn |
| 157 | (fun k => iteratedFDeriv ℝ m (fun p : ℝ × E => |
| 158 | ((A k).metric (p.1 + (-T + d / 4))).pullbackCoefficients Φ p.2)) |
| 159 | (iteratedFDeriv ℝ m B) atTop K) |
| 160 | (hlower : ∀ eta : ℝ, 0 < eta → ∀ᶠ k in atTop, ∀ t ∈ Icc (-(T + d / 2)) 0, |
| 161 | ∀ (x : M) (v w : TangentSpace (𝓡 3) x), |
| 162 | -eta ≤ ((A k).connection t).sectionalCurvature x v w) : |
| 163 | let W := fun _ : Unit => Metric.ball (0 : E) ρ |
| 164 | let hW : ∀ i, IsOpen (W i) := fun _ => Metric.isOpen_ball |
| 165 | letI : Nonempty (W ()) := ⟨⟨0, Metric.mem_ball_self hρ⟩⟩ |
| 166 | letI := (hW ()).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 167 | letI := (hW ()).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 168 | ∀ F : RicciFlow 3 (Piece W ()) (Ioo (-T - d / 8) (-T + d / 4)), |
| 169 | (∀ t ∈ Ioo (-T - d / 8) (-T + d / 4), ∀ (x : Piece W ()) v w, |
| 170 | (F.metric t).inner x v w = B (t - (-T + d / 4), x) v w) → |
| 171 | ∀ t ∈ Ioo (-T - d / 8) (-T + d / 4), ∀ x, |
| 172 | (F.connection t).NonnegativeCurvatureOperator x := by |
| 173 | classical |
| 174 | let W := fun _ : Unit => Metric.ball (0 : E) ρ |
| 175 | let hW : ∀ i, IsOpen (W i) := fun _ => Metric.isOpen_ball |
| 176 | let : Nonempty (W ()) := ⟨⟨0, Metric.mem_ball_self hρ⟩⟩ |
| 177 | let : ∀ i, Nonempty (Piece W i) := fun _ => ⟨⟨0, Metric.mem_ball_self hρ⟩⟩ |
| 178 | let := (hW ()).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 179 | let := (hW ()).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 180 | dsimp only |
| 181 | intro F hcoeff |
| 182 | let J := Ioo (-((3 * d / 4) / 2)) 0 |
| 183 | let c := -T + d / 4 |
| 184 | let e : Piece W () → M := fun x => Φ x |
| 185 | have he : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ e := by |
| 186 | intro x |
| 187 | have hx : (x : E) ∈ Φ.source := by |
| 188 | rw [hsource] |
| 189 | exact Metric.ball_subset_ball hρR.le x.property |
| 190 | exact (Poincare.isLocalDiffeomorph_subtypeVal (𝓡 3) (W ()) (hW ()) ∞ x).comp |
| 191 | (𝓡 3) M (Φ.isLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ hx) |
| 192 | have hnear (z : E) (hz : z ∈ W ()) : |
| 193 | ChartDistance.chartParametrization W hW e =ᶠ[𝓝 z] Φ := by |
| 194 | filter_upwards [(hW ()).mem_nhds hz] with y hy |
| 195 | exact ChartDistance.chartParametrization_apply W hW e ⟨y, hy⟩ |
| 196 | have hmap : (fun s : ℝ => s + c) '' J ⊆ Icc (-(T + d / 2)) 0 := by |
| 197 | rintro _ ⟨s, hs, rfl⟩ |
| 198 | dsimp [J, c] at hs ⊢ |
| 199 | constructor <;> linarith [hs.1, hs.2] |
| 200 | have hne : J.Nontrivial := by |
| 201 | exact ⟨-d / 4, ⟨by linarith, by linarith⟩, -d / 8, |
| 202 | ⟨by linarith, by linarith⟩, by linarith⟩ |
| 203 | let A' : ℕ → RicciFlow 3 M J := fun k => (A k).translate c hmap ordConnected_Ioo hne |
| 204 | have hfmap : (fun s : ℝ => s + c) '' J ⊆ Ioo (-T - d / 8) (-T + d / 4) := by |
| 205 | rintro _ ⟨s, hs, rfl⟩ |
| 206 | dsimp [J, c] at hs ⊢ |
| 207 | constructor <;> linarith [hs.1, hs.2] |
| 208 | let F' := F.translate c hfmap ordConnected_Ioo hne |
| 209 | have hcoeff' : ∀ s ∈ J, ∀ (x : Piece W ()) v w, |
| 210 | (F'.metric s).inner x v w = B (s, x) v w := by |
| 211 | intro s hs x v w |
| 212 | change (F.metric (s + c)).inner x v w = B (s, x) v w |
| 213 | simpa only [c, add_sub_cancel_right] using hcoeff (s + c) (hfmap ⟨s, hs, rfl⟩) x v w |
| 214 | have hactual (k : ℕ) : EqOn |
| 215 | (fun p : ℝ × E => ((A k).metric (p.1 + c)).pullbackCoefficients Φ p.2) |
| 216 | (fun p : ℝ × E => ((A' k).metric p.1).pullbackCoefficients |
| 217 | (ChartDistance.chartParametrization W hW e) p.2) (J ×ˢ W ()) := by |
| 218 | intro p hp |
| 219 | have hn := hnear p.2 hp.2 |
| 220 | change ((A k).metric (p.1 + c)).pullbackCoefficients Φ p.2 = |
| 221 | ((A k).metric (p.1 + c)).pullbackCoefficients |
| 222 | (ChartDistance.chartParametrization W hW e) p.2 |
| 223 | unfold RiemannianMetric.pullbackCoefficients |
| 224 | rw [hn.self_of_nhds, hn.mfderiv_eq] |
| 225 | have hjetActual : ∀ m K, IsCompact K → K ⊆ J ×ˢ W () → TendstoUniformlyOn |
| 226 | (fun k => iteratedFDeriv ℝ m (fun p : ℝ × E => |
| 227 | ((A' k).metric p.1).pullbackCoefficients |
| 228 | (ChartDistance.chartParametrization W hW e) p.2)) |
| 229 | (iteratedFDeriv ℝ m B) atTop K := by |
| 230 | intro m K hK hKΩ |
| 231 | exact (hjets m K hK hKΩ).congr (Eventually.of_forall fun k => |
| 232 | (Poincare.Analysis.Calculus.eqOn_iteratedFDeriv_of_isOpen |
| 233 | (isOpen_Ioo.prod (hW ())) (hactual k) m).mono hKΩ) |
| 234 | have hlower' : ∀ eta : ℝ, 0 < eta → ∀ᶠ k in atTop, ∀ s ∈ J, |
| 235 | ∀ (x : M) (v w : TangentSpace (𝓡 3) x), |
| 236 | -eta ≤ ((A' k).connection s).sectionalCurvature x v w := by |
| 237 | intro eta heta |
| 238 | filter_upwards [hlower eta heta] with k hk s hs x v w |
| 239 | exact hk (s + c) (hmap ⟨s, hs, rfl⟩) x v w |
| 240 | have hop := operator_of_open_chart_jets W hW isOpen_Ioo A' () e he F' B |
| 241 | hcoeff' hjetActual hlower' |
| 242 | intro t ht x |
| 243 | have hs : t - c ∈ J := by |
| 244 | dsimp [J, c] |
| 245 | constructor <;> linarith [ht.1, ht.2] |
| 246 | have h := hop (t - c) hs x |
| 247 | change (F.connection (t - c + c)).NonnegativeCurvatureOperator x at h |
| 248 | convert h using 1 <;> congr 1 <;> ring |
| 249 | |
| 250 | end PoincareMT.M47 |