# Definition:Class Equality

## Definition

Let $A$ and $B$ be classes.

### Definition 1

$A$ and $B$ are equal, denoted $A = B$, if and only if:

$\forall x: \paren {x \in A \iff x \in B}$

where $\in$ denotes class membership.

### Definition 2

$A$ and $B$ are equal, denoted $A = B$, if and only if:

$A \subseteq B$ and $B \subseteq A$

where $\subseteq$ denotes the subclass relation.

When $x$ is a set variable, equality of $x$ and $A$ is defined using the same formula:

$x = A$ if and only if $\forall y: \paren {y \in x \iff y \in A}$
$A = x$ if and only if $\forall y: \paren {y \in A \iff y \in x}$

## Axiom of Extension

The concept of class equality is axiomatised as the Axiom of Extension:

Let $A$ and $B$ be classes.

Then:

$\forall x: \paren {x \in A \iff x \in B} \iff A = B$

## Equality as applied to Sets

In the context of set theory, the same definition applies:

Let $S$ and $T$ be sets.

### Definition 1

$S$ and $T$ are equal if and only if they have the same elements:

$S = T \iff \paren {\forall x: x \in S \iff x \in T}$

### Definition 2

$S$ and $T$ are equal if and only if both:

$S$ is a subset of $T$

and

$T$ is a subset of $S$

## Comment

This definition "overloads" the $=$ sign, since $x = y$ could refer to either class equality or set equality.

However, this overloading is justified because for sets $x$ and $y$, $x = y$ is equal for either set equality or class equality.

This fact is proved on Class Equality Extension of Set Equality.