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.InteriorEndpointFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Initial.InitialVectorVariation |
| 3 | |
| 4 | /-! |
| 5 | # Interior endpoint families along an initial-vector line |
| 6 | |
| 7 | The endpoint family preserves both outer endpoints and recovers the |
| 8 | original square-time curve on its actual parameter diagonal. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | set_option maxHeartbeats 800000 |
| 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] [IsManifold (𝓡 n) ∞ M] |
| 24 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 25 | |
| 26 | local notation "Q" => EuclideanSpace ℝ (Fin n) |
| 27 | |
| 28 | noncomputable def lineInteriorCoordinate (A : LExponentialFamily F T τmax p) |
| 29 | (Z W : TangentSpace (𝓡 n) p) (c : ℝ) (r : ℝ) : Q := |
| 30 | chartAt Q (A.squareFamily Z (Real.sqrt c)) (A.squareFamily (Z + r • W) (Real.sqrt c)) |
| 31 | |
| 32 | structure LineInteriorFamily (A : LExponentialFamily F T τmax p) |
| 33 | (Z W : TangentSpace (𝓡 n) p) (c b : ℝ) where |
| 34 | family : (ℝ × Q) × ℝ → M |
| 35 | domain : Set ((ℝ × Q) × ℝ) |
| 36 | parameters : Set (ℝ × Q) |
| 37 | domain_open : IsOpen domain |
| 38 | parameters_open : IsOpen parameters |
| 39 | center_mem : (0, lineInteriorCoordinate A Z W c 0) ∈ parameters |
| 40 | segment_mem : parameters ×ˢ Set.Icc 0 (Real.sqrt b) ⊆ domain |
| 41 | smooth : ContMDiffOn (𝓘(ℝ, (ℝ × Q) × ℝ)) (𝓡 n) ∞ family domain |
| 42 | target_mem : ∀ z ∈ parameters, |
| 43 | z.2 ∈ (chartAt Q (A.squareFamily Z (Real.sqrt c))).target |
| 44 | left : ∀ r y, family ((r, y), 0) = p |
| 45 | right : ∀ r y, family ((r, y), Real.sqrt b) = A.squareFamily (Z + r • W) (Real.sqrt b) |
| 46 | marked : ∀ r y, family ((r, y), Real.sqrt c) = |
| 47 | (chartAt Q (A.squareFamily Z (Real.sqrt c))).symm y |
| 48 | recovery : ∀ z ∈ parameters, ∀ s ∈ Set.Icc 0 (Real.sqrt b), |
| 49 | family ((z.1, lineInteriorCoordinate A Z W c z.1), s) = A.squareFamily (Z + z.1 • W) s |
| 50 | coordinate_smooth : ContDiffAt ℝ ∞ (lineInteriorCoordinate A Z W c) 0 |
| 51 | diagonal_mem : ∀ᶠ r in 𝓝 (0 : ℝ), (r, lineInteriorCoordinate A Z W c r) ∈ parameters |
| 52 | |
| 53 | set_option backward.isDefEq.respectTransparency false in |
| 54 | theorem exists_lineInteriorFamily (A : LExponentialFamily F T τmax p) |
| 55 | (Z W : TangentSpace (𝓡 n) p) (c b : ℝ) |
| 56 | (hc : 0 < c) (hcb : c < b) (hmax : b < τmax) : |
| 57 | Nonempty (LineInteriorFamily A Z W c b) := by |
| 58 | let V := (initialVectorVariation A Z W b (hc.trans hcb) hmax).toLVariation |
| 59 | let H : ℝ × ℝ → M := fun z ↦ A.squareFamily (Z + z.1 • W) z.2 |
| 60 | let U := Prod.swap ⁻¹' V.squareDomain |
| 61 | have hU : IsOpen U := V.square_open.preimage continuous_swap |
| 62 | have hV : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ |
| 63 | (fun z : ℝ × ℝ ↦ V.squareFamily z.1 z.2) V.squareDomain := by |
| 64 | convert! V.square_smooth using 1 <;> |
| 65 | simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 66 | have hH : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ H U := |
| 67 | hV.comp (contDiff_snd.prodMk contDiff_fst).contMDiff.contMDiffOn (fun _ hz ↦ hz) |
| 68 | have hsegment (s : ℝ) (hs : s ∈ Set.Icc 0 (Real.sqrt b)) : (0, s) ∈ U := by |
| 69 | change (s, (0 : ℝ)) ∈ V.squareDomain |
| 70 | apply V.square_contains |
| 71 | exact ⟨by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs, |
| 72 | neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 73 | have hH0 : H (0, Real.sqrt c) = A.squareFamily Z (Real.sqrt c) := by |
| 74 | simp only [H, zero_smul, add_zero] |
| 75 | obtain ⟨Φ, Ω, N, hΩ, hN, h0N, hNΩ, hΦ, hinfo, hleft, hright, hmarked, hrecovery⟩ := |
| 76 | exists_smooth_interior_endpoint_family H U hU hH 0 (Real.sqrt b) (Real.sqrt c) |
| 77 | ⟨Real.sqrt_pos.mpr hc, Real.sqrt_lt_sqrt hc.le hcb⟩ hsegment |
| 78 | let e := chartAt Q (A.squareFamily Z (Real.sqrt c)) |
| 79 | let a := lineInteriorCoordinate A Z W c |
| 80 | have ha : ContDiffAt ℝ ∞ a 0 := by |
| 81 | have hmem := hsegment (Real.sqrt c) |
| 82 | ⟨Real.sqrt_nonneg c, Real.sqrt_le_sqrt hcb.le⟩ |
| 83 | have hslice : ContMDiffAt (𝓘(ℝ, ℝ)) (𝓡 n) ∞ |
| 84 | (fun r ↦ H (r, Real.sqrt c)) 0 := |
| 85 | (hH.contMDiffAt (hU.mem_nhds hmem)).comp 0 |
| 86 | (contDiff_id.prodMk contDiff_const).contMDiff.contMDiffAt |
| 87 | have hsource : H (0, Real.sqrt c) ∈ e.source := by |
| 88 | rw [hH0] |
| 89 | exact mem_chart_source Q _ |
| 90 | have hchart : ContMDiffAt (𝓡 n) (𝓡 n) ∞ e (H (0, Real.sqrt c)) := |
| 91 | contMDiffOn_chart.contMDiffAt (e.open_source.mem_nhds hsource) |
| 92 | exact (hchart.comp 0 hslice).contDiffAt |
| 93 | have hcenter : (0, a 0) ∈ N := by |
| 94 | simpa only [hH0, a, lineInteriorCoordinate, zero_smul, add_zero] using h0N |
| 95 | have hdiag : ∀ᶠ r in 𝓝 (0 : ℝ), (r, a r) ∈ N := |
| 96 | (continuousAt_id.prodMk ha.continuousAt).preimage_mem_nhds (hN.mem_nhds hcenter) |
| 97 | refine ⟨{ |
| 98 | family := Φ |
| 99 | domain := Ω |
| 100 | parameters := N |
| 101 | domain_open := hΩ |
| 102 | parameters_open := hN |
| 103 | center_mem := hcenter |
| 104 | segment_mem := hNΩ |
| 105 | smooth := hΦ |
| 106 | target_mem := ?_ |
| 107 | left := ?_ |
| 108 | right := hright |
| 109 | marked := ?_ |
| 110 | recovery := ?_ |
| 111 | coordinate_smooth := ha |
| 112 | diagonal_mem := hdiag |
| 113 | }⟩ |
| 114 | · intro z hz |
| 115 | simpa only [hH0] using (hinfo z hz).1 |
| 116 | · intro r y |
| 117 | exact (hleft r y).trans (A.square_at_zero (Z + r • W)) |
| 118 | · intro r y |
| 119 | simpa only [hH0] using hmarked r y |
| 120 | · intro z hz s hs |
| 121 | simpa only [hH0, H, lineInteriorCoordinate] using hrecovery z hz s hs |
| 122 | |
| 123 | end PoincareMT.ReducedLength |