TITLE: How to prove $\vdash\neg P\to (P\to Q)$?
QUESTION [5 upvotes]: I am trying to prove,

$$\vdash\neg P\to (P\to Q)$$

where $P$ and $Q$ are arbitrary but otherwise fixed formulas.
The only axioms and rule of inference that I can use are,

$\color{crimson}{\text{Axiom 1.}}\  P\to (Q\to P)$
$\color{crimson}{\text{Axiom 2.}}\  (S\to (P\to Q))\to((S\to P)\to (S\to Q))$
$\color{crimson}{\text{Axiom 3.}}\  (\neg Q\to\neg P)\to(P\to Q)$
$\color{crimson}{\text{Rule of Inference.}}$ Modus Ponens.

I know that in Angelo Margaris's book First Order Mathematical Logic there is a proof (page 53) but as I have mentioned here, the dot notation seems very confusing and translating them to the nested parentheses notation seems very difficult to me. So, I am trying on my own to prove the result.
Can anyone help?

REPLY [3 votes]: Abbreviate $a = \lnot P$, $b = \lnot Q \to \lnot P$, and $c = P \to Q$. Then

$\color{crimson}{\text{1.}}\  a\to b \color{crimson}{\ \ \ \text{by axiom 1}}$
$\color{crimson}{\text{2.}}\  b\to c \color{crimson}{\ \ \ \text{by axiom 3}}$

and we need to deduce $a \to c$. The thing that ultimately is going to produce this is

$\color{crimson}{\text{3.}}\  (a \to (b \to c)) \to ((a \to b) \to (a \to c)) \color{crimson}{\ \ \ \text{by axiom 2}}$

Note that we're already very close: we just need to deduce $a \to (b \to c)$ from $b \to c$ and apply modus ponens twice. So

$\color{crimson}{\text{4.}}\  (b\to c) \to (a \to (b \to c)) \color{crimson}{\ \ \ \text{by axiom 1}}$
$\color{crimson}{\text{5.}}\  a \to (b \to c) \color{crimson}{\ \ \ \text{by modus ponens on 2 and 4}}$

And, as promised, we finish by applying modus ponens twice.

$\color{crimson}{\text{6.}}\  (a \to b) \to (a \to c) \color{crimson}{\ \ \ \text{by modus ponens on 3 and 5}}$
$\color{crimson}{\text{7.}}\  a \to c \color{crimson}{\ \ \ \text{by modus ponens on 1 and 6}}$