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.ReducedGeometry.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.LGeometry.Variation.UniformSliceImage |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Families.ClosedEulerRestart |
| 4 | |
| 5 | /-! |
| 6 | # Joint state and time neighborhoods for actual Euler restarts |
| 7 | |
| 8 | Proposition 16.4, pp. 389-391. A single state ball works for every |
| 9 | nearby relative starting time, and each restart retains the same |
| 10 | closed physical time interval. This is the uniform local input to |
| 11 | the finite compact horizontal phase cover. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Actual closed Euler chart phases retain their standard tangent models. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter Metric |
| 19 | open scoped Topology Manifold ContDiff |
| 20 | |
| 21 | namespace PoincareMT.M08 |
| 22 | export PoincareMT.LGeometry (closedChartEulerPhase) |
| 23 | end PoincareMT.M08 |
| 24 | namespace PoincareMT.M08 |
| 25 | export PoincareMT.LGeometry (closedChartEulerPhase_contDiffOn) |
| 26 | end PoincareMT.M08 |
| 27 | |
| 28 | namespace PoincareMT.Proofs.M46 |
| 29 | |
| 30 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 31 | |
| 32 | /-- One closed-time ODE family supplies actual restarts for all states |
| 33 | in a fixed ball and all nearby relative starting times. Source: |
| 34 | Proposition 16.4 and Lemma 6.18, pp. 389-391 and 113-114. -/ |
| 35 | theorem closedODE_exists_uniform_restart_neighborhood |
| 36 | {a b : ℝ} (hab : a < b) (t₀ : Icc a b) |
| 37 | {U : Set E} (hU : IsOpen U) (f : ℝ × E → E) |
| 38 | (hf : ContDiffOn ℝ ∞ f (Icc a b ×ˢ U)) {x₀ : E} (hx₀ : x₀ ∈ U) : |
| 39 | ∃ c d : ℝ, c < d ∧ a ≤ c ∧ d ≤ b ∧ Icc c d ∈ 𝓝[Icc a b] t₀.val ∧ |
| 40 | ∃ R : ℝ, 0 < R ∧ ∀ᶠ r in 𝓝[Icc a b] t₀.val, |
| 41 | r ∈ Icc c d ∧ ∀ y ∈ ball x₀ R, ∃ gamma : ℝ → E, |
| 42 | gamma r = y ∧ ContDiffOn ℝ ∞ gamma (Icc c d) ∧ |
| 43 | ∀ s ∈ Icc c d, gamma s ∈ U ∧ |
| 44 | HasDerivWithinAt gamma (f (s, gamma s)) (Icc c d) s := by |
| 45 | obtain ⟨c, d, t₁, hcd, hac, hdb, hi, hnear, rho, hrho, alpha, halpha, hdata⟩ := |
| 46 | M14.closedODE_exists_joint_family hab t₀ hU f hf hx₀ |
| 47 | have hx : x₀ ∈ ball x₀ rho := mem_ball_self hrho |
| 48 | have ht : t₀.val ∈ Icc c d := hi ▸ t₁.property |
| 49 | have hinit (x : E) (hx' : x ∈ ball x₀ rho) : alpha (x, t₀.val) = x := |
| 50 | hi ▸ (hdata x hx').1 |
| 51 | obtain ⟨R, hR, hsurj⟩ := closedFamily_exists_uniform_image_ball |
| 52 | (uniqueDiffOn_Icc hcd) isOpen_ball alpha halpha hx ht hinit |
| 53 | have hfilter : 𝓝[Icc a b] t₀.val ≤ 𝓝[Icc c d] t₀.val := |
| 54 | le_inf nhdsWithin_le_nhds (le_principal_iff.mpr hnear) |
| 55 | refine ⟨c, d, hcd, hac, hdb, hnear, R, hR, ?_⟩ |
| 56 | filter_upwards [hsurj.filter_mono hfilter, hnear] with r hr hrC |
| 57 | refine ⟨hrC, ?_⟩ |
| 58 | intro y hy |
| 59 | obtain ⟨z, hz, heq⟩ := hr hy |
| 60 | refine ⟨fun s => alpha (z, s), heq, ?_, (hdata z hz).2⟩ |
| 61 | exact halpha.comp (contDiffOn_const.prodMk contDiffOn_id) (fun _ hs => ⟨hz, hs⟩) |
| 62 | |
| 63 | universe u |
| 64 | |
| 65 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 66 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 67 | |
| 68 | /-- The literal closed Euler phase equation has a joint state/time |
| 69 | restart neighborhood. Every restart uses the retained interval's |
| 70 | actual coefficients and stays in the actual spatial chart. Source: |
| 71 | Proposition 16.4 and Lemma 6.18, pp. 389-391 and 113-114. -/ |
| 72 | theorem exists_closedChartEulerPhase_uniform_restart_neighborhood |
| 73 | {J : Set ℝ} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 74 | (T : ℝ) (x₀ : M) {a b : ℝ} (hab : a < b) |
| 75 | (htime : ∀ s ∈ Icc a b, T - s ^ 2 ∈ J) (s₀ : Icc a b) |
| 76 | {z₀ : EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)} |
| 77 | (hcenter : z₀.1 ∈ (extChartAt (𝓡 n) x₀).target) : |
| 78 | ∃ c d : ℝ, c < d ∧ a ≤ c ∧ d ≤ b ∧ Icc c d ∈ 𝓝[Icc a b] s₀.val ∧ |
| 79 | ∃ R : ℝ, 0 < R ∧ ∀ᶠ r in 𝓝[Icc a b] s₀.val, |
| 80 | r ∈ Icc c d ∧ ∀ z ∈ ball z₀ R, |
| 81 | ∃ gamma : ℝ → EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n), |
| 82 | gamma r = z ∧ ContDiffOn ℝ ∞ gamma (Icc c d) ∧ |
| 83 | ∀ s ∈ Icc c d, |
| 84 | (gamma s).1 ∈ (extChartAt (𝓡 n) x₀).target ∧ |
| 85 | HasDerivWithinAt gamma |
| 86 | (M08.closedChartEulerPhase F T x₀ (Icc c d) s (gamma s)) |
| 87 | (Icc c d) s := by |
| 88 | obtain ⟨c, d, hcd, hac, hdb, hnear, R, hR, hrestart⟩ := |
| 89 | closedODE_exists_uniform_restart_neighborhood hab s₀ |
| 90 | ((isOpen_extChartAt_target (I := 𝓡 n) x₀).prod isOpen_univ) |
| 91 | (Function.uncurry (M08.closedChartEulerPhase F T x₀ (Icc a b))) |
| 92 | (M08.closedChartEulerPhase_contDiffOn F hM04 T x₀ (uniqueDiffOn_Icc hab) htime) |
| 93 | ⟨hcenter, mem_univ _⟩ |
| 94 | refine ⟨c, d, hcd, hac, hdb, hnear, R, hR, ?_⟩ |
| 95 | filter_upwards [hrestart] with r hr |
| 96 | refine ⟨hr.1, ?_⟩ |
| 97 | intro z hz |
| 98 | obtain ⟨gamma, hgamma, hsmooth, hdata⟩ := hr.2 z hz |
| 99 | refine ⟨gamma, hgamma, hsmooth, ?_⟩ |
| 100 | intro s hs |
| 101 | obtain ⟨hmap, hd⟩ := hdata s hs |
| 102 | refine ⟨hmap.1, ?_⟩ |
| 103 | rw [M14.closedChartEulerPhase_restrict F hM04 T x₀ htime |
| 104 | (Icc_subset_Icc hac hdb) hs hmap.1] |
| 105 | exact hd |
| 106 | |
| 107 | end PoincareMT.Proofs.M46 |