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.Minimum.Variation.Frame.Field |
| 2 | import PoincareLib.Analysis.ODE.Uniqueness.Open |
| 3 | |
| 4 | /-! |
| 5 | # Uniqueness of adapted transport |
| 6 | |
| 7 | The coordinate equations are the same linear ODE. Local uniqueness extends |
| 8 | over a preconnected time set; closedness is checked in a chart of the tangent |
| 9 | bundle, so only the Hausdorff coordinate fibers enter the proof. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter Topology |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.ReducedLengthMinimum.Variation.Frame |
| 23 | |
| 24 | open PoincareMT.ReducedLengthMinimum.Variational |
| 25 | open PoincareMT.ReducedLengthMinimum.Variation.Geometry |
| 26 | |
| 27 | private theorem linearODE_eventuallyEq {E : Type*} |
| 28 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 29 | (A : ℝ → E →L[ℝ] E) (f g : ℝ → E) (s : ℝ) |
| 30 | (hA : ContDiffAt ℝ 1 A s) |
| 31 | (hf : ∀ᶠ t in 𝓝 s, HasDerivAt f (A t (f t)) t) |
| 32 | (hg : ∀ᶠ t in 𝓝 s, HasDerivAt g (A t (g t)) t) |
| 33 | (heq : f s = g s) : f =ᶠ[𝓝 s] g := by |
| 34 | let V : ℝ × E → ℝ × E := fun z ↦ (1, A z.1 z.2) |
| 35 | have hV : ContDiffAt ℝ 1 V (s, f s) := |
| 36 | contDiffAt_const.prodMk ((hA.comp _ contDiffAt_fst).clm_apply contDiffAt_snd) |
| 37 | have hf' : ∀ᶠ t in 𝓝 s, |
| 38 | HasDerivAt (fun r ↦ (r, f r)) (V (t, f t)) t := |
| 39 | hf.mono (fun t ht ↦ (hasDerivAt_id t).prodMk ht) |
| 40 | have hg' : ∀ᶠ t in 𝓝 s, |
| 41 | HasDerivAt (fun r ↦ (r, g r)) (V (t, g t)) t := |
| 42 | hg.mono (fun t ht ↦ (hasDerivAt_id t).prodMk ht) |
| 43 | have h := Poincare.ODE.eq_nhds_of_hasDerivAt hV hf' hg' |
| 44 | (congrArg (fun v ↦ (s, v)) heq) |
| 45 | exact h.mono (fun _ ht ↦ congrArg Prod.snd ht) |
| 46 | |
| 47 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 48 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 49 | [IsManifold (𝓡 n) ∞ M] |
| 50 | |
| 51 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 52 | |
| 53 | theorem adaptedField_eventuallyEq {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) |
| 54 | (γ : ℝ → M) (P Q : ∀ t, TangentSpace (𝓡 n) (γ t)) |
| 55 | (U : Set ℝ) (hU : IsOpen U) |
| 56 | (htime : ∀ s ∈ U, s ∈ interior ((fun r : ℝ ↦ T - r ^ 2) ⁻¹' J)) |
| 57 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) ∞ γ U) |
| 58 | (hP : IsAdaptedFieldOn F T γ P U) (hQ : IsAdaptedFieldOn F T γ Q U) |
| 59 | (s₀ : ℝ) (hs₀ : s₀ ∈ U) (heq : P s₀ = Q s₀) : |
| 60 | ∀ᶠ t in 𝓝 s₀, P t = Q t := by |
| 61 | let x := γ s₀ |
| 62 | let D := U ∩ γ ⁻¹' (chartAt E x).source |
| 63 | have hD : IsOpen D := hγ.continuousOn.isOpen_inter_preimage hU (chartAt E x).open_source |
| 64 | have hsD : s₀ ∈ D := ⟨hs₀, mem_chart_source E x⟩ |
| 65 | let y : ℝ → E := fun t ↦ extChartAt (𝓡 n) x (γ t) |
| 66 | have hy : ContDiffOn ℝ ∞ y D := by |
| 67 | apply ContMDiffOn.contDiffOn |
| 68 | exact (contMDiffOn_extChartAt (I := 𝓡 n) (x := x)).comp |
| 69 | (hγ.mono inter_subset_left) (fun s hs ↦ by |
| 70 | simpa only [extChartAt_source, mem_preimage] using hs.2) |
| 71 | have hdy : ContDiffOn ℝ ∞ (deriv y) D := hy.deriv_of_isOpen hD (by simp) |
| 72 | let A : ℝ → E →L[ℝ] E := fun t ↦ |
| 73 | chartTransportOperator (chartActionMetric F T x) (t, y t) (deriv y t) |
| 74 | have hA : ContDiffOn ℝ ∞ A D := |
| 75 | (chartTransportOperator_contDiffOn (chartActionMetric F T x) (chartActionDomain F T x) |
| 76 | (chartActionDomain_open F T x) (chartActionMetric_contDiffOn F T x) |
| 77 | (fun z hz ↦ chartActionMetric_pos F T x hz)).comp |
| 78 | (f := fun t : ℝ ↦ ((t, y t), deriv y t)) |
| 79 | ((contDiffOn_id.prodMk hy).prodMk hdy) (fun t ht ↦ |
| 80 | ⟨⟨htime t ht.1, (extChartAt (𝓡 n) x).map_source (by |
| 81 | simpa only [extChartAt_source, mem_preimage] using ht.2)⟩, mem_univ _⟩) |
| 82 | have hv : ∀ᶠ t in 𝓝 s₀, HasDerivAt (fieldChartCoordinates x γ P) |
| 83 | (A t (fieldChartCoordinates x γ P t)) t := by |
| 84 | filter_upwards [hD.mem_nhds hsD] with t ht |
| 85 | exact hP.equation t ht.1 x ht.2 |
| 86 | have hw : ∀ᶠ t in 𝓝 s₀, HasDerivAt (fieldChartCoordinates x γ Q) |
| 87 | (A t (fieldChartCoordinates x γ Q t)) t := by |
| 88 | filter_upwards [hD.mem_nhds hsD] with t ht |
| 89 | exact hQ.equation t ht.1 x ht.2 |
| 90 | have h₀ : fieldChartCoordinates x γ P s₀ = fieldChartCoordinates x γ Q s₀ := by |
| 91 | simp only [fieldChartCoordinates, heq] |
| 92 | have hsame := linearODE_eventuallyEq A (fieldChartCoordinates x γ P) |
| 93 | (fieldChartCoordinates x γ Q) s₀ |
| 94 | (((hA s₀ hsD).contDiffAt (hD.mem_nhds hsD)).of_le (by simp)) hv hw h₀ |
| 95 | filter_upwards [hD.mem_nhds hsD, hsame] with t ht htw |
| 96 | rw [← chartFrame_fieldChartCoordinates x γ P ht.2, htw, |
| 97 | chartFrame_fieldChartCoordinates x γ Q ht.2] |
| 98 | |
| 99 | theorem adaptedField_eqOn {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) |
| 100 | (γ : ℝ → M) (P Q : ∀ t, TangentSpace (𝓡 n) (γ t)) |
| 101 | (U : Set ℝ) (hU : IsOpen U) (hconn : IsPreconnected U) |
| 102 | (htime : ∀ s ∈ U, s ∈ interior ((fun r : ℝ ↦ T - r ^ 2) ⁻¹' J)) |
| 103 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 n) ∞ γ U) |
| 104 | (hP : IsAdaptedFieldOn F T γ P U) (hQ : IsAdaptedFieldOn F T γ Q U) |
| 105 | (s₀ : ℝ) (hs₀ : s₀ ∈ U) (heq : P s₀ = Q s₀) : ∀ t ∈ U, P t = Q t := by |
| 106 | let G : Set ℝ := {s | ∀ᶠ t in 𝓝 s, P t = Q t} |
| 107 | have hopen : IsOpen G := isOpen_setOfPred_eventually_nhds |
| 108 | have hlocal (t : ℝ) (ht : t ∈ U) (he : P t = Q t) : t ∈ G := |
| 109 | adaptedField_eventuallyEq F T γ P Q U hU htime hγ hP hQ t ht he |
| 110 | have hclosed : closure G ∩ U ⊆ G := by |
| 111 | intro t ht |
| 112 | let x := γ t |
| 113 | let V := U ∩ γ ⁻¹' (chartAt E x).source |
| 114 | have hV : IsOpen V := hγ.continuousOn.isOpen_inter_preimage hU (chartAt E x).open_source |
| 115 | have htV : t ∈ V := ⟨ht.2, mem_chart_source E x⟩ |
| 116 | have hPc := fieldChartCoordinates_smooth x γ P V (hP.smooth.mono inter_subset_left) |
| 117 | (fun _ hr ↦ hr.2) |
| 118 | have hQc := fieldChartCoordinates_smooth x γ Q V (hQ.smooth.mono inter_subset_left) |
| 119 | (fun _ hr ↦ hr.2) |
| 120 | have hfreq : ∃ᶠ r in 𝓝 t, fieldChartCoordinates x γ P r = |
| 121 | fieldChartCoordinates x γ Q r := |
| 122 | (mem_closure_iff_frequently.mp ht.1).mono (fun r hr ↦ by |
| 123 | simp only [fieldChartCoordinates, hr.self_of_nhds]) |
| 124 | have hc := tendsto_nhds_unique_of_frequently_eq |
| 125 | ((hPc t htV).contDiffAt (hV.mem_nhds htV)).continuousAt |
| 126 | ((hQc t htV).contDiffAt (hV.mem_nhds htV)).continuousAt hfreq |
| 127 | apply hlocal t ht.2 |
| 128 | rw [← chartFrame_fieldChartCoordinates x γ P htV.2, hc, |
| 129 | chartFrame_fieldChartCoordinates x γ Q htV.2] |
| 130 | have hall := hconn.subset_of_closure_inter_subset hopen ⟨s₀, hs₀, hlocal s₀ hs₀ heq⟩ hclosed |
| 131 | exact fun t ht ↦ (hall ht).self_of_nhds |
| 132 | |
| 133 | end PoincareMT.ReducedLengthMinimum.Variation.Frame |