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.SmoothSquareAction |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Action.ActionCongruence |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.PathComparison |
| 4 | |
| 5 | /-! |
| 6 | # Smooth actions and actual admissible slices of frozen variations |
| 7 | |
| 8 | The square agreement identifies actions on the parameter neighborhood. |
| 9 | Every initial-fixed slice gives a constructed backward-time competitor. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | open Filter |
| 17 | |
| 18 | universe u |
| 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 | {J : Set ℝ} {F : RicciFlow n M J} {T a b τmax : ℝ} |
| 26 | |
| 27 | theorem variation_endpoint_contMDiffOn {P : BackwardTimePath F T a b} |
| 28 | (V : LVariation F T a b P) (s : ℝ) (hs : s ∈ sqrtParameterInterval a b) : |
| 29 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ (V.squareFamily s) V.parameterDomain := by |
| 30 | exact V.square_smooth.comp (contMDiff_const.prodMk contMDiff_id).contMDiffOn |
| 31 | (fun _ hu ↦ V.square_contains ⟨hs, hu⟩) |
| 32 | |
| 33 | theorem variationLLength_eq_squareAction (hb : 0 < b) {P : BackwardTimePath F T 0 b} |
| 34 | (V : LVariation F T 0 b P) (u : ℝ) (hu : u ∈ V.parameterDomain) : |
| 35 | variationLLength V u = |
| 36 | backwardLLength F T 0 b (fun t ↦ V.squareFamily (Real.sqrt t) u) := by |
| 37 | apply backwardLLength_congr_Ioo F T 0 b hb.le |
| 38 | intro t ht |
| 39 | have hs : Real.sqrt t ∈ sqrtParameterInterval 0 b := by |
| 40 | simpa only [sqrtParameterInterval, Real.sqrt_zero] using |
| 41 | (show Real.sqrt t ∈ Set.Icc 0 (Real.sqrt b) from |
| 42 | ⟨Real.sqrt_nonneg t, Real.sqrt_le_sqrt ht.2.le⟩) |
| 43 | simpa only [Real.sq_sqrt ht.1.le] using (V.square_agrees (Real.sqrt t) hs u hu).symm |
| 44 | |
| 45 | set_option backward.isDefEq.respectTransparency false in |
| 46 | theorem variationLLength_contDiffAt |
| 47 | (hM04 : RicciFlowCurvatureTheory.{u}) (hτmax : 0 < τmax) |
| 48 | (hwindow : Set.Icc (T - τmax) T ⊆ J) (hb : 0 < b) (hmax : b < τmax) |
| 49 | {P : BackwardTimePath F T 0 b} (V : LVariation F T 0 b P) |
| 50 | (u : ℝ) (hu : u ∈ V.parameterDomain) : |
| 51 | ContDiffAt ℝ ∞ (variationLLength V) u := by |
| 52 | let f : ℝ × ℝ → M := fun z ↦ V.squareFamily z.2 z.1 |
| 53 | let U := Prod.swap ⁻¹' V.squareDomain |
| 54 | have hU : IsOpen U := V.square_open.preimage continuous_swap |
| 55 | have hV : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ |
| 56 | (fun z : ℝ × ℝ ↦ V.squareFamily z.1 z.2) V.squareDomain := by |
| 57 | convert! V.square_smooth using 1 <;> |
| 58 | simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 59 | have hf : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ f U := |
| 60 | hV.comp (contDiff_snd.prodMk contDiff_fst).contMDiff.contMDiffOn (fun _ hz ↦ hz) |
| 61 | have hsegment (r : ℝ) (hr : r ∈ Set.Icc (0 : ℝ) 1) : |
| 62 | (u, Real.sqrt b * r) ∈ U := by |
| 63 | change (Real.sqrt b * r, u) ∈ V.squareDomain |
| 64 | apply V.square_contains |
| 65 | refine ⟨?_, hu⟩ |
| 66 | simpa only [sqrtParameterInterval, Real.sqrt_zero] using |
| 67 | (show Real.sqrt b * r ∈ Set.Icc 0 (Real.sqrt b) from |
| 68 | ⟨mul_nonneg (Real.sqrt_nonneg b) hr.1, |
| 69 | mul_le_of_le_one_right (Real.sqrt_nonneg b) hr.2⟩) |
| 70 | have haction := contDiffAt_smoothSquareFamily_action F hM04 T τmax hτmax hwindow |
| 71 | f U hU hf (u, b) ⟨hb, hmax⟩ hsegment |
| 72 | have hsmooth : ContDiffAt ℝ ∞ |
| 73 | (fun v ↦ backwardLLength F T 0 b (fun t ↦ V.squareFamily (Real.sqrt t) v)) u := |
| 74 | haction.comp u (contDiffAt_id.prodMk contDiffAt_const) |
| 75 | apply hsmooth.congr_of_eventuallyEq |
| 76 | filter_upwards [isOpen_Ioo.mem_nhds hu] with v hv |
| 77 | exact variationLLength_eq_squareAction hb V v hv |
| 78 | |
| 79 | theorem reducedLength_le_initialFixedVariation [ConnectedSpace M] |
| 80 | (hM04 : RicciFlowCurvatureTheory.{u}) (hL : LGeodesicTheory F T τmax) |
| 81 | (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 82 | (hb : 0 < b) (hmax : b < τmax) {P : BackwardTimePath F T 0 b} |
| 83 | (V : InitialFixedLVariation F T 0 b P) (p : M) (hP0 : P.curve 0 = p) |
| 84 | (u : ℝ) (hu : u ∈ V.toLVariation.parameterDomain) : |
| 85 | reducedLength F T p (V.squareFamily (Real.sqrt b) u) b ≤ |
| 86 | variationLLength V.toLVariation u / (2 * Real.sqrt b) := by |
| 87 | let D := (fun s : ℝ ↦ (s, u)) ⁻¹' V.squareDomain |
| 88 | have hD : IsOpen D := V.square_open.preimage (continuous_id.prodMk continuous_const) |
| 89 | have hKD : Set.Icc 0 (Real.sqrt b) ⊆ D := by |
| 90 | intro s hs |
| 91 | apply V.square_contains |
| 92 | exact ⟨by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs, hu⟩ |
| 93 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ (fun s ↦ V.squareFamily s u) D := |
| 94 | V.square_smooth.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun _ hs ↦ hs) |
| 95 | obtain ⟨Q, hQ, _⟩ := exists_backwardPath_of_smoothSquareCurve F hM04 T τmax hτmax |
| 96 | hwindow b hb hmax (fun s ↦ V.squareFamily s u) D hD hKD hα |
| 97 | have h0 : (0 : ℝ) ∈ sqrtParameterInterval 0 b := by |
| 98 | simp only [sqrtParameterInterval, Real.sqrt_zero, Set.mem_Icc, le_refl, |
| 99 | Real.sqrt_nonneg, and_self] |
| 100 | have hQ0 : Q.curve 0 = p := by |
| 101 | rw [hQ] |
| 102 | change V.squareFamily (Real.sqrt 0) u = p |
| 103 | rw [Real.sqrt_zero, V.square_agrees 0 h0 u hu, zero_pow two_ne_zero, |
| 104 | V.fixed_left u hu, hP0] |
| 105 | have hQb : Q.curve b = V.squareFamily (Real.sqrt b) u := congrFun hQ b |
| 106 | have hcompare := reducedLength_le_path hL hb hmax.le Q hQ0 hQb |
| 107 | rw [hQ, ← variationLLength_eq_squareAction hb V.toLVariation u hu] at hcompare |
| 108 | exact hcompare |
| 109 | |
| 110 | end PoincareMT.ReducedLength |