TITLE: Does double negation distribute over implication intuitionistically?
QUESTION [7 upvotes]: Does the equivalence $$\neg\neg (P \rightarrow Q) \leftrightarrow (\neg\neg P \rightarrow \neg\neg Q)$$ hold in propositional intuitionistic logic? In propositional classical logic the equivalence holds obviously since $P \leftrightarrow \neg\neg P$. However, the similar-looking implication $\neg\neg (P \vee Q) \rightarrow (\neg\neg P \vee \neg\neg Q)$ is not intuitionistically acceptable. The validity of the backward implication comes up in some questions about type theory as well.

REPLY [5 votes]: At a higher level, this equivalence is easy to prove using the monadicity of double negation: this is the tautology $$\lnot\lnot P \rightarrow [(P \rightarrow \lnot\lnot Q) \rightarrow \lnot\lnot Q].$$
As a consequence of this, as a derived inference rule, we can conclude that if $\Gamma, P \vdash \lnot\lnot Q$, then $\Gamma, \lnot\lnot P \vdash \lnot\lnot Q$.  Intuitively, what this means is: if the desired conclusion is a double negation, then we can freely eliminate double negations in hypotheses, add instances of LEM $\phi \vee \lnot\phi$ to the assumptions, etc.
So, for the forward direction, we easily reduce to showing that $\lnot\lnot(P\rightarrow Q), \lnot\lnot P \vdash \lnot\lnot Q$.  By the principle above, then it suffices to show $P \rightarrow Q, P \vdash \lnot\lnot Q$.  But since $Q \rightarrow \lnot\lnot Q$, and $P\rightarrow Q, P \vdash Q$ is trivial, we are now done.
Similarly, for the reverse direction, we easily reduce to showing $\lnot\lnot P \rightarrow \lnot\lnot Q \vdash \lnot\lnot(P \rightarrow Q)$.  We can now introduce $P\vee \lnot P$ and $Q\vee \lnot Q$ into the context; then, using that $P\vee \lnot P$ implies $\lnot\lnot P \leftrightarrow P$, we can reduce $\lnot\lnot P \rightarrow \lnot\lnot Q$ to $P \rightarrow Q$.  Then trivially, $P\rightarrow Q, P \vee \lnot P, Q \vee \lnot Q \vdash \lnot\lnot(P \rightarrow Q)$.

Under the Curry-Howard correspondence, a typical proof of the tautologies $P \rightarrow \lnot\lnot P$ and $\lnot\lnot P \rightarrow [(P \rightarrow \lnot\lnot Q) \rightarrow \lnot\lnot Q]$ corresponds closely to the continuation monad $\operatorname{Cont}(\bot)$.  Then for example, the forward direction of the proof in Haskell-like notation might look like:
\(nnpq : ~~(P -> Q)) (nnp : ~~P) .
    do {
        pq <- nnpq;     -- pq : P -> Q
        p <- nnp;       -- p : P
        return (pq p)   -- (pq p) : Q  so  return (pq p) : ~~Q
    }


On a related note, the above proofs could be considered an elaboration of an application of Glivenko's theorem that in propositional logic, $\Gamma \vdash P$ classically if and only if $\Gamma \vdash \lnot\lnot P$ intuitionistically.  Glivenko's theorem then makes for trivial proofs that $\lnot\lnot(P\rightarrow Q), \lnot\lnot P \vdash \lnot\lnot Q$ and $\lnot\lnot P \rightarrow \lnot\lnot Q \vdash \lnot\lnot(P \rightarrow Q)$ intuitionistically.