AFTD Auto-Formalizing Theoretical Domains

op1957_four_shore_choose_nonendpoint_representative

theoremverified

Four shore choose nonendpoint representative.

Statement

theorem op1957_four_shore_choose_nonendpoint_representative
    {V : Type*} [Fintype V] [DecidableEq V]
    (F B : Fin 4 → Finset V) (x y : V)
    (hBdis : ∀ i j : Fin 4, i ≠ j → Disjoint (B i) (B j))
    (hx : x ∈ B 0) (hy : y ∈ B 2) (j b : Fin 4)
    (hcount : (if (j=0 ∧ b=0) ∨ (j=1 ∧ b=2) then 2 else 1) ≤ (F j ∩ B b).card) :
    ∃ v ∈ F j, v ∈ B b ∧ (j=0 → v≠x) ∧ (j=1 → v≠y)
Source
OP-1957; positive-separator graph-to-count transfer.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof proceeds by case analysis on the index j. In all cases, the intersection F j ∩ B b has cardinality at least 1 and is therefore nonempty. When j = 0 (or j = 1), the chosen representative must avoid the distinguished vertex x ∈ B 0 (respectively y ∈ B 2). If x ∈ F 0 ∩ B b (or y ∈ F 1 ∩ B b), the pairwise disjointness of the sets B i forces b = 0 (respectively b = 2), where the cardinality hypothesis guarantees at least two elements in the intersection, ensuring the existence of an element distinct from x (respectively y).

  1. The intersection F j ∩ B b has cardinality at least 1, and hence is nonempty.

    By hypothesis `hcount`, the cardinality of F j ∩ B b is at least 2 if (j = 0 and b = 0) or (j = 1 and b = 2), and at least 1 otherwise. In both cases, the cardinality is at least 1.

    lines 10–12

      classical
      have hpos : 1 ≤ (F j ∩ B b).card := by
        split_ifs at hcount <;> omega
  2. In the case j = 0, if x ∈ F 0 ∩ B b, then b = 0.

    We assume j = 0 and consider whether x belongs to F 0 ∩ B b. If it does, then x ∈ B b. Since x ∈ B 0 by assumption and the sets B i are pairwise disjoint, having b ≠ 0 would mean B 0 and B b are disjoint, contradicting that x is in both. Therefore, b = 0.

    lines 13–19

    uses Finset.disjoint_left.mp, Ne.symm, Finset.mem_inter.mp

      by_cases h0 : j=0
      · subst j
        by_cases hxW : x ∈ F 0 ∩ B b
        · have hb0 : b=0 := by
            by_contra hn
            exact Finset.disjoint_left.mp (hBdis 0 b (Ne.symm hn)) hx (Finset.mem_inter.mp hxW).2
          subst b
  3. When j = 0 and x ∈ F 0 ∩ B 0, there exists a vertex v ∈ F 0 ∩ B 0 distinct from x.

    Since j = 0 and b = 0, the hypothesis gives |F 0 ∩ B 0| ≥ 2. Because x ∈ F 0 ∩ B 0, erasing x leaves a subset with cardinality |F 0 ∩ B 0| - 1 ≥ 1 > 0. Any element v in this erased set belongs to F 0 ∩ B 0 with v ≠ x, and the condition for j = 1 holds vacuously.

    lines 20–26

    uses Finset.card_erase_of_mem, Finset.card_pos.mp, Finset.mem_erase.mp, Finset.mem_inter.mp

          have htwo : 2 ≤ (F 0 ∩ B 0).card := by simpa using hcount
          have hn : 0 < ((F 0 ∩ B 0).erase x).card := by
            rw [Finset.card_erase_of_mem hxW]
            omega
          obtain ⟨v,hv⟩ := Finset.card_pos.mp hn
          have hv' := Finset.mem_erase.mp hv
          exact ⟨v,(Finset.mem_inter.mp hv'.2).1,(Finset.mem_inter.mp hv'.2).2,by simpa using hv'.1⟩
  4. When j = 0 and x ∉ F 0 ∩ B b, any element of F 0 ∩ B b satisfies the requirements.

    Since |F 0 ∩ B b| ≥ 1, we choose an element v ∈ F 0 ∩ B b. Because x is not in F 0 ∩ B b, v cannot equal x, so v ≠ x automatically holds. The condition for j = 1 is vacuously true.

    lines 27–29

    uses Finset.card_pos.mp, Finset.mem_inter.mp

        · obtain ⟨v,hv⟩ := Finset.card_pos.mp hpos
          have hvne : v ≠ x := fun h => hxW (h ▸ hv)
          exact ⟨v,(Finset.mem_inter.mp hv).1,(Finset.mem_inter.mp hv).2,by simpa using hvne⟩
  5. In the case j = 1, if y ∈ F 1 ∩ B b, then b = 2.

    Assuming j ≠ 0, we consider j = 1 and examine whether y ∈ F 1 ∩ B b. If so, y ∈ B b. Since y ∈ B 2 by hypothesis and the blocks B i are pairwise disjoint, b ≠ 2 would imply that B 2 and B b are disjoint, contradicting that y belongs to both. Hence b = 2.

    lines 30–36

    uses Finset.disjoint_left.mp, Ne.symm, Finset.mem_inter.mp

      · by_cases h1 : j=1
        · subst j
          by_cases hyW : y ∈ F 1 ∩ B b
          · have hb2 : b=2 := by
              by_contra hn
              exact Finset.disjoint_left.mp (hBdis 2 b (Ne.symm hn)) hy (Finset.mem_inter.mp hyW).2
            subst b
  6. When j = 1 and y ∈ F 1 ∩ B 2, there exists a vertex v ∈ F 1 ∩ B 2 distinct from y.

    Since j = 1 and b = 2, the hypothesis implies |F 1 ∩ B 2| ≥ 2. Because y ∈ F 1 ∩ B 2, removing y leaves a set of cardinality |F 1 ∩ B 2| - 1 ≥ 1 > 0. Any element v chosen from this erased set lies in F 1 ∩ B 2 and satisfies v ≠ y. The condition for j = 0 is vacuously true since j = 1 ≠ 0.

    lines 37–43

    uses Finset.card_erase_of_mem, Finset.card_pos.mp, Finset.mem_erase.mp, Finset.mem_inter.mp

            have htwo : 2 ≤ (F 1 ∩ B 2).card := by simpa using hcount
            have hn : 0 < ((F 1 ∩ B 2).erase y).card := by
              rw [Finset.card_erase_of_mem hyW]
              omega
            obtain ⟨v,hv⟩ := Finset.card_pos.mp hn
            have hv' := Finset.mem_erase.mp hv
            exact ⟨v,(Finset.mem_inter.mp hv'.2).1,(Finset.mem_inter.mp hv'.2).2,by simpa using hv'.1⟩
  7. When j = 1 and y ∉ F 1 ∩ B b, any element of F 1 ∩ B b satisfies the requirements.

    Since |F 1 ∩ B b| ≥ 1, we select an element v ∈ F 1 ∩ B b. Since y ∉ F 1 ∩ B b, v cannot equal y, giving v ≠ y. The condition for j = 0 holds vacuously.

    lines 44–46

    uses Finset.card_pos.mp, Finset.mem_inter.mp

          · obtain ⟨v,hv⟩ := Finset.card_pos.mp hpos
            have hvne : v ≠ y := fun h => hyW (h ▸ hv)
            exact ⟨v,(Finset.mem_inter.mp hv).1,(Finset.mem_inter.mp hv).2,by simpa using hvne⟩
  8. When j ≠ 0 and j ≠ 1, any element of F j ∩ B b satisfies the requirements.

    Since |F j ∩ B b| ≥ 1, there exists an element v ∈ F j ∩ B b. Because j is neither 0 nor 1, both conditions (j = 0 → v ≠ x) and (j = 1 → v ≠ y) are vacuously satisfied.

    lines 47–48

    uses Finset.card_pos.mp, Finset.mem_inter.mp

        · obtain ⟨v,hv⟩ := Finset.card_pos.mp hpos
          exact ⟨v,(Finset.mem_inter.mp hv).1,(Finset.mem_inter.mp hv).2,by simp [h0,h1]⟩
