Introductory Logic
The materials on this page provide an overview of basic logic. This is a largely informal discussion; more rigorous treatments are found in later notes.
- Propositions
- Propositional Formulas
- Logical Equivalence
- De Morgan's Laws
- Tautology
- Contradictions
- Conditional Propositions
- Implications as Logical Disjunctions
- Negative Implications
- The Contrapositive
- Idiom: Only If
- The Biconditional
- Common Equivalences
- Predicates
- Limitations to Predicates
- Universal Quantification
- Existential Quantification
This introductory chapter provides an overview of basic logic.
Propositions
Informally, a proposition is a sentence that can be meaningfully assigned a true or false value. For the sake of just getting started, that's all it is. Propositions can be connected with logical connectives to create compound propositions. For example, the propositions " is less than or equal to 4" and " is a member of but not a member of " are examples of compound propositions.
Propositional Formulas
Just as the proposition " plus equals one" can be translated to the proposition "If then " can be expressed symbolically as:
The expression above is called a propositional formula. It consists of the propositional variables and and the logical operator Let's see what logical operators we have available.
Negation
The operator is called logical negation. It takes a single proposition as an operand, and returns the opposite of the operand's truth value. Here's its truth table:
T | F |
F | T |
Computer science often refers to the logical negation as the not-expression. A helpful way to think about the negation (and all the other logical operators) is in terms of sets.
Double Negatives
The double negative property provides that, given a proposition , the negation of the negation of is simply . We can see this to be the case from the truth table for :
T | F | T |
F | T | F |
Conjunction
The logical connective is called the conjunction. If and are propositions, then the conjunction of and is " and ," denoted As a truth table:
T | T | T |
T | F | F |
F | T | F |
F | F | F |
In computer science, the conjunction is often referred to as the and-expression.
Expression: But
The word but is just another word for and in logic. For example, consider the proposition
From the perspective of propositional logic, this proposition is no different from saying
Encapsulating the component propositions to variables:
In propositional logic, we express this proposition as
Negated Conjunction
One of the most important propositional formulas in real-world logic applications is the negated conjunction. In natural language, the negated conjunction often takes the form:
This is a bit ambiguous in propositional logic — are we saying ((not ) and ()), or are we saying (not and not )? In most everyday usage, it's the latter:
Thus, as a propositional formula, we have:
In computer science, this is propositional formula is often called a nand-expression. As we'll see later, it turns out that if a system has the nand-expression as a primitive, the system can derive all of the other logical connectives.
Inclusive Disjunction
The logical connective OR is the logical disjunction. Let and be propositions. The disjunction of and is " OR ," denoted If, and only if, is true, is true, or both and are true, then is true. Otherwise, if both and are false, then is false.
As a truth table:
T | T | T |
T | F | T |
F | T | T |
F | F | F |
Note that this definition of OR differs from our more common usage of or, which generally denotes "one or the other, but not both." This common usage of or is called the exclusive or. In mathematics and computer science, we use the inclusive or by default — "one or the other, or both." When the exclusive or is used, mathematicians and computer scientists will make it explicit with sentence structures such as " or but not both," or, occassionally, "Either or ." The exclusive or (XOR) is covered in later sections.
Negated Inclusive Disjunction
The negation of a disjunction is called the negated disjunction. In everyday language, it often takes the form neither nor
negated disjunction. Let and be propositions. Then:
is the negated disjunction of and read "Neither nor " We may also express the negated disjunction as:
In computer science, the negated disjunction is often called a nor-expression.
Exclusive Disjunctions
The logical connective XOR, is the exclusive disjunction (the exlusive or). Given propositions and , the exlusive disjunction of and is "Either or ," or " or but not both." It is denoted .
The proposition is true if, and only if, is true or is true, but not both. If (a) both and are true, or (b) both and are false, then is false.
T | T | F |
T | F | T |
F | T | T |
F | F | F |
Note that is the same proposition as We can verify this with a truth table:
T | T | T | T | F | F | F |
T | F | T | F | T | T | T |
F | T | T | F | T | T | T |
F | F | F | F | T | F | F |
Evaluation Order
Compound propositions themselves can be connect to form more complicated expressions:
When evaluating these more complicated expressions, we follow a convention called the Boolean order of operations:
- Parenthesized expressions are evaluated first, following these rules.
- Negations are evaluated second.
- Conjunctions are performed third.
- Inclusive/exclusive disjunctions are performed last.
An interesting thing to note is that this is purely a convention. We could have used an entirely different order, but this is the order most people have agreed on.
Logical Equivalence
The propositions "2 is greater than 1" and "1 is less than 2" are two different ways of saying the same thing. This is because of the definitions of the words “greater than” and “less than.” Both propositions, together, can only be: (1) both true, or (2) both false. In other words, if the propositions were connected with a logical connective and evaluated in a truth table, their truth values would be identical.
For example, suppose and are propositions. The compound propositions and have the same truth values:
T | T | T | T |
T | F | F | F |
F | T | F | F |
F | F | F | F |
When two proposition forms have the same truth values, we say that they are logically equivalent. More formally, two proposition forms are logically equivalent if, and only if, they have identical truth values for each possible substitution of propositions for their proposition variables. The logical equivalence of proposition forms and is denoted by writing
Because of logical equivalence, there are logical properties we can use in all situations. We will explore some tactics for evaluating logical equivalences once we've covered conditonals.
De Morgan's Laws
Consider the following proposition:
Apples are red and sweet.
As we know, this is a compound proposition:
(1) Apples are red.
(2) Apples are sweet.
For the proposition to be false, one or both of (1) and (2) must be false. That is,
Apples are not red and sweet.
Apples are red and not sweet
Apples are not red and are not sweet.
These propositions can be reduced to a single proposition:
Apples are not red or are not sweet."
Similarly, consider the proposition:
Apples are red or green.
Like the previous proposition, this is a compound proposition consisting of two propositions:
(1) Apples are red
(2) Apples are green.
Thus, for the compound proposition to be false, both (1) and (2) must be false, since a disjunction is false if, and only if, both of its component propositions are false. The negation then is:
Apples are not red and are not green.
De Morgan's laws formalize this reduction. The negation of a conjunction is logically equivalent to a disjunction, where each component proposition is negated. The negation of a disjunction is logically equivalent to a conjunction where each component proposition is negated.
de morgan's laws. Let and be propositions. Then:
A truth table demonstrates the logical equivalences:
T | T | F | F | T | F | F |
T | F | F | T | F | T | T |
F | T | T | F | F | T | T |
F | F | T | T | F | T | T |
The negation of a disjunction is often written in the form of neither nor. Consider the proposition
Cats are sympathetic or lively.
The negated proposition is:
Cats are not sympathetic and are not lively.
Style, not logic, leads to the more common form:
Cats are neither sympathetic nor lively.
Tautology
A tautology is a propositional formula that always reduces to true, regardless of its component propositions's truth values. A proposition whose form is a tautology is called a tautological proposition. For example, consider the proposition:
Beijing is the capital of China or Beijing is not the capital of China.
Let's suppose:
As a propositional formula:
As a truth table:
T | F | T |
F | T | T |
We see that will always be true, regardless of what truth values are assigned to . Thus, we say that is a tautology:
The symbol is called the verum symbol, and means "always true".
Contradictions
In contrast to the tautology, a contradiction is a propositional formula that always reduces to false, regardless of the truth values of the individual propositions substituted for the propositional form's variables. For example, consider the proposition:
Dogs are cute and dogs are not cute.
Suppose:
As a propositional formula:
As a truth table:
T | F | F |
F | T | F |
We see that is always false, regardless of the truth value of . Thus, we say that is a contradiction. We denote this fact with the logical notation:
The symbol is the falsum symbol, and means "always false."
Conditional Propositions
When we reason from a hypothesis to a conclusion, we make a deduction. This act is embodied in the proposition:
We call this proposition a conditional and we denote it as:
The symbol is a logical connective just like , , , etc. The proposition is called the sufficient condition, and the proposition is called the necessary condition.1.
When Is a Conditional False?
Consider the following proposition:
If Paris picks Hera, then there will be no war.
When is this proposition false? It is false if, and only if, Paris picks Hera and there is a war (i.e., the sufficient condition is true and the necessary condition is false). Otherwise, the conditional is true.
T | T | T |
T | F | F |
F | T | T |
F | F | T |
If a conditional proposition's necessary condition is true because its sufficient condition is false, we say that the proposition is vacuously true. For example, consider the proposition:
If one is less than zero, then one plus one is two.
Clearly, the sufficient condition is false, and the necessary condition is true. The proposition, however, is vacuously true. To see why we vacuous truth sense, let's consider a logical equivalence of an implication.
Implications as Logical Disjunctions
The conditionals is logically equivalent to disjunctions. In fact, this is apparent from every day speech. Consider the proposition:
Either you study or you receive poor grades.
Let's rewrite this symbolically using the following variables:
Variable | Signified |
---|---|
Using the variables above, we have the propositional formula:
Now consider the proposition is:
If you do not study, then you receive poor grades.
Symbolically:
Let's look at their truth tables.
T | T | F | T | T |
T | F | F | F | F |
F | T | T | T | T |
F | F | T | T | T |
Both and have the same truth values; they are logically equivalent.Similarly, if then
T | T | F | T | T |
T | F | F | F | F |
F | T | T | T | T |
F | F | T | T | T |
Accordingly, we have the following logical equivalence:
lemma. Given propositions and
or
Negative Implications
Let's take a closer look at that equivalence If we negate both sides, we get:
Applying De Morgan's laws,
By the double negative law, we have
Therefore, it follows that
In other words, the negation of if then is and not . Let's see an example.
If I timely submit my assignment, I will not lose points.
I timely submit my assignment, but I lose points.
For those fond of Victorian horror:
If Dracula is a man, then Dracula is human.
Dracula is a man but not human.
Accordingly, we have the following theorem:
lemma. Given propositions and
The Contrapositive
A particularly useful equivalence is that between a conditonal and its contrapositive. Consider the proposition:
If I go to class, then I will attend lecture.
The contrapositive of this proposition is:
If I do not attend lecture, then I do not go to class.
contrapositive. Let and be propositions. Then
We call the proposition the contrapositive of
We can verify the logical equivalence claimed with a proof table. Suppose and are propositions:
T | T | F | F | T | T |
T | F | T | F | F | F |
F | T | F | T | T | T |
F | F | T | T | T | T |
The fact that a conditional's contrapositive is logically equivalent to the conditional is a valuable asset. Often, proving a conditional proposition's contrapositive is much easier than proving the conditional proposition itself.
The Converse
The converse of a proposition is formed when the proposition's necessary and sufficient conditions are switched:
Proposition | Converse |
---|---|
If Bo is a horse, then Bo is a mammal. | If Bo is a mammal, then Bo is a horse. |
converse. Let and be propositions. Then the converse of is the proposition
We may also denote the converse as
which is read as " is implied by ."
It's very important to understand that the converse of a conditional is not logically equivalent to the conditional. We can see that this is true with a truth table. Let and be propositions:
T | T | T | T |
T | F | F | T |
F | T | T | F |
F | F | T | T |
We will revisit the converse when we examine another propositional formula called the biconditional.
The Inverse
When we negate the sufficient and necessary conditions of conditional proposition while keeping their order in place, we get the conditional's inverse.
inverse. Let and be propositions. Then the inverse of is
For example:
Proposition | Inverse |
---|---|
If Sam entered the home, then she is guilty of burglary. | If Sam did not enter the home, then she is not guilty of burglary. |
Like the converse, the inverse of a conditional is not logically equivalent to the conditional:
T | T | F | F | T | T |
T | F | F | T | F | T |
F | T | T | F | T | F |
F | F | T | T | T | T |
Equivalence of Converse and Inverse
Although both the converse and inverse of a conditional are not logically equivalent to the conditional, the converse of a conditional is logically equivalent to the inverse of a conditional, and vice versa.
T | T | F | F | T | T | T |
T | F | F | T | F | T | T |
F | T | T | F | F | F | F |
F | F | T | T | F | T | T |
Idiom: Only If
The idiom only if introduces a necessary condition. In other words, when we say "A only if B", we are saying "If A occurs, B MUST occur;" that is, "If b does not occur, a does not occur."
Formally, given propositions and , the proposition " only if " is denoted as:
or, equivalently,
The Biconditional
A biconditional proposition (a "biconditional") is a conditional proposition where both component propositions are the necessary and sufficient conditions. The biconditional most often takes the form " if, and only if, ". The words if and only if are sometimes abbreviated:
We will follow this convention. The biconditional is true if both and have the same true values and is false if and have opposite truth values. The biconditional has the truth table:
T | T | T |
T | F | F |
F | T | F |
F | F | T |
Consider the following truth table:
T | T | T | T | T | T |
T | F | F | T | F | F |
F | T | T | F | F | F |
F | F | T | T | T | T |
Observe that the biconditional " iff " is logically equivalent to " if and if ." In other words, the biconditional is logically equivalent to the conjunction of the conditional and its converse. Symbolically:
This is helpful result. Biconditionals are much easier to prove or work with when they are reduced to the conditional and its converse.
Common Equivalences
The table below provides some helpful logical equivalences.
and-identity | |||
or-identity | |||
tautological domination | |||
falsehood | |||
or-indempotency | |||
and-indempotency | |||
double negation | |||
or-commutativity | |||
and-commutativity | |||
or-association | |||
and-association | |||
or-distribution | |||
and-distribution | |||
or-absorption | |||
and-absorption | |||
natural tautology | |||
natural contradiction | |||
conditional-reduction | |||
contrapositive | |||
or-reduction | |||
and-reduction | |||
negated conditional | |||
conditional conjunction | |||
conditional disjunction | |||
biconditional reduction | |||
biconditional negation |
Predicates
Consider the following argument:
(1) Every man is mortal.
(2) Socrates is a man.
(3) Therefore, Socrates is mortal.
Propositional logic isn't well-equipped to handle arguments of this form. What we need is a metalanguage that can more concisely handle sentences that use words like "is", "every", "all", "never", etc. The metalanguage we use to express such sentences is called predicate logic.
For example, consider the sentence:
Smoking is unhealthy.
This sentence has two parts, an argument and a predicate:
We express predicates with the following notation form:
More explicitly:
predicate. The sentence
is a proposition that asserts:
For each is true.
Each is called an argument, and is called a predicate.
For example, the sentence
Smoking is unhealthy
can be expressed as:
In the notation above, the symbol means
Limitations to Predicates
Predicates allow us to express the notions of and However, if we think about the way we categorize objects in the real world, we'd realize that categorize in several ways:
Some ... (is/are) (not)
All .. (is/are) (not)
That is, we describe objects as either all having some property or only some objects as having a property We need to distinguish between these types of propositions to avoid ambiguity and to be more precise.
Universal Quantification
A claim of the form:
All are
is called a universal quantification. Because its a description of the state of the world, it is, in fact, a proposition. We use the notation below to express universal quantification.
universal quantification. The proposition:
is a universal quantification, read
For example, consider the proposition:
In predicate logic, we express this with the logical formula:
Let's consider another example. Suppose we had the statement:
is greater than or equal to
As a logical formula:
Alternatively, we may also write:
Existential Quantification
A sentence of the form:
Some s are s.
is called an existential quantification. In the world of predicate logic, we interpret these sentences as saying:
There exists an that is not a
Why do we interpret them this way? Because it ties well to our previous notation for universal quantification. When we say that there exists an that is not a we're effectively saying:
For all , there is at least one that does not have property
Thus, we have the following definition:
existential quantification. The proposition:
is an existential quantification, read:
Footnotes
-
In the order of operations, the logical connective is performed last. ↩