$\vdash\forall x(\alpha\rightarrow\beta)\rightarrow(\alpha\rightarrow\forall x\beta)$
According to Enderton p.121, it suffices to show that:
$\{\forall x(\alpha\rightarrow\beta),\alpha\}\vdash\beta$
For then, Enderton suggests, we can derive the former via generalization and deduction theorems.
But I don't understand this. For one the one hand, from the deduction theorem we can derive:
$\{\forall x(\alpha\rightarrow\beta)\}\vdash\alpha\rightarrow\beta$
But an application of the generalization theorem to the RHS of this won't yield our target theorem.
On the other hand, we cannot apply the generalization theorem to $\{\forall x(\alpha\rightarrow\beta),\alpha\}\vdash\beta$ to get:
$\{\forall x(\alpha\rightarrow\beta),\alpha\}\vdash\forall x\beta$
Because we don't know if $x$ occurs free in $\alpha$.
Any and all help is much appreciated!