AFTD Auto-Formalizing Theoretical Domains

op869_bipartite_gadget_growth

theoremverified

When two disjoint bipartite graphs are joined by a new vertex adjacent to a designated side of one, the combined graph has a bipartition with at least ceil(t/2) more colors on one side.

Statement

theorem op869_bipartite_gadget_growth {α β γ : Type} [Fintype α] [Fintype β]
    [DecidableEq α] [DecidableEq β] [DecidableEq γ]
    (G : SimpleGraph (Option (α ⊕ β))) (colors : Option (α ⊕ β) → Finset γ)
    (p : α → Bool) (q : β → Bool) (a t : ℕ)
    (hleft : ∀ x y, G.Adj (some (Sum.inl x)) (some (Sum.inl y)) → p x ≠ p y)
    (hright : ∀ x y, G.Adj (some (Sum.inr x)) (some (Sum.inr y)) → q x ≠ q y)
    (hcross : ∀ x y, ¬ G.Adj (some (Sum.inl x)) (some (Sum.inr y)))
    (hnewright : ∀ y, ¬ G.Adj none (some (Sum.inr y)))
    (hnewleft : ∀ x, G.Adj none (some (Sum.inl x)) ↔ p x = true)
    (hproper : ∀ x y, G.Adj x y → Disjoint (colors x) (colors y))
    (hcard : (colors none).card = t)
    (hP : a ≤ ((Finset.univ.filter (fun x => p x = true)).biUnion
      (fun x => colors (some (Sum.inl x)))).card)
    (hQ : a ≤ ((Finset.univ.filter (fun x => q x = true)).biUnion
      (fun x => colors (some (Sum.inr x)))).card) :
    ∃ flip target : Bool,
      (∀ x y, G.Adj x y → op869_gadget_side p q flip x ≠ op869_gadget_side p q flip y) ∧
      a + (t+1)/2 ≤ ((Finset.univ.filter (fun x => op869_gadget_side p q flip x = target)).biUnion colors).card
Source
arXiv:2610.41516, Lemma 2.3
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • op869_color_set_amplificationIf P and Q each have at least a elements and X has t elements disjoint from P, then P union Q or Q union X has at least a plus ceil(t/2)…
Used by 1
  • op869_board_two_copies_amplifyOn the actual finite board, after two disjoint bipartite copies and a new vertex joined to the first designated side, one can orient the…

The proof, explained

