Logic puzzle

If you want to test your propositional logic skills, try this puzzle that arose from a conversation at my office hours:

Suppose we are given the premises (1) $p\to q$ and (2) $\neg p\to q$.

a) What can we infer from (1) and (2)?

b) The contrapositive of (1) is $\neg q\to\neg p$. Putting that together with (2), we can infer $\neg q\to q$. Is that a contradiction? Why or why not?

Answers below…

a) We can infer $q$. That’s how proof by cases works!

b) No, $\neg q\to q$ is not a contradiction, because it is satisfied (vacuously) as long as $q$ is true.

In fact, $\neg q\to q$ is logically equivalent to $q$. Do you see why?