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.Induction.Schedules.StandardGeometry.CapEndOrientation |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Schedules.StandardGeometry.CapDefiningFunction |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Schedules.StandardGeometry.NeckReflection |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Schedules.StandardGeometry.CapUniformBounds |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Schedules.Constants.ProducerEndpoints |
| 6 | |
| 7 | /-! |
| 8 | # Standard caps in the common intrinsic certificate |
| 9 | |
| 10 | Morgan--Tian Definition 9.72 and Remark 9.73, pp. 230-231, and Section |
| 11 | 15.1.1, p. 354. The selected carrier, closed core, and connection are |
| 12 | unchanged. Exact end reversal fixes orientation; the added unit supplies |
| 13 | every uniform strict analytic bound. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology ENNReal |
| 20 | |
| 21 | namespace PoincareMT.StandardCapNeighborhood |
| 22 | |
| 23 | open M45 |
| 24 | |
| 25 | variable {atlas : StandardCylinderAtlas} {g₀ : StandardInitialMetric} |
| 26 | {F : MaximalStandardCapFlow g₀} {t epsilon C : ℝ} {x : StandardCapSpace} |
| 27 | |
| 28 | /-- The closed-core frontier is the end frontier relative to the actual |
| 29 | open cap carrier. Definition 9.72(3), p. 230. -/ |
| 30 | theorem core_frontier_eq_end (N : StandardCapNeighborhood atlas F t epsilon C x) : |
| 31 | frontier N.closed_core = N.carrier ∩ frontier N.end_neck.patch.carrier := by |
| 32 | rw [N.core_compact.isClosed.frontier_eq, N.closed_core_eq] |
| 33 | simp only [sdiff_eq] |
| 34 | rw [interior_inter, N.carrier_open.interior_eq, interior_compl, |
| 35 | N.end_neck.patch.carrier_open.frontier_eq] |
| 36 | ext y |
| 37 | simp only [mem_sdiff, mem_inter_iff, mem_compl_iff] |
| 38 | tauto |
| 39 | |
| 40 | /-- The supplied Euclidean cap chart is the actual model equivalence. |
| 41 | Definition 9.72(1), p. 230. -/ |
| 42 | noncomputable def euclideanModel (N : StandardCapNeighborhood atlas F t epsilon C x) |
| 43 | (p : RealProjectiveThree) : CapModelEquivalence .euclidean p N.carrier where |
| 44 | model := StandardCapSpace |
| 45 | model_topology := inferInstance |
| 46 | model_charted := inferInstance |
| 47 | model_manifold := inferInstance |
| 48 | standard_model := Homeomorph.ulift.symm |
| 49 | standard_smooth := ⟨Diffeomorph.refl (𝓡 3) StandardCapSpace ∞⟩ |
| 50 | forward := N.ball_inverse |
| 51 | inverse := N.ball_map |
| 52 | inverse_mem := fun y => N.ball_map_range ▸ mem_range_self y |
| 53 | left_inverse := N.ball_map_right_inverse |
| 54 | right_inverse := N.ball_map_left_inverse |
| 55 | forward_smooth := N.ball_inverse_smooth |
| 56 | inverse_smooth := N.ball_map_smooth.contMDiffOn |
| 57 | |
| 58 | /-- Refine the raw standard cap without changing its carrier, core, or |
| 59 | connection. Definition 9.72, pp. 230-231, and Section 15.1.1, p. 354. -/ |
| 60 | theorem exists_refinement (N : StandardCapNeighborhood atlas F t epsilon C x) |
| 61 | (hepsilon : epsilon ≤ 1 / 200) : Nonempty (M45StandardCapRefinement N) := by |
| 62 | classical |
| 63 | obtain ⟨E, hEepsilon, hEconnection, hEcarrier, hEboundary⟩ : |
| 64 | ∃ E : EpsilonNeck (F.metric t), E.epsilon = epsilon ∧ |
| 65 | E.connection = F.connection t ∧ E.carrier = N.end_neck.patch.carrier ∧ |
| 66 | frontier N.closed_core ⊆ closure (E.region (-epsilon⁻¹) (-epsilon⁻¹ / 2)) := by |
| 67 | rcases N.boundary_end_orientation with h | h |
| 68 | · exact ⟨N.end_neck.toEpsilonNeck, rfl, rfl, rfl, h⟩ |
| 69 | · refine ⟨reverseNeck N.end_neck.toEpsilonNeck, rfl, rfl, rfl, ?_⟩ |
| 70 | rw [reverseNeck_region] |
| 71 | simpa only [neg_neg, neg_div] using h |
| 72 | obtain ⟨radius, hradius, hradiusEq, hball, hcompact, bound, hbound, hvolume⟩ := |
| 73 | N.exists_uniform_coreRadii |
| 74 | let p : RealProjectiveThree := Quotient.mk' |
| 75 | (Classical.choice (show Nonempty UnitThreeSphere from |
| 76 | (NormedSpace.sphere_nonempty.mpr (by norm_num : 0 ≤ (1 : ℝ))).coe_sort)) |
| 77 | let cap : CapCertificate (F.metric t) := |
| 78 | { epsilon := epsilon |
| 79 | epsilon_pos := N.epsilon_pos |
| 80 | epsilon_le_threshold := hepsilon |
| 81 | cap_constant := C + 1 |
| 82 | cap_constant_pos := by linarith [N.constant_pos] |
| 83 | carrier := N.carrier |
| 84 | carrier_open := N.carrier_open |
| 85 | closed_core := N.closed_core |
| 86 | closed_core_compact := N.core_compact |
| 87 | core := interior N.closed_core |
| 88 | core_nonempty := ⟨x, N.center_in_core⟩ |
| 89 | core_eq_interior_closed_core := rfl |
| 90 | puncture := p |
| 91 | model_kind := .euclidean |
| 92 | model_equivalence := N.euclideanModel p |
| 93 | connection := F.connection t |
| 94 | end_neck := E |
| 95 | end_neck_epsilon := hEepsilon |
| 96 | end_neck_subset := hEcarrier ▸ N.end_subset |
| 97 | end_neck_connection := hEconnection |
| 98 | closed_core_eq_complement_end := by rw [hEcarrier]; exact N.closed_core_eq |
| 99 | boundary_sphere := frontier N.closed_core |
| 100 | boundary_neck := N.boundary_neck.toEpsilonNeck |
| 101 | boundary_neck_epsilon := rfl |
| 102 | boundary_neck_subset := N.boundary_neck_subset |
| 103 | boundary_neck_connection := rfl |
| 104 | boundary_eq_neck_sphere := N.boundary_sphere |
| 105 | boundary_eq_end_frontier := by rw [hEcarrier]; exact N.core_frontier_eq_end |
| 106 | boundary_subset_negative_end_closure := hEboundary |
| 107 | boundary_subset := by |
| 108 | intro y hy |
| 109 | apply N.boundary_neck_subset |
| 110 | apply N.boundary_neck.toEpsilonNeck.central_sphere_subset |
| 111 | change y ∈ N.boundary_neck.patch.centralSphere |
| 112 | rwa [← N.boundary_sphere] |
| 113 | core_frontier_eq_boundary := rfl |
| 114 | boundary_local_defining_function := fun y hy => |
| 115 | neck_boundary_defining_function N.boundary_neck.toEpsilonNeck |
| 116 | N.core_compact.isClosed ⟨x, N.center_in_core⟩ N.core_ne_univ |
| 117 | N.boundary_sphere N.boundary_neck_subset hy |
| 118 | scalar_pos := N.scalar_pos |
| 119 | intrinsic_diameter_bound := N.intrinsicDiameter_lt_add_one |
| 120 | scalar_ratio := N.scalarRatio_uniform |
| 121 | volume_bound := N.volume_lt_add_one |
| 122 | core_radius := radius |
| 123 | core_radius_pos := hradius |
| 124 | core_radius_eq := hradiusEq |
| 125 | core_ball_subset := hball |
| 126 | core_ball_compact := hcompact |
| 127 | core_ball_volume_lower := ⟨bound, hbound, hvolume⟩ |
| 128 | gradient_bound := N.gradient_uniform |
| 129 | laplacian_bound := N.scalarEvolution_uniform } |
| 130 | exact ⟨⟨cap, rfl, rfl, rfl, rfl, rfl, rfl, N.center_in_core⟩⟩ |
| 131 | |
| 132 | end PoincareMT.StandardCapNeighborhood |
| 133 | |
| 134 | namespace PoincareMT.M45 |
| 135 | |
| 136 | /-- The literal cap-refinement producer used in the M45 calibration. |
| 137 | Definition 9.72 and Remark 9.73, pp. 230-231. -/ |
| 138 | theorem capRefinementProducer : CapRefinementProducer := by |
| 139 | intro atlas g₀ F t epsilon C x hepsilon N |
| 140 | exact N.exists_refinement hepsilon |
| 141 | |
| 142 | end PoincareMT.M45 |