Logic and Proofs
A short introduction to proofs and mathematical logic. Written as notes for the course CS 70.
Last updated
A short introduction to proofs and mathematical logic. Written as notes for the course CS 70.
Last updated
Propositions are statements that are either true or false. In examples, they are usually represented by the letters and Here are some propositions.
Steven is bald.
4 + 1 = 1000
Truth tables are a way of visualizing the possible outcomes of a statement. Here is an example of a truth table that shows the possible outcomes of
T
T
T
T
F
F
F
T
F
F
F
F
If you don't know what means, see this page.
If you've seen anything written by a mathematician, you've probably read the words "there exists" or "for all." There are two symbols for these, and and they are called quantifiers. They are used to write most propositions. For example, here is a proposition that uses a quantifier.
De Morgan's laws are used to negate propositions. To negate a statement, walk the negation through the statement, switching symbols as you go.
Applying De Morgan's laws to quantifiers is just as simple.
Thing
Tool
If you can't read that right column, see this page.
TODO: Proof by contradiction, proof by cases, add more tools to useful tools section
This roughly translates to "there exists a natural number such that " Of course, using basic algebra, we know what that number is.
This follows pretty well logically. In the first example, if we know that in order for then either or must be false, which is exactly what is written on the LHS of the equation.
This makes sense. Assuming that we are using both sides being true as our basis, if "for all , is true" is false, then the LHS is true. In order for the statement to be false, there needs to be some at least one, that makes false. This is exactly what the RHS is saying.
The negation of an implication is a conjunction, In order for the implication to be false, it must be the case that when is true, is false.
The contrapositive of an implication is If one is true, the other is also true.
The converse of an implication is If one is true the other is not necessarily true. If both are true, they have a iff (if and only if) relationship.
A tautology is a propositional statement/formula that is always true no matter what the result of the propositional variables is. For example, an obvious one would be Whether is true or false, the statement is always true. It's like saying "Steven is bald or he has hair."
The direct proof is probably the most common type of proof. The goal is to prove a statement, The steps are as follows.
Assume that is true.
Show that under the above condition, is also true.
In some cases, proving a statement might become overly complicated and annoying to think about. However, since the contrapositive is true if the original statement is true, we can just do a direct proof of the contrapositive instead.
is even
is odd
is rational