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.Calculus.PathSpaceCalculus |
| 2 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic |
| 3 | import Mathlib.Topology.Order.ProjIcc |
| 4 | |
| 5 | /-! |
| 6 | # Smooth primitives with a finite-dimensional parameter |
| 7 | |
| 8 | Rescale to the fixed unit interval. Substitution on continuous paths is |
| 9 | smooth, and integration on that interval is a bounded linear functional. |
| 10 | The rescaling identity includes negative and zero terminal times. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped ContDiff Topology intervalIntegral |
| 16 | open Set |
| 17 | |
| 18 | namespace PoincareMT.ReducedLength |
| 19 | |
| 20 | noncomputable def unitTimeProjection : C(ℝ, Set.Icc (0 : ℝ) 1) := |
| 21 | ⟨Set.projIcc 0 1 zero_le_one, continuous_projIcc⟩ |
| 22 | |
| 23 | @[simp] theorem unitTimeProjection_of_mem {r : ℝ} (hr : r ∈ Set.Icc (0 : ℝ) 1) : |
| 24 | unitTimeProjection r = ⟨r, hr⟩ := |
| 25 | Set.projIcc_of_mem zero_le_one hr |
| 26 | |
| 27 | noncomputable def unitPathIntegral : C(Set.Icc (0 : ℝ) 1, ℝ) →L[ℝ] ℝ := by |
| 28 | let L : C(Set.Icc (0 : ℝ) 1, ℝ) →ₗ[ℝ] ℝ := { |
| 29 | toFun := fun v ↦ ∫ r in (0 : ℝ)..1, v (unitTimeProjection r) |
| 30 | map_add' := by |
| 31 | intro v w |
| 32 | exact intervalIntegral.integral_add |
| 33 | ((v.continuous.comp unitTimeProjection.continuous).intervalIntegrable _ _) |
| 34 | ((w.continuous.comp unitTimeProjection.continuous).intervalIntegrable _ _) |
| 35 | map_smul' := by |
| 36 | intro c v |
| 37 | exact intervalIntegral.integral_smul c _ |
| 38 | } |
| 39 | refine L.mkContinuous 1 ?_ |
| 40 | intro v |
| 41 | change ‖∫ r in (0 : ℝ)..1, v (unitTimeProjection r)‖ ≤ 1 * ‖v‖ |
| 42 | simpa using intervalIntegral.norm_integral_le_of_norm_le_const |
| 43 | (a := 0) (b := 1) (fun r _ ↦ v.norm_coe_le_norm (unitTimeProjection r)) |
| 44 | |
| 45 | @[simp] theorem unitPathIntegral_apply (v : C(Set.Icc (0 : ℝ) 1, ℝ)) : |
| 46 | unitPathIntegral v = ∫ r in (0 : ℝ)..1, v (unitTimeProjection r) := rfl |
| 47 | |
| 48 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 49 | |
| 50 | noncomputable def scaledSegmentPath : (E × ℝ) →L[ℝ] C(Set.Icc (0 : ℝ) 1, E × ℝ) := by |
| 51 | let L : (E × ℝ) →ₗ[ℝ] C(Set.Icc (0 : ℝ) 1, E × ℝ) := { |
| 52 | toFun := fun z ↦ ⟨fun r ↦ (z.1, z.2 * (r : ℝ)), |
| 53 | continuous_const.prodMk (continuous_const.mul continuous_subtype_val)⟩ |
| 54 | map_add' := by |
| 55 | intro z w |
| 56 | apply ContinuousMap.ext |
| 57 | intro r |
| 58 | change (z.1 + w.1, (z.2 + w.2) * (r : ℝ)) = |
| 59 | (z.1 + w.1, z.2 * (r : ℝ) + w.2 * (r : ℝ)) |
| 60 | rw [add_mul] |
| 61 | map_smul' := by |
| 62 | intro c z |
| 63 | apply ContinuousMap.ext |
| 64 | intro r |
| 65 | change (c • z.1, (c * z.2) * (r : ℝ)) = |
| 66 | (c • z.1, c * (z.2 * (r : ℝ))) |
| 67 | rw [mul_assoc] |
| 68 | } |
| 69 | refine L.mkContinuous 1 ?_ |
| 70 | intro z |
| 71 | rw [one_mul] |
| 72 | apply (ContinuousMap.norm_le _ (norm_nonneg z)).2 |
| 73 | intro r |
| 74 | change ‖(z.1, z.2 * (r : ℝ))‖ ≤ ‖z‖ |
| 75 | rw [Prod.norm_def, Prod.norm_def] |
| 76 | apply max_le (le_max_left _ _) |
| 77 | calc |
| 78 | ‖z.2 * (r : ℝ)‖ = ‖z.2‖ * |(r : ℝ)| := by simp only [norm_mul, Real.norm_eq_abs] |
| 79 | _ ≤ ‖z.2‖ * 1 := mul_le_mul_of_nonneg_left |
| 80 | (by rw [abs_of_nonneg r.property.1]; exact r.property.2) (norm_nonneg _) |
| 81 | _ ≤ max ‖z.1‖ ‖z.2‖ := by rw [mul_one]; exact le_max_right _ _ |
| 82 | |
| 83 | @[simp] theorem scaledSegmentPath_apply (z : E × ℝ) (r : Set.Icc (0 : ℝ) 1) : |
| 84 | scaledSegmentPath z r = (z.1, z.2 * (r : ℝ)) := rfl |
| 85 | |
| 86 | theorem integral_zero_to_eq_scaled (f : ℝ → ℝ) (a : ℝ) : |
| 87 | (∫ s in 0..a, f s) = a * ∫ r in (0 : ℝ)..1, f (a * r) := by |
| 88 | simpa only [smul_eq_mul, mul_zero, mul_one] using |
| 89 | (intervalIntegral.smul_integral_comp_mul_left (a := 0) (b := 1) f a).symm |
| 90 | |
| 91 | theorem contDiff_parameter_primitive [FiniteDimensional ℝ E] |
| 92 | (g : E × ℝ → ℝ) (hg : ContDiff ℝ ∞ g) : |
| 93 | ContDiff ℝ ∞ (fun z : E × ℝ ↦ ∫ s in 0..z.2, g (z.1, s)) := by |
| 94 | let gC : C(E × ℝ, ℝ) := ⟨g, hg.continuous⟩ |
| 95 | have hsub := (contDiff_postcomp_smooth (K := Set.Icc (0 : ℝ) 1) gC hg).comp |
| 96 | (scaledSegmentPath (E := E)).contDiff |
| 97 | have havg : ContDiff ℝ ∞ |
| 98 | (fun z : E × ℝ ↦ unitPathIntegral (gC.comp (scaledSegmentPath z))) := |
| 99 | unitPathIntegral.contDiff.comp hsub |
| 100 | have heq (z : E × ℝ) : |
| 101 | unitPathIntegral (gC.comp (scaledSegmentPath z)) = |
| 102 | ∫ r in (0 : ℝ)..1, g (z.1, z.2 * r) := by |
| 103 | rw [unitPathIntegral_apply] |
| 104 | apply intervalIntegral.integral_congr |
| 105 | intro r hr |
| 106 | have hr' : r ∈ Set.Icc (0 : ℝ) 1 := by |
| 107 | simpa only [Set.uIcc_of_le zero_le_one] using hr |
| 108 | simp only [ContinuousMap.comp_apply, unitTimeProjection_of_mem hr', |
| 109 | scaledSegmentPath_apply, gC, ContinuousMap.coe_mk] |
| 110 | have hresult : ContDiff ℝ ∞ (fun z : E × ℝ ↦ |
| 111 | z.2 * unitPathIntegral (gC.comp (scaledSegmentPath z))) := contDiff_snd.mul havg |
| 112 | have hfun : (fun z : E × ℝ ↦ ∫ s in 0..z.2, g (z.1, s)) = |
| 113 | (fun z : E × ℝ ↦ z.2 * unitPathIntegral (gC.comp (scaledSegmentPath z))) := by |
| 114 | funext z |
| 115 | rw [heq, integral_zero_to_eq_scaled] |
| 116 | rw [hfun] |
| 117 | exact hresult |
| 118 | |
| 119 | end PoincareMT.ReducedLength |