Intro
Propositional Logic is a deep topic, covering most of what we can call “logical reasoning”. You have probably seen most of it before, and the goal today is to use it towards proving some kind of completeness theorem.
Be warned that at the moment, I have no intention of putting proofs in here. The “introduction” posts will be definitions only, pretty much. I may come back later and have a series of posts titled eg. “Proofs of Propositional Logic”, but for now, just definitions.
Math
The general idea is that propositional logic allows us to define a set of propositions, and then use logical connectives to build more complex propositions. We will distinguish between syntax, semantics, and the proof system that ties them together.
Basic Definitions
A propositional logic system must be able to express some kind of statement, give a meaning to that statement, and then have a way to prove things about those statements.
To put it another way, think of the typical Algebra 1 expressions you work with. We need a way to write expressions and formulas, eg “x+y” and “2+3”, a way to assign meaning to those expressions, eg “x=2” and “y=3”, and then a way to prove things about those expressions, eg “2+3=5”.
Structure of Propositional Logic
Definition (Propositional Symbols): I include the tex here for easy copy pasting for those using tex.
| Symbol | Name | Meaning | Tex |
|---|---|---|---|
| And | Conjunction | \wedge | |
| Or | Disjunction | \vee | |
| Not | Negation | \neg | |
| Implies | Implication | \rightarrow | |
| Parentheses | Grouping | () |
Note that we are defining grouping here!
If you have ever taken a programming languages course, you will know that grouping is very important for defining order of operations. We will not define a “parser” here, but know that parentheses are very important, and that when we evaluate expressions, we will always evaluate it as if there was a parser.
For instance, we will always evaluate the innermost parentheses first. Additionally, we must group every expression with parentheses. For example, instead of writing , we will write .
If I do not write parentheses, it should be obvious from context that I am omitting them for brevity, and that it can be grouped in a way that makes sense.
Definition (Propositional Variable): A propositional variable, the set of which will be denoted , is just some set of symbols that represent a proposition. For example, , , and could be propositional variables. The cardinality of this set must be at least countably infinite, eg .
Definition (Propositional Formula): A propositional formula is the following:
- Any propositional variable is a propositional formula.
- Propositional formulas are closed under the logical connectives defined above. For example, if and are propositional formulas, then so are , , , and .
- Nothing else is a propositional formula.
Note that this is a recursive (or inductive) definition. We can build up complex formulas from simpler ones, and that is the only way we can do them. It also means we can break down complex formulas into simpler ones by finding a recursive path that builds it up, and then reversing that path. Note that this recursive path also doesn’t have to be unique under valuation; for example, can be built up in two different ways depending on which connective we apply first, which are and , or and .
When discussing how to build a tree of a propositional formula, we may use “recursive” because it’s more computational. However, when discussing proofs by induction on propositional formulas, we will use “inductive” since it’s more mathematical.
TLDR: a propositional formula is the smallest possible set of things that contains all propositional variables and is closed under the logical connectives.
Because formulas are inductive items, proofs on them will be done with structural induction, eg by proving a base case and then showing that the property holds under closure.
Definition (Subformula): The function , which defines the set of subformulas of a propositional formula, is defined as follows:
- for any propositional variable .
- .
- .
- .
- .
- Nothing else.
As an example, let’s prove that for all formulas, , we have that . Again, we will do this by structural induction.
Example: We will prove that for all formulas, , we have that .
Proof: We will do this by structural induction on .
- Base Case: Let be a propositional variable, . Then, by the definition of , we have that , so .
- Inductive Step: Assume that for all formulas and , we have that and . We will show that this holds for the formulas , , , and .
- Let . Then, by the definition of , we have that . By the inductive hypothesis, we have that , so .
- Let . Then, by the definition of , we have that . By the inductive hypothesis, we have that and , so .
- Let . Then, by the definition of , we have that . By the inductive hypothesis, we have that and , so .
- Let . Then, by the definition of , we have that . By the inductive hypothesis, we have that and , so .
Thus, by structural induction, we have that for all formulas , we have that .
This is a very bulky proof! For the future, I will truncate similar proofs to just the base case and one inductive step, since the rest are analogous. Additionally, we will avoid trying to prove things that are obvious.
Definition (Variables): Let’s formally define the function , which gives us the set of propositional variables in a formula . Note that is different than . The first is a function that produces a set of propositional variables from a formula, while the second is the set of all propositional variables.
- for any propositional variable .
- .
- .
- … and so on for the other connectives.
- Nothing else.
Substitution
The notion of substitution is something that we should all understand to some degree. In 6th grade algebra, when we have the expression , and we don’t know what is in this expression, but we do know that from some other context, we can replace with to get .
The idea is that we can replace things in propositional logic too. They can be from within the same universe of discourse, or from different ones. For example, if we have the formula , and we know that is equivalent to , then we can replace with to get .
Definition (Substitution): Let (recall that this is the set of all propositional variables), and let be a propositional formula. Let be another propositional formula. Then, we define the substitution of with in as
These two notations are equivalent. We will use the first. In order for it to be well defined, let’s have that
- For , then if , if
- For , then
- For , then
- … and so on for the other connectives.
- Nothing else.
A shorthand we’re going to make here is that
Next, we will define a lemma, which basically just states that substitution on a variable that does not exist in the formula does nothing. To make an analogy if and we have the expression , substituting with does nothing since is not in the expression.
Lemma: If , then
Proof: We will use induction on the structure of formulas.
Base case: Let . Then, assuming that , eg that , then .
Inductive Step: Assume that for formulas if then , and if , then . We must show it holds for .
- For , if , then . Thus, by the inductive hypothesis, we have that . Therefore, .
- For , if , then and . Thus, by the inductive hypothesis, we have that and . Therefore, .
- … and so on for the other connectives.
Definition (Propositional Sentence): A propositional sentence is a propositional formula with no free variables. In other words, all variables in the formula are bound by some quantifier. At the moment, since we have not defined quantifiers, all propositional formulas are propositional sentences.
Tautologies, Contradiction, Entailment, and Proofs
Now that we have some basic definitions and syntax out of the way, we want to define some semantics. The idea is that we want to be able to assign truth values to propositional formulas, and then use those truth values to determine whether a formula is a tautology, contradiction, or contingent.
What does truth mean?
Definition (Truth Table): We want to give meetings to our formulas, and one of the easiest ways to do that is via truth tables. A truth table represents a truth function, which is a mapping from propositional variables to truth values (True or False).
We will denote , or , as the truth value “true”, and , or , as the truth value “false”. Propositional variables can take on either truth value.
Then, truth functions map , where is some set of propositional variables. For example, the truth function for is defined as follows:
| P | Q | (P ∧ Q) |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
If you are unfamiliar with the basic definitions of our connectives, here is a quick refresher: the conjunction is true if both and are true, and false otherwise. The disjunction is true if at least one of or is true, and false otherwise. The negation is true if is false, and false if is true. The implication is false only when is true and is false; otherwise, it is true. These can be summarized in truth tables as well.
Note that we have ex falso quodlibet here: from a contradiction, anything follows. That is to say, is always true, regardless of the truth value of .
Definition (Truth Assignment): A truth assignment is a function which assigns each propositional variable a truth value. That is, . This gives a meaning to propositional formulas.
Then, we can define the evaluation of a propositional formula under a truth assignment! Assume that we have, defined by truth tables, the functions which give the truth values of the respective connectives given their inputs.
Definition (Valuation Function): Then, we can define the valuation function as
- for any propositional variable , eg .
- Let and be propositional sentences (a reminder that in our current system a propositional sentence is equivalent to a propositional formula). Then,
- … and so on for the other connectives.
We write as shorthand for .
Definition (Models): We say that a truth assignment is a model of a propositional formula if . Then, we write that . In other words, the formula evaluates to true under the truth assignment. Similarly if .
Definition (Tautology): A formula is a tautology if for ALL assignments , we have that . In other words, the formula is always true regardless of the truth values of its propositional variables. We denote this as .
An example of a tautology is , which is true regardless of whether is true or false. (you can choose any valuation for , and it will always be true)
This tautology is called the law of excluded middle. Another tautology is MP, or Modus Ponens, which states that is a tautology. That is to say, if we know , and , then we can conclude .
It’s somewhat controversial if the law of excluded middle should be a tautology, since in some logics (eg intuitionistic logic), it is not. However, in classical propositional logic, it is. And MP is definitely a tautology in all standard propositional logics.
Definition (Logical Entailment): A formula logically entails a formula if for all , such that , we have that . In other words, whenever is true, is also true. We denote this as .
More generally, for a set of formulas , we say that logically entails if for all , such that for all , we have that , then . In other words, whenever all formulas in are true, then is also true. We denote this as .
Definition (Logical Equivalence): We say that a formula is logically equivalent to a formula if is a tautology. In terms of logical entailment, this is equivalent to saying that and . We denote this as .
It’s a fun exercise to prove that if and are formulas, then the following are equivalent: logically implies , and is a tautology. In symbols, if and only if .
Definition (Unsatisfiable): A formula is unsatisfiable if there is NO truth assignment such that . In other words, the formula is always false regardless of the truth values of its propositional variables. We can also say that a set of formulas is unsatisfiable if there is NO truth assignment such that for all , we have that .
Truth Functions
Let be the set of all truth assignments. Then, we should intuitively be able to define a function from truth assignments to truth values for any propositional formula. This is called a truth function.
Definition (Truth Function): A function is a truth function if there exists a finite set of variables such that for all assignments we have that if
Then, we have that . In this case, we can call the set of variables that depends on, or the support of .
Then, given some formula we can define the function for in the most obvious way:
Note that every propositional variable implies a truth function, where
The support of this function is just .
Additionally, all truth functions can be described by a finite truth table. This is because the support of a truth function is finite, and thus there are only finitely many combinations of truth values for the variables in the support. Thus, we can enumerate all possible combinations of truth values for the variables in the support, and then define the output of the function for each combination. This is of course impractical for large supports, but it is theoretically possible, and might remind you that we are working with finite, countable objects here.
Definition (Adequacy of Truth Functions): Let be a set of truth functions. We will say that is adequate if for every truth function , there exists a formula such that the truth function induced by is equal to , and only uses truth functions from .
That is, every truth function can be expressed as a propositional formula using only the truth functions in under composition.
Theorem: I don’t really do theorems in this because I didn’t want to bloat the post with proofs, but it’s worth stating that the set of truth functions is adequate. It might be a fun exercise to show that the remaining functions and can be expressed in terms of these three functions.
From this, you can also deduce that is adequate, since you can express and in terms of these two functions.
End
Next: Propositional logic proof systems.