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.Spacetime.Interval |
| 2 | import PoincareLib.Geometry.Riemannian.Homothety.Connection.InverseWithin |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.Atlas |
| 4 | import Mathlib.Geometry.Manifold.MFDeriv.FDeriv |
| 5 | |
| 6 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M13/IntervalSmooth.lean`, |
| 7 | revision `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See `references/ricci-flow/mapher/rescaling-import.json`. -/ |
| 8 | |
| 9 | /-! |
| 10 | # Smooth maps into selected time intervals |
| 11 | |
| 12 | The retained inclusion derivative recovers the inverse coordinate regularity |
| 13 | for the supplied interval charts, including their boundary points. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | open PoincareMT.Homothety |
| 23 | |
| 24 | namespace PoincareMT.ParabolicRescaling |
| 25 | |
| 26 | noncomputable def intervalChartExtension {I : SpacetimeInterval} |
| 27 | (D : SmoothSpacetimeInterval I) (p : D.Point) : ℝ → EuclideanSpace ℝ (Fin 1) := |
| 28 | Function.extend (Subtype.val : D.Point → ℝ) (extChartAt (𝓡∂ 1) p) 0 |
| 29 | |
| 30 | theorem intervalChartExtension_val {I : SpacetimeInterval} |
| 31 | (D : SmoothSpacetimeInterval I) (p x : D.Point) : |
| 32 | intervalChartExtension D p (x : ℝ) = extChartAt (𝓡∂ 1) p x := |
| 33 | Subtype.val_injective.extend_apply _ _ _ |
| 34 | |
| 35 | theorem intervalChartExtension_contDiffOn {I : SpacetimeInterval} |
| 36 | (D : SmoothSpacetimeInterval I) (p : D.Point) : |
| 37 | ContDiffOn ℝ ∞ (intervalChartExtension D p) |
| 38 | ((Subtype.val : D.Point → ℝ) '' (extChartAt (𝓡∂ 1) p).source) := by |
| 39 | let : ChartedSpace (EuclideanHalfSpace 1) D.Point := D.chartedSpace |
| 40 | let : IsManifold (𝓡∂ 1) ∞ D.Point := D.isManifold |
| 41 | let e := extChartAt (𝓡∂ 1) p |
| 42 | let f : EuclideanSpace ℝ (Fin 1) → ℝ := fun y ↦ (e.symm y : ℝ) |
| 43 | have hf : ContDiffOn ℝ ∞ f e.target := |
| 44 | (D.inclusion_smooth.comp_contMDiffOn (contMDiffOn_extChartAt_symm p)).contDiffOn |
| 45 | have hg : ContinuousOn (intervalChartExtension D p) |
| 46 | ((Subtype.val : D.Point → ℝ) '' e.source) := by |
| 47 | apply Topology.IsInducing.continuousOn_image_iff |
| 48 | (Topology.IsEmbedding.subtypeVal.isInducing) |>.mpr |
| 49 | simpa only [Function.comp_def, intervalChartExtension_val] using |
| 50 | (continuousOn_extChartAt (I := 𝓡∂ 1) p) |
| 51 | apply contDiffOn_leftInverse hf (uniqueDiffOn_extChartAt_target p) hg |
| 52 | · rintro _ ⟨x, hx, rfl⟩ |
| 53 | rw [intervalChartExtension_val] |
| 54 | exact e.map_source hx |
| 55 | · rintro _ ⟨x, hx, rfl⟩ |
| 56 | rw [intervalChartExtension_val] |
| 57 | change (e.symm (e x) : ℝ) = (x : ℝ) |
| 58 | rw [e.left_inv hx] |
| 59 | · rintro _ ⟨x, hx, rfl⟩ |
| 60 | rw [intervalChartExtension_val] |
| 61 | have hy : e x ∈ e.target := e.map_source hx |
| 62 | have hu := (uniqueDiffOn_extChartAt_target p (e x) hy).uniqueMDiffWithinAt |
| 63 | have hi : MDifferentiableAt (𝓡∂ 1) 𝓘(ℝ) |
| 64 | (Subtype.val : D.Point → ℝ) (e.symm (e x)) := |
| 65 | D.inclusion_smooth.mdifferentiable (by simp) _ |
| 66 | have he := (mdifferentiableWithinAt_extChartAt_symm hy).mono |
| 67 | (extChartAt_target_subset_range p) |
| 68 | have hcomp := mfderiv_comp_mfderivWithin (e x) hi he hu |
| 69 | rw [mfderivWithin_eq_fderivWithin] at hcomp |
| 70 | change fderivWithin ℝ f e.target (e x) = _ at hcomp |
| 71 | change (fderivWithin ℝ f e.target (e x)).IsInvertible |
| 72 | rw [hcomp, ← D.inclusionDerivative_eq] |
| 73 | apply ContinuousLinearMap.IsInvertible.comp |
| 74 | · exact ⟨D.inclusionDerivative _, rfl⟩ |
| 75 | · have hmono := (mdifferentiableWithinAt_extChartAt_symm hy).mfderivWithin_mono |
| 76 | hu (extChartAt_target_subset_range p) |
| 77 | rw [hmono] |
| 78 | exact isInvertible_mfderivWithin_extChartAt_symm hy |
| 79 | |
| 80 | theorem interval_map_smooth {I J : SpacetimeInterval} |
| 81 | (D : SmoothSpacetimeInterval I) (E : SmoothSpacetimeInterval J) |
| 82 | (f : D.Point → E.Point) |
| 83 | (hf : ContMDiff (𝓡∂ 1) 𝓘(ℝ) ∞ (fun x ↦ (f x : ℝ))) : |
| 84 | ContMDiff (𝓡∂ 1) (𝓡∂ 1) ∞ f := by |
| 85 | have hc : Continuous f := |
| 86 | Topology.IsEmbedding.subtypeVal.continuous_iff.mpr hf.continuous |
| 87 | intro x |
| 88 | rw [contMDiffAt_iff_target] |
| 89 | refine ⟨hc.continuousAt, ?_⟩ |
| 90 | let e := extChartAt (𝓡∂ 1) (f x) |
| 91 | have hU : f ⁻¹' e.source ∈ 𝓝 x := |
| 92 | hc.continuousAt.preimage_mem_nhds (extChartAt_source_mem_nhds (f x)) |
| 93 | have hcomp : ContMDiffOn (𝓡∂ 1) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) ∞ |
| 94 | (fun y ↦ intervalChartExtension E (f x) (f y : ℝ)) (f ⁻¹' e.source) := |
| 95 | (intervalChartExtension_contDiffOn E (f x)).contMDiffOn.comp hf.contMDiffOn |
| 96 | (fun y hy ↦ ⟨f y, hy, rfl⟩) |
| 97 | have hpoint := (hcomp x (mem_extChartAt_source (f x))).contMDiffAt hU |
| 98 | simpa only [Function.comp_def, intervalChartExtension_val] using hpoint |
| 99 | |
| 100 | end PoincareMT.ParabolicRescaling |