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.Barrier.PathComparison |
| 2 | |
| 3 | /-! |
| 4 | # Restricting the actual joint-seed path |
| 5 | |
| 6 | All time, regularity and integrability fields are inherited from the |
| 7 | literal path. Nonnegative scalar curvature compares the two actions. |
| 8 | Source: Definition 6.2, p. 106, and Definition 6.45, p. 129. |
| 9 | See `proof-work/tasks/M47/derivations/joint-seed.md`, Stage B. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set MeasureTheory |
| 15 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M47 |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {J : Set ℝ} {F : RicciFlow n M J} {T tau theta : ℝ} |
| 24 | |
| 25 | /-- Restriction preserves the actual curve and all admissibility fields |
| 26 | of a backward path; Definition 6.2, p. 106. -/ |
| 27 | def jointSeed_restrict_path (path : BackwardTimePath F T 0 tau) |
| 28 | (htheta : 0 < theta) (hle : theta ≤ tau) : BackwardTimePath F T 0 theta where |
| 29 | curve := path.curve |
| 30 | nonnegative := le_rfl |
| 31 | ordered := htheta |
| 32 | terminal_mem := path.terminal_mem |
| 33 | time_mem := fun s hs => path.time_mem s ⟨hs.1, hs.2.trans hle⟩ |
| 34 | continuous := path.continuous.mono (Icc_subset_Icc le_rfl hle) |
| 35 | regular := path.regular.mono (Ioo_subset_Ioo le_rfl hle) |
| 36 | l_integrable := path.l_integrable.mono_set (by |
| 37 | rw [uIcc_of_le htheta.le, uIcc_of_le path.ordered.le] |
| 38 | exact Icc_subset_Icc le_rfl hle) |
| 39 | |
| 40 | /-- The literal scalar-plus-kinetic integrand is nonnegative along an |
| 41 | actual path in a scalar-nonnegative flow; Definition 6.2, p. 106. -/ |
| 42 | theorem jointSeed_integrand_nonneg (path : BackwardTimePath F T 0 tau) |
| 43 | (hscalar : ∀ s ∈ J, ∀ x : M, 0 ≤ (F.connection s).scalarCurvature x) |
| 44 | {s : ℝ} (hs : s ∈ Icc 0 tau) : 0 ≤ backwardLIntegrand F T path.curve s := by |
| 45 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 46 | ⟨(F.metric (T - s)).toRiemannianMetric⟩ |
| 47 | have hkin : 0 ≤ (F.metric (T - s)).inner (path.curve s) |
| 48 | (curveVelocity (n := n) path.curve s) (curveVelocity (n := n) path.curve s) := by |
| 49 | change 0 ≤ inner ℝ (curveVelocity (n := n) path.curve s) |
| 50 | (curveVelocity (n := n) path.curve s) |
| 51 | exact real_inner_self_nonneg |
| 52 | exact mul_nonneg (Real.sqrt_nonneg s) |
| 53 | (add_nonneg (hscalar (T - s) (path.time_mem s hs) (path.curve s)) hkin) |
| 54 | |
| 55 | /-- Removing the terminal part of a backward path can only decrease |
| 56 | its action under scalar nonnegativity; Definitions 6.2 and 6.45. -/ |
| 57 | theorem jointSeed_restricted_action_le (path : BackwardTimePath F T 0 tau) |
| 58 | (htheta : 0 < theta) (hle : theta ≤ tau) |
| 59 | (hscalar : ∀ s ∈ J, ∀ x : M, 0 ≤ (F.connection s).scalarCurvature x) : |
| 60 | backwardLLength F T 0 theta (jointSeed_restrict_path path htheta hle).curve ≤ |
| 61 | backwardLLength F T 0 tau path.curve := by |
| 62 | apply intervalIntegral.integral_mono_interval le_rfl htheta.le hle |
| 63 | ?_ path.l_integrable |
| 64 | exact (ae_restrict_mem measurableSet_Ioc).mono (fun s hs => |
| 65 | jointSeed_integrand_nonneg path hscalar ⟨hs.1.le, hs.2⟩) |
| 66 | |
| 67 | end PoincareMT.M47 |