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.Calculus.LocalLinearTransport |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.SquareChartTransport |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.ChartFieldDerivative |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.CompactFieldExtension |
| 5 | |
| 6 | /-! |
| 7 | # Local adapted fields along an actual smooth curve |
| 8 | |
| 9 | The linear coordinate equation has a radius independent of its initial |
| 10 | vector. Its inverse-chart field has a genuine parametric extension and |
| 11 | obeys the frozen pullback equation. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option maxSynthPendingDepth 3 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.ReducedLength |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 25 | [IsManifold (𝓡 n) ∞ M] |
| 26 | |
| 27 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 28 | |
| 29 | set_option maxHeartbeats 800000 in |
| 30 | -- The construction transports the same field through chart and bundle representations. |
| 31 | set_option backward.isDefEq.respectTransparency false in |
| 32 | theorem exists_uniform_local_adapted_field {J : Set ℝ} (F : RicciFlow n M J) |
| 33 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 34 | (γ : ℝ → M) (U : Set ℝ) (hU : IsOpen U) |
| 35 | (htime : U ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 36 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) (s0 : ℝ) (hs0 : s0 ∈ U) : |
| 37 | ∃ (W : Set ℝ) (d : ℝ), IsOpen W ∧ s0 ∈ W ∧ W ⊆ U ∧ 0 < d ∧ |
| 38 | ∀ t0 ∈ W, ∀ v0 : TangentSpace (𝓡 n) (γ t0), |
| 39 | let I := Set.Ioo (t0 - d) (t0 + d) |
| 40 | ∃ P : ∀ t, TangentSpace (𝓡 n) (γ t), |
| 41 | I ⊆ U ∧ P t0 = v0 ∧ |
| 42 | ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 43 | (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) I ∧ |
| 44 | ∃ H : ParametricAlongCurveExtensionOn (n := n) I γ P, |
| 45 | ∀ t ∈ I, ∀ w : TangentSpace (𝓡 n) (γ t), |
| 46 | (F.metric (T - t ^ 2)).inner (γ t) |
| 47 | (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) γ P I H t) w = |
| 48 | -(2 * t) * (F.connection (T - t ^ 2)).ricci (γ t) (P t) w := by |
| 49 | let p := γ s0 |
| 50 | let e := chartAt E p |
| 51 | let D := U ∩ γ ⁻¹' e.source |
| 52 | have hD : IsOpen D := hγ.continuousOn.isOpen_inter_preimage hU e.open_source |
| 53 | have hsD : s0 ∈ D := ⟨hs0, mem_chart_source E p⟩ |
| 54 | let y : ℝ → E := fun t ↦ e (γ t) |
| 55 | have hy : ContDiffOn ℝ ∞ y D := |
| 56 | (contMDiffOn_chart.comp (hγ.mono Set.inter_subset_left) (fun t ht ↦ ht.2)).contDiffOn |
| 57 | have hdy : ContDiffOn ℝ ∞ (deriv y) D := hy.deriv_of_isOpen hD (by simp) |
| 58 | let S := Set.Ioo (-Real.sqrt b) (Real.sqrt b) ×ˢ e.target |
| 59 | have hS : IsOpen S := isOpen_Ioo.prod e.open_target |
| 60 | have hL := coordinateTransportOperator_contDiffOn (squareChartMetric F T p) S hS |
| 61 | (squareChartMetric_smooth F T b hb hwindow p) |
| 62 | (fun z hz v hv ↦ squareChartMetric_pos F T p z hz.2 v hv) |
| 63 | let A : ℝ → E →L[ℝ] E := fun t ↦ |
| 64 | coordinateTransportOperator (squareChartMetric F T p) (t, y t) (deriv y t) |
| 65 | have hparam : ContDiffOn ℝ ∞ (fun t : ℝ ↦ ((t, y t), deriv y t)) D := |
| 66 | (contDiffOn_id.prodMk hy).prodMk hdy |
| 67 | have hA := hL.comp (f := fun t : ℝ ↦ ((t, y t), deriv y t)) hparam |
| 68 | (fun t ht ↦ ⟨⟨htime ht.1, e.map_source ht.2⟩, Set.mem_univ _⟩) |
| 69 | obtain ⟨W, d, hW, hsW, hWD, hd, hsolve⟩ := |
| 70 | exists_uniform_local_linear_solution D hD A hA s0 hsD |
| 71 | refine ⟨W, d, hW, hsW, hWD.trans Set.inter_subset_left, hd, ?_⟩ |
| 72 | intro t0 ht0 v0 |
| 73 | let I := Set.Ioo (t0 - d) (t0 + d) |
| 74 | let vinit : E := mfderiv (𝓡 n) (𝓡 n) e (γ t0) v0 |
| 75 | obtain ⟨v, hID, hv0, hv, hode⟩ := hsolve t0 ht0 vinit |
| 76 | let P : ∀ t, TangentSpace (𝓡 n) (γ t) := fun t ↦ chartVectorField p (v t) (γ t) |
| 77 | have hIU : I ⊆ U := hID.trans Set.inter_subset_left |
| 78 | have hq : ∀ t ∈ I, γ t ∈ e.source := fun t ht ↦ (hID ht).2 |
| 79 | have hP : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 80 | (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓡 n) M)) I := |
| 81 | (chartVectorField_param_smooth p v I hv).comp |
| 82 | (contMDiffOn_id.prodMk (hγ.mono hIU)) (fun t ht ↦ ⟨ht, hq t ht⟩) |
| 83 | let H : ParametricAlongCurveExtensionOn (n := n) I γ P := |
| 84 | chartFieldExtensionAlong p γ P v I I isOpen_Ioo (Set.Subset.refl I) hv hq |
| 85 | (fun _ _ ↦ rfl) |
| 86 | refine ⟨P, hIU, ?_, hP, H, ?_⟩ |
| 87 | · change chartVectorField p (v t0) (γ t0) = v0 |
| 88 | rw [hv0] |
| 89 | exact chartVectorField_differential p (γ t0) v0 (hWD ht0).2 |
| 90 | · intro t ht w |
| 91 | have hγt : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ t := |
| 92 | (hγ.contMDiffAt (hU.mem_nhds (hIU ht))).mdifferentiableAt (by simp) |
| 93 | have hyt : HasDerivAt y (deriv y t) t := |
| 94 | ((hy.contDiffAt (hD.mem_nhds (hID ht))).differentiableAt (by simp)).hasDerivAt |
| 95 | have hvelocity : curveVelocityWithin (n := n) γ I t = |
| 96 | chartVectorField p (deriv y t) (γ t) := by |
| 97 | unfold curveVelocityWithin |
| 98 | rw [mfderivWithin_eq_mfderiv (isOpen_Ioo.uniqueMDiffWithinAt ht) hγt] |
| 99 | exact (chartVectorField_coordinate_velocity p γ t (deriv y t) (hq t ht) hγt hyt).symm |
| 100 | have hpull := chartFieldExtensionAlong_pullback F (fun r ↦ T - r ^ 2) p γ P v I I |
| 101 | isOpen_Ioo (Set.Subset.refl I) hv hq (fun _ _ ↦ rfl) t (A t (v t)) (hode t ht) |
| 102 | change pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) γ P I H t = _ at hpull |
| 103 | rw [hvelocity] at hpull |
| 104 | let wc : E := mfderiv (𝓡 n) (𝓡 n) e (γ t) w |
| 105 | have hw : chartVectorField p wc (γ t) = w := |
| 106 | chartVectorField_differential p (γ t) w (hq t ht) |
| 107 | have hpair := squareChartTransport_pairing F T b hb hwindow p t (htime (hIU ht)) |
| 108 | (y t) (e.map_source (hq t ht)) (deriv y t) (v t) wc |
| 109 | dsimp only at hpair |
| 110 | change (F.metric (T - t ^ 2)).inner (e.symm (e (γ t))) _ _ = _ at hpair |
| 111 | rw [e.left_inv (hq t ht), hw] at hpair |
| 112 | rw [hpull] |
| 113 | exact hpair |
| 114 | |
| 115 | end PoincareMT.ReducedLength |