The proof connects two disjoint bipartite graphs via a new vertex adjacent only to the designated (true) side of the left component. Applying the color-set amplification lemma, either the union of the two designated color sets P and Q, or the union of Q and the new vertex's color set, has at least a + ⌈t/2⌉ colors. In the first case, keeping the original bipartitions (flip = false) yields at least a + ⌈t/2⌉ colors on the true side; in the second case, inverting the right component's bipartition (flip = true) groups Q with the new vertex on the false side to achieve the same bound.

  1. The auxiliary function `op869_gadget_side` defines a proper 2-coloring of the combined graph for any boolean value of `flip`.

    We check that any two adjacent vertices x and y receive different sides under `op869_gadget_side`. By case analysis: the new vertex `none` cannot be adjacent to itself by irreflexivity of simple graphs (`False.elim`), nor to any vertex in the right component by `hnewright` (`False.elim`), and its neighbors in the left component satisfy `p = true`, differing from `op869_gadget_side none = false`. Cross-edges between the left and right components are impossible by `hcross` (`False.elim`). Adjacent vertices within the left component have different p-values by `hleft`, and adjacent vertices within the right component have different q-values by `hright`, which remain different regardless of whether `flip` is true or false.

    lines 14–41

    uses False.elim, op869_gadget_side

      intro x y h
      cases x with
      | none =>
        cases y with
        | none => exact False.elim (G.irrefl h)
        | some y =>
          cases y with
          | inl a => simpa [op869_gadget_side, hnewleft a h]
          | inr b => exact False.elim (hnewright b h)
      | some x =>
        cases x with
        | inl a =>
          cases y with
          | none => simpa [op869_gadget_side, hnewleft a h.symm]
          | some y =>
            cases y with
            | inl b => exact hleft a b h
            | inr b => exact False.elim (hcross a b h)
        | inr a =>
          cases y with
          | none => exact False.elim (hnewright a h.symm)
          | some y =>
            cases y with
            | inl b => exact False.elim (hcross b a h.symm)
            | inr b =>
              have hab := hright a b h
              cases flip <;> cases ha : q a <;> cases hb : q b <;>
                simp_all [op869_gadget_side]
  2. Let P and Q be the sets of colors assigned to the designated (true) sides of the left and right components, respectively.

    Under classical logic, P is defined as the union of colors of all left vertices where p evaluates to true, and Q is the union of colors of all right vertices where q evaluates to true.

    lines 62–64

      classical
      let P := (Finset.univ.filter (fun x => p x = true)).biUnion (fun x => colors (some (Sum.inl x)))
      let Q := (Finset.univ.filter (fun x => q x = true)).biUnion (fun x => colors (some (Sum.inr x)))
  3. The color set of the new vertex is disjoint from P.

    By `Finset.disjoint_left.mpr`, it suffices to show that no color c in the color set of `none` belongs to P. If c were in P, it would belong to `colors (some (Sum.inl x))` for some x with `p x = true` by `Finset.mem_biUnion.mp` and `Finset.mem_filter.mp`. But by `hnewleft`, any such vertex x is adjacent to `none`, so by proper coloring (`hproper`), their color sets are disjoint, contradicting c belonging to both sets by `Finset.disjoint_left.mp`.

    lines 65–70

    uses Finset.disjoint_left.mpr, Finset.mem_biUnion.mp, Finset.mem_filter.mp, Finset.disjoint_left.mp

      have hdis : Disjoint (colors none) P := by
        apply Finset.disjoint_left.mpr
        intro c hc hcp
        obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hcp
        have hpx : p x = true := (Finset.mem_filter.mp hx).2
        exact Finset.disjoint_left.mp (hproper none _ ((hnewleft x).mpr hpx)) hc hxc
  4. Either |P ∪ Q| ≥ a + ⌈t/2⌉ or |Q ∪ colors(none)| ≥ a + ⌈t/2⌉, and `op869_gadget_side` provides a proper coloring for any boolean flip.

    Applying the lemma `op869_color_set_amplification` with the bounds on |P| and |Q|, the size |colors(none)| = t, and the disjointness of `colors none` and P yields that either P ∪ Q or Q ∪ colors(none) has size at least a + (t + 1) / 2. Separately, the auxiliary lemma `op869_gadget_side_proper` establishes that `op869_gadget_side` is a proper 2-coloring for any choice of `flip`. We split into the two cases given by `hgrow`.

    lines 71–74

    uses op869_color_set_amplification, op869_gadget_side_proper

      have hgrow := op869_color_set_amplification P Q (colors none) a t hP hQ hcard hdis
      have hside (f : Bool) := op869_gadget_side_proper G p q hleft hright hcross hnewright
        (fun x hx => (hnewleft x).mp hx) f
      rcases hgrow with hPQ | hQX
  5. In the first case (|P ∪ Q| ≥ a + ⌈t/2⌉), taking flip = false and target = true achieves the required color count.

    We set `flip = false` and `target = true`. The coloring is proper by `op869_gadget_side_proper`. To lower-bound the target color count, by `le_trans` and `Finset.card_le_card` it suffices to show P ∪ Q is a subset of the colors on vertices assigned true. For any c ∈ P ∪ Q, by `Finset.mem_union.mp`, either c ∈ P or c ∈ Q. If c ∈ P, it comes from a left vertex x with `p x = true`, which `op869_gadget_side` assigns to true; if c ∈ Q, it comes from a right vertex x with `q x = true`, which with `flip = false` is also assigned to true. In both branches, `Finset.mem_biUnion.mpr` places c in the union of colors on the target side.

    lines 75–83

    uses le_trans, Finset.card_le_card, Finset.mem_union.mp, Finset.mem_biUnion.mp, Finset.mem_filter.mp, Finset.mem_biUnion.mpr, op869_gadget_side

      · refine ⟨false, true, hside false, le_trans hPQ (Finset.card_le_card ?_)⟩
        intro c hc
        rcases Finset.mem_union.mp hc with hc | hc
        · obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hc
          have hpx : p x = true := (Finset.mem_filter.mp hx).2
          exact Finset.mem_biUnion.mpr ⟨some (Sum.inl x), by simp [op869_gadget_side, hpx], hxc⟩
        · obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hc
          have hqx : q x = true := (Finset.mem_filter.mp hx).2
          exact Finset.mem_biUnion.mpr ⟨some (Sum.inr x), by simp [op869_gadget_side, hqx], hxc⟩
  6. In the second case (|Q ∪ colors(none)| ≥ a + ⌈t/2⌉), taking flip = true and target = false achieves the required color count.

    We set `flip = true` and `target = false`. The coloring is proper by `op869_gadget_side_proper`. By `le_trans` and `Finset.card_le_card`, it suffices to show Q ∪ colors(none) is a subset of the colors on vertices assigned false. For any c ∈ Q ∪ colors(none), either c ∈ Q or c ∈ colors(none) by `Finset.mem_union.mp`. If c ∈ Q, it comes from a right vertex x with `q x = true`; since `flip = true`, the gadget assignment negates q, mapping x to ¬true = false, matching the target. If c ∈ colors(none), the new vertex `none` itself is assigned false by definition of `op869_gadget_side`. In either case, `Finset.mem_biUnion.mpr` shows c is in the target color union.

    lines 84–90

    uses le_trans, Finset.card_le_card, Finset.mem_union.mp, Finset.mem_biUnion.mp, Finset.mem_filter.mp, Finset.mem_biUnion.mpr, op869_gadget_side

      · refine ⟨true, false, hside true, le_trans hQX (Finset.card_le_card ?_)⟩
        intro c hc
        rcases Finset.mem_union.mp hc with hc | hc
        · obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hc
          have hqx : q x = true := (Finset.mem_filter.mp hx).2
          exact Finset.mem_biUnion.mpr ⟨some (Sum.inr x), by simp [op869_gadget_side, hqx], hxc⟩
        · exact Finset.mem_biUnion.mpr ⟨none, by simp [op869_gadget_side], hc⟩
