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.PathCompactness |
| 2 | |
| 3 | /-! |
| 4 | # Backward action in square-root time |
| 5 | |
| 6 | The substitution is valid for the frozen admissible paths, without a |
| 7 | derivative at either endpoint. Adapted from Mapher |
| 8 | `Proofs/M08/RegularizedAction.lean`, commit |
| 9 | `49331b7d7ecad38f53e4300c3b35d6a84b2cc648`. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 17 | |
| 18 | namespace PoincareMT.ReducedLengthMinimum.Variational |
| 19 | |
| 20 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | /-- The nonsingular action density after the substitution `tau = s^2`. -/ |
| 24 | noncomputable def regularizedLIntegrand {J : Set ℝ} (F : RicciFlow n M J) |
| 25 | (T : ℝ) (α : ℝ → M) (s : ℝ) : ℝ := |
| 26 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (α s) + |
| 27 | (1 / 2 : ℝ) * (F.metric (T - s ^ 2)).inner (α s) |
| 28 | (curveVelocity (n := n) α s) (curveVelocity (n := n) α s) |
| 29 | |
| 30 | /-- The actual backward action expressed on a regular parameter interval. -/ |
| 31 | noncomputable def regularizedLAction {J : Set ℝ} (F : RicciFlow n M J) |
| 32 | (T tau : ℝ) (α : ℝ → M) : ℝ := |
| 33 | ∫ s in 0..Real.sqrt tau, regularizedLIntegrand F T α s |
| 34 | |
| 35 | theorem squarePath_integrand_eq_transformed {J : Set ℝ} {F : RicciFlow n M J} |
| 36 | {T tau : ℝ} (p : BackwardTimePath F T 0 tau) |
| 37 | {s : ℝ} (hs : s ∈ Ioo 0 (Real.sqrt tau)) : |
| 38 | regularizedLIntegrand F T (fun r => p.curve (r ^ 2)) s = |
| 39 | backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := by |
| 40 | have htime : s ^ 2 ∈ Ioo 0 tau := |
| 41 | ⟨sq_pos_of_pos hs.1, (Real.lt_sqrt hs.1.le).mp hs.2⟩ |
| 42 | have hreg := (p.regular _ htime).contMDiffAt (isOpen_Ioo.mem_nhds htime) |
| 43 | have hvel := curveVelocity_comp_sq (hreg.mdifferentiableAt one_ne_zero) |
| 44 | unfold regularizedLIntegrand backwardLIntegrand |
| 45 | rw [Real.sqrt_sq hs.1.le, hvel] |
| 46 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 47 | ring |
| 48 | |
| 49 | /-- The square-time density is integrable and has exactly the frozen action. -/ |
| 50 | theorem squarePath_action {J : Set ℝ} {F : RicciFlow n M J} |
| 51 | {T tau : ℝ} (p : BackwardTimePath F T 0 tau) : |
| 52 | IntervalIntegrable (regularizedLIntegrand F T (fun r => p.curve (r ^ 2))) |
| 53 | volume 0 (Real.sqrt tau) ∧ |
| 54 | regularizedLAction F T tau (fun r => p.curve (r ^ 2)) = |
| 55 | backwardLLength F T 0 tau p.curve := by |
| 56 | have hd (s : ℝ) : HasDerivAt (fun r : ℝ => r ^ 2) (2 * s) s := by |
| 57 | simpa using hasDerivAt_pow 2 s |
| 58 | have hn : ∀ s ∈ uIoo 0 (Real.sqrt tau), 0 ≤ 2 * s := by |
| 59 | intro s hs |
| 60 | rw [uIoo_of_le (Real.sqrt_nonneg tau)] at hs |
| 61 | exact mul_nonneg (by norm_num) hs.1.le |
| 62 | have ht : IntervalIntegrable |
| 63 | (fun s => backwardLIntegrand F T p.curve (s ^ 2) * (2 * s)) |
| 64 | volume 0 (Real.sqrt tau) := by |
| 65 | apply (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg |
| 66 | (f := fun s : ℝ => s ^ 2) (f' := fun s => 2 * s) |
| 67 | (g := backwardLIntegrand F T p.curve) |
| 68 | (continuous_id.pow 2).continuousOn (fun s _ => hd s) hn).mpr |
| 69 | simpa only [zero_pow two_ne_zero, Real.sq_sqrt p.ordered.le] using p.l_integrable |
| 70 | refine ⟨?_, ?_⟩ |
| 71 | · apply ht.congr_uIoo |
| 72 | intro s hs |
| 73 | rw [uIoo_of_le (Real.sqrt_nonneg tau)] at hs |
| 74 | exact (squarePath_integrand_eq_transformed p hs).symm |
| 75 | · have hsub := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg |
| 76 | (f := fun s : ℝ => s ^ 2) (f' := fun s => 2 * s) |
| 77 | (g := backwardLIntegrand F T p.curve) |
| 78 | (continuous_id.pow 2).continuousOn (fun s _ => hd s) hn |
| 79 | calc |
| 80 | _ = ∫ s in 0..Real.sqrt tau, |
| 81 | backwardLIntegrand F T p.curve (s ^ 2) * (2 * s) := |
| 82 | intervalIntegral.integral_congr_Ioo_of_le (Real.sqrt_nonneg tau) |
| 83 | (fun _ hs => squarePath_integrand_eq_transformed p hs) |
| 84 | _ = _ := by |
| 85 | simpa only [Function.comp_def, zero_pow two_ne_zero, |
| 86 | Real.sq_sqrt p.ordered.le, backwardLLength] using hsub |
| 87 | |
| 88 | end PoincareMT.ReducedLengthMinimum.Variational |