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 | /- |
| 2 | Provenance and modification notice (recorded 2026-09-29). |
| 3 | Source: https://github.com/qinz1yang/differential-geometry |
| 4 | DifferentialGeometry/Analysis/ODE/Flow/HigherRegularity/VariationalLevelOneWitness.lean |
| 5 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 6 | Changes: Imports, module paths, and namespaces were adapted to the subject-organized PoincareLib library. |
| 7 | License: Apache-2.0. Source licenses and notices are retained under |
| 8 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 9 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 10 | -/ |
| 11 | |
| 12 | /- |
| 13 | Copyright (c) 2026 The DifferentialGeometry contributors. |
| 14 | Released under Apache 2.0 license. |
| 15 | |
| 16 | Adapted from DifferentialGeometry/Analysis/ODE/Flow/HigherRegularity/VariationalLevelOneWitness.lean |
| 17 | at revision 1b535dd102b94cc42b107cca27059687888f08b3. |
| 18 | Original SHA-256: 62234ed518261181075b62e1a0a95bb8807bc00069b130b6b20d5df5fee26b65 |
| 19 | Changes: library paths and namespaces. |
| 20 | -/ |
| 21 | import PoincareLib.Analysis.ODE.LocalFlow.HigherRegularity.VariationalCoproductDerivative |
| 22 | |
| 23 | |
| 24 | noncomputable section |
| 25 | |
| 26 | open Set Function Filter Metric Asymptotics Real |
| 27 | open scoped Topology NNReal |
| 28 | |
| 29 | namespace Poincare.ODE.LocalFlow |
| 30 | |
| 31 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 32 | |
| 33 | attribute [local instance] variationalAugmentedEndNormedAddCommGroup |
| 34 | |
| 35 | section LevelOneFullWitness |
| 36 | |
| 37 | variable {f : ℝ → E → E} {t₀ : ℝ} {x₀ : E} {r : ℝ≥0} {tmin tmax : ℝ} {Φ : E × ℝ → E} |
| 38 | |
| 39 | theorem exists_isVariationalFlowProjection_one_of_C2 |
| 40 | [FiniteDimensional ℝ E] |
| 41 | (hΦ : IsLocalFlow f t₀ x₀ r tmin tmax Φ) |
| 42 | (ht₀_Ioo : t₀ ∈ Ioo tmin tmax) |
| 43 | (hr_pos : (0 : ℝ) < (r : ℝ)) |
| 44 | (hf_C2 : ContDiffOn ℝ 2 (uncurry f) (Set.univ : Set (ℝ × E))) : |
| 45 | ∃ (T : ℝ) (ρ : ℝ≥0) (_hT : 0 < T) (_hρ : 0 < (ρ : ℝ)) |
| 46 | (Y : E × ℝ → (E →L[ℝ] E)), |
| 47 | IsVariationalFlowProjection hΦ T ρ Y 1 := by |
| 48 | classical |
| 49 | obtain ⟨R_aug, ε_aug, hR_aug_pos, hε_aug_pos, aΦ, T_final, ρ_finalN, |
| 50 | hT_final_pos, hρ_final_pos, haΦ, h_Y_smooth⟩ := |
| 51 | exists_isLocalFlow_augmentedVectorField_and_contDiffOn_fromAugFlow_one_of_C2 |
| 52 | hf_C2 t₀ x₀ |
| 53 | have hf_C1 : ContDiffOn ℝ 1 (uncurry f) (Set.univ : Set (ℝ × E)) := by |
| 54 | have h_le : ((1 : ℕ∞) : WithTop ℕ∞) ≤ ((2 : ℕ∞) : WithTop ℕ∞) := by |
| 55 | exact_mod_cast (by decide : (1 : ℕ∞) ≤ 2) |
| 56 | exact hf_C2.of_le h_le |
| 57 | have hR_aug_R : (0 : ℝ) < (R_aug : ℝ) := by |
| 58 | exact_mod_cast hR_aug_pos |
| 59 | have ht₀_a_Ioo : t₀ ∈ Ioo (t₀ - ε_aug) (t₀ + ε_aug) := |
| 60 | ⟨by linarith, by linarith⟩ |
| 61 | obtain ⟨T_help, ρ_help, hT_help_pos, hρ_help_pos, h_help⟩ := |
| 62 | fderiv_Phi_eq_coprod_fromAugFlow_aux (Φ := Φ) hΦ hf_C1 ht₀_Ioo hr_pos haΦ ht₀_a_Ioo hR_aug_R |
| 63 | set T_eff : ℝ := min T_final T_help with hT_eff_def |
| 64 | have hT_eff_pos : 0 < T_eff := lt_min hT_final_pos hT_help_pos |
| 65 | have hT_eff_le_final : T_eff ≤ T_final := min_le_left _ _ |
| 66 | have hT_eff_le_help : T_eff ≤ T_help := min_le_right _ _ |
| 67 | set ρ_eff : ℝ := min (ρ_finalN : ℝ) (ρ_help : ℝ) with hρ_eff_def |
| 68 | have hρ_eff_pos : 0 < ρ_eff := lt_min hρ_final_pos hρ_help_pos |
| 69 | set ρ_effN : ℝ≥0 := ⟨ρ_eff, le_of_lt hρ_eff_pos⟩ |
| 70 | have hρ_effN_eq : (ρ_effN : ℝ) = ρ_eff := rfl |
| 71 | have hρ_eff_le_finalN : ρ_eff ≤ (ρ_finalN : ℝ) := min_le_left _ _ |
| 72 | have hρ_eff_le_help : ρ_eff ≤ (ρ_help : ℝ) := min_le_right _ _ |
| 73 | have hρ_effN_le_finalN : (ρ_effN : ℝ) ≤ (ρ_finalN : ℝ) := by |
| 74 | rw [hρ_effN_eq] |
| 75 | exact hρ_eff_le_finalN |
| 76 | have hρ_effN_le_help : (ρ_effN : ℝ) ≤ (ρ_help : ℝ) := by |
| 77 | rw [hρ_effN_eq] |
| 78 | exact hρ_eff_le_help |
| 79 | have h_eff_sub_smooth : (ball x₀ (ρ_effN : ℝ)) ×ˢ Ioo (t₀ - T_eff) (t₀ + T_eff) |
| 80 | ⊆ (ball x₀ (ρ_finalN : ℝ)) ×ˢ Ioo (t₀ - T_final) (t₀ + T_final) := by |
| 81 | refine Set.prod_mono ?_ ?_ |
| 82 | · intro y hy |
| 83 | rw [mem_ball] at hy ⊢ |
| 84 | exact lt_of_lt_of_le hy hρ_effN_le_finalN |
| 85 | · intro s hs |
| 86 | rcases hs with ⟨h1, h2⟩ |
| 87 | refine ⟨?_, ?_⟩ <;> linarith |
| 88 | have h_eff_sub_help : (ball x₀ (ρ_effN : ℝ)) ×ˢ Ioo (t₀ - T_eff) (t₀ + T_eff) |
| 89 | ⊆ (ball x₀ (ρ_help : ℝ)) ×ˢ Ioo (t₀ - T_help) (t₀ + T_help) := by |
| 90 | refine Set.prod_mono ?_ ?_ |
| 91 | · intro y hy |
| 92 | rw [mem_ball] at hy ⊢ |
| 93 | exact lt_of_lt_of_le hy hρ_effN_le_help |
| 94 | · intro s hs |
| 95 | rcases hs with ⟨h1, h2⟩ |
| 96 | refine ⟨?_, ?_⟩ <;> linarith |
| 97 | refine ⟨T_eff, ρ_effN, hT_eff_pos, hρ_eff_pos, fromAugFlow aΦ, ?_⟩ |
| 98 | refine { contDiffOn := h_Y_smooth.mono h_eff_sub_smooth, fderiv_eq := ?_ } |
| 99 | intro q hq |
| 100 | exact h_help q (h_eff_sub_help hq) |
| 101 | |
| 102 | end LevelOneFullWitness |
| 103 | |
| 104 | end Poincare.ODE.LocalFlow |
| 105 | |
| 106 | end |