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.Exponential.FamilyPhase |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.TangentChartPhase |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.ChartVelocity |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.SmoothPartials |
| 5 | |
| 6 | /-! |
| 7 | # Actual phases of a time-first smooth family |
| 8 | |
| 9 | The intrinsic phase is smooth by the tangent map. In any valid chart it |
| 10 | equals the ordinary position-and-time-derivative phase of the chart family. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | local notation "Q" => EuclideanSpace ℝ (Fin n) |
| 26 | |
| 27 | noncomputable def parameterCurvePhase (H : ℝ × ℝ → M) (z : ℝ × ℝ) : TangentBundle (𝓡 n) M := |
| 28 | curvePhase (n := n) (fun s ↦ H (s, z.2)) z.1 |
| 29 | |
| 30 | set_option backward.isDefEq.respectTransparency false in |
| 31 | theorem parameterCurvePhase_contMDiffOn (H : ℝ × ℝ → M) (U : Set (ℝ × ℝ)) |
| 32 | (hU : IsOpen U) (hH : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ H U) : |
| 33 | ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 34 | (parameterCurvePhase (n := n) H) U := by |
| 35 | have hswap : ContDiff ℝ ∞ (Prod.swap : ℝ × ℝ → ℝ × ℝ) := |
| 36 | contDiff_snd.prodMk contDiff_fst |
| 37 | have hHU : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ (H ∘ Prod.swap) (Prod.swap ⁻¹' U) := |
| 38 | hH.comp hswap.contMDiff.contMDiffOn (fun _ hz ↦ hz) |
| 39 | have hphase := familyPhase_contMDiffOn (H ∘ Prod.swap) (Prod.swap ⁻¹' U) |
| 40 | (hU.preimage hswap.continuous) hHU |
| 41 | exact hphase.comp hswap.contMDiff.contMDiffOn (fun _ hz ↦ hz) |
| 42 | |
| 43 | theorem tangentChartPhase_parameter_eq (H : ℝ × ℝ → M) (U : Set (ℝ × ℝ)) |
| 44 | (hU : IsOpen U) (hH : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ H U) |
| 45 | (p : M) (z : ℝ × ℝ) (hz : z ∈ U) (hp : H z ∈ (chartAt Q p).source) : |
| 46 | tangentChartPhase p (parameterCurvePhase (n := n) H z) = |
| 47 | timeDerivativePhase (fun w ↦ (chartAt Q p) (H w)) z := by |
| 48 | have hslice : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) (fun s ↦ H (s, z.2)) z.1 := |
| 49 | ((hH.contMDiffAt (hU.mem_nhds hz)).comp z.1 |
| 50 | (contDiff_id.prodMk contDiff_const).contMDiff.contMDiffAt).mdifferentiableAt (by simp) |
| 51 | apply Prod.ext |
| 52 | · rfl |
| 53 | · exact (hasDerivAt_chart_curve p (fun s ↦ H (s, z.2)) z.1 hp hslice).deriv.symm |
| 54 | |
| 55 | theorem tangentChartPhase_parameter_contDiffOn (H : ℝ × ℝ → M) (U : Set (ℝ × ℝ)) |
| 56 | (hU : IsOpen U) (hH : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ H U) (p : M) : |
| 57 | ContDiffOn ℝ ∞ (fun z ↦ tangentChartPhase p (parameterCurvePhase (n := n) H z)) |
| 58 | (U ∩ H ⁻¹' (chartAt Q p).source) := by |
| 59 | let Ω := U ∩ H ⁻¹' (chartAt Q p).source |
| 60 | have hΩ : IsOpen Ω := hH.continuousOn.isOpen_inter_preimage hU (chartAt Q p).open_source |
| 61 | have hc : ContDiffOn ℝ ∞ (fun z ↦ (chartAt Q p) (H z)) Ω := |
| 62 | (contMDiffOn_chart.comp (hH.mono Set.inter_subset_left) (fun _ hz ↦ hz.2)).contDiffOn |
| 63 | apply (timeDerivativePhase_contDiffOn _ Ω hΩ hc).congr |
| 64 | intro z hz |
| 65 | exact tangentChartPhase_parameter_eq H U hU hH p z hz.1 hz.2 |
| 66 | |
| 67 | end PoincareMT.ReducedLength |