AFTD Auto-Formalizing Theoretical Domains

op1957_outer_shore_defect_pair

theoremverified

If the first shore contains x and at least two further A vertices, and one of p,q lies in the second shore or its anticomplete pool, two A vertices are simultaneous nonneighbors of the root y and that p or q.

Statement

theorem op1957_outer_shore_defect_pair
    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)
    (A X Y U : Finset V) (x y p q : V)
    (hxA : x ∈ A) (hxX : x ∈ X) (hyY : y ∈ Y)
    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)
    (hantiX : ∀ a ∈ X, ∀ u ∈ U, ¬ G.Adj a u)
    (hlarge : 3 ≤ (X ∩ A).card)
    (houtside : p ∈ Y ∪ U ∨ q ∈ Y ∪ U) :
    ∃ r ∈ ({p,q} : Finset V), ∃ T ⊆ A.erase x, T.card=2 ∧
      ∀ a ∈ T, ¬ G.Adj a y ∧ ¬ G.Adj a r
Source
OP-1957 large-shore defect extraction
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

We select a vertex r ∈ {p, q} that lies in Y ∪ U, which exists by assumption. Since X ∩ A contains x and has cardinality at least 3, removing x leaves at least two vertices, from which we choose a 2-element subset T ⊆ (X ∩ A) \ {x} ⊆ A \ {x}. Any vertex a ∈ T belongs to X and differs from x, so it cannot be adjacent to y ∈ Y or to r ∈ Y ∪ U: the only edge between X and Y is xy, and X is completely anticomplete to U.

  1. There exists a 2-element subset T ⊆ (X ∩ A) \ {x}.

    Since x ∈ X and x ∈ A, x lies in X ∩ A (Finset.mem_inter.mpr). Given that |X ∩ A| ≥ 3, removing x leaves a set of cardinality at least 2 (Finset.card_erase_add_one) by linear arithmetic (omega). Therefore, (X ∩ A) \ {x} contains a subset T of cardinality 2 (Finset.exists_subset_card_eq).

    lines 11–16

    uses Finset.mem_inter.mpr, Finset.card_erase_add_one, Finset.exists_subset_card_eq

      classical
      have hx : x ∈ X ∩ A := Finset.mem_inter.mpr ⟨hxX,hxA⟩
      have hc : 2 ≤ ((X ∩ A).erase x).card := by
        have h := Finset.card_erase_add_one hx
        omega
      obtain ⟨T,hT,hcard⟩ := Finset.exists_subset_card_eq hc
  2. There exists r ∈ {p, q} such that r ∈ Y ∪ U.

    By hypothesis houtside, at least one of p or q lies in Y ∪ U. In the case p ∈ Y ∪ U, we select r = p; otherwise, we select r = q.

    lines 17–20

      obtain ⟨r,hr,hrout⟩ : ∃ r ∈ ({p,q} : Finset V), r ∈ Y ∪ U := by
        rcases houtside with hp | hq
        · exact ⟨p,by simp,hp⟩
        · exact ⟨q,by simp,hq⟩
  3. The candidates r and T satisfy T ⊆ A \ {x} and |T| = 2.

    We present r and T as witnesses. The cardinality |T| = 2 is already established. For the inclusion T ⊆ A \ {x}, take any a ∈ T. Since T ⊆ (X ∩ A) \ {x}, we have a ≠ x and a ∈ X ∩ A (Finset.mem_erase.mp), hence a ∈ A (Finset.mem_inter.mp). Thus a ∈ A \ {x} (Finset.mem_erase.mpr).

    lines 21–24

    uses Finset.mem_erase.mp, Finset.mem_erase.mpr, Finset.mem_inter.mp

      refine ⟨r,hr,T,?_,hcard,?_⟩
      · intro a ha
        have hh := Finset.mem_erase.mp (hT ha)
        exact Finset.mem_erase.mpr ⟨hh.1,(Finset.mem_inter.mp hh.2).2⟩
  4. Every vertex a ∈ T is nonadjacent to both y and r.

    Let a ∈ T. From T ⊆ (X ∩ A) \ {x}, we know that a ∈ X and a ≠ x (Finset.mem_erase.mp, Finset.mem_inter.mp). If a were adjacent to y ∈ Y, then by hcross we would have a = x, contradicting a ≠ x; hence a is not adjacent to y. If a were adjacent to r, we split on whether r ∈ Y or r ∈ U (Finset.mem_union.mp): if r ∈ Y, hcross again forces a = x, a contradiction; if r ∈ U, this contradicts hantiX, which states that X has no edges to U. Thus a is adjacent to neither y nor r.

    lines 25–35

    uses Finset.mem_erase.mp, Finset.mem_inter.mp, Finset.mem_union.mp

      · intro a ha
        have hh := Finset.mem_erase.mp (hT ha)
        have haX := (Finset.mem_inter.mp hh.2).1
        have hne : a ≠ x := hh.1
        constructor
        · intro hay
          exact hne (hcross a haX y hyY hay).1
        · intro har
          rcases Finset.mem_union.mp hrout with hrY | hrU
          · exact hne (hcross a haX r hrY har).1
          · exact hantiX a haX r hrU har
