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.Generalized.ReducedGeometry.Regularity.PositiveStart.PositiveStartInitialVelocity |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Regularity.Formulas.HarnackIntegral |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Equation.SquareEuler |
| 4 | |
| 5 | /-! |
| 6 | # The actual initial Harnack boundary correction |
| 7 | |
| 8 | The supplied initial within derivative determines the retained square |
| 9 | kinetic energy and hence the exact initial primitive in K. |
| 10 | Morgan-Tian Lemmas 6.48-6.49, pp. 130-131. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 25 | |
| 26 | /-- The initial Harnack primitive is exactly the prescribed initial |
| 27 | scalar-plus-kinetic boundary term, including its absolute time factor, |
| 28 | Lemma 6.48 and the positive-start correction to Lemma 6.49, pp. 130-131. -/ |
| 29 | theorem positiveStart_initial_harnackPrimitive (R : M14SquareRootPath G p) |
| 30 | (hstart : MDifferentiableWithinAt (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 31 | p.curve (Icc a b) a) |
| 32 | (hderiv : mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) p.curve (Icc a b) a 1 = |
| 33 | -G.spacetime.timeVector (p.curve a) + (p.horizontal_velocity a).val) : |
| 34 | squareHarnackPrimitive R (Real.sqrt a) = a * Real.sqrt a * |
| 35 | (horizontalScalarCurvature G.leafwise (p.curve a) + |
| 36 | G.spacetime.horizontalMetric.inner (p.curve a) |
| 37 | (p.horizontal_velocity a) (p.horizontal_velocity a)) := by |
| 38 | have hpoint : R.curve (Real.sqrt a) = p.curve a := by |
| 39 | rw [R.agrees _ ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩, |
| 40 | Real.sq_sqrt p.tau_nonneg] |
| 41 | unfold squareHarnackPrimitive |
| 42 | rw [positiveStart_initial_velocity_norm R hstart hderiv, |
| 43 | congrArg (horizontalScalarCurvature G.leafwise) hpoint, |
| 44 | show (Real.sqrt a) ^ 3 = a * Real.sqrt a by |
| 45 | rw [pow_succ, Real.sq_sqrt p.tau_nonneg]] |
| 46 | ring |
| 47 | |
| 48 | /-- The K integral of the actual minimizing path retains the initial |
| 49 | positive-start correction determined by the frozen derivative data, |
| 50 | Lemmas 6.48-6.49, pp. 130-131. -/ |
| 51 | theorem positiveStart_harnackIntegral_eq |
| 52 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 53 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (hp : M14IsMinimizing p) |
| 54 | (R : M14SquareRootPath G p) |
| 55 | (hstart : MDifferentiableWithinAt (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 56 | p.curve (Icc a b) a) |
| 57 | (hderiv : mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) p.curve (Icc a b) a 1 = |
| 58 | -G.spacetime.timeVector (p.curve a) + (p.horizontal_velocity a).val) : |
| 59 | M14GeneralizedKIntegral G p |
| 60 | (fun t => M14BackwardTimeDerivative G (horizontalScalarCurvature G.leafwise) |
| 61 | (p.curve t)) = |
| 62 | M14BackwardLAction G p / 2 - |
| 63 | ((Real.sqrt b) ^ 3 * horizontalScalarCurvature G.leafwise (R.curve (Real.sqrt b)) + |
| 64 | Real.sqrt b * G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt b)) |
| 65 | (R.horizontal_velocity (Real.sqrt b)) (R.horizontal_velocity (Real.sqrt b)) / 4) + |
| 66 | a * Real.sqrt a * (horizontalScalarCurvature G.leafwise (p.curve a) + |
| 67 | G.spacetime.horizontalMetric.inner (p.curve a) |
| 68 | (p.horizontal_velocity a) (p.horizontal_velocity a)) := by |
| 69 | obtain ⟨E⟩ := exists_squareRoot_velocity_extension R |
| 70 | have h := squareRoot_harnackIntegral_eq hM12 R E (by |
| 71 | intro r hr W |
| 72 | exact squareRootEulerResidual_eq_zero_of_minimizing hCoordinates hM12 hp E |
| 73 | (Ioo_subset_Icc_self hr) W) |
| 74 | rw [positiveStart_initial_harnackPrimitive R hstart hderiv] at h |
| 75 | exact h |
| 76 | |
| 77 | end PoincareMT.M14 |