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.Calculus.Differential.WithinInverseSmooth |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Local.TimePreservingHomeomorph |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Local.ConvexLinearApproximation |
| 4 | |
| 5 | /-! |
| 6 | # A smooth relative inverse preserving time |
| 7 | |
| 8 | A small spatial Lipschitz extension supplies a homeomorphism, and the |
| 9 | actual within inverse derivative supplies its smoothness on the |
| 10 | original relative image. This includes closed physical endpoints in |
| 11 | Morgan-Tian Proposition 6.28, p. 117; see the derivation |
| 12 | tasks/M14/derivations/2026-09-21-relative-inverse.md. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped ContDiff Topology NNReal |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] |
| 24 | |
| 25 | set_option backward.isDefEq.respectTransparency false in |
| 26 | /-- A smooth map preserving time and having an invertible triangular |
| 27 | within derivative has a smooth inverse on a relative neighborhood. |
| 28 | The homeomorphism extends to the ambient space and preserves time |
| 29 | there, but its smoothness is asserted only on the actual relative |
| 30 | image. Proposition 6.28, p. 117; see the derivation |
| 31 | 2026-09-21-relative-inverse.md. -/ |
| 32 | theorem exists_timePreserving_relative_inverse |
| 33 | {f : E × ℝ → F × ℝ} {S : Set (E × ℝ)} |
| 34 | (hSc : Convex ℝ S) (hS : UniqueDiffOn ℝ S) (hf : ContDiffOn ℝ ∞ f S) |
| 35 | (hft : ∀ z ∈ S, (f z).2 = z.2) {x : E × ℝ} (hx : x ∈ S) |
| 36 | (L : (E × ℝ) ≃L[ℝ] (F × ℝ)) |
| 37 | (hL : (L : (E × ℝ) →L[ℝ] (F × ℝ)) = fderivWithin ℝ f S x) |
| 38 | (hLt : ∀ z, (L z).2 = z.2) : |
| 39 | ∃ U : Set (E × ℝ), IsOpen U ∧ x ∈ U ∧ |
| 40 | ∃ g : (E × ℝ) ≃ₜ (F × ℝ), EqOn f g (U ∩ S) ∧ |
| 41 | (∀ z, (g z).2 = z.2) ∧ |
| 42 | ContDiffOn ℝ ∞ g.symm (g '' (U ∩ S)) ∧ |
| 43 | ∀ z ∈ U ∩ S, (fderivWithin ℝ f S z).IsInvertible := by |
| 44 | let : FiniteDimensional ℝ (E × ℝ) := L.symm.finiteDimensional |
| 45 | obtain ⟨c, hcpos, hc⟩ := exists_pos_mul_lt |
| 46 | (inv_pos.mpr L.nnnorm_symm_pos) (lipschitzExtensionConstant F) |
| 47 | obtain ⟨U₀, hU₀, hxU₀, happ⟩ := |
| 48 | exists_open_approximatesLinearOn hSc hS (hf.of_le (by simp)) hx c hcpos |
| 49 | rw [← hL] at happ |
| 50 | have hnear : ∀ᶠ z in 𝓝[S] x, (fderivWithin ℝ f S z).IsInvertible := by |
| 51 | have hnhds := L.nhds |
| 52 | rw [hL] at hnhds |
| 53 | exact (hf.continuousOn_fderivWithin hS (by simp) x hx) hnhds |
| 54 | obtain ⟨V, hV, hxV, hVinv⟩ := mem_nhdsWithin.mp hnear |
| 55 | let U := U₀ ∩ V |
| 56 | have hU : IsOpen U := hU₀.inter hV |
| 57 | have hUS : U ∩ S ⊆ U₀ ∩ S := fun _ hz => ⟨hz.1.1, hz.2⟩ |
| 58 | obtain ⟨g, hgf, hgt⟩ := exists_timePreserving_homeomorph_extension |
| 59 | (happ.mono_set hUS) (fun z hz => hft z hz.2) hLt hc |
| 60 | have hinv (z : E × ℝ) (hz : z ∈ U ∩ S) : |
| 61 | (fderivWithin ℝ f S z).IsInvertible := hVinv ⟨hz.1.2, hz.2⟩ |
| 62 | refine ⟨U, hU, ⟨hxU₀, hxV⟩, g, hgf, hgt, ?_, hinv⟩ |
| 63 | have hUSdiff : UniqueDiffOn ℝ (U ∩ S) := by |
| 64 | rw [inter_comm] |
| 65 | exact hS.inter hU |
| 66 | apply contDiffOn_inverse_of_leftInverse hUSdiff (hf.mono inter_subset_right) |
| 67 | g.symm.continuous.continuousOn |
| 68 | · rintro y ⟨z, hz, rfl⟩ |
| 69 | simpa only [g.symm_apply_apply] using hz |
| 70 | · rintro y ⟨z, hz, rfl⟩ |
| 71 | simpa only [g.symm_apply_apply] using hgf hz |
| 72 | · intro z hz |
| 73 | rw [inter_comm, fderivWithin_inter (hU.mem_nhds hz.1)] |
| 74 | exact hinv z hz |
| 75 | |
| 76 | omit [NormedSpace ℝ E] [NormedSpace ℝ F] [FiniteDimensional ℝ F] in |
| 77 | /-- A time-preserving homeomorphism carries intersection with any |
| 78 | physical time slab to intersection with the same slab. This gives |
| 79 | relative openness without adding points beyond a physical endpoint, |
| 80 | Proposition 6.28, p. 117. -/ |
| 81 | theorem timePreserving_image_inter (g : (E × ℝ) ≃ₜ (F × ℝ)) |
| 82 | (hgt : ∀ z, (g z).2 = z.2) (U : Set (E × ℝ)) (C : Set ℝ) : |
| 83 | g '' (U ∩ (Prod.snd ⁻¹' C)) = g '' U ∩ (Prod.snd ⁻¹' C) := by |
| 84 | ext y |
| 85 | constructor |
| 86 | · rintro ⟨z, ⟨hzU, hzC⟩, rfl⟩ |
| 87 | exact ⟨⟨z, hzU, rfl⟩, by simpa only [mem_preimage, hgt z] using hzC⟩ |
| 88 | · rintro ⟨⟨z, hzU, rfl⟩, hzC⟩ |
| 89 | exact ⟨z, ⟨hzU, by simpa only [mem_preimage, hgt z] using hzC⟩, rfl⟩ |
| 90 | |
| 91 | end PoincareMT.M14 |