$\{X,Y\} \equiv \{x \mid x = X \lor x = Y\}$
$\{X,X\} = \{x \mid x = X \lor x = X\} = \{x \mid x = X\} = \{X\}$
Wikipedia: Axiom of pairing
Sets