| | @@ -107,11 +107,66 @@ structure OutsiderInputs : Prop where |
| 107 | 107 | private theorem kernel_zero : kernel 0 = 17 / 175 + 192 / 25 := by |
| 108 | 108 | norm_num [kernel] |
| 109 | 109 | |
| 110 | | −private theorem coord_iso (M : ℕ) (g : Bool × ℤ) (a : ℤ) : |
| 110 | +/-- Conjugating an integer isometry by the host coordinate gives a real isometry. -/ |
| 111 | +theorem coord_iso (M : ℕ) (g : Bool × ℤ) (a : ℤ) : |
| 111 | 112 | isoR g.1 (if g.1 then 32 * ((g.2 : ℝ) - 1) / M else 32 * (g.2 : ℝ) / M) (coord M a) = |
| 112 | 113 | coord M (iso g a) := by |
| 113 | 114 | rcases g with ⟨_ | _, t⟩ <;> simp [isoR, iso, coord] <;> ring |
| 114 | 115 | |
| 116 | +/-- The midpoint coordinate of each integer in the host lies strictly between 0 and 32. -/ |
| 117 | +theorem coord_mem_Ioo {M a : ℕ} (ha : a ∈ host M) : coord M a ∈ Set.Ioo (0 : ℝ) 32 := by |
| 118 | + obtain ⟨h1, h2⟩ := mem_Icc.mp ha |
| 119 | + have h1' : (1 : ℝ) ≤ a := by exact_mod_cast h1 |
| 120 | + have h2' : (a : ℝ) ≤ M := by exact_mod_cast h2 |
| 121 | + have hM : (0 : ℝ) < M := by linarith only [h1', h2'] |
| 122 | + unfold coord |
| 123 | + push_cast |
| 124 | + exact ⟨div_pos (by linarith only [h1']) hM, (div_lt_iff₀ hM).mpr (by linarith only [h2'])⟩ |
| 125 | + |
| 126 | +/-- If there are at least `(s + ε)τm` outsiders, test a set of at most `m/3` of them. |
| 127 | +After the exceptional vertices in the incidence lemma are removed, `⌈sτm⌉` still remain. -/ |
| 128 | +theorem outsider_samples {A : Finset ℕ} {s m : ℝ} (hm : (2 : ℝ) ^ 240 ≤ m) |
| 129 | + (hs : 0 ≤ s) (hs' : s ≤ 10) (hA : (s + eps) * tau * m ≤ A.card) : |
| 130 | + ∃ B₀ ⊆ A, (B₀.card : ℝ) ≤ m / 3 ∧ |
| 131 | + ∀ Z ⊆ B₀, (Z.card : ℝ) ≤ 16 / 9 / 18 ^ 4 * m → |
| 132 | + ∃ B ⊆ B₀ \ Z, B.card = ⌈s * tau * m⌉₊ := by |
| 133 | + have hm₀ : 0 ≤ m := le_trans (by norm_num) hm |
| 134 | + have hτ : 0 ≤ tau := by norm_num [tau] |
| 135 | + have hpos : 0 ≤ (s + eps) * tau * m := by |
| 136 | + exact mul_nonneg (mul_nonneg (add_nonneg hs (by norm_num [eps])) hτ) hm₀ |
| 137 | + obtain ⟨B₀, hB₀, hc⟩ := exists_subset_card_eq (Nat.ceil_le.mpr hA) |
| 138 | + refine ⟨B₀, hB₀, ?_, ?_⟩ |
| 139 | + · rw [hc] |
| 140 | + calc (⌈(s + eps) * tau * m⌉₊ : ℝ) ≤ (s + eps) * tau * m + 1 := |
| 141 | + (Nat.ceil_lt_add_one hpos).le |
| 142 | + _ ≤ (10 + eps) * tau * m + 1 := by gcongr |
| 143 | + _ ≤ m / 3 := by norm_num [eps, tau]; linarith only [hm] |
| 144 | + · intro Z hZ hcard |
| 145 | + apply exists_subset_card_eq |
| 146 | + apply Nat.ceil_le.mpr |
| 147 | + have hdiff : ((B₀ \ Z).card : ℝ) + Z.card = B₀.card := by |
| 148 | + exact_mod_cast card_sdiff_add_card_eq_card hZ |
| 149 | + have hbase : (s + eps) * tau * m ≤ B₀.card := hc ▸ Nat.le_ceil _ |
| 150 | + have hcost : (Z.card : ℝ) ≤ eps * tau * m := |
| 151 | + hcard.trans (mul_le_mul_of_nonneg_right (by norm_num [eps, tau]) hm₀) |
| 152 | + linarith only [hdiff, hbase, hcost] |
| 153 | + |
| 154 | +/-- Scaling a seed of size at least `(1−τ)m − 160m^(7/8)` by `32/m` gives the |
| 155 | +mass required by both kernel estimates. Here `u = m^(1/8) ≥ 2^30`. -/ |
| 156 | +theorem seed_mass_ge {m u n : ℝ} (hu : (2 : ℝ) ^ 30 ≤ u) (hm : m = u ^ 8) |
| 157 | + (hn : (1 - tau) * m - 160 * u ^ 7 ≤ n) : |
| 158 | + 31 - 1 / 10 ^ 5 ≤ n * (32 / m) := by |
| 159 | + have hu₀ : 0 < u := lt_of_lt_of_le (by norm_num) hu |
| 160 | + have hm₀ : 0 < m := hm ▸ pow_pos hu₀ 8 |
| 161 | + rw [← mul_div_assoc, le_div_iff₀ hm₀] |
| 162 | + have herr : 5120 * u ^ 7 ≤ 1 / 10 ^ 5 * m := by |
| 163 | + rw [hm] |
| 164 | + calc 5120 * u ^ 7 ≤ (1 / 10 ^ 5 * u) * u ^ 7 := |
| 165 | + mul_le_mul_of_nonneg_right (by linarith only [hu]) (pow_pos hu₀ 7).le |
| 166 | + _ = _ := by ring |
| 167 | + norm_num [tau] at hn |
| 168 | + linarith only [hn, herr] |
| 169 | + |
| 115 | 170 | /-- The arithmetic of §3: the summed lower bound (lemma 7) against the charging and energy |
| 116 | 171 | bounds (lemmas 5, 6) leaves `0.014 < 32 w W(0) + 2 s c w + 2·1024·183·W(0)/u`. -/ |
| 117 | 172 | private theorem no_room {u m w bR sR E Q Ψ T W0 D : ℝ} |
| | @@ -252,7 +307,6 @@ theorem few_outsiders_of_inputs (inputs : OutsiderInputs) |
| 252 | 307 | rcases Nat.eq_zero_or_pos M with h | h |
| 253 | 308 | · rw [h] at hm₀; simp at hm₀ |
| 254 | 309 | · exact h |
| 255 | | − have hMr : (0 : ℝ) < M := by exact_mod_cast hMpos |
| 256 | 310 | have hsq : Real.sqrt M ^ 2 = M := Real.sq_sqrt (Nat.cast_nonneg M) |
| 257 | 311 | obtain ⟨u, hu⟩ : ∃ u : ℝ, u = Real.sqrt M ^ (1 / 8 : ℝ) := ⟨_, rfl⟩ |
| 258 | 312 | have hu₀ : 0 < u := hu ▸ Real.rpow_pos_of_pos hm₀ _ |
| | @@ -265,35 +319,11 @@ theorem few_outsiders_of_inputs (inputs : OutsiderInputs) |
| 265 | 319 | apply le_of_pow_le_pow_left₀ (n := 8) (by decide) hu₀.le |
| 266 | 320 | rw [← hu8] |
| 267 | 321 | exact le_trans (by norm_num) hm |
| 268 | | − -- the tested outsiders |
| 269 | | − have hn₀ : ⌈(sCoef + eps) * tau * Real.sqrt M⌉₊ ≤ (U \ S).card := Nat.ceil_le.mpr hcon |
| 270 | | − obtain ⟨B₀, hB₀, hB₀card⟩ := exists_subset_card_eq hn₀ |
| 271 | | − have hpos₀ : 0 ≤ (sCoef + eps) * tau * Real.sqrt M := by |
| 272 | | − have : (0 : ℝ) ≤ (sCoef + eps) * tau := by norm_num [sCoef, eps, tau] |
| 273 | | − exact mul_nonneg this hm₀.le |
| 274 | | − have hB₀lt : (B₀.card : ℝ) < (sCoef + eps) * tau * Real.sqrt M + 1 := by |
| 275 | | − rw [hB₀card]; exact Nat.ceil_lt_add_one hpos₀ |
| 276 | | − have hB₀ge : (sCoef + eps) * tau * Real.sqrt M ≤ B₀.card := by |
| 277 | | − rw [hB₀card]; exact Nat.le_ceil _ |
| 278 | | − have hb₀ : (B₀.card : ℝ) ≤ Real.sqrt M / 3 := by |
| 279 | | − norm_num [sCoef, eps, tau] at hB₀lt ⊢ |
| 280 | | − linarith only [hB₀lt, hm] |
| 322 | + obtain ⟨B₀, hB₀, hb₀, hsample⟩ := outsider_samples (s := sCoef) hm |
| 323 | + (by norm_num [sCoef]) (by norm_num [sCoef]) hcon |
| 281 | 324 | obtain ⟨Z, hZ, hZcard, hrest⟩ := |
| 282 | 325 | inputs.incidences hm hU hSU hsid hind hedges hquads hle hB₀ hb₀ |
| 283 | | − have hpos : 0 ≤ sCoef * tau * Real.sqrt M := by |
| 284 | | − have : (0 : ℝ) ≤ sCoef * tau := by norm_num [sCoef, tau] |
| 285 | | − exact mul_nonneg this hm₀.le |
| 286 | | − have hb : ⌈sCoef * tau * Real.sqrt M⌉₊ ≤ (B₀ \ Z).card := by |
| 287 | | − have h1 := card_sdiff_add_card_eq_card hZ |
| 288 | | − have h2 : ((B₀ \ Z).card : ℝ) = (B₀.card : ℝ) - Z.card := by |
| 289 | | − rw [← h1]; push_cast; ring |
| 290 | | − have h3 := Nat.ceil_lt_add_one hpos |
| 291 | | − have h4 : ((⌈sCoef * tau * Real.sqrt M⌉₊ : ℕ) : ℝ) < ((B₀ \ Z).card : ℝ) := by |
| 292 | | − rw [h2] |
| 293 | | − norm_num [sCoef, eps, tau] at h3 hB₀ge hZcard ⊢ |
| 294 | | − linarith only [h3, hB₀ge, hZcard, hm] |
| 295 | | − exact_mod_cast h4.le |
| 296 | | − obtain ⟨B, hBsub, hBcard⟩ := exists_subset_card_eq hb |
| 326 | + obtain ⟨B, hBsub, hBcard⟩ := hsample Z hZ hZcard |
| 297 | 327 | obtain ⟨P, g, hP, hdisc, hD, hg⟩ := hrest B hBsub |
| 298 | 328 | have hBU : B ⊆ U \ S := (hBsub.trans sdiff_subset).trans hB₀ |
| 299 | 329 | have hBhost : B ⊆ host M \ S := fun x hx => |
| | @@ -301,26 +331,9 @@ theorem few_outsiders_of_inputs (inputs : OutsiderInputs) |
| 301 | 331 | have hS : S ⊆ host M := hSU.trans hU |
| 302 | 332 | have hch := inputs.charging hMpos hS hBhost hP hD hg |
| 303 | 333 | have hen := inputs.energy hMpos hS hsid |
| 304 | | − have hcoord : ∀ a ∈ host M, coord M (a : ℤ) ∈ Set.Ioo (0 : ℝ) 32 := by |
| 305 | | − intro a ha |
| 306 | | − obtain ⟨h1, h2⟩ := mem_Icc.mp ha |
| 307 | | − have h1' : (1 : ℝ) ≤ a := by exact_mod_cast h1 |
| 308 | | − have h2' : (a : ℝ) ≤ M := by exact_mod_cast h2 |
| 309 | | − unfold coord |
| 310 | | − push_cast |
| 311 | | − exact ⟨div_pos (by linarith only [h1']) hMr, |
| 312 | | − (div_lt_iff₀ hMr).mpr (by linarith only [h2'])⟩ |
| 313 | 334 | have hw₀ : (0 : ℝ) ≤ 32 / Real.sqrt M := by positivity |
| 314 | | − have hmass : 31 - 1 / 10 ^ 5 ≤ (S.card : ℝ) * (32 / Real.sqrt M) := by |
| 315 | | − rw [← mul_div_assoc, le_div_iff₀ hm₀] |
| 316 | | − rw [h78] at hge |
| 317 | | − have h1 : 5120 * u ^ 7 ≤ 1 / 10 ^ 5 * Real.sqrt M := by |
| 318 | | − rw [hu8] |
| 319 | | − have : (5120 : ℝ) * u ^ 7 ≤ 1 / 10 ^ 5 * u * u ^ 7 := |
| 320 | | − mul_le_mul_of_nonneg_right (by linarith only [hlarge]) (pow_pos hu₀ 7).le |
| 321 | | − linarith only [this, show (1 : ℝ) / 10 ^ 5 * u * u ^ 7 = 1 / 10 ^ 5 * u ^ 8 by ring] |
| 322 | | − norm_num [tau] at hge |
| 323 | | − linarith only [hge, h1] |
| 335 | + rw [h78] at hge |
| 336 | + have hmass := seed_mass_ge hlarge hu8 hge |
| 324 | 337 | have hBne : B.Nonempty := by |
| 325 | 338 | apply card_pos.mp |
| 326 | 339 | rw [hBcard] |
| | @@ -335,7 +348,7 @@ theorem few_outsiders_of_inputs (inputs : OutsiderInputs) |
| 335 | 348 | 2 * cCharge * sCoef ^ 2 * psi (coord M x) := by |
| 336 | 349 | intro x hx |
| 337 | 350 | have h := inputs.lower S (fun a : ℕ => coord M (a : ℤ)) hw₀ |
| 338 | | − (fun a ha => hcoord a (hS ha)) hmass (hcoord x (mem_sdiff.mp (hBhost hx)).1) (g x).1 |
| 351 | + (fun _ ha => coord_mem_Ioo (hS ha)) hmass (coord_mem_Ioo (mem_sdiff.mp (hBhost hx)).1) (g x).1 |
| 339 | 352 | (if (g x).1 then 32 * (((g x).2 : ℝ) - 1) / M else 32 * ((g x).2 : ℝ) / M) |
| 340 | 353 | simp only [coord_iso] at h |
| 341 | 354 | exact h |
| | @@ -349,6 +362,7 @@ theorem few_outsiders_of_inputs (inputs : OutsiderInputs) |
| 349 | 362 | linarith only [this] |
| 350 | 363 | have hb2 : (B.card : ℝ) < sCoef * Real.sqrt M / 32 + 1 := by |
| 351 | 364 | rw [hBcard] |
| 365 | + have hpos := mul_nonneg (by norm_num [sCoef, tau] : 0 ≤ sCoef * tau) hm₀.le |
| 352 | 366 | have := Nat.ceil_lt_add_one hpos |
| 353 | 367 | norm_num [tau] at this ⊢ |
| 354 | 368 | linarith only [this] |
| | @@ -403,7 +417,7 @@ open private prob_extension_le exists_small_sample triples support supports |
| 403 | 417 | support_properties excludes_extension from ErdosSwarm.Erdos530Gap.Fingerprint in |
| 404 | 418 | /-- The accepted sampler, used as in `Erdos530Gap428.Assembly`: it excludes every point |
| 405 | 419 | outside `S ∪ E`, so `|C₁(T)| ≤ |S| + |E| < (1 − τ)m + 1 + 124 τ m < 5m`. -/ |
| 406 | | −private theorem initial_cover (inputs : CoverInputs) {M : ℕ} {S : Finset ℕ} |
| 420 | +private theorem initial_cover (initial : type_of% @exceptional_card_32) {M : ℕ} {S : Finset ℕ} |
| 407 | 421 | (hm : 10 ^ 14 / tau ^ 2 ≤ Real.sqrt M) (hS : S ⊆ host M) |
| 408 | 422 | (hsid : IsSidon (S : Set ℕ)) (hk : S.card = seedSize M tau) : |
| 409 | 423 | ∃ T ∈ initialFamily M, T ⊆ S := by |
| | @@ -463,30 +477,41 @@ private theorem initial_cover (inputs : CoverInputs) {M : ℕ} {S : Finset ℕ} |
| 463 | 477 | exact hTX x (mem_sdiff.mpr ⟨(mem_filter.mp hx).1, h⟩) hx |
| 464 | 478 | have hcard : ((extension M T).card : ℝ) ≤ (S.card : ℝ) + E.card := by |
| 465 | 479 | exact_mod_cast (card_le_card hC).trans (card_union_le _ _) |
| 466 | | − have hE := inputs.initial hm hS hsid hk |
| 480 | + have hE := initial hm hS hsid hk |
| 467 | 481 | change (E.card : ℝ) < 124 * tau * m at hE |
| 468 | 482 | have hc : ((extension M T).card : ℝ) ≤ 5 * m := by |
| 469 | 483 | norm_num [tau] at hE hceil hm ⊢ |
| 470 | 484 | linarith only [hcard, hceil, hE, hm] |
| 471 | 485 | exact ⟨T, mem_filter.mpr ⟨mem_powerset.mpr (hTS.trans hS), hTcard, hc⟩, hTS⟩ |
| 472 | 486 | |
| 473 | | −/-- One initial container `C` and one Sidon target: the leaf of the level-`⌈m^(1/8)⌉` run |
| 474 | | −contains the target and has `|F ∪ U| ≤ (1 + Kτ)m`. Choose an independent seed |
| 475 | | −`S' ⊆ S ∩ U` with `|F| + |S'| = k`; then `|F ∪ U| = k + |U \ S'|` and lemma 4 applies. |
| 476 | | −The allowance is `(K − s − ε + 1)τ m = m/160000 ≥ 1`. -/ |
| 477 | | −private theorem refined_size (inputs : CoverInputs) {M : ℕ} {C S : Finset ℕ} |
| 487 | +/-- The outsider estimate needed on the live set of a level-`⌈m^(1/8)⌉` refinement. |
| 488 | +Different kernel estimates give different bounds `b` for the same class of graphs. -/ |
| 489 | +def OutsiderBound (M : ℕ) (b : ℝ) : Prop := |
| 490 | + ∀ {U S : Finset ℕ} {G : SimpleGraph ℕ}, U ⊆ host M → S ⊆ U → |
| 491 | + IsSidon (S : Set ℕ) → G.IsIndepSet (S : Set ℕ) → |
| 492 | + ((adjacentPairs G U).card : ℝ) ≤ 101 / 20 * Real.sqrt M ^ (9 / 8 : ℝ) → |
| 493 | + ((edgeFreeQuadruples G U).card : ℝ) ≤ 5 * (101 / 100) ^ 3 * Real.sqrt M ^ (11 / 8 : ℝ) → |
| 494 | + (S.card : ℝ) ≤ Real.sqrt M → |
| 495 | + (1 - tau) * Real.sqrt M - 160 * Real.sqrt M ^ (7 / 8 : ℝ) ≤ S.card → |
| 496 | + ((U \ S).card : ℝ) < b |
| 497 | + |
| 498 | +/-- Choose an independent seed `S' ⊆ S ∩ U` with `|F| + |S'| = k`. The terminal |
| 499 | +container has size `k + |U \ S'|`, so the outsider estimate controls its size. -/ |
| 500 | +private theorem refined_size (census : type_of% @leaf_census) {M : ℕ} {C S : Finset ℕ} |
| 501 | + {b width : ℝ} (outsiders : OutsiderBound M b) |
| 502 | + (hwidth : (1 - tau) * Real.sqrt M + 1 + b ≤ width) |
| 478 | 503 | (hm : (2 : ℝ) ^ 240 ≤ Real.sqrt M) (hC : C ⊆ host M) |
| 479 | 504 | (hn : (C.card : ℝ) ≤ 5 * Real.sqrt M) (hSC : S ⊆ C) (hsid : IsSidon (S : Set ℕ)) |
| 480 | 505 | (hk : seedSize M tau ≤ S.card) : |
| 481 | 506 | let L := (follow C (level8 (Real.sqrt M)) S).1.leaf |
| 482 | 507 | S ⊆ L.fixed ∪ L.live ∧ L.fixed ∪ L.live ⊆ C ∧ |
| 483 | | − ((L.fixed ∪ L.live).card : ℝ) ≤ (1 + K * tau) * Real.sqrt M := by |
| 508 | + ((L.fixed ∪ L.live).card : ℝ) ≤ width := by |
| 484 | 509 | classical |
| 485 | 510 | intro L |
| 486 | 511 | obtain ⟨m, hmdef⟩ : ∃ m : ℝ, m = Real.sqrt M := ⟨_, rfl⟩ |
| 487 | 512 | obtain ⟨l, hldef⟩ : ∃ l : ℕ, l = level8 m := ⟨_, rfl⟩ |
| 488 | 513 | obtain ⟨u, hu⟩ : ∃ u : ℝ, u = m ^ (1 / 8 : ℝ) := ⟨_, rfl⟩ |
| 489 | | − rw [← hmdef] at hm hn ⊢ |
| 514 | + rw [← hmdef] at hm hn |
| 490 | 515 | have hm₀ : 0 < m := lt_of_lt_of_le (by norm_num) hm |
| 491 | 516 | have hu₀ : 0 < u := hu ▸ Real.rpow_pos_of_pos hm₀ _ |
| 492 | 517 | have hu8 : u ^ 8 = m := by rw [hu, ← Real.rpow_mul_natCast hm₀.le]; norm_num |
| | @@ -511,7 +536,7 @@ private theorem refined_size (inputs : CoverInputs) {M : ℕ} {C S : Finset ℕ} |
| 511 | 536 | subst hLdef |
| 512 | 537 | obtain ⟨_, _, hfollow, hinside, hdisj, hfixed⟩ := refinement_path C S l hl3 hSC hsid |
| 513 | 538 | obtain ⟨hyes, _⟩ := refinement_accounting C S l hl3 hSC hsid |
| 514 | | − obtain ⟨hedge, hquad⟩ := inputs.census C S l hl3 hSC hsid |
| 539 | + obtain ⟨hedge, hquad⟩ := census C S l hl3 hSC hsid |
| 515 | 540 | set F := (follow C l S).1.fixed with hF |
| 516 | 541 | set U := (follow C l S).1.live with hU |
| 517 | 542 | have hcov : S ⊆ F ∪ U := hfollow.1 |
| | @@ -557,9 +582,9 @@ private theorem refined_size (inputs : CoverInputs) {M : ℕ} {C S : Finset ℕ} |
| 557 | 582 | have hS'real : (S'.card : ℝ) = (seedSize M tau : ℝ) - F.card := by |
| 558 | 583 | rw [hS'card, Nat.cast_sub hFk] |
| 559 | 584 | have hl2 : 8 * l ^ 2 ≤ 3 * l ^ 3 := by nlinarith only [hl3, sq_nonneg l] |
| 560 | | − have hout := few_outsiders_of_inputs inputs.toOutsiderInputs (M := M) (U := U) (S := S') |
| 585 | + have hout := outsiders (U := U) (S := S') |
| 561 | 586 | (G := (follow C l S).1.leaf.graph) |
| 562 | | − (by rw [← hmdef]; exact hm) ((subset_union_right.trans hinside).trans hC) hS'U |
| 587 | + ((subset_union_right.trans hinside).trans hC) hS'U |
| 563 | 588 | (Set.IsSidon.subset hsid (hS'.trans inter_subset_left)) |
| 564 | 589 | (hindep.mono (coe_subset.mpr hS')) |
| 565 | 590 | (by |
| | @@ -586,31 +611,31 @@ private theorem refined_size (inputs : CoverInputs) {M : ℕ} {C S : Finset ℕ} |
| 586 | 611 | (by |
| 587 | 612 | rw [← hmdef, h78, hS'real] |
| 588 | 613 | linarith only [hkle, hFu]) |
| 589 | | − rw [← hmdef] at hout |
| 614 | + rw [← hmdef] at hwidth |
| 590 | 615 | have hsplit : (F ∪ U).card = seedSize M tau + (U \ S').card := by |
| 591 | 616 | have h1 : (F ∪ U).card = F.card + U.card := card_union_of_disjoint hdisj |
| 592 | 617 | have h2 := card_sdiff_add_card_eq_card hS'U |
| 593 | 618 | omega |
| 594 | 619 | rw [hsplit] |
| 595 | 620 | push_cast |
| 596 | | − have h1 : (1 : ℝ) ≤ (K - sCoef - eps + 1) * tau * m := by |
| 597 | | − norm_num [K, sCoef, eps, tau] |
| 598 | | − linarith only [hm] |
| 599 | | − linarith only [hout, hklt, h1] |
| 600 | | − |
| 601 | | −/-- Theorem 1 of the note at `τ = 1/32` from lemmas 1–4: refine every initial container at |
| 602 | | −level `⌈m^(1/8)⌉` and keep the outputs `F ∪ U` of the stated size. -/ |
| 603 | | −theorem cover_35_4_of_inputs (inputs : CoverInputs) {M : ℕ} |
| 621 | + linarith only [hout, hklt, hwidth] |
| 622 | + |
| 623 | +/-- Refine each initial container at level `⌈m^(1/8)⌉` and keep the outputs of size at |
| 624 | +most `width`. The count is independent of the bound used for the live outsiders. -/ |
| 625 | +theorem cover_of_outsider_bound (initial : type_of% @exceptional_card_32) |
| 626 | + (census : type_of% @leaf_census) (count : type_of% @leaf_count) |
| 627 | + {M : ℕ} {b width : ℝ} (outsiders : OutsiderBound M b) |
| 628 | + (hwidth : (1 - tau) * Real.sqrt M + 1 + b ≤ width) |
| 604 | 629 | (hm : (2 : ℝ) ^ 240 ≤ Real.sqrt M) : |
| 605 | 630 | ∃ 𝒞 : Finset (Finset ℕ), |
| 606 | 631 | (𝒞.card : ℝ) ≤ Real.exp (coverLog M tau + recordLog (Real.sqrt M)) ∧ |
| 607 | | − (∀ C ∈ 𝒞, C ⊆ host M ∧ (C.card : ℝ) ≤ (1 + K * tau) * Real.sqrt M) ∧ |
| 632 | + (∀ C ∈ 𝒞, C ⊆ host M ∧ (C.card : ℝ) ≤ width) ∧ |
| 608 | 633 | ∀ S ⊆ host M, IsSidon (S : Set ℕ) → seedSize M tau ≤ S.card → ∃ C ∈ 𝒞, S ⊆ C := by |
| 609 | 634 | classical |
| 610 | 635 | let out (T : Finset ℕ) : Finset (Finset ℕ) := |
| 611 | 636 | (leaves (extension M T) (level8 (Real.sqrt M))).image fun L => L.fixed ∪ L.live |
| 612 | 637 | let 𝒞 := ((initialFamily M).biUnion out).filter fun C => |
| 613 | | − C ⊆ host M ∧ (C.card : ℝ) ≤ (1 + K * tau) * Real.sqrt M |
| 638 | + C ⊆ host M ∧ (C.card : ℝ) ≤ width |
| 614 | 639 | have hscale : 10 ^ 14 / tau ^ 2 ≤ Real.sqrt M := le_trans (by norm_num [tau]) hm |
| 615 | 640 | have hM : 2 ≤ M := by |
| 616 | 641 | have hsq : Real.sqrt M ^ 2 = M := Real.sq_sqrt (Nat.cast_nonneg M) |
| | @@ -623,7 +648,7 @@ theorem cover_35_4_of_inputs (inputs : CoverInputs) {M : ℕ} |
| 623 | 648 | exact_mod_cast card_biUnion_le |
| 624 | 649 | _ ≤ ∑ _T ∈ initialFamily M, Real.exp (recordLog (Real.sqrt M)) := |
| 625 | 650 | sum_le_sum fun T hT => |
| 626 | | − (Nat.cast_le.mpr card_image_le).trans (inputs.count hm (mem_filter.mp hT).2.2) |
| 651 | + (Nat.cast_le.mpr card_image_le).trans (count hm (mem_filter.mp hT).2.2) |
| 627 | 652 | _ = (initialFamily M).card * Real.exp (recordLog (Real.sqrt M)) := by simp |
| 628 | 653 | _ ≤ Real.exp (coverLog M tau) * Real.exp (recordLog (Real.sqrt M)) := |
| 629 | 654 | mul_le_mul_of_nonneg_right (initial_count hM) (Real.exp_nonneg _) |
| | @@ -631,16 +656,31 @@ theorem cover_35_4_of_inputs (inputs : CoverInputs) {M : ℕ} |
| 631 | 656 | · intro S hS hsid hk |
| 632 | 657 | obtain ⟨S₀, h₀, hk₀⟩ := exists_subset_card_eq hk |
| 633 | 658 | obtain ⟨T, hT, hT₀⟩ := |
| 634 | | − initial_cover inputs hscale (h₀.trans hS) (Set.IsSidon.subset hsid h₀) hk₀ |
| 659 | + initial_cover initial hscale (h₀.trans hS) (Set.IsSidon.subset hsid h₀) hk₀ |
| 635 | 660 | have hTS := hT₀.trans h₀ |
| 636 | 661 | have hSC : S ⊆ extension M T := fun x hx => |
| 637 | 662 | mem_filter.mpr ⟨hS hx, Set.IsSidon.subset hsid (insert_subset hx hTS)⟩ |
| 638 | | − obtain ⟨h1, h2, h3⟩ := refined_size inputs hm (filter_subset _ _) |
| 663 | + obtain ⟨h1, h2, h3⟩ := refined_size census outsiders hwidth hm (filter_subset _ _) |
| 639 | 664 | (mem_filter.mp hT).2.2 hSC hsid hk |
| 640 | 665 | refine ⟨_, mem_filter.mpr ⟨mem_biUnion.mpr ⟨T, hT, mem_image.mpr |
| 641 | 666 | ⟨_, mem_image.mpr ⟨S, mem_filter.mpr ⟨mem_powerset.mpr hSC, hsid⟩, rfl⟩, rfl⟩⟩, |
| 642 | 667 | h2.trans (filter_subset _ _), h3⟩, h1⟩ |
| 643 | 668 | |
| 669 | +/-- Theorem 1 at `τ = 1/32` for the `35/4` cover. The margin between the width and the |
| 670 | +estimated leaf size pays for the ceiling in `seedSize`. -/ |
| 671 | +theorem cover_35_4_of_inputs (inputs : CoverInputs) {M : ℕ} |
| 672 | + (hm : (2 : ℝ) ^ 240 ≤ Real.sqrt M) : |
| 673 | + ∃ 𝒞 : Finset (Finset ℕ), |
| 674 | + (𝒞.card : ℝ) ≤ Real.exp (coverLog M tau + recordLog (Real.sqrt M)) ∧ |
| 675 | + (∀ C ∈ 𝒞, C ⊆ host M ∧ (C.card : ℝ) ≤ (1 + K * tau) * Real.sqrt M) ∧ |
| 676 | + ∀ S ⊆ host M, IsSidon (S : Set ℕ) → seedSize M tau ≤ S.card → ∃ C ∈ 𝒞, S ⊆ C := by |
| 677 | + refine cover_of_outsider_bound inputs.initial inputs.census inputs.count |
| 678 | + (b := (sCoef + eps) * tau * Real.sqrt M) ?_ ?_ hm |
| 679 | + · intro U S G |
| 680 | + exact few_outsiders_of_inputs inputs.toOutsiderInputs (U := U) (S := S) (G := G) hm |
| 681 | + · norm_num [K, sCoef, eps, tau] |
| 682 | + linarith only [hm] |
| 683 | + |
| 644 | 684 | /- ## The host calculation -/ |
| 645 | 685 | |
| 646 | 686 | /-- The eight inputs: the seven of the cover and the parameter estimate. -/ |