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.Curvature.Theory |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | |
| 5 | /-! |
| 6 | # Smoothness of the actual positive-time backward action integrand |
| 7 | |
| 8 | The metric and scalar curvature are evaluated at the same spacetime |
| 9 | graph as the actual bundled velocity of each family slice. |
| 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 | set_option backward.isDefEq.respectTransparency false in |
| 28 | theorem backwardFamilyActionDensity_contDiffOn {J : Set ℝ} |
| 29 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) |
| 30 | (f : E × ℝ → M) (U : Set (E × ℝ)) (hU : IsOpen U) |
| 31 | (hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ f U) |
| 32 | (hpositive : ∀ z ∈ U, 0 < z.2) (htime : ∀ z ∈ U, T - z.2 ∈ J) : |
| 33 | ContDiffOn ℝ ∞ (fun z : E × ℝ ↦ |
| 34 | backwardLIntegrand F T (fun s ↦ f (z.1, s)) z.2) U := by |
| 35 | have hbase : ContMDiffOn (𝓘(ℝ, E × ℝ)) ((𝓘(ℝ, ℝ)).prod (𝓡 n)) ∞ |
| 36 | (fun z : E × ℝ ↦ (T - z.2, f z)) U := |
| 37 | (contDiff_const.sub contDiff_snd).contMDiff.contMDiffOn.prodMk hf |
| 38 | have hg := F.smooth.comp hbase (fun z hz ↦ ⟨htime z hz, Set.mem_univ _⟩) |
| 39 | have hphase := familyPhase_contMDiffOn f U hU hf |
| 40 | have heval : ContMDiffOn (𝓘(ℝ, E × ℝ)) ((𝓡 n).prod (𝓘(ℝ, ℝ))) ∞ |
| 41 | (fun z : E × ℝ ↦ |
| 42 | (⟨f z, (F.metric (T - z.2)).inner (f z) |
| 43 | (curveVelocity (n := n) (fun s ↦ f (z.1, s)) z.2) |
| 44 | (curveVelocity (n := n) (fun s ↦ f (z.1, s)) z.2)⟩ : |
| 45 | Bundle.TotalSpace ℝ (Bundle.Trivial M ℝ))) U := |
| 46 | hg.clm_bundle_apply₂ hphase hphase |
| 47 | have henergy : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓘(ℝ, ℝ)) ∞ |
| 48 | (fun z : E × ℝ ↦ (F.metric (T - z.2)).inner (f z) |
| 49 | (curveVelocity (n := n) (fun s ↦ f (z.1, s)) z.2) |
| 50 | (curveVelocity (n := n) (fun s ↦ f (z.1, s)) z.2)) U := by |
| 51 | intro z hz |
| 52 | exact (Bundle.contMDiffWithinAt_totalSpace.mp (heval z hz)).2 |
| 53 | have hscalar := ((hM04.scalar_regular n M J F).comp hbase |
| 54 | (fun z hz ↦ ⟨htime z hz, Set.mem_univ _⟩)).contDiffOn |
| 55 | have hsqrt : ContDiffOn ℝ ∞ (fun z : E × ℝ ↦ Real.sqrt z.2) U := |
| 56 | contDiff_snd.contDiffOn.sqrt (fun z hz ↦ (hpositive z hz).ne') |
| 57 | exact hsqrt.mul (hscalar.add henergy.contDiffOn) |
| 58 | |
| 59 | end PoincareMT.ReducedLength |