AFTD Auto-Formalizing Theoretical Domains

op1957_endpoint_residual_nonneighbor_budget

theoremverified

Endpoint residual nonneighbor budget.

Statement

theorem op1957_endpoint_residual_nonneighbor_budget
    (k c : ℕ) (hc : 7 ≤ c) (hkc : c ≤ k)
    (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]
    (X Y U D : Finset (Fin (4*k))) (x y : Fin (4*k))
    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U) (hUD : Disjoint U D)
    (hxX : x ∈ X) (hyY : y ∈ Y) (hyD : y ∉ D) (hD : D.card=2*k-c)
    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)
    (hnoU : ∀ u ∈ U, ¬ G.Adj y u) (hnoD : ∀ d ∈ D, ¬ G.Adj y d)
    (hdegree : 2*k+2 ≤ (G.neighborFinset y).card) :
    ((X.erase x) \ D).card + U.card + 3 ≤ c
Source
OP-1957; positive-separator graph-to-count transfer.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 1

The proof, explained

The theorem upper-bounds the combined size of the residual set W = (X ∖ {x}) ∖ D and U by c - 3. Since y has high degree (at least 2k + 2) and no neighbors in D, the lemma anticomplete_neighbor_defect_bound limits the total number of non-neighbors of y outside D ∪ {y} to at most c - 3. Both W and U consist entirely of such non-neighbors and are disjoint from each other, so their cardinalities sum to at most c - 3, yielding the claim.

  1. Defining W = (X ∖ {x}) ∖ D, the sets W and U are disjoint, and y belongs to neither U nor X.

    Let W = (X ∖ {x}) ∖ D. Since W ⊆ X and X is disjoint from U, W and U are disjoint by Finset.disjoint_of_subset_left. Since y ∈ Y and Y is disjoint from both U and X, y cannot belong to U or X.

    lines 13–18

    uses Finset.disjoint_of_subset_left, Finset.mem_erase.mp, Finset.mem_sdiff.mp, Finset.disjoint_left.mp

      classical
      let W := (X.erase x) \ D
      have hWU : Disjoint W U := Finset.disjoint_of_subset_left
        (by intro v hv; exact (Finset.mem_erase.mp (Finset.mem_sdiff.mp hv).1).2) hXU
      have hyU : y ∉ U := fun h => Finset.disjoint_left.mp hYU hyY h
      have hyX : y ∉ X := fun h => Finset.disjoint_left.mp hXY h hyY
  2. The number of non-neighbors of y outside D ∪ {y} is at most c - 3.

    The total number of vertices in Fin (4*k) is 4*k, which partitions as |D| + (2*k + c - 1) + 1 since |D| = 2*k - c. Because deg(y) ≥ 2*k + 2, we have 2*k + c - 1 ≤ deg(y) + (c - 3). Since y ∉ D and y has no neighbors in D, anticomplete_neighbor_defect_bound applies with d = 2*k + c - 1 and defect parameter r = c - 3, showing that at most c - 3 vertices outside D ∪ {y} are non-neighbors of y.

    lines 19–23

    uses Fintype.card_fin, anticomplete_neighbor_defect_bound

      have hsize : Fintype.card (Fin (4*k)) = D.card+(2*k+c-1)+1 := by
        simp only [Fintype.card_fin]
        omega
      have hd : 2*k+c-1 ≤ (G.neighborFinset y).card+(c-3) := by omega
      have hb := anticomplete_neighbor_defect_bound G D y hyD hnoD (2*k+c-1) (c-3) hsize hd
  3. The union W ∪ U is contained in the set of non-neighbors of y outside D ∪ {y}.

    Let v ∈ W ∪ U. If v ∈ W, then v ∈ X ∖ {x} and v ∉ D. Since y ∉ X, v ≠ y. If y were adjacent to v, the hypothesis that {x, y} is the only edge between X and Y would force v = x, a contradiction; thus y is not adjacent to v. If v ∈ U, then v ≠ y (as y ∉ U), v ∉ D (as U and D are disjoint), and y is not adjacent to v by assumption. In both cases, v is a non-neighbor of y in (univ ∖ D) ∖ {y}.

    lines 24–40

    uses Finset.mem_union.mp, Finset.mem_sdiff.mp, Finset.mem_erase.mp, Finset.disjoint_left.mp, Finset.mem_sdiff, Finset.mem_erase, Finset.mem_univ, true_and, SimpleGraph.mem_neighborFinset

      have hsub : W ∪ U ⊆ (((Finset.univ \ D).erase y) \ G.neighborFinset y) := by
        intro v hv
        rcases Finset.mem_union.mp hv with hvW | hvU
        · have hv' := Finset.mem_sdiff.mp hvW
          have hve := Finset.mem_erase.mp hv'.1
          have hvne : v ≠ y := fun h => hyX (h ▸ hve.2)
          have hnon : ¬ G.Adj y v := by
            intro hadj
            exact hve.1 (hcross v hve.2 y hyY hadj.symm).1
          simp only [Finset.mem_sdiff,Finset.mem_erase,Finset.mem_univ,true_and,
            SimpleGraph.mem_neighborFinset]
          exact ⟨⟨hvne,hv'.2⟩,hnon⟩
        · have hvne : v ≠ y := fun h => hyU (h ▸ hvU)
          have hvD : v ∉ D := fun h => Finset.disjoint_left.mp hUD hvU h
          simp only [Finset.mem_sdiff,Finset.mem_erase,Finset.mem_univ,true_and,
            SimpleGraph.mem_neighborFinset]
          exact ⟨⟨hvne,hvD⟩,hnoU v hvU⟩
  4. ((X ∖ {x}) ∖ D).card + U.card + 3 ≤ c.

    From the inclusion W ∪ U ⊆ ((univ ∖ D) ∖ {y}) ∖ N(y), we obtain |W ∪ U| ≤ c - 3. Because W and U are disjoint, |W ∪ U| = |W| + |U| = |(X ∖ {x}) ∖ D| + |U|. Adding 3 to both sides gives the desired inequality.

    lines 41–44

    uses Finset.card_le_card, Finset.card_union_of_disjoint

      have hh := (Finset.card_le_card hsub).trans hb
      rw [Finset.card_union_of_disjoint hWU] at hh
      dsimp [W] at hh
      omega
