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.Analysis.Parabolic.Interior.CompactSlices |
| 2 | import PoincareLib.Analysis.Parabolic.Interior.Kernel.DuhamelRepresentation |
| 3 | |
| 4 | /-! |
| 5 | # Heat representation of compactly supported smooth functions |
| 6 | |
| 7 | The source is the actual time derivative minus the spatial Laplacian. |
| 8 | Smoothness and compact support supply all regularity assumptions of the |
| 9 | Duhamel identity, including differentiation in the supremum norm. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option maxSynthPendingDepth 3 |
| 16 | |
| 17 | open MeasureTheory Set |
| 18 | open scoped ContDiff Topology |
| 19 | |
| 20 | namespace Poincare.Parabolic.Interior |
| 21 | |
| 22 | variable {V F : Type*} |
| 23 | [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] |
| 24 | [MeasurableSpace V] [BorelSpace V] [Nontrivial V] |
| 25 | [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] |
| 26 | |
| 27 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 28 | /-- The residual for the standard Euclidean heat equation. -/ |
| 29 | def heatResidual (f : V × ℝ → F) (p : V × ℝ) : F := |
| 30 | timeDerivative f p - Kernel.lapEval (spatialDerivative (spatialDerivative f) p) |
| 31 | |
| 32 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 33 | theorem contDiff_heatResidual {f : V × ℝ → F} (hf : ContDiff ℝ ∞ f) : |
| 34 | ContDiff ℝ ∞ (heatResidual f) := |
| 35 | (contDiff_timeDerivative hf).sub ((Kernel.lapEval (V := V) (F := F)).contDiff.comp |
| 36 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf))) |
| 37 | |
| 38 | omit [MeasurableSpace V] [BorelSpace V] [Nontrivial V] [CompleteSpace F] in |
| 39 | theorem hasCompactSupport_heatResidual {f : V × ℝ → F} (hf : HasCompactSupport f) : |
| 40 | HasCompactSupport (heatResidual f) := |
| 41 | (hasCompactSupport_timeDerivative hf).sub |
| 42 | ((hasCompactSupport_spatialDerivative (hasCompactSupport_spatialDerivative hf)).comp_left |
| 43 | (g := Kernel.lapEval) (map_zero _)) |
| 44 | |
| 45 | /-- Duhamel's identity for a smooth compactly supported function with zero |
| 46 | initial data, with no separate regularity or integrability assumptions. -/ |
| 47 | theorem heatDuh_compactSlice_residual {f : V × ℝ → F} |
| 48 | (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) |
| 49 | (hzero : ∀ x, f (x, 0) = 0) {t : ℝ} (ht : 0 < t) (x : V) : |
| 50 | Kernel.heatDuh t |
| 51 | (compactSlice (heatResidual f) (contDiff_heatResidual hf).continuous |
| 52 | (hasCompactSupport_heatResidual hc)) x = f (x, t) := by |
| 53 | let u := compactSlice f hf.continuous hc |
| 54 | let dt := compactSlice (timeDerivative f) (contDiff_timeDerivative hf).continuous |
| 55 | (hasCompactSupport_timeDerivative hc) |
| 56 | let dx := compactSlice (spatialDerivative f) (contDiff_spatialDerivative hf).continuous |
| 57 | (hasCompactSupport_spatialDerivative hc) |
| 58 | let dxx := compactSlice (spatialDerivative (spatialDerivative f)) |
| 59 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf)).continuous |
| 60 | (hasCompactSupport_spatialDerivative (hasCompactSupport_spatialDerivative hc)) |
| 61 | let source := compactSlice (heatResidual f) (contDiff_heatResidual hf).continuous |
| 62 | (hasCompactSupport_heatResidual hc) |
| 63 | have hsource : (fun s => dt s - Kernel.coreLap (dxx s)) = source := by |
| 64 | funext s |
| 65 | ext y |
| 66 | rfl |
| 67 | have hsourceCont : Continuous source := |
| 68 | continuous_compactSlice (contDiff_heatResidual hf) (hasCompactSupport_heatResidual hc) |
| 69 | have hint : IntervalIntegrable (fun s => Kernel.heatScaled (t - s) (source s) x) |
| 70 | volume 0 t := by |
| 71 | apply Continuous.intervalIntegrable |
| 72 | apply continuous_iff_continuousAt.mpr |
| 73 | intro s |
| 74 | exact Kernel.tendsto_heatScaled_of_tendsto |
| 75 | (continuous_const.sub continuous_id).continuousAt hsourceCont.continuousAt x |
| 76 | have h := Kernel.heatDuh_eq_of_zero_initial ht u dt dx dxx |
| 77 | (fun s _ => hasDerivAt_compactSlice hf hc s) |
| 78 | (fun s _ y => hasFDerivAt_spatialSlice (hf.differentiable (by simp)) y s) |
| 79 | (fun s _ y => hasFDerivAt_spatialSlice |
| 80 | ((contDiff_spatialDerivative hf).differentiable (by simp)) y s) |
| 81 | (continuous_compactSlice hf hc) (by ext y; exact hzero y) x |
| 82 | (by simpa only [congrFun hsource] using hint) |
| 83 | simpa only [hsource, u, source, compactSlice_apply] using h |
| 84 | |
| 85 | end Poincare.Parabolic.Interior |