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.ReducedVolume.Exponential.Dynamics.GeometricBranchODE |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Dynamics.LocalODE |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Regularity.AlmostEverywhere.TerminalVelocity |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Dynamics.EulerTail |
| 5 | |
| 6 | /-! |
| 7 | # Uniqueness of noncritical minimizing branches at differentiable contact |
| 8 | |
| 9 | The actual terminal velocity identifies both covector phase states in one |
| 10 | preferred chart. Local ODE uniqueness gives agreement near the endpoint. |
| 11 | The supplied extension to zero then identifies the original closed paths. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedVolume |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 26 | |
| 27 | set_option backward.isDefEq.respectTransparency false in |
| 28 | /-- Noncritical branches with the same actual terminal state agree on a time neighborhood. -/ |
| 29 | theorem noncritical_gamma_eventuallyEq_of_terminal_velocity |
| 30 | (hwindow : Icc (T - τmax) T ⊆ J) (G : LExponentialGeometry F T τmax p) |
| 31 | (Z W : TangentSpace (𝓡 n) p) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 32 | (hZ : Function.Bijective (G.toLExponentialFamily.sliceDifferential Z τ)) |
| 33 | (hW : Function.Bijective (G.toLExponentialFamily.sliceDifferential W τ)) |
| 34 | (hend : G.gamma Z τ = G.gamma W τ) |
| 35 | (hvel : hend ▸ curveVelocity (n := n) (G.gamma Z) τ = |
| 36 | curveVelocity (n := n) (G.gamma W) τ) : |
| 37 | G.gamma Z =ᶠ[𝓝 τ] G.gamma W := by |
| 38 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 39 | ⟨(F.metric T).toRiemannianMetric⟩ |
| 40 | let q := G.gamma Z τ |
| 41 | let E := endpointCoordinates G q |
| 42 | let B := coordinateBackwardMetric F T q |
| 43 | let R := coordinateScalarCurvature F T q |
| 44 | have hz : (Z, τ) ∈ univ ×ˢ Ioo 0 τmax := ⟨mem_univ _, hτ, hmax⟩ |
| 45 | have hw : (W, τ) ∈ univ ×ˢ Ioo 0 τmax := ⟨mem_univ _, hτ, hmax⟩ |
| 46 | have hqZ : G.gamma Z τ ∈ (chartAt (EuclideanSpace ℝ (Fin n)) q).source := |
| 47 | mem_chart_source _ _ |
| 48 | have hqW : G.gamma W τ ∈ (chartAt (EuclideanSpace ℝ (Fin n)) q).source := hend ▸ hqZ |
| 49 | have hEeq : E (Z, τ) = E (W, τ) := congrArg (extChartAt (𝓡 n) q) hend |
| 50 | have hframe : ∀ (x y : M) (hxy : x = y) |
| 51 | (u : TangentSpace (𝓡 n) x) (v : TangentSpace (𝓡 n) y), hxy ▸ u = v → |
| 52 | (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 53 | (TangentSpace (𝓡 n)) q).continuousLinearMapAt ℝ x u = |
| 54 | (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 55 | (TangentSpace (𝓡 n)) q).continuousLinearMapAt ℝ y v := by |
| 56 | intro x y hxy u v huv |
| 57 | subst y |
| 58 | exact congrArg _ huv |
| 59 | have hVeq : fderiv ℝ E (Z, τ) (0, 1) = fderiv ℝ E (W, τ) (0, 1) := by |
| 60 | rw [endpointCoordinates_time G q (Z, τ) hz hqZ, |
| 61 | endpointCoordinates_time G q (W, τ) hw hqW] |
| 62 | exact hframe _ _ hend _ _ hvel |
| 63 | have hstate : actionBranchPhase E B Z τ = actionBranchPhase E B W τ := by |
| 64 | change (τ, E (Z, τ), actionBranchMomentum E B (Z, τ)) = |
| 65 | (τ, E (W, τ), actionBranchMomentum E B (W, τ)) |
| 66 | refine Prod.ext (show τ = τ from rfl) (Prod.ext hEeq ?_) |
| 67 | dsimp only [actionBranchMomentum] |
| 68 | rw [hEeq, hVeq] |
| 69 | have hB : ContDiffAt ℝ ∞ B (E (Z, τ), τ) := |
| 70 | coordinateBackwardMetric_contDiffAt hwindow q hτ hmax |
| 71 | have hR : ContDiffAt ℝ ∞ R (E (Z, τ), τ) := |
| 72 | coordinateScalarCurvature_contDiffAt_of_noncritical hwindow G (Z, τ) hz hZ |
| 73 | have hi : (B (E (Z, τ), τ)).IsInvertible := |
| 74 | coordinateBackwardMetric_isInvertible q _ |
| 75 | ((extChartAt (𝓡 n) q).map_source (mem_extChartAt_source q)) |
| 76 | have hfield : ContDiffAt ℝ 1 (phaseField B R) (actionBranchPhase E B Z τ) := |
| 77 | phaseField_contDiffAt hB hR hτ hi |
| 78 | have hsolZ := noncritical_branch_solves hwindow G q (Z, τ) hz rfl hZ |
| 79 | have hsolW := noncritical_branch_solves hwindow G q (W, τ) hw hend.symm hW |
| 80 | have hphase := eventuallyEq_of_contDiffAt_vectorField hfield hsolZ hsolW hstate |
| 81 | have hcontZ : ContinuousAt (G.gamma Z) τ := |
| 82 | ((G.gamma_smooth.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds hz)).comp τ |
| 83 | (contMDiffAt_const.prodMk contMDiffAt_id)).continuousAt |
| 84 | have hcontW : ContinuousAt (G.gamma W) τ := |
| 85 | ((G.gamma_smooth.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds hw)).comp τ |
| 86 | (contMDiffAt_const.prodMk contMDiffAt_id)).continuousAt |
| 87 | filter_upwards [hphase, |
| 88 | hcontZ ((chartAt (EuclideanSpace ℝ (Fin n)) q).open_source.mem_nhds hqZ), |
| 89 | hcontW ((chartAt (EuclideanSpace ℝ (Fin n)) q).open_source.mem_nhds hqW)] |
| 90 | with t ht htZ htW |
| 91 | have htZ' : G.gamma Z t ∈ (extChartAt (𝓡 n) q).source := by |
| 92 | simpa only [Set.mem_preimage, extChartAt_source] using htZ |
| 93 | have htW' : G.gamma W t ∈ (extChartAt (𝓡 n) q).source := by |
| 94 | simpa only [Set.mem_preimage, extChartAt_source] using htW |
| 95 | apply (extChartAt (𝓡 n) q).injOn htZ' htW' |
| 96 | exact congrArg (fun a : ℝ × EuclideanSpace ℝ (Fin n) × |
| 97 | (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) ↦ a.2.1) ht |
| 98 | |
| 99 | variable [ConnectedSpace M] |
| 100 | |
| 101 | /-- At differentiable contact, two noncritical minimizing lifts agree on the full interval. -/ |
| 102 | theorem minimizing_noncritical_gamma_eqOn |
| 103 | (hL : LGeodesicTheory F T τmax) (hwindow : Icc (T - τmax) T ⊆ J) |
| 104 | (G : LExponentialGeometry F T τmax p) |
| 105 | (Z W : TangentSpace (𝓡 n) p) {τ : ℝ} (hτ : 0 < τ) (hmax : τ < τmax) |
| 106 | (hZ : IsMinimizingBackwardLPath F T 0 τ (G.path Z τ hτ hmax)) |
| 107 | (hW : IsMinimizingBackwardLPath F T 0 τ (G.path W τ hτ hmax)) |
| 108 | (hend : G.gamma Z τ = G.gamma W τ) |
| 109 | (hl : MDifferentiableAt (𝓡 n) (𝓘(ℝ, ℝ)) (fun q ↦ reducedLength F T p q τ) |
| 110 | (G.gamma Z τ)) |
| 111 | (hcZ : Function.Bijective (G.toLExponentialFamily.sliceDifferential Z τ)) |
| 112 | (hcW : Function.Bijective (G.toLExponentialFamily.sliceDifferential W τ)) : |
| 113 | EqOn (G.gamma Z) (G.gamma W) (Icc 0 τ) := by |
| 114 | have hvel := minimizing_terminal_velocity_eq hL G Z W hτ hmax hZ hW hend hl hcZ.2 hcW.2 |
| 115 | have hlocal := noncritical_gamma_eventuallyEq_of_terminal_velocity |
| 116 | hwindow G Z W hτ hmax hcZ hcW hend hvel |
| 117 | have heq := eulerPaths_eqOn_of_eventuallyEq hL hmax.le |
| 118 | (hL.euler_lagrange 0 τ le_rfl hτ hmax.le (G.path Z τ hτ hmax) hZ) |
| 119 | (hL.euler_lagrange 0 τ le_rfl hτ hmax.le (G.path W τ hτ hmax) hW) |
| 120 | (by simpa only [G.path_eq] using hlocal) |
| 121 | simpa only [G.path_eq] using heq |
| 122 | |
| 123 | end PoincareMT.ReducedVolume |