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.ScaledAdaptedField |
| 2 | |
| 3 | /-! # Smooth finite sums of actual fields along a curve -/ |
| 4 | |
| 5 | set_option autoImplicit false |
| 6 | set_option maxSynthPendingDepth 3 |
| 7 | |
| 8 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 9 | open Filter |
| 10 | |
| 11 | universe u v |
| 12 | |
| 13 | namespace PoincareMT.ReducedLength |
| 14 | |
| 15 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 16 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 17 | [IsManifold (𝓡 n) ∞ M] {ι : Type v} [Fintype ι] |
| 18 | |
| 19 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 20 | |
| 21 | set_option backward.isDefEq.respectTransparency false in |
| 22 | theorem field_sum_smooth (α : ℝ → M) |
| 23 | (P : ι → ∀ t, TangentSpace (𝓡 n) (α t)) |
| 24 | (U : Set ℝ) (hU : IsOpen U) |
| 25 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 26 | (hP : ∀ i, ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 27 | (fun t ↦ (⟨α t, P i t⟩ : TangentBundle (𝓡 n) M)) U) : |
| 28 | ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 29 | (fun t ↦ (⟨α t, ∑ i, P i t⟩ : TangentBundle (𝓡 n) M)) U := by |
| 30 | intro s hs |
| 31 | let p := α s |
| 32 | let V := U ∩ α ⁻¹' (chartAt E p).source |
| 33 | have hV : IsOpen V := hα.continuousOn.isOpen_inter_preimage hU (chartAt E p).open_source |
| 34 | have hsV : s ∈ V := ⟨hs, mem_chart_source E p⟩ |
| 35 | let v : ι → ℝ → E := fun i t ↦ mfderiv (𝓡 n) (𝓡 n) (chartAt E p) (α t) (P i t) |
| 36 | have hv (i : ι) : ContDiffOn ℝ ∞ (v i) V := |
| 37 | field_chart_coordinates_smooth p α (P i) V ((hP i).mono Set.inter_subset_left) |
| 38 | (fun _ ht ↦ ht.2) |
| 39 | have hsum : ContDiffOn ℝ ∞ (fun t ↦ ∑ i, v i t) V := |
| 40 | ContDiffOn.sum (fun i _ ↦ hv i) |
| 41 | have hlocal : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 42 | (fun t ↦ (⟨α t, chartVectorField p (∑ i, v i t) (α t)⟩ : TangentBundle (𝓡 n) M)) V := |
| 43 | (chartVectorField_param_smooth p (fun t ↦ ∑ i, v i t) V hsum).comp |
| 44 | (contMDiffOn_id.prodMk (hα.mono Set.inter_subset_left)) (fun _ ht ↦ ⟨ht, ht.2⟩) |
| 45 | apply ((hlocal.contMDiffAt (hV.mem_nhds hsV)).congr_of_eventuallyEq ?_).contMDiffWithinAt |
| 46 | filter_upwards [hV.mem_nhds hsV] with t ht |
| 47 | have heq : chartVectorField p (∑ i, v i t) (α t) = ∑ i, P i t := by |
| 48 | change (mfderiv (𝓡 n) (𝓡 n) (chartAt E p) (α t)).inverse (∑ i, v i t) = _ |
| 49 | rw [map_sum] |
| 50 | exact Finset.sum_congr rfl (fun i _ ↦ chartVectorField_differential p (α t) (P i t) ht.2) |
| 51 | rw [heq] |
| 52 | |
| 53 | end PoincareMT.ReducedLength |