I have a question on something extremely basic I can't find described properly in literature. It must be so obvious most people don't even need to hear about it.
My starting point is this. In first order logic with equality, I have an axiom telling me that I can substitute equal things in formulas. Why isn't there a similar axiom for logically equivalent formulas? Everybody does this kind of substitutions all the time in formal proof, but how are they justified rigorously? Shouldn't there be an axiom?
I have tried to use the existing axioms and here's my attempt. If $\alpha \Leftrightarrow \beta$ and I have a formula $\varphi$ containing $\alpha$, I suppose I could say that $\varphi \Leftrightarrow \varphi'$ is a tautology where $\varphi'$ is $\varphi$ where I have substituted some occurrences of $\alpha$ with $\beta$. My argument (perhaps not too formal) would be that I have not changed any truth tables by substituting. Once I have that tautology, if $\varphi$ holds, I could use biconditional elimination and deduce $\varphi'$.
However, this doesn't quite work when quantifiers are thrown into the mix. If $\varphi \equiv \forall x \alpha$, I can't say that $\forall x \alpha \Leftrightarrow \forall x \beta$ is a propositional tautology.
In a nutshell, does anyone know what it is that justifies swapping logically equivalent formulas in a formal proof?
Yes; we have a "substitution theorem" in FOL.
See: Dirk van Dalen, Logic and Structure, Springer (5th ed. 2013), page 70, for a "bookkeeping lemma" regarding substitution.
With it, we can prove:
where the “$\$$” symbol is a “place holder” for an atom.
Of course, substitution must be carefully defined in order to avoid "clash" with existing quantifiers; i.e.: $ϕ,ψ$ must be free for $\$$ in $σ$ (see page 61-63).