AFTD Auto-Formalizing Theoretical Domains

saturated_barrier_groups_outside_b_at_most_two

theoremverified

For pairwise disjoint groups inside an anticomplete set U, saturation of x in A and D and all but p,q in C forces at most two groups to meet the complement of B.

Statement

theorem saturated_barrier_groups_outside_b_at_most_two
    {I V : Type*} [Fintype V] [DecidableEq V] [DecidableEq I]
    (G : SimpleGraph V) (A B C D U : Finset V) (x p q : V)
    (hcover : A ∪ B ∪ C ∪ D = Finset.univ)
    (hxU : x ∉ U)
    (hanti : ∀ u ∈ U, ¬ G.Adj x u)
    (hsatA : ∀ a ∈ A, a ≠ x → G.Adj x a)
    (hsatD : ∀ d ∈ D, G.Adj x d)
    (hfull : ∀ z ∈ C, z ≠ p → z ≠ q → G.Adj x z)
    (K : Finset I) (F : I → Finset V)
    (hsub : ∀ i ∈ K, F i ⊆ U)
    (hdis : ∀ i ∈ K, ∀ j ∈ K, i ≠ j → Disjoint (F i) (F j)) :
    (K.filter (fun i => (F i \ B).Nonempty)).card ≤ 2
Source
OP-1957: reduction of positive-barrier components under saturation.
Verified
27 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 2

The proof, explained

