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.SupportedChartVariation |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.VariationChartFields |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/SupportedChartField.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter Topology |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ τ₂ : ℝ} |
| 23 | {p : BackwardTimePath F T τ₁ τ₂} |
| 24 | |
| 25 | set_option maxHeartbeats 1800000 in |
| 26 | theorem supportedChartVariation_squareField (V W : LVariation F T τ₁ τ₂ p) |
| 27 | (x : M) (η : ℝ → EuclideanSpace ℝ (Fin n)) (hη : ContDiff ℝ ∞ η) (c : ℝ) |
| 28 | (hfamily : ∀ s v, W.squareFamily s v = supportedChartFamily V x η c (s, v)) |
| 29 | (hsrc : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, s ∈ tsupport η → |
| 30 | V.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 31 | {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 32 | squareVariationField W s = squareVariationField V s + |
| 33 | c • chartFrame x (η s) (V.baseSquareCurve s) := by |
| 34 | by_cases hsupport : s ∈ tsupport η |
| 35 | swap |
| 36 | · have hcurve : W.squareFamily s = V.squareFamily s := by |
| 37 | funext v |
| 38 | exact (hfamily s v).trans |
| 39 | (supportedChartFamily_eq_of_not_support V x η c (z := (s, v)) hsupport) |
| 40 | have hηzero : η s = 0 := image_eq_zero_of_notMem_tsupport hsupport |
| 41 | simp only [squareVariationField, hηzero, chartFrame, map_zero, smul_zero, add_zero] |
| 42 | change curveVelocity (W.squareFamily s) 0 = curveVelocity (V.squareFamily s) 0 |
| 43 | rw [hcurve] |
| 44 | have hx := hsrc s hs hsupport |
| 45 | have hbase : W.baseSquareCurve s = V.baseSquareCurve s := |
| 46 | (hfamily s 0).trans (supportedChartFamily_at_zero V x η c hsrc hs) |
| 47 | have hxW : W.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source := by |
| 48 | rw [hbase] |
| 49 | exact hx |
| 50 | let U := variationChartDomain V x ∩ |
| 51 | supportedChartShift V x η c ⁻¹' (extChartAt (𝓡 n) x).target |
| 52 | have hU : IsOpen U := (supportedChartShift_contDiffOn V x η hη c).continuousOn.isOpen_inter_preimage |
| 53 | (variationChartDomain_open V x) (isOpen_extChartAt_target (I := 𝓡 n) x) |
| 54 | have hsV : (s, (0 : ℝ)) ∈ variationChartDomain V x := |
| 55 | ⟨V.square_contains ⟨hs, neg_neg_of_pos V.radius_pos, V.radius_pos⟩, hx⟩ |
| 56 | have hsU : (s, (0 : ℝ)) ∈ U := by |
| 57 | refine ⟨hsV, ?_⟩ |
| 58 | simp only [mem_preimage, supportedChartShift, zero_mul, zero_smul, add_zero, variationChart] |
| 59 | exact (extChartAt (𝓡 n) x).map_source |
| 60 | (by simpa only [extChartAt_source, LVariation.baseSquareCurve] using hx) |
| 61 | have hnear : ∀ᶠ v in 𝓝 (0 : ℝ), (s, v) ∈ U := |
| 62 | (continuous_const.prodMk continuous_id).continuousAt.preimage_mem_nhds (hU.mem_nhds hsU) |
| 63 | have heq : ((extChartAt (𝓡 n) x) ∘ W.squareFamily s) =ᶠ[𝓝 (0 : ℝ)] |
| 64 | (fun v ↦ supportedChartShift V x η c (s, v)) := by |
| 65 | filter_upwards [hnear] with v hv |
| 66 | simp only [Function.comp_apply] |
| 67 | rw [hfamily s v, supportedChartFamily_eq_chart V x η c (z := (s, v)) hv.1.2] |
| 68 | exact (extChartAt (𝓡 n) x).right_inv hv.2 |
| 69 | have hdV := coordinateSlice_snd_hasDerivAt (variationChart V x) |
| 70 | ((((variationChart_contDiffOn V x) (s, 0) hsV).contDiffAt |
| 71 | ((variationChartDomain_open V x).mem_nhds hsV)).differentiableAt (by simp)) |
| 72 | have hdshift : HasDerivAt (fun v ↦ supportedChartShift V x η c (s, v)) |
| 73 | (coordinatePartialU (variationChart V x) (s, 0) + c • η s) 0 := by |
| 74 | have hdη : HasDerivAt (fun v : ℝ ↦ (v * c) • η s) (c • η s) 0 := by |
| 75 | convert ((hasDerivAt_id (0 : ℝ)).mul_const c).smul_const (η s) using 1 <;> |
| 76 | first | rfl | simp only [one_mul] |
| 77 | exact hdV.add hdη |
| 78 | have hdW := hdshift.congr_of_eventuallyEq heq |
| 79 | have hWs : (s, (0 : ℝ)) ∈ W.squareDomain := |
| 80 | W.square_contains ⟨hs, neg_neg_of_pos W.radius_pos, W.radius_pos⟩ |
| 81 | have hWcurve := (((W.square_smooth (s, 0) hWs).contMDiffAt |
| 82 | (W.square_open.mem_nhds hWs)).mdifferentiableAt (by simp)).comp 0 |
| 83 | (mdifferentiableAt_const.prodMk mdifferentiableAt_id) |
| 84 | calc |
| 85 | squareVariationField W s = chartFrame x |
| 86 | (deriv ((extChartAt (𝓡 n) x) ∘ W.squareFamily s) 0) (W.baseSquareCurve s) := |
| 87 | (chartFrame_curveVelocity (α := W.squareFamily s) (s := 0) hxW hWcurve).symm |
| 88 | _ = chartFrame x (coordinatePartialU (variationChart V x) (s, 0) + c • η s) |
| 89 | (V.baseSquareCurve s) := by rw [hdW.deriv, hbase] |
| 90 | _ = chartFrame x (coordinatePartialU (variationChart V x) (s, 0)) |
| 91 | (V.baseSquareCurve s) + c • chartFrame x (η s) (V.baseSquareCurve s) := by |
| 92 | simp only [chartFrame, map_add, map_smul] |
| 93 | _ = _ := by rw [variationChart_squareVariationField V hs hx] |
| 94 | |
| 95 | end PoincareMT.LGeometry |
| 96 |