Graduate → Mathematical Logic and Foundations ↓
Propositional Logic
Propositional logic is a branch of mathematical logic that deals with the study and manipulation of propositions. A proposition is a declarative statement that can be true or false. Propositional logic is the simplest form of logic and forms the basis for more advanced types of logic, such as predicate logic. In this discussion, we will present the basic principles of propositional logic using simple language.
Basics of propositional logic
At its core, propositional logic deals with propositions, which are statements that are either true or false. For example, "It is raining," and "A triangle has three sides" are propositions because they can be unambiguously determined as true or false. However, questions or commands, such as "Is it raining?" or "Close the door," are not propositions because they do not have truth values.
Each proposition can be represented by a variable, usually by a capital letter such as P
, Q
, or R
. For example, we might consider P
to be "it is raining." So if it is in fact raining, then the proposition P
is true; otherwise, it is false.
Logical connectives
In propositional logic, we use logical connectives to create new propositions from existing propositions. The basic logical connectives are:
- AND (∧): A conjunction. A compound statement is true only if both component statements are true. For example,
P ∧ Q
is true if bothP
is true andQ
are true. - OR (∨): A disjunction. A compound statement is true if at least one of the component statements is true. For example,
P ∨ Q
is true if eitherP
orQ
(or both) are true. - NOT (¬): A negation. This single operator inverts the truth value of a given proposition. If
P
is true, then¬P
is false, and vice versa. - Implication (→): Implication. It is a conditional statement that is read as "if
P
, thenQ
." The propositionP → Q
is false only ifP
is true, andQ
is false. - Biconditional (↔): An equivalence. A compound statement is true if both component statements are true or false, i.e.,
P
is equivalent toQ
.
Truth tables
Truth tables are a convenient method for representing the truth values of compound propositions based on their logical connectives. Let's start with a simple truth table for a proposition with a single variable, such as P
:
| P | ¬P | | T | F | | F | T |
The table above shows the truth value of P
and its negation ¬P
. In complex propositions, we use connectives such as AND, OR, etc. Here is what the truth table for a compound proposition such as P ∧ Q
looks like:
| P | Q | P ∧ Q | | T | T | T | | T | F | F | | F | T | F | | F | F | F |
In the above table, P ∧ Q
is true only if both P
and Q
are true.
Similarly, the truth table for P ∨ Q
looks like this:
| P | Q | P ∨ Q | | T | T | T | | T | F | T | | F | T | T | | F | F | F |
Logical equivalences
Logical equivalence refers to a situation where two statements are true at the same time, given all possible scenarios for the variables involved. Some common logical equivalences are:
- Double negation: The statement
¬¬P
is logically equivalent toP
. - De Morgan's laws: They provide a way of distributing negation between conjunctions and disjunctions:
¬(P ∧ Q)
is equivalent to¬P ∨ ¬Q
.¬(P ∨ Q)
is equivalent to¬P ∧ ¬Q
.
- Implication:
(P → Q)
is equivalent to(¬P ∨ Q)
. - Equivalence law: It states that repeating the same condition does not change the outcome:
P ∧ P
is equal toP
.P ∨ P
is equal toP
.
- Law of excluded middle:
P ∨ ¬P
is always true.
Examples of logical reasoning
Imagine you are planning a weekend picnic. You say that P
means "it will be sunny," and Q
means "the park is open." You want to plan your picnic based on the following conditions:
If it's sunny and the park is open, we will go on a picnic.
This condition can be written as a logical expression: P ∧ Q
. Using this expression, you can evaluate different scenarios:
| P | Q | P ∧ Q | Result | | T | T | T | Go on a picnic | | T | F | F | No picnic | | F | T | F | No picnic | | F | F | F | No picnic |
With these evaluations, you note that the only scenario when you will go ahead with the picnic is when both conditions are met.
Extracting complex logic statements
Suppose you want to make a decision based on several conditions. Your decision may correspond to complex logical expressions involving several propositions and logical connectives.
For example, imagine you are automating the decision-making process of turning on a heating system based on some criteria. Let's define:
T
means "the temperature is below 18 degrees,"W
means "it is winter,"H
as in "the heating is not already on."
You decide logically that if the temperature is below 18 degrees, or if it is winter and the heating is not already on, the heater should be turned on:
(T ∨ (W ∧ H))
Logical proofs and applications
Propositional logic is not just a way of presenting truth values; it is also used to present logical proofs — validating statements and reasoning about propositions based on their logical structure.
An example of a simple proof using logical equivalence:
Let us prove that (P → Q) → (¬P ∨ Q)
.
(¬P ∨ Q) → (¬P ∨ Q)2. By rearranging the disjunction:
(¬P ∨ Q)
This brief example shows how complex logical expressions can be simplified by proving logical equivalence.
Limitations and possibilities for propositional logic
While propositional logic provides a basic foundation for logical reasoning, it has its limitations. It cannot express relations or predicates about objects, which is why predicate logic, which uses quantifiers, is considered a more robust logical framework suitable for deeper analysis where propositions depend on variables.
However, propositional logic remains an important foundation because of its simplicity and clear structure, making it ideal for introductory logic courses and providing a platform for more sophisticated logical analysis.
Conclusion
Understanding propositional logic is very important in various fields such as mathematics, computer science, and philosophy. In computer science, it is particularly prevalent in the field of digital logic design and algorithms, which provide the basis for circuit theory and various algorithms.
In this talk, we thoroughly discussed the basic elements of propositional logic. The logical connectives and truth tables introduced are tools for evaluating each possibility within logical expressions. Mastery of these basics leads to more advanced topics, making it possible to solve complex logical problems with clarity and precision.