AFTD Auto-Formalizing Theoretical Domains

complement_saturated_twins_force_four_vertex_bridge_shores

theoremverified

Let H have maximum degree at most d, and let adjacent vertices x,y be complement twins with x of degree d. Let Q and W be even sets of at least two vertices, with x and y outside Q, W contained in the neighbors of x other than y, all Q-W pairs adjacent in H, and |Q|+|W|=d+1. Suppose two vertices u,v in that neighbor set have no common neighbor outside x,y. Then each of Q and W has at least four vertices.

Statement

theorem complement_saturated_twins_force_four_vertex_bridge_shores
    {n d : ℕ} (H : SimpleGraph (Fin n)) [DecidableRel H.Adj]
    (x y u v : Fin n) (Q W : Finset (Fin n))
    (hxy : H.Adj x y) (hxdeg : (H.neighborFinset x).card = d)
    (hmax : ∀ a, (H.neighborFinset a).card ≤ d)
    (htwin : ∀ a, a ≠ x → a ≠ y → (H.Adj x a ↔ H.Adj y a))
    (hqx : x ∉ Q) (hqy : y ∉ Q)
    (hw : W ⊆ (H.neighborFinset x).erase y)
    (hu : u ∈ (H.neighborFinset x).erase y)
    (hv : v ∈ (H.neighborFinset x).erase y)
    (hcommon : ∀ a, H.Adj u a → H.Adj v a → a = x ∨ a = y)
    (hcross : ∀ q ∈ Q, ∀ w ∈ W, H.Adj q w)
    (hqmin : 2 ≤ Q.card) (hwmin : 2 ≤ W.card)
    (hqe : Even Q.card) (hwe : Even W.card)
    (hsum : Q.card + W.card = d + 1) :
    4 ≤ Q.card ∧ 4 ≤ W.card
Source
Structural shore-size step for the OP-1957 saturated-twin equality branch, suggested by experiments 34916 and 34917.
Verified
20 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