False.elim
The principle of explosion: from False, any proposition follows.
op869_gadget_side
The side assignment function sending `none` to false, left vertices to p, and right vertices to q (or ¬q when flipped).
op869_gadget_side_proper
The bipartite coloring extended to the joined graph via `op869_gadget_side` is proper for any boolean choice of `flip`.
Finset.disjoint_left.mpr
A finite set s is disjoint from t if every element of s does not belong to t.
Finset.mem_biUnion.mp
If an element belongs to a union of sets indexed by s, then it belongs to some set in the collection.
Finset.mem_filter.mp
An element belonging to a filtered set belongs to the base set and satisfies the filtering condition.
Finset.disjoint_left.mp
If two finite sets are disjoint, an element of the first set cannot belong to the second.
op869_color_set_amplification
For finite sets P, Q, X with |P| ≥ a, |Q| ≥ a, |X| = t, and X disjoint from P, either |P ∪ Q| or |Q ∪ X| has cardinality at least a + ⌈t/2⌉.
le_trans
The inequality relation ≤ is transitive: if a ≤ b and b ≤ c then a ≤ c.
Finset.card_le_card
If s ⊆ t for finite sets s and t, then |s| ≤ |t|.
Finset.mem_union.mp
An element in s ∪ t belongs to s or belongs to t.
Finset.mem_biUnion.mpr
If an element belongs to f(x) for some x ∈ s, then it belongs to the union over s of f.

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