The proof bounds the number of groups meeting the complement of B by constructing an injection into the two-element set {p, q}. First, because x is anticomplete to U but adjacent to all other vertices in the universe outside {p, q} and B, any vertex in U \\ B must be either p or q. Next, picking a representative from F i \\ B for each group meeting the complement of B defines a map into {p, q}. Because the groups are pairwise disjoint, no two groups can share a representative, making this map injective and forcing the number of such groups to be at most |{p, q}| ≤ 2.

  1. Every vertex in U that does not belong to B must be either p or q.

    Given u ∈ U with u ∉ B, since A ∪ B ∪ C ∪ D covers the entire vertex set, u must belong to A, B, C, or D. If u ∈ A, then u ≠ x (as x ∉ U), so x is adjacent to u by saturation of A, contradicting that x has no neighbours in U. If u ∈ B, this directly contradicts u ∉ B. If u ∈ D, x is adjacent to u, again contradicting anticompleteness to U. If u ∈ C, then u must equal p or q, because any other vertex in C is adjacent to x, which would also be a contradiction. Thus u ∈ {p, q}.

    lines 14–28

    uses Finset.mem_union, False.elim

      classical
      have hregion : ∀ u ∈ U, u ∉ B → u ∈ ({p,q} : Finset V) := by
        intro u hu hb
        have hc : u ∈ A ∪ B ∪ C ∪ D := by rw [hcover]; simp
        simp only [Finset.mem_union] at hc
        rcases hc with ((ha | hb') | hc) | hd
        · have hne : u ≠ x := by intro he; subst u; exact hxU hu
          exact False.elim (hanti u hu (hsatA u ha hne))
        · exact False.elim (hb hb')
        · by_cases hp : u = p
          · simp [hp]
          · by_cases hq : u = q
            · simp [hq]
            · exact False.elim (hanti u hu (hfull u hc hp hq))
        · exact False.elim (hanti u hu (hsatD u hd))
  2. Let L = {i ∈ K | F i \\ B is nonempty}; there is a choice function f : I → V selecting a representative f(i) ∈ F i \\ B for each i ∈ L.

    By the definition of L, for every index i ∈ L the set difference F i \\ B is nonempty, which means there exists some vertex in F i that is not in B. Using classical choice (Classical.choose), we construct a function f that assigns to each i ∈ L such a representative f(i) ∈ F i with f(i) ∉ B.

    lines 29–37

    uses Finset.mem_filter.mp, Finset.mem_sdiff.mp, Classical.choose_spec

      let L := K.filter (fun i => (F i \ B).Nonempty)
      have hex : ∀ i ∈ L, ∃ u, u ∈ F i ∧ u ∉ B := by
        intro i hi
        obtain ⟨u,hu⟩ := (Finset.mem_filter.mp hi).2
        exact ⟨u,(Finset.mem_sdiff.mp hu).1,(Finset.mem_sdiff.mp hu).2⟩
      let f : I → V := fun i => if h : i ∈ L then Classical.choose (hex i h) else p
      have hf : ∀ i ∈ L, f i ∈ F i ∧ f i ∉ B := by
        intro i hi
        simpa [f,hi] using Classical.choose_spec (hex i hi)
  3. The cardinality of L is at most the cardinality of {p, q}.

    By Finset.card_le_card_of_injOn, it suffices to show that f maps L into {p, q} and is injective on L. For any i ∈ L, f(i) ∈ F i ⊆ U and f(i) ∉ B, so by the earlier result (hregion), f(i) ∈ {p, q}. For injectivity, if f(i) = f(j) for distinct indices i, j ∈ L, then f(i) belongs to both F i and F j, contradicting the assumption that F i and F j are disjoint for distinct indices in K. Thus f is injective on L.

    lines 38–45

    uses Finset.card_le_card_of_injOn, Finset.disjoint_left.mp, Finset.mem_filter.mp

      have hle : L.card ≤ ({p,q} : Finset V).card := by
        apply Finset.card_le_card_of_injOn f
        · intro i hi
          exact hregion (f i) (hsub i (Finset.mem_filter.mp hi).1 (hf i hi).1) (hf i hi).2
        · intro i hi j hj hij
          by_contra hne
          have h := Finset.disjoint_left.mp (hdis i (Finset.mem_filter.mp hi).1 j (Finset.mem_filter.mp hj).1 hne)
          exact h (hf i hi).1 (hij ▸ (hf j hj).1)
  4. The number of indices in K whose group meets the complement of B is at most 2.

    We chain the inequality |L| ≤ |{p, q}| from the previous step with the fact that any two-element set has cardinality at most 2 (Finset.card_le_two), concluding |L| ≤ 2.

    lines 46–48

    uses Finset.card_le_two

      calc
        L.card ≤ ({p,q} : Finset V).card := hle
        _ ≤ 2 := Finset.card_le_two
Finset.mem_union
An element belongs to the union of two finite sets if and only if it belongs to the first set or the second set.
False.elim
From a contradiction (False), any conclusion can be deduced (the principle of explosion).
Finset.mem_filter.mp
If an element belongs to a filtered set {x ∈ s | p x}, then it belongs to s and satisfies the condition p.
Finset.mem_sdiff.mp
If an element belongs to the set difference s \\ t, then it belongs to s and does not belong to t.
Classical.choose_spec
The witness chosen by Classical.choose from an existence proof satisfies the corresponding predicate.
Finset.card_le_card_of_injOn
If a function maps a finite set s into a finite set t and is injective on s, then the cardinality of s is at most the cardinality of t.
Finset.disjoint_left.mp
If two sets are disjoint, then any element belonging to the first set does not belong to the second set.
Finset.card_le_two
A pair {a, b} has cardinality at most 2.

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

theorem saturated_barrier_groups_outside_b_at_most_two    {I V : Type*} [Fintype V] [DecidableEq V] [DecidableEq I]    (G : SimpleGraph V) (A B C D U : Finset V) (x p q : V)    (hcover : A ∪ B ∪ C ∪ D = Finset.univ)    (hxU : x ∉ U)    (hanti : ∀ u ∈ U, ¬ G.Adj x u)    (hsatA : ∀ a ∈ A, a ≠ x → G.Adj x a)    (hsatD : ∀ d ∈ D, G.Adj x d)    (hfull : ∀ z ∈ C, z ≠ p → z ≠ q → G.Adj x z)    (K : Finset I) (F : I → Finset V)    (hsub : ∀ i ∈ K, F i ⊆ U)    (hdis : ∀ i ∈ K, ∀ j ∈ K, i ≠ j → Disjoint (F i) (F j)) :    (K.filter (fun i => (F i \ B).Nonempty)).card ≤ 2 := by  classical  have hregion : ∀ u ∈ U, u ∉ B → u ∈ ({p,q} : Finset V) := by    intro u hu hb    have hc : u ∈ A ∪ B ∪ C ∪ D := by rw [hcover]; simp    simp only [Finset.mem_union] at hc    rcases hc with ((ha | hb') | hc) | hd    · have hne : u ≠ x := by intro he; subst u; exact hxU hu      exact False.elim (hanti u hu (hsatA u ha hne))    · exact False.elim (hb hb')    · by_cases hp : u = p      · simp [hp]      · by_cases hq : u = q        · simp [hq]        · exact False.elim (hanti u hu (hfull u hc hp hq))    · exact False.elim (hanti u hu (hsatD u hd))  let L := K.filter (fun i => (F i \ B).Nonempty)  have hex : ∀ i ∈ L, ∃ u, u ∈ F i ∧ u ∉ B := by    intro i hi    obtain ⟨u,hu⟩ := (Finset.mem_filter.mp hi).2    exact ⟨u,(Finset.mem_sdiff.mp hu).1,(Finset.mem_sdiff.mp hu).2⟩  let f : I → V := fun i => if h : i ∈ L then Classical.choose (hex i h) else p  have hf : ∀ i ∈ L, f i ∈ F i ∧ f i ∉ B := by    intro i hi    simpa [f,hi] using Classical.choose_spec (hex i hi)  have hle : L.card ≤ ({p,q} : Finset V).card := by    apply Finset.card_le_card_of_injOn f    · intro i hi      exact hregion (f i) (hsub i (Finset.mem_filter.mp hi).1 (hf i hi).1) (hf i hi).2    · intro i hi j hj hij      by_contra hne      have h := Finset.disjoint_left.mp (hdis i (Finset.mem_filter.mp hi).1 j (Finset.mem_filter.mp hj).1 hne)      exact h (hf i hi).1 (hij ▸ (hf j hj).1)  calc    L.card ≤ ({p,q} : Finset V).card := hle    _ ≤ 2 := Finset.card_le_two
See it in the graphDiscuss this resultChallenge it