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.Generalized.ReducedGeometry.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Second.SecondVariationCoordinates |
| 3 | |
| 4 | /-! |
| 5 | # Actual slice derivatives in the surface formula |
| 6 | |
| 7 | Morgan-Tian Proposition 6.33, pp. 120-121. On an open surface |
| 8 | neighborhood, M08's full coordinate partials agree with actual slice |
| 9 | derivatives. At an interior time the same identities hold with within |
| 10 | time derivatives on the closed or relative parameter set. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | {Ω : Set (ℝ × ℝ)} (hΩ : IsOpen Ω) (q : ℝ × ℝ → E) |
| 22 | (hq : ContDiffOn ℝ ∞ q Ω) {p : ℝ × ℝ} (hp : p ∈ Ω) |
| 23 | (Γ : ℝ × E → E →L[ℝ] E →L[ℝ] E) |
| 24 | |
| 25 | include hΩ hq hp |
| 26 | |
| 27 | /-- The coordinate parameter acceleration is the actual iterated |
| 28 | parameter derivative plus its connection term, Proposition 6.33, |
| 29 | pp. 120-121. -/ |
| 30 | theorem coordinateCovariantU_partialU_eq_slice : |
| 31 | M08.coordinateCovariantU Γ q (M08.coordinatePartialU q) p = |
| 32 | deriv (deriv (fun v => q (p.1, v))) p.2 + |
| 33 | Γ (p.1, q p) (deriv (fun v => q (p.1, v)) p.2) |
| 34 | (deriv (fun v => q (p.1, v)) p.2) := by |
| 35 | have hqd := (hq.contDiffAt (hΩ.mem_nhds hp)).differentiableAt (by simp) |
| 36 | have hY := M08.coordinatePartialU_contDiffOn hΩ q hq |
| 37 | have hYd := (hY.contDiffAt (hΩ.mem_nhds hp)).differentiableAt (by simp) |
| 38 | have hnear : ∀ᶠ v in 𝓝 p.2, (p.1, v) ∈ Ω := |
| 39 | (continuous_const.prodMk continuous_id).continuousAt.preimage_mem_nhds (hΩ.mem_nhds hp) |
| 40 | have heq : (fun v => M08.coordinatePartialU q (p.1, v)) =ᶠ[𝓝 p.2] |
| 41 | deriv (fun v => q (p.1, v)) := by |
| 42 | filter_upwards [hnear] with v hv |
| 43 | exact (M08.coordinateSlice_snd_hasDerivAt q |
| 44 | ((hq.contDiffAt (hΩ.mem_nhds hv)).differentiableAt (by simp))).deriv.symm |
| 45 | change fderiv ℝ (M08.coordinatePartialU q) p (0, 1) + |
| 46 | Γ (p.1, q p) (fderiv ℝ q p (0, 1)) (fderiv ℝ q p (0, 1)) = _ |
| 47 | rw [← (M08.coordinateSlice_snd_hasDerivAt _ hYd).deriv, heq.deriv_eq, |
| 48 | ← (M08.coordinateSlice_snd_hasDerivAt q hqd).deriv] |
| 49 | |
| 50 | /-- The covariant time derivative of the parameter partial uses |
| 51 | its actual mixed slice derivative, also written within any time |
| 52 | neighborhood, Proposition 6.33, pp. 120-121. -/ |
| 53 | theorem coordinateCovariantS_partialU_eq_slice {S : Set ℝ} (hS : S ∈ 𝓝 p.1) : |
| 54 | M08.coordinateCovariantS Γ q (M08.coordinatePartialU q) p = |
| 55 | derivWithin (fun r => deriv (fun v => q (r, v)) p.2) S p.1 + |
| 56 | Γ (p.1, q p) (derivWithin (fun r => q (r, p.2)) S p.1) |
| 57 | (deriv (fun v => q (p.1, v)) p.2) := by |
| 58 | have hqd := (hq.contDiffAt (hΩ.mem_nhds hp)).differentiableAt (by simp) |
| 59 | have hY := M08.coordinatePartialU_contDiffOn hΩ q hq |
| 60 | have hYd := (hY.contDiffAt (hΩ.mem_nhds hp)).differentiableAt (by simp) |
| 61 | have hnear : ∀ᶠ r in 𝓝 p.1, (r, p.2) ∈ Ω := |
| 62 | (continuous_id.prodMk continuous_const).continuousAt.preimage_mem_nhds (hΩ.mem_nhds hp) |
| 63 | have heq : (fun r => M08.coordinatePartialU q (r, p.2)) =ᶠ[𝓝 p.1] |
| 64 | (fun r => deriv (fun v => q (r, v)) p.2) := by |
| 65 | filter_upwards [hnear] with r hr |
| 66 | exact (M08.coordinateSlice_snd_hasDerivAt q |
| 67 | ((hq.contDiffAt (hΩ.mem_nhds hr)).differentiableAt (by simp))).deriv.symm |
| 68 | change fderiv ℝ (M08.coordinatePartialU q) p (1, 0) + |
| 69 | Γ (p.1, q p) (fderiv ℝ q p (1, 0)) (fderiv ℝ q p (0, 1)) = _ |
| 70 | rw [← (M08.coordinateSlice_fst_hasDerivAt _ hYd).deriv, heq.deriv_eq, |
| 71 | ← (M08.coordinateSlice_fst_hasDerivAt q hqd).deriv, |
| 72 | ← (M08.coordinateSlice_snd_hasDerivAt q hqd).deriv, |
| 73 | derivWithin_of_mem_nhds hS, derivWithin_of_mem_nhds hS] |
| 74 | |
| 75 | /-- The coordinate base acceleration agrees with the iterated |
| 76 | within time derivative on a time neighborhood, Proposition 6.33, |
| 77 | pp. 120-121. -/ |
| 78 | theorem coordinateCovariantS_partialS_eq_slice {S : Set ℝ} (hS : S ∈ 𝓝 p.1) : |
| 79 | M08.coordinateCovariantS Γ q (M08.coordinatePartialS q) p = |
| 80 | derivWithin (derivWithin (fun r => q (r, p.2)) S) S p.1 + |
| 81 | Γ (p.1, q p) (derivWithin (fun r => q (r, p.2)) S p.1) |
| 82 | (derivWithin (fun r => q (r, p.2)) S p.1) := by |
| 83 | have hqd := (hq.contDiffAt (hΩ.mem_nhds hp)).differentiableAt (by simp) |
| 84 | have hA := M08.coordinatePartialS_contDiffOn hΩ q hq |
| 85 | have hAd := (hA.contDiffAt (hΩ.mem_nhds hp)).differentiableAt (by simp) |
| 86 | have hnear : ∀ᶠ r in 𝓝 p.1, (r, p.2) ∈ Ω := |
| 87 | (continuous_id.prodMk continuous_const).continuousAt.preimage_mem_nhds (hΩ.mem_nhds hp) |
| 88 | have heq : (fun r => M08.coordinatePartialS q (r, p.2)) =ᶠ[𝓝 p.1] |
| 89 | derivWithin (fun r => q (r, p.2)) S := by |
| 90 | filter_upwards [hnear, isOpen_interior.mem_nhds (mem_interior_iff_mem_nhds.mpr hS)] |
| 91 | with r hr hrS |
| 92 | exact (M08.coordinateSlice_fst_hasDerivAt q |
| 93 | ((hq.contDiffAt (hΩ.mem_nhds hr)).differentiableAt (by simp))).deriv.symm.trans |
| 94 | (derivWithin_of_mem_nhds (mem_interior_iff_mem_nhds.mp hrS)).symm |
| 95 | change fderiv ℝ (M08.coordinatePartialS q) p (1, 0) + |
| 96 | Γ (p.1, q p) (fderiv ℝ q p (1, 0)) (fderiv ℝ q p (1, 0)) = _ |
| 97 | rw [← (M08.coordinateSlice_fst_hasDerivAt _ hAd).deriv, heq.deriv_eq, |
| 98 | ← (M08.coordinateSlice_fst_hasDerivAt q hqd).deriv, |
| 99 | derivWithin_of_mem_nhds hS, derivWithin_of_mem_nhds hS] |
| 100 | |
| 101 | end PoincareMT.M14 |