Substitutivity of Class Equality

Theorem
Let $A$ and $B$ be classes.

Let $P(A)$ be a well-formed formula of the language of set theory.

Let $P\left({B}\right)$ be the same proposition $P\left({A}\right)$ with all instances of $A$ replaced with instances of $B$.

Let $=$ denote class equality


 * $A = B \implies \left({ P(A) \iff P(B) }\right)$

Proof
By induction on the well-formed parts of $P\left({A}\right)$.

The proof shall use $\implies$ and $\neg$ as the primitive connectives.

Atoms
First, to prove the statement if $A$ and $B$ are members of some other class $C$:

Then, if $A$ and $B$ have $C$ as a member:

Inductive Step for $\implies$
Suppose that $P\left({A}\right)$ is of the form $Q\left({A}\right) \implies R\left({A}\right)$

Furthermore, suppose that:


 * $A = B \implies \left({ Q\left({A}\right) \iff Q\left({B}\right) }\right)$ and:


 * $A = B \implies \left({ R\left({A}\right) \iff R\left({B}\right) }\right)$

It follows that:


 * $A = B \implies \left({ \left({ Q\left({A}\right) \implies R\left({A}\right) }\right) \iff \left({ Q\left({B}\right) \implies R\left({B}\right) }\right) }\right)$


 * $A = B \implies \left({ P\left({A}\right) \iff P\left({B}\right) }\right)$

Inductive Step for $\neg$
Suppose that $P\left({A}\right)$ is of the form $\neg Q\left({A}\right)$

Furthermore, suppose that:


 * $A = B \implies \left({ Q\left({A}\right) \iff Q\left({B}\right) }\right)$

It follows that:


 * $A = B \implies \left({ \neg Q\left({A}\right) \iff \neg Q\left({B}\right) }\right)$


 * $A = B \implies \left({ P\left({A}\right) \iff P\left({B}\right) }\right)$

Inductive Step for $\forall x:$
Suppose that $P\left({A}\right)$ is of the form $\forall z: Q\left({x,z}\right)$

If $x$ and $z$ are the same variable, then $x$ is a bound variable and the theorem holds trivially.

If $x$ and $z$ are distinct, then: