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.Variation.Adapted.LocalAdaptedEquation |
| 2 | |
| 3 | /-! |
| 4 | # Smooth local adapted fields |
| 5 | |
| 6 | Locality supports gluing. Compact restriction constructs a genuine extension |
| 7 | and recovers its actual equation, also at nondegenerate interval endpoints. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | |
| 12 | open scoped Manifold ContDiff Bundle Topology |
| 13 | open Filter |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.ReducedLength |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 21 | [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | structure IsAdaptedFieldOn {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) |
| 24 | (γ : ℝ → M) (P : ∀ t, TangentSpace (𝓡 n) (γ t)) (U : Set ℝ) : Prop where |
| 25 | smooth : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 26 | (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) U |
| 27 | equation : ∀ s ∈ U, LocalAdaptedEquation F T γ P s |
| 28 | |
| 29 | theorem IsAdaptedFieldOn.mono {J : Set ℝ} {F : RicciFlow n M J} {T : ℝ} |
| 30 | {γ : ℝ → M} {P : ∀ t, TangentSpace (𝓡 n) (γ t)} {U V : Set ℝ} |
| 31 | (h : IsAdaptedFieldOn F T γ P U) (hVU : V ⊆ U) : IsAdaptedFieldOn F T γ P V := |
| 32 | ⟨h.smooth.mono hVU, fun s hs ↦ h.equation s (hVU hs)⟩ |
| 33 | |
| 34 | theorem IsAdaptedFieldOn.congr {J : Set ℝ} {F : RicciFlow n M J} {T : ℝ} |
| 35 | {γ : ℝ → M} {P Q : ∀ t, TangentSpace (𝓡 n) (γ t)} {U : Set ℝ} |
| 36 | (h : IsAdaptedFieldOn F T γ P U) (hU : IsOpen U) |
| 37 | (heq : ∀ t ∈ U, P t = Q t) : IsAdaptedFieldOn F T γ Q U := by |
| 38 | refine ⟨h.smooth.congr (fun t ht ↦ ?_), ?_⟩ |
| 39 | · rw [heq t ht] |
| 40 | · intro s hs |
| 41 | apply (h.equation s hs).congr |
| 42 | filter_upwards [hU.mem_nhds hs] with t ht using heq t ht |
| 43 | |
| 44 | theorem IsAdaptedFieldOn.of_locally {J : Set ℝ} {F : RicciFlow n M J} {T : ℝ} |
| 45 | {γ : ℝ → M} {P : ∀ t, TangentSpace (𝓡 n) (γ t)} {U : Set ℝ} |
| 46 | (h : ∀ s ∈ U, ∃ (Q : ∀ t, TangentSpace (𝓡 n) (γ t)) (V : Set ℝ), |
| 47 | IsOpen V ∧ s ∈ V ∧ IsAdaptedFieldOn F T γ Q V ∧ |
| 48 | ∀ᶠ t in 𝓝 s, P t = Q t) : IsAdaptedFieldOn F T γ P U := by |
| 49 | have hp : ∀ s ∈ U, |
| 50 | ContMDiffAt (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 51 | (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) s ∧ |
| 52 | LocalAdaptedEquation F T γ P s := by |
| 53 | intro s hs |
| 54 | obtain ⟨Q, V, hV, hsV, hQ, heq⟩ := h s hs |
| 55 | have he : (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) =ᶠ[𝓝 s] |
| 56 | (fun t ↦ (⟨γ t, Q t⟩ : TangentBundle (𝓡 n) M)) := by |
| 57 | filter_upwards [heq] with t ht |
| 58 | rw [ht] |
| 59 | exact ⟨(hQ.smooth.contMDiffAt (hV.mem_nhds hsV)).congr_of_eventuallyEq he, |
| 60 | (hQ.equation s hsV).congr (heq.mono (fun _ ht ↦ ht.symm))⟩ |
| 61 | exact ⟨fun s hs ↦ (hp s hs).1.contMDiffWithinAt, fun s hs ↦ (hp s hs).2⟩ |
| 62 | |
| 63 | theorem exists_uniform_local_isAdaptedFieldOn {J : Set ℝ} (F : RicciFlow n M J) |
| 64 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 65 | (γ : ℝ → M) (U : Set ℝ) (hU : IsOpen U) |
| 66 | (htime : U ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 67 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) (s0 : ℝ) (hs0 : s0 ∈ U) : |
| 68 | ∃ (W : Set ℝ) (d : ℝ), IsOpen W ∧ s0 ∈ W ∧ W ⊆ U ∧ 0 < d ∧ |
| 69 | ∀ t0 ∈ W, ∀ v0 : TangentSpace (𝓡 n) (γ t0), |
| 70 | ∃ P : ∀ t, TangentSpace (𝓡 n) (γ t), |
| 71 | Set.Ioo (t0 - d) (t0 + d) ⊆ U ∧ P t0 = v0 ∧ |
| 72 | IsAdaptedFieldOn F T γ P (Set.Ioo (t0 - d) (t0 + d)) := by |
| 73 | obtain ⟨W, d, hW, hsW, hWU, hd, hsolve⟩ := |
| 74 | exists_uniform_local_adapted_field F T b hb hwindow γ U hU htime hγ s0 hs0 |
| 75 | refine ⟨W, d, hW, hsW, hWU, hd, ?_⟩ |
| 76 | intro t0 ht0 v0 |
| 77 | obtain ⟨P, hIU, hP0, hP, H, heq⟩ := hsolve t0 ht0 v0 |
| 78 | refine ⟨P, hIU, hP0, hP, ?_⟩ |
| 79 | intro s hs |
| 80 | exact localAdaptedEquation_of_pullback F T b hb hwindow γ P _ _ H |
| 81 | isOpen_Ioo (hγ.mono hIU) hP s hs hs (isOpen_Ioo.uniqueDiffOn s hs) |
| 82 | (htime (hIU hs)) (heq s hs) |
| 83 | |
| 84 | theorem IsAdaptedFieldOn.exists_extension_compact {J : Set ℝ} (F : RicciFlow n M J) |
| 85 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 86 | (γ : ℝ → M) (P : ∀ t, TangentSpace (𝓡 n) (γ t)) |
| 87 | (U K : Set ℝ) (hU : IsOpen U) (hKU : K ⊆ U) (hK : IsCompact K) |
| 88 | (hKd : UniqueDiffOn ℝ K) (htime : K ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 89 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) (hP : IsAdaptedFieldOn F T γ P U) : |
| 90 | ∃ H : ParametricAlongCurveExtensionOn (n := n) K γ P, |
| 91 | ∀ s ∈ K, ∀ w : TangentSpace (𝓡 n) (γ s), |
| 92 | (F.metric (T - s ^ 2)).inner (γ s) |
| 93 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) γ P K H s) w = |
| 94 | -(2 * s) * (F.connection (T - s ^ 2)).ricci (γ s) (P s) w := by |
| 95 | obtain ⟨H⟩ := nonempty_parametricFieldExtensionOn_compact γ P U K hU hKU hK hγ hP.smooth |
| 96 | refine ⟨H, ?_⟩ |
| 97 | intro s hs w |
| 98 | exact pullback_adapted_of_localAdaptedEquation F T b hb hwindow γ P K U H |
| 99 | hU hγ hP.smooth s hs (hKU hs) (hKd s hs) (htime hs) (hP.equation s (hKU hs)) w |
| 100 | |
| 101 | end PoincareMT.ReducedLength |