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.Basic |
| 2 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 3 | import Mathlib.Geometry.Manifold.Algebra.Structures |
| 4 | |
| 5 | /-! |
| 6 | # Actual backward paths under finite-interval normalization |
| 7 | |
| 8 | The original and normalized flows retain their actual time domains. |
| 9 | Only interior velocities enter the almost-everywhere action identity. |
| 10 | MT Definition 3.40 and Definition 6.11; reviewed young-seed G3 derivation. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle intervalIntegral Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.Proofs.M47 |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {J K : Set ℝ} {F : RicciFlow n M J} {G : RicciFlow n M K} |
| 26 | {T U d sigma : ℝ} |
| 27 | |
| 28 | omit [IsManifold (𝓡 n) ∞ M] in |
| 29 | private theorem normalized_curve_velocity {gamma : ℝ → M} {s : ℝ} |
| 30 | (hgamma : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) gamma (d * s)) : |
| 31 | curveVelocity (n := n) (fun r => gamma (d * r)) s = |
| 32 | d • curveVelocity (n := n) gamma (d * s) := by |
| 33 | have hd : HasDerivAt (fun r : ℝ => d * r) d s := by |
| 34 | simpa using (hasDerivAt_id s).const_mul d |
| 35 | have hvalue : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) (fun r : ℝ => d * r) s 1 = d := by |
| 36 | rw [mfderiv_eq_fderiv, hd.hasFDerivAt.fderiv] |
| 37 | exact ContinuousLinearMap.toSpanSingleton_apply_one ℝ d |
| 38 | have hchain := mfderiv_comp_apply s (f := fun r : ℝ => d * r) (g := gamma) |
| 39 | hgamma hd.differentiableAt.mdifferentiableAt (1 : TangentSpace (𝓘(ℝ, ℝ)) s) |
| 40 | have hinput : mfderiv (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) (fun r : ℝ => d * r) s 1 = |
| 41 | d • (1 : TangentSpace (𝓘(ℝ, ℝ)) s) := by rw [hvalue]; simp |
| 42 | rw [hinput, map_smul] at hchain |
| 43 | change (mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) (gamma ∘ fun r : ℝ => d * r) s) 1 = _ |
| 44 | simpa only [curveVelocity, Function.comp_apply] using hchain |
| 45 | |
| 46 | private theorem normalized_path_integrand (hd : 0 < d) |
| 47 | (hmetric : ∀ s ∈ Icc (0 : ℝ) sigma, ∀ x (v w : TangentSpace (𝓡 n) x), |
| 48 | (G.metric (U - s)).inner x v w = d⁻¹ * (F.metric (T - d * s)).inner x v w) |
| 49 | (hscalar : ∀ s ∈ Icc (0 : ℝ) sigma, ∀ x, |
| 50 | (G.connection (U - s)).scalarCurvature x = |
| 51 | d * (F.connection (T - d * s)).scalarCurvature x) |
| 52 | {gamma : ℝ → M} {s : ℝ} (hs : s ∈ Icc (0 : ℝ) sigma) |
| 53 | (hgamma : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) gamma (d * s)) : |
| 54 | backwardLIntegrand G U (fun r => gamma (d * r)) s = |
| 55 | Real.sqrt d * backwardLIntegrand F T gamma (d * s) := by |
| 56 | rw [backwardLIntegrand, normalized_curve_velocity hgamma, |
| 57 | hscalar s hs, hmetric s hs] |
| 58 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 59 | rw [backwardLIntegrand, Real.sqrt_mul hd.le] |
| 60 | have hsqrt := Real.sq_sqrt hd.le |
| 61 | field_simp |
| 62 | rw [hsqrt] |
| 63 | ring |
| 64 | |
| 65 | /-- A genuine path on the original closed history gives a genuine path |
| 66 | on the normalized closed history, with every time guard retained. -/ |
| 67 | noncomputable def seedNormalizedPath (hd : 0 < d) (hsigma : 0 < sigma) |
| 68 | (hwindow : Icc (U - sigma) U ⊆ K) |
| 69 | (hmetric : ∀ s ∈ Icc (0 : ℝ) sigma, ∀ x (v w : TangentSpace (𝓡 n) x), |
| 70 | (G.metric (U - s)).inner x v w = d⁻¹ * (F.metric (T - d * s)).inner x v w) |
| 71 | (hscalar : ∀ s ∈ Icc (0 : ℝ) sigma, ∀ x, |
| 72 | (G.connection (U - s)).scalarCurvature x = |
| 73 | d * (F.connection (T - d * s)).scalarCurvature x) |
| 74 | (p : BackwardTimePath F T 0 (d * sigma)) : BackwardTimePath G U 0 sigma where |
| 75 | curve := fun s => p.curve (d * s) |
| 76 | nonnegative := le_rfl |
| 77 | ordered := hsigma |
| 78 | terminal_mem := hwindow ⟨by linarith, le_rfl⟩ |
| 79 | time_mem := fun s hs => hwindow ⟨by linarith [hs.2], by linarith [hs.1]⟩ |
| 80 | continuous := p.continuous.comp (continuous_const.mul continuous_id).continuousOn |
| 81 | (fun s hs => ⟨mul_nonneg hd.le hs.1, mul_le_mul_of_nonneg_left hs.2 hd.le⟩) |
| 82 | regular := p.regular.comp (contMDiff_const.mul contMDiff_id).contMDiffOn |
| 83 | (fun s hs => ⟨mul_pos hd hs.1, mul_lt_mul_of_pos_left hs.2 hd⟩) |
| 84 | l_integrable := by |
| 85 | have hi := (p.l_integrable.comp_mul_left (c := d)).const_mul (Real.sqrt d) |
| 86 | simp only [zero_div, mul_div_cancel_left₀ sigma hd.ne'] at hi |
| 87 | apply hi.congr_uIoo |
| 88 | intro s hs |
| 89 | rw [uIoo_of_le hsigma.le] at hs |
| 90 | have hs' : d * s ∈ Ioo (0 : ℝ) (d * sigma) := |
| 91 | ⟨mul_pos hd hs.1, mul_lt_mul_of_pos_left hs.2 hd⟩ |
| 92 | exact (normalized_path_integrand hd hmetric hscalar ⟨hs.1.le, hs.2.le⟩ |
| 93 | ((p.regular.contMDiffAt (isOpen_Ioo.mem_nhds hs')).mdifferentiableAt one_ne_zero)).symm |
| 94 | |
| 95 | /-- The finite path action has precisely the inverse square-root factor. -/ |
| 96 | theorem seedNormalizedPath_length (hd : 0 < d) (hsigma : 0 < sigma) |
| 97 | (hwindow : Icc (U - sigma) U ⊆ K) |
| 98 | (hmetric : ∀ s ∈ Icc (0 : ℝ) sigma, ∀ x (v w : TangentSpace (𝓡 n) x), |
| 99 | (G.metric (U - s)).inner x v w = d⁻¹ * (F.metric (T - d * s)).inner x v w) |
| 100 | (hscalar : ∀ s ∈ Icc (0 : ℝ) sigma, ∀ x, |
| 101 | (G.connection (U - s)).scalarCurvature x = |
| 102 | d * (F.connection (T - d * s)).scalarCurvature x) |
| 103 | (p : BackwardTimePath F T 0 (d * sigma)) : |
| 104 | backwardLLength G U 0 sigma |
| 105 | (seedNormalizedPath hd hsigma hwindow hmetric hscalar p).curve = |
| 106 | backwardLLength F T 0 (d * sigma) p.curve / Real.sqrt d := by |
| 107 | change (∫ s in 0..sigma, backwardLIntegrand G U (fun r => p.curve (d * r)) s) = _ |
| 108 | have heq : (∫ s in 0..sigma, backwardLIntegrand G U (fun r => p.curve (d * r)) s) = |
| 109 | ∫ s in 0..sigma, Real.sqrt d * backwardLIntegrand F T p.curve (d * s) := by |
| 110 | apply intervalIntegral.integral_congr_Ioo_of_le hsigma.le |
| 111 | intro s hs |
| 112 | have hs' : d * s ∈ Ioo (0 : ℝ) (d * sigma) := |
| 113 | ⟨mul_pos hd hs.1, mul_lt_mul_of_pos_left hs.2 hd⟩ |
| 114 | exact normalized_path_integrand hd hmetric hscalar ⟨hs.1.le, hs.2.le⟩ |
| 115 | ((p.regular.contMDiffAt (isOpen_Ioo.mem_nhds hs')).mdifferentiableAt one_ne_zero) |
| 116 | rw [heq, intervalIntegral.integral_const_mul, |
| 117 | intervalIntegral.integral_comp_mul_left _ hd.ne', mul_zero] |
| 118 | change Real.sqrt d * (d⁻¹ * backwardLLength F T 0 (d * sigma) p.curve) = _ |
| 119 | have hsqrt := Real.sq_sqrt hd.le |
| 120 | have hpos := Real.sqrt_pos.mpr hd |
| 121 | field_simp |
| 122 | rw [hsqrt] |
| 123 | |
| 124 | end PoincareMT.Proofs.M47 |