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.Calculus.WithinDerivativeCongruence |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.ODE.LocalRegularizedEquation |
| 3 | |
| 4 | /-! |
| 5 | # Transfer of the actual regularized equation on a closed interval |
| 6 | |
| 7 | The coordinate position and velocity agree by unique within derivatives. |
| 8 | Their ambient phase derivative therefore agrees at included endpoints. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.ReducedLength |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 22 | [IsManifold (𝓡 n) ∞ M] |
| 23 | |
| 24 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 25 | |
| 26 | theorem LocalRegularizedEquation.congr_of_eqOn {J : Set ℝ} {F : RicciFlow n M J} |
| 27 | {T s : ℝ} {γ δ : ℝ → M} (K Uγ Uδ : Set ℝ) |
| 28 | (hUγ : IsOpen Uγ) (hUδ : IsOpen Uδ) (hKγ : K ⊆ Uγ) (hKδ : K ⊆ Uδ) |
| 29 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ Uγ) |
| 30 | (hδ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ δ Uδ) |
| 31 | (hK : UniqueDiffOn ℝ K) (heq : Set.EqOn γ δ K) (hs : s ∈ K) |
| 32 | (h : LocalRegularizedEquation F T γ s) : LocalRegularizedEquation F T δ s := by |
| 33 | obtain ⟨p, hp, hd⟩ := h |
| 34 | let Wγ := Uγ ∩ γ ⁻¹' (chartAt V p).source |
| 35 | let Wδ := Uδ ∩ δ ⁻¹' (chartAt V p).source |
| 36 | let W := Wγ ∩ Wδ |
| 37 | have hWγ : IsOpen Wγ := |
| 38 | hγ.continuousOn.isOpen_inter_preimage hUγ (chartAt V p).open_source |
| 39 | have hWδ : IsOpen Wδ := |
| 40 | hδ.continuousOn.isOpen_inter_preimage hUδ (chartAt V p).open_source |
| 41 | have hW : IsOpen W := hWγ.inter hWδ |
| 42 | have hδp : δ s ∈ (chartAt V p).source := by rwa [← heq hs] |
| 43 | have hsW : s ∈ W := ⟨⟨hKγ hs, hp⟩, ⟨hKδ hs, hδp⟩⟩ |
| 44 | let L := K ∩ W |
| 45 | have hL : UniqueDiffOn ℝ L := hK.inter hW |
| 46 | have hsL : s ∈ L := ⟨hs, hsW⟩ |
| 47 | let a : ℝ → V := fun r ↦ (chartAt V p) (γ r) |
| 48 | let c : ℝ → V := fun r ↦ (chartAt V p) (δ r) |
| 49 | have ha : ContDiffOn ℝ ∞ a W := |
| 50 | (contMDiffOn_chart.comp (hγ.mono (fun _ hr ↦ hr.1.1)) |
| 51 | (fun _ hr ↦ hr.1.2)).contDiffOn |
| 52 | have hc : ContDiffOn ℝ ∞ c W := |
| 53 | (contMDiffOn_chart.comp (hδ.mono (fun _ hr ↦ hr.2.1)) |
| 54 | (fun _ hr ↦ hr.2.2)).contDiffOn |
| 55 | have had (r : ℝ) (hr : r ∈ L) : DifferentiableAt ℝ a r := |
| 56 | (ha.contDiffAt (hW.mem_nhds hr.2)).differentiableAt (by simp) |
| 57 | have hcd (r : ℝ) (hr : r ∈ L) : DifferentiableAt ℝ c r := |
| 58 | (hc.contDiffAt (hW.mem_nhds hr.2)).differentiableAt (by simp) |
| 59 | have hac : Set.EqOn a c L := fun r hr ↦ congrArg (chartAt V p) (heq hr.1) |
| 60 | have hv : deriv a s = deriv c s := deriv_eq_of_eqOn hac hsL (hL s hsL) |
| 61 | (had s hsL) (hcd s hsL) |
| 62 | have hdc : ContDiffOn ℝ ∞ (deriv c) W := hc.deriv_of_isOpen hW (by simp) |
| 63 | have hd' := hasDerivAt_phase_congr_of_eqOn hac hsL hL had hcd |
| 64 | ((hdc.contDiffAt (hW.mem_nhds hsW)).differentiableAt (by simp)) hd |
| 65 | refine ⟨p, hδp, ?_⟩ |
| 66 | change HasDerivAt (fun r ↦ (c r, deriv c r)) |
| 67 | (regularizedCoordinatePhase (squareChartMetric F T p) (squareChartScalar F T p) |
| 68 | (s, (c s, deriv c s))) s |
| 69 | change HasDerivAt (fun r ↦ (c r, deriv c r)) |
| 70 | (regularizedCoordinatePhase (squareChartMetric F T p) (squareChartScalar F T p) |
| 71 | (s, (a s, deriv a s))) s at hd' |
| 72 | rwa [hac hsL, hv] at hd' |
| 73 | |
| 74 | end PoincareMT.ReducedLength |