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.LGeometry.Path.PathBasics |
| 2 | import Mathlib.Analysis.Calculus.LocalExtr.Basic |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/VariationPaths.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | /-! |
| 10 | # Admissible slices of an L-variation |
| 11 | |
| 12 | Square-root regularity supplies admissibility of each variation slice. A |
| 13 | minimizing path consequently gives a local minimum of the action for every |
| 14 | fixed-endpoint variation. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.LGeometry |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 27 | [IsManifold (𝓡 n) ∞ M] |
| 28 | |
| 29 | /-- Every slice in the open variation parameter interval is an admissible backward path. -/ |
| 30 | def variationPath {J : Set ℝ} {F : RicciFlow n M J} |
| 31 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 32 | (V : LVariation F T τ₁ τ₂ p) {u : ℝ} (hu : u ∈ V.parameterDomain) : |
| 33 | BackwardTimePath F T τ₁ τ₂ := by |
| 34 | have hmaps : Set.MapsTo (fun τ : ℝ ↦ (Real.sqrt τ, u)) |
| 35 | (Set.Icc τ₁ τ₂) V.squareDomain := by |
| 36 | intro τ hτ |
| 37 | exact V.square_contains |
| 38 | ⟨⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩, hu⟩ |
| 39 | have hagrees (τ : ℝ) (hτ : τ ∈ Set.Icc τ₁ τ₂) : |
| 40 | V.squareFamily (Real.sqrt τ) u = V.family τ u := by |
| 41 | have hnonneg : 0 ≤ τ := p.nonnegative.trans hτ.1 |
| 42 | simpa only [Real.sq_sqrt hnonneg] using V.square_agrees (Real.sqrt τ) |
| 43 | ⟨Real.sqrt_le_sqrt hτ.1, Real.sqrt_le_sqrt hτ.2⟩ u hu |
| 44 | refine { |
| 45 | curve := fun τ ↦ V.family τ u |
| 46 | nonnegative := p.nonnegative |
| 47 | ordered := p.ordered |
| 48 | terminal_mem := p.terminal_mem |
| 49 | time_mem := p.time_mem |
| 50 | continuous := ?_ |
| 51 | regular := ?_ |
| 52 | l_integrable := V.l_integrable u hu } |
| 53 | · exact (V.square_smooth.continuousOn.comp |
| 54 | (Real.continuous_sqrt.prodMk continuous_const).continuousOn hmaps).congr |
| 55 | (fun τ hτ ↦ (hagrees τ hτ).symm) |
| 56 | · have hsqrt : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) 1 Real.sqrt |
| 57 | (Set.Ioo τ₁ τ₂) := by |
| 58 | intro τ hτ |
| 59 | exact (Real.contDiffAt_sqrt |
| 60 | (ne_of_gt (lt_of_le_of_lt p.nonnegative hτ.1))).contMDiffAt.contMDiffWithinAt |
| 61 | exact ((V.square_smooth.of_le (by simp)).comp |
| 62 | (hsqrt.prodMk contMDiffOn_const) (hmaps.mono_left Set.Ioo_subset_Icc_self)).congr |
| 63 | (fun τ hτ ↦ (hagrees τ (Set.Ioo_subset_Icc_self hτ)).symm) |
| 64 | |
| 65 | /-- Along a fixed-endpoint variation, the action of a minimizing path is a local minimum. -/ |
| 66 | theorem isLocalMin_variationLLength {J : Set ℝ} {F : RicciFlow n M J} |
| 67 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 68 | (hmin : IsMinimizingBackwardLPath F T τ₁ τ₂ p) |
| 69 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) : |
| 70 | IsLocalMin (variationLLength V.toLVariation) 0 := by |
| 71 | have hzero : variationLLength V.toLVariation 0 = backwardLLength F T τ₁ τ₂ p.curve := by |
| 72 | have hcurve : (fun τ ↦ V.family τ 0) = p.curve := funext V.at_zero |
| 73 | simp only [variationLLength, hcurve] |
| 74 | change ∀ᶠ u in 𝓝 (0 : ℝ), |
| 75 | variationLLength V.toLVariation 0 ≤ variationLLength V.toLVariation u |
| 76 | refine Filter.eventually_of_mem |
| 77 | (isOpen_Ioo.mem_nhds ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩) ?_ |
| 78 | intro u hu |
| 79 | rw [hzero] |
| 80 | exact hmin (variationPath V.toLVariation hu) (V.fixed_left u hu) (V.fixed_right u hu) |
| 81 | |
| 82 | /-- Any actual first derivative of the fixed-endpoint action vanishes at a minimizer. -/ |
| 83 | theorem hasDerivAt_variationLLength_eq_zero {J : Set ℝ} {F : RicciFlow n M J} |
| 84 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 85 | (hmin : IsMinimizingBackwardLPath F T τ₁ τ₂ p) |
| 86 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) {d : ℝ} |
| 87 | (hd : HasDerivAt (variationLLength V.toLVariation) d 0) : d = 0 := |
| 88 | (isLocalMin_variationLLength hmin V).hasDerivAt_eq_zero hd |
| 89 | |
| 90 | /-- The totalized first derivative vanishes; this statement alone asserts no differentiability. -/ |
| 91 | theorem deriv_variationLLength_eq_zero {J : Set ℝ} {F : RicciFlow n M J} |
| 92 | {T τ₁ τ₂ : ℝ} {p : BackwardTimePath F T τ₁ τ₂} |
| 93 | (hmin : IsMinimizingBackwardLPath F T τ₁ τ₂ p) |
| 94 | (V : FixedEndpointLVariation F T τ₁ τ₂ p) : |
| 95 | deriv (variationLLength V.toLVariation) 0 = 0 := |
| 96 | (isLocalMin_variationLLength hmin V).deriv_eq_zero |
| 97 | |
| 98 | end PoincareMT.LGeometry |