I am very new to proofs, and I learned that for $2^c-1=n$, if $c$ is composite, then $n$ is composite. I recently learned about proofs by contradiction, so here is my attempt at proving this statement. Please let me know if it is valid/invalid and how it can be improved.
Proof by contradiction
Let $a,b \in \mathbb{N}$ where $a,b>1$, and $p$ be a prime number.
Assume that $2^{ab}-1=p$ is possible. There are two possibilities: $ab$ is even or odd.
If $ab$ is even:
Then $2^{ab}-1$ can be factored as a difference of squares: $(2^{\frac{ab}{2}}+1)(2^{\frac{ab}{2}}-1)=p$
Since $\frac{ab}{2}$ is always an integer, then both factors of $p$ are integers that are not $1$, so $p$ cannot be prime.
If $ab$ is odd:
Then $2^{ab}-1=p \Rightarrow 2^{ab+1}-2=2p \Rightarrow 2^{ab+1}-1=2p+1$
Now, since $ab+1$is even, $2^{ab+1}-1$ can be factored as a difference of squares.
$(2^{\frac{ab+1}{2}}+1)(2^{\frac{ab+1}{2}}-1)=2p+1$
Isolate $p$, and we get:
$\frac{(2^{\frac{ab+1}{2}}+1)(2^{\frac{ab+1}{2}}-1)-1}{2}=p$
Both the numerator and denominator are clearly integers, so $p$ cannot be prime.
$Q.E.D$
Again, please let me know if this is a valid proof. Thank you.