In the book Gödel's Theorems and Zermelo's Axioms by Halbeisen and Krapf the first chapter contains an excercise that asks us to prove $$\phi\rightarrow \psi \vdash \neg \psi \rightarrow\neg \phi,$$
i.e. contraposition. I can't figure out how to prove it. The axioms that are given are the following (This excercise comes before the deduction theorem):
\begin{align*} L_0:& \phi \vee\neg\phi \\ L_1:& \phi\rightarrow(\psi\rightarrow\phi) \\ L_2:& (\psi\rightarrow(\phi_1\rightarrow\phi_2))\rightarrow((\psi\rightarrow\phi_1)\rightarrow(\psi\rightarrow\phi_2)) \\ L_9:& \neg\phi \rightarrow (\phi \rightarrow \psi). \end{align*}
($L_3$ up to $L_8$ are axioms using $\wedge$ or $\vee$, so they're not relevant for the question I think, even $L_0$ should probably not be used here.)
The back of the book contains the following solution: \begin{align*} \phi_0:& \phi \rightarrow \psi && \text{given} \\ \phi_1:& \phi_0 \rightarrow (\neg \psi \rightarrow \phi_0) && L_1 \\ \phi_2:& \neg\psi\rightarrow\phi_0 && MP \text{ from } \phi_0 \text{ and } \phi_1 \\ \phi_3:& (\phi \rightarrow \psi) \rightarrow ((\phi \rightarrow \neg \psi) \rightarrow \neg\phi) && L_9 \\ \vdots \end{align*} Given $\phi_3$, the rest of the deduction is easy to follow (though I don't see how I could easily come up with it myself). However, I don't see how $\phi_3$ is deduced. Applying $L_9$ but with $\phi \equiv \neg(\phi \rightarrow \psi)$ and $\psi\equiv \neg \phi$ (which is what they appear to be doing) gives $$ (\phi \rightarrow \psi) \rightarrow (\neg(\phi\rightarrow\psi)\rightarrow\neg\phi). $$ Essentially, I have the following two questions:
- Is the proof in Halbeisen and Krapf incorrect (i.e. is there a typo), or am I missing something?
- How do you actually formally prove contraposition in the given system?