Flashes and rainbows in tournaments for (2, 4) and (3, 3)

3 of 6 main results in Lean (50%); 2 of 6 Lean + SAT certificate (Theorems 1 and 2: t(2, 4) = 8 and t(3, 3) = 9 couple Lean-proved CNF equisatisfiability, symmetry-breaking, and RUP-checker soundness with external DRAT/LRAT/cake_lpr UNSAT proofs); 1 of 6 certificate-only (Proposition 6: the exhaustive grid classification of good tournaments for (2, 3), (2, 4) and (3, 3)); 1 open conjecture · AI-generated and directed by Tyler B. Hughes · No human mathematician has yet refereed the proof.

Every two players in a tournament are joined by one arrow, from winner to loser, and each arrow is coloured. Some coloured 8-player tournament avoids 2 same-colour arrows in a row and 4 different-colour arrows in a row. No 9-player one can, given computer certificates checked outside Lean.

For all k, l ≥ 1 some tournament on k^(l − 1) players has a colouring with no k-flash and no l-rainbow, and, for walks and for paths alike, the largest number of players that allows this is exactly 8 when k = 2 and l = 4, provided Lean's refutation checker accepts some refutation of the 9-player formula with four players in a fixed ranking, and exactly 9 when k = l = 3, provided it accepts refutations of the three 10-player case formulas.

Girão, Illingworth, Michel, Savery and Scott (2024) conjectured that the answer is always k to the power (l − 1), and noted that the question was wide open once flashes have at least 2 arrows and rainbows at least 3. Lefmann, Rödl and Thomas (1992) had settled the ranked case, where the players are ranked in a strict order, when flashes have at most 2 arrows or rainbows at most 4. The cases (2, 4) and (3, 3) are the two smallest open ones.

The 8-player and 9-player colourings

Take the 8 strings 111, 112, 121, 122, 211, 212, 221, 222 as players. Between two strings, the arrow goes from the one that comes earlier in dictionary order, and its colour is the leftmost position where they differ. So 112 → 121 has colour 2, and 111 → 222 has colour 1.

Only 3 colours exist, so no 4 arrows in a row can all have different colours.

An arrow of colour c goes from a string with 1 in position c to a string with 2 there. Two arrows of colour c in a row would need the middle string to have both 1 and 2 in position c, which is impossible. So there is no 2-flash.

For (3, 3), take the 9 strings 11, 12, 13, 21, …, 33 in the same way, with 2 colours. Along arrows of one colour the digit in that position goes up, for example 11 → 21 → 31 in colour 1. Three such arrows would need four rising digits from 1 to 3, so there is no 3-flash, and with 2 colours there is no 3-rainbow.

Tournaments, flashes and rainbows

A tournament on n players has exactly one arrow between every two players. A walk follows arrows and may revisit players; a path never does. A k-flash is a walk of k arrows of one colour, and an l-rainbow is a walk of l arrows with all colours different. t(k, l) is the largest number of players for which some coloured tournament has neither, and a good colouring for walks on M players, together with a proof that M + 1 players cannot be coloured well even for paths, settles it for walks and paths at once.

  • One construction and one impossibility settle both versions

    If M players can be coloured well for walks, and M + 1 players cannot be coloured well for paths, then M is the exact answer for walks and for paths, and t(k, l) = M for both.

    theorem TournamentEdgeColor.exact_both_of_walk_lower_path_upper {k : ℕ} {l : ℕ} {M : ℕ} (hlow : ExistsAvoidingWalk M k l) (hup : ¬ExistsAvoidingPath (M + 1) k l) :
      IsExactWalkThreshold k l M ∧ IsExactPathThreshold k l M ∧ t_walk k l = M ∧ t_path k l = M
  • A tournament
  • A walk
  • A path
  • k same-colour arrows in a row (a k-flash)
  • A path of k same-colour arrows (a k-flash path)
  • l arrows in a row, all of different colours (an l-rainbow)
  • A path of l arrows, all of different colours (an l-rainbow path)
  • A good colouring for walks
  • A good colouring for paths
  • A flash only needs neighbouring arrows to match

    For k ≥ 1, there is a k-flash exactly when there is a walk of k arrows in which every two neighbouring arrows have the same colour.

    theorem TournamentEdgeColor.hasMonoWalk_iff_adj {n : ℕ} {k : ℕ} {C : Type u_1} (hk : 1 ≤ k) (T : Tournament n) (c : Fin n → Fin n → C) :
      HasMonoWalk T c k ↔
      ∃ w, ∀ (i : ℕ) (hi : i + 1 < k), c (w.vert ⟨i, ⋯⟩) (w.vert ⟨i + 1, ⋯⟩) = c (w.vert ⟨i + 1, ⋯⟩) (w.vert ⟨i + 2, ⋯⟩)
  • n players can be coloured well, for walks
  • n players can be coloured well, for paths
  • The exact answer for walks
  • The exact answer for paths
  • Most players with no k-flash and no l-rainbow (walks)
  • Most players with no k-flash path and no l-rainbow path

