TITLE: Is this a valid proof that A = B given A ∩ B = A ∪ B?
QUESTION [8 upvotes]: Here is my proof. My instructor claims that it is invalid because I did not use a set membership table, and that the use of a predicate logic truth table is invalid.
That makes no sense to me. If I can do S := { x | P(x) }, then I should obviously be able to use predicate logic on the members of sets!
Given 2 sets A and B such that A ∩ B = A ∪ B, what can be concluded about A and B?

A ∩ B = A ∪ B                                                           restatement

∀x(x ∈ A ∩ B ↔ x ∈ A ∪ B)                                               definition of set equality

∀x(x ∈ A ∧ x ∈ B ↔ x ∈ A ∨ x ∈ B)                                       set membership distributed over union and intersection

p(x) := x ∈ A

q(x) := x ∈ B

p    q    p ∧ q    p ∨ q    p ∧ q ↔ p ∨ q    p ↔ q

T    T      T        T            T            T

T    F      F        T            F            F

F    T      F        T            F            F

F    F      F        F            T            T

∀x(x ∈ A ↔ x ∈ B)                                                        logical equivalence (p ↔ q ≡ p ∧ q ↔ p ∨ q)

∀x(x ∈ A → x ∈ B ∧ x ∈ B → x ∈ A)                                        logical equivalence (p → q ∧ q → p ≡ p ↔ q)

∀x(x ∈ A → x ∈ B) ∧ ∀x(x ∈ B → x ∈ A)                                    universal quantifier distributed over conjunction

A ⊆ B ∧ B ⊆ A                                                            definition of subset

A = B                                                                     definition of set equality

We see that the sets A and B are equal. A and B may both be the empty set.

So, is my proof valid?
Edit: after further reflection, I think the point of contention may be the use of a truth table to demonstrate logical equivalence over an infinite domain. This proof may not be valid for infinite sets. I could instead demonstrate the logical equivalence p ↔ q ≡ p ∧ q ↔ p ∨ q another way.

REPLY [2 votes]: Let me show you a Fitch-style proof corresponding to your (correct)reasoning, to make sure you understand why it is valid:

Given any sets $A,B$ such that $A∩B = A∪B$:
  Given any object $x$:
    $x∈A∩B ⇔ x∈A∪B$.
    Thus $x∈A ∧ x∈B ⇔ x∈A ∨ x∈B$.
    Let $P :≡ x∈A$.
    Let $Q :≡ x∈B$.
    Then $P∧Q ⇔ P∨Q$.
    Thus $P ⇔ Q$.   [by the truth-table you gave]
    Thus $x∈A ⇔ x∈B$.
  Therefore $A = B$.

Note that you perform the same reasoning for any given object $x$, so even though the $P,Q$ in the above proof may differ in truth-value for different $x$, it still holds in every case that $P ⇔ Q$, and hence you get the conclusion you seek. If your instructor cannot understand this, ask him/her to give you any sets $A,B$ such that $A∩B = A∪B$ and any object $x$ and explicitly follow the proof to show (by a single use of the truth-table) that $x∈A ⇔ x∈B$. If it is clear that he/she cannot prevent your conclusion no matter what $A,B,x$ he/she gives you, then you have won. (This is called game semantics, by the way, and I recommend you think of quantifiers this way to fully grasp the meaning of order of quantification.)