To show |W| ≥ 4, choose any vertex w ∈ W; since W is contained in N(x) \ {y} and x, y are complement twins, w is adjacent to both x and y as well as all of Q, so N(w) contains the disjoint union {x, y} ∪ Q. The degree bound deg(w) ≤ d then forces |Q| + 2 ≤ d, which together with |Q| + |W| = d + 1 implies |W| ≥ 3, and evenness promotes this to |W| ≥ 4. To show |Q| ≥ 4, an assumption that |Q| < 4 forces |Q| = 2 by evenness, which makes W the entire set N(x) \ {y} and thus contains u and v; any vertex in Q would then be a common neighbor of u and v, forcing it to be x or y and contradicting that x, y are outside Q.

  1. Since W has at least two vertices, we can choose a vertex w ∈ W, which is adjacent to both x and y and distinct from both.

    Because |W| ≥ 2, W is nonempty (Finset.card_pos.mp), allowing us to pick an element w ∈ W. Since W ⊆ N(x) \ {y}, w is a neighbor of x (Finset.mem_of_mem_erase, SimpleGraph.mem_neighborFinset) distinct from y (Finset.ne_of_mem_erase). Adjacency to x also ensures w ≠ x. By the twin hypothesis that x and y share the same adjacencies away from {x, y}, the edge between x and w implies that y and w are also adjacent.

    lines 17–28

    uses Finset.card_pos.mp, Finset.mem_of_mem_erase, SimpleGraph.mem_neighborFinset, Finset.ne_of_mem_erase

      have h4W : 4 ≤ W.card := by
        have hWne : W.Nonempty := Finset.card_pos.mp (by omega)
        obtain ⟨w, hwW⟩ := hWne
        have hwx : w ∈ (H.neighborFinset x).erase y := hw hwW
        have hwx_adj : H.Adj x w := by
          have := Finset.mem_of_mem_erase hwx
          rwa [SimpleGraph.mem_neighborFinset] at this
        have hwx_adj' : H.Adj w x := hwx_adj.symm
        have hwy_ne : w ≠ y := Finset.ne_of_mem_erase hwx
        have hwx_ne : w ≠ x := hwx_adj'.ne
        have hwy_adj : H.Adj y w := (htwin w hwx_ne hwy_ne).mp hwx_adj
        have hwy_adj' : H.Adj w y := hwy_adj.symm
  2. The neighborhood of w contains x, y, and all vertices of Q.

    For any vertex z in {x, y} ∪ Q (Finset.mem_insert), if z = x then w is adjacent to x; if z = y then w is adjacent to y; and if z ∈ Q then w is adjacent to z because every vertex of Q is adjacent to every vertex of W (hcross). In every case z is a neighbor of w (SimpleGraph.mem_neighborFinset), showing {x, y} ∪ Q ⊆ N(w).

    lines 29–36

    uses Finset.mem_insert, SimpleGraph.mem_neighborFinset

        have hsub : insert x (insert y Q) ⊆ H.neighborFinset w := by
          intro z hz
          simp only [Finset.mem_insert] at hz
          rcases hz with rfl | rfl | hz
          · rwa [SimpleGraph.mem_neighborFinset]
          · rwa [SimpleGraph.mem_neighborFinset]
          · rw [SimpleGraph.mem_neighborFinset]
            exact (hcross z hz w hwW).symm
  3. The vertices x and y are outside Q and distinct, so |{x, y} ∪ Q| = |Q| + 2 ≤ |N(w)|.

    Since {x, y} ∪ Q ⊆ N(w), its cardinality is bounded by |N(w)| (Finset.card_le_card). Because x is adjacent to y, x ≠ y. Since neither x nor y belongs to Q, x does not belong to {y} ∪ Q (Finset.mem_insert). Successively inserting y and x into Q thus increases the cardinality by 1 each time (Finset.card_insert_of_notMem), giving |{x, y} ∪ Q| = |Q| + 2 ≤ |N(w)|.

    lines 37–45

    uses Finset.card_le_card, Finset.mem_insert, Finset.card_insert_of_notMem

        have hcard_sub := Finset.card_le_card hsub
        have hx_ne_y : x ≠ y := hxy.ne
        have hx_not_in : x ∉ insert y Q := by
          intro h
          simp only [Finset.mem_insert] at h
          rcases h with rfl | h
          · exact hx_ne_y rfl
          · exact hqx h
        rw [Finset.card_insert_of_notMem hx_not_in, Finset.card_insert_of_notMem hqy] at hcard_sub
  4. The cardinality of W is at least 4.

    The maximum degree in H is at most d, so |N(w)| ≤ d, which together with |Q| + 2 ≤ |N(w)| yields |Q| + 2 ≤ d. From |Q| + |W| = d + 1, linear arithmetic gives |W| = d + 1 - |Q| ≥ 3. Since |W| is even, |W| ≥ 3 forces |W| ≥ 4.

    lines 46–50

        have hw_deg : (H.neighborFinset w).card ≤ d := hmax w
        have hQd : Q.card + 2 ≤ d := by omega
        have : 3 ≤ W.card := by omega
        rcases hwe with ⟨m, hm⟩
        omega
  5. Assuming for contradiction that |Q| < 4, the cardinality of Q must be 2.

    To establish 4 ≤ |Q|, we assume for contradiction that |Q| < 4. We are given that 2 ≤ |Q| and that |Q| is even. The only even integer in [2, 4) is 2, so |Q| = 2.

    lines 51–55

      have h4Q : 4 ≤ Q.card := by
        by_contra! hlt
        have hq2 : Q.card = 2 := by
          rcases hqe with ⟨m, hm⟩
          omega
  6. The set W is the entire punctured neighborhood N(x) \ {y}, so both u and v belong to W.

    Because x is adjacent to y, y belongs to N(x) (SimpleGraph.mem_neighborFinset). Since x has degree d, removing y leaves |N(x) \ {y}| = d - 1 (Finset.card_erase_of_mem). Substituting |Q| = 2 into |Q| + |W| = d + 1 gives |W| = d - 1. Since W ⊆ N(x) \ {y} and both sets have cardinality d - 1, they must be equal (Finset.eq_of_subset_of_card_le). Because u and v are given to be in N(x) \ {y}, both belong to W.

    lines 56–65

    uses SimpleGraph.mem_neighborFinset, Finset.card_erase_of_mem, Finset.eq_of_subset_of_card_le

        have hy_mem : y ∈ H.neighborFinset x := by
          rwa [SimpleGraph.mem_neighborFinset]
        have herase_card : ((H.neighborFinset x).erase y).card = d - 1 := by
          rw [Finset.card_erase_of_mem hy_mem, hxdeg]
        have hW_card : W.card = d - 1 := by omega
        have hW_eq : W = (H.neighborFinset x).erase y := by
          apply Finset.eq_of_subset_of_card_le hw
          omega
        have huW : u ∈ W := by rwa [hW_eq]
        have hvW : v ∈ W := by rwa [hW_eq]
  7. Any element of Q is a common neighbor of u and v outside {x, y}, a contradiction; thus |Q| ≥ 4.

    Since |Q| = 2 > 0, Q is nonempty (Finset.card_pos.mp), so we can choose q ∈ Q. Every vertex of Q is adjacent to every vertex of W, so q is adjacent to both u and v because u, v ∈ W. By the hypothesis that u and v share no common neighbors outside {x, y}, we must have q = x or q = y. But this contradicts x ∉ Q and y ∉ Q, refuting |Q| < 4 and establishing 4 ≤ |Q|.

    lines 66–73

    uses Finset.card_pos.mp

        have hQne : Q.Nonempty := Finset.card_pos.mp (by omega)
        obtain ⟨q, hqQ⟩ := hQne
        have huq : H.Adj u q := (hcross q hqQ u huW).symm
        have hvq : H.Adj v q := (hcross q hqQ v hvW).symm
        have hqxy : q = x ∨ q = y := hcommon q huq hvq
        rcases hqxy with rfl | rfl
        · exact hqx hqQ
        · exact hqy hqQ
  8. Both Q and W have cardinality at least 4.

    We pair the two established bounds 4 ≤ |Q| and 4 ≤ |W| to conclude 4 ≤ |Q| ∧ 4 ≤ |W|.

    line 74

      exact ⟨h4Q, h4W⟩
