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 | |
| 3 | /-! |
| 4 | # Varying terminal times for unit-interval comparison families |
| 5 | |
| 6 | Positive square-root rescaling gives actual admissible paths. Applying |
| 7 | the local action theorem to a larger family keeps the terminal time in |
| 8 | both the rescaling and the integration limit. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle |
| 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 | {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 24 | |
| 25 | theorem exists_backwardPath_of_unitFamily {J : Set ℝ} |
| 26 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 27 | (T τmax : ℝ) (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 28 | (f : E × ℝ → M) (U : Set (E × ℝ)) (hU : IsOpen U) |
| 29 | (hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ f U) |
| 30 | (v : E) (hsegment : ∀ r ∈ Set.Icc (0 : ℝ) 1, (v, r) ∈ U) |
| 31 | (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 32 | ∃ P : BackwardTimePath F T 0 b, |
| 33 | P.curve = (fun τ ↦ f (v, Real.sqrt τ / Real.sqrt b)) := by |
| 34 | let α : ℝ → M := fun s ↦ f (v, s / Real.sqrt b) |
| 35 | let D := (fun s : ℝ ↦ (v, s / Real.sqrt b)) ⁻¹' U |
| 36 | have hi : ContDiff ℝ ∞ (fun s : ℝ ↦ (v, s / Real.sqrt b)) := |
| 37 | contDiff_const.prodMk (contDiff_id.div_const _) |
| 38 | have hD : IsOpen D := hU.preimage hi.continuous |
| 39 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α D := |
| 40 | hf.comp hi.contMDiff.contMDiffOn (fun _ hs ↦ hs) |
| 41 | have hpos : 0 < Real.sqrt b := Real.sqrt_pos.mpr hb |
| 42 | have hI : Set.Icc 0 (Real.sqrt b) ⊆ D := by |
| 43 | intro s hs |
| 44 | exact hsegment (s / Real.sqrt b) |
| 45 | ⟨div_nonneg hs.1 hpos.le, (div_le_one hpos).mpr hs.2⟩ |
| 46 | obtain ⟨P, hP, _⟩ := exists_backwardPath_of_smoothSquareCurve F hM04 T τmax hτmax hwindow |
| 47 | b hb hmax α D hD hI hα |
| 48 | exact ⟨P, hP⟩ |
| 49 | |
| 50 | theorem contDiffOn_unitFamily_action {J : Set ℝ} |
| 51 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 52 | (T τmax : ℝ) (hτmax : 0 < τmax) (hwindow : Set.Icc (T - τmax) T ⊆ J) |
| 53 | (f : E × ℝ → M) (U : Set (E × ℝ)) (hU : IsOpen U) |
| 54 | (hf : ContMDiffOn (𝓘(ℝ, E × ℝ)) (𝓡 n) ∞ f U) |
| 55 | (V : Set E) (_hV : IsOpen V) (hVU : V ×ˢ Set.Icc (0 : ℝ) 1 ⊆ U) : |
| 56 | ContDiffOn ℝ ∞ |
| 57 | (fun z : E × ℝ ↦ backwardLLength F T 0 z.2 |
| 58 | (fun τ ↦ f (z.1, Real.sqrt τ / Real.sqrt z.2))) |
| 59 | (V ×ˢ Set.Ioo 0 τmax) := by |
| 60 | let S : Set ((E × ℝ) × ℝ) := (Set.univ ×ˢ Set.Ioo 0 τmax) ×ˢ Set.univ |
| 61 | let Φ : (E × ℝ) × ℝ → E × ℝ := fun w ↦ (w.1.1, w.2 / Real.sqrt w.1.2) |
| 62 | let D := S ∩ Φ ⁻¹' U |
| 63 | let g : (E × ℝ) × ℝ → M := fun w ↦ f (Φ w) |
| 64 | have hS : IsOpen S := (isOpen_univ.prod isOpen_Ioo).prod isOpen_univ |
| 65 | have hroot : ContDiffOn ℝ ∞ (fun w : (E × ℝ) × ℝ ↦ Real.sqrt w.1.2) S := |
| 66 | contDiff_fst.snd.contDiffOn.sqrt (fun w hw ↦ hw.1.2.1.ne') |
| 67 | have hΦ : ContDiffOn ℝ ∞ Φ S := |
| 68 | contDiff_fst.fst.contDiffOn.prodMk (contDiff_snd.contDiffOn.div hroot |
| 69 | (fun w hw ↦ (Real.sqrt_pos.mpr hw.1.2.1).ne')) |
| 70 | have hD : IsOpen D := hΦ.continuousOn.isOpen_inter_preimage hS hU |
| 71 | have hg : ContMDiffOn (𝓘(ℝ, (E × ℝ) × ℝ)) (𝓡 n) ∞ g D := |
| 72 | hf.comp (hΦ.mono Set.inter_subset_left).contMDiffOn (fun w hw ↦ hw.2) |
| 73 | intro z hz |
| 74 | have hpos : 0 < Real.sqrt z.2 := Real.sqrt_pos.mpr hz.2.1 |
| 75 | have hsegment : ∀ r ∈ Set.Icc (0 : ℝ) 1, (z, Real.sqrt z.2 * r) ∈ D := by |
| 76 | intro r hr |
| 77 | refine ⟨⟨⟨Set.mem_univ _, hz.2⟩, Set.mem_univ _⟩, ?_⟩ |
| 78 | change (z.1, Real.sqrt z.2 * r / Real.sqrt z.2) ∈ U |
| 79 | rw [mul_div_cancel_left₀ r hpos.ne'] |
| 80 | exact hVU ⟨hz.1, hr⟩ |
| 81 | have haction := contDiffAt_smoothSquareFamily_action F hM04 T τmax hτmax hwindow |
| 82 | g D hD hg (z, z.2) hz.2 hsegment |
| 83 | have hdiag : ContDiffAt ℝ ∞ (fun w : E × ℝ ↦ (w, w.2)) z := |
| 84 | contDiffAt_id.prodMk contDiffAt_snd |
| 85 | exact (haction.comp z hdiag).contDiffWithinAt |
| 86 | |
| 87 | end PoincareMT.ReducedLength |