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.ConjugateHeat.TestRegularity |
| 2 | import PoincareLib.Geometry.RicciFlow.MetricFamily.Integral |
| 3 | |
| 4 | /-! # Integrability of the actual weak heat pairing on a time slab -/ |
| 5 | |
| 6 | noncomputable section |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open Set Filter MeasureTheory |
| 11 | open scoped Manifold ContDiff Topology |
| 12 | |
| 13 | namespace PoincareMT.RicciFlow.ConjugateHeat |
| 14 | |
| 15 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T3Space M] |
| 16 | [MeasurableSpace M] [BorelSpace M] [SecondCountableTopology M] |
| 17 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 18 | {J : Set ℝ} |
| 19 | |
| 20 | theorem weakPairing_integrable_of_continuousOn |
| 21 | (F : RicciFlow n M J) {α β : ℝ} |
| 22 | (ht : ∀ τ ∈ Icc α β, -τ ∈ interior J) |
| 23 | {u : M × ℝ → ℝ} (hu : ContinuousOn u (univ ×ˢ Icc α β)) |
| 24 | (φ : testFunctions (n := n) (univ ×ˢ Ioo α β)) : |
| 25 | (∀ τ, Integrable (fun x => u (x, τ) * testOperator F φ (x, τ)) |
| 26 | (F.metric (-τ)).volumeMeasure) ∧ |
| 27 | Integrable (fun τ => ∫ x, u (x, τ) * testOperator F φ (x, τ) |
| 28 | ∂(F.metric (-τ)).volumeMeasure) := by |
| 29 | let A := Prod.fst '' tsupport (φ : M × ℝ → ℝ) |
| 30 | have hA : IsCompact A := φ.property.2.1.isCompact.image continuous_fst |
| 31 | let f := fun z : M × ℝ => u z * testOperator F φ z |
| 32 | have hf : ContinuousOn f (univ ×ˢ Icc α β) := hu.mul |
| 33 | ((contMDiffOn_testOperator F φ.property.1).continuousOn.mono |
| 34 | (fun z hz => ⟨mem_univ _, ht z.2 hz.2⟩)) |
| 35 | have hzA (τ : ℝ) (x : M) (hx : x ∉ A) : f (x, τ) = 0 := by |
| 36 | have hs : (x, τ) ∉ tsupport (φ : M × ℝ → ℝ) := |
| 37 | fun h => hx (mem_image_of_mem Prod.fst h) |
| 38 | dsimp only [f] |
| 39 | rw [testOperator_eq_zero_of_notMem_tsupport F hs, mul_zero] |
| 40 | have hzt (τ : ℝ) (hτ : τ ∉ Icc α β) (x : M) : f (x, τ) = 0 := by |
| 41 | have hs : (x, τ) ∉ tsupport (φ : M × ℝ → ℝ) := |
| 42 | fun h => hτ ⟨(φ.property.2.2 h).2.1.le, (φ.property.2.2 h).2.2.le⟩ |
| 43 | dsimp only [f] |
| 44 | rw [testOperator_eq_zero_of_notMem_tsupport F hs, mul_zero] |
| 45 | constructor |
| 46 | · intro τ |
| 47 | by_cases hτ : τ ∈ Icc α β |
| 48 | · have hc : Continuous (fun x => f (x, τ)) := |
| 49 | hf.comp_continuous (continuous_id.prodMk continuous_const) |
| 50 | (fun x => ⟨mem_univ x, hτ⟩) |
| 51 | have hs : Function.support (fun x => f (x, τ)) ⊆ A := by |
| 52 | intro x hx |
| 53 | by_contra hxA |
| 54 | exact hx (hzA τ x hxA) |
| 55 | exact (integrableOn_iff_integrable_of_support_subset hs).mp |
| 56 | (hc.continuousOn.integrableOn_compact hA) |
| 57 | · change Integrable (fun x => f (x, τ)) (F.metric (-τ)).volumeMeasure |
| 58 | rw [show (fun x => f (x, τ)) = (fun _ => (0 : ℝ)) from funext (hzt τ hτ)] |
| 59 | exact integrable_zero _ _ _ |
| 60 | · have hi := F.integrableOn_backward_integral_volumeMeasure_Icc_of_compact_support |
| 61 | ht hA hf (fun τ _ x hx => hzA τ x hx) |
| 62 | apply (integrableOn_iff_integrable_of_support_subset (s := Icc α β) ?_).mp hi |
| 63 | intro τ hτ |
| 64 | by_contra ht' |
| 65 | exact hτ (by simp only [hzt τ ht', integral_zero]) |
| 66 | |
| 67 | /-- A continuous density determines a linear weak heat pairing on the slab; |
| 68 | the required integrability follows from the actual flow and compact tests. -/ |
| 69 | def weakPairingLinearOfContinuousOn |
| 70 | (F : RicciFlow n M J) {α β : ℝ} |
| 71 | (ht : ∀ τ ∈ Icc α β, -τ ∈ interior J) |
| 72 | {u : M × ℝ → ℝ} (hu : ContinuousOn u (univ ×ˢ Icc α β)) : |
| 73 | testFunctions (n := n) ((univ : Set M) ×ˢ Ioo α β) →ₗ[ℝ] ℝ := |
| 74 | weakPairingLinear F u (univ ×ˢ Ioo α β) |
| 75 | (fun φ => (weakPairing_integrable_of_continuousOn F ht hu φ).1) |
| 76 | (fun φ => (weakPairing_integrable_of_continuousOn F ht hu φ).2) |
| 77 | |
| 78 | end PoincareMT.RicciFlow.ConjugateHeat |