Discrete Mathematics: Logic and Proofs


Discrete Mathematics: Logic and Proofs

Anna
Welcome to our review of discrete mathematics logic. We’ll build from propositional logic to predicate logic, then finish with rules of inference—the tools for drawing conclusions from statements. The big idea is to represent everyday claims precisely so we can reason about circuits, programs, algorithms, and mathematical proofs.

Hope
So logic is useful not just for symbolic exercises. A precise representation helps us ask whether a statement is true, how statements connect, and whether a conclusion really follows from what we know.

Anna
Let’s begin with propositional logic. A proposition is a declarative statement that can be true or false. We can assign a letter such as P to “Delhi is the capital of India,” and Q to another statement, such as “Delhi is in the north.” The letters stand for whole propositions.

Hope
Then we can connect propositions with logical operators. The main ones in this review are AND, OR, NOT, implication, and equivalence—often read as “if and only if.” These let us represent more complicated claims without writing every sentence out in ordinary English.

Anna
For P AND Q, the combined statement is true only when both P and Q are true. For P OR Q, we use the inclusive meaning of OR: it is true if P is true, if Q is true, or if both are true. It is false only when both propositions are false.

Hope
And NOT P simply reverses P’s truth value. If P is true, NOT P is false; if P is false, NOT P is true. That makes NOT a unary operator—it acts on one proposition—while AND and OR combine two.

Anna
Implication, written P implies Q, means “if P, then Q.” It is false in exactly one case: P is true and Q is false. If P is false, the implication is counted as true whether Q is true or false. That can feel surprising at first, but it is the truth-table definition of implication.

Hope
A useful way to remember the false case is to treat P as the condition and Q as the promised result. The implication fails only when the condition happens but the promised result does not. If the condition never happens, the statement hasn’t been broken.

Anna
Equivalence, written P if and only if Q, says that P and Q have the same truth value. It is true when both are true or both are false, and false when their truth values differ. Equivalently, P if and only if Q can be expressed as both P implies Q and Q implies P.

Hope
Truth tables make all of these definitions systematic. With two propositions, P and Q, there are four possible combinations: true–true, true–false, false–true, and false–false. We evaluate the operator for each row. With one proposition, there are two rows; with three propositions, there are eight, because each proposition can independently be true or false.

Anna
For example, the AND column is true only in the true–true row. The OR column is false only in the false–false row. For NOT P, just reverse the two values in P’s column. For a compound expression, build intermediate columns first, then use those columns to evaluate the larger expression.

Hope
That last point matters when an expression is nested. If we’re evaluating something like P implies Q AND Q implies P, first work out the two implications, then combine their truth values with AND. The order of operations tells us how to group the expression, so parentheses and the course’s operator precedence rules are important.

Anna
Once a full truth table is complete, its final column can tell us what kind of statement we have. If every row is true, the statement is a tautology: it is true for every possible truth-value assignment. If every row is false, it is a contradiction. Otherwise, it is true for some assignments and false for others.

Hope
Truth tables also help us check logical properties. For instance, P OR Q and Q OR P have identical truth values in every row, so they are logically equivalent; this is the commutative property of OR. The course notes list other properties too, and constructing tables is a way to verify them rather than simply memorizing their names.

Anna
It’s helpful to distinguish equivalence from implication here. Saying two expressions are equivalent means they match on every row of their truth tables. In symbolic work, we can show that by comparing their columns, or by showing that the biconditional between them is a tautology.

Hope
Now we can move from propositions to predicate logic. A predicate is a statement pattern containing one or more variables. For example, P of x could mean “x is a student.” By itself, that pattern does not say whether a particular claim is true; we need to specify a value for x.

Anna
When we substitute a particular object, the predicate becomes a proposition. If P of x means “x is a student,” then P of a particular person says that person is a student, and the resulting claim can be true or false. Predicates can also have more than one variable—for example, a predicate involving x and y can describe a relation between them.

Hope
The set of possible values for a variable is called its universe, or domain of discourse. Choosing the domain matters: “x is a student” makes sense when x ranges over people, while a domain of integers would not fit that intended meaning. Sometimes the domain is stated; sometimes context is expected to make it clear.

Anna
Quantifiers let us make claims about a domain. The universal quantifier, read “for all,” says that the predicate holds for every value in the domain. The existential quantifier, read “there exists,” says that it holds for at least one value. So “for every integer x, x is even” is a universal claim, while “there is an integer x that is even” is an existential one.

