Textbook
Sets $A$ and $B$ are equal exactly when they have the same elements:
$$A=B\quad\Longleftrightarrow\quad\forall x\,(x\in A\Leftrightarrow x\in B).$$
An equivalent criterion is mutual inclusion: $A=B$ exactly when $A\subseteq B$ and $B\subseteq A$. The symbol $\subseteq$ permits equality.
For the forward direction, equality of the sets is assumed. Every element of either set then belongs to the other, so both inclusions hold. Conversely, the first inclusion rules out elements only in $A$, and the second rules out elements only in $B$. Membership therefore agrees for every $x$, and the sets are equal.
One inclusion is insufficient. Equal numbers of elements are also insufficient: $\{1,2\}\ne\{3,4\}$. Enumeration order and repeated entries do not matter.
Different descriptions can specify the same set: an enumeration and a selection condition are compared by elements, not by how their expressions look. One object belonging to exactly one set suffices to prove inequality. An inclusion proof takes an arbitrary element, assuming no special properties beyond its membership. This matters especially for infinite sets, where inspecting several representatives cannot cover every possible object.
Related concepts: Set inclusion.
In plain language
Equal guest lists require the same membership: everyone on the first is on the second and conversely. Equal lengths prove little; two parties can each have ten guests without sharing a single person. Rearranged lines, different fonts, and repeated entries do not change a set, but a matching name must identify the same guest. Mathematics cannot repair ambiguous identification or require namesakes to share a chair for a convenient comparison.
Example
The illustrative descriptions $A=\{1,2,3\}$ and $B=\{3,1,2,2\}$ list their elements in different orders. The repeated 2 adds no new element.
Set equality
From A into B
Every element of A is in B. The first inclusion holds.
Step 1 of 3: From A into B
Read all steps
From A into B
Every element of A is in B. The first inclusion holds.
- A
- 1current2current3current
- B
- 3included1included2included
From B into A
Every element of B is in A. The second inclusion completes the proof.
- A
- 1included2included3included
- B
- 3current1current2current
Replacing one element
Set C contains 4 instead of 3. Its size stays the same, but equality disappears.
- A
- 123excluded
- C
- 124excluded
The first direction establishes only that $A$ has no elements missing from $B$. The reverse direction rules out extra elements in $B$; together they complete the comparison. In the final step, three is already a witness of inequality: it belongs to $A$ but not to the replacement set. There is no need to find every difference when the goal is to disprove equality. One verified mismatch is sufficient.