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.Minimum.Variation.Geometry.ChartPerturbationVelocity |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension |
| 3 | |
| 4 | /-! |
| 5 | # Smooth families realizing fields along compact curves |
| 6 | |
| 7 | A finite time partition and successive actual chart perturbations realize the |
| 8 | prescribed linear field. The zero field fixes the corresponding slice |
| 9 | globally, which is needed for endpoint conditions in free-endpoint variations. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 16 | open Filter |
| 17 | |
| 18 | universe u v |
| 19 | |
| 20 | namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | {P : Type v} [NormedAddCommGroup P] [NormedSpace ℝ P] [FiniteDimensional ℝ P] |
| 26 | |
| 27 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 28 | |
| 29 | set_option maxHeartbeats 1600000 in |
| 30 | set_option backward.isDefEq.respectTransparency false in |
| 31 | theorem exists_smooth_family_of_compact_linear_field |
| 32 | (α : ℝ → M) (Y : ∀ s, P →L[ℝ] TangentSpace (𝓡 n) (α s)) |
| 33 | (U K : Set ℝ) (hU : IsOpen U) (hK : IsCompact K) (hKU : K ⊆ U) |
| 34 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 35 | (hY : ∀ z : P, ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 36 | (fun s ↦ (⟨α s, Y s z⟩ : TangentBundle (𝓡 n) M)) U) : |
| 37 | ∃ (f : ℝ × P → M) (Ω : Set (ℝ × P)) (N : Set P), |
| 38 | IsOpen Ω ∧ IsOpen N ∧ (0 : P) ∈ N ∧ K ×ˢ N ⊆ Ω ∧ |
| 39 | ContMDiffOn (𝓘(ℝ, ℝ × P)) (𝓡 n) ∞ f Ω ∧ |
| 40 | (∀ s, f (s, 0) = α s) ∧ |
| 41 | (∀ s, Y s = 0 → ∀ z, f (s, z) = α s) ∧ |
| 42 | ∀ s ∈ K, ∀ z : P, |
| 43 | (curveVelocity (n := n) (fun u : ℝ ↦ f (s, u • z)) 0 : E) = Y s z := by |
| 44 | classical |
| 45 | let W : ℝ → Set ℝ := fun t ↦ U ∩ α ⁻¹' (chartAt E (α t)).source |
| 46 | have hW (t : ℝ) : IsOpen (W t) := |
| 47 | hα.continuousOn.isOpen_inter_preimage hU (chartAt E (α t)).open_source |
| 48 | obtain ⟨S, _, hcover⟩ := hK.elim_nhds_subcover W (fun t ht ↦ |
| 49 | (hW t).mem_nhds ⟨hKU ht, mem_chart_source E (α t)⟩) |
| 50 | have hcover' : K ⊆ ⋃ i : S, W i := by |
| 51 | intro s hs |
| 52 | obtain ⟨t, htS, ht⟩ := Set.mem_iUnion₂.mp (hcover hs) |
| 53 | exact Set.mem_iUnion.mpr ⟨⟨t, htS⟩, ht⟩ |
| 54 | obtain ⟨ρ, hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate (𝓘(ℝ, ℝ)) |
| 55 | hK.isClosed (fun i : S ↦ W i) (fun i ↦ hW i) hcover' |
| 56 | let B : S → ℝ → P →L[ℝ] E := fun i s ↦ |
| 57 | (mfderiv (𝓡 n) (𝓡 n) (chartAt E (α i)) (α s)).comp (Y s) |
| 58 | have hB (i : S) : ContDiffOn ℝ ∞ (B i) (W i) := by |
| 59 | apply contDiffOn_clm_apply.mpr |
| 60 | intro z |
| 61 | have h := (tangentChartPhase_contMDiffOn (α i)).comp |
| 62 | ((hY z).mono (show W i ⊆ U from Set.inter_subset_left)) (fun s hs ↦ hs.2) |
| 63 | exact h.contDiffOn.snd |
| 64 | have hpiece (i : S) (s : ℝ) (z : P) : |
| 65 | chartVectorField (α i) (ρ i s • B i s z) (α s) = ρ i s • Y s z := by |
| 66 | by_cases hz : ρ i s = 0 |
| 67 | · simp only [hz, zero_smul, chartVectorField, VectorField.mpullback, map_zero] |
| 68 | · have hsi := hρ i (subset_tsupport (ρ i) (Function.mem_support.mpr hz)) |
| 69 | change (mfderiv (𝓡 n) (𝓡 n) (chartAt E (α i)) (α s)).inverse |
| 70 | (ρ i s • mfderiv (𝓡 n) (𝓡 n) (chartAt E (α i)) (α s) (Y s z)) = _ |
| 71 | rw [map_smul] |
| 72 | exact congrArg (fun v : TangentSpace (𝓡 n) (α s) ↦ ρ i s • v) |
| 73 | (chartVectorField_differential (α i) (α s) (Y s z) hsi.2) |
| 74 | have hfinite (L : Finset S) : |
| 75 | ∃ (f : ℝ × P → M) (Ω : Set (ℝ × P)), IsOpen Ω ∧ |
| 76 | (∀ s ∈ K, (s, (0 : P)) ∈ Ω) ∧ |
| 77 | ContMDiffOn (𝓘(ℝ, ℝ × P)) (𝓡 n) ∞ f Ω ∧ |
| 78 | (∀ s, f (s, 0) = α s) ∧ |
| 79 | (∀ s, Y s = 0 → ∀ z, f (s, z) = α s) ∧ |
| 80 | ∀ s ∈ K, ∀ z : P, |
| 81 | (curveVelocity (n := n) (fun u : ℝ ↦ f (s, u • z)) 0 : E) = |
| 82 | ∑ i ∈ L, ρ i s • Y s z := by |
| 83 | induction L using Finset.induction_on with |
| 84 | | empty => |
| 85 | refine ⟨fun z ↦ α z.1, U ×ˢ Set.univ, hU.prod isOpen_univ, |
| 86 | fun s hs ↦ ⟨hKU hs, Set.mem_univ _⟩, ?_, fun _ ↦ rfl, |
| 87 | fun _ _ _ ↦ rfl, ?_⟩ |
| 88 | · exact hα.comp contDiff_fst.contMDiff.contMDiffOn (fun z hz ↦ hz.1) |
| 89 | · intro s hs z |
| 90 | simp only [Finset.sum_empty, curveVelocity, mfderiv_const, zero_apply] |
| 91 | | @insert i L hi ih => |
| 92 | obtain ⟨f, Ω, hΩ, hKΩ, hf, hcenter, hfixed, hvelocity⟩ := ih |
| 93 | have hchart : ∀ s ∈ K ∩ tsupport (ρ i), |
| 94 | f (s, 0) ∈ (chartAt E (α i)).source := by |
| 95 | intro s hs |
| 96 | rw [hcenter] |
| 97 | exact (hρ i hs.2).2 |
| 98 | obtain ⟨V, hV, _, hKV, hg⟩ := weightedChartPerturbation_smooth_near_center |
| 99 | (α i) (W i) (hW i) (ρ i) (ρ i).contMDiff.contDiff (hρ i) |
| 100 | (B i) (hB i) f Ω hΩ hf K hKΩ hchart |
| 101 | let g := weightedChartPerturbation (α i) (W i) (ρ i) (B i) f |
| 102 | refine ⟨g, V, hV, hKV, hg, ?_, ?_, ?_⟩ |
| 103 | · intro s |
| 104 | exact (weightedChartPerturbation_center (α i) (W i) (ρ i) (B i) f s).trans |
| 105 | (hcenter s) |
| 106 | · intro s hYs z |
| 107 | have hBzero : B i s z = 0 := by |
| 108 | change mfderiv (𝓡 n) (𝓡 n) (chartAt E (α i)) (α s) (Y s z) = 0 |
| 109 | rw [hYs] |
| 110 | exact (mfderiv (𝓡 n) (𝓡 n) (chartAt E (α i)) (α s)).map_zero |
| 111 | exact (weightedChartPerturbation_eq_of_zero (α i) (W i) (ρ i) (B i) f |
| 112 | (s, z) (Or.inr hBzero)).trans (hfixed s hYs z) |
| 113 | · intro s hs z |
| 114 | have hbranch : ρ i s ≠ 0 → s ∈ W i ∧ f (s, 0) ∈ (chartAt E (α i)).source := by |
| 115 | intro hne |
| 116 | have hsi := hρ i (subset_tsupport (ρ i) (Function.mem_support.mpr hne)) |
| 117 | exact ⟨hsi, by rw [hcenter]; exact hsi.2⟩ |
| 118 | have hd := weightedChartPerturbation_curveVelocity (α i) (W i) (ρ i) (B i) f s z |
| 119 | ((hf.contMDiffAt (hΩ.mem_nhds (hKΩ s hs))).mdifferentiableAt (by simp)) hbranch |
| 120 | change curveVelocity (n := n) (fun u : ℝ ↦ g (s, u • z)) 0 = _ at hd |
| 121 | rw [hvelocity s hs z, hcenter, hpiece] at hd |
| 122 | rw [hd, Finset.sum_insert hi] |
| 123 | exact add_comm _ _ |
| 124 | obtain ⟨f, Ω, hΩ, hKΩ, hf, hcenter, hfixed, hvelocity⟩ := hfinite Finset.univ |
| 125 | have hnear : ∀ᶠ z : P in 𝓝 0, ∀ s ∈ K, (s, z) ∈ Ω := by |
| 126 | apply hK.eventually_forall_of_forall_eventually |
| 127 | intro s hs |
| 128 | exact (hΩ.preimage (continuous_swap (X := P) (Y := ℝ))).mem_nhds (hKΩ s hs) |
| 129 | obtain ⟨N, hNsub, hN, h0N⟩ := mem_nhds_iff.mp hnear |
| 130 | refine ⟨f, Ω, N, hΩ, hN, h0N, fun z hz ↦ hNsub hz.2 z.1 hz.1, |
| 131 | hf, hcenter, hfixed, ?_⟩ |
| 132 | intro s hs z |
| 133 | have hsum : ∑ i : S, ρ i s = 1 := by |
| 134 | simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one hs |
| 135 | calc |
| 136 | _ = ∑ i : S, ρ i s • Y s z := hvelocity s hs z |
| 137 | _ = (∑ i : S, ρ i s) • Y s z := Finset.sum_smul.symm |
| 138 | _ = Y s z := by rw [hsum, one_smul] |
| 139 | |
| 140 | end PoincareMT.ReducedLengthMinimum.Variation.Geometry |