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.SourceNames.ReducedLength |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.PathSpaceCalculus |
| 3 | |
| 4 | /-! |
| 5 | # Differentiating substitution with a compact parameter |
| 6 | |
| 7 | Morgan-Tian Lemma 6.18, pp. 113-114, requires smooth dependence of the |
| 8 | closed-time ODE. This extends M09's path-space derivative argument to a |
| 9 | compact parameter held fixed during state differentiation. Compact uniform |
| 10 | continuity and the convex mean-value estimate control the sup-norm remainder. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter Metric |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | universe u v |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {K : Type v} [PseudoMetricSpace K] [CompactSpace K] |
| 23 | {E F : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 24 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 25 | |
| 26 | /-- Substitute a continuous path into a field while retaining its |
| 27 | compact parameter, the path-space construction for Lemma 6.18, |
| 28 | pp. 113-114. -/ |
| 29 | def parametricPostcomp (f : C(K × E, F)) (φ : C(K, E)) : C(K, F) := |
| 30 | ⟨fun k => f (k, φ k), f.continuous.comp (continuous_id.prodMk φ.continuous)⟩ |
| 31 | |
| 32 | omit [NormedSpace ℝ E] [NormedSpace ℝ F] in |
| 33 | /-- Compact-parameter substitution is continuous in the path topology, |
| 34 | the continuous dependence input to Lemma 6.18, pp. 113-114. -/ |
| 35 | theorem continuous_parametricPostcomp (f : C(K × E, F)) : |
| 36 | Continuous (parametricPostcomp f) := by |
| 37 | apply ContinuousMap.continuous_of_continuous_uncurry |
| 38 | exact f.continuous.comp (continuous_snd.prodMk continuous_eval) |
| 39 | |
| 40 | /-- A continuous genuine state derivative differentiates compact-parameter |
| 41 | substitution in the sup norm. This adapts M09's pointwise derivative proof |
| 42 | to closed-time fields for Lemma 6.18, pp. 113-114. -/ |
| 43 | theorem hasFDerivAt_parametricPostcomp [FiniteDimensional ℝ E] |
| 44 | (f : C(K × E, F)) (Df : C(K × E, E →L[ℝ] F)) |
| 45 | (hDf : ∀ k x, HasFDerivAt (fun y => f (k, y)) (Df (k, x)) x) |
| 46 | (φ : C(K, E)) : |
| 47 | HasFDerivAt (parametricPostcomp f) |
| 48 | (Proofs.M09.pointwiseLinear (parametricPostcomp Df φ)) φ := by |
| 49 | rw [hasFDerivAt_iff_isLittleO, Asymptotics.isLittleO_iff] |
| 50 | intro ε hε |
| 51 | let B := closedBall (0 : E) (‖φ‖ + 1) |
| 52 | let S : Set (K × E) := univ ×ˢ B |
| 53 | have hcompact : IsCompact S := isCompact_univ.prod (isCompact_closedBall _ _) |
| 54 | obtain ⟨δ, hδ, hcontrol⟩ := Metric.uniformContinuousOn_iff.mp |
| 55 | (hcompact.uniformContinuousOn_of_continuous Df.continuous.continuousOn) ε hε |
| 56 | have hnear : ∀ᶠ ψ : C(K, E) in 𝓝 φ, ‖ψ - φ‖ < min 1 δ := by |
| 57 | filter_upwards [ball_mem_nhds φ (lt_min zero_lt_one hδ)] with ψ hψ |
| 58 | simpa only [mem_ball, dist_eq_norm] using hψ |
| 59 | filter_upwards [hnear] with ψ hψ |
| 60 | apply (ContinuousMap.norm_le _ (mul_nonneg hε.le (norm_nonneg _))).2 |
| 61 | intro k |
| 62 | have hφ : φ k ∈ B := by |
| 63 | change dist (φ k) 0 ≤ ‖φ‖ + 1 |
| 64 | rw [dist_zero_right] |
| 65 | exact (φ.norm_coe_le_norm k).trans (le_add_of_nonneg_right zero_le_one) |
| 66 | have hψk : ‖ψ k - φ k‖ ≤ ‖ψ - φ‖ := (ψ - φ).norm_coe_le_norm k |
| 67 | have hψB : ψ k ∈ B := by |
| 68 | change dist (ψ k) 0 ≤ ‖φ‖ + 1 |
| 69 | rw [dist_zero_right] |
| 70 | calc |
| 71 | ‖ψ k‖ = ‖(ψ k - φ k) + φ k‖ := by rw [sub_add_cancel] |
| 72 | _ ≤ ‖ψ k - φ k‖ + ‖φ k‖ := norm_add_le _ _ |
| 73 | _ ≤ 1 + ‖φ‖ := add_le_add |
| 74 | (hψk.trans (lt_of_lt_of_le hψ (min_le_left _ _)).le) (φ.norm_coe_le_norm k) |
| 75 | _ = ‖φ‖ + 1 := add_comm _ _ |
| 76 | have hsegment : segment ℝ (φ k) (ψ k) ⊆ B := |
| 77 | (convex_closedBall (0 : E) (‖φ‖ + 1)).segment_subset hφ hψB |
| 78 | have hbound : ∀ x ∈ segment ℝ (φ k) (ψ k), ‖Df (k, x) - Df (k, φ k)‖ ≤ ε := by |
| 79 | intro x hx |
| 80 | have hdist : dist x (φ k) < δ := by |
| 81 | rw [dist_eq_norm] |
| 82 | exact (norm_sub_le_of_mem_segment hx).trans_lt |
| 83 | (hψk.trans_lt (lt_of_lt_of_le hψ (min_le_right _ _))) |
| 84 | have hprod : dist (k, x) (k, φ k) < δ := by |
| 85 | simpa only [Prod.dist_eq, dist_self, max_eq_right dist_nonneg] using hdist |
| 86 | have hsmall := hcontrol (k, x) ⟨mem_univ _, hsegment hx⟩ (k, φ k) ⟨mem_univ _, hφ⟩ hprod |
| 87 | exact le_of_lt (by simpa only [dist_eq_norm] using hsmall) |
| 88 | have hrem := Convex.norm_image_sub_le_of_norm_hasFDerivWithin_le' |
| 89 | (fun x (_ : x ∈ segment ℝ (φ k) (ψ k)) => (hDf k x).hasFDerivWithinAt) |
| 90 | hbound (convex_segment (φ k) (ψ k)) |
| 91 | (left_mem_segment ℝ (φ k) (ψ k)) (right_mem_segment ℝ (φ k) (ψ k)) |
| 92 | exact hrem.trans (mul_le_mul_of_nonneg_left hψk hε.le) |
| 93 | |
| 94 | end PoincareMT.M14 |