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.AdaptedFieldCoordinates |
| 2 | |
| 3 | /-! |
| 4 | # Local coordinates of the adapted equation |
| 5 | |
| 6 | The local predicate is equivalent to the actual pullback equation for any |
| 7 | extension on a domain with unique within derivatives at the point. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option maxSynthPendingDepth 3 |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | open Filter |
| 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 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 25 | |
| 26 | def LocalAdaptedEquation {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) |
| 27 | (γ : ℝ → M) (P : ∀ t, TangentSpace (𝓡 n) (γ t)) (s : ℝ) : Prop := |
| 28 | ∀ p : M, γ s ∈ (chartAt E p).source → |
| 29 | let y : ℝ → E := fun t ↦ (chartAt E p) (γ t) |
| 30 | let v : ℝ → E := fun t ↦ mfderiv (𝓡 n) (𝓡 n) (chartAt E p) (γ t) (P t) |
| 31 | HasDerivAt v (coordinateTransportOperator (squareChartMetric F T p) |
| 32 | (s, y s) (deriv y s) (v s)) s |
| 33 | |
| 34 | theorem localAdaptedEquation_of_pullback {J : Set ℝ} (F : RicciFlow n M J) |
| 35 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 36 | (γ : ℝ → M) (P : ∀ t, TangentSpace (𝓡 n) (γ t)) |
| 37 | (K U : Set ℝ) (H : ParametricAlongCurveExtensionOn (n := n) K γ P) |
| 38 | (hU : IsOpen U) (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) |
| 39 | (hP : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 40 | (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) U) |
| 41 | (s : ℝ) (hs : s ∈ K) (hsU : s ∈ U) (hKd : UniqueDiffWithinAt ℝ K s) |
| 42 | (htime : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 43 | (heq : ∀ w : TangentSpace (𝓡 n) (γ s), |
| 44 | (F.metric (T - s ^ 2)).inner (γ s) |
| 45 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) γ P K H s) w = |
| 46 | -(2 * s) * (F.connection (T - s ^ 2)).ricci (γ s) (P s) w) : |
| 47 | LocalAdaptedEquation F T γ P s := by |
| 48 | intro p hp |
| 49 | let V := U ∩ γ ⁻¹' (chartAt E p).source |
| 50 | have hV : IsOpen V := hγ.continuousOn.isOpen_inter_preimage hU (chartAt E p).open_source |
| 51 | have hq : ∀ t ∈ V, γ t ∈ (chartAt E p).source := fun _ ht ↦ ht.2 |
| 52 | let v : ℝ → E := fun t ↦ mfderiv (𝓡 n) (𝓡 n) (chartAt E p) (γ t) (P t) |
| 53 | have hv := field_chart_coordinates_smooth p γ P V (hP.mono Set.inter_subset_left) hq |
| 54 | exact hasDerivAt_coordinates_of_adapted_equation F T b hb hwindow p γ P K V H |
| 55 | hV (hγ.mono Set.inter_subset_left) hq v hv |
| 56 | (fun t ht ↦ chartVectorField_differential p (γ t) (P t) ht.2.2) |
| 57 | s hs ⟨hsU, hp⟩ hKd htime heq |
| 58 | |
| 59 | set_option maxHeartbeats 800000 in |
| 60 | -- Chart reconstruction identifies the same tangent vectors in all three formulas. |
| 61 | set_option backward.isDefEq.respectTransparency false in |
| 62 | theorem pullback_adapted_of_localAdaptedEquation {J : Set ℝ} (F : RicciFlow n M J) |
| 63 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 64 | (γ : ℝ → M) (P : ∀ t, TangentSpace (𝓡 n) (γ t)) |
| 65 | (K U : Set ℝ) (H : ParametricAlongCurveExtensionOn (n := n) K γ P) |
| 66 | (hU : IsOpen U) (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) |
| 67 | (hP : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 68 | (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) U) |
| 69 | (s : ℝ) (hs : s ∈ K) (hsU : s ∈ U) (hKd : UniqueDiffWithinAt ℝ K s) |
| 70 | (htime : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 71 | (heq : LocalAdaptedEquation F T γ P s) (w : TangentSpace (𝓡 n) (γ s)) : |
| 72 | (F.metric (T - s ^ 2)).inner (γ s) |
| 73 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) γ P K H s) w = |
| 74 | -(2 * s) * (F.connection (T - s ^ 2)).ricci (γ s) (P s) w := by |
| 75 | let p := γ s |
| 76 | let e := chartAt E p |
| 77 | let V := U ∩ γ ⁻¹' e.source |
| 78 | have hV : IsOpen V := hγ.continuousOn.isOpen_inter_preimage hU e.open_source |
| 79 | have hsV : s ∈ V := ⟨hsU, mem_chart_source E p⟩ |
| 80 | have hq : ∀ t ∈ V, γ t ∈ e.source := fun _ ht ↦ ht.2 |
| 81 | let y : ℝ → E := fun t ↦ e (γ t) |
| 82 | let v : ℝ → E := fun t ↦ mfderiv (𝓡 n) (𝓡 n) e (γ t) (P t) |
| 83 | have hv := field_chart_coordinates_smooth p γ P V (hP.mono Set.inter_subset_left) hq |
| 84 | have hvrep : ∀ t ∈ V, chartVectorField p (v t) (γ t) = P t := |
| 85 | fun t ht ↦ chartVectorField_differential p (γ t) (P t) ht.2 |
| 86 | have hpull := pullbackCovariantDerivative_eq_chart F T b hb hwindow p γ P K V H |
| 87 | hV (hγ.mono Set.inter_subset_left) hq v hv (fun t ht ↦ hvrep t ht.2) |
| 88 | s hs hsV hKd htime |
| 89 | have hd : deriv v s = coordinateTransportOperator (squareChartMetric F T p) |
| 90 | (s, y s) (deriv y s) (v s) := (heq p hsV.2).deriv |
| 91 | rw [hd] at hpull |
| 92 | let wc : E := mfderiv (𝓡 n) (𝓡 n) e (γ s) w |
| 93 | have hw : chartVectorField p wc (γ s) = w := |
| 94 | chartVectorField_differential p (γ s) w hsV.2 |
| 95 | have hpair := squareChartTransport_pairing F T b hb hwindow p s htime |
| 96 | (y s) (e.map_source hsV.2) (deriv y s) (v s) wc |
| 97 | have hconn := squareChartConnection_eq F T b hb hwindow p s htime |
| 98 | (y s) (e.map_source hsV.2) (deriv y s) (v s) |
| 99 | dsimp only [y] at hpair hconn |
| 100 | rw [e.left_inv hsV.2] at hpair hconn |
| 101 | rw [← hconn, hw, hvrep s hsV] at hpair |
| 102 | rw [hpull] |
| 103 | change (F.metric (T - s ^ 2)).inner (γ s) |
| 104 | ((mfderiv (𝓡 n) (𝓡 n) e (γ s)).inverse (_ + _)) w = _ |
| 105 | rw [map_add] |
| 106 | exact hpair |
| 107 | |
| 108 | theorem LocalAdaptedEquation.congr {J : Set ℝ} {F : RicciFlow n M J} {T s : ℝ} |
| 109 | {γ : ℝ → M} {P Q : ∀ t, TangentSpace (𝓡 n) (γ t)} |
| 110 | (h : LocalAdaptedEquation F T γ P s) (heq : ∀ᶠ t in 𝓝 s, P t = Q t) : |
| 111 | LocalAdaptedEquation F T γ Q s := by |
| 112 | intro p hp |
| 113 | have hv : (fun t ↦ mfderiv (𝓡 n) (𝓡 n) (chartAt E p) (γ t) (P t)) =ᶠ[𝓝 s] |
| 114 | (fun t ↦ mfderiv (𝓡 n) (𝓡 n) (chartAt E p) (γ t) (Q t)) := by |
| 115 | filter_upwards [heq] with t ht |
| 116 | rw [ht] |
| 117 | have hd := (h p hp).congr_of_eventuallyEq hv.symm |
| 118 | simpa only [hv.eq_of_nhds] using hd |
| 119 | |
| 120 | end PoincareMT.ReducedLength |