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.Surgery.GlobalSchedule.Global.GlobalAdmissible |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.GlobalSchedule.Global.GlobalExtension |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.GlobalSchedule.Global.GlobalProfileControls |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.GlobalSchedule.Global.GlobalVolumeAssembly |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.Global.ScheduleData |
| 6 | |
| 7 | /-! |
| 8 | # The actual controlled global extension of the input flow |
| 9 | |
| 10 | Use the constructed global flow and its input extension, transport the |
| 11 | finite-prefix controls, and apply the retained volume service and M50 to |
| 12 | this same target. Both source-facing branches use this constructor. |
| 13 | Source: Morgan--Tian Theorem 15.9 and Corollary 15.10, printed pp. 363-366, |
| 14 | and Section 17.2, printed pp. 409-411. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M51.CompletedStageChain |
| 24 | |
| 25 | variable {S : RepairedControlledSchedulesData.{u}} |
| 26 | {N : RepairedNoncollapseInductionData S} |
| 27 | {C : RepairedCanonicalInductionData S N} |
| 28 | {F₀ : SurgeryFlowData.{u}} {k : ℕ} |
| 29 | (Q : CompletedStageChain S N C F₀ k) |
| 30 | (m13 : GeneralizedParabolicRescalingTheory.{u} 3) |
| 31 | (F50 : RepairedFinitePrefixTheory.{u}) |
| 32 | (d : ℝ) (hd : (M51Numerical.schedule S N C).Delta 0 ≤ d) |
| 33 | (losses : ∀ (F : SurgeryFlowData.{u}) (V : RepairedVolumeLossControls F), |
| 34 | F.standard_initial = S.standard_initial → F.local_constants = S.constants → |
| 35 | (∀ t ∈ F.surgery_times, F.parameters.delta t ≤ d) → |
| 36 | Nonempty (RepairedVolumeLossData F V)) |
| 37 | (delta : ℝ → ℝ) |
| 38 | (hdelta : ∀ t, 0 ≤ t → F₀.parameters.delta t = delta t) |
| 39 | (hprofiles : ∀ j t, t ∈ surgeryEpochEntry j → 0 ≤ t → |
| 40 | F₀.parameters.r t = (M51Numerical.schedule S N C).r j ∧ |
| 41 | F₀.parameters.kappa t = (M51Numerical.schedule S N C).kappa j ∧ |
| 42 | F₀.parameters.h t = S.setup.selector.h |
| 43 | (delta t * F₀.parameters.r t) (delta t)) |
| 44 | (hcut : ∀ j t, t ∈ surgeryEpochEntry j → 0 ≤ t → |
| 45 | delta t ≤ (M51Numerical.schedule S N C).Delta j) |
| 46 | |
| 47 | /-- Extend the original flow through the actual completed chain with all global controls. -/ |
| 48 | noncomputable def controlledExtension : |
| 49 | RepairedGlobalControlledExtension (M51Numerical.schedule S N C) F₀ := by |
| 50 | let E := Q.inputExtension m13 |
| 51 | have htarget : E.extended = Q.globalFlow m13 := Q.inputExtension_extended m13 |
| 52 | have hadmissible : SurgeryFlowAdmissible E.extended := by |
| 53 | rw [htarget] |
| 54 | exact Q.globalFlow_admissible m13 |
| 55 | have hpinched : SurgeryFlowPinched E.extended := by |
| 56 | rw [htarget] |
| 57 | exact Q.globalFlow_pinched m13 |
| 58 | have hpolicy : SurgeryFlowTerminalPolicyOn E.extended E.extended.time_domain := by |
| 59 | rw [htarget] |
| 60 | exact Q.globalFlow_terminalPolicy m13 |
| 61 | have hgeometry := Q.profile_controls_of_extensions m13 (Q.globalFlow m13) |
| 62 | (Q.globalExtension m13) (Q.globalExtension_extended m13) |
| 63 | have hcanonical : SurgeryCanonicalAssumption E.extended := by |
| 64 | rw [htarget] |
| 65 | exact hgeometry.1 |
| 66 | have hnoncollapsed : SurgeryNoncollapsed E.extended := by |
| 67 | rw [htarget] |
| 68 | exact hgeometry.2 |
| 69 | have hagreement : ∀ j t, t ∈ surgeryEpochEntry j → t ∈ E.extended.time_domain → |
| 70 | E.extended.parameters.r t = (M51Numerical.schedule S N C).r j ∧ |
| 71 | E.extended.parameters.kappa t = (M51Numerical.schedule S N C).kappa j ∧ |
| 72 | E.extended.parameters.delta t ≤ (M51Numerical.schedule S N C).Delta j ∧ |
| 73 | E.extended.parameters.h t = (M51Numerical.schedule S N C).setup.selector.h |
| 74 | (E.extended.parameters.delta t * E.extended.parameters.r t) |
| 75 | (E.extended.parameters.delta t) := by |
| 76 | intro j t ht htF |
| 77 | have ht0 := E.extended.time_domain_nonnegative htF |
| 78 | have hprofile := hprofiles j t ht ht0 |
| 79 | rw [E.parameters_eq, hdelta t ht0] |
| 80 | exact ⟨hprofile.1, hprofile.2.1, hcut j t ht ht0, hprofile.2.2⟩ |
| 81 | have hstandard : E.extended.standard_initial = S.standard_initial := |
| 82 | E.standard_initial_eq.trans |
| 83 | (((Q.standard_initial_eq 0).symm.trans (Q.standard_initial_setup_eq 0)).trans |
| 84 | S.setup_standard_initial_eq) |
| 85 | have hconstants : E.extended.local_constants = S.constants := |
| 86 | E.local_constants_eq.trans |
| 87 | ((Q.local_constants_eq 0).symm.trans (Q.local_constants_setup_eq 0)) |
| 88 | have volume := selected_global_volume S N C m13 F50 d hd losses E.extended |
| 89 | hstandard hconstants hadmissible hpinched |
| 90 | (fun j t hj ht => (hagreement j t hj ht).2.2.1) |
| 91 | let V := Classical.choose volume |
| 92 | let finite : RepairedFinitePrefixData E.extended |
| 93 | (globalVolumeControls E.extended m13 hadmissible hpinched) V := |
| 94 | Classical.choice (Classical.choose_spec volume) |
| 95 | exact { |
| 96 | extension := E |
| 97 | time_domain_eq := by rw [htarget]; exact Q.globalFlow_time_domain m13 |
| 98 | admissible := hadmissible |
| 99 | terminal_policy := hpolicy |
| 100 | pinched := hpinched |
| 101 | canonical := hcanonical |
| 102 | noncollapsed := hnoncollapsed |
| 103 | schedule_agreement := hagreement |
| 104 | local_finite := finite.local_finite |
| 105 | no_finite_accumulation := fun T _ => finite.no_finite_accumulation T } |
| 106 | |
| 107 | /-- The controlled output retains exactly the constructed extension of the input flow. -/ |
| 108 | theorem controlledExtension_extension : |
| 109 | (Q.controlledExtension m13 F50 d hd losses delta hdelta hprofiles hcut).extension = |
| 110 | Q.inputExtension m13 := rfl |
| 111 | |
| 112 | /-- The controlled output's target is the actual constructed global raw flow. -/ |
| 113 | theorem controlledExtension_extended : |
| 114 | (Q.controlledExtension m13 F50 d hd losses delta hdelta hprofiles hcut).extension.extended = |
| 115 | Q.globalFlow m13 := Q.inputExtension_extended m13 |
| 116 | |
| 117 | end PoincareMT.M51.CompletedStageChain |