anticomplete_neighbor_defect_bound
If a vertex $y ∉ B$ has no neighbors in $B$, $|V| = |B| + d + 1$, and $d ≤ \\deg(y) + r$, then the number of non-neighbors of $y$ in $V ∖ (B ∪ \\{y\\})$ is at most $r$.
Fintype.card_fin
The cardinality of Fin n is n.
Finset.card_le_card
If s ⊆ t, then |s| ≤ |t|.
Finset.card_union_of_disjoint
If s and t are disjoint, then |s ∪ t| = |s| + |t|.
Finset.disjoint_left.mp
If s and t are disjoint, any element of s does not belong to t.
Finset.disjoint_of_subset_left
If s ⊆ u and u is disjoint from t, then s is disjoint from t.
Finset.mem_erase
An element a is in s.erase b if and only if a ≠ b and a ∈ s.
Finset.mem_erase.mp
If a ∈ s.erase b, then a ≠ b and a ∈ s.
Finset.mem_sdiff
An element is in s ∖ t if and only if it is in s and not in t.
Finset.mem_sdiff.mp
If a ∈ s ∖ t, then a ∈ s and a ∉ t.
Finset.mem_union.mp
If a ∈ s ∪ t, then a ∈ s or a ∈ t.
Finset.mem_univ
Every element of a finite type belongs to the universal finset univ.
SimpleGraph.mem_neighborFinset
A vertex w is in the neighbor set of v if and only if v and w are adjacent in G.
true_and
The conjunction True ∧ p is equivalent to p.

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

set_option maxHeartbeats 2000000theorem op1957_endpoint_residual_nonneighbor_budget    (k c : ℕ) (hc : 7 ≤ c) (hkc : c ≤ k)    (G : SimpleGraph (Fin (4*k))) [DecidableRel G.Adj]    (X Y U D : Finset (Fin (4*k))) (x y : Fin (4*k))    (hXY : Disjoint X Y) (hXU : Disjoint X U) (hYU : Disjoint Y U) (hUD : Disjoint U D)    (hxX : x ∈ X) (hyY : y ∈ Y) (hyD : y ∉ D) (hD : D.card=2*k-c)    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)    (hnoU : ∀ u ∈ U, ¬ G.Adj y u) (hnoD : ∀ d ∈ D, ¬ G.Adj y d)    (hdegree : 2*k+2 ≤ (G.neighborFinset y).card) :    ((X.erase x) \ D).card + U.card + 3 ≤ c := by  classical  let W := (X.erase x) \ D  have hWU : Disjoint W U := Finset.disjoint_of_subset_left    (by intro v hv; exact (Finset.mem_erase.mp (Finset.mem_sdiff.mp hv).1).2) hXU  have hyU : y ∉ U := fun h => Finset.disjoint_left.mp hYU hyY h  have hyX : y ∉ X := fun h => Finset.disjoint_left.mp hXY h hyY  have hsize : Fintype.card (Fin (4*k)) = D.card+(2*k+c-1)+1 := by    simp only [Fintype.card_fin]    omega  have hd : 2*k+c-1 ≤ (G.neighborFinset y).card+(c-3) := by omega  have hb := anticomplete_neighbor_defect_bound G D y hyD hnoD (2*k+c-1) (c-3) hsize hd  have hsub : W ∪ U ⊆ (((Finset.univ \ D).erase y) \ G.neighborFinset y) := by    intro v hv    rcases Finset.mem_union.mp hv with hvW | hvU    · have hv' := Finset.mem_sdiff.mp hvW      have hve := Finset.mem_erase.mp hv'.1      have hvne : v ≠ y := fun h => hyX (h ▸ hve.2)      have hnon : ¬ G.Adj y v := by        intro hadj        exact hve.1 (hcross v hve.2 y hyY hadj.symm).1      simp only [Finset.mem_sdiff,Finset.mem_erase,Finset.mem_univ,true_and,        SimpleGraph.mem_neighborFinset]      exact ⟨⟨hvne,hv'.2⟩,hnon⟩    · have hvne : v ≠ y := fun h => hyU (h ▸ hvU)      have hvD : v ∉ D := fun h => Finset.disjoint_left.mp hUD hvU h      simp only [Finset.mem_sdiff,Finset.mem_erase,Finset.mem_univ,true_and,        SimpleGraph.mem_neighborFinset]      exact ⟨⟨hvne,hvD⟩,hnoU v hvU⟩  have hh := (Finset.card_le_card hsub).trans hb  rw [Finset.card_union_of_disjoint hWU] at hh  dsimp [W] at hh  omega
See it in the graphDiscuss this resultChallenge it