AFTD Auto-Formalizing Theoretical Domains

anticomplete_vertex_four_disjoint_nonneighbor_sets_bound

theoremverified

If a vertex is anticomplete to a block and its degree is within r of the number of vertices outside the block other than itself, then four pairwise disjoint sets of its non-neighbors (other than itself) have at most r vertices outside the block in total.

Statement

theorem anticomplete_vertex_four_disjoint_nonneighbor_sets_bound {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)
    [DecidableRel G.Adj] (Q : Finset V) (v : V) (hv : v ∉ Q)
    (hanti : ∀ b ∈ Q, ¬ G.Adj v b) (d r : ℕ)
    (hsize : Fintype.card V = Q.card + d + 1)
    (hdeg : d ≤ (G.neighborFinset v).card + r)
    (s1 s2 s3 s4 : Finset V)
    (hs : ∀ w, (w ∈ s1 ∨ w ∈ s2 ∨ w ∈ s3 ∨ w ∈ s4) → w ≠ v ∧ ¬ G.Adj v w)
    (d12 : Disjoint s1 s2) (d13 : Disjoint s1 s3) (d14 : Disjoint s1 s4)
    (d23 : Disjoint s2 s3) (d24 : Disjoint s2 s4) (d34 : Disjoint s3 s4) :
    (s1 \ Q).card + (s2 \ Q).card + (s3 \ Q).card + (s4 \ Q).card ≤ r
Source
OP-1957: graph-to-count transfer for the size-five block forced-edge route (IN-1126).
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
Used by 7

The proof, explained

The proof bounds the total number of elements outside Q in four disjoint sets s₁, s₂, s₃, s₄ of non-neighbors of v (distinct from v). First, anticomplete_neighbor_defect_bound shows that the defect set T of all non-neighbors of v outside Q ∪ {v} has size at most r. Next, each sᵢ \ Q is shown to be a subset of T, and their mutual disjointness is inherited from that of the sᵢ. Finally, four_disjoint_subsets_card_sum_le bounds the sum of their cardinalities by |T| ≤ r.

  1. The defect set of non-neighbors of v outside Q ∪ {v} has at most r elements.

    By hypothesis, v ∉ Q is anticomplete to Q, there are d vertices outside Q ∪ {v}, and deg(v) ≥ d - r. Applying the lemma anticomplete_neighbor_defect_bound guarantees that the set of vertices outside Q other than v that are not adjacent to v, namely T = ((Finset.univ \ Q).erase v) \ G.neighborFinset v, has cardinality at most r.

    line 11

    uses anticomplete_neighbor_defect_bound

      have hb := anticomplete_neighbor_defect_bound G Q v hv hanti d r hsize hdeg
  2. Any finset s whose elements are non-neighbors of v other than v satisfies s \ Q ⊆ ((Finset.univ \ Q).erase v) \ G.neighborFinset v.

    Let w ∈ s \ Q. Then w ∈ s and w ∉ Q. By assumption on s, w ≠ v and w is not adjacent to v. Unfolding the definitions of set difference, erase, the universal set, and graph neighborhood confirms that w belongs to ((Finset.univ \ Q).erase v) \ G.neighborFinset v.

    lines 12–19

    uses Finset.mem_sdiff, Finset.mem_erase, Finset.mem_univ, true_and, SimpleGraph.mem_neighborFinset

      have hsub : ∀ s : Finset V, (∀ w ∈ s, w ≠ v ∧ ¬ G.Adj v w) →
          s \ Q ⊆ ((Finset.univ \ Q).erase v) \ G.neighborFinset v := by
        intro s hs' w hw
        rw [Finset.mem_sdiff] at hw
        obtain ⟨h1, h2⟩ := hs' w hw.1
        simp only [Finset.mem_sdiff, Finset.mem_erase, Finset.mem_univ, true_and,
          SimpleGraph.mem_neighborFinset]
        exact ⟨⟨h1, hw.2⟩, h2⟩
  3. The sum of the cardinalities |s₁ \ Q| + |s₂ \ Q| + |s₃ \ Q| + |s₄ \ Q| is at most the cardinality of the defect set T.

    By the previous inclusion, each sᵢ \ Q is a subset of T = ((Finset.univ \ Q).erase v) \ G.neighborFinset v. Furthermore, since sᵢ \ Q ⊆ sᵢ and the original sets sᵢ are pairwise disjoint, each pair sᵢ \ Q and sⱼ \ Q is disjoint by Finset.disjoint_of_subset_left and Finset.disjoint_of_subset_right applied to Finset.sdiff_subset. Applying four_disjoint_subsets_card_sum_le shows that the sum of their cardinalities is bounded by |T|.

    lines 20–36

    uses four_disjoint_subsets_card_sum_le, Or.inl, Or.inr, Finset.disjoint_of_subset_left, Finset.sdiff_subset, Finset.disjoint_of_subset_right

      have := four_disjoint_subsets_card_sum_le (s1 \ Q) (s2 \ Q) (s3 \ Q) (s4 \ Q) _
        (hsub s1 (fun w hw => hs w (Or.inl hw)))
        (hsub s2 (fun w hw => hs w (Or.inr (Or.inl hw))))
        (hsub s3 (fun w hw => hs w (Or.inr (Or.inr (Or.inl hw)))))
        (hsub s4 (fun w hw => hs w (Or.inr (Or.inr (Or.inr hw)))))
        (Finset.disjoint_of_subset_left Finset.sdiff_subset
          (Finset.disjoint_of_subset_right Finset.sdiff_subset d12))
        (Finset.disjoint_of_subset_left Finset.sdiff_subset
          (Finset.disjoint_of_subset_right Finset.sdiff_subset d13))
        (Finset.disjoint_of_subset_left Finset.sdiff_subset
          (Finset.disjoint_of_subset_right Finset.sdiff_subset d14))
        (Finset.disjoint_of_subset_left Finset.sdiff_subset
          (Finset.disjoint_of_subset_right Finset.sdiff_subset d23))
        (Finset.disjoint_of_subset_left Finset.sdiff_subset
          (Finset.disjoint_of_subset_right Finset.sdiff_subset d24))
        (Finset.disjoint_of_subset_left Finset.sdiff_subset
          (Finset.disjoint_of_subset_right Finset.sdiff_subset d34))
  4. |s₁ \ Q| + |s₂ \ Q| + |s₃ \ Q| + |s₄ \ Q| ≤ r.

    Linear arithmetic over ℕ combines the sum bound from the previous step with |T| ≤ r from the first step to close the goal.

    line 37

      omega
