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.Exponential.FamilySlices |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityRestriction |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.CurvePhase |
| 4 | |
| 5 | /-! |
| 6 | # Identifying the normalized initial vector from an actual path |
| 7 | |
| 8 | Unique within-derivatives recover the ambient velocity at square time zero. |
| 9 | The normalization is exactly 2Z, with the actual basepoint retained. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 26 | |
| 27 | omit [IsManifold (𝓡 n) ∞ M] in |
| 28 | set_option backward.isDefEq.respectTransparency false in |
| 29 | theorem curveVelocity_eq_of_eqOn {γ δ : ℝ → M} {I : Set ℝ} {s : ℝ} |
| 30 | (heq : Set.EqOn γ δ I) (hs : s ∈ I) (hI : UniqueDiffWithinAt ℝ I s) |
| 31 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) |
| 32 | (hδ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) δ s) : |
| 33 | (curveVelocity (n := n) γ s : V) = curveVelocity (n := n) δ s := by |
| 34 | have hd := mfderivWithin_congr_of_mem (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 35 | (fun r hr ↦ heq hr) hs |
| 36 | rw [mfderivWithin_eq_mfderiv hI.uniqueMDiffWithinAt hγ, |
| 37 | mfderivWithin_eq_mfderiv hI.uniqueMDiffWithinAt hδ] at hd |
| 38 | exact congrArg (fun L : ℝ →L[ℝ] V ↦ L 1) hd |
| 39 | |
| 40 | variable {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 41 | |
| 42 | theorem lExponentialFamily_regularization_eqOn (A : LExponentialFamily F T τmax p) |
| 43 | (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 44 | Set.EqOn (A.regularization Z b hb hmax).path.curve (A.squareFamily Z) |
| 45 | (sqrtParameterInterval 0 b) := by |
| 46 | intro s hs |
| 47 | have hs0 : 0 ≤ s := by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs.1 |
| 48 | have hsmax : s < Real.sqrt τmax := hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax) |
| 49 | exact ((A.regularization Z b hb hmax).path.agrees s hs).trans |
| 50 | ((congrFun (A.path_eq Z b hb hmax) (s ^ 2)).trans |
| 51 | (A.square_agrees Z s ⟨hs0, hsmax⟩).symm) |
| 52 | |
| 53 | theorem lExponentialFamily_initial_velocity (A : LExponentialFamily F T τmax p) |
| 54 | (Z : TangentSpace (𝓡 n) p) : |
| 55 | (curveVelocity (n := n) (A.squareFamily Z) 0 : V) = (2 : ℝ) • Z := by |
| 56 | have hcast (x y : M) (h : x = y) (v : TangentSpace (𝓡 n) x) : |
| 57 | (h ▸ v : TangentSpace (𝓡 n) y) = (show TangentSpace (𝓡 n) y from v) := by |
| 58 | cases h |
| 59 | rfl |
| 60 | have hi := A.initial_derivative Z |
| 61 | rw [hcast] at hi |
| 62 | exact hi |
| 63 | |
| 64 | theorem lExponentialFamily_regularization_initial_phase (A : LExponentialFamily F T τmax p) |
| 65 | (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 66 | curvePhase (n := n) (A.regularization Z b hb hmax).path.curve 0 = |
| 67 | Bundle.TotalSpace.mk' V p ((2 : ℝ) • Z) := by |
| 68 | let R := A.regularization Z b hb hmax |
| 69 | let K := sqrtParameterInterval 0 b |
| 70 | have hK : K = Set.Icc 0 (Real.sqrt b) := by simp [K, sqrtParameterInterval] |
| 71 | have hzero : (0 : ℝ) ∈ K := by rw [hK]; exact ⟨le_rfl, Real.sqrt_nonneg b⟩ |
| 72 | have hKdiff : UniqueDiffOn ℝ K := hK ▸ uniqueDiffOn_Icc (Real.sqrt_pos.mpr hb) |
| 73 | have heq := lExponentialFamily_regularization_eqOn A Z b hb hmax |
| 74 | have hx : R.path.curve 0 = p := (heq hzero).trans (A.square_at_zero Z) |
| 75 | have hR : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) R.path.curve 0 := |
| 76 | (R.path.smooth.contMDiffAt |
| 77 | (R.path.open_domain.mem_nhds (R.path.interval_subset hzero))).mdifferentiableAt (by simp) |
| 78 | have hA := (lExponentialFamily_squareSlice_contMDiffAt A Z 0 |
| 79 | ⟨le_rfl, Real.sqrt_pos.mpr (hb.trans hmax)⟩).mdifferentiableAt (by simp) |
| 80 | have hv := curveVelocity_eq_of_eqOn heq hzero (hKdiff 0 hzero) hR hA |
| 81 | exact Bundle.TotalSpace.ext hx (heq_of_eq (hv.trans (lExponentialFamily_initial_velocity A Z))) |
| 82 | |
| 83 | theorem lExponentialFamily_initialVector_eq_of_eqOn (A : LExponentialFamily F T τmax p) |
| 84 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) |
| 85 | (heq : Set.EqOn (A.gamma Z) (A.gamma W) (Set.Icc 0 b)) : Z = W := by |
| 86 | let K := Set.Icc 0 (Real.sqrt b) |
| 87 | have hroot : 0 < Real.sqrt b := Real.sqrt_pos.mpr hb |
| 88 | have hrootmax : Real.sqrt b < Real.sqrt τmax := Real.sqrt_lt_sqrt hb.le hmax |
| 89 | have hzero : (0 : ℝ) ∈ K := ⟨le_rfl, hroot.le⟩ |
| 90 | have hsqeq : Set.EqOn (A.squareFamily Z) (A.squareFamily W) K := by |
| 91 | intro s hs |
| 92 | have hsmax : s < Real.sqrt τmax := hs.2.trans_lt hrootmax |
| 93 | have hsq : s ^ 2 ∈ Set.Icc 0 b := by |
| 94 | refine ⟨sq_nonneg s, ?_⟩ |
| 95 | nlinarith [hs.1, hs.2, Real.sq_sqrt hb.le] |
| 96 | exact (A.square_agrees Z s ⟨hs.1, hsmax⟩).trans |
| 97 | ((heq hsq).trans (A.square_agrees W s ⟨hs.1, hsmax⟩).symm) |
| 98 | have hd (Y : TangentSpace (𝓡 n) p) := |
| 99 | (lExponentialFamily_squareSlice_contMDiffAt A Y 0 |
| 100 | ⟨le_rfl, Real.sqrt_pos.mpr (hb.trans hmax)⟩).mdifferentiableAt (by simp) |
| 101 | have hv := curveVelocity_eq_of_eqOn hsqeq hzero |
| 102 | (uniqueDiffOn_Icc hroot 0 hzero) (hd Z) (hd W) |
| 103 | have htwo : (2 : ℝ) • Z = (2 : ℝ) • W := |
| 104 | (lExponentialFamily_initial_velocity A Z).symm.trans |
| 105 | (hv.trans (lExponentialFamily_initial_velocity A W)) |
| 106 | exact (smul_right_injective (M := TangentSpace (𝓡 n) p) (by norm_num : (2 : ℝ) ≠ 0)) htwo |
| 107 | |
| 108 | end PoincareMT.ReducedLength |