AFTD Auto-Formalizing Theoretical Domains

equal_cardinality_set_transition

theoremverified

For finite sets A and B of equal cardinality and any x in A, some y in B either equals x or lies outside A.

Statement

theorem equal_cardinality_set_transition {Ω : Type*} [DecidableEq Ω]
    (A B : Finset Ω) (hcard : A.card = B.card) (x : Ω) (hx : x ∈ A) :
    ∃ y ∈ B, y = x ∨ y ∉ A
Source
Elementary transition in the cyclic palette selection construction for OP-874.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 2

Lean source view module on GitHub

theorem equal_cardinality_set_transition {Ω : Type*} [DecidableEq Ω]
    (A B : Finset Ω) (hcard : A.card = B.card) (x : Ω) (hx : x ∈ A) :
    ∃ y ∈ B, y = x ∨ y ∉ A := by
  by_cases hxB : x ∈ B
  · exact ⟨x, hxB, Or.inl rfl⟩
  · have hnot : ¬ B ⊆ A := by
      intro hBA
      have heq : B = A := Finset.eq_of_subset_of_card_le hBA (by omega)
      apply hxB
      rw [heq]
      exact hx
    obtain ⟨y, hyB, hyA⟩ := Finset.not_subset.mp hnot
    exact ⟨y, hyB, Or.inr hyA⟩
See it in the graphDiscuss this resultChallenge it