\input{decls.tex}
\title{Sets}
\begin{document}
\maketitle
Set comprehensions can be written $\{ x | x \in \N \}$ or $\{ x : x \in \N \}$ - '$:$' or '$|$' \\
Sets are defined entirely by the values of $x$ for which $x \in A$
\begin{description}
	\item[Axiom of Extensionality / Set Equality] $A = B \iff \forall x. (x \in A \iff x \in B)$
	\item[$A \subseteq B$] \quad $\forall x \in A. x \in B$ \\
		Is transitive, reflexive, antisymmetric
	\item[$A \subset B$] \quad $(\forall x \in A.~x \in B) \land (\exists x \in B.~x \not\in A)$ \\
		Is transitive, antisymmetric
	\item[$\varnothing$] $\{\}$
	\item[$\cup$] Union
	\item[$\cap$] Intersection
	\item[$A \setminus B$] \quad $\{ x \in A : x \not\in B \}$
		\item[$A^\complement$]\quad $U \setminus A$
	\item[$[a, b)$] \quad $\{ x \in \R : a \leq x < b \}$
\end{description}
\begin{align*}
	C \setminus (A \cup B) \equiv           & ~ (C \setminus A) \cap (C \setminus B) \\
	C \setminus (A \cap B) \equiv           & ~ (C \setminus A) \cup (C \setminus B) \\
	(A^\complement)^\complement \equiv      & ~ A                                    \\
	A^\complement \cup B^\complement \equiv & ~ (A \cap B)^\complement               \\
	A^\complement \cap B^\complement \equiv & ~ (A \cup B)^\complement
\end{align*}
\section*{Families of Sets}
A family of sets indexed by a set $I$ (the indexing set): $A_i ~~\forall~i\in I (\equiv (A_i)_{i\in I})$ \\
$A_i$ is a set for every element $i \in I$ \\
A family of sets indexed by $\N$ is called a sequence of sets. Also written $(B_i)^{\inf}_{i=0}$ or $(B_i)_{i \geq 0}$
\begin{align*}
\bigcup_{i \in I}~A_i \equiv \{x | \exists i \in I. x \in A_i \} \\
\bigcap_{i \in I}~A_i \equiv \{x | \forall i \in I. x \in A_i \} & \text{ Exists iff } \exists~i\in I
\end{align*}
\begin{align*}
	& \forall i \in I. A_i \subseteq \cup_{j \in I}A_j \\
	& \forall i \in I. A_i \subseteq B \implies \cup_{j \in I}A_j \subseteq B \\
	& \forall i \in I.\cap_{j \in I}A_j \subseteq A_i  \\
	& \forall i \in I. B \subseteq A_i \implies B \subseteq \cap_{j \in I}A_j \\ \\
	& B \cup \cap_{i \in I}A_i = \cup_{i \in I}(B \cap A_i) \\
	& B \cap \cup_{i \in I}A_i = \cap_{i \in I}(B \cup A_i) \\
	& B \setminus \cup_{i \in I}A_i = \cap_{i\in I}(B\setminus A_i) \\
	& B \setminus \cap_{i \in I}A_i = \cup_{i\in I}(B \setminus A_i)
\end{align*}
\section*{Cartesian Products}
Ordered pairs can be represented as $(x, y) \equiv \{x, \{x, y\}\}$ \\
$X \times Y = \{ (x, y) |~ \forall x, y.~x \in X \land y \in Y\}$ for sets $X$, $Y$ \\
$X^n$ is $X\times X^{n-1}$ for set $X$ and natural $n$ \\
$\card{X\times Y} = \card{X} \times \card{Y}$ (for finite $X$, $Y$)
\section*{Functions}
For sets $X$, $Y$:
\begin{description}
	\item[A function $F: X \to Y$] $\subseteq X\times Y$ \text { where } \\
		$\forall x \in X.~\exists \text{ a unique } y \in Y.~ (x, y) \in F$ \\
		$F(x)$ denotes the unique element $y \in Y$ for which $(x, F(x)) \in F$
	\item[$\operatorname{dom}(F)$] The domain of $F$, i.e. $X$
	\item[$\operatorname{incl}^{X}_{A} : A \to X$] $= a \quad \forall A X. \text{ where } A \subseteq X$
\end{description}
\end{document}
