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.Action.SquareActionIntegral |
| 2 | |
| 3 | /-! |
| 4 | # Action congruence on the open geometric interval |
| 5 | |
| 6 | Interior curve germs determine their actual velocities and integrands. |
| 7 | The interval integral ignores both endpoints. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option maxSynthPendingDepth 3 |
| 12 | set_option maxHeartbeats 800000 |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 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 | set_option backward.isDefEq.respectTransparency false in |
| 25 | theorem backwardLLength_congr_Ioo {J : Set ℝ} (F : RicciFlow n M J) |
| 26 | (T a b : ℝ) (hab : a ≤ b) (γ δ : ℝ → M) |
| 27 | (heq : Set.EqOn γ δ (Set.Ioo a b)) : |
| 28 | backwardLLength F T a b γ = backwardLLength F T a b δ := by |
| 29 | unfold backwardLLength |
| 30 | apply intervalIntegral.integral_congr_Ioo_of_le hab |
| 31 | intro t ht |
| 32 | have hlocal : γ =ᶠ[nhds t] δ := Filter.eventuallyEq_of_mem (isOpen_Ioo.mem_nhds ht) heq |
| 33 | have hderiv := hlocal.mfderiv_eq (I := 𝓘(ℝ, ℝ)) (I' := 𝓡 n) |
| 34 | have hv : (curveVelocity (n := n) γ t : EuclideanSpace ℝ (Fin n)) = |
| 35 | curveVelocity (n := n) δ t := |
| 36 | congrArg (fun L : ℝ →L[ℝ] EuclideanSpace ℝ (Fin n) ↦ L 1) hderiv |
| 37 | have hphase : (⟨γ t, curveVelocity (n := n) γ t⟩ : TangentBundle (𝓡 n) M) = |
| 38 | ⟨δ t, curveVelocity (n := n) δ t⟩ := |
| 39 | Bundle.TotalSpace.ext (heq ht) (heq_of_eq hv) |
| 40 | have hvalue := congrArg (fun q : TangentBundle (𝓡 n) M ↦ |
| 41 | Real.sqrt t * ((F.connection (T - t)).scalarCurvature q.1 + |
| 42 | (F.metric (T - t)).inner q.1 q.2 q.2)) hphase |
| 43 | exact hvalue |
| 44 | |
| 45 | end PoincareMT.ReducedLength |