AFTD Auto-Formalizing Theoretical Domains

overlapping_five_windows_force_middle_pair

theoremverified

If each of two overlapping five-element sets contains the element excluded by the other and those excluded elements avoid their common outside positions, the two middle elements form exactly the excluded pair.

Statement

theorem overlapping_five_windows_force_middle_pair
    {α : Type*} [DecidableEq α] (a b c d e f : α)
    (hea : e ≠ a) (hed : e ≠ d) (hef : e ≠ f)
    (hfa : f ≠ a) (hfd : f ≠ d)
    (he : e ∈ ({f, a, b, c, d} : Finset α))
    (hf : f ∈ ({a, b, c, d, e} : Finset α)) :
    ({b, c} : Finset α) = {e, f}
Source
Helper for the OP-874 truncation coloring campaign; the concrete instance is independently checked in experiments 33309, 33310, 33320, 33321 and 33322.
Verified
19 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof establishes that the excluded elements e and f must both belong to the two-element set of middle elements {b, c}. Expanding the membership assumptions and ruling out the elements a, d, and the other excluded element reduces e and f to alternatives in {b, c}. A four-way case analysis then eliminates the two cases where e and f would coincide (contradicting e ≠ f) and shows the equality of sets {b, c} = {e, f} in the remaining two cases.

  1. e = b ∨ e = c

    Expanding the hypothesis e ∈ {f, a, b, c, d} gives the disjunction e = f ∨ e = a ∨ e = b ∨ e = c ∨ e = d using Finset.mem_insert and Finset.mem_singleton. Since the hypotheses state that e ≠ a, e ≠ d, and e ≠ f, these three alternatives are ruled out, leaving only e = b ∨ e = c.

    lines 8–10

    uses Finset.mem_insert, Finset.mem_singleton

      have he' : e = b ∨ e = c := by
        simp only [Finset.mem_insert, Finset.mem_singleton] at he
        aesop
  2. f = b ∨ f = c

    Similarly, expanding f ∈ {a, b, c, d, e} yields f = a ∨ f = b ∨ f = c ∨ f = d ∨ f = e. The hypotheses f ≠ a, f ≠ d, and e ≠ f (so f ≠ e) rule out three of the five possibilities, leaving f = b ∨ f = c.

    lines 11–13

    uses Finset.mem_insert, Finset.mem_singleton

      have hf' : f = b ∨ f = c := by
        simp only [Finset.mem_insert, Finset.mem_singleton] at hf
        aesop
  3. {b, c} = {e, f}

    We perform a case split over the four combinations of choices for e and f in {b, c}. If e and f were assigned the same element (e = b and f = b, or e = c and f = c), we would have e = f, contradicting e ≠ f. The remaining two cases assign {e, f} to {b, c} in either order, which matches {b, c} either identically or via commutativity of pairs (Finset.pair_comm).

    lines 14–15

    uses Finset.pair_comm

      rcases he' with hb | hc <;> rcases hf' with hb' | hc' <;>
        subst_vars <;> simp_all [Finset.pair_comm]
Finset.mem_insert
An element belongs to the insertion of an element into a finite set if and only if it equals the inserted element or belongs to the set.
Finset.mem_singleton
An element belongs to a singleton set if and only if it is equal to the element of that set.
Finset.pair_comm
A two-element set is unordered: {a, b} = {b, 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

theorem overlapping_five_windows_force_middle_pair    {α : Type*} [DecidableEq α] (a b c d e f : α)    (hea : e ≠ a) (hed : e ≠ d) (hef : e ≠ f)    (hfa : f ≠ a) (hfd : f ≠ d)    (he : e ∈ ({f, a, b, c, d} : Finset α))    (hf : f ∈ ({a, b, c, d, e} : Finset α)) :    ({b, c} : Finset α) = {e, f} := by  have he' : e = b ∨ e = c := by    simp only [Finset.mem_insert, Finset.mem_singleton] at he    aesop  have hf' : f = b ∨ f = c := by    simp only [Finset.mem_insert, Finset.mem_singleton] at hf    aesop  rcases he' with hb | hc <;> rcases hf' with hb' | hc' <;>    subst_vars <;> simp_all [Finset.pair_comm]
See it in the graphDiscuss this resultChallenge it