{
  "id": "1167",
  "ident": "NS.01167",
  "slug": "erdos-162",
  "title": "Erdős Problem 162",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $\\alpha > 0$ and $n \\geq 1$. Let $F(n,\\alpha)$ be the largest $k$ such that there exists some\n2-colouring of the edges of $K_n$ in which any induced subgraph $H$ on at least $k$ vertices\ncontains more than $\\alpha\\binom{|H|}{2}$ many edges of each colour.\n\nProve that for every fixed $0 \\leq \\alpha \\leq 1/2$, as $n \\to \\infty$,\n$F(n,\\alpha) \\sim c_\\alpha \\log n$ for some constant $c_\\alpha$.\n\nWe require $\\alpha < 1/2$: at $\\alpha = 1/2$ no colouring works for any `k ≤ n`\n(see `erdos_162.variants.half`).",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos162.erdos_162",
  "statement_lean": "theorem erdos_162 (α : ℝ) (h0 : 0 ≤ α) (h1 : α < 1 / 2) :\n    ∃ c : ℝ, (fun n : ℕ ↦ (F n α : ℝ)) ~[atTop] (fun n : ℕ ↦ c * Real.log n)",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 162\n\n*References:*\n- [erdosproblems.com/162](https://www.erdosproblems.com/162)\n- [Er90b] Erdős, Paul, *Problems and results on graphs and hypergraphs: similarities and\n  differences*. Mathematics of Ramsey theory (1990), 12-28.\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos162\n\n/-- The number of edges of $K_n$ inside `H` that get colour `b` under the colouring `c`. -/\ndef colourEdgeCount {n : ℕ} (c : Sym2 (Fin n) → Bool) (H : Finset (Fin n)) (b : Bool) : ℕ :=\n  (H.sym2.filter (fun e ↦ ¬ e.IsDiag ∧ c e = b)).card\n\n/-- Every set `H` of at least `k` vertices contains more than $\\alpha\\binom{|H|}{2}$ edges of\neach colour under `c`. -/\ndef IsBalancedAbove (n : ℕ) (α : ℝ) (c : Sym2 (Fin n) → Bool) (k : ℕ) : Prop :=\n  ∀ H : Finset (Fin n), k ≤ H.card → ∀ b : Bool,\n    α * (H.card.choose 2 : ℝ) < colourEdgeCount c H b\n\n/-- $F(n, \\alpha)$: the smallest `k` such that some 2-colouring of $K_n$ satisfies\n`IsBalancedAbove n α c k`.\n\nThe source says \"largest `k`\". Read literally, every `k > n` works vacuously, so no largest `k`\nexists. The smallest `k` is the reading consistent with the stated $\\Theta(\\log n)$ growth. -/\nnoncomputable def F (n : ℕ) (α : ℝ) : ℕ :=\n  sInf {k : ℕ | ∃ c : Sym2 (Fin n) → Bool, IsBalancedAbove n α c k}\n\n/--\nLet $\\alpha > 0$ and $n \\geq 1$. Let $F(n,\\alpha)$ be the largest $k$ such that there exists some\n2-colouring of the edges of $K_n$ in which any induced subgraph $H$ on at least $k$ vertices\ncontains more than $\\alpha\\binom{|H|}{2}$ many edges of each colour.\n\nProve that for every fixed $0 \\leq \\alpha \\leq 1/2$, as $n \\to \\infty$,\n$F(n,\\alpha) \\sim c_\\alpha \\log n$ for some constant $c_\\alpha$.\n\nWe require $\\alpha < 1/2$: at $\\alpha = 1/2$ no colouring works for any `k ≤ n`\n(see `erdos_162.variants.half`).\n-/\n@[category research open, AMS 5]\ntheorem erdos_162 (α : ℝ) (h0 : 0 ≤ α) (h1 : α < 1 / 2) :\n    ∃ c : ℝ, (fun n : ℕ ↦ (F n α : ℝ)) ~[atTop] (fun n : ℕ ↦ c * Real.log n) := by\n  sorry\n\n/--\nIt is easy to show with the probabilistic method that there exist $c_1(\\alpha), c_2(\\alpha)$ such\nthat $c_1(\\alpha)\\log n < F(n,\\alpha) < c_2(\\alpha)\\log n$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_162.variants.bounds (α : ℝ) (h0 : 0 ≤ α) (h1 : α < 1 / 2) :\n    ∃ c₁ c₂ : ℝ, 0 < c₁ ∧ c₁ < c₂ ∧ ∀ᶠ n : ℕ in atTop,\n      c₁ * Real.log n < F n α ∧ (F n α : ℝ) < c₂ * Real.log n := by\n  sorry\n\n/--\nAt $\\alpha = 1/2$ the two colour counts in $H$ add up to $\\binom{|H|}{2}$, so both cannot exceed\nhalf of it. Hence $F(n, 1/2) = n + 1$, and the claim fails at $\\alpha = 1/2$.\n-/\n@[category textbook, AMS 5]\ntheorem erdos_162.variants.half (n : ℕ) : F n (1 / 2) = n + 1 := by\n  have hvac : ∀ c : Sym2 (Fin n) → Bool, IsBalancedAbove n (1 / 2) c (n + 1) := by\n    intro c H hH\n    have := H.card_le_univ\n    simp at this\n    omega\n  refine le_antisymm (Nat.sInf_le ⟨fun _ ↦ true, hvac _⟩) ?_\n  refine le_csInf ⟨n + 1, fun _ ↦ true, hvac _⟩ ?_\n  rintro k ⟨c, hc⟩\n  by_contra! hk\n  have ht := hc Finset.univ (by simp; omega) true\n  have hf := hc Finset.univ (by simp; omega) false\n  have hsum : colourEdgeCount c Finset.univ true + colourEdgeCount c Finset.univ false =\n      n.choose 2 := by\n    have h1 := Finset.card_filter_add_card_filter_not\n      (s := (Finset.univ : Finset (Fin n)).sym2.filter fun e ↦ ¬ e.IsDiag) (fun e ↦ c e = true)\n    simp only [Finset.filter_filter, Bool.not_eq_true] at h1\n    rw [colourEdgeCount, colourEdgeCount, h1, Finset.sym2_univ, ← Fintype.card_subtype,\n      Sym2.card_subtype_not_diag, Fintype.card_fin]\n  simp only [Finset.card_univ, Fintype.card_fin] at ht hf\n  have : (colourEdgeCount c Finset.univ true : ℝ) + colourEdgeCount c Finset.univ false =\n      n.choose 2 := by exact_mod_cast hsum\n  linarith\n\n/-- `k = n + 1` always works, since no vertex set has more than `n` elements. -/\n@[category API, AMS 5]\ntheorem isBalancedAbove_succ (n : ℕ) (α : ℝ) (c : Sym2 (Fin n) → Bool) :\n    IsBalancedAbove n α c (n + 1) := by\n  intro H hH\n  have := H.card_le_univ\n  simp at this\n  omega\n\n/-- $F(n, \\alpha)$ is at most `n + 1`. -/\n@[category API, AMS 5]\ntheorem F_le_succ (n : ℕ) (α : ℝ) : F n α ≤ n + 1 :=\n  Nat.sInf_le ⟨fun _ ↦ true, isBalancedAbove_succ n α _⟩\n\nend Erdos162\n",
  "statement_hash": "4e29437ffdc9fa77a3be18026659ce9b6f14e8648e0082807ea47b73deee9d06",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}