The deduction theorem says if {$\gamma$, $\alpha$} $\vdash$ $\beta$, then $\gamma$ $\vdash$ ($\alpha$$\rightarrow$$\beta$). Now you can represent a proof of $\gamma$ from $\alpha$ by a sequence
$\alpha$
$\vdash$ $\beta$1
$\vdash$ $\beta$2
.
.
.
$\vdash$ $\gamma$.
Consequently by the deduction theorem we can obtain ($\alpha$$\rightarrow$$\alpha$), ($\alpha$$\rightarrow$$\beta1$), ..., ($\alpha$$\rightarrow$$\gamma$). I repeat for emphasis that we have ($\alpha$$\rightarrow$$\gamma$) by having the deduction theorem. Now there exists a theorem which says:
((p$\rightarrow$q)$\rightarrow$(p$\rightarrow$(r$\rightarrow$q))).
Thus to obtain ($\alpha$$\rightarrow$($\beta$$\rightarrow$$\gamma$)) we substitute p with $\alpha$, q with $\gamma$, and r with $\beta$ in ((p$\rightarrow$q)$\rightarrow$(p$\rightarrow$(r$\rightarrow$q))), and from ($\alpha$$\rightarrow$$\gamma$) we detach ($\alpha$$\rightarrow$($\beta$$\rightarrow$$\gamma$)).
We iterate this process, substituting p with $\alpha$, q with ($\beta$$\rightarrow$$\gamma$), and r with $\delta$, and then we can detach
($\alpha$$\rightarrow$($\delta$$\rightarrow$($\beta$$\rightarrow$$\gamma$))).
The catch here comes as that we should obtain ($\alpha$$\rightarrow$($\beta$$_n$$\rightarrow$$\gamma$)) first, then ($\alpha$$\rightarrow$($\beta$$_m$$\rightarrow$($\beta$$_n$$\rightarrow$$\gamma$)) next [where "m"=(n-1)], until we finally obtain ($\alpha$→(β1→(β2→(....→γ)))).
Now let's suppose that we have ($\alpha$→(β1→(β2→(....→γ)))), and $\alpha$. By detachment we can obtain (β1→(β2→(....→γ))). Thus, if we have ($\alpha$$\rightarrow$$\beta$1) also, we can obtain $\beta$1 and thus (β2→(....→γ)). Eventually we can obtain ($\alpha$$\rightarrow$$\gamma$).
So, the answer to your question, I think, is "yes".
But, notice that the deduction theorem itself doesn't directly give us such a transformation as your original post suggests. We used
((p$\rightarrow$q)$\rightarrow$(p$\rightarrow$(r$\rightarrow$q))) for this to work.
That said, if we have the deduction theorem, then ((p$\rightarrow$q)$\rightarrow$(p$\rightarrow$(r$\rightarrow$q))) will follow, as we can see from the following:
hypothesis 1 | (p→q)
hypothesis 2 || p
hypothesis 3 ||| r
detachment 1, 2 4 ||| q
conditional-in 3-4 5 || (r→q)
conditional-in 2-5 6 | (p→(r→q))
conditional-in 1-6 7 ((p→q)→(p→(r→q)))
If we have {(p→(q→p)), ((p→(q→r))→((p→q)→(p→r)))} as the basis used for proving the deduction theorem (other bases exist) we could also prove ((p→q)→(p→(r→q))) as follows:
axiom 1 (p→(q→p))
axiom 2 ((p→(q→r))→((p→q)→(p→r)))
1 p/q, q/r 3 (q→(r→q))
1 p/(q→(r→q)), q/p 4 ((q→(r→q))→(p→(q→(r→q))))
detachment 4, 3 5 (p→(q→(r→q)))
2 r/(r→q) 6 ((p→(q→(r→q)))→((p→q)→(p→(r→q))))
detachment 6, 5 7 ((p→q)→(p→(r→q))))
If we ignore the substitutions here, it looks like in this case that an axiomatic proof can work out as shorter than a natural deduction derivation.
Best Answer
What you defined could be called a valid formal proof.
A valid mathematical proof (or a proof accepted by the mathematical community) on the other hand might be described as an informal(!) arrangement of arguments that the reader finds convincing in the sense that he/she strongly believes that it is possible to write down a valid formal proof reflecting the given arguments.
Some clarifying remarks:
"A computer program tested all even integers from $4$ up to $10^{100}$ and verified that each of them can be written as sum of two primes" - This is not convincing enough to be a mathematical proof. It may be convincing enough to accept that the claim is correct for evens up to $10^{100}$ insofar as the computational steps of the program (once verified to be algorithmically correct) could be translated into a formal proof. But there is no hitn as to how the argument might be converted to a general formal proof (by induction, say)
A lengthy sequence of statements without explanation or comment and the mere claim that each line somehow follows from some of the preceeding lines (i.e., a formal proof) may not be lightheartedly accepted as mathematical proof. Indeed, the very lack of motivation and comment and helpful hints makes such a beast suspicious: One would really have to verify every single line and check that there are some preceeding lines leading to it; there is no such thing as diagonal reading. In fact, you may find a number of questions on this site where someone presents a proof of $1=0$ or the like consisting completely of commentless equations - and one has to really check that there is a step somewhere where the apparent transformation is a division by an expression that cannot be assumed to be non-zero. (Such a mistake is probably much easier to spot if at least some comments a la "Now I divide both sides by ..." are added)