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.Surgery.StandardCap.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.RawFlow.IntrinsicTip |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RadialSectionalPlane |
| 4 | import PoincareLib.Geometry.Riemannian.Curvature.SectionalBounds |
| 5 | |
| 6 | /-! |
| 7 | # The actual radial velocity integral |
| 8 | |
| 9 | Morgan-Tian Section 12.6, pp. 309-314. The radial arclength velocity is |
| 10 | the integral of twice f''/f. Dividing both odd profiles by radius first |
| 11 | constructs its smooth even integrand at the tip. Its primitive is odd, |
| 12 | and the quotient used by the corrected forcing extends smoothly to R5. |
| 13 | The identification with the moving arclength time derivative is separate. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | namespace PoincareMT.M35.Uniqueness |
| 22 | |
| 23 | open SmoothRadial |
| 24 | |
| 25 | variable (g : RiemannianMetric 3 StandardCapSpace) |
| 26 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 27 | ∀ x u v : StandardCapSpace, |
| 28 | g.inner (standardRotation A x) |
| 29 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 30 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 31 | (hcomplete : MetricComplete g) |
| 32 | |
| 33 | private theorem warping_second_contDiff : |
| 34 | ContDiff ℝ ∞ (deriv (deriv (intrinsicWarpingRadius g hrotation hcomplete))) := |
| 35 | (contDiff_infty_iff_deriv.mp |
| 36 | (contDiff_infty_iff_deriv.mp (intrinsicWarpingRadius_contDiff g hrotation hcomplete)).2).2 |
| 37 | |
| 38 | private theorem warping_second_odd : |
| 39 | Function.Odd (deriv (deriv (intrinsicWarpingRadius g hrotation hcomplete))) := |
| 40 | deriv_odd_of_even |
| 41 | ((contDiff_infty_iff_deriv.mp |
| 42 | (intrinsicWarpingRadius_contDiff g hrotation hcomplete)).2.differentiable (by simp)) |
| 43 | (deriv_even_of_odd |
| 44 | ((intrinsicWarpingRadius_contDiff g hrotation hcomplete).differentiable (by simp)) |
| 45 | (intrinsicWarpingRadius_odd g hrotation hcomplete)) |
| 46 | |
| 47 | /-- The smooth extension of twice the genuine intrinsic ratio f''/f. -/ |
| 48 | noncomputable def intrinsicRadialAcceleration (s : ℝ) : ℝ := |
| 49 | 2 * axisDivision (deriv (deriv (intrinsicWarpingRadius g hrotation hcomplete))) s / |
| 50 | intrinsicWarpingQuotient g hrotation hcomplete s |
| 51 | |
| 52 | theorem intrinsicRadialAcceleration_contDiff : |
| 53 | ContDiff ℝ ∞ (intrinsicRadialAcceleration g hrotation hcomplete) := |
| 54 | (contDiff_const.mul (axisDivision_contDiff (warping_second_contDiff g hrotation hcomplete))).div |
| 55 | (intrinsicWarpingQuotient_contDiff g hrotation hcomplete) |
| 56 | (fun s => (intrinsicWarpingQuotient_pos g hrotation hcomplete s).ne') |
| 57 | |
| 58 | theorem intrinsicRadialAcceleration_even : |
| 59 | Function.Even (intrinsicRadialAcceleration g hrotation hcomplete) := by |
| 60 | intro s |
| 61 | rw [intrinsicRadialAcceleration, intrinsicRadialAcceleration, |
| 62 | axisDivision_even_of_odd (warping_second_contDiff g hrotation hcomplete) |
| 63 | (warping_second_odd g hrotation hcomplete) s, |
| 64 | intrinsicWarpingQuotient_even g hrotation hcomplete s] |
| 65 | |
| 66 | /-- Away from the tip the extension is exactly the original geometric ratio. -/ |
| 67 | theorem intrinsicRadialAcceleration_eq {s : ℝ} (hs : 0 < s) : |
| 68 | intrinsicRadialAcceleration g hrotation hcomplete s = |
| 69 | 2 * deriv (deriv (intrinsicWarpingRadius g hrotation hcomplete)) s / |
| 70 | intrinsicWarpingRadius g hrotation hcomplete s := by |
| 71 | let f := intrinsicWarpingRadius g hrotation hcomplete |
| 72 | have hz : deriv (deriv f) 0 = 0 := by |
| 73 | have hh := warping_second_odd g hrotation hcomplete 0 |
| 74 | rw [neg_zero] at hh |
| 75 | linarith only [hh] |
| 76 | have hn : s * axisDivision (deriv (deriv f)) s = deriv (deriv f) s := by |
| 77 | rw [mul_axisDivision (warping_second_contDiff g hrotation hcomplete), hz, sub_zero] |
| 78 | apply (div_eq_div_iff (intrinsicWarpingQuotient_pos g hrotation hcomplete s).ne' |
| 79 | (intrinsicWarpingRadius_pos g hrotation hcomplete hs).ne').mpr |
| 80 | change 2 * axisDivision (deriv (deriv f)) s * f s = |
| 81 | 2 * deriv (deriv f) s * intrinsicWarpingQuotient g hrotation hcomplete s |
| 82 | rw [← hn, show f s = s * intrinsicWarpingQuotient g hrotation hcomplete s from |
| 83 | (mul_intrinsicWarpingQuotient g hrotation hcomplete s).symm] |
| 84 | ring |
| 85 | |
| 86 | /-- The coefficient is minus twice the actual radial sectional curvature. -/ |
| 87 | theorem intrinsicRadialAcceleration_eq_sectional {s : ℝ} (hs : 0 < s) : |
| 88 | intrinsicRadialAcceleration g hrotation hcomplete s = |
| 89 | -2 * (radialMixedCurvatureFactor g |
| 90 | ((radialArclengthOrderIso g hrotation hcomplete).symm s) / |
| 91 | axisRadialCoefficient g ((radialArclengthOrderIso g hrotation hcomplete).symm s)) := by |
| 92 | rw [intrinsicRadialAcceleration_eq g hrotation hcomplete hs, |
| 93 | (intrinsicWarpingRadius_deriv_hasDerivAt g hrotation hcomplete hs).deriv, |
| 94 | radialMixedCurvatureFactor_eq_warping g |
| 95 | (radialArclengthOrderIso_symm_pos g hrotation hcomplete hs)] |
| 96 | unfold intrinsicWarpingRadius |
| 97 | ring |
| 98 | |
| 99 | /-- The genuine primitive with zero tip value. -/ |
| 100 | noncomputable def intrinsicRadialVelocity (s : ℝ) : ℝ := |
| 101 | ∫ a in (0 : ℝ)..s, intrinsicRadialAcceleration g hrotation hcomplete a |
| 102 | |
| 103 | theorem intrinsicRadialVelocity_hasDerivAt (s : ℝ) : |
| 104 | HasDerivAt (intrinsicRadialVelocity g hrotation hcomplete) |
| 105 | (intrinsicRadialAcceleration g hrotation hcomplete s) s := by |
| 106 | have hc := (intrinsicRadialAcceleration_contDiff g hrotation hcomplete).continuous |
| 107 | exact intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 s) |
| 108 | hc.aestronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt |
| 109 | |
| 110 | theorem intrinsicRadialVelocity_contDiff : |
| 111 | ContDiff ℝ ∞ (intrinsicRadialVelocity g hrotation hcomplete) := by |
| 112 | rw [contDiff_infty_iff_deriv] |
| 113 | refine ⟨fun s => |
| 114 | (intrinsicRadialVelocity_hasDerivAt g hrotation hcomplete s).differentiableAt, ?_⟩ |
| 115 | have hd : deriv (intrinsicRadialVelocity g hrotation hcomplete) = |
| 116 | intrinsicRadialAcceleration g hrotation hcomplete := |
| 117 | funext (fun s => (intrinsicRadialVelocity_hasDerivAt g hrotation hcomplete s).deriv) |
| 118 | rw [hd] |
| 119 | exact intrinsicRadialAcceleration_contDiff g hrotation hcomplete |
| 120 | |
| 121 | theorem intrinsicRadialVelocity_zero : intrinsicRadialVelocity g hrotation hcomplete 0 = 0 := by |
| 122 | simp only [intrinsicRadialVelocity, intervalIntegral.integral_same] |
| 123 | |
| 124 | theorem intrinsicRadialVelocity_odd : |
| 125 | Function.Odd (intrinsicRadialVelocity g hrotation hcomplete) := by |
| 126 | intro s |
| 127 | have h := intervalIntegral.integral_comp_neg |
| 128 | (intrinsicRadialAcceleration g hrotation hcomplete) (a := (0 : ℝ)) (b := s) |
| 129 | have he (a : ℝ) : intrinsicRadialAcceleration g hrotation hcomplete (-a) = |
| 130 | intrinsicRadialAcceleration g hrotation hcomplete a := |
| 131 | intrinsicRadialAcceleration_even g hrotation hcomplete a |
| 132 | simp_rw [he] at h |
| 133 | rw [neg_zero, intervalIntegral.integral_symm 0 (-s)] at h |
| 134 | change intrinsicRadialVelocity g hrotation hcomplete s = |
| 135 | -intrinsicRadialVelocity g hrotation hcomplete (-s) at h |
| 136 | linarith only [h] |
| 137 | |
| 138 | /-- The literal velocity quotient xi=v/r has its genuine smooth tip extension. -/ |
| 139 | theorem intrinsicRadialVelocity_quotient_contDiff_norm {E : Type*} |
| 140 | [NormedAddCommGroup E] [InnerProductSpace ℝ E] : |
| 141 | ContDiff ℝ ∞ (fun x : E => axisDivision (intrinsicRadialVelocity g hrotation hcomplete) ‖x‖) := |
| 142 | contDiff_even_norm |
| 143 | (axisDivision_contDiff (intrinsicRadialVelocity_contDiff g hrotation hcomplete)) |
| 144 | (axisDivision_even_of_odd (intrinsicRadialVelocity_contDiff g hrotation hcomplete) |
| 145 | (intrinsicRadialVelocity_odd g hrotation hcomplete)) |
| 146 | |
| 147 | end PoincareMT.M35.Uniqueness |