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.ReducedVolume.Exponential.Coordinates.SpacetimeInverse |
| 2 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 3 | import Mathlib.Analysis.Calculus.FDeriv.CompCLM |
| 4 | |
| 5 | /-! |
| 6 | # Actual potential smoothness from an action identity |
| 7 | |
| 8 | The time action identity recovers the potential along the endpoint-time |
| 9 | map. A noncritical inverse transfers this identity to a neighborhood of |
| 10 | the endpoint and proves smoothness of the actual potential there. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Filter Set |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.ReducedVolume |
| 19 | |
| 20 | variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] |
| 21 | [NormedAddCommGroup Y] [NormedSpace ℝ Y] [FiniteDimensional ℝ X] |
| 22 | |
| 23 | /-- A noncritical smooth action family produces a smooth germ of its actual potential. -/ |
| 24 | theorem potential_contDiffAt_of_action |
| 25 | {E : X × ℝ → Y} {A : X × ℝ → ℝ} |
| 26 | {B : Y × ℝ → Y →L[ℝ] Y →L[ℝ] ℝ} {R : Y × ℝ → ℝ} {z₀ : X × ℝ} |
| 27 | (hE : ContDiffAt ℝ ∞ E z₀) (hA : ContDiffAt ℝ ∞ A z₀) |
| 28 | (hB : ContDiffAt ℝ ∞ B (E z₀, z₀.2)) (ht : 0 < z₀.2) |
| 29 | (hcrit : Function.Bijective (fun h : X ↦ fderiv ℝ E z₀ (h, 0))) |
| 30 | (hidentity : ∀ᶠ z in 𝓝 z₀, |
| 31 | fderiv ℝ A z (0, 1) = Real.sqrt z.2 * |
| 32 | (R (E z, z.2) + B (E z, z.2) |
| 33 | (fderiv ℝ E z (0, 1)) (fderiv ℝ E z (0, 1)))) : |
| 34 | ContDiffAt ℝ ∞ R (E z₀, z₀.2) := by |
| 35 | let H : X × ℝ → Y × ℝ := fun z ↦ (E z, z.2) |
| 36 | let V : X × ℝ → Y := fun z ↦ fderiv ℝ E z (0, 1) |
| 37 | let Q : X × ℝ → ℝ := fun z ↦ |
| 38 | fderiv ℝ A z (0, 1) / Real.sqrt z.2 - B (H z) (V z) (V z) |
| 39 | have hH : ContDiffAt ℝ ∞ H z₀ := hE.prodMk contDiffAt_snd |
| 40 | have hV : ContDiffAt ℝ ∞ V z₀ := |
| 41 | (hE.fderiv_right (by simp)).clm_apply contDiffAt_const |
| 42 | have hDA : ContDiffAt ℝ ∞ (fun z ↦ fderiv ℝ A z (0, 1)) z₀ := |
| 43 | (hA.fderiv_right (by simp)).clm_apply contDiffAt_const |
| 44 | have hQ : ContDiffAt ℝ ∞ Q z₀ := |
| 45 | (hDA.div (contDiffAt_snd.sqrt ht.ne') (Real.sqrt_pos.mpr ht).ne').sub |
| 46 | (((hB.comp z₀ hH).clm_apply hV).clm_apply hV) |
| 47 | have heq : Q =ᶠ[𝓝 z₀] R ∘ H := by |
| 48 | filter_upwards [hidentity, continuous_snd.continuousAt (eventually_gt_nhds ht)] |
| 49 | with z hz hzt |
| 50 | dsimp only [Q, V, H, Function.comp_apply] |
| 51 | rw [hz, mul_div_cancel_left₀ _ (Real.sqrt_pos.mpr hzt).ne'] |
| 52 | ring |
| 53 | obtain ⟨φ, hφ, hzφ, hφsmooth, _⟩ := |
| 54 | exists_smooth_endpoint_time_inverse hE (by simp) hcrit |
| 55 | change ∀ z, φ z = H z at hφ |
| 56 | have hleft : φ.symm (H z₀) = z₀ := by |
| 57 | rw [← hφ z₀] |
| 58 | exact φ.left_inv hzφ |
| 59 | have htarget : H z₀ ∈ φ.target := by |
| 60 | rw [← hφ z₀] |
| 61 | exact φ.map_source hzφ |
| 62 | have hinv : ContDiffAt ℝ ∞ φ.symm (H z₀) := hφsmooth |
| 63 | have hcont : Tendsto φ.symm (𝓝 (H z₀)) (𝓝 z₀) := by |
| 64 | simpa only [ContinuousAt, hleft] using hinv.continuousAt |
| 65 | have hQ' : ContDiffAt ℝ ∞ (Q ∘ φ.symm) (H z₀) := |
| 66 | (hleft.symm ▸ hQ).comp _ hinv |
| 67 | apply hQ'.congr_of_eventuallyEq |
| 68 | have heq' : ∀ᶠ w in 𝓝 (H z₀), Q (φ.symm w) = R (H (φ.symm w)) := |
| 69 | hcont heq |
| 70 | filter_upwards [heq', φ.open_target.mem_nhds htarget] with w hw hwφ |
| 71 | dsimp only [Function.comp_apply] |
| 72 | rw [hw] |
| 73 | congr 1 |
| 74 | exact ((hφ (φ.symm w)).symm.trans (φ.right_inv hwφ)).symm |
| 75 | |
| 76 | end PoincareMT.ReducedVolume |