Fewer players, renamed players, fewer colours

A good colouring stays good on any group of the players and after the players are renamed. For k ≥ 1, only which arrows share a colour matters, never the colours themselves, and with at least 2 players any colouring can be replaced by one with at most n(n − 1)/2 colours in which the same arrows share colours.

  • At most one colour per pair is needed

    For n ≥ 2, any colouring of a tournament on n players can be replaced by one with n(n − 1)/2 colours in which two arrows share a colour exactly when they did before.

    theorem TournamentEdgeColor.exists_fin_edges_recoloring {n : ℕ} {C : Type u_1} (hn : 2 ≤ n) (T : Tournament n) (c : Fin n → Fin n → C) :
      ∃ c', ∀ (u₁ v₁ u₂ v₂ : Fin n), T.edge u₁ v₁ → T.edge u₂ v₂ → (c u₁ v₁ = c u₂ v₂ ↔ c' u₁ v₁ = c' u₂ v₂)
  • The tournament on a group of players
  • A walk in the group is a walk in the whole
  • A good colouring stays good on a group, for walks

    If the colouring is good for walks, it is good on any group of the players.

    theorem TournamentEdgeColor.avoidsWalk_pullback {m : ℕ} {n : ℕ} {k : ℕ} {l : ℕ} {C : Type u_1} (T : Tournament n) (c : Fin n → Fin n → C) (f : Fin m → Fin n) (hf : Function.Injective f) (h : AvoidsWalk k l T c) :
      AvoidsWalk k l (T.pullback f hf) fun u v => c (f u) (f v)
  • Renaming players changes nothing, for paths

    After the players are renamed, the colouring is good for paths exactly when it was before.

    theorem TournamentEdgeColor.avoidsPath_iso {n : ℕ} {k : ℕ} {l : ℕ} {C : Type u_1} (T : Tournament n) (c : Fin n → Fin n → C) (e : Fin n ≃ Fin n) :
      (AvoidsPath k l (T.pullback ⇑e ⋯) fun u v => c (e u) (e v)) ↔ AvoidsPath k l T c
  • Fewer players is never harder, for walks

    If m ≤ n and n players can be coloured well for walks, so can m.

    theorem TournamentEdgeColor.existsAvoidingWalk_of_le {m : ℕ} {n : ℕ} {k : ℕ} {l : ℕ} (hmn : m ≤ n) (h : ExistsAvoidingWalk n k l) :
      ExistsAvoidingWalk m k l
  • Fewer players is never harder, for paths

    If m ≤ n and n players can be coloured well for paths, so can m.

    theorem TournamentEdgeColor.existsAvoidingPath_of_le {m : ℕ} {n : ℕ} {k : ℕ} {l : ℕ} (hmn : m ≤ n) (h : ExistsAvoidingPath n k l) :
      ExistsAvoidingPath m k l
  • Only matching colours matter, for walks

    Let k ≥ 1. If two colourings of the same tournament agree on which pairs of arrows share a colour, then one is good for walks exactly when the other is.

    theorem TournamentEdgeColor.avoidsWalk_iff_of_eq_iff {n : ℕ} {k : ℕ} {l : ℕ} {C₁ : Type u_1} {C₂ : Type u_2} (hk : 1 ≤ k) (T : Tournament n) (c₁ : Fin n → Fin n → C₁) (c₂ : Fin n → Fin n → C₂) (heq : ∀ (u₁ v₁ u₂ v₂ : Fin n), T.edge u₁ v₁ → T.edge u₂ v₂ → (c₁ u₁ v₁ = c₁ u₂ v₂ ↔ c₂ u₁ v₁ = c₂ u₂ v₂)) :
      AvoidsWalk k l T c₁ ↔ AvoidsWalk k l T c₂
  • A number for each pair of players

The grid gives k to the power (l − 1) players

Place the players at points of a grid with l − 1 coordinates, each taking one of k values, so that every arrow raises some coordinate, and colour each arrow by a coordinate it raises. Along one colour that coordinate keeps rising, so a flash has fewer than k arrows, and with l − 1 colours there is no l-rainbow. The whole grid in dictionary order is a tournament on k to the power (l − 1) players, which gives the lower bound for every k, l ≥ 1.

  • k to the power (l − 1) players can be coloured well

    For all k, l ≥ 1, some tournament on k to the power (l − 1) players has a colouring with no k-flash and no l-rainbow.

    theorem TournamentEdgeColor.lexGrid_lower_bound {k : ℕ} {l : ℕ} (hk : 1 ≤ k) (hl : 1 ≤ l) :
      ExistsAvoidingWalk (k ^ (l - 1)) k l
  • A grid point
  • Placing a tournament in a grid
  • Fits in the grid
  • A grid placement gives a good colouring with d colours

    If d ≥ 1 and the tournament fits in the grid with d coordinates of k values, then some colouring with d colours has no k-flash and no (d + 1)-rainbow.

    theorem TournamentEdgeColor.gridEmbedding_avoidsWalk_fin {n : ℕ} {k : ℕ} {d : ℕ} (hd : 1 ≤ d) {T : Tournament n} (h : HasGridEmbedding T k d) :
      ∃ c, AvoidsWalk k (d + 1) T c
  • The same for every d

    If k ≥ 1 and the tournament fits in the grid with d coordinates of k values, then some colouring has no k-flash and no (d + 1)-rainbow.

    theorem TournamentEdgeColor.gridEmbedding_avoidsWalk {n : ℕ} {k : ℕ} {d : ℕ} (hk : 1 ≤ k) {T : Tournament n} (h : HasGridEmbedding T k d) :
      ∃ C c, AvoidsWalk k (d + 1) T c
  • The grid tournament
  • 8 players work for (2, 4)

    Some coloured tournament on 8 players has no 2-flash and no 4-rainbow, for walks and for paths.

    theorem TournamentEdgeColor.lower_bound_2_4 :
      ExistsAvoidingWalk 8 2 4 ∧ ExistsAvoidingPath 8 2 4
  • 9 players work for (3, 3)

    Some coloured tournament on 9 players has no 3-flash and no 3-rainbow, for walks and for paths.

    theorem TournamentEdgeColor.lower_bound_3_3 :
      ExistsAvoidingWalk 9 3 3 ∧ ExistsAvoidingPath 9 3 3

Few colours means a grid

The converse also holds. If d colours leave no k-flash, give each player, for each colour, the length of the longest one-colour walk of that colour ending at it. These lengths place the players in the grid with d coordinates from 0 to k − 1, and every arrow raises the coordinate of its own colour. So, for k, d ≥ 1, a colouring with d colours and no k-flash exists exactly when the tournament fits in the grid with d coordinates of k values, and then it has at most kᵈ players.

  • d colours work exactly when the tournament fits in the grid

    For all k, d ≥ 1, a tournament has a colouring with d colours, no k-flash and no (d + 1)-rainbow if and only if it fits in the grid with d coordinates of k values.

    theorem TournamentEdgeColor.bounded_palette_iff_gridEmbedding {n : ℕ} {k : ℕ} {d : ℕ} (hk : 1 ≤ k) (hd : 1 ≤ d) (T : Tournament n) :
      (∃ c, AvoidsWalk k (d + 1) T c) ↔ HasGridEmbedding T k d
  • Add one arrow at the end of a walk
  • No flash with d colours gives a grid placement

    If k ≥ 1 and a colouring with d colours has no k-flash, then the tournament fits in the grid with d coordinates of k values.

    theorem TournamentEdgeColor.hasGridEmbedding_of_fin_no_monoWalk {n : ℕ} {k : ℕ} {d : ℕ} (hk : 1 ≤ k) {T : Tournament n} (c : Fin n → Fin n → Fin d) (hno : ¬HasMonoWalk T c k) :
      HasGridEmbedding T k d
  • d colours allow at most kᵈ players

    If k ≥ 1 and a colouring of a tournament on n players with d colours has no k-flash, then n ≤ kᵈ.

    theorem TournamentEdgeColor.bounded_palette_card_le {n : ℕ} {k : ℕ} {d : ℕ} (hk : 1 ≤ k) (T : Tournament n) (c : Fin n → Fin n → Fin d) (hno : ¬HasMonoWalk T c k) :
      n ≤ k ^ d
  • Colour reduction
  • Colour reduction would prove the conjecture for walks

    For k ≥ 1 and l ≥ 2, if colour reduction holds for (k, l), then k to the power (l − 1) is the exact answer for walks, so t(k, l) equals k to the power (l − 1) for walks.

    theorem TournamentEdgeColor.cr_implies_conj_1_7 {k : ℕ} {l : ℕ} (hk : 1 ≤ k) (hl : 2 ≤ l) (hCR : ColorReductionHolds k l) :
      IsExactWalkThreshold k l (k ^ (l - 1)) ∧ t_walk k l = k ^ (l - 1)

Small cases settled by hand

Every tournament with at least one player has a path through all its players, a theorem of Rédei (1934). On k + 1 players that path has k arrows, and either all its neighbouring arrows share colours, which makes a k-flash, or two neighbours differ, which makes a 2-rainbow. So t(k, 2) = k for every k ≥ 1. For (2, 3), a chain of forced arrows on 5 players ends in a contradiction, so t(2, 3) = 4.

  • t(k, 2) = k

    For every k ≥ 1, the exact answer for (k, 2) is k, for walks and for paths.

    theorem TournamentEdgeColor.exact_k_2 {k : ℕ} (hk : 1 ≤ k) :
      IsExactWalkThreshold k 2 k ∧ IsExactPathThreshold k 2 k ∧ t_walk k 2 = k ∧ t_path k 2 = k
  • t(2, 3) = 4

    The exact answer for (2, 3) is 4, for walks and for paths.

    theorem TournamentEdgeColor.exact_2_3 :
      IsExactWalkThreshold 2 3 4 ∧ IsExactPathThreshold 2 3 4 ∧ t_walk 2 3 = 4 ∧ t_path 2 3 = 4
  • Rédei's theorem

    For n ≥ 1, every tournament on n players has a path through all n of them.

    theorem TournamentEdgeColor.exists_hamiltonian_path {n : ℕ} (a.0 : 1 ≤ n) (T : Tournament n) :
      Nonempty (DirPath T (n - 1))
  • k + 1 players are too many for (k, 2)

    For k ≥ 1, every coloured tournament on k + 1 players has a flash path of k arrows or a rainbow path of 2 arrows.

    theorem TournamentEdgeColor.not_existsAvoidingPath_k_2 {k : ℕ} (hk : 1 ≤ k) :
      ¬ExistsAvoidingPath (k + 1) k 2
  • 5 players are too many for (2, 3)

    Every coloured tournament on 5 players has a flash path of 2 arrows or a rainbow path of 3 arrows.

    theorem TournamentEdgeColor.not_existsAvoidingPath_5_2_3 :
      ¬ExistsAvoidingPath 5 2 3
  • Three players make a path of 2 arrows
  • Four players make a path of 3 arrows

An exact formula and a checker for refutations

For n players, a yes-or-no formula has one variable for the direction of the arrow between each two players, and one for each two pairs of players, saying whether their arrows share a colour. Lean proves that, for k ≥ 1, the formula can be satisfied exactly when some coloured tournament on n players has no flash path of k arrows and no rainbow path of l arrows. It also proves that a refutation accepted by its forcing checker shows a formula cannot be satisfied, and runs the checker in full on a 3-player case.

  • For k ≥ 1, the yes/no formula answers the path question exactly: n players can avoid both exactly when it can be satisfied

    For k ≥ 1, n players can be coloured well for paths if and only if the formula for n players can be satisfied.

    theorem TournamentEdgeColor.existsAvoidingPath_iff_sat_tourneyPathCNF {n : ℕ} {k : ℕ} {l : ℕ} (hk : 1 ≤ k) :
      ExistsAvoidingPath n k l ↔ ∃ σ, Satisfies σ (tourneyPathCNF n k l)
  • The refutation checker can be trusted

    If the checker accepts a refutation of a formula, then the formula cannot be satisfied.

    theorem TournamentEdgeColor.checkRUPProof_sound {V : Type} [DecidableEq V] (F : CNF V) (proof : List (Clause V)) (a.0 : checkRUPProof F proof = true) :
      Unsat F
  • A literal
  • The opposite literal
  • A clause
  • A formula
  • A truth assignment
  • The value of a literal
  • Satisfying a clause
  • Satisfying a formula
  • A formula that cannot be satisfied
  • Finding the state of a clause
  • Repeated sweeps
  • A literal and its opposite
  • A clause that forcing confirms
  • A confirmed clause follows from the formula

    If a clause is confirmed, every assignment that satisfies the formula also satisfies the clause.

    theorem TournamentEdgeColor.isRUP_sound {V : Type} [DecidableEq V] {db : CNF V} {c : Clause V} (hrup : isRUP db c = true) (σ : Eval V) (a.0 : Satisfies σ db) :
      SatisfiesClause σ c
  • The refutation checker
  • The variables of the tournament formula
  • A code for a pair of players
  • All pair codes
  • The literal "not u → v"
  • The tournament formula
  • The assignment read off a coloured tournament
  • A good colouring satisfies the formula

    If k ≥ 1 and a colouring is good for paths, the assignment read off it satisfies the formula.

    theorem TournamentEdgeColor.avoidingPath_satisfies_cnf {n : ℕ} {k : ℕ} {l : ℕ} {C : Type u_1} (hk : 1 ≤ k) (T : Tournament n) (c : Fin n → Fin n → C) (hav : AvoidsPath k l T c) :
      Satisfies (tourneyEval T c) (tourneyPathCNF n k l)
  • An unsatisfiable formula rules out n players

    If k ≥ 1 and the formula for n players cannot be satisfied, then n players cannot be coloured well for paths.

    theorem TournamentEdgeColor.not_existsAvoidingPath_of_unsat {n : ℕ} {k : ℕ} {l : ℕ} (hk : 1 ≤ k) (hunsat : Unsat (tourneyPathCNF n k l)) :
      ¬ExistsAvoidingPath n k l
  • A satisfying assignment gives a good colouring

    If k ≥ 1 and some assignment satisfies the formula for n players, then some coloured tournament on n players is good for paths.

    theorem TournamentEdgeColor.existsAvoidingPath_of_sat {n : ℕ} {k : ℕ} {l : ℕ} (hk : 1 ≤ k) (hsat : ∃ σ, Satisfies σ (tourneyPathCNF n k l)) :
      ExistsAvoidingPath n k l
  • t(2, 2) = 2, through the checker

    The exact answer for (2, 2) is 2, for walks and for paths, proved by running the checker.

    theorem TournamentEdgeColor.exact_2_2_via_rup :
      IsExactWalkThreshold 2 2 2 ∧ IsExactPathThreshold 2 2 2 ∧ t_walk 2 2 = 2 ∧ t_path 2 2 = 2

Eight and nine, given the certificates

Every tournament on at least 8 players contains 4 players ranked in a fixed order, so the 9-player formula may assume it. Every tournament on at least 10 players contains such 4 players plus a little more. In a colouring with no rainbow path of 3 arrows, some two of the 3 arrows 0 → 1 → 2 → 3 along the ranking share a colour, which splits the 10-player question into 3 cases. With the grid constructions this gives t(2, 4) = 8 and t(3, 3) = 9 for walks and paths, provided refutations of those formulas are accepted by Lean's checker.

  • t(2, 4) = 8, given a refutation of the ranked formula

    If the checker accepts some refutation of the (2, 4) formula for 9 players with players 0 to 3 ranked, then 8 is the exact answer for (2, 4), and t(2, 4) = 8, for walks and for paths.

    theorem TournamentEdgeColor.t_2_4_exact_of_tt4_rup (h_rup_tt4 : ∃ proof, checkRUPProof (tourneyPathCNF_TT4 9 2 4) proof = true) :
      IsExactWalkThreshold 2 4 8 ∧ IsExactPathThreshold 2 4 8 ∧ t_walk 2 4 = 8 ∧ t_path 2 4 = 8
  • t(3, 3) = 9, given refutations of the three cases

    If the checker accepts some refutation of each of the case formulas A, B and C for 10 players, then 9 is the exact answer for (3, 3), and t(3, 3) = 9, for walks and for paths.

    theorem TournamentEdgeColor.t_3_3_exact_of_cube33_rup (h_rup_A : ∃ proof, checkRUPProof (cube33A 10) proof = true) (h_rup_B : ∃ proof, checkRUPProof (cube33B 10) proof = true) (h_rup_C : ∃ proof, checkRUPProof (cube33C 10) proof = true) :
      IsExactWalkThreshold 3 3 9 ∧ IsExactPathThreshold 3 3 9 ∧ t_walk 3 3 = 9 ∧ t_path 3 3 = 9
  • Large tournaments contain a ranked group

    For every m, every tournament on at least 2ᵐ⁻¹ players has m players in a fixed ranking.

  • 8 players contain a ranked 4

    Every tournament on at least 8 players has 4 players in a fixed ranking.

    theorem TournamentEdgeColor.exists_TT4_of_ge_8 {n : ℕ} (hn : 8 ≤ n) (T : Tournament n) :
      ∃ f, IsTransitiveEmbedding T f
  • 10 players contain a ranked 4 and a little more

    Every tournament on at least 10 players has 6 different players a, b, c, d, e, f with a, b, c, d in a fixed ranking, and a → e, a → f and e → f.

  • The formula with players 0 to 3 ranked
  • Assuming four ranked players loses nothing

    If n ≥ 8, k ≥ 1 and the ranked formula for n players cannot be satisfied, then n players cannot be coloured well for paths.

  • The case with 0 → 1 and 1 → 2 in one colour
  • The case with 1 → 2 and 2 → 3 in one colour
  • The case with 0 → 1 and 2 → 3 in one colour
  • Three cases cover everything

    If n ≥ 10 and none of the three case formulas can be satisfied, then n players cannot be coloured well for (3, 3) paths.