For example,
$\phi = r \rightarrow (\neg p \rightarrow \neg q)$
$A = ( \neg p \rightarrow \neg q)$
$B = ( q \rightarrow p)$
A is equivalent to B. In other words, they have identical truth tables. I also know that if I replace A with B in this specific case the resulting truth table remains the same. I'd like to know if that's the case for any formula and, if so, where can I find the theory or proof of that property, please.
I'm not satisfied, for example, with this article: https://en.wikipedia.org/wiki/Substitution_(logic), because it doesn't speak at all about logical equivalence.
I also am not sure if a substitution theorem for an axiom system apply for this case, because I'm talking about any formula in propositional logic and not only axioms.