| | @@ -402,27 +402,19 @@ end binomial_choice |
| 402 | 402 | open Filter |
| 403 | 403 | open scoped Asymptotics |
| 404 | 404 | |
| 405 | | −/-- The maximum chromatic-to-clique ratio is `O(n / (log₂ n)^2)`. -/ |
| 406 | | −theorem isBigO_upper : |
| 407 | | − (fun n : ℕ ↦ _root_.Erdos627.maxChromaticCliqueRatio n) =O[atTop] |
| 408 | | − (fun n : ℕ ↦ (n : ℝ) / Real.logb 2 n ^ 2) := by |
| 405 | +/-- If the Ramsey and greedy colouring parameters give at most `B * k` colours |
| 406 | +for every positive clique size `k`, the maximum chromatic-to-clique ratio is at most `B`. -/ |
| 407 | +theorem maxChromaticCliqueRatio_le_of_parameters {n : ℕ} {B : ℝ} (hB : 0 ≤ B) |
| 408 | + (hchoice : ∀ k : ℕ, 1 ≤ k → ∃ t m : ℕ, 0 < t ∧ Nat.choose (k + t - 1) k ≤ m ∧ |
| 409 | + ((n / t + m : ℕ) : ℝ) ≤ B * k) : |
| 410 | + _root_.Erdos627.maxChromaticCliqueRatio n ≤ B := by |
| 409 | 411 | classical |
| 410 | | − obtain ⟨C, hC, hchoice⟩ := exists_t_m |
| 411 | | − refine Asymptotics.IsBigO.of_bound C ?_ |
| 412 | | − filter_upwards [hchoice] with n hn |
| 413 | | − have hscale : 0 ≤ (n : ℝ) / Real.logb 2 n ^ 2 := by positivity |
| 414 | | − let ratio (G : SimpleGraph (Fin n)) : ℝ := |
| 415 | | − (G.chromaticNumber.toNat : ℝ) / (G.cliqueNum : ℝ) |
| 416 | | − have hratio : 0 ≤ ⨆ G, ratio G := |
| 417 | | − (by positivity : 0 ≤ ratio ⊥).trans (le_ciSup (Finite.bddAbove_range ratio) ⊥) |
| 418 | | − change ‖⨆ G, ratio G‖ ≤ _ |
| 419 | | − rw [Real.norm_of_nonneg hscale, Real.norm_of_nonneg hratio] |
| 412 | + unfold _root_.Erdos627.maxChromaticCliqueRatio |
| 420 | 413 | refine ciSup_le fun G => ?_ |
| 421 | | − change (G.chromaticNumber.toNat : ℝ) / (G.cliqueNum : ℝ) ≤ _ |
| 422 | 414 | by_cases hk : G.cliqueNum = 0 |
| 423 | | − · simpa [hk] using mul_nonneg hC.le hscale |
| 415 | + · simpa [hk] using hB |
| 424 | 416 | have hkpos : 0 < G.cliqueNum := Nat.pos_of_ne_zero hk |
| 425 | | − obtain ⟨t, m, ht, hm, hbound⟩ := hn G.cliqueNum hkpos |
| 417 | + obtain ⟨t, m, ht, hm, hbound⟩ := hchoice G.cliqueNum hkpos |
| 426 | 418 | have hcolor : G.Colorable (n / t + m) := by |
| 427 | 419 | have hset : ∀ s : Finset (Fin n), m ≤ s.card → |
| 428 | 420 | ∃ u ⊆ s, G.IsIndepSet (u : Set (Fin n)) ∧ t ≤ u.card := by |
| | @@ -448,9 +440,24 @@ theorem isBigO_upper : |
| 448 | 440 | have hχ : G.chromaticNumber.toNat ≤ n / t + m := by |
| 449 | 441 | exact ENat.toNat_le_of_le_natCast (chromaticNumber_le_iff_colorable.mpr hcolor) |
| 450 | 442 | apply (div_le_iff₀ (by exact_mod_cast hkpos : (0 : ℝ) < G.cliqueNum)).2 |
| 451 | | − calc |
| 452 | | − (G.chromaticNumber.toNat : ℝ) ≤ ((n / t + m : ℕ) : ℝ) := by exact_mod_cast hχ |
| 453 | | − _ ≤ C * G.cliqueNum * ((n : ℝ) / Real.logb 2 n ^ 2) := hbound |
| 454 | | − _ = (C * ((n : ℝ) / Real.logb 2 n ^ 2)) * G.cliqueNum := by ring |
| 443 | + exact (Nat.cast_le.mpr hχ).trans hbound |
| 444 | + |
| 445 | +/-- The maximum chromatic-to-clique ratio is `O(n / (log₂ n)^2)`. -/ |
| 446 | +theorem isBigO_upper : |
| 447 | + (fun n : ℕ ↦ _root_.Erdos627.maxChromaticCliqueRatio n) =O[atTop] |
| 448 | + (fun n : ℕ ↦ (n : ℝ) / Real.logb 2 n ^ 2) := by |
| 449 | + classical |
| 450 | + obtain ⟨C, hC, hchoice⟩ := exists_t_m |
| 451 | + refine Asymptotics.IsBigO.of_bound C ?_ |
| 452 | + filter_upwards [hchoice] with n hn |
| 453 | + have hscale : 0 ≤ (n : ℝ) / Real.logb 2 n ^ 2 := by positivity |
| 454 | + let ratio (G : SimpleGraph (Fin n)) : ℝ := |
| 455 | + (G.chromaticNumber.toNat : ℝ) / (G.cliqueNum : ℝ) |
| 456 | + have hratio : 0 ≤ ⨆ G, ratio G := |
| 457 | + (by positivity : 0 ≤ ratio ⊥).trans (le_ciSup (Finite.bddAbove_range ratio) ⊥) |
| 458 | + change ‖⨆ G, ratio G‖ ≤ _ |
| 459 | + rw [Real.norm_of_nonneg hscale, Real.norm_of_nonneg hratio] |
| 460 | + refine maxChromaticCliqueRatio_le_of_parameters (mul_nonneg hC.le hscale) ?_ |
| 461 | + simpa only [mul_right_comm C] using hn |
| 455 | 462 | |
| 456 | 463 | end ErdosSwarm.Erdos627 |