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.ReducedVolume.Regularity.Continuity.MinimizingLifts |
| 2 | import Mathlib.Analysis.Calculus.LocalExtr.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Terminal gradients of noncritical minimizing lifts |
| 6 | |
| 7 | Morgan-Tian Claim 6.69 uses the different gradients of two minimizing |
| 8 | branches. Pulling reduced length back to the initial-vector space gives |
| 9 | the same contact argument directly, using the actual action differential. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedVolume |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | [ConnectedSpace M] {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 24 | |
| 25 | /-- Every minimizing lift realizes the actual reduced length, not just one chosen lift. -/ |
| 26 | theorem reducedLength_eq_normalized_action_of_minimizing |
| 27 | (hL : LGeodesicTheory F T τmax) (G : LExponentialGeometry F T τmax p) |
| 28 | (Z : TangentSpace (𝓡 n) p) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 29 | (hmin : IsMinimizingBackwardLPath F T 0 τ (G.path Z τ hτ hmax)) : |
| 30 | reducedLength F T p (G.gamma Z τ) τ = |
| 31 | G.toLExponentialFamily.action Z τ / (2 * Real.sqrt τ) := by |
| 32 | apply le_antisymm (reducedLength_le_normalized_action hL G Z τ hτ hmax) |
| 33 | obtain ⟨path, hp, hq, _, hlength⟩ := |
| 34 | hL.reduced_length_attained τ hτ hmax.le p (G.gamma Z τ) |
| 35 | have hcomp := hmin path |
| 36 | (by rw [G.path_eq, G.gamma_at_zero]; exact hp) |
| 37 | (by rw [G.path_eq]; exact hq) |
| 38 | rw [G.path_eq] at hcomp |
| 39 | rw [hlength] |
| 40 | exact div_le_div_of_nonneg_right hcomp (by positivity) |
| 41 | |
| 42 | set_option backward.isDefEq.respectTransparency false in |
| 43 | /-- Contact on initial-vector space determines the endpoint derivative on the differential range. -/ |
| 44 | theorem reducedLength_differential_on_slice_range |
| 45 | (hL : LGeodesicTheory F T τmax) (G : LExponentialGeometry F T τmax p) |
| 46 | (Z : TangentSpace (𝓡 n) p) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 47 | (hmin : IsMinimizingBackwardLPath F T 0 τ (G.path Z τ hτ hmax)) |
| 48 | (hl : MDifferentiableAt (𝓡 n) (𝓘(ℝ, ℝ)) (fun q ↦ reducedLength F T p q τ) |
| 49 | (G.gamma Z τ)) (W : TangentSpace (𝓡 n) p) : |
| 50 | mvfderiv (𝓡 n) (fun q ↦ reducedLength F T p q τ) (G.gamma Z τ) |
| 51 | (G.toLExponentialFamily.sliceDifferential Z τ W) = |
| 52 | (F.metric (T - τ)).inner (G.gamma Z τ) (curveVelocity (G.gamma Z) τ) |
| 53 | (G.toLExponentialFamily.sliceDifferential Z τ W) := by |
| 54 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 55 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 56 | have htime : (Z, τ) ∈ (univ : Set (TangentSpace (𝓡 n) p)) ×ˢ Ioo 0 τmax := |
| 57 | ⟨mem_univ _, hτ, hmax⟩ |
| 58 | have hE : MDifferentiableAt (𝓘(ℝ, TangentSpace (𝓡 n) p)) (𝓡 n) |
| 59 | (fun V ↦ G.gamma V τ) Z := |
| 60 | ((G.gamma_smooth.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds htime)).comp Z |
| 61 | (contMDiffAt_id.prodMk contMDiffAt_const)).mdifferentiableAt (by simp) |
| 62 | have hA : DifferentiableAt ℝ (fun V ↦ G.toLExponentialFamily.action V τ) Z := |
| 63 | ((G.action_smooth.contDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds htime)).comp Z |
| 64 | (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt (by simp) |
| 65 | let c : ℝ := (2 * Real.sqrt τ)⁻¹ |
| 66 | let cost : TangentSpace (𝓡 n) p → ℝ := |
| 67 | fun V ↦ c * G.toLExponentialFamily.action V τ |
| 68 | let pull : TangentSpace (𝓡 n) p → ℝ := fun V ↦ reducedLength F T p (G.gamma V τ) τ |
| 69 | have hcost : DifferentiableAt ℝ cost Z := hA.const_mul c |
| 70 | have hpull : DifferentiableAt ℝ pull Z := by |
| 71 | exact (hl.comp (f := fun V ↦ G.gamma V τ) Z hE).differentiableAt |
| 72 | have hcontact : cost Z = pull Z := by |
| 73 | dsimp [cost, pull, c] |
| 74 | rw [reducedLength_eq_normalized_action_of_minimizing hL G Z hτ hmax hmin, |
| 75 | div_eq_mul_inv, mul_comm] |
| 76 | have hlocal : IsLocalMin (cost - pull) Z := by |
| 77 | apply Filter.Eventually.of_forall |
| 78 | intro V |
| 79 | have hle := reducedLength_le_normalized_action hL G V τ hτ hmax |
| 80 | change cost Z - pull Z ≤ cost V - pull V |
| 81 | rw [hcontact, sub_self] |
| 82 | apply sub_nonneg.mpr |
| 83 | simpa only [cost, pull, c, div_eq_mul_inv, mul_comm] using hle |
| 84 | have hderiv := hlocal.fderiv_eq_zero |
| 85 | rw [fderiv_sub hcost hpull] at hderiv |
| 86 | have heq : fderiv ℝ pull Z = fderiv ℝ cost Z := (sub_eq_zero.mp hderiv).symm |
| 87 | have hchain : fderiv ℝ pull Z W = |
| 88 | mvfderiv (𝓡 n) (fun q ↦ reducedLength F T p q τ) (G.gamma Z τ) |
| 89 | (G.toLExponentialFamily.sliceDifferential Z τ W) := by |
| 90 | have h := mfderiv_comp_apply Z hl hE W |
| 91 | rw [mfderiv_eq_fderiv] at h |
| 92 | exact h |
| 93 | rw [← hchain, heq] |
| 94 | dsimp only [cost] |
| 95 | rw [fderiv_const_mul hA c] |
| 96 | simp only [smul_apply, smul_eq_mul] |
| 97 | rw [G.action_initial_differential Z τ hτ hmax W] |
| 98 | dsimp only [c] |
| 99 | have hden : 2 * Real.sqrt τ ≠ 0 := by positivity |
| 100 | field_simp |
| 101 | |
| 102 | /-- At a noncritical minimizer, the genuine spatial differential is the terminal metric dual. -/ |
| 103 | theorem reducedLength_differential_eq_terminal_pairing |
| 104 | (hL : LGeodesicTheory F T τmax) (G : LExponentialGeometry F T τmax p) |
| 105 | (Z : TangentSpace (𝓡 n) p) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 106 | (hmin : IsMinimizingBackwardLPath F T 0 τ (G.path Z τ hτ hmax)) |
| 107 | (hl : MDifferentiableAt (𝓡 n) (𝓘(ℝ, ℝ)) (fun q ↦ reducedLength F T p q τ) |
| 108 | (G.gamma Z τ)) |
| 109 | (hsurj : Function.Surjective (G.toLExponentialFamily.sliceDifferential Z τ)) |
| 110 | (v : TangentSpace (𝓡 n) (G.gamma Z τ)) : |
| 111 | mvfderiv (𝓡 n) (fun q ↦ reducedLength F T p q τ) (G.gamma Z τ) v = |
| 112 | (F.metric (T - τ)).inner (G.gamma Z τ) (curveVelocity (G.gamma Z) τ) v := by |
| 113 | obtain ⟨W, rfl⟩ := hsurj v |
| 114 | exact reducedLength_differential_on_slice_range hL G Z hτ hmax hmin hl W |
| 115 | |
| 116 | end PoincareMT.ReducedVolume |