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.CurveShortening.Ramp.LocalFlow.Initial.ArclengthGauge |
| 2 | import Mathlib.Topology.Algebra.GroupWithZero |
| 3 | |
| 4 | /-! |
| 5 | # Unit initial speed on the physical length period |
| 6 | |
| 7 | Rescaling the normalized initial arclength label gives the actual length |
| 8 | as physical period and principal coefficient one. MT2007 Claim 19.1, |
| 9 | p. 437 and Lemma 19.6, pp. 441-442; contract review block 8 and |
| 10 | `2026-09-21-unit-speed-initial-period.md`. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M63 |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {a b : ℝ} |
| 25 | |
| 26 | /-- The actual initial speed primitive gives a C2 unit-speed parameter |
| 27 | with physical period equal to the metric length. MT2007 Claim 19.1, |
| 28 | p. 437 and Lemma 19.6, pp. 441-442; unit-speed initial-period derivation. |
| 29 | The unequal forward and inverse period shifts are explicit. -/ |
| 30 | theorem exists_c2_unit_speed_parameter (F : RicciFlow n M (Icc a b)) |
| 31 | (gamma : ℝ → M) (t : ℝ) (hperiod : Function.Periodic gamma curvePeriod) |
| 32 | (hgamma : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 gamma) |
| 33 | (himm : ∀ x, curveVelocity (n := n) gamma x ≠ 0) : |
| 34 | let v := curveSpeed F (fun x _ => gamma x) t |
| 35 | let ell := ∫ x in (0 : ℝ)..curvePeriod, v x |
| 36 | 0 < ell ∧ ∃ sigma : ℝ ≃ₜ ℝ, |
| 37 | (∀ x, sigma x = ∫ y in (0 : ℝ)..x, v y) ∧ |
| 38 | ContDiff ℝ 2 (sigma : ℝ → ℝ) ∧ ContDiff ℝ 2 (sigma.symm : ℝ → ℝ) ∧ |
| 39 | sigma 0 = 0 ∧ (∀ x, 0 < deriv sigma x) ∧ (∀ y, 0 < deriv sigma.symm y) ∧ |
| 40 | (∀ x, sigma (x + curvePeriod) = sigma x + ell) ∧ |
| 41 | (∀ y, sigma.symm (y + ell) = sigma.symm y + curvePeriod) ∧ |
| 42 | Function.Periodic (fun y => gamma (sigma.symm y)) ell ∧ |
| 43 | ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) 2 (fun y => gamma (sigma.symm y)) ∧ |
| 44 | (∀ y, curveVelocity (n := n) (fun z => gamma (sigma.symm z)) y ≠ 0) ∧ |
| 45 | (∀ y, curveSpeed F (fun z _ => gamma (sigma.symm z)) t y = 1) ∧ |
| 46 | (∀ y, (curveSpeed F (fun z _ => gamma (sigma.symm z)) t y ^ 2)⁻¹ = 1) ∧ |
| 47 | ∀ x, gamma (sigma.symm (sigma x)) = gamma x := by |
| 48 | let v := curveSpeed F (fun x _ => gamma x) t |
| 49 | let ell := ∫ x in (0 : ℝ)..curvePeriod, v x |
| 50 | have hp : 0 < curvePeriod := Real.two_pi_pos |
| 51 | obtain ⟨hell, phi, hformula, hphi, hinv, hzero, hdpos, hinvpos, hshift, hinvshift, |
| 52 | _, hq, _, hspeed, _⟩ := |
| 53 | exists_c2_constant_speed_relabeling F gamma t hperiod hgamma himm |
| 54 | change 0 < ell at hell |
| 55 | change ∀ x, phi x = (curvePeriod / ell) * ∫ y in (0 : ℝ)..x, v y at hformula |
| 56 | change ∀ y, curveSpeed F (fun z _ => gamma (phi.symm z)) t y = |
| 57 | ell / curvePeriod at hspeed |
| 58 | let c : ℝ := ell / curvePeriod |
| 59 | have hc : 0 < c := div_pos hell hp |
| 60 | let sigma : ℝ ≃ₜ ℝ := phi.trans (Homeomorph.mulLeft₀ c hc.ne') |
| 61 | have hsig (x : ℝ) : sigma x = c * phi x := rfl |
| 62 | have hsigInv (y : ℝ) : sigma.symm y = phi.symm ((curvePeriod / ell) * y) := by |
| 63 | change phi.symm (c⁻¹ * y) = _ |
| 64 | dsimp only [c] |
| 65 | rw [inv_div] |
| 66 | have hsigFun : (sigma : ℝ → ℝ) = fun x => c * phi x := funext hsig |
| 67 | have hsigInvFun : (sigma.symm : ℝ → ℝ) = |
| 68 | fun y => phi.symm ((curvePeriod / ell) * y) := funext hsigInv |
| 69 | have hscale : 0 < curvePeriod / ell := div_pos hp hell |
| 70 | have hsigReg : ContDiff ℝ 2 (sigma : ℝ → ℝ) := by |
| 71 | rw [hsigFun] |
| 72 | exact contDiff_const.mul hphi |
| 73 | have hsigInvReg : ContDiff ℝ 2 (sigma.symm : ℝ → ℝ) := by |
| 74 | rw [hsigInvFun] |
| 75 | exact hinv.comp (contDiff_const.mul contDiff_id) |
| 76 | have hsigPos (x : ℝ) : 0 < deriv sigma x := by |
| 77 | have hd := ((hphi.differentiable (by norm_num) x).hasDerivAt.const_mul c) |
| 78 | rw [hsigFun, hd.deriv] |
| 79 | exact mul_pos hc (hdpos x) |
| 80 | have hsigInvPos (y : ℝ) : 0 < deriv sigma.symm y := by |
| 81 | have hd := ((hinv.differentiable (by norm_num) |
| 82 | ((curvePeriod / ell) * y)).hasDerivAt).comp y |
| 83 | ((hasDerivAt_id y).const_mul (curvePeriod / ell)) |
| 84 | simp only [Function.comp_def, mul_one] at hd |
| 85 | rw [hsigInvFun, hd.deriv] |
| 86 | exact mul_pos (hinvpos _) hscale |
| 87 | have hsigShift (x : ℝ) : sigma (x + curvePeriod) = sigma x + ell := by |
| 88 | rw [hsig, hshift, hsig] |
| 89 | dsimp only [c] |
| 90 | field_simp |
| 91 | have hsigInvShift (y : ℝ) : sigma.symm (y + ell) = sigma.symm y + curvePeriod := by |
| 92 | rw [hsigInv, hsigInv] |
| 93 | have heq : (curvePeriod / ell) * (y + ell) = (curvePeriod / ell) * y + curvePeriod := by |
| 94 | field_simp [hell.ne'] |
| 95 | rw [heq, hinvshift] |
| 96 | have hnewSpeed (y : ℝ) : |
| 97 | curveSpeed F (fun z _ => gamma (sigma.symm z)) t y = 1 := by |
| 98 | simp only [hsigInvFun] |
| 99 | calc |
| 100 | _ = (curvePeriod / ell) * |
| 101 | curveSpeed F (fun z _ => gamma (phi.symm z)) t ((curvePeriod / ell) * y) := |
| 102 | curveSpeed_comp F (fun z _ => gamma (phi.symm z)) |
| 103 | (hq.mdifferentiable (by norm_num) _) |
| 104 | (by simpa only [id_eq, mul_one] using |
| 105 | (hasDerivAt_id y).const_mul (curvePeriod / ell)) hscale.le |
| 106 | _ = 1 := by rw [hspeed]; field_simp [hell.ne'] |
| 107 | refine ⟨hell, sigma, ?_, hsigReg, hsigInvReg, ?_, hsigPos, hsigInvPos, |
| 108 | hsigShift, hsigInvShift, ?_, hgamma.comp hsigInvReg.contMDiff, ?_, hnewSpeed, ?_, ?_⟩ |
| 109 | · intro x |
| 110 | change sigma x = ∫ y in (0 : ℝ)..x, v y |
| 111 | rw [hsig, hformula] |
| 112 | dsimp only [c] |
| 113 | field_simp |
| 114 | · rw [hsig, hzero, mul_zero] |
| 115 | · intro y |
| 116 | dsimp only |
| 117 | rw [hsigInvShift, hperiod] |
| 118 | · intro y |
| 119 | rw [curveVelocity_comp (hgamma.mdifferentiable (by norm_num) _) |
| 120 | ((hsigInvReg.differentiable (by norm_num) y).hasDerivAt)] |
| 121 | exact smul_ne_zero (hsigInvPos y).ne' (himm _) |
| 122 | · intro y |
| 123 | rw [hnewSpeed] |
| 124 | norm_num |
| 125 | · intro x |
| 126 | rw [sigma.symm_apply_apply] |
| 127 | |
| 128 | end PoincareMT.M63 |