Chapter 14: Mathematical Logic
This chapter introduces the basic concepts of mathematical logic. These principles form part of the foundation for digital circuits, formal mathematical reasoning, and conditional logic in programming. The focus is the mathematical language of propositions, predicates, connectives, and truth tables.
Propositions and Predicates
Propositions and predicates both express mathematical claims, but they differ in whether a truth value has already been determined. A proposition is a complete statement that is true or false. A predicate contains one or more variables and becomes a proposition after values are assigned to the variables or after a claim is made about the allowed values.
A proposition is a declarative statement that can be assigned a definite truth value: true or false, but never both.
The following are examples of propositions:
- "Four is even." (True)
- "1 + 1 is 3." (False)
- "." (True)
- "." (False)
A statement involving an unspecified variable, such as "" or " is even," is called a predicate or open statement. It does not yet have one fixed truth value. The domain is the set of allowed values for the variable, and the truth of the predicate depends on which value is chosen from this set.
Let be the predicate " is even" with domain . Substituting a value for produces a proposition: is true, while is false.
Stating that holds for every integer, or that it holds for at least one integer, also produces a proposition. The symbols for these statements are introduced near the end of the chapter.
The distinction provides the link to logical operations: predicates describe conditions, substituted values turn those conditions into propositions, and logical connectives combine propositions into more complex statements. This framework supports mathematical proofs and conditional statements in programs.
Logical Operations
Logical operations extend the connection between predicates and propositions. If and are predicates with the same domain, then the combined condition " and " is a new predicate. After a value is selected, and are propositions, and their combined statement has a definite truth value.
More generally, propositions can be combined using logical connectives such as and, or, not, if...then..., and if and only if. Each connective has a precise meaning and a standard symbolic representation.
Except for negation (not), which acts on a single proposition, all logical operations act on pairs of propositions. Since each proposition can be either true () or false (), there are four possible combinations of truth values for two propositions. The effect of a logical operation on these combinations is most clearly shown using a truth table.
Logical connectives are symbols or words used to build compound propositions from simpler propositions.
Conjunction. The connective means " and " and is true only when both propositions are true.
Disjunction. The connective means " or " and is true when at least one proposition is true.
Negation. The connective means "not " and reverses the truth value of .
Conditional. The connective means "if , then " and is false only when is true and is false.
Biconditional. The connective means " if and only if " and is true when and have the same truth value.
Conjunction (AND)
If and are propositions, their conjunction, " and ," denoted by , is defined by the truth table:
Each row in the table represents one possible case. The conjunction is true only when both and are true, just as in ordinary language.
The symbols , , and are commonly used as placeholders for propositions, similar to how , , and are used for numeric variables.
For , the conditions and require to satisfy both inequalities simultaneously:
The following values illustrate that the conjunction is true only when both inequalities are true:
Table 14.1. Truth values for a conjunction of two inequalities.
| 0 | 1 | 0 | |
| 1 | 1 | 1 | |
| 1 | 0 | 0 |
Thus, the conjunction is true exactly for .
Disjunction (OR)
If and are propositions, their disjunction, " or ," denoted by , is defined by:
This operation reflects the inclusive or, meaning the result is true if either or both propositions are true.
A quadratic equation has two possible solutions:
For , the following values illustrate that the disjunction is true when at least one of the equations is true:
Table 14.2. Truth values for a disjunction of two equations.
| 0 | 1 | 1 | |
| 0 | 0 | 0 | |
| 1 | 0 | 1 |
Thus, the disjunction is true exactly for or .
Negation (NOT)
Negation, denoted by , is the only standard operation that applies to a single proposition.
The statement that is not equal to is written
For , the following values illustrate that negation reverses the truth value of the original equation:
Table 14.3. Truth values for negating an equation.
| 1 | 0 | |
| 0 | 1 | |
| 0 | 1 |
Conditional
The conditional statement "If then ," denoted , is defined by:
The conditional is false only when is true and is false. The symbol is a logical connective: it combines and to form a new proposition whose truth value is given by the table. It does not by itself state that is true or that has been inferred.
Let and consider the conditional predicate "If is greater than , then is even." This is written
The selected values illustrate the four possible combinations and highlight the case where the conditional is false:
Table 14.4. Truth values for a conditional statement.
| is even | |||
|---|---|---|---|
| 1 | 1 | 1 | |
| 1 | 0 | 0 | |
| 0 | 1 | 1 | |
| 0 | 0 | 1 |
Converse and Contrapositive
The converse of is .
The contrapositive of is . The original conditional and its contrapositive always have the same truth value, while the converse need not have the same truth value.
Let the domain be the integers, and define the predicates
- : " is divisible by ," and
- : " is even."
The three associated conditional forms are:
- Original: .
- Converse: .
- Contrapositive: .
The relationship between these forms comes from the truth table:
Table 14.5. Truth values for a conditional, its converse, and its contrapositive.
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 |
The original and contrapositive columns agree in every row. For the integer predicates, the original conditional holds for every integer because a number divisible by can be written as for some and is therefore even. The converse is false: is even but is not divisible by . The contrapositive states that an integer that is not even cannot be divisible by , and its truth values match those of the original conditional.
Biconditional
If and are propositions, the biconditional, " if and only if ," denoted , is defined by:
The biconditional is true when and share the same truth value, i.e., both true or both false. Like the conditional, is a connective that forms a proposition. A particular biconditional may therefore be true or false. It expresses logical equivalence only when it is true in every possible case.
For a real number , the number is zero if and only if both and :
Both sides have the same truth value for every real number .
For a real number , compare the conditions " is not less than " and " is greater than or equal to ":
The table illustrates the agreement for three values. The two predicates agree for every real because any real number that is not less than must be greater than or equal to :
Table 14.6. Truth values for a biconditional involving inequalities.
| 1 | 0 | 0 | 1 | |
| 0 | 1 | 1 | 1 | |
| 0 | 1 | 1 | 1 |
Tautologies and Contradictions
Tautologies and contradictions describe expressions whose truth values do not vary from one possible case to another.
Tautology
A tautology is a logical expression that is true in every possible case. The symbol is often used to denote a tautology.
A tautology covers every possible truth case. Examples include:
- ("Either is true, or it is not.")
- ("If both and are true, then is true.")
Over the domain , consider the predicate
For each fixed value of , this predicate becomes a true proposition. It has the tautological form . Equivalently, the statement "for every real number , either or " is a true proposition.
The table illustrates the predicate for a few values. Its universal truth does not follow from testing these examples; it follows because every value of is either equal to or not equal to :
Table 14.7. Truth values showing a tautology.
| 1 | 0 | 1 | |
| 0 | 1 | 1 | |
| 0 | 1 | 1 |
Contradiction
A contradiction is a logical expression that is false in every possible case. The symbol is often used to denote a contradiction.
A contradiction combines conditions in a way that can never be satisfied. Examples include:
- (" and not ," which is impossible to be true simultaneously.)
- ("Either or is true, but neither nor is true.")
Over the domain , consider the predicate
For each fixed value of , this predicate becomes a false proposition. Equivalently, the statement "for every real number , it is not the case that both and " is a true proposition.
The table illustrates the predicate for a few values. The conclusion for every real follows because no number can be both greater than and less than :
Table 14.8. Truth values showing a contradiction.
| 0 | 1 | 0 | |
| 0 | 0 | 0 | |
| 1 | 0 | 0 |
Logical Equivalence
Two propositional expressions and are logically equivalent, written , if they have the same truth value under every assignment of truth values to their component propositions. The symbol states that this general relationship has been established; it is not another connective with a separate truth table. Equivalently, the biconditional
is a tautology.
The conditional and its contrapositive give one example:
Consider two propositions:
- : "I have been to Toronto."
- : "I have been to Chicago."
Now compare these two propositions:
- : "I have not been to both Toronto and Chicago."
- : "I have not been to Toronto or I have not been to Chicago."
The two expressions have the same truth value in every possible case. Thus:
Table 14.9. Truth values for De Morgan's law.
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
The final two columns agree in every row, which verifies the equivalence.
Over the domain , the predicate " is not less than " is logically equivalent to " is greater than or equal to ":
Implication and Bi-implication
The earlier sections distinguished propositions from predicates. If and are propositions, then and are compound propositions with truth values determined by their truth tables. If and are predicates with the same domain, then
are also predicates. Choosing a value from the domain turns them into the propositions and . These propositions may be true for some values and false for others.
Implication arises when the corresponding conditional is valid throughout the relevant domain. If is true for every allowed value of , then implies , written
Similarly, bi-implication arises when the corresponding biconditional is valid throughout the domain. If is true for every allowed value of , then and bi-imply one another, written
For propositional expressions, the same distinction is made across all relevant assignments of truth values. Thus,
and
Equivalently, a bi-implication consists of two implications, one in each direction:
The small arrows and therefore form propositions that can be evaluated in a particular case. The large arrows and state that the corresponding relationship is valid in every relevant case.
For propositional expressions, and both communicate logical equivalence. This book uses when comparing logical expressions and also uses for reversible reasoning or algebraic steps with the same solution set. This common convention is used throughout this book, although some texts use these symbols differently.
Let the domain be , and define
- : "," and
- : "."
For every real number , is true. Therefore,
The reverse conditional fails at , because is true while is false. Consequently, and do not bi-imply one another.
Now define
- : "," and
- : "."
For every real , both and are true. Hence,
or, written directly,
The two predicates have the same truth value throughout the domain, and the two equations have the same solution set.
Valid Inference
Implication describes a relationship that is valid across the relevant cases. An inference applies propositions in a particular argument: it starts from one or more assumed propositions, called premises, and draws a conclusion. The inference is valid if there is no possible case in which all the premises are true and the conclusion is false.
A predicate does not yet have a fixed truth value, so it must first be turned into a proposition by choosing a value or making a statement about its domain before it can serve as a premise. In this book, marks a valid conclusion or a one-way reasoning step; it is not a connective used to form a proposition.
Suppose and are both given as premises. Then follows:
This inference is valid because, when is true, the conditional can be true only when is also true. Thus, there is no case in which both premises are true and the conclusion is false.
Statements that a predicate holds for every value in a domain or for at least one value are propositions. The notation for expressing these domain-wide claims is introduced next.
Additional Notation
A few other foundational logical symbols are commonly used in mathematics. Predicate logic is not developed in detail in this course, but the table below provides a brief overview of notation used in definitions, proofs, and statements about sets or functions.
Quantifiers are especially important because they turn open statements involving variables into propositions by specifying whether a claim holds for every element of a domain or for at least one element. The two central quantifiers, together with closely related notation, are introduced below.
Table 14.10. Common logical notation and its meaning.
| Symbol | Operation | Description |
|---|---|---|
| Universal quantifier | Means "for all" or "for every"; the statement must hold for every object in the given domain. | |
| Existential quantifier | Means "there exists"; the statement must hold for at least one object in the given domain. | |
| Unique existence quantifier | Means "there exists exactly one"; the statement must hold for one and only one object in the given domain. |
Connection to Set Theory
Logic and set theory describe closely related ideas from different viewpoints. A predicate states a condition that elements of a domain may or may not satisfy, while a set can collect precisely the elements that satisfy that condition. In this way, a logical statement can be viewed as describing membership in a corresponding set.
Logical operations then parallel familiar set operations from Chapter 2: "and" resembles intersection, "or" resembles union, and "not" resembles complement. This connection is also why identities such as De Morgan's laws have the same general structure in logic and set theory.
More precisely, let mean "" and let mean "." Then
In each row, the logical condition and the corresponding set-membership statement are true for exactly the same values of .