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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/SmoothManifoldLocalFlowNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Gauge.Flow.SmoothLocalFlow |
| 6 | import Mathlib.Geometry.Manifold.VectorBundle.Basic |
| 7 | import Mathlib.Geometry.Manifold.ContMDiff.Atlas |
| 8 | |
| 9 | /-! |
| 10 | # Actual smooth local flows in native manifold charts |
| 11 | |
| 12 | The vector field is expressed in a tangent-bundle trivialization, solved |
| 13 | in its finite-dimensional coordinate space, and pulled back through the |
| 14 | inverse chart. No globally trivial tangent bundle is required. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Metric Manifold |
| 20 | open scoped Topology ContDiff |
| 21 | |
| 22 | noncomputable section |
| 23 | |
| 24 | namespace PoincareMT.SmoothManifoldLocalFlowNative |
| 25 | |
| 26 | variable {E M : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 27 | [CompleteSpace E] [FiniteDimensional ℝ E] |
| 28 | [TopologicalSpace M] [ChartedSpace E M] [IsManifold 𝓘(ℝ, E) ∞ M] |
| 29 | |
| 30 | local notation "I" => 𝓘(ℝ, E) |
| 31 | |
| 32 | def coordinateField (V : (x : M) → TangentSpace I x) (p : M) (y : E) : E := |
| 33 | tangentCoordChange I ((extChartAt I p).symm y) p ((extChartAt I p).symm y) |
| 34 | (V ((extChartAt I p).symm y)) |
| 35 | |
| 36 | set_option backward.isDefEq.respectTransparency false in |
| 37 | theorem coordinateField_contDiffOn_of_order {k : ℕ∞} |
| 38 | (V : (x : M) → TangentSpace I x) |
| 39 | (hV : ContMDiff I (ModelWithCorners.prod I 𝓘(ℝ, E)) k |
| 40 | (fun x => (⟨x, V x⟩ : TangentBundle I M))) (p : M) : |
| 41 | ContDiffOn ℝ k (coordinateField V p) (extChartAt I p).target := by |
| 42 | let e := trivializationAt E (TangentSpace I) p |
| 43 | have hcoord : ContMDiffOn I 𝓘(ℝ, E) k |
| 44 | (fun x => (e (⟨x, V x⟩ : TangentBundle I M)).2) e.baseSet := |
| 45 | e.contMDiffOn_section_baseSet_iff.mp hV.contMDiffOn |
| 46 | have hcomp := hcoord.comp (contMDiffOn_extChartAt_symm p) |
| 47 | (show MapsTo (extChartAt I p).symm (extChartAt I p).target e.baseSet by |
| 48 | simpa only [e, TangentBundle.trivializationAt_baseSet, extChartAt_source] using |
| 49 | (extChartAt I p).mapsTo_symm) |
| 50 | apply hcomp.contDiffOn.congr |
| 51 | intro y _ |
| 52 | rfl |
| 53 | |
| 54 | theorem coordinateField_contDiffOn |
| 55 | (V : (x : M) → TangentSpace I x) |
| 56 | (hV : ContMDiff I (ModelWithCorners.prod I 𝓘(ℝ, E)) ∞ |
| 57 | (fun x => (⟨x, V x⟩ : TangentBundle I M))) (p : M) : |
| 58 | ContDiffOn ℝ ∞ (coordinateField V p) (extChartAt I p).target := |
| 59 | coordinateField_contDiffOn_of_order V hV p |
| 60 | |
| 61 | set_option backward.isDefEq.respectTransparency false in |
| 62 | theorem hasMFDerivAt_inverse_chart_curve |
| 63 | {V : (x : M) → TangentSpace I x} {p : M} {u : ℝ → E} {t : ℝ} |
| 64 | (htarget : u t ∈ (extChartAt I p).target) |
| 65 | (hu : HasDerivAt u (coordinateField V p (u t)) t) : |
| 66 | HasMFDerivAt 𝓘(ℝ, ℝ) I ((extChartAt I p).symm ∘ u) t |
| 67 | ((1 : ℝ →L[ℝ] ℝ).smulRight (V ((extChartAt I p).symm (u t)))) := by |
| 68 | let q := (extChartAt I p).symm (u t) |
| 69 | have hqp : q ∈ (extChartAt I p).source := (extChartAt I p).map_target htarget |
| 70 | have hqq : q ∈ (extChartAt I q).source := mem_extChartAt_source q |
| 71 | have hchange : HasFDerivAt ((extChartAt I q) ∘ (extChartAt I p).symm) |
| 72 | (tangentCoordChange I p q q) (u t) := by |
| 73 | have h := hasFDerivWithinAt_tangentCoordChange |
| 74 | (x := p) (y := q) (z := q) ⟨hqp, hqq⟩ |
| 75 | have h' := h.hasFDerivAt (by simp : range I ∈ 𝓝 (extChartAt I p q)) |
| 76 | simpa only [q, (extChartAt I p).right_inv htarget] using h' |
| 77 | have hvelocity : tangentCoordChange I p q q (coordinateField V p (u t)) = V q := by |
| 78 | change tangentCoordChange I p q q (tangentCoordChange I q p q (V q)) = V q |
| 79 | rw [tangentCoordChange_comp ⟨⟨hqq, hqp⟩, hqq⟩, tangentCoordChange_self hqq] |
| 80 | have hderiv := (hchange.comp_hasDerivAt t hu).congr_deriv hvelocity |
| 81 | refine ⟨(continuousAt_extChartAt_symm'' htarget).comp hu.continuousAt, ?_⟩ |
| 82 | simp only [mfld_simps, hasFDerivWithinAt_univ] |
| 83 | simpa [q, extChartAt_coe, extChartAt_coe_symm, Function.comp_def, |
| 84 | ContinuousLinearMap.smulRight_one_eq_toSpanSingleton] using hderiv.hasFDerivAt |
| 85 | |
| 86 | theorem exists_contDiff_local_flow {k : ℕ∞} (hk : k ≠ 0) |
| 87 | (V : (x : M) → TangentSpace I x) |
| 88 | (hV : ContMDiff I (ModelWithCorners.prod I 𝓘(ℝ, E)) k |
| 89 | (fun x => (⟨x, V x⟩ : TangentBundle I M))) (p : M) : |
| 90 | ∃ U : Set M, IsOpen U ∧ p ∈ U ∧ ∃ ε > 0, ∃ α : M × ℝ → M, |
| 91 | (∀ x ∈ U, α (x, 0) = x) ∧ |
| 92 | (∀ x ∈ U, IsMIntegralCurveOn (fun t => α (x, t)) V (Ioo (-ε) ε)) ∧ |
| 93 | ContMDiffOn (ModelWithCorners.prod I 𝓘(ℝ, ℝ)) I k α (U ×ˢ Ioo (-ε) ε) := by |
| 94 | obtain ⟨r, hr, ε, hε, A, hzero, hder, hA⟩ := |
| 95 | SmoothLocalFlowNative.exists_contDiff_confined_local_flow_on hk |
| 96 | (coordinateField V p) (by simpa using (chartAt E p).open_target) |
| 97 | (coordinateField_contDiffOn_of_order V hV p) (extChartAt I p p) |
| 98 | (mem_extChartAt_target p) (extChartAt_target_mem_nhds p) |
| 99 | let U : Set M := (extChartAt I p).source ∩ |
| 100 | (extChartAt I p) ⁻¹' ball (extChartAt I p p) r |
| 101 | have hUo : IsOpen U := by |
| 102 | apply isOpen_iff_mem_nhds.mpr |
| 103 | intro x hx |
| 104 | have hxchart : x ∈ (chartAt E p).source := by |
| 105 | simpa only [extChartAt_source] using hx.1 |
| 106 | have hsource : (extChartAt I p).source ∈ 𝓝 x := by |
| 107 | simpa only [extChartAt_source] using (chartAt E p).open_source.mem_nhds hxchart |
| 108 | exact Filter.inter_mem hsource |
| 109 | ((continuousAt_extChartAt' hx.1).preimage_mem_nhds (isOpen_ball.mem_nhds hx.2)) |
| 110 | have hpU : p ∈ U := ⟨mem_extChartAt_source p, mem_ball_self hr⟩ |
| 111 | let α : M × ℝ → M := fun q => (extChartAt I p).symm (A (extChartAt I p q.1, q.2)) |
| 112 | refine ⟨U, hUo, hpU, ε, hε, α, ?_, ?_, ?_⟩ |
| 113 | · intro x hx |
| 114 | change (extChartAt I p).symm (A (extChartAt I p x, 0)) = x |
| 115 | rw [hzero _ hx.2, (extChartAt I p).left_inv hx.1] |
| 116 | · intro x hx t ht |
| 117 | obtain ⟨hd, htarget⟩ := hder _ hx.2 t ht |
| 118 | exact (hasMFDerivAt_inverse_chart_curve htarget hd).hasMFDerivWithinAt |
| 119 | · have hchart0 : ContMDiffOn I 𝓘(ℝ, E) k (extChartAt I p) |
| 120 | (extChartAt I p).source := by |
| 121 | rw [extChartAt_source] |
| 122 | exact contMDiffOn_extChartAt |
| 123 | have hchart : ContMDiffOn (ModelWithCorners.prod I 𝓘(ℝ, ℝ)) |
| 124 | 𝓘(ℝ, E × ℝ) k |
| 125 | (fun q : M × ℝ => (extChartAt I p q.1, q.2)) (U ×ˢ Ioo (-ε) ε) := by |
| 126 | apply (contMDiffOn_prod_module_iff _).mpr |
| 127 | exact ⟨hchart0.comp contMDiffOn_fst (fun q hq => hq.1.1), contMDiffOn_snd⟩ |
| 128 | have hcoord := hA.contMDiffOn.comp hchart (fun q hq => ⟨hq.1.2, hq.2⟩) |
| 129 | exact (contMDiffOn_extChartAt_symm p).comp hcoord |
| 130 | (fun q hq => (hder _ hq.1.2 _ hq.2).2) |
| 131 | |
| 132 | theorem exists_smooth_local_flow |
| 133 | (V : (x : M) → TangentSpace I x) |
| 134 | (hV : ContMDiff I (ModelWithCorners.prod I 𝓘(ℝ, E)) ∞ |
| 135 | (fun x => (⟨x, V x⟩ : TangentBundle I M))) (p : M) : |
| 136 | ∃ U : Set M, IsOpen U ∧ p ∈ U ∧ ∃ ε > 0, ∃ α : M × ℝ → M, |
| 137 | (∀ x ∈ U, α (x, 0) = x) ∧ |
| 138 | (∀ x ∈ U, IsMIntegralCurveOn (fun t => α (x, t)) V (Ioo (-ε) ε)) ∧ |
| 139 | ContMDiffOn (ModelWithCorners.prod I 𝓘(ℝ, ℝ)) I ∞ α (U ×ˢ Ioo (-ε) ε) := |
| 140 | exists_contDiff_local_flow (by simp) V hV p |
| 141 | |
| 142 | end PoincareMT.SmoothManifoldLocalFlowNative |
| 143 | |
| 144 | end |