Let $A$ and $B$ be [[Set|sets]]. We say $A$ and $B$ have the same **cardinality** when there exists a [[Bijective Function]] $f: A \rightarrow B$. We denote by $|A|$ the [[Equivalence Class|equivalence class]] of all sets with the same cardinality as $A$ and we simply call **$|A|$** the **cardinality of $A$**.
Suppose $A$ has the same cardinality as $\{1,2,3, \ldots, n\}$ for some $n \in \mathbb{N}$. We then write $|A|:=n$. If $A$ is empty we write $|A|:=0$. In either case we say that $A$ is finite.
We say $A$ is infinite or "of infinite cardinality" if $A$ is not finite.
That the notation $|A|=n$ is justified we leave as an exercise. That is, for each nonempty finite set $A$, there exists a unique natural number $n$ such that there exists a bijection from $A$ to $\{1,2,3, \ldots, n\}$.
We write
$
|A| \leq|B|
$
if there exists an injection from $A$ to $B$. We write $|A|=|B|$ if $A$ and $B$ have the same cardinality. We write $|A|<|B|$ if $|A| \leq|B|$, but $A$ and $B$ do not have the same cardinality.
related: [[† Cantor-Bernstein-Schröder theorem]]
$|A|=|B|$ have the same cardinality if and only if $|A| \leq|B|$ and $|B| \leq|A|$. Furthermore, if $A$ and $B$ are any two sets, we can always write $|A| \leq|B|$ or $|B| \leq|A|$.