| | @@ -181,43 +181,38 @@ private lemma yes_bound {n l : ℕ} {s : State} {Y : Finset ℕ} (hl : 3 ≤ l) |
| 181 | 181 | linarith only [hy, hT, Nat.mul_le_mul_left l hG, Nat.zero_le (l ^ 2 * s.live.card)] |
| 182 | 182 | exact Nat.le_of_mul_le_mul_left hY (by positivity) |
| 183 | 183 | |
| 184 | | −/-- In an independent set, each nonactive quadruple contains a stored triple. -/ |
| 185 | | −private lemma terminal_bound {s : State} {l : ℕ} (hs : Invariant s l) (stop : query s l = none) |
| 186 | | − {J : Finset ℕ} (hJ : J ⊆ s.live) (hind : s.leaf.graph.IsIndepSet (J : Set ℕ)) : |
| 187 | | − 4 * (additiveQuadruples J).card ≤ s.live.card * (l ^ 3 + 8 * l ^ 2) := by |
| 184 | +/-- Each edge-free quadruple is active or contains a stored triple. This counts |
| 185 | +any family of quadruples whose individual supports are independent. -/ |
| 186 | +theorem terminal_quadruple_bound {s : State} {l : ℕ} (hs : Invariant s l) |
| 187 | + (stop : query s l = none) {F : Faces} (hF : F ⊆ quads s.live) |
| 188 | + (hind : ∀ q ∈ F, s.leaf.graph.IsIndepSet (q : Set ℕ)) : |
| 189 | + 4 * F.card ≤ s.live.card * (l ^ 3 + 8 * l ^ 2) := by |
| 188 | 190 | have sel : Selection s l none := stop ▸ selection hs |
| 189 | 191 | have ha : Bounded (active s) 1 (l ^ 3) := by cases sel with | stop h => exact h |
| 190 | | − have noEdge : ∀ e ∈ s.edges, ¬e ⊆ J := by |
| 191 | | − intro e he hsub |
| 192 | | − obtain ⟨x, y, hxy, rfl⟩ := card_eq_two.mp (hs.edges e he).2 |
| 193 | | − exact hind (hsub (mem_insert_self _ _)) (hsub (mem_insert_of_mem (mem_singleton_self _))) |
| 194 | | − hxy ⟨hxy, he⟩ |
| 195 | | − have cover : quads J ⊆ active s ∪ s.triples.biUnion (incident (quads J)) := by |
| 192 | + have cover : F ⊆ active s ∪ s.triples.biUnion (incident (quads s.live)) := by |
| 196 | 193 | intro q hq |
| 197 | 194 | by_cases h : ∃ t ∈ s.triples, t ⊆ q |
| 198 | 195 | · obtain ⟨t, ht, htq⟩ := h |
| 199 | | − exact mem_union_right _ (mem_biUnion.mpr ⟨t, ht, mem_filter.mpr ⟨hq, htq⟩⟩) |
| 200 | | − · exact mem_union_left _ (mem_filter.mpr ⟨quads_mono hJ hq, fun u hu huq => |
| 201 | | − (mem_union.mp hu).elim (fun he => noEdge u he (huq.trans ((quads_uniform J) q hq).1)) |
| 202 | | − (fun ht => h ⟨u, ht, huq⟩)⟩) |
| 196 | + exact mem_union_right _ (mem_biUnion.mpr ⟨t, ht, mem_filter.mpr ⟨hF hq, htq⟩⟩) |
| 197 | + · refine mem_union_left _ (mem_filter.mpr ⟨hF hq, ?_⟩) |
| 198 | + intro u hu huq |
| 199 | + rcases mem_union.mp hu with he | ht |
| 200 | + · obtain ⟨x, y, hxy, rfl⟩ := card_eq_two.mp (hs.edges u he).2 |
| 201 | + exact hind q hq (huq (mem_insert_self _ _)) (huq (mem_insert_of_mem (mem_singleton_self _))) |
| 202 | + hxy ⟨hxy, he⟩ |
| 203 | + · exact h ⟨u, ht, huq⟩ |
| 203 | 204 | have hc := (card_le_card cover).trans (card_union_le _ _) |
| 204 | | − have hd := card_biUnion_bound (S := s.triples) (f := incident (quads J)) |
| 205 | | − (fun t ht => quads_triple_degree J t (hs.triples t ht).2) |
| 205 | + have hd := card_biUnion_bound (S := s.triples) (f := incident (quads s.live)) |
| 206 | + (fun t ht => quads_triple_degree s.live t (hs.triples t ht).2) |
| 206 | 207 | have hA := card_mul_width_le ((quads_uniform s.live).subfamily (active_sub s)) ha |
| 207 | 208 | have hT := card_mul_width_le hs.triples hs.tripleDeg |
| 208 | | − rw [card_quads] at hc |
| 209 | 209 | linarith only [hc, hd, hA, hT] |
| 210 | 210 | |
| 211 | | −/-- The five-rule run uses at most `16 |C| / l` yes answers. In the resulting |
| 212 | | −leaf, double counting active quadruples and the triples on an independent |
| 213 | | −set bounds all of its additive quadruples. -/ |
| 214 | | −theorem refinement_accounting (C I : Finset ℕ) (l : ℕ) (hl : 3 ≤ l) : |
| 215 | | − (hI : I ⊆ C) → (hsid : IsSidon (I : Set ℕ)) → |
| 211 | +/-- At the end of the allotted steps the run has stopped, with its degree |
| 212 | +invariants and yes-answer bound. -/ |
| 213 | +theorem follow_terminal_bounds (C I : Finset ℕ) (l : ℕ) (hl : 3 ≤ l) : |
| 216 | 214 | let r := follow C l I |
| 217 | | − l * r.2.card ≤ 16 * C.card ∧ |
| 218 | | − ∀ J ⊆ r.1.live, r.1.leaf.graph.IsIndepSet (J : Set ℕ) → |
| 219 | | − 4 * (additiveQuadruples J).card ≤ C.card * (l ^ 3 + 8 * l ^ 2) := by |
| 220 | | − intro _ _ |
| 215 | + Invariant r.1 l ∧ r.1.live ⊆ C ∧ query r.1 l = none ∧ l * r.2.card ≤ 16 * C.card := by |
| 221 | 216 | let r := follow C l I |
| 222 | 217 | obtain ⟨hs, hC, hb, hi⟩ := run_bounds C l (fun _ q => decide (q ⊆ I)) hl (steps C) |
| 223 | 218 | change query r.1 l = none ∨ steps C + fuel r.1 ≤ steps C at hi |
| | @@ -229,8 +224,23 @@ theorem refinement_accounting (C I : Finset ℕ) (l : ℕ) (hl : 3 ≤ l) : |
| 229 | 224 | obtain ⟨step⟩ := selection_effect hl (s := r.1) hs (hq ▸ selection hs) false |
| 230 | 225 | have hlt := fuel_decreases (fixed := step.fixed) step.batch step.progress |
| 231 | 226 | omega |
| 232 | | − refine ⟨(yes_bound hl hs hb).trans (Nat.mul_le_mul_right _ (by decide : 9 ≤ 16)), |
| 233 | | − fun J hJ hind => ?_⟩ |
| 234 | | − exact (terminal_bound hs stop hJ hind).trans (Nat.mul_le_mul_right _ (card_le_card hC)) |
| 227 | + exact ⟨hs, hC, stop, (yes_bound hl hs hb).trans (Nat.mul_le_mul_right _ (by decide : 9 ≤ 16))⟩ |
| 228 | + |
| 229 | +/-- The five-rule run uses at most `16 |C| / l` yes answers. In the resulting |
| 230 | +leaf, double counting active quadruples and the triples on an independent |
| 231 | +set bounds all of its additive quadruples. -/ |
| 232 | +theorem refinement_accounting (C I : Finset ℕ) (l : ℕ) (hl : 3 ≤ l) : |
| 233 | + (hI : I ⊆ C) → (hsid : IsSidon (I : Set ℕ)) → |
| 234 | + let r := follow C l I |
| 235 | + l * r.2.card ≤ 16 * C.card ∧ |
| 236 | + ∀ J ⊆ r.1.live, r.1.leaf.graph.IsIndepSet (J : Set ℕ) → |
| 237 | + 4 * (additiveQuadruples J).card ≤ C.card * (l ^ 3 + 8 * l ^ 2) := by |
| 238 | + intro _ _ |
| 239 | + obtain ⟨hs, hC, stop, hy⟩ := follow_terminal_bounds C I l hl |
| 240 | + refine ⟨hy, fun J hJ hind => ?_⟩ |
| 241 | + rw [← card_quads] |
| 242 | + exact (terminal_quadruple_bound hs stop (quads_mono hJ) |
| 243 | + (fun q hq => hind.mono ((quads_uniform J) q hq).1)).trans |
| 244 | + (Nat.mul_le_mul_right _ (card_le_card hC)) |
| 235 | 245 | |
| 236 | 246 | end ErdosSwarm.Erdos530Gap |