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.NormalizedSquareFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.ODE.ForwardRegularizedContinuation |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.SqrtActionIntegrability |
| 4 | |
| 5 | /-! |
| 6 | # Canonical backward-time paths and their actual regularizations |
| 7 | |
| 8 | Each terminal path uses the same global square-root reparameterization. |
| 9 | Compact velocity extensions supply its endpoint equation and energy |
| 10 | continuity, while square substitution supplies finite action. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option maxSynthPendingDepth 3 |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | noncomputable def normalizedBackwardFamily {J : Set ℝ} (F : RicciFlow n M J) |
| 28 | (T τmax : ℝ) (p : M) (Z : TangentSpace (𝓡 n) p) : ℝ → M := |
| 29 | fun τ ↦ normalizedSquareFamily F T τmax p Z (Real.sqrt τ) |
| 30 | |
| 31 | set_option backward.isDefEq.respectTransparency false in |
| 32 | theorem exists_normalizedBackwardPath {J : Set ℝ} |
| 33 | [ConnectedSpace M] [T3Space M] [SecondCountableTopology M] |
| 34 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 35 | (T τmax : ℝ) (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 36 | (hcurvature : CompleteBoundedCurvatureOn F (Set.Icc (T - τmax) T)) |
| 37 | (p : M) (Z : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hbmax : b < τmax) : |
| 38 | ∃ P : BackwardTimePath F T 0 b, |
| 39 | P.curve = normalizedBackwardFamily F T τmax p Z ∧ |
| 40 | Nonempty (RegularizedLGeodesicData P) := by |
| 41 | let α := normalizedSquareFamily F T τmax p Z |
| 42 | let γ := normalizedBackwardFamily F T τmax p Z |
| 43 | let q0 : TangentBundle (𝓡 n) M := ⟨p, (2 : ℝ) • Z⟩ |
| 44 | let D := maximalRegularizedDomain F T τmax 0 q0 |
| 45 | let K := sqrtParameterInterval 0 b |
| 46 | have hK : K = Set.Icc 0 (Real.sqrt b) := by simp [K, sqrtParameterInterval] |
| 47 | have hD : IsOpen D := isOpen_maximalRegularizedDomain F T τmax 0 q0 |
| 48 | have hα : IsLocalRegularizedCurveOn F T α D := |
| 49 | maximalRegularizedCurve_isLocal F hM04 T τmax hτmax hwindow 0 q0 |
| 50 | have hforward : Set.Ico 0 (Real.sqrt τmax) ⊆ D := |
| 51 | Ico_subset_maximalRegularizedDomain F hM04 T τmax hτmax hwindow hcurvature q0 |
| 52 | have hsqrt : 0 < Real.sqrt b := Real.sqrt_pos.mpr hb |
| 53 | have hsqrtmax : Real.sqrt b < Real.sqrt τmax := Real.sqrt_lt_sqrt hb.le hbmax |
| 54 | have hKD : K ⊆ D := by |
| 55 | rw [hK] |
| 56 | intro s hs |
| 57 | exact hforward ⟨hs.1, hs.2.trans_lt hsqrtmax⟩ |
| 58 | have htime : K ⊆ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) := by |
| 59 | rw [hK] |
| 60 | intro s hs |
| 61 | exact ⟨(neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs.1, |
| 62 | hs.2.trans_lt hsqrtmax⟩ |
| 63 | have hKcompact : IsCompact K := hK ▸ isCompact_Icc |
| 64 | have hKdiff : UniqueDiffOn ℝ K := hK ▸ uniqueDiffOn_Icc hsqrt |
| 65 | obtain ⟨E, heq⟩ := exists_regularizedExtensionOn_compact F hM04 T τmax hτmax hwindow |
| 66 | α D K hD hKD hKcompact hKdiff htime hα.smooth (fun s hs ↦ hα.equation s (hKD hs)) |
| 67 | have henergy : ContinuousOn (regularizedCurveEnergy F T α) K := by |
| 68 | intro s hs |
| 69 | exact (regularizedCurveEnergy_hasDerivAt F hM04 T τmax hτmax hwindow |
| 70 | α D K hD hKD hKdiff hα.smooth E s hs (htime hs) (heq s hs)).continuousAt.continuousWithinAt |
| 71 | have hαcontinuous : ContinuousOn α K := hα.smooth.continuousOn.mono hKD |
| 72 | have htimeContinuous : ContinuousOn (fun s : ℝ ↦ T - s ^ 2) K := |
| 73 | (continuous_const.sub (continuous_id.pow 2)).continuousOn |
| 74 | have hgraph : ContinuousOn (fun s : ℝ ↦ (T - s ^ 2, α s)) K := |
| 75 | htimeContinuous.prodMk hαcontinuous |
| 76 | have hR : ContinuousOn (fun z : ℝ × M ↦ (F.connection z.1).scalarCurvature z.2) |
| 77 | (J ×ˢ Set.univ) := (hM04.scalar_regular n M J F).continuousOn |
| 78 | have hmaps : Set.MapsTo (fun s : ℝ ↦ (T - s ^ 2, α s)) K (J ×ˢ Set.univ) := by |
| 79 | intro s hs |
| 80 | exact ⟨hwindow (squareTime_mem_window T hτmax (htime hs)), Set.mem_univ _⟩ |
| 81 | have hscalar := hR.comp hgraph hmaps |
| 82 | have hαdiff : ∀ s ∈ D, MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) α s := |
| 83 | fun s hs ↦ (hα.smooth.contMDiffAt (hD.mem_nhds hs)).mdifferentiableAt (by simp) |
| 84 | have hintegrable : IntervalIntegrable (backwardLIntegrand F T γ) MeasureTheory.volume 0 b := by |
| 85 | apply intervalIntegrable_backwardLIntegrand_comp_sqrt F T b hb α |
| 86 | · intro s hs |
| 87 | apply hαdiff s (hKD ?_) |
| 88 | rw [hK] |
| 89 | exact ⟨hs.1.le, hs.2.le⟩ |
| 90 | · simpa only [hK, Function.comp_def] using hscalar |
| 91 | · simpa only [hK] using henergy |
| 92 | have hsqrtD : Set.MapsTo Real.sqrt (Set.Icc 0 b) D := by |
| 93 | intro τ hτ |
| 94 | apply hKD |
| 95 | rw [hK] |
| 96 | exact ⟨Real.sqrt_nonneg τ, Real.sqrt_le_sqrt hτ.2⟩ |
| 97 | have hγcontinuous : ContinuousOn γ (Set.Icc 0 b) := |
| 98 | hα.smooth.continuousOn.comp Real.continuous_sqrt.continuousOn hsqrtD |
| 99 | have hsqrtSmooth : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ Real.sqrt (Set.Ioo 0 b) := by |
| 100 | intro τ hτ |
| 101 | exact (Real.contDiffAt_sqrt hτ.1.ne').contMDiffAt.contMDiffWithinAt |
| 102 | have hγsmooth : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ (Set.Ioo 0 b) := |
| 103 | hα.smooth.comp hsqrtSmooth (fun τ hτ ↦ hsqrtD (Set.Ioo_subset_Icc_self hτ)) |
| 104 | let P : BackwardTimePath F T 0 b := { |
| 105 | curve := γ |
| 106 | nonnegative := le_rfl |
| 107 | ordered := hb |
| 108 | terminal_mem := hwindow ⟨by linarith, le_rfl⟩ |
| 109 | time_mem := fun τ hτ ↦ hwindow ⟨by linarith [hτ.2], by linarith [hτ.1]⟩ |
| 110 | continuous := hγcontinuous |
| 111 | regular := hγsmooth.of_le (by simp) |
| 112 | l_integrable := hintegrable |
| 113 | } |
| 114 | refine ⟨P, rfl, ⟨{ |
| 115 | path := { |
| 116 | curve := α |
| 117 | domain := D |
| 118 | open_domain := hD |
| 119 | interval_subset := hKD |
| 120 | smooth := hα.smooth |
| 121 | agrees := ?_ |
| 122 | } |
| 123 | velocity_extension := E |
| 124 | equation := heq |
| 125 | }⟩⟩ |
| 126 | intro s hs |
| 127 | have hs0 : 0 ≤ s := by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs.1 |
| 128 | change α s = α (Real.sqrt (s ^ 2)) |
| 129 | rw [Real.sqrt_sq hs0] |
| 130 | |
| 131 | end PoincareMT.ReducedLength |