Proving: if P then (if p then q) without dependencies (How Logic Works Exercise 3.2.3) I am working through Hans Halvorson's How Logic Works: A User's Guide and I am struggling to solve Exercise 3.2.2 which reads:
Prove the following sequent: ⊢ Q → (P → Q)
My proposed solution using the rules Halvorson has thus far presented(namely: conjunction elimination/introduction, disjunction intro, modus ponens, modus tollens, double negation, and conditional proof) :
1   (1) Q → (P → Q) a
2   (2) Q           a
1,2 (3) P → Q       1,2 MP
1   (4) Q → (P → Q) 2,3 CP
(5) (Q → (P → Q)) → (Q → (P → Q)) 1,4 CP
The use of a conditional proof (CP) on line 5 seems off to me and obviously the statement (Q → (P → Q)) → (Q → (P → Q)) ≠ ⊢ Q → (P → Q).
Any guidance on how to use CP more appropriately would be appreciated.
 A: Without knowing the specific rules you have available it's quite difficult to give you an answer that fits those rules  Anyway, here's a few ways and hopefully you can fit them to your system.
Augmentation Method
$\begin{array}{}
\{1\}&1.&Q&\text{A for CP}\\
\{2\}&2.&P&\text{A for CP}\\
\{1, 2\}&3.&P\land Q&\text{1, 2 $\land$I}\\
\{1, 2\}&4.&Q&\text{3 $\land$E}\\
\{1\}&5.&P\to Q&\text{2, 4 CP}\\
\{\}&6.&Q\to (P\to Q)&\text{1, 5 CP}\\
\end{array}$
Reiteration Method
$\begin{array}{}
\{1\}&1.&Q&\text{A for CP}\\
\{2\}&2.&P&\text{A for CP}\\
\{1, 2\}&3.&Q&\text{1, 2 Reit}\\
\{1\}&4.&P\to Q&\text{2, 3 CP}\\
\{\}&5.&Q\to (P\to Q)&\text{1, 4 CP}\\
\end{array}$
Derived Rule Method
$\begin{array}{}
\{1\}&1.&Q&\text{A for CP}\\
\{1\}&2.&P\to Q&\text{1 DR}\\
\{\}&3.&Q\to (P\to Q)&\text{1, 2 CP}\\
\end{array}$
I've included this because it's a really common derived rule and it's really quite a handy one to know (the proof should be obvious).
A: If $P = T, Q = T$, then $Q \to (P \to Q)=T$. If $P = T, Q = F$, then $Q\to (P\to Q)= F \to F = T$. If $P = F, Q = T$, then $Q\to (P\to Q)=T\to T = T$. Finally, if $P = F, Q = F$, then $Q\to (P\to Q)= F\to T = T$. Thus $Q\to (P\to Q) = T$ for any values of $P, Q$. Hence it is a tautology, proving the claim.
