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.LGeometry.Variation.VariationAction |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.SqrtRecovery |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiFieldPackaging |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/SquareVariationConstruction.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Topology MeasureTheory |
| 15 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.LGeometry |
| 20 | |
| 21 | theorem exists_squareTube_radius {C : Set ℝ} (hC : IsCompact C) |
| 22 | {Ω : Set (ℝ × ℝ)} (hΩ : IsOpen Ω) (hzero : C ×ˢ {(0 : ℝ)} ⊆ Ω) |
| 23 | {R : ℝ} (hR : 0 < R) : |
| 24 | ∃ r : ℝ, 0 < r ∧ r ≤ R ∧ C ×ˢ Ioo (-r) r ⊆ Ω := by |
| 25 | obtain ⟨U, V, _, hV, hCU, hzeroV, hUV⟩ := |
| 26 | generalized_tube_lemma hC isCompact_singleton hΩ hzero |
| 27 | obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.mp |
| 28 | (hV.mem_nhds (hzeroV (mem_singleton (0 : ℝ)))) |
| 29 | refine ⟨min R ε, lt_min hR hε, min_le_left _ _, ?_⟩ |
| 30 | rintro ⟨s, v⟩ ⟨hs, hv⟩ |
| 31 | apply hUV ⟨hCU hs, hball ?_⟩ |
| 32 | rw [Metric.mem_ball, dist_zero_right, Real.norm_eq_abs, abs_lt] |
| 33 | exact ⟨lt_of_le_of_lt (neg_le_neg (min_le_right R ε)) hv.1, |
| 34 | hv.2.trans_le (min_le_right R ε)⟩ |
| 35 | |
| 36 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 37 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 38 | |
| 39 | theorem smoothSquareAction_intervalIntegrable {J : Set ℝ} {F : RicciFlow n M J} |
| 40 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τ₁ τ₂ : ℝ} |
| 41 | (p : BackwardTimePath F T τ₁ τ₂) {U : Set ℝ} (hU : IsOpen U) |
| 42 | (hCU : sqrtParameterInterval τ₁ τ₂ ⊆ U) (α : ℝ → M) |
| 43 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) : |
| 44 | IntervalIntegrable (regularizedLIntegrand F T α) volume |
| 45 | (Real.sqrt τ₁) (Real.sqrt τ₂) := by |
| 46 | let C := sqrtParameterInterval τ₁ τ₂ |
| 47 | have hαC : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α C := hα.mono hCU |
| 48 | have hA := (contMDiffOn_mfderiv_const_apply hU α hα (1 : ℝ)).mono hCU |
| 49 | have ht : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ (fun s : ℝ ↦ T - s ^ 2) C := |
| 50 | (contDiff_const.sub (contDiff_id.pow 2)).contMDiff.contMDiffOn |
| 51 | have hmem : MapsTo (fun s : ℝ ↦ T - s ^ 2) C J := |
| 52 | fun s hs ↦ p.time_mem (s ^ 2) (square_mem_backward_interval p hs) |
| 53 | have hg := (movingMetric_pair_contMDiffOn F (fun s : ℝ ↦ T - s ^ 2) α |
| 54 | (curveVelocity (n := n) α) (curveVelocity (n := n) α) ht hαC hA hA hmem).contDiffOn |
| 55 | have hscalar := ((hM04.scalar_regular n M J F).comp (ht.prodMk hαC) |
| 56 | (fun s hs ↦ ⟨hmem hs, mem_univ _⟩)).contDiffOn |
| 57 | have hdensity : ContDiffOn ℝ ∞ (regularizedLIntegrand F T α) C := |
| 58 | ((contDiffOn_const.mul (contDiffOn_id.pow 2)).mul hscalar).add |
| 59 | (contDiffOn_const.mul hg) |
| 60 | exact hdensity.continuousOn.intervalIntegrable_of_Icc (Real.sqrt_le_sqrt p.ordered.le) |
| 61 | |
| 62 | def backwardFamilyOfSquare {J : Set ℝ} {F : RicciFlow n M J} |
| 63 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) (H : ℝ × ℝ → M) |
| 64 | (τ v : ℝ) : M := by |
| 65 | classical |
| 66 | exact if τ ∈ Icc τ₁ τ₂ then H (Real.sqrt τ, v) else p.curve τ |
| 67 | |
| 68 | theorem backwardFamilyOfSquare_eq {J : Set ℝ} {F : RicciFlow n M J} |
| 69 | {T τ₁ τ₂ : ℝ} (p : BackwardTimePath F T τ₁ τ₂) (H : ℝ × ℝ → M) |
| 70 | {τ : ℝ} (hτ : τ ∈ Icc τ₁ τ₂) (v : ℝ) : |
| 71 | backwardFamilyOfSquare p H τ v = H (Real.sqrt τ, v) := by |
| 72 | simp only [backwardFamilyOfSquare, if_pos hτ] |
| 73 | |
| 74 | theorem backwardLIntegrand_congr_of_eventuallyEq {J : Set ℝ} (F : RicciFlow n M J) |
| 75 | (T : ℝ) {α β : ℝ → M} {τ : ℝ} (h : α =ᶠ[𝓝 τ] β) : |
| 76 | backwardLIntegrand F T α τ = backwardLIntegrand F T β τ := by |
| 77 | have hd := h.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 78 | simp only [backwardLIntegrand, curveVelocity, hd, h.eq_of_nhds] |
| 79 | congr 2 |
| 80 | exact congrArg (fun x : M ↦ (F.metric (T - τ)).inner x |
| 81 | ((mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) β τ) 1) |
| 82 | ((mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) β τ) 1)) h.eq_of_nhds |
| 83 | |
| 84 | def variationOfSquare {J : Set ℝ} {F : RicciFlow n M J} |
| 85 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τ₁ τ₂ : ℝ} |
| 86 | (p : BackwardTimePath F T τ₁ τ₂) (H : ℝ × ℝ → M) |
| 87 | (Ω : Set (ℝ × ℝ)) (hΩ : IsOpen Ω) (r : ℝ) (hr : 0 < r) |
| 88 | (hCr : sqrtParameterInterval τ₁ τ₂ ×ˢ Ioo (-r) r ⊆ Ω) |
| 89 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 n) ∞ H Ω) |
| 90 | (hzero : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, H (s, 0) = p.curve (s ^ 2)) : |
| 91 | LVariation F T τ₁ τ₂ p where |
| 92 | family := backwardFamilyOfSquare p H |
| 93 | at_zero := by |
| 94 | intro τ |
| 95 | by_cases hτ : τ ∈ Icc τ₁ τ₂ |
| 96 | · rw [backwardFamilyOfSquare_eq p H hτ, hzero _ (sqrt_mem_sqrtParameterInterval hτ), |
| 97 | Real.sq_sqrt (p.nonnegative.trans hτ.1)] |
| 98 | · simp only [backwardFamilyOfSquare, if_neg hτ] |
| 99 | radius := r |
| 100 | radius_pos := hr |
| 101 | squareFamily := fun s v ↦ H (s, v) |
| 102 | squareDomain := Ω |
| 103 | square_open := hΩ |
| 104 | square_contains := hCr |
| 105 | square_smooth := hH |
| 106 | square_agrees := by |
| 107 | intro s hs v _ |
| 108 | rw [backwardFamilyOfSquare_eq p H (square_mem_backward_interval p hs), |
| 109 | Real.sqrt_sq ((Real.sqrt_nonneg τ₁).trans hs.1)] |
| 110 | l_integrable := by |
| 111 | intro v hv |
| 112 | let U := (fun s : ℝ ↦ (s, v)) ⁻¹' Ω |
| 113 | let α := fun s : ℝ ↦ H (s, v) |
| 114 | have hU : IsOpen U := hΩ.preimage (continuous_id.prodMk continuous_const) |
| 115 | have hCU : sqrtParameterInterval τ₁ τ₂ ⊆ U := fun s hs ↦ hCr ⟨hs, hv⟩ |
| 116 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U := |
| 117 | hH.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun s hs ↦ hs) |
| 118 | have hreg : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 1 α |
| 119 | (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) := |
| 120 | (hα.of_le (by simp)).mono (Ioo_subset_Icc_self.trans hCU) |
| 121 | have hint := intervalIntegrable_of_square_transform p.nonnegative p.ordered.le |
| 122 | (smoothSquareAction_intervalIntegrable hM04 p hU hCU α hα) |
| 123 | (fun s hs ↦ regularizedLIntegrand_sqrtPullback F T p.nonnegative α hreg hs) |
| 124 | apply hint.congr_uIoo |
| 125 | intro τ hτ |
| 126 | rw [uIoo_of_le p.ordered.le] at hτ |
| 127 | apply backwardLIntegrand_congr_of_eventuallyEq |
| 128 | filter_upwards [isOpen_Ioo.mem_nhds hτ] with t ht |
| 129 | exact (backwardFamilyOfSquare_eq p H (Ioo_subset_Icc_self ht) v).symm |
| 130 | |
| 131 | def fixedVariationOfSquare {J : Set ℝ} {F : RicciFlow n M J} |
| 132 | (hM04 : RicciFlowCurvatureTheory.{u}) {T τ₁ τ₂ : ℝ} |
| 133 | (p : BackwardTimePath F T τ₁ τ₂) (H : ℝ × ℝ → M) |
| 134 | (Ω : Set (ℝ × ℝ)) (hΩ : IsOpen Ω) (r : ℝ) (hr : 0 < r) |
| 135 | (hCr : sqrtParameterInterval τ₁ τ₂ ×ˢ Ioo (-r) r ⊆ Ω) |
| 136 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 n) ∞ H Ω) |
| 137 | (hzero : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, H (s, 0) = p.curve (s ^ 2)) |
| 138 | (hleft : ∀ v ∈ Ioo (-r) r, H (Real.sqrt τ₁, v) = p.curve τ₁) |
| 139 | (hright : ∀ v ∈ Ioo (-r) r, H (Real.sqrt τ₂, v) = p.curve τ₂) : |
| 140 | FixedEndpointLVariation F T τ₁ τ₂ p where |
| 141 | toLVariation := variationOfSquare hM04 p H Ω hΩ r hr hCr hH hzero |
| 142 | fixed_left v hv := (backwardFamilyOfSquare_eq p H ⟨le_rfl, p.ordered.le⟩ v).trans |
| 143 | (hleft v hv) |
| 144 | fixed_right v hv := (backwardFamilyOfSquare_eq p H ⟨p.ordered.le, le_rfl⟩ v).trans |
| 145 | (hright v hv) |
| 146 | |
| 147 | end PoincareMT.LGeometry |
| 148 |