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.IntrinsicRadialCoordinate |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RadialEndSlope |
| 4 | |
| 5 | /-! |
| 6 | # The actual smooth warping function in intrinsic radius |
| 7 | |
| 8 | Morgan-Tian Section 12.6, pp. 307-309. The orbit radius is composed with |
| 9 | the genuine inverse arclength coordinate. Its first two derivatives are |
| 10 | the already computed intrinsic slope and second derivative. At the tip |
| 11 | its derivative is exactly one, by isotropy of the actual origin metric. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | namespace PoincareMT.M35.Uniqueness |
| 21 | |
| 22 | variable (g : RiemannianMetric 3 StandardCapSpace) |
| 23 | (hrotation : ∀ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, |
| 24 | ∀ x u v : StandardCapSpace, |
| 25 | g.inner (standardRotation A x) |
| 26 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x u) |
| 27 | (mfderiv (𝓡 3) (𝓡 3) (standardRotation A) x v) = g.inner x u v) |
| 28 | |
| 29 | include hrotation in |
| 30 | /-- Section 12.6: all tangent directions have the same coefficient at the tip. -/ |
| 31 | theorem axisAngularCoefficient_zero_eq_radial : |
| 32 | axisAngularCoefficient g 0 = axisRadialCoefficient g 0 := by |
| 33 | let e (i : Fin 3) : StandardCapSpace := EuclideanSpace.single i 1 |
| 34 | obtain ⟨A, hA⟩ := exists_axis_rotation (e 0) |
| 35 | have hnorm : ‖e 0‖ = 1 := by simp [e] |
| 36 | rw [hnorm, one_smul] at hA |
| 37 | change standardRotation A (e 2) = e 0 at hA |
| 38 | have hz : standardRotation A (0 : StandardCapSpace) = 0 := |
| 39 | map_zero (Matrix.toEuclideanLin A.1) |
| 40 | have h := hrotation A 0 (e 2) (e 2) |
| 41 | rw [standardRotation_mfderiv] at h |
| 42 | change g.euclideanCoefficients (standardRotation A 0) |
| 43 | (standardRotation A (e 2)) (standardRotation A (e 2)) = |
| 44 | g.euclideanCoefficients 0 (e 2) (e 2) at h |
| 45 | change g.euclideanCoefficients (0 • e 2) (e 0) (e 0) = |
| 46 | g.euclideanCoefficients (0 • e 2) (e 2) (e 2) |
| 47 | simpa only [hz, hA, zero_smul] using h |
| 48 | |
| 49 | /-- Section 12.6: the signed orbit radius is smooth through zero. -/ |
| 50 | theorem axisWarpingRadius_contDiff : ContDiff ℝ ∞ (axisWarpingRadius g) := |
| 51 | contDiff_id.mul ((axisAngularCoefficient_contDiff g).sqrt |
| 52 | (fun r => (axisAngularCoefficient_pos g r).ne')) |
| 53 | |
| 54 | variable (hcomplete : MetricComplete g) |
| 55 | |
| 56 | /-- Section 12.6: the actual orbit radius in the actual intrinsic coordinate. -/ |
| 57 | noncomputable def intrinsicWarpingRadius (s : ℝ) : ℝ := |
| 58 | axisWarpingRadius g ((radialArclengthOrderIso g hrotation hcomplete).symm s) |
| 59 | |
| 60 | theorem intrinsicWarpingRadius_contDiff : |
| 61 | ContDiff ℝ ∞ (intrinsicWarpingRadius g hrotation hcomplete) := |
| 62 | (axisWarpingRadius_contDiff g).comp |
| 63 | (radialArclengthOrderIso_symm_contDiff g hrotation hcomplete) |
| 64 | |
| 65 | theorem intrinsicWarpingRadius_zero : intrinsicWarpingRadius g hrotation hcomplete 0 = 0 := by |
| 66 | simp only [intrinsicWarpingRadius, radialArclengthOrderIso_symm_zero, |
| 67 | axisWarpingRadius, zero_mul] |
| 68 | |
| 69 | /-- Section 12.6: the actual warping function has odd smooth tip parity. -/ |
| 70 | theorem intrinsicWarpingRadius_odd : |
| 71 | Function.Odd (intrinsicWarpingRadius g hrotation hcomplete) := by |
| 72 | intro s |
| 73 | simp only [intrinsicWarpingRadius, axisWarpingRadius] |
| 74 | rw [radialArclengthOrderIso_symm_odd g hrotation hcomplete s, |
| 75 | axisAngularCoefficient_even g hrotation] |
| 76 | ring |
| 77 | |
| 78 | theorem radialArclengthOrderIso_symm_pos {s : ℝ} (hs : 0 < s) : |
| 79 | 0 < (radialArclengthOrderIso g hrotation hcomplete).symm s := by |
| 80 | have h := (radialArclengthOrderIso g hrotation hcomplete).symm.strictMono hs |
| 81 | rwa [radialArclengthOrderIso_symm_zero] at h |
| 82 | |
| 83 | theorem intrinsicWarpingRadius_pos {s : ℝ} (hs : 0 < s) : |
| 84 | 0 < intrinsicWarpingRadius g hrotation hcomplete s := |
| 85 | axisWarpingRadius_pos g (radialArclengthOrderIso_symm_pos g hrotation hcomplete hs) |
| 86 | |
| 87 | /-- Section 12.6: the genuine intrinsic derivative is the retained radial slope. -/ |
| 88 | theorem intrinsicWarpingRadius_hasDerivAt {s : ℝ} (hs : 0 < s) : |
| 89 | HasDerivAt (intrinsicWarpingRadius g hrotation hcomplete) |
| 90 | (axisWarpingSlope g ((radialArclengthOrderIso g hrotation hcomplete).symm s)) s := by |
| 91 | let r := (radialArclengthOrderIso g hrotation hcomplete).symm s |
| 92 | have hr : 0 < r := radialArclengthOrderIso_symm_pos g hrotation hcomplete hs |
| 93 | have hd := (axisWarpingRadius_hasDerivAt g hr).comp s |
| 94 | (radialArclengthOrderIso_symm_hasDerivAt g hrotation hcomplete s) |
| 95 | convert! hd using 1 |
| 96 | change axisWarpingSlope g r = Real.sqrt (axisRadialCoefficient g r) * |
| 97 | axisWarpingSlope g r * (Real.sqrt (axisRadialCoefficient g r))⁻¹ |
| 98 | field_simp [(Real.sqrt_pos.mpr (axisRadialCoefficient_pos g r)).ne'] |
| 99 | |
| 100 | /-- Section 12.6: the actual second derivative is minus radius times radial curvature. -/ |
| 101 | theorem intrinsicWarpingRadius_deriv_hasDerivAt {s : ℝ} (hs : 0 < s) : |
| 102 | HasDerivAt (deriv (intrinsicWarpingRadius g hrotation hcomplete)) |
| 103 | (axisWarpingSecond g ((radialArclengthOrderIso g hrotation hcomplete).symm s)) s := by |
| 104 | let q := (radialArclengthOrderIso g hrotation hcomplete).symm |
| 105 | have hr : 0 < q s := radialArclengthOrderIso_symm_pos g hrotation hcomplete hs |
| 106 | have hd : HasDerivAt (fun a => axisWarpingSlope g (q a)) |
| 107 | (axisWarpingSecond g (q s)) s := by |
| 108 | convert! (axisWarpingSlope_hasDerivAt g hr).comp s |
| 109 | (radialArclengthOrderIso_symm_hasDerivAt g hrotation hcomplete s) using 1 |
| 110 | change axisWarpingSecond g (q s) = Real.sqrt (axisRadialCoefficient g (q s)) * |
| 111 | axisWarpingSecond g (q s) * (Real.sqrt (axisRadialCoefficient g (q s)))⁻¹ |
| 112 | field_simp [(Real.sqrt_pos.mpr (axisRadialCoefficient_pos g (q s))).ne'] |
| 113 | apply hd.congr_of_eventuallyEq |
| 114 | filter_upwards [eventually_gt_nhds hs] with a ha |
| 115 | exact (intrinsicWarpingRadius_hasDerivAt g hrotation hcomplete ha).deriv |
| 116 | |
| 117 | /-- Section 12.6: isotropy at zero gives the required unit warping slope. -/ |
| 118 | theorem intrinsicWarpingRadius_hasDerivAt_zero : |
| 119 | HasDerivAt (intrinsicWarpingRadius g hrotation hcomplete) 1 0 := by |
| 120 | have ha := ((axisAngularCoefficient_contDiff g).differentiable (by simp) 0).hasDerivAt |
| 121 | have hd : HasDerivAt (axisWarpingRadius g) (Real.sqrt (axisAngularCoefficient g 0)) 0 := by |
| 122 | convert! (hasDerivAt_id (0 : ℝ)).mul (ha.sqrt (axisAngularCoefficient_pos g 0).ne') using 1 |
| 123 | simp only [id_eq, one_mul, zero_mul, add_zero] |
| 124 | have hd' : HasDerivAt (axisWarpingRadius g) (Real.sqrt (axisAngularCoefficient g 0)) |
| 125 | ((radialArclengthOrderIso g hrotation hcomplete).symm 0) := by |
| 126 | rwa [radialArclengthOrderIso_symm_zero] |
| 127 | have hc := hd'.comp 0 (radialArclengthOrderIso_symm_hasDerivAt g hrotation hcomplete 0) |
| 128 | rw [radialArclengthOrderIso_symm_zero, axisAngularCoefficient_zero_eq_radial g hrotation, |
| 129 | mul_inv_cancel₀ (Real.sqrt_pos.mpr (axisRadialCoefficient_pos g 0)).ne'] at hc |
| 130 | exact hc |
| 131 | |
| 132 | /-- Section 12.6: the actual intrinsic scalar curvature formula. -/ |
| 133 | theorem rotational_scalar_eq_intrinsicWarping (D : LeviCivitaData g) |
| 134 | {s : ℝ} (hs : 0 < s) : |
| 135 | D.scalarCurvature ((radialArclengthOrderIso g hrotation hcomplete).symm s • |
| 136 | EuclideanSpace.single (2 : Fin 3) 1) = |
| 137 | 2 * (1 - deriv (intrinsicWarpingRadius g hrotation hcomplete) s ^ 2) / |
| 138 | intrinsicWarpingRadius g hrotation hcomplete s ^ 2 - |
| 139 | 4 * deriv (deriv (intrinsicWarpingRadius g hrotation hcomplete)) s / |
| 140 | intrinsicWarpingRadius g hrotation hcomplete s := by |
| 141 | let r := (radialArclengthOrderIso g hrotation hcomplete).symm s |
| 142 | have hr : 0 < r := radialArclengthOrderIso_symm_pos g hrotation hcomplete hs |
| 143 | rw [(intrinsicWarpingRadius_hasDerivAt g hrotation hcomplete hs).deriv, |
| 144 | (intrinsicWarpingRadius_deriv_hasDerivAt g hrotation hcomplete hs).deriv, |
| 145 | rotational_scalar_axis D hrotation hr] |
| 146 | change _ = 2 * (1 - axisWarpingSlope g r ^ 2) / axisWarpingRadius g r ^ 2 - |
| 147 | 4 * axisWarpingSecond g r / axisWarpingRadius g r |
| 148 | calc |
| 149 | _ = 2 * (radialTangentialCurvatureFactor g r / axisAngularCoefficient g r) + |
| 150 | 4 * (radialMixedCurvatureFactor g r / axisRadialCoefficient g r) := by ring |
| 151 | _ = _ := by |
| 152 | rw [radialTangentialCurvatureFactor_eq_warping g hr, |
| 153 | radialMixedCurvatureFactor_eq_warping g hr] |
| 154 | ring |
| 155 | |
| 156 | end PoincareMT.M35.Uniqueness |