Give the contrapositive of the following proposition concerning an integer $p$:
["]If $p$ is odd and $p>3$ then $p+1$ and $p-1$ are not primes[."]
The answer is:
["]if $p+1$ or $p-1$ is a prime then $p$ is even or $p\le3$[."]
I'm talking about the switch between "and" to "or" in the sentences. The switch between "and" and "or" technically makes sense, but the negation in symbols of the second part of the original, (i.e. $p+1$ and $p-1$ are not primes) is:
["]if $\ \underbrace{p+1\textrm{ is a prime}}_{r}\ $ and $\ \underbrace{p-1\textrm{ is not a prime}}_{s}$[",]
then $\lnot\lnot r\land\lnot\lnot s$ which is the same as $r\land s$. I don't understand how that got to "p or r" when it is "p and r" in symbols, so why wouldn't it be ["]$p+1$ and $p-1$ is a prime[".]? They also said they were using De Morgan's law so I guess it might be that, but I don't know in what way they used it.
Symbolically, the original proposition was $$ (\mathit{odd}(p) \land p>3) \to (p+1\notin\mathbb P \land p-1\notin\mathbb P)$$ The contrapositive of this is $$ \neg(p+1\notin\mathbb P \land p-1\notin\mathbb P) \to \neg(\mathit{odd}(p) \land p>3)$$ Now we can use De Morgan's law to simplify each of the sides of the $\to$ separately. First on the left: $$ (\neg(p+1\notin\mathbb P) \lor \neg(p-1\notin\mathbb P)) \to \neg(\mathit{odd}(p) \land p>3)$$ and then on the right: $$ (\neg(p+1\notin\mathbb P) \lor \neg(p-1\notin\mathbb P)) \to (\neg\mathit{odd}(p) \lor \neg(p>3))$$ Finally apply the negations to the atomic propositions one by one: $$ (p+1\in\mathbb P \lor p-1\in\mathbb P) \to (\mathit{even}(p) \lor p\le 3)$$