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.Geometry.Pullback.Chart |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Geometry.MetricPair |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Second.Coordinates |
| 4 | |
| 5 | /-! |
| 6 | # Spatial chart coordinates of an actual variation |
| 7 | |
| 8 | Adapted from Mapher `Proofs/M08/VariationAcceleration.lean` and |
| 9 | `VariationChartFields.lean`, commit `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`. |
| 10 | The coordinate partials represent the intrinsic velocity and variation field. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | noncomputable section |
| 17 | open Set Filter Topology |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 22 | |
| 23 | open ReducedLengthMinimum.Variational |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | def variationChartDomain {J : Set ℝ} {F : RicciFlow n M J} |
| 29 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 30 | (V : LVariation F T τ₁ τ₂ p) (x : M) : Set (ℝ × ℝ) := |
| 31 | V.squareDomain ∩ (fun z : ℝ × ℝ ↦ V.squareFamily z.1 z.2) ⁻¹' |
| 32 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source |
| 33 | |
| 34 | def variationChart {J : Set ℝ} {F : RicciFlow n M J} |
| 35 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 36 | (V : LVariation F T τ₁ τ₂ p) (x : M) (z : ℝ × ℝ) : EuclideanSpace ℝ (Fin n) := |
| 37 | extChartAt (𝓡 n) x (V.squareFamily z.1 z.2) |
| 38 | |
| 39 | theorem variationChartDomain_open {J : Set ℝ} {F : RicciFlow n M J} |
| 40 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 41 | (V : LVariation F T τ₁ τ₂ p) (x : M) : IsOpen (variationChartDomain V x) := |
| 42 | V.square_smooth.continuousOn.isOpen_inter_preimage V.square_open |
| 43 | (chartAt (EuclideanSpace ℝ (Fin n)) x).open_source |
| 44 | |
| 45 | theorem variationChart_contDiffOn {J : Set ℝ} {F : RicciFlow n M J} |
| 46 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 47 | (V : LVariation F T τ₁ τ₂ p) (x : M) : |
| 48 | ContDiffOn ℝ ∞ (variationChart V x) (variationChartDomain V x) := by |
| 49 | have h := (contMDiffOn_extChartAt (I := 𝓡 n) (x := x)).comp |
| 50 | (V.square_smooth.mono inter_subset_left) (fun z hz ↦ by |
| 51 | simpa only [extChartAt_source] using hz.2) |
| 52 | apply ContMDiffOn.contDiffOn |
| 53 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] |
| 54 | exact h |
| 55 | |
| 56 | |
| 57 | variable {J : Set ℝ} {F : RicciFlow n M J} {T τ₁ τ₂ : ℝ} |
| 58 | {p : BackwardTimePath F T τ₁ τ₂} |
| 59 | |
| 60 | theorem variationChart_partialS_frame (V : LVariation F T τ₁ τ₂ p) |
| 61 | {x : M} {z : ℝ × ℝ} (hz : z ∈ variationChartDomain V x) : |
| 62 | chartFrame x (coordinatePartialS (variationChart V x) z) (V.squareFamily z.1 z.2) = |
| 63 | curveVelocity (n := n) (fun r ↦ V.squareFamily r z.2) z.1 := by |
| 64 | have hq := (((variationChart_contDiffOn V x) z hz).contDiffAt |
| 65 | ((variationChartDomain_open V x).mem_nhds hz)).differentiableAt (by simp) |
| 66 | have hd := (coordinateSlice_fst_hasDerivAt (variationChart V x) hq).deriv |
| 67 | have hα := (((V.square_smooth z hz.1).contMDiffAt |
| 68 | (V.square_open.mem_nhds hz.1)).mdifferentiableAt (by simp)).comp z.1 |
| 69 | (mdifferentiableAt_id.prodMk mdifferentiableAt_const) |
| 70 | change deriv ((extChartAt (𝓡 n) x) ∘ (fun r ↦ V.squareFamily r z.2)) z.1 = |
| 71 | coordinatePartialS (variationChart V x) z at hd |
| 72 | rw [← hd] |
| 73 | exact chartFrame_curveVelocity hz.2 hα |
| 74 | |
| 75 | theorem variationChart_partialU_frame (V : LVariation F T τ₁ τ₂ p) |
| 76 | {x : M} {z : ℝ × ℝ} (hz : z ∈ variationChartDomain V x) : |
| 77 | chartFrame x (coordinatePartialU (variationChart V x) z) (V.squareFamily z.1 z.2) = |
| 78 | curveVelocity (n := n) (V.squareFamily z.1) z.2 := by |
| 79 | have hq := (((variationChart_contDiffOn V x) z hz).contDiffAt |
| 80 | ((variationChartDomain_open V x).mem_nhds hz)).differentiableAt (by simp) |
| 81 | have hd := (coordinateSlice_snd_hasDerivAt (variationChart V x) hq).deriv |
| 82 | have hα := (((V.square_smooth z hz.1).contMDiffAt |
| 83 | (V.square_open.mem_nhds hz.1)).mdifferentiableAt (by simp)).comp z.2 |
| 84 | (mdifferentiableAt_const.prodMk mdifferentiableAt_id) |
| 85 | change deriv ((extChartAt (𝓡 n) x) ∘ V.squareFamily z.1) z.2 = |
| 86 | coordinatePartialU (variationChart V x) z at hd |
| 87 | rw [← hd] |
| 88 | exact chartFrame_curveVelocity hz.2 hα |
| 89 | |
| 90 | theorem variationBaseSquare_mdifferentiableAt (V : LVariation F T τ₁ τ₂ p) |
| 91 | {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) : |
| 92 | MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) V.baseSquareCurve s := by |
| 93 | have hz : (s, (0 : ℝ)) ∈ V.squareDomain := |
| 94 | V.square_contains ⟨hs, neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 95 | exact (((V.square_smooth (s, 0) hz).contMDiffAt |
| 96 | (V.square_open.mem_nhds hz)).mdifferentiableAt (by simp)).comp s |
| 97 | (mdifferentiableAt_id.prodMk mdifferentiableAt_const) |
| 98 | |
| 99 | theorem variationChart_baseVelocity (V : LVariation F T τ₁ τ₂ p) |
| 100 | {x : M} {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) |
| 101 | (hx : V.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 102 | chartFrame x (coordinatePartialS (variationChart V x) (s, 0)) (V.baseSquareCurve s) = |
| 103 | curveVelocityWithin (n := n) V.baseSquareCurve (sqrtParameterInterval τ₁ τ₂) s := by |
| 104 | have hzero : (0 : ℝ) ∈ V.parameterDomain := ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 105 | have h := variationChart_partialS_frame V (x := x) (z := (s, 0)) |
| 106 | ⟨V.square_contains ⟨hs, hzero⟩, hx⟩ |
| 107 | unfold curveVelocityWithin |
| 108 | dsimp only [sqrtParameterInterval] |
| 109 | rw [mfderivWithin_eq_mfderiv |
| 110 | ((uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.nonnegative p.ordered) s hs).uniqueMDiffWithinAt) |
| 111 | (variationBaseSquare_mdifferentiableAt V hs)] |
| 112 | exact h |
| 113 | |
| 114 | theorem variationChart_squareVariationField (V : LVariation F T τ₁ τ₂ p) |
| 115 | {x : M} {s : ℝ} (hs : s ∈ sqrtParameterInterval τ₁ τ₂) |
| 116 | (hx : V.baseSquareCurve s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 117 | chartFrame x (coordinatePartialU (variationChart V x) (s, 0)) (V.baseSquareCurve s) = |
| 118 | squareVariationField V s := by |
| 119 | have hzero : (0 : ℝ) ∈ V.parameterDomain := ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 120 | exact variationChart_partialU_frame V ⟨V.square_contains ⟨hs, hzero⟩, hx⟩ |
| 121 | |
| 122 | |
| 123 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |