AFTD Auto-Formalizing Theoretical Domains

op869_repeated_colors_have_reservations

theoremverified

If every one of KqD copies contains at least q colors and fewer than K colors occur globally, choose q distinct colors and D disjoint copies per color in which it occurs.

Statement

theorem op869_repeated_colors_have_reservations {α β : Type} [DecidableEq α] [DecidableEq β]
    (A : Finset α) (B : Finset β) (R : α → β → Prop) [DecidableRel R] (K q D : ℕ)
    (hq : 1 ≤ q) (hqK : q ≤ K) (hD : 1 ≤ D) (hA : A.card = K * q * D)
    (hB : B.card < K) (hd : ∀ a ∈ A, q ≤ (B.filter (R a)).card) :
    ∃ color : Fin q → β, Function.Injective color ∧ (∀ i, color i ∈ B) ∧
      ∃ reserve : Fin q → Finset α,
        (∀ i, (reserve i).card = D ∧ ∀ a ∈ reserve i, a ∈ A ∧ R a (color i)) ∧
        ∀ i j, i ≠ j → Disjoint (reserve i) (reserve j)
Source
arXiv:2610.41516, Section 2.2
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • op869_repeated_color_incidenceSuppose there are KqD copies and fewer than K colors, and every copy contains at least q colors. If 1 ≤ q ≤ K and D ≥ 1, at least q colors…
  • op869_disjoint_reserved_copiesIf each of q colors occurs in at least qD copies, one can reserve D copies for each color so that reservations for different colors are…

The proof, explained

By an incidence counting lemma (op869_repeated_color_incidence), having K * q * D copies with at least q colors each on fewer than K available colors forces at least q 'frequent' colors to each appear in at least q * D copies. We choose q such distinct colors and consider for each the set of copies containing it. A disjoint transversal lemma (op869_disjoint_reserved_copies) then selects D disjoint copies per color from these sets of size at least q * D.

  1. At least q colors appear in at least q * D copies.

    Define H as the set of colors in B that occur in at least q * D elements of A. Applying the incidence lemma op869_repeated_color_incidence with |A| = K * q * D, each element of A containing at least q colors, and the total number of colors |B| < K, a double-counting argument guarantees that |H| ≥ q.

    lines 10–12

    uses op869_repeated_color_incidence

      classical
      let H := B.filter (fun b => q * D ≤ (A.filter (fun a => R a b)).card)
      have hH : q ≤ H.card := op869_repeated_color_incidence A B R K q D hq hqK hD hA hB hd
  2. There exist q distinct colors in H, which we index by Fin q.

    Since |H| ≥ q, Finset.exists_subset_card_eq provides a subset T ⊆ H of size exactly q. Using Fintype.equivFinOfCardEq, we identify Fin q bijectively with T, defining an injective function color : Fin q → β whose image is contained in H.

    lines 13–17

    uses Finset.exists_subset_card_eq, Fintype.equivFinOfCardEq

      obtain ⟨T, hTH, hT⟩ := Finset.exists_subset_card_eq hH
      let e : Fin q ≃ {b // b ∈ T} := (Fintype.equivFinOfCardEq (by simpa using hT)).symm
      let color : Fin q → β := fun i => (e i).1
      have hinj : Function.Injective color := Subtype.val_injective.comp e.injective
      have hcolor : ∀ i, color i ∈ H := fun i => hTH (e i).2
  3. For each chosen color, the set of elements in A containing it has size at least q * D.

    For each index i in Fin q, let S i be the set of elements a ∈ A containing color i. Since color i belongs to H, the filtering condition defining H (unpacked via Finset.mem_filter.mp) gives |S i| ≥ q * D.

    lines 18–21

    uses Finset.mem_filter.mp

      let S : Fin q → Finset α := fun i => A.filter (fun a => R a (color i))
      have hS : ∀ i, q * D ≤ (S i).card := by
        intro i
        exact (Finset.mem_filter.mp (hcolor i)).2
  4. Each color can be assigned a reserved set of D copies such that the reserved sets are mutually disjoint.

    Applying op869_disjoint_reserved_copies to the q sets S i, each of size at least q * D, produces subsets reserve i ⊆ S i with |reserve i| = D that are pairwise disjoint for distinct indices i ≠ j.

    line 22

    uses op869_disjoint_reserved_copies

      obtain ⟨reserve, hreserve, hdisj⟩ := op869_disjoint_reserved_copies q D S hS
  5. The chosen colors and reserved sets satisfy all required properties.

    We assemble the full existential witness from color and reserve. Injectivity of color and disjointness of the reserved sets were established earlier. Each color i belongs to B because color i ∈ H ⊆ B (unpacked by Finset.mem_filter.mp). Each reserve i has size D, and every element a ∈ reserve i belongs to S i, meaning a ∈ A and R a (color i) (also by Finset.mem_filter.mp).

    lines 23–29

    uses Finset.mem_filter.mp

      refine ⟨color, hinj, ?_, reserve, ?_, hdisj⟩
      · intro i
        exact (Finset.mem_filter.mp (hcolor i)).1
      · intro i
        refine ⟨(hreserve i).2, ?_⟩
        intro a ha
        exact Finset.mem_filter.mp ((hreserve i).1 ha)
op869_repeated_color_incidence
If a bipartite incidence relation between A and B satisfies |A| = K * q * D with left-degrees at least q and |B| < K, then at least q vertices in B have degree at least q * D into A.
Finset.exists_subset_card_eq
A finite set with at least n elements contains a subset of cardinality exactly n.
Fintype.equivFinOfCardEq
A finite type of cardinality n is in bijection with Fin n.
Finset.mem_filter.mp
An element belongs to a filtered set if and only if it belongs to the base set and satisfies the filter condition.
op869_disjoint_reserved_copies
Given q sets each of cardinality at least q * D, there exist pairwise disjoint subsets of size D, one drawn from each set.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- A finite combinatorial step in the three-colorable online-coloring simulation. -/theorem op869_repeated_colors_have_reservations {α β : Type} [DecidableEq α] [DecidableEq β]    (A : Finset α) (B : Finset β) (R : α → β → Prop) [DecidableRel R] (K q D : ℕ)    (hq : 1 ≤ q) (hqK : q ≤ K) (hD : 1 ≤ D) (hA : A.card = K * q * D)    (hB : B.card < K) (hd : ∀ a ∈ A, q ≤ (B.filter (R a)).card) :    ∃ color : Fin q → β, Function.Injective color ∧ (∀ i, color i ∈ B) ∧      ∃ reserve : Fin q → Finset α,        (∀ i, (reserve i).card = D ∧ ∀ a ∈ reserve i, a ∈ A ∧ R a (color i)) ∧        ∀ i j, i ≠ j → Disjoint (reserve i) (reserve j) := by  classical  let H := B.filter (fun b => q * D ≤ (A.filter (fun a => R a b)).card)  have hH : q ≤ H.card := op869_repeated_color_incidence A B R K q D hq hqK hD hA hB hd  obtain ⟨T, hTH, hT⟩ := Finset.exists_subset_card_eq hH  let e : Fin q ≃ {b // b ∈ T} := (Fintype.equivFinOfCardEq (by simpa using hT)).symm  let color : Fin q → β := fun i => (e i).1  have hinj : Function.Injective color := Subtype.val_injective.comp e.injective  have hcolor : ∀ i, color i ∈ H := fun i => hTH (e i).2  let S : Fin q → Finset α := fun i => A.filter (fun a => R a (color i))  have hS : ∀ i, q * D ≤ (S i).card := by    intro i    exact (Finset.mem_filter.mp (hcolor i)).2  obtain ⟨reserve, hreserve, hdisj⟩ := op869_disjoint_reserved_copies q D S hS  refine ⟨color, hinj, ?_, reserve, ?_, hdisj⟩  · intro i    exact (Finset.mem_filter.mp (hcolor i)).1  · intro i    refine ⟨(hreserve i).2, ?_⟩    intro a ha    exact Finset.mem_filter.mp ((hreserve i).1 ha)
See it in the graphDiscuss this resultChallenge it