Closure for Finite Collection of Relations and Operations

Theorem
Let $\mathcal R_1, \mathcal R_2, \ldots \mathcal R_n$ be relations.

Let $\mathcal S_1, \mathcal S_2, \ldots \mathcal S_m$ be operations.

Let $T$ be a small class.

Let the image of $\mathcal R_i$ over any small class $x$ be small classes for $1 \le i \le n$.

Let the image of $\mathcal S_i$ over any Cartesian product $x \times x$ be small classes for $1 \le i \le m$.

Then there exists a small class $X$ such that:


 * $(1): \quad$ $T \subseteq X$
 * $(2): \quad$ Each $R_i$ is closed with respect to $X$. Each $S_i$ is closed with respect to $X \times X$.
 * $(3): \quad$ $X$ is the smallest small class satisfying conditions $(1)$ and $(2)$ above.

If $Y$ satisfies conditions $(1)$ and $(2)$, then $X \subseteq Y$.

Proof
Let $R \left[{x}\right]$ denote the image of $x$ under $R$.

Set:
 * $\displaystyle G \left({x}\right) = x \cup \bigcup_{i \mathop = 1}^n \mathcal R_i \left[{x}\right] \cup \bigcup_{i \mathop = 1}^m \mathcal S_i \left[{x}\right]$

Using the Principle of Recursive Definition, construct the function $F$ as follows:


 * $F \left({0}\right) = T$
 * $F \left({n+1}\right) = G \left({F \left({n}\right)}\right)$

Define $X$ as follows:


 * $\displaystyle X = \bigcup_{n \mathop \in \omega} F \left({n}\right)$

Proof of Closure
Take any $\mathcal R_i$.

Suppose $x \mathcal R_i y$ and $x \in F \left({n}\right)$ for some $n$.

Then $y \in F \left({n+1}\right)$ by the definition of image.

Thus $y \in X$ and $R_i$ is closed with respect to $X$.

Similarly, take any $\mathcal S_i$.

Suppose $\left({x S_i y}\right) = z$ and that $x \in X$ and $y \in X$.

It follows that $x, y \in F \left({n}\right)$ for some $n$.

So:
 * $z \in F \left({n+1}\right)$

Therefore:
 * $z \in X$

Proof that $X$ is the Smallest Relational Closure
Suppose $T \subseteq Y$ and that $R_i$ and $S_i$ are closed with respect to $Y$.

$F \left({n}\right) \subseteq Y$ shall be proven by induction:

For all $n \in \omega$, let $P \left({n}\right)$ be the proposition:
 * $F \left({n}\right) \subseteq Y$

Basis for the Induction
$P \left({0}\right)$ is the case:
 * $F \left({0}\right) \subseteq Y$

which has been proved above.

This is our basis for the induction.

Induction Hypothesis
Now we need to show that, if $P \left({k}\right)$ is true, where $k \ge 0$, then it logically follows that $P \left({k+1}\right)$ is true.

So this is our induction hypothesis:
 * $F \left({k}\right) \subseteq Y$

Then we need to show:
 * $F \left({k+1}\right) \subseteq Y$

Induction Step
This is our induction step:

So $P \left({k}\right) \implies P \left({k+1}\right)$ and the result follows by the Principle of Mathematical Induction.

Therefore:
 * $\forall n \in \omega: F \left({n}\right) \subseteq R$

Hence by Indexed Union Subset:
 * $T \subseteq Y$