TITLE: Why is the principle of explosion accepted in constructive mathematics?
QUESTION [9 upvotes]: I think something is wrong with the principle of explosion, because according to it, if I know $P\wedge \lnot P$, I can deduce $Q$ though I don't know anything about $Q$.
Is it really constructive to decide whether $Q$ is true by only seeing $P$ unrelated to $Q$? If $P\wedge \lnot P$ holds, how do I construct a reason for $Q$ ?

REPLY [7 votes]: Here's one way to look at it. Suppose we're working in a natural deduction system with a $\lor$-elimination rule that goes
$$ \frac{\Gamma\vdash P\lor Q \qquad \Gamma, P\vdash R \qquad \Gamma, Q\vdash R}{\Gamma\vdash R} $$
This allows us to prove things by case analysis once we have proved a $\lor$ that tells us we have to be in one of the cases.
Now, what is the fundamental thing knowing $\neg P$ tells us? Arguably it is that in the above rule we won't need to carry out the $\Gamma, P\vdash R$ part of the proof because $P$ cannot actually happen.
We could achieve that by having a bunch of specialized $\lor$-elimination rules such as
$$ \frac{\Gamma\vdash P\lor Q \qquad \Gamma, P\vdash A \qquad \Gamma\vdash\neg A \qquad \Gamma, Q\vdash R}{\Gamma\vdash R} $$
but it is simpler to wrap all the variants up in a single rule that says:

If you find yourself in a branch of a proof where two contradictory things appear to hold, it means that proof branch was not actually necessary, and you're allowed to cancel it completely by pretending you've already proved whatever you were aiming for in that branch.

That's basically what the principle of explosion does.
It is constructively acceptable because intuitively there are only two ways it's ever possible to use it:

Either your initial assumptions in the proof are impossible to satisfy. Then we don't really care if we conclude nonsense. What we do care is that if our assumptions hold then the conclusion will also hold. Otherwise we're happy with garbage-in, garbage-out.
Or you have introduced an additional temporary assumption somewhere in the proof tree which creates the contradiction. For example, the $\Gamma,P\vdash R$ premise in our $\lor$-elimination rule does that. Then we can justify the use of explosion by arguing that the branch that the explosion happened in was not actually necessary because the conditions it would be relevant in cannot happen.
If the additional assumption came from an introduction rule such as $\to$-introduction, the argument that "this branch is not needed" is not as immediately convincing. However, in that case we can argue that we're still "constructively safe", because then our conclusion of that introduction rule is something that involves $\to$. And the only way we can use that result is by using it in modus ponens (aka $\to$-elimination). At that time someone will be claiming they can prove the antecedent of the $\to$, but we know that is not actually realistic because the assumption leads to a contradiction! So this tells us that the proof branch where the modus ponens is found will itself be an unneeded branch, so constructively we don't need to worry about shenanigans there. It will never be executed.
The story for $\neg$-introduction is similar to that for $\to$-introduction; then the principle of explosion itself is the relevant elimination rule.