I am curious how one would figure out a proof like this, that $\vdash p \to p$ using only axioms and rules of inference:
https://proofwiki.org/wiki/Law_of_Identity/Formulation_2/Proof_3
Posting some details below to summarize it all:
Axiom 1 is $ \vdash A \to (B \to A)$
Axiom 2 is $\vdash (A \to (B \to C)) \to ((A \to B) \to (A \to C))$
Modus ponens is $A, (A \to B) \vdash B$
So we start with an instance of axiom 2: $(p \to ((p \to p) \to p)) \to ((p \to (p \to p)) \to (p \to p))$ where $A = p$ and $B = p \to p$ and $C = p $.
And then we have an instance of axiom 1: $p \to ((p \to p) \to p)$ where $A = p$ and $B = p \to p$.
Then using modus ponens on those two gets us $(p \to (p \to p)) \to (p \to p)$.
Now we make another instance of axiom 1: $p \to (p \to p)$ where $A = p$ and $B = p$.
Using modus ponens again with our old result and this new axiom gets us $p \to p$ and we're done.
But how would we have ever known how to figure this out? Is there a systematic way or is it mostly trial and error?
We seek to prove $p\to p$, using only the three axiom schemas and modus ponens, so we need something that ultimately implies $(p\to p)$.
By inspection: Axiom 1 suggests $p\to(p\to p)$ . Axiom 2 suggests $(p\to(B\to p))\to((p\to B)\to (p\to p))$. Axiom 3 suggests $(\neg p\to\neg p)\to(p\to p)$ .
The second seems more helpful, but for what $B$? It is trial and error time.
Substituting $B:=p$ and using modus ponens would give $(p\to p)\to(p\to p)$ which is not really helpful.
Substituting $B:=(p\to p)$ gives $(p\to((p\to p)\to p))\to((p\to(p\to p))\to(p\to p))$ which is rather helpful. The rest falls into place.
$$\begin{array}{l}1. & p\to(p\to p) &\text{via Axiom }1\\2. & p\to((p\to p)\to p) &\text{via Axiom }1\\ 3. & (p\to((p\to p)\to p))\to((p\to(p\to p))\to(p\to p)) & \text{via Axiom }2\\ 4. & (p\to(p\to p))\to(p\to p) &\text{via modus ponens }2,3\\ 5. & p\to p &\text{via modus ponens }1,4 \\\blacksquare \end{array}$$
So trial and error is involved, but a systematic approach is needed. Pattern recognition skills are quite essential.