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.Minimum.Variation.Construction.SquareFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Geometry.CompactFieldVariation |
| 3 | |
| 4 | /-! |
| 5 | # Initial-fixed variations realizing smooth fields |
| 6 | |
| 7 | The compact chart construction realizes the prescribed field, and the actual |
| 8 | ancient square-time action supplies integrability of every variation slice. |
| 9 | |
| 10 | Adapted from Mapher `Proofs/M09/RealizedSquareVariation.lean:29-76`, commit |
| 11 | `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | noncomputable section |
| 18 | |
| 19 | open Set Filter Topology |
| 20 | open scoped Manifold ContDiff Bundle |
| 21 | |
| 22 | namespace PoincareMT.ReducedLengthMinimum.Variation.Construction |
| 23 | |
| 24 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | private theorem alongCurve_const_smul_contMDiffOn (α : ℝ → M) |
| 28 | (Y : ∀ s, TangentSpace (𝓡 n) (α s)) {U : Set ℝ} (hU : IsOpen U) |
| 29 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 30 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 31 | (fun s ↦ (⟨α s, Y s⟩ : TangentBundle (𝓡 n) M)) U) (z : ℝ) : |
| 32 | ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 33 | (fun s ↦ (⟨α s, z • Y s⟩ : TangentBundle (𝓡 n) M)) U := by |
| 34 | intro s hs |
| 35 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) (α s) |
| 36 | have hαs := (hα s hs).contMDiffAt (hU.mem_nhds hs) |
| 37 | have hYs := (hY s hs).contMDiffAt (hU.mem_nhds hs) |
| 38 | apply ContMDiffAt.contMDiffWithinAt |
| 39 | apply Bundle.contMDiffAt_totalSpace.mpr |
| 40 | refine ⟨hαs, ?_⟩ |
| 41 | have hcoord := (Bundle.contMDiffAt_totalSpace.mp hYs).2 |
| 42 | have hconst : ContMDiffAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ |
| 43 | (fun _ : ℝ ↦ z) s := contMDiffAt_const |
| 44 | apply (hconst.smul hcoord).congr_of_eventuallyEq |
| 45 | have hnear : ∀ᶠ r in 𝓝 s, α r ∈ e.baseSet := |
| 46 | hαs.continuousAt (e.open_baseSet.mem_nhds |
| 47 | (mem_baseSet_trivializationAt _ _ _)) |
| 48 | filter_upwards [hnear] with r hr |
| 49 | change (e ⟨α r, z • Y r⟩).2 = z • (e ⟨α r, Y r⟩).2 |
| 50 | simp only [← e.continuousLinearMapAt_apply_of_mem ℝ hr, map_smul] |
| 51 | |
| 52 | end PoincareMT.ReducedLengthMinimum.Variation.Construction |
| 53 | |
| 54 | namespace PoincareMT.AncientKappaSolution |
| 55 | |
| 56 | open ReducedLengthMinimum.Variation.Geometry ReducedLengthMinimum.Variation.Construction |
| 57 | |
| 58 | variable {M : Type*} [TopologicalSpace M] |
| 59 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 60 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 61 | [SecondCountableTopology M] [ConnectedSpace M] |
| 62 | |
| 63 | /-- Every smooth field vanishing at the initial point is realized by an actual variation. -/ |
| 64 | theorem exists_initialFixedLVariation_of_smooth_field (K : AncientKappaSolution 2 M) |
| 65 | {τ : ℝ} (p : BackwardTimePath K.flow 0 0 τ) (α : ℝ → M) |
| 66 | (Y : ∀ s, TangentSpace (𝓡 2) (α s)) (U : Set ℝ) |
| 67 | (hU : IsOpen U) (hIU : Icc 0 (Real.sqrt τ) ⊆ U) |
| 68 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 2) ∞ α U) |
| 69 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 2).prod (𝓡 2)) ∞ |
| 70 | (fun s ↦ (⟨α s, Y s⟩ : TangentBundle (𝓡 2) M)) U) |
| 71 | (hagrees : ∀ s ∈ Icc 0 (Real.sqrt τ), α s = p.curve (s ^ 2)) |
| 72 | (hY0 : Y 0 = 0) : |
| 73 | ∃ V : InitialFixedLVariation K.flow 0 0 τ p, |
| 74 | V.toLVariation.baseSquareCurve = α ∧ |
| 75 | ∀ s ∈ Icc 0 (Real.sqrt τ), |
| 76 | (squareVariationField V.toLVariation s : EuclideanSpace ℝ (Fin 2)) = Y s := by |
| 77 | let Ylin : ∀ s, ℝ →L[ℝ] TangentSpace (𝓡 2) (α s) := |
| 78 | fun s ↦ ContinuousLinearMap.toSpanSingleton ℝ (Y s) |
| 79 | have hYlin (z : ℝ) : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 2).prod (𝓡 2)) ∞ |
| 80 | (fun s ↦ (⟨α s, Ylin s z⟩ : TangentBundle (𝓡 2) M)) U := |
| 81 | alongCurve_const_smul_contMDiffOn α Y hU hα hY z |
| 82 | obtain ⟨f, Ω, N, hΩ, hN, h0N, hIN, hf, hcenter, hfixed, hvelocity⟩ := |
| 83 | exists_smooth_family_of_compact_linear_field α Ylin U (Icc 0 (Real.sqrt τ)) |
| 84 | hU isCompact_Icc hIU hα hYlin |
| 85 | obtain ⟨ρ, hρ, hρN⟩ := Metric.mem_nhds_iff.mp (hN.mem_nhds h0N) |
| 86 | have hparam : Ioo (-ρ) ρ ⊆ N := by |
| 87 | intro z hz |
| 88 | apply hρN |
| 89 | simpa only [Real.ball_eq_Ioo, zero_sub, zero_add] using hz |
| 90 | have hrectangle : Icc 0 (Real.sqrt τ) ×ˢ Ioo (-ρ) ρ ⊆ Ω := |
| 91 | fun z hz ↦ hIN ⟨hz.1, hparam hz.2⟩ |
| 92 | have hf' : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 2) ∞ f Ω := by |
| 93 | convert! hf using 1 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 94 | have hYlin0 : Ylin 0 = 0 := by |
| 95 | ext z |
| 96 | simp [Ylin, hY0] |
| 97 | obtain ⟨V, _, hVf, _, _⟩ := K.exists_initialFixedLVariation_of_smoothSquareFamily |
| 98 | p f Ω hΩ hf' ρ hρ hrectangle |
| 99 | (fun s hs ↦ (hcenter s).trans (hagrees s hs)) |
| 100 | (fun z _ ↦ (hfixed 0 hYlin0 z).trans (hcenter 0).symm) |
| 101 | refine ⟨V, funext (fun s ↦ (hVf s 0).trans (hcenter s)), ?_⟩ |
| 102 | intro s hs |
| 103 | have hfield : (squareVariationField V.toLVariation s : EuclideanSpace ℝ (Fin 2)) = |
| 104 | curveVelocity (n := 2) (fun z ↦ f (s, z)) 0 := |
| 105 | congrArg (fun γ : ℝ → M ↦ (curveVelocity γ 0 : EuclideanSpace ℝ (Fin 2))) |
| 106 | (funext (hVf s)) |
| 107 | rw [hfield] |
| 108 | have hc : (fun u : ℝ ↦ f (s, u • (1 : ℝ))) = (fun u ↦ f (s, u)) := by |
| 109 | funext u |
| 110 | simp only [smul_eq_mul, mul_one] |
| 111 | have hv := hvelocity s hs (1 : ℝ) |
| 112 | rw [hc] at hv |
| 113 | simpa only [Ylin, ContinuousLinearMap.toSpanSingleton_apply_one] using hv |
| 114 | |
| 115 | end PoincareMT.AncientKappaSolution |