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 Mathlib.Analysis.Calculus.ContDiff.FiniteDimension |
| 2 | import Mathlib.Analysis.Calculus.MeanValue |
| 3 | import Mathlib.Topology.ContinuousMap.Compact |
| 4 | import Mathlib.Topology.ContinuousMap.Algebra |
| 5 | |
| 6 | /-! |
| 7 | # Smooth substitution on a compact space of paths |
| 8 | |
| 9 | The derivative of substitution acts pointwise. A uniform mean-value |
| 10 | estimate on a finite-dimensional compact ball proves differentiability in |
| 11 | the sup norm. This is the analytic input to the regularized ODE family. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option maxSynthPendingDepth 3 |
| 16 | |
| 17 | open scoped ContDiff Topology |
| 18 | open Set Filter |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | universe u v |
| 23 | |
| 24 | variable {K : Type v} [TopologicalSpace K] [CompactSpace K] |
| 25 | {E F : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 26 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 27 | |
| 28 | noncomputable def pointwiseLinear (A : C(K, E →L[ℝ] F)) : C(K, E) →L[ℝ] C(K, F) := |
| 29 | ({ |
| 30 | toFun := fun v ↦ ⟨fun k ↦ A k (v k), A.continuous.clm_apply v.continuous⟩ |
| 31 | map_add' := by intro v w; ext k; simp |
| 32 | map_smul' := by intro c v; ext k; simp |
| 33 | } : C(K, E) →ₗ[ℝ] C(K, F)).mkContinuous ‖A‖ (by |
| 34 | intro v |
| 35 | apply (ContinuousMap.norm_le _ (mul_nonneg (norm_nonneg A) (norm_nonneg v))).2 |
| 36 | intro k |
| 37 | exact ((A k).le_opNorm (v k)).trans |
| 38 | (mul_le_mul (A.norm_coe_le_norm k) (v.norm_coe_le_norm k) |
| 39 | (norm_nonneg _) (norm_nonneg _))) |
| 40 | |
| 41 | @[simp] theorem pointwiseLinear_apply (A : C(K, E →L[ℝ] F)) (v : C(K, E)) (k : K) : |
| 42 | pointwiseLinear A v k = A k (v k) := rfl |
| 43 | |
| 44 | theorem pointwiseLinear_norm_le (A : C(K, E →L[ℝ] F)) : |
| 45 | ‖pointwiseLinear A‖ ≤ ‖A‖ := by |
| 46 | apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg A) |
| 47 | intro v |
| 48 | apply (ContinuousMap.norm_le _ (mul_nonneg (norm_nonneg A) (norm_nonneg v))).2 |
| 49 | intro k |
| 50 | exact ((A k).le_opNorm (v k)).trans |
| 51 | (mul_le_mul (A.norm_coe_le_norm k) (v.norm_coe_le_norm k) |
| 52 | (norm_nonneg _) (norm_nonneg _)) |
| 53 | |
| 54 | noncomputable def pointwiseOperator : C(K, E →L[ℝ] F) →L[ℝ] (C(K, E) →L[ℝ] C(K, F)) := by |
| 55 | let L : C(K, E →L[ℝ] F) →ₗ[ℝ] (C(K, E) →L[ℝ] C(K, F)) := { |
| 56 | toFun := fun A ↦ pointwiseLinear (K := K) (E := E) (F := F) A |
| 57 | map_add' := by intro A B; ext v k; rfl |
| 58 | map_smul' := by intro c A; ext v k; rfl |
| 59 | } |
| 60 | have hL : ∀ A : C(K, E →L[ℝ] F), ‖L A‖ ≤ 1 * ‖A‖ := by |
| 61 | intro (A : C(K, E →L[ℝ] F)) |
| 62 | change ‖pointwiseLinear (K := K) (E := E) (F := F) A‖ ≤ 1 * ‖A‖ |
| 63 | exact (pointwiseLinear_norm_le (K := K) (E := E) (F := F) A).trans_eq |
| 64 | (one_mul ‖A‖).symm |
| 65 | exact LinearMap.mkContinuous L 1 hL |
| 66 | |
| 67 | @[simp] theorem pointwiseOperator_apply (A : C(K, E →L[ℝ] F)) : |
| 68 | pointwiseOperator A = pointwiseLinear A := rfl |
| 69 | |
| 70 | theorem pointwiseOperator_norm_le : |
| 71 | ‖pointwiseOperator (K := K) (E := E) (F := F)‖ ≤ 1 := by |
| 72 | apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one |
| 73 | intro A |
| 74 | simpa only [one_mul, pointwiseOperator_apply] using pointwiseLinear_norm_le A |
| 75 | |
| 76 | theorem hasFDerivAt_postcomp [FiniteDimensional ℝ E] |
| 77 | (f : C(E, F)) (Df : C(E, E →L[ℝ] F)) |
| 78 | (hDf : ∀ x, HasFDerivAt f (Df x) x) (φ : C(K, E)) : |
| 79 | HasFDerivAt (fun ψ : C(K, E) ↦ f.comp ψ) |
| 80 | (pointwiseLinear (Df.comp φ)) φ := by |
| 81 | rw [hasFDerivAt_iff_isLittleO, Asymptotics.isLittleO_iff] |
| 82 | intro ε hε |
| 83 | let S := Metric.closedBall (0 : E) (‖φ‖ + 1) |
| 84 | have hcompact : IsCompact S := isCompact_closedBall _ _ |
| 85 | obtain ⟨δ, hδ, hcontrol⟩ := Metric.uniformContinuousOn_iff.mp |
| 86 | (hcompact.uniformContinuousOn_of_continuous Df.continuous.continuousOn) ε hε |
| 87 | have hnear : ∀ᶠ ψ : C(K, E) in 𝓝 φ, ‖ψ - φ‖ < min 1 δ := by |
| 88 | filter_upwards [Metric.ball_mem_nhds φ (lt_min zero_lt_one hδ)] with ψ hψ |
| 89 | simpa only [Metric.mem_ball, dist_eq_norm] using hψ |
| 90 | filter_upwards [hnear] with ψ hψ |
| 91 | apply (ContinuousMap.norm_le _ (mul_nonneg hε.le (norm_nonneg _))).2 |
| 92 | intro k |
| 93 | have hφ : φ k ∈ S := by |
| 94 | change dist (φ k) 0 ≤ ‖φ‖ + 1 |
| 95 | rw [dist_zero_right] |
| 96 | exact (φ.norm_coe_le_norm k).trans (le_add_of_nonneg_right zero_le_one) |
| 97 | have hψk : ‖ψ k - φ k‖ ≤ ‖ψ - φ‖ := (ψ - φ).norm_coe_le_norm k |
| 98 | have hψS : ψ k ∈ S := by |
| 99 | change dist (ψ k) 0 ≤ ‖φ‖ + 1 |
| 100 | rw [dist_zero_right] |
| 101 | calc |
| 102 | ‖ψ k‖ = ‖(ψ k - φ k) + φ k‖ := by rw [sub_add_cancel] |
| 103 | _ ≤ ‖ψ k - φ k‖ + ‖φ k‖ := norm_add_le _ _ |
| 104 | _ ≤ 1 + ‖φ‖ := add_le_add (hψk.trans (lt_of_lt_of_le hψ (min_le_left _ _)).le) |
| 105 | (φ.norm_coe_le_norm k) |
| 106 | _ = ‖φ‖ + 1 := add_comm _ _ |
| 107 | have hsegment : segment ℝ (φ k) (ψ k) ⊆ S := |
| 108 | (convex_closedBall (0 : E) (‖φ‖ + 1)).segment_subset hφ hψS |
| 109 | have hbound : ∀ x ∈ segment ℝ (φ k) (ψ k), ‖Df x - Df (φ k)‖ ≤ ε := by |
| 110 | intro x hx |
| 111 | apply le_of_lt |
| 112 | have hdist : dist x (φ k) < δ := by |
| 113 | rw [dist_eq_norm] |
| 114 | exact (norm_sub_le_of_mem_segment hx).trans_lt |
| 115 | (hψk.trans_lt (lt_of_lt_of_le hψ (min_le_right _ _))) |
| 116 | simpa only [dist_eq_norm] using hcontrol x (hsegment hx) (φ k) hφ hdist |
| 117 | have hrem := Convex.norm_image_sub_le_of_norm_hasFDerivWithin_le' |
| 118 | (fun x (_ : x ∈ segment ℝ (φ k) (ψ k)) ↦ (hDf x).hasFDerivWithinAt) |
| 119 | hbound (convex_segment (φ k) (ψ k)) |
| 120 | (left_mem_segment ℝ (φ k) (ψ k)) (right_mem_segment ℝ (φ k) (ψ k)) |
| 121 | exact hrem.trans (mul_le_mul_of_nonneg_left hψk hε.le) |
| 122 | |
| 123 | theorem contDiff_postcomp_nat [FiniteDimensional ℝ E] |
| 124 | (n : ℕ) (f : C(E, F)) (hf : ContDiff ℝ n f) : |
| 125 | ContDiff ℝ n (fun φ : C(K, E) ↦ f.comp φ) := by |
| 126 | induction n generalizing F with |
| 127 | | zero => exact contDiff_zero.mpr f.continuous_postcomp |
| 128 | | succ n ih => |
| 129 | simp only [Nat.cast_add, Nat.cast_one] at hf ⊢ |
| 130 | obtain ⟨df, hdf, hderiv⟩ := contDiff_succ_iff_hasFDerivAt.mp hf |
| 131 | let Df : C(E, E →L[ℝ] F) := ⟨df, hdf.continuous⟩ |
| 132 | refine contDiff_succ_iff_hasFDerivAt.mpr |
| 133 | ⟨fun φ ↦ pointwiseLinear (Df.comp φ), ?_, fun φ ↦ hasFDerivAt_postcomp f Df hderiv φ⟩ |
| 134 | exact (pointwiseOperator (K := K) (E := E) (F := F)).contDiff.comp (ih Df hdf) |
| 135 | |
| 136 | theorem contDiff_postcomp_smooth [FiniteDimensional ℝ E] |
| 137 | (f : C(E, F)) (hf : ContDiff ℝ ∞ f) : |
| 138 | ContDiff ℝ ∞ (fun φ : C(K, E) ↦ f.comp φ) := |
| 139 | contDiff_infty.mpr fun n ↦ contDiff_postcomp_nat n f (contDiff_infty.mp hf n) |
| 140 | |
| 141 | end PoincareMT.ReducedLength |