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.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.IntrinsicGeometry.IntrinsicCompetitors |
| 3 | |
| 4 | /-! |
| 5 | # C1 replacement paths in the selected region |
| 6 | |
| 7 | The shortening arguments of Morgan--Tian, Appendix A.1, pp. 497-498, and |
| 8 | Claim 10.3, pp. 248-249, need admissible C1 replacement paths. A smooth |
| 9 | transition flattens endpoints while preserving both image containment and |
| 10 | length. The resulting pieces splice to an actual region-valued path with |
| 11 | the sum of their lengths. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M28 |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | [IsManifold (𝓡 3) ∞ M] |
| 26 | |
| 27 | /-- Flat reparameterization preserves the literal region and exact length, |
| 28 | and gives a globally C1 representative (Appendix A.1). -/ |
| 29 | theorem exists_flat_intrinsic_path (g : RiemannianMetric 3 M) |
| 30 | {U : Set M} {γ : ℝ → M} {a b : ℝ} |
| 31 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc (0 : ℝ) 1)) |
| 32 | (hγU : MapsTo γ (Icc (0 : ℝ) 1) U) (hab : a < b) : |
| 33 | ∃ σ : ℝ → M, σ a = γ 0 ∧ σ b = γ 1 ∧ |
| 34 | ContMDiff 𝓘(ℝ, ℝ) (𝓡 3) 1 σ ∧ MapsTo σ univ U ∧ |
| 35 | g.pathELength σ a b = g.pathELength γ 0 1 ∧ |
| 36 | σ =ᶠ[𝓝 a] (fun _ => γ 0) ∧ σ =ᶠ[𝓝 b] (fun _ => γ 1) := by |
| 37 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 38 | ⟨g.toRiemannianMetric⟩ |
| 39 | obtain ⟨a', haa', ha'b⟩ := exists_between hab |
| 40 | obtain ⟨b', ha'b', hb'b⟩ := exists_between ha'b |
| 41 | let η (t : ℝ) : ℝ := Real.smoothTransition ((b' - a')⁻¹ * (t - a')) |
| 42 | have hzero (t : ℝ) (ht : t < a') : η t = 0 := by |
| 43 | simp only [η, Real.smoothTransition.zero_iff_nonpos] |
| 44 | apply mul_nonpos_of_nonneg_of_nonpos |
| 45 | · simpa using ha'b'.le |
| 46 | · linarith |
| 47 | have hone (t : ℝ) (ht : b' < t) : η t = 1 := by |
| 48 | simp only [η, Real.smoothTransition.eq_one_iff_one_le, inv_mul_eq_div] |
| 49 | rw [one_le_div₀] <;> linarith |
| 50 | have hη : MapsTo η univ (Icc (0 : ℝ) 1) := by |
| 51 | intro t _ |
| 52 | exact ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ |
| 53 | refine ⟨γ ∘ η, by simp [hzero a haa'], by simp [hone b hb'b], ?_, |
| 54 | hγU.comp hη, ?_, ?_, ?_⟩ |
| 55 | · rw [← contMDiffOn_univ] |
| 56 | apply hγ.comp |
| 57 | · rw [contMDiffOn_univ, contMDiff_iff_contDiff] |
| 58 | fun_prop |
| 59 | · exact hη |
| 60 | · rw [← hzero a haa', ← hone b hb'b] |
| 61 | apply Manifold.pathELength_comp_of_monotoneOn hab.le |
| 62 | · apply Monotone.monotoneOn |
| 63 | apply Real.smoothTransition.monotone.comp |
| 64 | intro t u htu |
| 65 | dsimp only |
| 66 | gcongr |
| 67 | · simp only [η] |
| 68 | apply (ContDiff.contDiffOn _).differentiableOn one_ne_zero |
| 69 | fun_prop |
| 70 | · rw [hzero a haa', hone b hb'b] |
| 71 | exact hγ.mdifferentiableOn one_ne_zero |
| 72 | · filter_upwards [Iio_mem_nhds haa'] with t ht |
| 73 | simp [hzero t ht] |
| 74 | · filter_upwards [Ioi_mem_nhds hb'b] with t ht |
| 75 | simp [hone t ht] |
| 76 | |
| 77 | /-- Two actual region-valued C1 paths with a common endpoint admit a C1 |
| 78 | splice of exactly the sum of their lengths (Appendix A.1). -/ |
| 79 | theorem exists_intrinsic_splice (g : RiemannianMetric 3 M) |
| 80 | {U : Set M} {α β : ℝ → M} |
| 81 | (hα : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 α (Icc (0 : ℝ) 1)) |
| 82 | (hβ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 β (Icc (0 : ℝ) 1)) |
| 83 | (hαU : MapsTo α (Icc (0 : ℝ) 1) U) |
| 84 | (hβU : MapsTo β (Icc (0 : ℝ) 1) U) (hjoin : α 1 = β 0) : |
| 85 | ∃ σ : ℝ → M, σ 0 = α 0 ∧ σ 1 = β 1 ∧ |
| 86 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 σ (Icc (0 : ℝ) 1) ∧ |
| 87 | MapsTo σ (Icc (0 : ℝ) 1) U ∧ |
| 88 | g.pathELength σ 0 1 = g.pathELength α 0 1 + g.pathELength β 0 1 := by |
| 89 | classical |
| 90 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 91 | ⟨g.toRiemannianMetric⟩ |
| 92 | obtain ⟨α', hα0, _, hα', hαU', hαlen, _, hαend⟩ := |
| 93 | exists_flat_intrinsic_path g hα hαU zero_lt_one |
| 94 | obtain ⟨β', _, hβ2, hβ', hβU', hβlen, hβstart, _⟩ := |
| 95 | exists_flat_intrinsic_path g hβ hβU one_lt_two |
| 96 | have hmatch : α' =ᶠ[𝓝 (1 : ℝ)] β' := by |
| 97 | have hαend' : α' =ᶠ[𝓝 (1 : ℝ)] (fun _ => β 0) := by |
| 98 | simpa only [hjoin] using hαend |
| 99 | exact hαend'.trans hβstart.symm |
| 100 | let τ := piecewise (Iic (1 : ℝ)) α' β' |
| 101 | have hτ : ContMDiff 𝓘(ℝ, ℝ) (𝓡 3) 1 τ := |
| 102 | hα'.piecewise_Iic hβ' hmatch |
| 103 | have hτU : MapsTo τ univ U := by |
| 104 | intro t _ |
| 105 | by_cases ht : t ≤ 1 |
| 106 | · simp only [τ, piecewise, mem_Iic, if_pos ht] |
| 107 | exact hαU' (mem_univ t) |
| 108 | · simp only [τ, piecewise, mem_Iic, if_neg ht] |
| 109 | exact hβU' (mem_univ t) |
| 110 | have hτ0 : τ 0 = α 0 := by simp [τ, hα0] |
| 111 | have hτ2 : τ 2 = β 1 := by simp [τ, hβ2] |
| 112 | have hfirst : g.pathELength τ 0 1 = g.pathELength α' 0 1 := by |
| 113 | apply Manifold.pathELength_congr |
| 114 | intro t ht |
| 115 | simp [τ, ht.2] |
| 116 | have hsecond : g.pathELength τ 1 2 = g.pathELength β' 1 2 := by |
| 117 | apply Manifold.pathELength_congr_Ioo |
| 118 | intro t ht |
| 119 | simp [τ, not_le.mpr ht.1] |
| 120 | have hτlen : g.pathELength τ 0 2 = |
| 121 | g.pathELength α 0 1 + g.pathELength β 0 1 := by |
| 122 | calc |
| 123 | g.pathELength τ 0 2 = g.pathELength τ 0 1 + g.pathELength τ 1 2 := |
| 124 | (Manifold.pathELength_add zero_le_one one_le_two).symm |
| 125 | _ = g.pathELength α 0 1 + g.pathELength β 0 1 := by |
| 126 | rw [hfirst, hsecond, hαlen, hβlen] |
| 127 | obtain ⟨σ, h0, h1, hσ, hσU, hσlen⟩ := |
| 128 | exists_unit_interval_path g zero_le_two hτ.contMDiffOn |
| 129 | (fun t _ => hτU (mem_univ t)) |
| 130 | exact ⟨σ, h0.trans hτ0, h1.trans hτ2, hσ, hσU, hσlen.trans hτlen⟩ |
| 131 | |
| 132 | /-- Replacing an actual subarc by an actual region-valued C1 shortcut |
| 133 | constructs an admissible full competitor with the exact replacement length. |
| 134 | This is the analytic gluing step in Appendix A.1 and relative A.8. -/ |
| 135 | theorem exists_intrinsic_subarc_replacement (g : RiemannianMetric 3 M) |
| 136 | {U : Set M} {γ α : ℝ → M} {a b c d : ℝ} |
| 137 | (hac : a ≤ c) (hcd : c ≤ d) (hdb : d ≤ b) |
| 138 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc a b)) |
| 139 | (hγU : MapsTo γ (Icc a b) U) |
| 140 | (hα : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 α (Icc (0 : ℝ) 1)) |
| 141 | (hαU : MapsTo α (Icc (0 : ℝ) 1) U) |
| 142 | (hα0 : α 0 = γ c) (hα1 : α 1 = γ d) : |
| 143 | ∃ σ : ℝ → M, σ 0 = γ a ∧ σ 1 = γ b ∧ |
| 144 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 σ (Icc (0 : ℝ) 1) ∧ |
| 145 | MapsTo σ (Icc (0 : ℝ) 1) U ∧ |
| 146 | g.pathELength σ 0 1 = |
| 147 | g.pathELength γ a c + g.pathELength α 0 1 + g.pathELength γ d b := by |
| 148 | have hleft : Icc a c ⊆ Icc a b := Icc_subset_Icc le_rfl (hcd.trans hdb) |
| 149 | have hright : Icc d b ⊆ Icc a b := Icc_subset_Icc (hac.trans hcd) le_rfl |
| 150 | obtain ⟨β, hβ0, hβ1, hβ, hβU, hβlen⟩ := |
| 151 | exists_unit_interval_path g hac (hγ.mono hleft) (fun _ ht => hγU (hleft ht)) |
| 152 | obtain ⟨η, hη0, hη1, hη, hηU, hηlen⟩ := |
| 153 | exists_unit_interval_path g hdb (hγ.mono hright) (fun _ ht => hγU (hright ht)) |
| 154 | obtain ⟨τ, hτ0, hτ1, hτ, hτU, hτlen⟩ := |
| 155 | exists_intrinsic_splice g hβ hα hβU hαU (hβ1.trans hα0.symm) |
| 156 | obtain ⟨σ, hσ0, hσ1, hσ, hσU, hσlen⟩ := |
| 157 | exists_intrinsic_splice g hτ hη hτU hηU ((hτ1.trans hα1).trans hη0.symm) |
| 158 | refine ⟨σ, (hσ0.trans hτ0).trans hβ0, hσ1.trans hη1, hσ, hσU, ?_⟩ |
| 159 | rw [hσlen, hτlen, hβlen, hηlen] |
| 160 | |
| 161 | end PoincareMT.M28 |