Finset.disjoint_left.mp
If two sets are disjoint, an element of the first set cannot belong to the second set.
Ne.symm
Inequality is symmetric: if a ≠ b, then b ≠ a.
Finset.mem_inter.mp
An element belongs to the intersection s ∩ t if and only if it belongs to s and to t.
Finset.card_erase_of_mem
Removing an element from a finite set decreases its cardinality by 1, provided the element belongs to the set.
Finset.card_pos.mp
A finite set with strictly positive cardinality is nonempty, containing at least one element.
Finset.mem_erase.mp
An element belongs to s with a removed if and only if it is in s and distinct from a.

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_four_shore_choose_nonendpoint_representative    {V : Type*} [Fintype V] [DecidableEq V]    (F B : Fin 4 → Finset V) (x y : V)    (hBdis : ∀ i j : Fin 4, i ≠ j → Disjoint (B i) (B j))    (hx : x ∈ B 0) (hy : y ∈ B 2) (j b : Fin 4)    (hcount : (if (j=0 ∧ b=0) ∨ (j=1 ∧ b=2) then 2 else 1) ≤ (F j ∩ B b).card) :    ∃ v ∈ F j, v ∈ B b ∧ (j=0 → v≠x) ∧ (j=1 → v≠y) := by  classical  have hpos : 1 ≤ (F j ∩ B b).card := by    split_ifs at hcount <;> omega  by_cases h0 : j=0  · subst j    by_cases hxW : x ∈ F 0 ∩ B b    · have hb0 : b=0 := by        by_contra hn        exact Finset.disjoint_left.mp (hBdis 0 b (Ne.symm hn)) hx (Finset.mem_inter.mp hxW).2      subst b      have htwo : 2 ≤ (F 0 ∩ B 0).card := by simpa using hcount      have hn : 0 < ((F 0 ∩ B 0).erase x).card := by        rw [Finset.card_erase_of_mem hxW]        omega      obtain ⟨v,hv⟩ := Finset.card_pos.mp hn      have hv' := Finset.mem_erase.mp hv      exact ⟨v,(Finset.mem_inter.mp hv'.2).1,(Finset.mem_inter.mp hv'.2).2,by simpa using hv'.1⟩    · obtain ⟨v,hv⟩ := Finset.card_pos.mp hpos      have hvne : v ≠ x := fun h => hxW (h ▸ hv)      exact ⟨v,(Finset.mem_inter.mp hv).1,(Finset.mem_inter.mp hv).2,by simpa using hvne⟩  · by_cases h1 : j=1    · subst j      by_cases hyW : y ∈ F 1 ∩ B b      · have hb2 : b=2 := by          by_contra hn          exact Finset.disjoint_left.mp (hBdis 2 b (Ne.symm hn)) hy (Finset.mem_inter.mp hyW).2        subst b        have htwo : 2 ≤ (F 1 ∩ B 2).card := by simpa using hcount        have hn : 0 < ((F 1 ∩ B 2).erase y).card := by          rw [Finset.card_erase_of_mem hyW]          omega        obtain ⟨v,hv⟩ := Finset.card_pos.mp hn        have hv' := Finset.mem_erase.mp hv        exact ⟨v,(Finset.mem_inter.mp hv'.2).1,(Finset.mem_inter.mp hv'.2).2,by simpa using hv'.1⟩      · obtain ⟨v,hv⟩ := Finset.card_pos.mp hpos        have hvne : v ≠ y := fun h => hyW (h ▸ hv)        exact ⟨v,(Finset.mem_inter.mp hv).1,(Finset.mem_inter.mp hv).2,by simpa using hvne⟩    · obtain ⟨v,hv⟩ := Finset.card_pos.mp hpos      exact ⟨v,(Finset.mem_inter.mp hv).1,(Finset.mem_inter.mp hv).2,by simp [h0,h1]⟩
See it in the graphDiscuss this resultChallenge it