# Equality (sets)

The defining feature of a set is the collections of elements that are in or not in it. This suggests that we should consider two sets to be the same if they contain the same elements. This motivates the definition of equality:

Definition: Equality (sets)
Two sets and are equal if and .

This is equivalent to the following definition:

Definition: Equality (sets)
Two sets and are equal if, for all , is also in and if for all , is also in .

Here is a third variant:

Definition: Equality (sets)
Two sets and are equal if, for all , if and only if .

These three definitions are equivalent (proof left as an exercise), so you can use them interchangeably.

This definition tells us that sets "ignore" duplicates and order. For example, ; we can prove this using the definition. First, we check every in the left hand side (LHS) is in the right hand side (RHS); by inspection, we see that , and . Then, we check that every in the RHS is in the LHS; which they are, again by inspection.