Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 639

Source:Erdős Problems
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Is it true that if the edges of KnK_n are 2-coloured then there are at most n2/4n^2/4 many edges which do not occur in a monochromatic triangle?

Solved by Erdős, Rousseau, and Schelp for large nn, but unpublished. Alon has observed that this also follows from a result of Pyber [Py86], which states that (for large enough nn) at most ⌊n2/4⌋+2\lfloor n^2/4\rfloor+2 monochromatic cliques cover all edges of a 22-coloured KnK_n.

This problem was solved completely by Keevash and Sudakov [KeSu04], who proved that the correct threshold is ⌊n2/4⌋\lfloor n^2/4\rfloor for all n≥7n\geq 7, is (n2)\binom{n}{2} for n≤5n\leq 5, and is 1010 for n=6n=6.

Since the bound fails for small nn (at n=6n=6 the threshold is 10>62/410 > 6^2/4), the statement is formalized in the asymptotic reading in which the problem was posed and solved: for all sufficiently large nn, every 22-colouring of the edges of KnK_n leaves at most n2/4n^2/4 edges not occurring in a monochromatic triangle. Edges of KnK_n are the non-diagonal unordered pairs Sym2 (Fin n); an edge {x,y}\{x, y\} occurs in a monochromatic triangle if and only if there is a third vertex zz with C({x,z})=C({y,z})=C({x,y})C(\{x, z\}) = C(\{y, z\}) = C(\{x, y\}).

The linked file proves the bound for every finite vertex type with at least 1010 vertices, which gives the atTop reading below, and collects the uncovered edges as the edge set of a graph rather than as a set of pairs.

Subjects:Combinatorics (math.CO)
MSC classes:05
Tags:question, formal_proof
Cite as:NS.02680 [math.CO] · NS.02680v1 for this version
Declaration:Erdos639.erdos_639
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:d68aef35b3bb5657e03f4f47717997bfc789798112c59caec10ca1d6f3e4f23c
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/639.lean

Formal statement

theorem erdos_639 :
    ∀ᶠ (n : ℕ) in atTop, ∀ C : Sym2 (Fin n) → Fin 2,
      {e : Sym2 (Fin n) | ¬e.IsDiag ∧
        ∀ x y : Fin n, e = s(x, y) →
          ¬∃ z, z ≠ x ∧ z ≠ y ∧ C s(x, z) = C e ∧ C s(y, z) = C e}.ncard ≤ n ^ 2 / 4