Finset.card_pos.mp
A finite set is nonempty if its cardinality is strictly greater than 0.
Finset.mem_of_mem_erase
An element belonging to a finite set with a point removed also belongs to the original set.
SimpleGraph.mem_neighborFinset
A vertex w belongs to the neighbor finset of v if and only if v and w are adjacent in the graph.
Finset.ne_of_mem_erase
An element belonging to a finite set with a removed is not equal to a.
Finset.mem_insert
An element belongs to insert a s if and only if it equals a or belongs to s.
Finset.card_le_card
If one finite set is a subset of another, its cardinality is less than or equal to that of the other.
Finset.card_insert_of_notMem
Inserting an element into a finite set that does not contain it increases its cardinality by 1.
Finset.card_erase_of_mem
Removing an element from a finite set that contains it decreases its cardinality by 1.
Finset.eq_of_subset_of_card_le
If a finite set s is a subset of t and |t| ≤ |s|, then s = 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 complement_saturated_twins_force_four_vertex_bridge_shores    {n d : ℕ} (H : SimpleGraph (Fin n)) [DecidableRel H.Adj]    (x y u v : Fin n) (Q W : Finset (Fin n))    (hxy : H.Adj x y) (hxdeg : (H.neighborFinset x).card = d)    (hmax : ∀ a, (H.neighborFinset a).card ≤ d)    (htwin : ∀ a, a ≠ x → a ≠ y → (H.Adj x a ↔ H.Adj y a))    (hqx : x ∉ Q) (hqy : y ∉ Q)    (hw : W ⊆ (H.neighborFinset x).erase y)    (hu : u ∈ (H.neighborFinset x).erase y)    (hv : v ∈ (H.neighborFinset x).erase y)    (hcommon : ∀ a, H.Adj u a → H.Adj v a → a = x ∨ a = y)    (hcross : ∀ q ∈ Q, ∀ w ∈ W, H.Adj q w)    (hqmin : 2 ≤ Q.card) (hwmin : 2 ≤ W.card)    (hqe : Even Q.card) (hwe : Even W.card)    (hsum : Q.card + W.card = d + 1) :    4 ≤ Q.card ∧ 4 ≤ W.card := by  have h4W : 4 ≤ W.card := by    have hWne : W.Nonempty := Finset.card_pos.mp (by omega)    obtain ⟨w, hwW⟩ := hWne    have hwx : w ∈ (H.neighborFinset x).erase y := hw hwW    have hwx_adj : H.Adj x w := by      have := Finset.mem_of_mem_erase hwx      rwa [SimpleGraph.mem_neighborFinset] at this    have hwx_adj' : H.Adj w x := hwx_adj.symm    have hwy_ne : w ≠ y := Finset.ne_of_mem_erase hwx    have hwx_ne : w ≠ x := hwx_adj'.ne    have hwy_adj : H.Adj y w := (htwin w hwx_ne hwy_ne).mp hwx_adj    have hwy_adj' : H.Adj w y := hwy_adj.symm    have hsub : insert x (insert y Q) ⊆ H.neighborFinset w := by      intro z hz      simp only [Finset.mem_insert] at hz      rcases hz with rfl | rfl | hz      · rwa [SimpleGraph.mem_neighborFinset]      · rwa [SimpleGraph.mem_neighborFinset]      · rw [SimpleGraph.mem_neighborFinset]        exact (hcross z hz w hwW).symm    have hcard_sub := Finset.card_le_card hsub    have hx_ne_y : x ≠ y := hxy.ne    have hx_not_in : x ∉ insert y Q := by      intro h      simp only [Finset.mem_insert] at h      rcases h with rfl | h      · exact hx_ne_y rfl      · exact hqx h    rw [Finset.card_insert_of_notMem hx_not_in, Finset.card_insert_of_notMem hqy] at hcard_sub    have hw_deg : (H.neighborFinset w).card ≤ d := hmax w    have hQd : Q.card + 2 ≤ d := by omega    have : 3 ≤ W.card := by omega    rcases hwe with ⟨m, hm⟩    omega  have h4Q : 4 ≤ Q.card := by    by_contra! hlt    have hq2 : Q.card = 2 := by      rcases hqe with ⟨m, hm⟩      omega    have hy_mem : y ∈ H.neighborFinset x := by      rwa [SimpleGraph.mem_neighborFinset]    have herase_card : ((H.neighborFinset x).erase y).card = d - 1 := by      rw [Finset.card_erase_of_mem hy_mem, hxdeg]    have hW_card : W.card = d - 1 := by omega    have hW_eq : W = (H.neighborFinset x).erase y := by      apply Finset.eq_of_subset_of_card_le hw      omega    have huW : u ∈ W := by rwa [hW_eq]    have hvW : v ∈ W := by rwa [hW_eq]    have hQne : Q.Nonempty := Finset.card_pos.mp (by omega)    obtain ⟨q, hqQ⟩ := hQne    have huq : H.Adj u q := (hcross q hqQ u huW).symm    have hvq : H.Adj v q := (hcross q hqQ v hvW).symm    have hqxy : q = x ∨ q = y := hcommon q huq hvq    rcases hqxy with rfl | rfl    · exact hqx hqQ    · exact hqy hqQ  exact ⟨h4Q, h4W⟩
See it in the graphDiscuss this resultChallenge it