Prove: if n is an odd integer, then n^2 is also odd.
The first step is to translate this statement into propositional logic! Notice that it’s talking about a variable n. It is really making a statement about all possible values of n. This is common in mathematics, to make a “for all” statement just by mentioning some variables without explicitly saying a word like “all” or “every”. So the correct translation is \forall {n}: {\Z }.\; \mathrm {Odd}(n) \rightarrow \mathrm {Odd}(n^2).
Now, what does \mathrm {Odd}(n) mean?
So let’s prove \forall {n}: {\Z }.\; \mathrm {Odd}(n) \rightarrow \mathrm {Odd}(n^2). We start by introducing an arbitrary integer n; then we have to prove \mathrm {Odd}(n)
\rightarrow \mathrm {Odd}(n^2). This is an implication, so we prove it by supposing that \mathrm {Odd}(n) is true, and then proving in that case \mathrm {Odd}(n^2) is true as well. We can expand the definition of \mathrm {Odd} to figure out what our assumption \mathrm {Odd}(n) means and what we have to show for \mathrm {Odd}(n^2). The whole thing goes like this:
The above proof has a lot of detail to help us keep track of what is going on. A more experienced mathematician or computer scientist might write something more like this:
But you are welcome and encouraged to include a lot of detail about what you are doing especially as you are starting out.