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.Exponential.ParametricEndpointFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.UnitIntervalAction |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Geometry.MinimizingInitialVectors |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.ActionCongruence |
| 5 | import Mathlib.Geometry.Manifold.Algebra.LieGroup |
| 6 | |
| 7 | /-! |
| 8 | # One smooth comparison action for nearby minimizing data |
| 9 | |
| 10 | The initial datum stays fixed in each barrier while its evaluation point |
| 11 | and time vary. The same scalar action is smooth jointly in all parameters. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option maxSynthPendingDepth 3 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] [ConnectedSpace M] |
| 26 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 27 | |
| 28 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 29 | local notation "P" => TangentSpace (𝓡 n) p × ℝ |
| 30 | |
| 31 | set_option maxHeartbeats 1600000 in |
| 32 | -- The center parameter, endpoint coordinates and evaluation time are distinct variables. |
| 33 | set_option backward.isDefEq.respectTransparency false in |
| 34 | theorem lExponentialFamily_exists_parametric_comparison_action |
| 35 | (hM04 : RicciFlowCurvatureTheory.{u}) (hL : LGeodesicTheory F T τmax) |
| 36 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 37 | (A : LExponentialFamily F T τmax p) (Z0 : TangentSpace (𝓡 n) p) |
| 38 | (b0 : ℝ) (hb0 : 0 < b0) (hmax0 : b0 < τmax) : |
| 39 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 41 | let e := chartAt E (A.gamma Z0 b0) |
| 42 | ∃ (W : Set P) (V : Set (P × E)) (C : (P × E) × ℝ → ℝ), |
| 43 | IsOpen W ∧ (Z0, b0) ∈ W ∧ W ⊆ Set.univ ×ˢ Set.Ioo 0 τmax ∧ |
| 44 | IsOpen V ∧ V ⊆ W ×ˢ e.target ∧ |
| 45 | ContDiffOn ℝ ∞ C (V ×ˢ Set.Ioo 0 τmax) ∧ |
| 46 | ∀ a ∈ W, A.gamma a.1 a.2 ∈ e.source ∧ (a, e (A.gamma a.1 a.2)) ∈ V ∧ |
| 47 | ∀ (ha : 0 < a.2) (hmax : a.2 < τmax), |
| 48 | IsMinimizingBackwardLPath F T 0 a.2 (A.path a.1 a.2 ha hmax) → |
| 49 | ∃ B : ReducedLengthUpperBarrier F T p (A.gamma a.1 a.2) a.2, |
| 50 | B.representative = fun w ↦ C ((a, e w.1), w.2) := by |
| 51 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 52 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 53 | letI : FiniteDimensional ℝ (TangentSpace (𝓡 n) p) := |
| 54 | VectorBundle.finiteDimensional ℝ E (TangentSpace (𝓡 n) : M → Type _) p |
| 55 | let e := chartAt E (A.gamma Z0 b0) |
| 56 | let S : Set (P × ℝ) := (Set.univ ×ˢ Set.Ioo 0 τmax) ×ˢ Set.univ |
| 57 | let Φ : P × ℝ → TangentSpace (𝓡 n) p × ℝ := |
| 58 | fun z ↦ (z.1.1, Real.sqrt z.1.2 * z.2) |
| 59 | let D := S ∩ Φ ⁻¹' A.squareDomain |
| 60 | let γ : P × ℝ → M := fun z ↦ A.squareFamily z.1.1 (Real.sqrt z.1.2 * z.2) |
| 61 | have hS : IsOpen S := (isOpen_univ.prod isOpen_Ioo).prod isOpen_univ |
| 62 | have hΦ : ContDiffOn ℝ ∞ Φ S := contDiff_fst.fst.contDiffOn.prodMk |
| 63 | ((contDiff_fst.snd.contDiffOn.sqrt (fun z hz ↦ hz.1.2.1.ne')).mul contDiffOn_snd) |
| 64 | have hD : IsOpen D := hΦ.continuousOn.isOpen_inter_preimage hS A.square_open |
| 65 | have hA : ContMDiffOn (𝓘(ℝ, TangentSpace (𝓡 n) p × ℝ)) (𝓡 n) ∞ |
| 66 | (fun z ↦ A.squareFamily z.1 z.2) A.squareDomain := by |
| 67 | convert! A.square_smooth using 1 <;> |
| 68 | simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 69 | have hγ : ContMDiffOn (𝓘(ℝ, P × ℝ)) (𝓡 n) ∞ γ D := |
| 70 | hA.comp (hΦ.mono Set.inter_subset_left).contMDiffOn (fun z hz ↦ hz.2) |
| 71 | have hI : ∀ r ∈ Set.Icc (0 : ℝ) 1, ((Z0, b0), r) ∈ D := by |
| 72 | intro r hr |
| 73 | refine ⟨⟨⟨Set.mem_univ _, hb0, hmax0⟩, Set.mem_univ _⟩, ?_⟩ |
| 74 | exact A.square_contains ⟨Set.mem_univ _, mul_nonneg (Real.sqrt_nonneg _) hr.1, |
| 75 | (mul_le_of_le_one_right (Real.sqrt_nonneg _) hr.2).trans_lt |
| 76 | (Real.sqrt_lt_sqrt hb0.le hmax0)⟩ |
| 77 | have hγstart (a : P) : γ (a, 0) = p := by |
| 78 | simp only [γ, mul_zero, A.square_at_zero] |
| 79 | have hγend (a : P) (ha : 0 < a.2) (hmax : a.2 < τmax) : |
| 80 | γ (a, 1) = A.gamma a.1 a.2 := by |
| 81 | dsimp only [γ] |
| 82 | rw [mul_one, A.square_agrees a.1 (Real.sqrt a.2) |
| 83 | ⟨Real.sqrt_nonneg _, Real.sqrt_lt_sqrt ha.le hmax⟩, Real.sq_sqrt ha.le] |
| 84 | obtain ⟨f, Ω, V, W, hΩ, hV, hW, haW, haV, hVe, hVΩ, hf, |
| 85 | hstart, hend, hWD, hgraph, hcenter⟩ := |
| 86 | exists_parametric_smooth_endpoint_family γ D hD hγ (Z0, b0) hI |
| 87 | have hγend0 := hγend (Z0, b0) hb0 hmax0 |
| 88 | rw [hγend0] at haV hVe hend hgraph hcenter |
| 89 | have hWt : W ⊆ Set.univ ×ˢ Set.Ioo 0 τmax := by |
| 90 | intro a ha |
| 91 | exact (hWD (show (a, (0 : ℝ)) ∈ W ×ˢ Set.Icc 0 1 from |
| 92 | ⟨ha, le_rfl, zero_le_one⟩)).1.1 |
| 93 | have hgraph' (a : P) (ha : a ∈ W) : (a, e (A.gamma a.1 a.2)) ∈ V := by |
| 94 | have h := hgraph a ha |
| 95 | rwa [hγend a (hWt ha).2.1 (hWt ha).2.2] at h |
| 96 | have hsource (a : P) (ha : a ∈ W) : A.gamma a.1 a.2 ∈ e.source := by |
| 97 | have hy : e (A.gamma a.1 a.2) ∈ e.target := (hVe (hgraph' a ha)).2 |
| 98 | have heq : e.symm (e (A.gamma a.1 a.2)) = A.gamma a.1 a.2 := by |
| 99 | have h := hcenter a ha 1 ⟨zero_le_one, le_rfl⟩ |
| 100 | rw [hγend a (hWt ha).2.1 (hWt ha).2.2, hend] at h |
| 101 | exact h |
| 102 | rw [← heq] |
| 103 | exact e.map_target hy |
| 104 | let L : (P × E) × ℝ → ℝ := fun z ↦ backwardLLength F T 0 z.2 |
| 105 | (fun t ↦ f (z.1, Real.sqrt t / Real.sqrt z.2)) |
| 106 | let C : (P × E) × ℝ → ℝ := fun z ↦ L z / (2 * Real.sqrt z.2) |
| 107 | have hLaction : ContDiffOn ℝ ∞ L (V ×ˢ Set.Ioo 0 τmax) := |
| 108 | contDiffOn_unitFamily_action F hM04 T τmax hτmax hwindow f Ω hΩ hf V hV hVΩ |
| 109 | have hroot : ContDiffOn ℝ ∞ (fun z : (P × E) × ℝ ↦ Real.sqrt z.2) |
| 110 | (V ×ˢ Set.Ioo 0 τmax) := contDiffOn_snd.sqrt (fun z hz ↦ hz.2.1.ne') |
| 111 | have hC : ContDiffOn ℝ ∞ C (V ×ˢ Set.Ioo 0 τmax) := |
| 112 | hLaction.div (contDiffOn_const.mul hroot) |
| 113 | (fun z hz ↦ (mul_pos zero_lt_two (Real.sqrt_pos.mpr hz.2.1)).ne') |
| 114 | refine ⟨W, V, C, hW, haW, hWt, hV, hVe, hC, ?_⟩ |
| 115 | intro a ha |
| 116 | refine ⟨hsource a ha, hgraph' a ha, ?_⟩ |
| 117 | intro ht hmax hmin |
| 118 | let q := A.gamma a.1 a.2 |
| 119 | let c : M × ℝ → (P × E) × ℝ := fun w ↦ ((a, e w.1), w.2) |
| 120 | let Cdom : Set (M × ℝ) := e.source ×ˢ Set.univ |
| 121 | let N := Cdom ∩ c ⁻¹' (V ×ˢ Set.Ioo 0 τmax) |
| 122 | let B : M × ℝ → ℝ := fun w ↦ C (c w) |
| 123 | have hc : ContMDiffOn ((𝓡 n).prod (𝓘(ℝ, ℝ))) (𝓘(ℝ, (P × E) × ℝ)) ∞ c Cdom := |
| 124 | (contMDiffOn_const.prodMk_space |
| 125 | (contMDiffOn_chart.comp contMDiffOn_fst (fun w hw ↦ hw.1))).prodMk_space contMDiffOn_snd |
| 126 | have hN : IsOpen N := hc.continuousOn.isOpen_inter_preimage |
| 127 | (e.open_source.prod isOpen_univ) (hV.prod isOpen_Ioo) |
| 128 | have hqN : (q, a.2) ∈ N := ⟨⟨hsource a ha, Set.mem_univ _⟩, hgraph' a ha, ht, hmax⟩ |
| 129 | have hB : ContMDiffOn ((𝓡 n).prod (𝓘(ℝ, ℝ))) (𝓘(ℝ, ℝ)) ∞ B N := |
| 130 | hC.contMDiffOn.comp (hc.mono Set.inter_subset_left) (fun w hw ↦ hw.2) |
| 131 | have hBat := hB.contMDiffAt (hN.mem_nhds hqN) |
| 132 | have hBtime : ∃ d : ℝ, HasDerivAt (fun s ↦ B (q, s)) d a.2 := by |
| 133 | have h := (hBat.comp a.2 (contMDiffAt_const.prodMk contMDiffAt_id)).contDiffAt |
| 134 | exact ⟨_, (h.differentiableAt (by simp)).hasDerivAt⟩ |
| 135 | refine ⟨{ |
| 136 | neighborhood := N |
| 137 | neighborhood_open := hN |
| 138 | center_mem := hqN |
| 139 | representative := B |
| 140 | touches := ?_ |
| 141 | dominates := ?_ |
| 142 | representative_spacetime_smooth := hBat |
| 143 | representative_space_smooth_on := hB.comp |
| 144 | (contMDiffOn_id.prodMk contMDiffOn_const) (fun x hx ↦ hx) |
| 145 | representative_space_smooth := hBat.comp q (contMDiffAt_id.prodMk contMDiffAt_const) |
| 146 | representative_time_derivative := hBtime }, rfl⟩ |
| 147 | · have heq : Set.EqOn (fun t ↦ f ((a, e q), Real.sqrt t / Real.sqrt a.2)) |
| 148 | (A.gamma a.1) (Set.Ioo 0 a.2) := by |
| 149 | intro t htt |
| 150 | have hr : Real.sqrt t / Real.sqrt a.2 ∈ Set.Icc (0 : ℝ) 1 := |
| 151 | ⟨div_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _), |
| 152 | (div_le_one (Real.sqrt_pos.mpr ht)).mpr (Real.sqrt_le_sqrt htt.2.le)⟩ |
| 153 | have h := hcenter a ha (Real.sqrt t / Real.sqrt a.2) hr |
| 154 | rw [hγend a ht hmax] at h |
| 155 | change f ((a, e q), Real.sqrt t / Real.sqrt a.2) = |
| 156 | A.squareFamily a.1 (Real.sqrt a.2 * (Real.sqrt t / Real.sqrt a.2)) at h |
| 157 | rw [mul_div_cancel₀ _ (Real.sqrt_pos.mpr ht).ne', |
| 158 | A.square_agrees a.1 (Real.sqrt t) |
| 159 | ⟨Real.sqrt_nonneg _, Real.sqrt_lt_sqrt htt.1.le (htt.2.trans hmax)⟩, |
| 160 | Real.sq_sqrt htt.1.le] at h |
| 161 | exact h |
| 162 | change backwardLLength F T 0 a.2 |
| 163 | (fun t ↦ f ((a, e q), Real.sqrt t / Real.sqrt a.2)) / (2 * Real.sqrt a.2) = _ |
| 164 | rw [backwardLLength_congr_Ioo F T 0 a.2 ht.le _ _ heq] |
| 165 | exact ((lExponentialFamily_reducedLength_eq_action_iff hL A a.1 a.2 ht hmax).mpr hmin).symm |
| 166 | · intro w hw |
| 167 | obtain ⟨Q, hQ⟩ := exists_backwardPath_of_unitFamily F hM04 T τmax hτmax hwindow |
| 168 | f Ω hΩ hf (a, e w.1) (fun r hr ↦ hVΩ ⟨hw.2.1, hr⟩) |
| 169 | w.2 hw.2.2.1 hw.2.2.2 |
| 170 | have hQ0 : Q.curve 0 = p := by |
| 171 | rw [hQ] |
| 172 | simpa only [Real.sqrt_zero, zero_div, hstart] using hγstart a |
| 173 | have hQw : Q.curve w.2 = w.1 := by |
| 174 | rw [hQ] |
| 175 | change f ((a, e w.1), Real.sqrt w.2 / Real.sqrt w.2) = w.1 |
| 176 | have hwt : 0 < w.2 := hw.2.2.1 |
| 177 | rw [div_self (Real.sqrt_pos.mpr hwt).ne', hend] |
| 178 | exact e.left_inv hw.1.1 |
| 179 | have h := reducedLength_le_path hL hw.2.2.1 hw.2.2.2.le Q hQ0 hQw |
| 180 | simpa only [hQ] using h |
| 181 | |
| 182 | end PoincareMT.ReducedLength |