Finset.mem_inter.mpr
If an element belongs to both of two finite sets, then it belongs to their intersection.
Finset.card_erase_add_one
For any element in a finite set, the cardinality of the set with that element removed plus one equals the cardinality of the set.
Finset.exists_subset_card_eq
If n is at most the cardinality of a finite set s, then s contains a subset of cardinality n.
Finset.mem_erase.mp
If an element belongs to s \\ {a}, then it is distinct from a and belongs to s.
Finset.mem_erase.mpr
If an element is distinct from a and belongs to s, then it belongs to s \\ {a}.
Finset.mem_inter.mp
If an element belongs to the intersection of two finite sets, then it belongs to both sets.
Finset.mem_union.mp
If an element belongs to the union of two finite sets, then it belongs to at least one of them.

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 op1957_outer_shore_defect_pair    {V : Type*} [Fintype V] [DecidableEq V] (G : SimpleGraph V)    (A X Y U : Finset V) (x y p q : V)    (hxA : x ∈ A) (hxX : x ∈ X) (hyY : y ∈ Y)    (hcross : ∀ a ∈ X, ∀ b ∈ Y, G.Adj a b → a=x ∧ b=y)    (hantiX : ∀ a ∈ X, ∀ u ∈ U, ¬ G.Adj a u)    (hlarge : 3 ≤ (X ∩ A).card)    (houtside : p ∈ Y ∪ U ∨ q ∈ Y ∪ U) :    ∃ r ∈ ({p,q} : Finset V), ∃ T ⊆ A.erase x, T.card=2 ∧      ∀ a ∈ T, ¬ G.Adj a y ∧ ¬ G.Adj a r := by  classical  have hx : x ∈ X ∩ A := Finset.mem_inter.mpr ⟨hxX,hxA⟩  have hc : 2 ≤ ((X ∩ A).erase x).card := by    have h := Finset.card_erase_add_one hx    omega  obtain ⟨T,hT,hcard⟩ := Finset.exists_subset_card_eq hc  obtain ⟨r,hr,hrout⟩ : ∃ r ∈ ({p,q} : Finset V), r ∈ Y ∪ U := by    rcases houtside with hp | hq    · exact ⟨p,by simp,hp⟩    · exact ⟨q,by simp,hq⟩  refine ⟨r,hr,T,?_,hcard,?_⟩  · intro a ha    have hh := Finset.mem_erase.mp (hT ha)    exact Finset.mem_erase.mpr ⟨hh.1,(Finset.mem_inter.mp hh.2).2⟩  · intro a ha    have hh := Finset.mem_erase.mp (hT ha)    have haX := (Finset.mem_inter.mp hh.2).1    have hne : a ≠ x := hh.1    constructor    · intro hay      exact hne (hcross a haX y hyY hay).1    · intro har      rcases Finset.mem_union.mp hrout with hrY | hrU      · exact hne (hcross a haX r hrY har).1      · exact hantiX a haX r hrU har
See it in the graphDiscuss this resultChallenge it