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.InteriorEndpointFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityChainRules |
| 3 | |
| 4 | /-! |
| 5 | # Real variations through an interior chart direction |
| 6 | |
| 7 | A fixed-curve specialization of the joint endpoint family preserves the |
| 8 | outer endpoints and realizes each inverse-chart tangent direction. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | open Filter |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | local notation "Q" => EuclideanSpace ℝ (Fin n) |
| 25 | |
| 26 | set_option backward.isDefEq.respectTransparency false in |
| 27 | theorem exists_smooth_interior_point_variation (α : ℝ → M) (D : Set ℝ) |
| 28 | (hD : IsOpen D) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α D) |
| 29 | (L c : ℝ) (hc : c ∈ Set.Ioo 0 L) (hI : Set.Icc 0 L ⊆ D) (v : Q) : |
| 30 | let e := chartAt Q (α c) |
| 31 | ∃ (f : ℝ × ℝ → M) (U : Set (ℝ × ℝ)) (ρ : ℝ), |
| 32 | IsOpen U ∧ 0 < ρ ∧ Set.Icc 0 L ×ˢ Set.Ioo (-ρ) ρ ⊆ U ∧ |
| 33 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (𝓡 n) ∞ f U ∧ |
| 34 | (∀ s ∈ Set.Icc 0 L, f (s, 0) = α s) ∧ |
| 35 | (∀ u, f (0, u) = α 0) ∧ (∀ u, f (L, u) = α L) ∧ |
| 36 | (∀ u, f (c, u) = e.symm (e (α c) + u • v)) ∧ |
| 37 | (curveVelocity (n := n) (fun u ↦ f (c, u)) 0 : Q) = |
| 38 | mfderiv (𝓡 n) (𝓡 n) e.symm (e (α c)) v := by |
| 39 | let e := chartAt Q (α c) |
| 40 | let y0 := e (α c) |
| 41 | let base : ℝ × ℝ → M := fun z ↦ α z.2 |
| 42 | have hbase : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ base (Set.univ ×ˢ D) := |
| 43 | hα.comp contDiff_snd.contMDiff.contMDiffOn (fun z hz ↦ hz.2) |
| 44 | obtain ⟨Φ, Ω, N, hΩ, hN, h0N, hNΩ, hΦ, _, hleft, hright, hmark, hcenter⟩ := |
| 45 | exists_smooth_interior_endpoint_family base (Set.univ ×ˢ D) |
| 46 | (isOpen_univ.prod hD) hbase 0 L c hc (fun s hs ↦ ⟨Set.mem_univ _, hI hs⟩) |
| 47 | let k : ℝ × ℝ → (ℝ × Q) × ℝ := fun z ↦ ((0, y0 + z.2 • v), z.1) |
| 48 | have hk : ContDiff ℝ ∞ k := |
| 49 | (contDiff_const.prodMk (contDiff_const.add (contDiff_snd.smul contDiff_const))).prodMk |
| 50 | contDiff_fst |
| 51 | let f : ℝ × ℝ → M := Φ ∘ k |
| 52 | let U := k ⁻¹' Ω |
| 53 | have hU : IsOpen U := hΩ.preimage hk.continuous |
| 54 | have hf : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ f U := |
| 55 | hΦ.comp hk.contMDiff.contMDiffOn (fun _ hz ↦ hz) |
| 56 | have hline : Continuous (fun u : ℝ ↦ ((0 : ℝ), y0 + u • v)) := |
| 57 | continuous_const.prodMk (continuous_const.add (continuous_id.smul continuous_const)) |
| 58 | have hnear : ∀ᶠ u : ℝ in 𝓝 0, ((0 : ℝ), y0 + u • v) ∈ N := by |
| 59 | apply hline.continuousAt.preimage_mem_nhds |
| 60 | simpa only [zero_smul, add_zero] using hN.mem_nhds h0N |
| 61 | obtain ⟨ρ, hρ, hρN⟩ := Metric.mem_nhds_iff.mp hnear |
| 62 | have hparam (u : ℝ) (hu : u ∈ Set.Ioo (-ρ) ρ) : ((0 : ℝ), y0 + u • v) ∈ N := by |
| 63 | apply hρN |
| 64 | simpa only [Real.ball_eq_Ioo, zero_sub, zero_add] using hu |
| 65 | refine ⟨f, U, ρ, hU, hρ, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 66 | · intro z hz |
| 67 | exact hNΩ ⟨hparam z.2 hz.2, hz.1⟩ |
| 68 | · convert! hf using 1 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 69 | · intro s hs |
| 70 | simpa only [f, Function.comp_apply, k, zero_smul, add_zero] using |
| 71 | hcenter (0, y0) h0N s hs |
| 72 | · intro u |
| 73 | exact hleft 0 (y0 + u • v) |
| 74 | · intro u |
| 75 | exact hright 0 (y0 + u • v) |
| 76 | · intro u |
| 77 | exact hmark 0 (y0 + u • v) |
| 78 | · have heq : (fun u ↦ f (c, u)) = fun u ↦ e.symm (y0 + u • v) := |
| 79 | funext (fun u ↦ hmark 0 (y0 + u • v)) |
| 80 | rw [heq] |
| 81 | apply curveVelocity_comp_initial_line |
| 82 | have hchart : ContMDiffOn (𝓡 n) (𝓡 n) ∞ e.symm e.target := contMDiffOn_chart_symm |
| 83 | exact (hchart.contMDiffAt |
| 84 | (e.open_target.mem_nhds (e.map_source (mem_chart_source Q (α c))))).mdifferentiableAt |
| 85 | (by simp) |
| 86 | |
| 87 | end PoincareMT.ReducedLength |