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.Calculus.CompactSmoothExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.SmoothParameterPrimitive |
| 3 | |
| 4 | /-! |
| 5 | # Local smoothness of the actual parameter primitive |
| 6 | |
| 7 | An extension near a compact segment agrees on every nearby segment by |
| 8 | compactness. Signed rescaling then identifies the actual primitive germ. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped ContDiff Topology intervalIntegral |
| 14 | open Set Filter |
| 15 | |
| 16 | namespace PoincareMT.ReducedLength |
| 17 | |
| 18 | variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | [FiniteDimensional ℝ E] |
| 20 | |
| 21 | theorem contDiffAt_parameter_primitive (f : E × ℝ → ℝ) |
| 22 | (U : Set (E × ℝ)) (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) |
| 23 | (z0 : E × ℝ) (hsegment : ∀ r ∈ Set.Icc (0 : ℝ) 1, (z0.1, z0.2 * r) ∈ U) : |
| 24 | ContDiffAt ℝ ∞ (fun z : E × ℝ ↦ ∫ s in 0..z.2, f (z.1, s)) z0 := by |
| 25 | let K : Set (E × ℝ) := (fun r : ℝ ↦ (z0.1, z0.2 * r)) '' Set.Icc 0 1 |
| 26 | have hK : IsCompact K := isCompact_Icc.image |
| 27 | (continuous_const.prodMk (continuous_const.mul continuous_id)) |
| 28 | have hKU : K ⊆ U := by |
| 29 | rintro _ ⟨r, hr, rfl⟩ |
| 30 | exact hsegment r hr |
| 31 | obtain ⟨g, V, hg, hV, hKV, _, hgf⟩ := |
| 32 | exists_smooth_extension_near_compact U K hU hK hKU f hf |
| 33 | have hnear : ∀ᶠ z : E × ℝ in 𝓝 z0, |
| 34 | ∀ r ∈ Set.Icc (0 : ℝ) 1, (z.1, z.2 * r) ∈ V := by |
| 35 | apply isCompact_Icc.eventually_forall_of_forall_eventually |
| 36 | intro r hr |
| 37 | have hcont : Continuous (fun w : (E × ℝ) × ℝ ↦ (w.1.1, w.1.2 * w.2)) := |
| 38 | continuous_fst.fst.prodMk (continuous_fst.snd.mul continuous_snd) |
| 39 | exact hcont.continuousAt.preimage_mem_nhds |
| 40 | (hV.mem_nhds (hKV ⟨r, hr, rfl⟩)) |
| 41 | have heq : (fun z : E × ℝ ↦ ∫ s in 0..z.2, f (z.1, s)) =ᶠ[𝓝 z0] |
| 42 | (fun z : E × ℝ ↦ ∫ s in 0..z.2, g (z.1, s)) := by |
| 43 | filter_upwards [hnear] with z hz |
| 44 | rw [integral_zero_to_eq_scaled (fun s ↦ f (z.1, s)) z.2, |
| 45 | integral_zero_to_eq_scaled (fun s ↦ g (z.1, s)) z.2] |
| 46 | congr 1 |
| 47 | apply intervalIntegral.integral_congr |
| 48 | intro r hr |
| 49 | have hr' : r ∈ Set.Icc (0 : ℝ) 1 := by |
| 50 | simpa only [Set.uIcc_of_le zero_le_one] using hr |
| 51 | exact (hgf (hz r hr')).symm |
| 52 | exact (contDiff_parameter_primitive g hg).contDiffAt.congr_of_eventuallyEq heq |
| 53 | |
| 54 | end PoincareMT.ReducedLength |