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.Calculus.Manifold.OpenSubsetShift |
| 2 | |
| 3 | /-! |
| 4 | # Actual derivatives of shifted spatial curves |
| 5 | |
| 6 | Morgan-Tian Lemma 6.4, pp. 107-108. On its admissible open domain, |
| 7 | the included affine shift has exactly the derivative of the affine |
| 8 | coordinate expression. Its subtype-valued curve retains C1 regularity. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set Filter |
| 14 | open scoped Manifold ContDiff Topology |
| 15 | |
| 16 | namespace TopologicalSpace.Opens |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (U : Opens E) |
| 19 | (u : ℝ → U) (η : ℝ → E) {s v : ℝ} |
| 20 | |
| 21 | /-- An admissible affine shift of a C1 spatial curve remains C1 near |
| 22 | the selected point, the variation construction of Lemma 6.4, |
| 23 | pp. 107-108. -/ |
| 24 | theorem affineShift_curve_contMDiffAt |
| 25 | (hu : ContMDiffAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) 1 u s) |
| 26 | (hη : ContDiffAt ℝ 1 η s) (hshift : (u s).val + v • η s ∈ U) : |
| 27 | ContMDiffAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) 1 (fun t => U.affineShift (u t) (v • η t)) s := by |
| 28 | have hηv : ContMDiffAt (𝓘(ℝ, ℝ)) (𝓘(ℝ, E)) 1 (fun t => v • η t) s := |
| 29 | ((contDiffAt_const (c := v)).smul hη).contMDiffAt |
| 30 | exact (((U.affineShift_contMDiffOn _ hshift).contMDiffAt |
| 31 | (U.affineShift_domain_isOpen.mem_nhds hshift)).of_le (by simp)).comp s (hu.prodMk hηv) |
| 32 | |
| 33 | /-- The actual ambient derivative of an admissible affine spatial |
| 34 | shift is the original derivative plus the shifted test derivative, |
| 35 | Lemma 6.4, pp. 107-108. -/ |
| 36 | theorem affineShift_curve_hasDerivAt |
| 37 | (hu : DifferentiableAt ℝ (fun t => (u t).val) s) |
| 38 | (hη : DifferentiableAt ℝ η s) (hshift : (u s).val + v • η s ∈ U) : |
| 39 | HasDerivAt (fun t => (U.affineShift (u t) (v • η t)).val) |
| 40 | (deriv (fun t => (u t).val) s + v • deriv η s) s := by |
| 41 | have hcont := hu.continuousAt.add (hη.continuousAt.const_smul v) |
| 42 | apply (hu.hasDerivAt.add (hη.hasDerivAt.const_smul v)).congr_of_eventuallyEq |
| 43 | filter_upwards [hcont.preimage_mem_nhds (U.isOpen.mem_nhds hshift)] with t ht |
| 44 | exact U.affineShift_val ht |
| 45 | |
| 46 | end TopologicalSpace.Opens |