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

P-1: linter warnings in Smoothing/Rigidity/Surfaces/Cuts #31
Open
+5 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/BoundaryGraphAttachment.lean View file
| @@ -22,9 +22,11 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||
| 22 | 22 | |
| 23 | 23 | def heightGraph (g : E → F) (x : E) : E × F := (x, g x) |
| 24 | 24 | |
| 25 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] in | |
| 25 | 26 | theorem heightGraph_injective (g : E → F) : Function.Injective (heightGraph g) := |
| 26 | 27 | fun _ _ h ↦ congrArg Prod.fst h |
| 27 | 28 | |
| 29 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] in | |
| 28 | 30 | @[simp] theorem heightGraph_mem_image (g : E → F) (s : Set E) (x : E) : |
| 29 | 31 | heightGraph g x ∈ heightGraph g '' s ↔ x ∈ s := by |
| 30 | 32 | constructor |
| @@ -32,6 +34,7 @@ theorem heightGraph_injective (g : E → F) : Function.Injective (heightGraph g) | ||
| 32 | 34 | exact heightGraph_injective g hyx ▸ hy |
| 33 | 35 | · exact mem_image_of_mem (heightGraph g) |
| 34 | 36 | |
| 37 | +omit [FiniteDimensional ℝ F] in | |
| 35 | 38 | theorem heightGraph_finitePL {g : E → F} {s : Set E} |
| 36 | 39 | (hg : FinitePiecewiseAffineOn g s) : FinitePiecewiseAffineOn (heightGraph g) s := by |
| 37 | 40 | have hid : FinitePiecewiseAffineOn (id : E → E) s := by |
| @@ -58,6 +61,7 @@ theorem graphAttachmentSheet_injective (g : ι → E → F) (k : ι → (E × F) | ||
| 58 | 61 | (i : ι) : Function.Injective (graphAttachmentSheet g k i) := |
| 59 | 62 | (separatedSheet_injective k i).comp (heightGraph_injective (g i)) |
| 60 | 63 | |
| 64 | +omit [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in | |
| 61 | 65 | theorem graphAttachment_projection_image (g : ι → E → F) (k : ι → (E × F) → ℝ) |
| 62 | 66 | (s : Set (E × F)) (u : ι → Set E) : |
| 63 | 67 | (fun p : (E × F) × (ι → ℝ) ↦ p.1.1) '' graphAttachmentCarrier g k s u = |
| @@ -72,6 +76,7 @@ theorem graphAttachment_projection_image (g : ι → E → F) (k : ι → (E × | ||
| 72 | 76 | exact image_id _ |
| 73 | 77 | |
| 74 | 78 | open Classical in |
| 79 | +omit [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in | |
| 75 | 80 | theorem graphAttachment_projection_fiber (g : ι → E → F) (k : ι → (E × F) → ℝ) |
| 76 | 81 | (s : Set (E × F)) (u : ι → Set E) (x : E) : |
| 77 | 82 | graphAttachmentCarrier g k s u ∩ (fun p : (E × F) × (ι → ℝ) ↦ p.1.1) ⁻¹' {x} = |
+3 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/ConnectedRimProjection.lean View file
| @@ -57,6 +57,7 @@ theorem connected_image_unique_closed_piece | ||
| 57 | 57 | |
| 58 | 58 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 59 | 59 | |
| 60 | +omit [FiniteDimensional ℝ E] in | |
| 60 | 61 | theorem OriginalPrimalSectorDecomposition.rim_iUnion |
| 61 | 62 | {d q : Set E} {marks : Fin 4 → E} (C : OriginalPrimalSectorDecomposition d q marks) : |
| 62 | 63 | (⋃ i, C.rim i) = q := by |
| @@ -76,6 +77,7 @@ theorem OriginalPrimalSectorDecomposition.rim_iUnion | ||
| 76 | 77 | · exact mem_iUnion.mpr ⟨2, h⟩ |
| 77 | 78 | · exact mem_iUnion.mpr ⟨3, h⟩ |
| 78 | 79 | |
| 80 | +omit [FiniteDimensional ℝ E] in | |
| 79 | 81 | theorem OriginalPrimalSectorDecomposition.rim_inter_subset_marks |
| 80 | 82 | {d q : Set E} {marks : Fin 4 → E} (C : OriginalPrimalSectorDecomposition d q marks) |
| 81 | 83 | {i j : Fin 4} (hij : i ≠ j) : C.rim i ∩ C.rim j ⊆ range marks := by |
| @@ -89,6 +91,7 @@ theorem OriginalPrimalSectorDecomposition.rim_inter_subset_marks | ||
| 89 | 91 | · have heq := (C.rim_inter_next j).subset ⟨hx.2, hprev ▸ hx.1⟩ |
| 90 | 92 | exact ⟨C.order (j + 1), (show x = marks (C.order (j + 1)) from heq).symm⟩ |
| 91 | 93 | |
| 94 | +omit [FiniteDimensional ℝ E] in | |
| 92 | 95 | theorem OriginalPrimalSectorDecomposition.connected_image_unique_rim |
| 93 | 96 | {X : Type*} [TopologicalSpace X] {d q : Set E} {marks : Fin 4 → E} |
| 94 | 97 | (C : OriginalPrimalSectorDecomposition d q marks) |
+3 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/ExteriorProjectionFibers.lean View file
| @@ -38,6 +38,7 @@ noncomputable def residualQuarterMarks : Set E := | ||
| 38 | 38 | {primalEdgeMark K (complementaryOriginalEdge K P hcofaces s.val) ((B s).ends 0), |
| 39 | 39 | primalEdgeMark K (complementaryOriginalEdge K P hcofaces s.val) ((B s).ends 1)} |
| 40 | 40 | |
| 41 | +omit [Fintype (ResidualComplementaryEdge K P D)] in | |
| 41 | 42 | theorem bridge_not_mem_selectedDual |
| 42 | 43 | (hbound : ∀ t ∈ K.faces, t.card ≤ 3) |
| 43 | 44 | (s : ResidualComplementaryEdge K P D) {x : E} |
| @@ -149,6 +150,7 @@ theorem complementary_bridge_copy_subset_rim | ||
| 149 | 150 | intro x hx |
| 150 | 151 | exact (Set.disjoint_left.mp ((B s).bridge_disjoint_attachment hbound j) hx.1 hx.2).elim |
| 151 | 152 | |
| 153 | +omit [Fintype (ResidualComplementaryEdge K P D)] in | |
| 152 | 154 | theorem residualBridge_inter_primalRim |
| 153 | 155 | (hP : P ≤ K.vertexAbstractComplex.edgeGraph) |
| 154 | 156 | (s : ResidualComplementaryEdge K P D) : |
| @@ -178,6 +180,7 @@ theorem residualBridge_inter_primalRim | ||
| 178 | 180 | change (B s).ends 1 ∈ (complementaryOriginalEdge K P hcofaces s.val).val |
| 179 | 181 | simp [(B s).edge_eq])⟩ |
| 180 | 182 | |
| 183 | +omit [Fintype (ResidualComplementaryEdge K P D)] in | |
| 181 | 184 | theorem residualBridgeUnion_inter_primalRim |
| 182 | 185 | (hP : P ≤ K.vertexAbstractComplex.edgeGraph) : |
| 183 | 186 | residualBridgeUnion K P D hcofaces B ∩ |
+4 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/FiniteSeparatedAttachments.lean View file
| @@ -20,6 +20,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||
| 20 | 20 | {ι : Type*} [Fintype ι] [DecidableEq ι] |
| 21 | 21 | |
| 22 | 22 | open Classical in |
| 23 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 23 | 24 | theorem separatedCarrier_projection_fiber |
| 24 | 25 | (h : ι → E → ℝ) (s : Set E) (u : ι → Set E) (T : Finset ι) (x : E) : |
| 25 | 26 | separatedCarrier h s u T ∩ Prod.fst ⁻¹' {x} = |
| @@ -149,6 +150,7 @@ def separatedSheetActive (T : Finset ι) : Option ι → Prop | ||
| 149 | 150 | | none => True |
| 150 | 151 | | some i => i ∈ T |
| 151 | 152 | |
| 153 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 152 | 154 | theorem mem_separatedCarrier_iff_sheet (h : ι → E → ℝ) |
| 153 | 155 | (s : Set E) (u : ι → Set E) (T : Finset ι) (p : E × (ι → ℝ)) : |
| 154 | 156 | p ∈ separatedCarrier h s u T ↔ |
| @@ -164,6 +166,7 @@ theorem mem_separatedCarrier_iff_sheet (h : ι → E → ℝ) | ||
| 164 | 166 | · exact Or.inl ⟨p.1, hx, hp.symm⟩ |
| 165 | 167 | · exact Or.inr (mem_iUnion₂.mpr ⟨i, hi, p.1, hx, hp.symm⟩) |
| 166 | 168 | |
| 169 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 167 | 170 | /-- A fiber equality is exactly an overlap of two active original source |
| 168 | 171 | pieces at the same original point, including overlaps away from attachments. -/ |
| 169 | 172 | theorem separated_projection_eq_iff_source_overlap (h : ι → E → ℝ) |
| @@ -189,6 +192,7 @@ def separatedSourceProjection (h : ι → E → ℝ) (s : Set E) (u : ι → Set | ||
| 189 | 192 | (p : separatedCarrier h s u T) : ↥(s ∪ ⋃ i ∈ T, u i) := |
| 190 | 193 | ⟨p.val.1, (projection_separatedCarrier h s u T).subset ⟨p.val, p.property, rfl⟩⟩ |
| 191 | 194 | |
| 195 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 192 | 196 | theorem exists_separatedSourceQuotient_homeomorph (h : ι → E → ℝ) |
| 193 | 197 | (s : Set E) (u : ι → Set E) (T : Finset ι) |
| 194 | 198 | (hc : IsCompact (separatedCarrier h s u T)) : |
+2 −2 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalBridgeReversal.lean View file
| @@ -30,7 +30,7 @@ strict scalar directions force the second pair to be the reversal. -/ | ||
| 30 | 30 | theorem endpoint_pair_reversal_of_scalar |
| 31 | 31 | {X : Type*} {Y : Type*} [LinearOrder Y] |
| 32 | 32 | {f : X → Y} {a b c d : X} |
| 33 | - (hab : a ≠ b) (hset : ({c, d} : Set X) = {a, b}) | |
| 33 | + (_hab : a ≠ b) (hset : ({c, d} : Set X) = {a, b}) | |
| 34 | 34 | (hforward : f a < f b) (hreverse : f d < f c) : |
| 35 | 35 | c = b ∧ d = a := by |
| 36 | 36 | rcases Set.pair_eq_pair_iff.mp hset with ⟨hca, hdb⟩ | ⟨hcb, hda⟩ |
| @@ -149,7 +149,7 @@ required source endpoint reversal once the two scalar directions are compared | ||
| 149 | 149 | in the original edge chart. This is the exact interface for the geometric |
| 150 | 150 | sign transport; it does not assume any cyclic alignment. -/ |
| 151 | 151 | theorem source_bridge_endpoint_reversal_of_scalar |
| 152 | - (hbound : ∀ s ∈ K.faces, s.card ≤ 3) (i : Fin 4) | |
| 152 | + (_hbound : ∀ s ∈ K.faces, s.card ≤ 3) (i : Fin 4) | |
| 153 | 153 | (ell : E →ₗ[ℝ] ℝ) |
| 154 | 154 | (hforward : ell (A.sourceMap K P D hD hcofaces hP labels (A.bridgeBegin i)) < |
| 155 | 155 | ell (A.sourceMap K P D hD hcofaces hP labels (A.bridgeEnd i))) |
+1 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalBridgeScalarCharts.lean View file
| @@ -30,7 +30,7 @@ local notation "sm" => A.sourceMap K P D hD hcofaces hP labels | ||
| 30 | 30 | theorem scalar_bridge_chart |
| 31 | 31 | (i : Fin 4) (f : (ℝ × ℝ) → CutSpace) |
| 32 | 32 | (hfPL : FinitePiecewiseAffineOn f (PeriodicSquare.squareCarrier 1)) |
| 33 | - (α β : ℝ) (hα : 0 < α) (hαβ : α < β) (hβ : β < 1) | |
| 33 | + (α β : ℝ) (hα : 0 < α) (_hαβ : α < β) (hβ : β < 1) | |
| 34 | 34 | (himage : (f ∘ unitSquareSide i) '' Icc α β = A.boundaryBridge i) |
| 35 | 35 | (hsourceInj : InjOn (sm ∘ (f ∘ unitSquareSide i)) (Icc α β)) |
| 36 | 36 | (ell : E →L[ℝ] ℝ) |
+4 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalCutCoherentSigns.lean View file
| @@ -96,6 +96,7 @@ private theorem mapped_cross_parity_signed (d : ℝ) (hd : d ≠ 0) (i : Fin 3) | ||
| 96 | 96 | have hn := sign_neg (neg_neg_of_pos h) |
| 97 | 97 | fin_cases i <;> norm_num [orientationSignParity, hn, hp] |
| 98 | 98 | |
| 99 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] in | |
| 99 | 100 | theorem mapped_numbered_boundary_cross_parity [DecidableEq E] |
| 100 | 101 | (number : E → ℕ) (p : Fin 3 → E) |
| 101 | 102 | (hp : Function.Injective p) (hnumber : StrictMono (number ∘ p)) |
| @@ -133,6 +134,7 @@ theorem mapped_numbered_boundary_cross_parity [DecidableEq E] | ||
| 133 | 134 | rw [hcross, mapped_cross_parity_signed _ hd i] |
| 134 | 135 | simp only [Dehn.orderedCofaceParity, hpar, if_neg (not_lt_of_gt hord), add_zero] |
| 135 | 136 | |
| 137 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] in | |
| 136 | 138 | private theorem mapped_numbered_boundary_cross_parity_reverse [DecidableEq E] |
| 137 | 139 | (number : E → ℕ) (p : Fin 3 → E) |
| 138 | 140 | (hp : Function.Injective p) (hnumber : StrictMono (number ∘ p)) |
| @@ -167,6 +169,7 @@ private theorem mapped_numbered_boundary_cross_parity_reverse [DecidableEq E] | ||
| 167 | 169 | linear_combination (norm := ring_nf) hrev |
| 168 | 170 | simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] |
| 169 | 171 | |
| 172 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] in | |
| 170 | 173 | /-- The source numbering, rather than any numbering of image vertices, |
| 171 | 174 | controls the boundary contribution of an affine image triangle. -/ |
| 172 | 175 | theorem mapped_numbered_edge_apex_parity [DecidableEq E] |
| @@ -303,7 +306,7 @@ theorem refined_original_cofaces_cancel [DecidableEq E] | ||
| 303 | 306 | (mul_ne_zero_iff.mp hnS).1 (mul_ne_zero_iff.mp hnS).2, hR, hS] |
| 304 | 307 | have hc := Dehn.orderedCofaceParity_cancellation number T U a b st su hcancel |
| 305 | 308 | linear_combination (norm := ring_nf) hc |
| 306 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] | |
| 309 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 307 | 310 | |
| 308 | 311 | /-- In one original owner chart, injectivity of the complete pair of |
| 309 | 312 | refined cofaces forces their actual edge/apex determinants to be opposite. -/ |
+3 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalHalfBandCofaces.lean View file
| @@ -67,6 +67,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||
| 67 | 67 | (K : SimplicialComplex ℝ E) [Fintype K.faces] |
| 68 | 68 | [Fintype K.barycentricSubdivision.faces] |
| 69 | 69 | |
| 70 | +omit [FiniteDimensional ℝ E] in | |
| 70 | 71 | theorem residualBand_subset_original_cofaces |
| 71 | 72 | (hpure : ∀ s ∈ K.faces, ∃ t ∈ K.faces, s ⊆ t ∧ t.card = 3) |
| 72 | 73 | (hcofaces : ∀ s ∈ K.faces, s.card = 2 → |
| @@ -131,6 +132,7 @@ theorem residualBand_inter_original_edge | ||
| 131 | 132 | (residualBand_halfEdge_passage K e b (by simp [heq])).1, |
| 132 | 133 | ← residualBridge_eq_band_radii K e heq] |
| 133 | 134 | |
| 135 | +omit [FiniteDimensional ℝ E] in | |
| 134 | 136 | theorem OriginalResidualHalfBands.coface_hulls_inter |
| 135 | 137 | {e : Edge K.vertexAbstractComplex.toPreAbstractSimplicialComplex} |
| 136 | 138 | (B : OriginalResidualHalfBands K e) : |
| @@ -156,6 +158,7 @@ theorem OriginalResidualHalfBands.coface_hulls_inter | ||
| 156 | 158 | rw [K.convexHull_inter_convexHull (B.coface 0).property.1 (B.coface 1).property.1, |
| 157 | 159 | ← Finset.coe_inter, ← heq] |
| 158 | 160 | |
| 161 | +omit [FiniteDimensional ℝ E] in | |
| 159 | 162 | theorem residualCofaceContact_subset_original_coface |
| 160 | 163 | (hbound : ∀ s ∈ K.faces, s.card ≤ 3) |
| 161 | 164 | (e : Edge K.vertexAbstractComplex.toPreAbstractSimplicialComplex) |
+3 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalHalfBands.lean View file
| @@ -110,14 +110,17 @@ theorem OriginalResidualHalfBands.attachment_interval (B : OriginalResidualHalfB | ||
| 110 | 110 | residualCofaceContact_exact_interval K hbound hcofaces e B.ends_ne B.edge_eq |
| 111 | 111 | (B.coface i).property.1 (B.coface i).property.2 (B.edge_subset i) |
| 112 | 112 | |
| 113 | +omit [FiniteDimensional ℝ E] in | |
| 113 | 114 | theorem OriginalResidualHalfBands.attachment_subset_rim (B : OriginalResidualHalfBands K e) |
| 114 | 115 | (i : Fin 2) : B.attachment i ⊆ B.rim i := |
| 115 | 116 | (B.coface_outer i).trans subset_union_left |
| 116 | 117 | |
| 118 | +omit [FiniteDimensional ℝ E] in | |
| 117 | 119 | theorem OriginalResidualHalfBands.attachment_subset_piece (B : OriginalResidualHalfBands K e) |
| 118 | 120 | (i : Fin 2) : B.attachment i ⊆ B.piece i := |
| 119 | 121 | (B.attachment_subset_rim i).trans (B.disk i).1 |
| 120 | 122 | |
| 123 | +omit [FiniteDimensional ℝ E] in | |
| 121 | 124 | theorem OriginalResidualHalfBands.piece_subset_band (B : OriginalResidualHalfBands K e) |
| 122 | 125 | (i : Fin 2) : B.piece i ⊆ residualBand K e := by |
| 123 | 126 | fin_cases i |
+2 −2 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalOwnerIntersection.lean View file
| @@ -79,10 +79,10 @@ theorem exists_common_owner_edge | ||
| 79 | 79 | refine ⟨a, b, c, d, hab, hca, hcb, hda, hdb, ?_, ?_, ?_, ?_⟩ |
| 80 | 80 | · rw [hTc.symm] |
| 81 | 81 | ext z |
| 82 | - simp [or_comm, or_left_comm, or_assoc] | |
| 82 | + simp [or_comm, or_left_comm] | |
| 83 | 83 | · rw [hUd.symm] |
| 84 | 84 | ext z |
| 85 | - simp [or_comm, or_left_comm, or_assoc] | |
| 85 | + simp [or_comm, or_left_comm] | |
| 86 | 86 | · rw [← convexHull_pair] |
| 87 | 87 | simpa [hab'] using hx |
| 88 | 88 | · rw [← convexHull_pair] |
+1 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalPeriodicSquareMap.lean View file
| @@ -52,7 +52,7 @@ remaining orientation input is reversal of the actual bridge endpoints. -/ | ||
| 52 | 52 | theorem nonempty_sourceSquareMap_of_source_reversal |
| 53 | 53 | (hrev : ∀ i : Fin 4, sm (A.bridgeBegin (A.arcPairing i)) = |
| 54 | 54 | sm (A.bridgeEnd i)) : Nonempty (SourceSquareMap 1 K) := by |
| 55 | - letI : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ | |
| 55 | + let : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ | |
| 56 | 56 | obtain ⟨C,H,G,e,d,hC,hH,hG,hbottom,htop,hleft,hright⟩ := |
| 57 | 57 | A.exists_matched_original_rectangle hbound hrev |
| 58 | 58 | let Q : Square 1 ≃ₜ A.carrier := (squareCarrierEquiv 1).trans C |
+1 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalPrimalCutDisk.lean View file
| @@ -21,6 +21,7 @@ variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||
| 21 | 21 | [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 22 | 22 | [FiniteDimensional ℝ F] |
| 23 | 23 | |
| 24 | +omit [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in | |
| 24 | 25 | /-- The inverse of a literal projection chart is the graph of its actual |
| 25 | 26 | finite PL second coordinate, with the whole original gap as exact image. -/ |
| 26 | 27 | theorem exists_heightGraph_of_projection_homeomorph |
+1 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalRefinementCoherentSigns.lean View file
| @@ -19,6 +19,7 @@ namespace PoincareMT.M76.OriginalTriangleCopies | ||
| 19 | 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | 20 | [FiniteDimensional ℝ E] [DecidableEq E] |
| 21 | 21 | |
| 22 | +omit [FiniteDimensional ℝ E] in | |
| 22 | 23 | /-- Sorted mapped determinants give cancellation on every adjacent refined |
| 23 | 24 | pair. Both same-owner and different-owner pairs use the actual closed-pair |
| 24 | 25 | injectivity and the original coherent coface signs. -/ |
+7 −3 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalRefinementOrientation.lean View file
| @@ -11,6 +11,7 @@ namespace PoincareMT.M76.OriginalTriangleCopies | ||
| 11 | 11 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 12 | 12 | [FiniteDimensional ℝ E] [DecidableEq E] |
| 13 | 13 | |
| 14 | +omit [FiniteDimensional ℝ E] [DecidableEq E] in | |
| 14 | 15 | theorem charted_refined_triangle_independent |
| 15 | 16 | (L : SimplicialComplex ℝ (ℝ × ℝ)) (F : (ℝ × ℝ) → E) |
| 16 | 17 | (hF : L.AffineOnFaces F) {t : Finset (ℝ × ℝ)} (ht : t ∈ L.faces) |
| @@ -46,6 +47,7 @@ private theorem parity_sum_of_negative_product (x y : ℝ) (h : x * y < 0) : | ||
| 46 | 47 | · rw [sign_neg h.1, sign_pos h.2] |
| 47 | 48 | norm_num [orientationSignParity] |
| 48 | 49 | |
| 50 | +omit [FiniteDimensional ℝ E] [DecidableEq E] in | |
| 49 | 51 | theorem charted_refined_cross_ne_zero |
| 50 | 52 | (L : SimplicialComplex ℝ (ℝ × ℝ)) (F : (ℝ × ℝ) → E) |
| 51 | 53 | (hF : L.AffineOnFaces F) (a b x : ℝ × ℝ) |
| @@ -67,6 +69,7 @@ theorem charted_refined_cross_ne_zero | ||
| 67 | 69 | ![a, b, x] hp himage |
| 68 | 70 | exact planar_triangle_cross_ne_zero _ hind |
| 69 | 71 | |
| 72 | +omit [FiniteDimensional ℝ E] in | |
| 70 | 73 | /-- The original coherent orientation cancels on an actual adjacent refined |
| 71 | 74 | pair, including pairs that cross an original edge. -/ |
| 72 | 75 | theorem charted_refined_cofaces_cancel |
| @@ -124,15 +127,15 @@ theorem charted_refined_cofaces_cancel | ||
| 124 | 127 | have hp := parity_sum_of_negative_product _ _ hpair |
| 125 | 128 | dsimp only [Function.comp_apply] at hp |
| 126 | 129 | linear_combination (norm := ring_nf) hp |
| 127 | - simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero, sub_zero] | |
| 130 | + simp only [show (2 : ZMod 2) = 0 from rfl, mul_zero] | |
| 128 | 131 | · obtain ⟨v, w, c, d, hvw, hcv, hcw, hdv, hdw, hTv, hUv, havw, hbvw⟩ := |
| 129 | 132 | K.exists_common_owner_edge hTf hUf hTc hUc hTU |
| 130 | 133 | (hT haT) (hU haU) (hT hbT) (hU hbU) |
| 131 | 134 | (fun h ↦ hab (hi (Or.inl haT) (Or.inl hbT) h)) |
| 132 | 135 | have hset : ({a, b, x} : Set (ℝ × ℝ)) = {a, x, b} := by |
| 133 | - ext z; simp [or_comm, or_left_comm] | |
| 136 | + ext z; simp [or_comm] | |
| 134 | 137 | have hfin : ({a, b, x} : Finset (ℝ × ℝ)) = {a, x, b} := by |
| 135 | - ext z; simp [or_comm, or_left_comm] | |
| 138 | + ext z; simp [or_comm] | |
| 136 | 139 | have hRn := charted_refined_cross_ne_zero L F hF a b x hab hax hbx |
| 137 | 140 | (hfin.symm ▸ ht) (by rw [hset]; exact hi.mono subset_union_left) |
| 138 | 141 | (charts T) (hcharts T hTf hTc).1 (by rw [hset]; exact hT) |
| @@ -151,6 +154,7 @@ theorem charted_refined_cofaces_cancel | ||
| 151 | 154 | · exact hcancel T hTf U hUf hTc hUc hTU v w hvw |
| 152 | 155 | (by simp [hTv]) (by simp [hUv]) |
| 153 | 156 | /-! Local mod-two transport used after applying concrete affine owner charts. -/ |
| 157 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] in | |
| 154 | 158 | theorem original_refined_pair_cancellation |
| 155 | 159 | (sourceSign : Finset E → ZMod 2) (number : E → ℕ) |
| 156 | 160 | {T U s : Finset E} {a b : E} (hs : s = {a, b}) |
+1 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/OriginalRimEndpoints.lean View file
| @@ -13,6 +13,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||
| 13 | 13 | [FiniteDimensional ℝ E] {d q : Set E} {marks : Fin 4 → E} |
| 14 | 14 | (C : OriginalPrimalSectorDecomposition d q marks) |
| 15 | 15 | |
| 16 | +omit [FiniteDimensional ℝ E] in | |
| 16 | 17 | theorem OriginalPrimalSectorDecomposition.rim_inter_marks (i : Fin 4) : |
| 17 | 18 | C.rim i ∩ range marks = {marks (C.order i), marks (C.order (i + 1))} := by |
| 18 | 19 | apply Subset.antisymm |
+5 −1 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/PrimalRimLiftCoverage.lean View file
| @@ -33,6 +33,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||
| 33 | 33 | (hP : P ≤ K.vertexAbstractComplex.edgeGraph) |
| 34 | 34 | (hbound : ∀ t ∈ K.faces, t.card ≤ 3) |
| 35 | 35 | |
| 36 | +omit [Fintype (ResidualComplementaryEdge K P D)] in | |
| 36 | 37 | private theorem residualBand_primal_contacts |
| 37 | 38 | (s : ResidualComplementaryEdge K P D) {x : E} |
| 38 | 39 | (hx : x ∈ residualBand K (complementaryOriginalEdge K P hcofaces s.val)) |
| @@ -51,6 +52,7 @@ private theorem residualBand_primal_contacts | ||
| 51 | 52 | |
| 52 | 53 | include hbound |
| 53 | 54 | |
| 55 | +omit [Fintype (ResidualComplementaryEdge K P D)] in | |
| 54 | 56 | theorem complementary_attachment_primal_contact |
| 55 | 57 | (i : ResidualHalfBandIndex K P D) {x : E} |
| 56 | 58 | (hx : x ∈ (B i.1).attachment i.2) |
| @@ -72,6 +74,7 @@ theorem complementary_attachment_primal_contact | ||
| 72 | 74 | · exact Or.inl (hcorner 0 ha) |
| 73 | 75 | · exact Or.inr (hcorner 1 hb) |
| 74 | 76 | |
| 77 | +omit [Fintype (ResidualComplementaryEdge K P D)] in | |
| 75 | 78 | private theorem selectedDual_inter_primal_subset_rim {x : E} |
| 76 | 79 | (hxD : x ∈ K.barycentricSubdivision.vertexDualUnion |
| 77 | 80 | (selectedDualCentroidSet K P D hD hcofaces)) |
| @@ -137,6 +140,7 @@ theorem exteriorGap_projection_subset_primalRim | ||
| 137 | 140 | exact ⟨z,⟨C.gap_subset i hzg,fun hc => Set.disjoint_left.mp |
| 138 | 141 | (exteriorGapInterior_disjoint_copies K P D hD hcofaces B h labels C i) hzint hc⟩,rfl⟩ |
| 139 | 142 | |
| 143 | +omit hbound [Fintype (ResidualComplementaryEdge K P D)] in | |
| 140 | 144 | private theorem copiedBridge_over_primalRim_is_endpoint |
| 141 | 145 | (k : Fin 4) {z : E × (ResidualHalfBandIndex K P D → ℝ)} |
| 142 | 146 | (hzB : z ∈ exteriorCopiedBridge K P D hcofaces B h (exteriorFourIndex K P D labels k)) |
| @@ -164,7 +168,7 @@ theorem complementaryCut_over_primalRim_eq_gaps | ||
| 164 | 168 | hP hbound hz hzlift |
| 165 | 169 | rcases C.gaps_cover.symm.subset hzr with ⟨k,hzk⟩ | ⟨i,hzi⟩ |
| 166 | 170 | · have hends := copiedBridge_over_primalRim_is_endpoint K P D hcofaces B h |
| 167 | - hP hbound labels k hzk hzlift.2 | |
| 171 | + hP labels k hzk hzlift.2 | |
| 168 | 172 | have hp := C.bridge_endpoints (C.bridgeOrder.symm k) |
| 169 | 173 | rw [C.bridgeOrder.apply_symm_apply k] at hp |
| 170 | 174 | have hends' := hp.symm.subset hends |
+10 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/PrimalSectorAttachmentFibers.lean View file
| @@ -24,6 +24,7 @@ namespace OriginalPrimalSectorDecomposition | ||
| 24 | 24 | |
| 25 | 25 | variable (C : OriginalPrimalSectorDecomposition d q marks) |
| 26 | 26 | |
| 27 | +omit [FiniteDimensional ℝ E] in | |
| 27 | 28 | theorem sector_subset (i : Fin 4) : C.sector i ⊆ d := by |
| 28 | 29 | intro x hx |
| 29 | 30 | apply C.sector_cover.subset |
| @@ -33,23 +34,29 @@ theorem sector_subset (i : Fin 4) : C.sector i ⊆ d := by | ||
| 33 | 34 | · exact Or.inr (Or.inl hx) |
| 34 | 35 | · exact Or.inr (Or.inr hx) |
| 35 | 36 | |
| 37 | +omit [FiniteDimensional ℝ E] in | |
| 36 | 38 | theorem rim_subset (i : Fin 4) : C.rim i ⊆ q := |
| 37 | 39 | (C.sector_rim i).symm.subset.trans inter_subset_right |
| 38 | 40 | |
| 41 | +omit [FiniteDimensional ℝ E] in | |
| 39 | 42 | theorem center_mem_spoke (i : Fin 4) : C.center ∈ C.spoke i := |
| 40 | 43 | (C.spoke_ball i).1 (Or.inl rfl) |
| 41 | 44 | |
| 45 | +omit [FiniteDimensional ℝ E] in | |
| 42 | 46 | theorem spoke_subset_sector (i : Fin 4) : C.spoke i ⊆ C.sector i := |
| 43 | 47 | (subset_union_left.trans subset_union_right).trans (C.sector_ball i).1 |
| 44 | 48 | |
| 49 | +omit [FiniteDimensional ℝ E] in | |
| 45 | 50 | theorem center_mem_sector (i : Fin 4) : C.center ∈ C.sector i := |
| 46 | 51 | C.spoke_subset_sector i (C.center_mem_spoke i) |
| 47 | 52 | |
| 53 | +omit [FiniteDimensional ℝ E] in | |
| 48 | 54 | theorem spoke_eq_sector_inter (i : Fin 4) : |
| 49 | 55 | C.spoke i = C.sector (i + 3) ∩ C.sector i := by |
| 50 | 56 | have hi : i + 3 + 1 = i := by fin_cases i <;> decide |
| 51 | 57 | simpa only [hi] using (C.sector_inter_next (i + 3)).symm |
| 52 | 58 | |
| 59 | +omit [FiniteDimensional ℝ E] in | |
| 53 | 60 | theorem spoke_sector_mem_iff (i j : Fin 4) {x : E} |
| 54 | 61 | (hx : x ∈ C.spoke i) (hxc : x ≠ C.center) : |
| 55 | 62 | x ∈ C.sector j ↔ j = i ∨ j = i + 3 := by |
| @@ -68,6 +75,7 @@ theorem spoke_sector_mem_iff (i j : Fin 4) {x : E} | ||
| 68 | 75 | · exact hpair.2 |
| 69 | 76 | · exact hpair.1 |
| 70 | 77 | |
| 78 | +omit [FiniteDimensional ℝ E] in | |
| 71 | 79 | theorem sector_inter_subset_spokes (i j : Fin 4) (hij : i ≠ j) : |
| 72 | 80 | C.sector i ∩ C.sector j ⊆ ⋃ k, C.spoke k := by |
| 73 | 81 | rintro x ⟨hxi, hxj⟩ |
| @@ -79,6 +87,7 @@ theorem sector_inter_subset_spokes (i j : Fin 4) (hij : i ≠ j) : | ||
| 79 | 87 | exact mem_iUnion.mpr ⟨0, hxc.symm ▸ C.center_mem_spoke 0⟩ |
| 80 | 88 | · exact mem_iUnion.mpr ⟨i, (C.spoke_eq_sector_inter i).symm.subset ⟨hxj, hxi⟩⟩ |
| 81 | 89 | |
| 90 | +omit [FiniteDimensional ℝ E] in | |
| 82 | 91 | theorem existsUnique_sector_of_not_mem_spokes {x : E} (hx : x ∈ d) |
| 83 | 92 | (hsp : x ∉ ⋃ k, C.spoke k) : ∃! i, x ∈ C.sector i := by |
| 84 | 93 | have hex : ∃ i, x ∈ C.sector i := by |
| @@ -96,6 +105,7 @@ section Attachment | ||
| 96 | 105 | |
| 97 | 106 | variable (g : Fin 4 → E → F) (k : Fin 4 → (E × F) → ℝ) (s : Set (E × F)) |
| 98 | 107 | |
| 108 | +omit [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in | |
| 99 | 109 | theorem attached_fiber_outside_primal {x : E} (hx : x ∉ d) : |
| 100 | 110 | graphAttachmentCarrier g k s C.sector ∩ |
| 101 | 111 | (fun p : (E × F) × (Fin 4 → ℝ) ↦ p.1.1) ⁻¹' {x} = |
+5 −0 PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts/SeparatedDiskAttachment.lean View file
| @@ -57,6 +57,7 @@ theorem separatedSheet_eq_zeroSheet_iff (h : ι → E → ℝ) (i : ι) (x y : E | ||
| 57 | 57 | · rintro ⟨rfl, hh⟩ |
| 58 | 58 | simp [separatedSheet, hh] |
| 59 | 59 | |
| 60 | +omit [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype ι] in | |
| 60 | 61 | theorem separatedSheet_distinct_eq_iff (h : ι → E → ℝ) {i j : ι} (hij : i ≠ j) (x y : E) : |
| 61 | 62 | separatedSheet h i x = separatedSheet h j y ↔ x = y ∧ h i x = 0 ∧ h j y = 0 := by |
| 62 | 63 | constructor |
| @@ -68,6 +69,7 @@ theorem separatedSheet_distinct_eq_iff (h : ι → E → ℝ) {i j : ι} (hij : | ||
| 68 | 69 | · rintro ⟨rfl, hi, hj⟩ |
| 69 | 70 | simp [separatedSheet, hi, hj] |
| 70 | 71 | |
| 72 | +omit [Fintype ι] [DecidableEq ι] in | |
| 71 | 73 | /-- Exact heights are constructed from the disk and interval triangulations. -/ |
| 72 | 74 | theorem exists_separating_disk_heights {u r d : ι → Set E} {a b : ι → E} |
| 73 | 75 | (hu : ∀ i, IsFinitePLBallPair (ℝ × ℝ) (u i) (r i)) |
| @@ -122,6 +124,7 @@ def separatedRim (h : ι → E → ℝ) (b : Set E) (r d : ι → Set E) | ||
| 122 | 124 | (zeroSheet '' b ∪ ⋃ i ∈ T, separatedSheet h i '' r i) \ |
| 123 | 125 | ⋃ i ∈ T, ((zeroSheet '' d i) \ {zeroSheet (ι := ι) (a i), zeroSheet (ι := ι) (z i)}) |
| 124 | 126 | |
| 127 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 125 | 128 | theorem separatedCarrier_insert (h : ι → E → ℝ) (s : Set E) (u : ι → Set E) |
| 126 | 129 | (T : Finset ι) (i : ι) : |
| 127 | 130 | separatedCarrier h s u (insert i T) = separatedCarrier h s u T ∪ separatedSheet h i '' u i := by |
| @@ -147,6 +150,7 @@ theorem separatedCarrier_inter_new (h : ι → E → ℝ) {s : Set E} {u d : ι | ||
| 147 | 150 | have hh := (separatedSheet_inter_base h i (hdu i) (hds i) (hzero i)).symm.subset hx |
| 148 | 151 | exact ⟨Or.inl hh.1, hh.2⟩ |
| 149 | 152 | |
| 153 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 150 | 154 | theorem unused_attachment_subset_separatedRim (h : ι → E → ℝ) {b : Set E} |
| 151 | 155 | {r d : ι → Set E} {a z : ι → E} |
| 152 | 156 | (hdb : ∀ i, d i ⊆ b) (hdis : Pairwise (fun i j ↦ Disjoint (d i) (d j))) |
| @@ -228,6 +232,7 @@ theorem separated_disks_isFinitePLBallPair (h : ι → E → ℝ) | ||
| 228 | 232 | separatedRim_insert h (fun i ↦ (hu i).1) hdu hzero hdis T hi] |
| 229 | 233 | exact hresult |
| 230 | 234 | |
| 235 | +omit [FiniteDimensional ℝ E] [Fintype ι] in | |
| 231 | 236 | theorem projection_separatedCarrier (h : ι → E → ℝ) (s : Set E) |
| 232 | 237 | (u : ι → Set E) (T : Finset ι) : |
| 233 | 238 | Prod.fst '' separatedCarrier h s u T = s ∪ ⋃ i ∈ T, u i := by |
+65 −0 routes/p1-surfaces-cuts/README.md added View file
| @@ -0,0 +1,65 @@ | ||
| 1 | +--- | |
| 2 | +issue: 2 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# p1-surfaces-cuts | |
| 6 | + | |
| 7 | +P-1 for the folder `PoincareLib/Topology/Manifold/Smoothing/Rigidity/Surfaces/Cuts` (78 files): fix the linter | |
| 8 | +warnings Lean prints for it, without changing any statement. | |
| 9 | + | |
| 10 | +## What I did | |
| 11 | + | |
| 12 | +No Lean on my machine, so the fixes come from the `build` log of `main` (job 660). That log only keeps its last 25 | |
| 13 | +lines, and they show three warnings, all in this folder: | |
| 14 | + | |
| 15 | +- `OriginalBridgeReversal.lean:152`: `hbound` unused in `source_bridge_endpoint_reversal_of_scalar` → `_hbound`. | |
| 16 | +- `OriginalBridgeScalarCharts.lean:33`: `hαβ` unused in `scalar_bridge_chart` → `_hαβ` (its one caller passes it | |
| 17 | + positionally, so nothing else moves). | |
| 18 | +- `OriginalPeriodicSquareMap.lean:55`: `letI` in a proof → `let`, as the `haveILetI` linter suggests. | |
| 19 | + | |
| 20 | +The `build` log of this branch's first head (job 830) then showed three more for the folder, fixed in a second | |
| 21 | +commit: | |
| 22 | + | |
| 23 | +- `OriginalBridgeReversal.lean:33`: `hab` unused in `endpoint_pair_reversal_of_scalar` → `_hab`. | |
| 24 | +- `OriginalHalfBandCofaces.lean:134, 159`: the section variable `[FiniteDimensional ℝ E]` was included but unused in | |
| 25 | + `OriginalResidualHalfBands.coface_hulls_inter` and `residualCofaceContact_subset_original_coface` → `omit … in`, | |
| 26 | + as the `unusedSectionVars` linter suggests (an instance argument nothing used; the stated claim is unchanged). | |
| 27 | + | |
| 28 | +Job 838 (second head) showed two more unused section variables, fixed in a third commit with `omit … in`: | |
| 29 | +`OriginalHalfBandCofaces.lean:70` (`residualBand_subset_original_cofaces`) and `OriginalRefinementOrientation.lean:154` | |
| 30 | +(`original_refined_pair_cancellation`). Job 842 (third head) showed unused simp arguments in `OriginalRefinementOrientation.lean`: `or_left_comm` at 133 | |
| 31 | +and 135, dropped; and `sub_zero` in a `simp only` whose line was cut off, which I take to be line 127 of the same | |
| 32 | +file (the only such `simp only` in it, just before the others); `build` judges that guess. (It passed: job 845.) | |
| 33 | + | |
| 34 | +Job 845 (fourth head) showed `or_assoc` unused at `OriginalOwnerIntersection.lean:82` and `:85`, dropped, and | |
| 35 | +`[FiniteDimensional ℝ E] [DecidableEq E]` unused in `charted_refined_triangle_independent` | |
| 36 | +(`OriginalRefinementOrientation.lean:14`), omitted. | |
| 37 | + | |
| 38 | +Job 850 (fifth head) showed the same two section variables unused in `charted_refined_cross_ne_zero` (omitted), and | |
| 39 | +`sub_zero` unused at `OriginalCutCoherentSigns.lean:306` (dropped). | |
| 40 | + | |
| 41 | +A failure worth keeping: I first took that `sub_zero` for a pattern (eleven `simp only [show (2 : ZMod 2) = 0 from | |
| 42 | +rfl, mul_zero, …]` lines close what `linear_combination (norm := ring_nf)` leaves) and dropped the zero lemmas from all | |
| 43 | +of them. Jobs 856, 859 and 864 failed: in `OrientedDiskBoundary.lean:212`, `PlanarBoundaryOrientation.lean` and | |
| 44 | +`OriginalCutCoherentSigns.lean:168` the goal left is `0 - 0 … = 0` or `-0 = 0`, so those lemmas are needed there. | |
| 45 | +Every one of those lines is back as it was; only the two the log named (127 and 306) are changed. | |
| 46 | + | |
| 47 | +Job 868 (green again) showed two more unused section variables, omitted: `[NormedAddCommGroup E] [NormedSpace ℝ E]` | |
| 48 | +in `mapped_numbered_boundary_cross_parity` (`OriginalCutCoherentSigns.lean:99`) and `[FiniteDimensional ℝ E]` in | |
| 49 | +`charted_refined_cofaces_cancel` (`OriginalRefinementOrientation.lean:74`). | |
| 50 | + | |
| 51 | +Only binder names, one tactic keyword, `omit` lines and unused simp arguments change; no statement changes. `python3 checks/challenge.py .` says ok. | |
| 52 | + | |
| 53 | +## How to go on | |
| 54 | + | |
| 55 | +The `build` check prints only the last 25 lines of its log, and Lake replays every module's warnings, so each push | |
| 56 | +shows the last two or three warnings of the folder that remain; fixing them shows the next ones. Each round takes | |
| 57 | +about five minutes on the site. Fix only what the log names, line by line: guessing by pattern failed (see above). | |
| 58 | + | |
| 59 | +## Next | |
| 60 | + | |
| 61 | +Job 875 (head ea59feb) names two more: `omit [NormedAddCommGroup E] [NormedSpace ℝ E] in` before the private | |
| 62 | +`mapped_numbered_boundary_cross_parity_reverse` (`OriginalCutCoherentSigns.lean:137`) and `omit [FiniteDimensional ℝ | |
| 63 | +E] in` before `original_refined_sorted_cross_cancellation` (`OriginalRefinementCoherentSigns.lean:25`); above them, cut | |
| 64 | +off, an `omit hbound in` for a theorem whose file the log no longer shows. Fix those, push, read the next log, and | |
| 65 | +repeat until the tail of `build` shows no warning for this folder; then set `status: done`. | |