I've been studying logic as part of my Discrete Mathematics course and I understood most of the material so far: statements, predicates, connectives, arguments, etc. The book was very thorough and the material clear, however, now that it is moving to proofs of actual mathematical theorems, I feel it became much sloppier in explaining what's going on. In particular, when proving a mathematical proposition q from a premise p, the book does so by completely moving from the realm of logic to the realm of algebra, and it does not explain the connection between the algebraic manipulations we perform and their meaning (and validity) in logic.
For example, if we want to prove by contradiction that
for all integers n: it is not the case that ((n is even) and (n is odd))
logic teaches us to start with the negated premise
there exists an integer n: (n is even) and (n is odd) and reach a contradiction.
This is when the book completely leaves the realm of logic and enters that of algebra. The following is my attempt at reconciling what is done algebraically to its meaning in logic.
The book first goes to the definitions of even and odd, which state:
An integer n is even <-> (there exists an integer j such that n=2j)
An integer n is odd <-> (there exists an integer k such that n=2k+1)
What is the corresponding operation in the realm of logic of this step, are we replacing the (sub)propositions in our premise with their definitions? Why are we allowed to do that? The book does not explain this, but I guess it makes sense that we are always allowed to substitute a proposition s for a proposition t inside a compound proposition, if the biconditional between s<->t holds.
So now we have
there exists an integer n: (there exists an integer j: n=2j) and (there exists an integer k: n=2k+1)
The next step in the book is to bring the two equations together, that is, informally:
Since (n=2j) and (n=2k+1), then 2j=2k+1
Why are we allowed to do this? In basic algebra, you can do this because the two equations have a common variable, but what about logic? Also, I feel this is only correct because the two propositions have the AND connective. Could we do the same if we had an OR? If we had a XOR, we surely couldn't, because while our original premise will lead to a contradiction, the version with XOR holds:
there exists an integer n: (there exists an integer j: n=2j) xor (there exists an integer k: n=2k+1)
i.e. an integer is either odd or even.
The next step in the book is to manipulate 2j=2k+1 so as to reach (j-k) = 1/2.
This is declared to be a contradiction because j,k were integers thus their difference cannot be 1/2.
Again, two doubts: Why are we allowed to manipulate equations as we usually do in algebra when doing proofs? My intuitive explanation is that, again, a biconditional holds between any of the original equation and its manipulated version (for example, if we add 1 on both sides of an equation: x=2a <-> x+1=2a+1) and thus any manipulated version can substitute its corresponding proposition in the premise.
When exactly is a "non-sensical mathematical situation" a contradiction?
My explanation is that, after applying all substitutions, we are left with
there exists an integer n: (there exists integers j, k: j-k=1/2)
Which is a false statement. Is this why we declare it to be a contradiction?
Where can I find a more rigorous explanation of what's going on in the realm of logic when we perform algebraic manipulations and do mathematical proofs in general?