def op869_gadget_side {α β : Type} (p : α → Bool) (q : β → Bool) (flip : Bool) : Option (α ⊕ β) → Bool  | none => false  | some (Sum.inl a) => p a  | some (Sum.inr b) => if flip then !q b else q btheorem op869_gadget_side_proper {α β : Type} (G : SimpleGraph (Option (α ⊕ β)))    (p : α → Bool) (q : β → Bool)    (hleft : ∀ a b, G.Adj (some (Sum.inl a)) (some (Sum.inl b)) → p a ≠ p b)    (hright : ∀ a b, G.Adj (some (Sum.inr a)) (some (Sum.inr b)) → q a ≠ q b)    (hcross : ∀ a b, ¬ G.Adj (some (Sum.inl a)) (some (Sum.inr b)))    (hnewright : ∀ b, ¬ G.Adj none (some (Sum.inr b)))    (hnewleft : ∀ a, G.Adj none (some (Sum.inl a)) → p a = true)    (flip : Bool) : ∀ x y, G.Adj x y → op869_gadget_side p q flip x ≠ op869_gadget_side p q flip y := by  intro x y h  cases x with  | none =>    cases y with    | none => exact False.elim (G.irrefl h)    | some y =>      cases y with      | inl a => simpa [op869_gadget_side, hnewleft a h]      | inr b => exact False.elim (hnewright b h)  | some x =>    cases x with    | inl a =>      cases y with      | none => simpa [op869_gadget_side, hnewleft a h.symm]      | some y =>        cases y with        | inl b => exact hleft a b h        | inr b => exact False.elim (hcross a b h)    | inr a =>      cases y with      | none => exact False.elim (hnewright a h.symm)      | some y =>        cases y with        | inl b => exact False.elim (hcross b a h.symm)        | inr b =>          have hab := hright a b h          cases flip <;> cases ha : q a <;> cases hb : q b <;>            simp_all [op869_gadget_side]/-- The graph-gluing growth step in the bipartite online-coloring gadget. -/theorem op869_bipartite_gadget_growth {α β γ : Type} [Fintype α] [Fintype β]    [DecidableEq α] [DecidableEq β] [DecidableEq γ]    (G : SimpleGraph (Option (α ⊕ β))) (colors : Option (α ⊕ β) → Finset γ)    (p : α → Bool) (q : β → Bool) (a t : ℕ)    (hleft : ∀ x y, G.Adj (some (Sum.inl x)) (some (Sum.inl y)) → p x ≠ p y)    (hright : ∀ x y, G.Adj (some (Sum.inr x)) (some (Sum.inr y)) → q x ≠ q y)    (hcross : ∀ x y, ¬ G.Adj (some (Sum.inl x)) (some (Sum.inr y)))    (hnewright : ∀ y, ¬ G.Adj none (some (Sum.inr y)))    (hnewleft : ∀ x, G.Adj none (some (Sum.inl x)) ↔ p x = true)    (hproper : ∀ x y, G.Adj x y → Disjoint (colors x) (colors y))    (hcard : (colors none).card = t)    (hP : a ≤ ((Finset.univ.filter (fun x => p x = true)).biUnion      (fun x => colors (some (Sum.inl x)))).card)    (hQ : a ≤ ((Finset.univ.filter (fun x => q x = true)).biUnion      (fun x => colors (some (Sum.inr x)))).card) :    ∃ flip target : Bool,      (∀ x y, G.Adj x y → op869_gadget_side p q flip x ≠ op869_gadget_side p q flip y) ∧      a + (t+1)/2 ≤ ((Finset.univ.filter (fun x => op869_gadget_side p q flip x = target)).biUnion colors).card := by  classical  let P := (Finset.univ.filter (fun x => p x = true)).biUnion (fun x => colors (some (Sum.inl x)))  let Q := (Finset.univ.filter (fun x => q x = true)).biUnion (fun x => colors (some (Sum.inr x)))  have hdis : Disjoint (colors none) P := by    apply Finset.disjoint_left.mpr    intro c hc hcp    obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hcp    have hpx : p x = true := (Finset.mem_filter.mp hx).2    exact Finset.disjoint_left.mp (hproper none _ ((hnewleft x).mpr hpx)) hc hxc  have hgrow := op869_color_set_amplification P Q (colors none) a t hP hQ hcard hdis  have hside (f : Bool) := op869_gadget_side_proper G p q hleft hright hcross hnewright    (fun x hx => (hnewleft x).mp hx) f  rcases hgrow with hPQ | hQX  · refine ⟨false, true, hside false, le_trans hPQ (Finset.card_le_card ?_)⟩    intro c hc    rcases Finset.mem_union.mp hc with hc | hc    · obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hc      have hpx : p x = true := (Finset.mem_filter.mp hx).2      exact Finset.mem_biUnion.mpr ⟨some (Sum.inl x), by simp [op869_gadget_side, hpx], hxc⟩    · obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hc      have hqx : q x = true := (Finset.mem_filter.mp hx).2      exact Finset.mem_biUnion.mpr ⟨some (Sum.inr x), by simp [op869_gadget_side, hqx], hxc⟩  · refine ⟨true, false, hside true, le_trans hQX (Finset.card_le_card ?_)⟩    intro c hc    rcases Finset.mem_union.mp hc with hc | hc    · obtain ⟨x, hx, hxc⟩ := Finset.mem_biUnion.mp hc      have hqx : q x = true := (Finset.mem_filter.mp hx).2      exact Finset.mem_biUnion.mpr ⟨some (Sum.inr x), by simp [op869_gadget_side, hqx], hxc⟩    · exact Finset.mem_biUnion.mpr ⟨none, by simp [op869_gadget_side], hc⟩
See it in the graphDiscuss this resultChallenge it