Show the full Challenge.lean (124 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 639

*References:*
- [erdosproblems.com/639](https://www.erdosproblems.com/639)
- [Er97d] Erdős, Paul, *Some recent problems and results in graph theory*. Discrete Math.
  (1997), 81-85.
- [KeSu04] Keevash, Peter and Sudakov, Benny, *On the number of edges not covered by monochromatic
  copies of a fixed graph*. J. Combin. Theory Ser. B (2004), 41-53.
- [Py86] Pyber, L., *Clique covering of graphs*. Combinatorica (1986), 393-398.
-/

@[expose] public section

open Filter

namespace Erdos639

set_option linter.style.formal_proof_palomar false in
/--
Is it true that if the edges of $K_n$ are 2-coloured then there are at most $n^2/4$ many edges
which do not occur in a monochromatic triangle?

Solved by Erdős, Rousseau, and Schelp for large $n$, but unpublished. Alon has observed that this
also follows from a result of Pyber [Py86], which states that (for large enough $n$) at most
$\lfloor n^2/4\rfloor+2$ monochromatic cliques cover all edges of a $2$-coloured $K_n$.

This problem was solved completely by Keevash and Sudakov [KeSu04], who proved that the correct
threshold is $\lfloor n^2/4\rfloor$ for all $n\geq 7$, is $\binom{n}{2}$ for $n\leq 5$, and is
$10$ for $n=6$.

Since the bound fails for small $n$ (at $n=6$ the threshold is $10 > 6^2/4$), the statement is
formalized in the asymptotic reading in which the problem was posed and solved: for all
sufficiently large $n$, every $2$-colouring of the edges of $K_n$ leaves at most $n^2/4$ edges
not occurring in a monochromatic triangle. Edges of $K_n$ are the non-diagonal unordered pairs
`Sym2 (Fin n)`; an edge $\{x, y\}$ occurs in a monochromatic triangle if and only if there is a
third vertex $z$ with $C(\{x, z\}) = C(\{y, z\}) = C(\{x, y\})$.

The linked file proves the bound for every finite vertex type with at least $10$ vertices, which
gives the `atTop` reading below, and collects the uncovered edges as the edge set of a graph
rather than as a set of pairs.
-/
@[category research solved, question, AMS 5, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/68da20b96673899166e94638f5a7fffeb7231d35/src/latest/ErdosProblems/Erdos639.lean"]
theorem erdos_639 :
    ∀ᶠ (n : ℕ) in atTop, ∀ C : Sym2 (Fin n) → Fin 2,
      {e : Sym2 (Fin n) | ¬e.IsDiag ∧
        ∀ x y : Fin n, e = s(x, y) →
          ¬∃ z, z ≠ x ∧ z ≠ y ∧ C s(x, z) = C e ∧ C s(y, z) = C e}.ncard ≤ n ^ 2 / 4 := by
  sorry

/-- The edges of a two-coloured complete graph that lie in no monochromatic triangle. -/
def uncoveredEdges {n : ℕ} (C : Sym2 (Fin n) → Fin 2) : Set (Sym2 (Fin n)) :=
  {e | ¬e.IsDiag ∧ ∀ x y : Fin n, e = s(x, y) →
    ¬∃ z, z ≠ x ∧ z ≠ y ∧ C s(x, z) = C e ∧ C s(y, z) = C e}

/--
The exact maximum number of uncovered edges is $\binom{n}{2}$ for $n\leq 5$, $10$ for
$n=6$, and $\lfloor n^2/4\rfloor$ for $n\geq 7$ [KeSu04, Theorem 1.1].
`IsGreatest` states both the upper bound and its attainment by a colouring.
-/
@[category research solved, AMS 5]
theorem erdos_639.variants.exact :
    ∀ n : ℕ, IsGreatest
      (Set.range fun C : Sym2 (Fin n) → Fin 2 => (uncoveredEdges C).ncard)
      (if n ≤ 5 then n.choose 2 else if n = 6 then 10 else n ^ 2 / 4) := by
  sorry

set_option linter.style.formal_proof_palomar false in
/-- Every two-colouring of $K_n$ with $n\geq 10$ has at most
$\lfloor n^2/4\rfloor$ uncovered edges [KeSu04, Proposition 2.1]. -/
@[category research solved, AMS 5, formal_proof using lean4 at
  "https://github.com/AItoBit/formal-conjectures/blob/0ad11a9f7f83c7ada19d42f1a95964465fb1195f/proofs/erdos639/Bridge639.lean"]
theorem erdos_639.variants.ten_le :
    ∀ n : ℕ, 10 ≤ n → ∀ C : Sym2 (Fin n) → Fin 2,
      (uncoveredEdges C).ncard ≤ n ^ 2 / 4 := by
  sorry

/-- A colouring of $K_6$ with exactly ten uncovered edges. -/
private def sixColoring (e : Sym2 (Fin 6)) : Fin 2 :=
  if e ∈ ({s(0, 1), s(1, 2), s(2, 3), s(3, 4), s(4, 0),
      s(5, 1), s(5, 4), s(0, 5)} : Finset (Sym2 (Fin 6))) then 0 else 1

private def sixUncovered : Finset (Sym2 (Fin 6)) :=
  {s(0, 2), s(0, 3), s(1, 2), s(1, 3), s(1, 4),
    s(2, 3), s(2, 4), s(2, 5), s(3, 4), s(3, 5)}

/-- There is a two-colouring of $K_6$ with ten uncovered edges, exceeding $6^2/4$. -/
@[category research solved, AMS 5]
theorem erdos_639.variants.six_vertices :
    ∃ C : Sym2 (Fin 6) → Fin 2, (uncoveredEdges C).ncard = 10 ∧
      6 ^ 2 / 4 < (uncoveredEdges C).ncard := by
  have h : (uncoveredEdges sixColoring).ncard = 10 := by
    have hs : uncoveredEdges sixColoring = (sixUncovered : Set (Sym2 (Fin 6))) := by
      unfold uncoveredEdges
      apply Set.ext
      simp only [Set.mem_ofPred_eq]
      decide
    rw [hs, Set.ncard_coe_finset]
    decide
  refine ⟨sixColoring, h, ?_⟩
  rw [h]
  decide

end Erdos639

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos639.erdos_639 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_639 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-639
nosorry submit erdos-639 nosorry/erdos-639/Solution.lean --wait

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.