anticomplete_neighbor_defect_bound
In a graph G on a finite type, if a vertex x is not in a subset B and is anticomplete to B, with |V| = |B| + d + 1 and d ≤ deg(x) + r, then the number of non-neighbors of x outside B ∪ {x} is at most r.
Finset.mem_sdiff
An element a belongs to s \ t if and only if a ∈ s and a ∉ t.
Finset.mem_erase
An element a belongs to s.erase b if and only if a ≠ b and a ∈ s.
Finset.mem_univ
Every element of a finite type belongs to the universal finset Finset.univ.
true_and
The conjunction True ∧ p is equivalent to p.
SimpleGraph.mem_neighborFinset
A vertex w is in the neighbor finset of v if and only if G.Adj v w.
four_disjoint_subsets_card_sum_le
If four subsets of an ambient finset T are pairwise disjoint, the sum of their cardinalities is at most |T|.
Or.inl
If a holds, then the disjunction a ∨ b holds.
Or.inr
If b holds, then the disjunction a ∨ b holds.
Finset.disjoint_of_subset_left
If s ⊆ u and u is disjoint from t, then s is disjoint from t.
Finset.sdiff_subset
The set difference s \ t is a subset of s.
Finset.disjoint_of_subset_right
If t ⊆ u and s is disjoint from u, then s is disjoint from t.

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 anticomplete_vertex_four_disjoint_nonneighbor_sets_bound {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)    [DecidableRel G.Adj] (Q : Finset V) (v : V) (hv : v ∉ Q)    (hanti : ∀ b ∈ Q, ¬ G.Adj v b) (d r : ℕ)    (hsize : Fintype.card V = Q.card + d + 1)    (hdeg : d ≤ (G.neighborFinset v).card + r)    (s1 s2 s3 s4 : Finset V)    (hs : ∀ w, (w ∈ s1 ∨ w ∈ s2 ∨ w ∈ s3 ∨ w ∈ s4) → w ≠ v ∧ ¬ G.Adj v w)    (d12 : Disjoint s1 s2) (d13 : Disjoint s1 s3) (d14 : Disjoint s1 s4)    (d23 : Disjoint s2 s3) (d24 : Disjoint s2 s4) (d34 : Disjoint s3 s4) :    (s1 \ Q).card + (s2 \ Q).card + (s3 \ Q).card + (s4 \ Q).card ≤ r := by  have hb := anticomplete_neighbor_defect_bound G Q v hv hanti d r hsize hdeg  have hsub : ∀ s : Finset V, (∀ w ∈ s, w ≠ v ∧ ¬ G.Adj v w) →      s \ Q ⊆ ((Finset.univ \ Q).erase v) \ G.neighborFinset v := by    intro s hs' w hw    rw [Finset.mem_sdiff] at hw    obtain ⟨h1, h2⟩ := hs' w hw.1    simp only [Finset.mem_sdiff, Finset.mem_erase, Finset.mem_univ, true_and,      SimpleGraph.mem_neighborFinset]    exact ⟨⟨h1, hw.2⟩, h2⟩  have := four_disjoint_subsets_card_sum_le (s1 \ Q) (s2 \ Q) (s3 \ Q) (s4 \ Q) _    (hsub s1 (fun w hw => hs w (Or.inl hw)))    (hsub s2 (fun w hw => hs w (Or.inr (Or.inl hw))))    (hsub s3 (fun w hw => hs w (Or.inr (Or.inr (Or.inl hw)))))    (hsub s4 (fun w hw => hs w (Or.inr (Or.inr (Or.inr hw)))))    (Finset.disjoint_of_subset_left Finset.sdiff_subset      (Finset.disjoint_of_subset_right Finset.sdiff_subset d12))    (Finset.disjoint_of_subset_left Finset.sdiff_subset      (Finset.disjoint_of_subset_right Finset.sdiff_subset d13))    (Finset.disjoint_of_subset_left Finset.sdiff_subset      (Finset.disjoint_of_subset_right Finset.sdiff_subset d14))    (Finset.disjoint_of_subset_left Finset.sdiff_subset      (Finset.disjoint_of_subset_right Finset.sdiff_subset d23))    (Finset.disjoint_of_subset_left Finset.sdiff_subset      (Finset.disjoint_of_subset_right Finset.sdiff_subset d24))    (Finset.disjoint_of_subset_left Finset.sdiff_subset      (Finset.disjoint_of_subset_right Finset.sdiff_subset d34))  omega
See it in the graphDiscuss this resultChallenge it