Leibniz: If $A \equiv B$ is a theorem, then so is $C[p:= A] \equiv C[p:= B]$.
Note: p is "fresh" means p doesn't occur in $A, B, C$.
I am trying to understand how to use Leibniz rule of inference for my proof. I understand equanimity, and the other axioms and boolean logic. The example below (equational proof) is giving me a hard time.
Prove theorem $A \vee A \wedge B \equiv A$:
$A \vee (A \wedge B)$
$\Leftrightarrow$ < proven theorem $(A \wedge T \equiv A)$ + Leib, C-part: $p \vee (A \wedge B)$, p fresh >
$(A \wedge T) \vee (A \wedge B)$
$\Leftrightarrow$ < Distributivity of $\wedge$ over $\vee$ (2.4.23 (ii)) >
$A \wedge (T \vee B)$
$\Leftrightarrow$ < proven theorem $( B \vee T)$ (2.4.7) + redundant true metatheorem + symmetry of $\vee$, therefore theorem $T \vee B \equiv T$ + Leib, C-part: $A \wedge p$, p fresh >
$A \wedge T$
$\Leftrightarrow$ < proven theorem $( A \wedge T \equiv A)$ (2.4.20) >
$A$
I dont understand how to go from that first line to the second line. Why are we using Leib on $(A \wedge T \equiv A)$ and not the formula in the fist line? How do you choose what C should be? Also I tried working out Leib on $(A \wedge T \equiv A)$, I got $(A \wedge T) \vee (A \wedge B) \equiv A \vee A \wedge B$, so then why does the following line only take the left side of $\equiv$?
I will give you this answer.
Using the two identities : $A \equiv A \land T$ and $T \equiv B \lor T$, we have that :
by Leibniz.
Using Distributive law we have :
by Leibniz, using again the above identity.
Finally :
by Commutativity.
About the correct understanding of Leibniz, I will refer to George Tourlakis, Mathematical Logic (2008), taht is based on equational logic.
See page 39, 1.4.1 Definition. (Schema Instance) :
See also page 40, 1.4.2 Definition. (Rules of Inference) :
For the "correct usage" of Leibniz you must take into account the difference between the (meta)-variables $A$ and $B$, which stay for formulas, and the (meta)-variable $p$, which stay for a Boolean letter.
In applying Leibniz to the formula
you must understand that the equivalence is between formulas; when you apply Leibniz, you must replace a Boolean letter "contained" into an existing formula (call it first) with another formula (call it second), obtaining a resulting formula (call it third). Leibniz says that third will be equivalent to first.
In our application, we have replaced into the formula $A$ (the $C$ of the rule) the Boolean letter $A$ (now, the $p$ of the rule) with the formula $A \land T$ (the $B$ of the rule, that is equivalent to $A$); this is the reason why : $A \equiv A \land T$.
So, the conclusion is, do not "mix" the different styles of variable in the formulas.