Hope
The programming analogy can help: a universal claim resembles checking every item, while an existential claim resembles finding at least one item that meets a condition. But the mathematical meaning is the key: universal means every domain element, and existential means at least one.

Anna
When quantifiers are nested, pay attention to their order and to which variables they bind. In a statement like “for every x, there exists a y such that a relation holds between x and y,” the y may depend on the chosen x. The scope of a quantifier is the part of the expression it governs; a variable occurrence is bound only within that scope.

Hope
And logical operators can connect predicates just as they connect propositions. Once values are assigned to the variables, the predicates have truth values, and AND or OR combines those values. With several variables or quantifiers, it helps to mark the scope clearly so you know which parts belong together.

Anna
Negation interacts with quantifiers in a useful way. “It is not true that every x has property P” means there is at least one x for which P is false. Symbolically, NOT of “for all x, P of x” is equivalent to “there exists an x such that NOT P of x.”

Hope
Likewise, “it is not true that there exists an x with property P” means no value has that property. We can rewrite it as “for all x, NOT P of x.” These patterns are often called quantifier-negation laws: negating “for all” changes it to “there exists,” and negating “there exists” changes it to “for all,” while the predicate itself is negated.

Anna
For example, let the domain be the integers and let Q of x mean “x is even.” The statement that every integer is even is false because some integers are not even. Its negation says that there exists an integer that is not even. The example also shows why specifying the domain is essential.

Hope
Negation can also move through AND and OR using De Morgan’s laws. NOT of P AND Q is equivalent to NOT P OR NOT Q. NOT of P OR Q is equivalent to NOT P AND NOT Q. So when a NOT is pushed inside parentheses, the connective switches, and each component is negated.

Anna
That gives us a reliable method for a long quantified expression: work outward from the main negation, applying the relevant rule at each step. Switch AND with OR when negating a compound, switch universal with existential when negating a quantifier, and negate the predicate at the end.

Hope
Next are rules of inference. These are patterns for proving that a conclusion follows from given premises. The horizontal-line notation means: statements above the line are premises, and the statement below is the conclusion. A valid rule guarantees that if the premises are true, the conclusion is true.

Anna
A simple example is AND introduction: from P and Q, we may conclude P AND Q. We can also simplify an AND statement: from P AND Q, we may conclude P, and we may conclude Q. But from P OR Q alone, we cannot conclude P, because Q could be true while P is false.

Hope
Another basic pattern is OR introduction. From P, we may conclude P OR Q, because an OR statement is true when at least one side is true. We do not need to know whether Q is true.

Anna
The best-known rule is modus ponens. From P implies Q, and P, we conclude Q. For example, if we know “if x is even, then x is divisible by 2,” and we know x is even, then we may conclude that x is divisible by 2.

Hope
Modus tollens works backward from a negative result. From P implies Q, and NOT Q, we conclude NOT P. Using the same example, if being even implies divisibility by 2, and x is not divisible by 2, then x cannot be even.

Anna
The difference between those two rules is worth remembering. Modus ponens uses P as its second premise and concludes Q. Modus tollens uses NOT Q as its second premise and concludes NOT P. Both are valid because they match the truth conditions of implication.

Hope
A proof can apply these patterns one step at a time. We list what is given, identify a rule whose premises match what we have, and derive a new statement. The new statement can then serve as a premise for a later step. That is how several simple inferences can establish a larger conclusion.

Anna
Rules of inference also work with quantified statements. Universal instantiation says that if a property holds for every object in the domain, it holds for any particular object in that domain. If every integer satisfies a predicate, for example, then the predicate holds for the integer 23.

Hope
Existential generalization goes in the other direction: if a predicate is true for a particular object in the domain, we can conclude that there exists an object for which it is true. If the predicate holds for 23, then there exists an integer satisfying it.

Anna
The lecture also mentions other inference rules and additional forms of derivation notation, but the key approach is not to memorize symbols blindly. Focus on what the premises say, whether the conclusion really follows, and which rule justifies the step. The vertical and horizontal marks in a derivation display premises and conclusions; for this review, the central focus is the logical reasoning they represent.

Hope
So the whole picture fits together: propositional logic combines true-or-false statements; truth tables define and test those combinations; predicate logic adds variables, domains, and quantifiers; and inference rules turn premises into justified conclusions. Those tools give us a precise foundation for reasoning about mathematical claims, programs, algorithms, and proofs.

Ask anything
We've read this whole study set, so questions about it get the best answers.