I am reading "Mathematical logic" by Ian chriswell and Hodges and at one point in the text they mention the deductive theorem (page 17) which states;
If $\Gamma \cup \left \{ \phi \right \} \vdash \psi $ then $\Gamma \vdash (\phi \rightarrow \psi) \quad$ where $\Gamma$ is the set containing the undischarged assumptions of the argument. Now my confusion starts at the point where they mention that its possible that $\phi \in \Gamma$ in which case it will still be an assumption in $\Gamma \vdash (\phi \rightarrow \psi) \quad$ however I was under the impression that the whole point of the deduction theorem was to enable us to discharge assumptions so that they no longer are apart of $\Gamma$, so what exactly is going on in this particular case? Is $\phi$ discharged or not?
The author also mentions that the rule is still correctly applied if we do not discharge all occurrences of $\phi$ which does not seem like a correct statement for a rule whose purpose is to discharge assumptions.