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.Pinching.Parabolic |
| 2 | import PoincareLib.Analysis.ODE.ParameterExistence |
| 3 | import Mathlib.Algebra.Star.Module |
| 4 | |
| 5 | /-! |
| 6 | # Supporting functionals for the Hamilton-Ivey reaction |
| 7 | |
| 8 | Short symmetric reaction trajectories and carrier scaling give the inward |
| 9 | support inequality for the fixed carrier at time zero. |
| 10 | |
| 11 | Reference: Morgan--Tian, Theorem 4.8, p. 66; Claims 4.30--4.31, pp. 78--79. |
| 12 | -/ |
| 13 | |
| 14 | namespace Poincare.HamiltonIvey |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Topology ContDiff |
| 22 | |
| 23 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 24 | [FiniteDimensional ℝ E] |
| 25 | |
| 26 | local instance : NormedAddCommGroup (E →L[ℝ] E) := |
| 27 | ContinuousLinearMap.toNormedAddCommGroup |
| 28 | local instance : NormedSpace ℝ (E →L[ℝ] E) := ContinuousLinearMap.toNormedSpace |
| 29 | local instance : TopologicalSpace (E →L[ℝ] E) := |
| 30 | (inferInstance : MetricSpace (E →L[ℝ] E)).toUniformSpace.toTopologicalSpace |
| 31 | local instance : AddCommGroup (E →L[ℝ] E) := |
| 32 | (inferInstance : NormedAddCommGroup (E →L[ℝ] E)).toAddCommGroup |
| 33 | local instance : Module ℝ (E →L[ℝ] E) := |
| 34 | (inferInstance : NormedSpace ℝ (E →L[ℝ] E)).toModule |
| 35 | |
| 36 | private theorem endomorphismReaction_symmetric {A : E →ₗ[ℝ] E} |
| 37 | (hA : A.IsSymmetric) : (endomorphismReaction A).IsSymmetric := by |
| 38 | unfold endomorphismReaction |
| 39 | rw [← Nat.cast_smul_eq_nsmul ℝ] |
| 40 | exact ((hA.mul_of_commute hA (Commute.refl A)).smul (by simp) |>.sub |
| 41 | (hA.smul (by simp))).add (LinearMap.IsSymmetric.one.smul (by simp)) |
| 42 | |
| 43 | private theorem exists_symmetric_reaction_curve |
| 44 | {A : E →L[ℝ] E} (hA : A.toLinearMap.IsSymmetric) : |
| 45 | ∃ ε : ℝ, 0 < ε ∧ ∃ γ : ℝ → E →L[ℝ] E, |
| 46 | γ 0 = A ∧ |
| 47 | (∀ t, (γ t).toLinearMap.IsSymmetric) ∧ |
| 48 | ∀ t ∈ Icc (-ε) ε, HasDerivWithinAt γ |
| 49 | (endomorphismReaction (γ t).toLinearMap).toContinuousLinearMap (Icc (-ε) ε) t := by |
| 50 | let : CompleteSpace E := FiniteDimensional.complete ℝ E |
| 51 | let S := ↥(selfAdjoint.submodule ℝ (E →L[ℝ] E)) |
| 52 | let ι : S →L[ℝ] (E →L[ℝ] E) := (selfAdjoint.submodule ℝ (E →L[ℝ] E)).subtypeL |
| 53 | let π : (E →L[ℝ] E) →L[ℝ] S := |
| 54 | (show (E →L[ℝ] E) →ₗ[ℝ] S from selfAdjointPart ℝ).toContinuousLinearMap |
| 55 | let f : S → S := fun B => π (endomorphismReaction (ι B).toLinearMap).toContinuousLinearMap |
| 56 | have hf : ContDiff ℝ 1 f := |
| 57 | (ContinuousLinearMap.contDiff π).comp ((contDiff_continuousEndomorphismReaction.of_le |
| 58 | (show (1 : WithTop ℕ∞) ≤ ∞ by norm_num)).comp ι.contDiff) |
| 59 | have hforget (B : S) : ι (f B) = |
| 60 | (endomorphismReaction (ι B).toLinearMap).toContinuousLinearMap := by |
| 61 | exact (ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr |
| 62 | (endomorphismReaction_symmetric |
| 63 | (ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mp B.property))).coe_selfAdjointPart_apply ℝ |
| 64 | let A₀ : S := ⟨A, ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr hA⟩ |
| 65 | obtain ⟨r, ε, Z, L, hr, hε, hZ, _⟩ := |
| 66 | Poincare.ODE.Parameter.exists_forall_hasDerivWithinAt_lipschitzOnWith_of_contDiffAt |
| 67 | (hf.contDiffAt (x := A₀)) (U := univ) (Filter.univ_mem) |
| 68 | obtain ⟨hZ₀, hd, _⟩ := hZ A₀ (Metric.mem_closedBall_self hr.le) |
| 69 | refine ⟨ε, hε, fun t => ι (Z A₀ t), ?_, ?_, ?_⟩ |
| 70 | · simp only [hZ₀] |
| 71 | rfl |
| 72 | · intro t |
| 73 | exact ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mp (Z A₀ t).property |
| 74 | · intro t ht |
| 75 | convert! ι.hasFDerivAt.comp_hasDerivWithinAt t (hd t ht) using 1 |
| 76 | exact (hforget _).symm |
| 77 | |
| 78 | /-- The scaled reaction points into every supporting half-space of the fixed carrier. -/ |
| 79 | theorem scaled_reaction_support_nonpos |
| 80 | (hn : Module.finrank ℝ E = 3) {t : ℝ} (ht : 0 ≤ t) |
| 81 | {A : E →L[ℝ] E} (hA : A ∈ continuousRegion hn 0) |
| 82 | (l : (E →L[ℝ] E) →L[ℝ] ℝ) |
| 83 | (hsupport : ∀ B ∈ continuousRegion hn 0, l (B - A) ≤ 0) : |
| 84 | l ((1 + t)⁻¹ • (A + (endomorphismReaction A.toLinearMap).toContinuousLinearMap)) ≤ 0 := by |
| 85 | obtain ⟨ε, hε, γ, hγ₀, hsymm, hd⟩ := exists_symmetric_reaction_curve hA.1 |
| 86 | have hsub : Icc 0 ε ⊆ Icc (-ε) ε := Icc_subset_Icc (by linarith) le_rfl |
| 87 | have hc : ContinuousOn γ (Icc 0 ε) := |
| 88 | fun s hs => ((hd s (hsub hs)).mono hsub).continuousWithinAt |
| 89 | have hinv : ∀ s ∈ Icc 0 ε, (γ s).toLinearMap ∈ region hn s := by |
| 90 | apply operator_reaction_invariance hn (A := fun s => (γ s).toLinearMap) |
| 91 | (by norm_num) hε.le |
| 92 | (fun v => (ContinuousLinearMap.apply ℝ E v).continuous.comp_continuousOn hc) |
| 93 | (fun s _ => hsymm s) |
| 94 | · intro s hs v |
| 95 | have hds := (hd s (hsub (Ioo_subset_Icc_self hs))).hasDerivAt |
| 96 | (Icc_mem_nhds (by linarith [hs.1]) hs.2) |
| 97 | simpa using hds.clm_apply (hasDerivAt_const s v) |
| 98 | · simpa only [hγ₀] using (mem_continuousRegion hn 0 A).mp hA |
| 99 | have hcarrier : ∀ s ∈ Icc 0 ε, (1 + s) • γ s ∈ continuousRegion hn 0 := by |
| 100 | intro s hs |
| 101 | exact (region_scale_iff hn hs.1 (γ s).toLinearMap).mp (hinv s hs) |
| 102 | have hd₀ : HasDerivAt γ |
| 103 | (endomorphismReaction A.toLinearMap).toContinuousLinearMap 0 := by |
| 104 | simpa only [hγ₀] using |
| 105 | (hd 0 ⟨by linarith, hε.le⟩).hasDerivAt (Icc_mem_nhds (by linarith) hε) |
| 106 | have hscaled : HasDerivAt (fun s => (1 + s) • γ s) |
| 107 | (A + (endomorphismReaction A.toLinearMap).toContinuousLinearMap) 0 := by |
| 108 | convert! |
| 109 | ((hasDerivAt_const 0 (1 : ℝ)).add (hasDerivAt_id 0)).smul hd₀ |
| 110 | using 1 |
| 111 | simp [hγ₀, add_comm] |
| 112 | have hscalar : HasDerivAt (fun s => l ((1 + s) • γ s - A)) |
| 113 | (l (A + (endomorphismReaction A.toLinearMap).toContinuousLinearMap)) 0 := |
| 114 | l.hasFDerivAt.comp_hasDerivAt 0 (hscaled.sub_const A) |
| 115 | have hmax : IsMaxOn (fun s => l ((1 + s) • γ s - A)) (Icc 0 ε) 0 := by |
| 116 | intro s hs |
| 117 | change l ((1 + s) • γ s - A) ≤ l ((1 + 0) • γ 0 - A) |
| 118 | simpa only [add_zero, one_smul, hγ₀, sub_self, map_zero] using |
| 119 | hsupport _ (hcarrier s hs) |
| 120 | have hcone : ε - 0 ∈ posTangentConeAt (Icc (0 : ℝ) ε) 0 := |
| 121 | sub_mem_posTangentConeAt_of_segment_subset |
| 122 | ((convex_Icc 0 ε).segment_subset ⟨le_rfl, hε.le⟩ ⟨hε.le, le_rfl⟩) |
| 123 | have h := hmax.localize.hasFDerivWithinAt_nonpos |
| 124 | hscalar.hasDerivWithinAt.hasFDerivWithinAt hcone |
| 125 | change (ε - 0) * l (A + (endomorphismReaction A.toLinearMap).toContinuousLinearMap) ≤ 0 at h |
| 126 | have hnonpos : l (A + (endomorphismReaction A.toLinearMap).toContinuousLinearMap) ≤ 0 := by |
| 127 | nlinarith |
| 128 | rw [map_smul, smul_eq_mul] |
| 129 | exact mul_nonpos_of_nonneg_of_nonpos (inv_nonneg.mpr (by linarith)) hnonpos |
| 130 | |
| 131 | end |
| 132 | |
| 133 | end Poincare.HamiltonIvey |