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.Action.IntrinsicEnergy |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.SquareTimeFields |
| 4 | |
| 5 | /-! |
| 6 | # The smooth action density of an actual square-time family |
| 7 | |
| 8 | Evaluate the pulled-back metric on the bundled time-slice phase. The |
| 9 | result is the intrinsic energy of that slice, with no independent field. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | set_option maxHeartbeats 800000 |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u v |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 24 | [IsManifold (𝓡 n) ∞ M] |
| 25 | {E : Type v} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 26 | |
| 27 | noncomputable def squareFamilyActionDensity {J : Set ℝ} (F : RicciFlow n M J) |
| 28 | (T : ℝ) (f : E × ℝ → M) (z : E × ℝ) : ℝ := |
| 29 | 2 * z.2 ^ 2 * (F.connection (T - z.2 ^ 2)).scalarCurvature (f z) + |
| 30 | (1 / 2 : ℝ) * regularizedCurveEnergy F T (fun s ↦ f (z.1, s)) z.2 |
| 31 | |
| 32 | set_option backward.isDefEq.respectTransparency false in |
| 33 | theorem squareFamilyActionDensity_contDiffOn {J : Set ℝ} |
| 34 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 35 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 36 | (f : E × ℝ → M) (U : Set (E × ℝ)) (hU : IsOpen U) |
| 37 | (hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ f U) |
| 38 | (htime : ∀ z ∈ U, z.2 ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) : |
| 39 | ContDiffOn ℝ ∞ (squareFamilyActionDensity F T f) U := by |
| 40 | have hbase : ContMDiffOn (𝓘(ℝ, E × ℝ)) ((𝓘(ℝ, ℝ)).prod (𝓡 n)) ∞ |
| 41 | (fun z : E × ℝ ↦ (z.2, f z)) U := |
| 42 | contDiff_snd.contMDiff.contMDiffOn.prodMk hf |
| 43 | have hg := (squareTime_metric_smooth F T b hb hwindow).comp hbase |
| 44 | (fun z hz ↦ ⟨htime z hz, Set.mem_univ _⟩) |
| 45 | have hphase := familyPhase_contMDiffOn f U hU hf |
| 46 | have heval : ContMDiffOn (𝓘(ℝ, E × ℝ)) ((𝓡 n).prod (𝓘(ℝ, ℝ))) ∞ |
| 47 | (fun z : E × ℝ ↦ |
| 48 | (⟨f z, regularizedCurveEnergy F T (fun s ↦ f (z.1, s)) z.2⟩ : |
| 49 | Bundle.TotalSpace ℝ (Bundle.Trivial M ℝ))) U := |
| 50 | hg.clm_bundle_apply₂ hphase hphase |
| 51 | have henergy : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓘(ℝ, ℝ)) ∞ |
| 52 | (fun z : E × ℝ ↦ regularizedCurveEnergy F T (fun s ↦ f (z.1, s)) z.2) U := by |
| 53 | intro z hz |
| 54 | exact (Bundle.contMDiffWithinAt_totalSpace.mp (heval z hz)).2 |
| 55 | have hscalar := ((squareTime_scalar_smooth F hM04 T b hb hwindow).comp hbase |
| 56 | (fun z hz ↦ ⟨htime z hz, Set.mem_univ _⟩)).contDiffOn |
| 57 | exact ((contDiffOn_const.mul (contDiff_snd.contDiffOn.pow 2)).mul hscalar).add |
| 58 | (contDiffOn_const.mul henergy.contDiffOn) |
| 59 | |
| 60 | end PoincareMT.ReducedLength |