Logic

“But in fact, they don't even know what thinking is. Because thinking is not actually logic. That was the mistake that the Greeks made. And that was the mistake that St Thomas Aquinas made. It was the major mistake of the Middle Ages. It was also the major mistake of Postmodernism. That isn't what it is.” —Alan Kay

What is Logic?

Logic is the study of reasoning. It is concerned mainly with inference, but also with entailment, causality, consequence, induction, deduction, truth, falsity, belief, fallacies, paradoxes, probabilities, analysis, tense, modality, necessity, sufficiency, possibility, identity, vagueness, existence, description, justification, tolerance, obligation, permission, relevance, assertion, judgment, soundness, validity, contradiction, provability, and argumentation.

Logic is topic-neutral, meaning we don’t let our biases about subject matter influence the way we look at the structure of arguments. Logic focuses on the form of arguments rather than their content. Here’s an introductory video. In fact it is the first video in an amazing playlist of 83 videos on logic.

One of the central questions explored in the study of logic is:

Does the conclusion follow from the premises?

The phrase “follow from” can have different interpretations, depending on the inference mode you are working under:

Deduction

We know a general rule to be valid. We see an instance of this rule, so we apply the general rule to show, with complete certainty, the truth of the specific instance.

Induction

We have seen a bunch of cases to be true, so we infer that a new related case is also true. We can’t be completely sure of the truth of our conclusion, though, since a few special cases cannot necessarily prove a general rule.

Abduction

The premises give really strong evidence for the truth of the conclusion.

Deduction is the one most often formally studied in philosophy, mathematics, and computer science. The others are still important, of course.

But hang on though! Each of these descriptions used the word truth. But what is truth? And how do we reason our way from premises to true conclusions? Answers to those questions depend on the system of logic we are using. We’ll see many systems of logic later in these notes.

A Pretest

Have some fun! Take this logic pre-test.

Basic Concepts

A rigorous study of any field benefits from an understanding of its basic concepts and terminology.

Sentences

Since logic requires a rigorous study of the forms of arguments, it helps to not get bogged down in long, confusing, and often ambiguous prose, so we want our statements, or sentences, to have a very compact form. We can achieve this by using single letters for our subjects, objects, and predicates, and fancy symbols for our conjunctions and prepositions and other grammatical words. Let’s jump right into some examples (with details to follow):

EnglishLogicBreakdown
Juliet is Italian$Ij$ 
Romeo likes Juliet$Lrj$ 
Romeo likes himself$Lrr$ Romeo likes Romeo
The sidewalk is wet when it rains$R \supset Ws$ If it is raining then the sidewalk is wet
Romeo likes the king’s daughter$Lr(\iota p.Dkp)$ Romeo likes the p such that the daughter of the king is p
$Lr(dk)$ Romeo likes the daughter of the king
Alice sees everybody$\forall p. Sap$ For every p Alice sees p
$\neg \exists p.\neg Sap$ It is not the case that there exists a p such that it is not the case that Alice sees p
Alice sees somebody$\exists p.Sap$ There exists a p such that Alice sees p
$\neg \forall p. \neg Sap$ It is not the case that for every p it is not the case that Alice sees p
Alice sees nobody$\neg \exists p.Sap$ It is not the case that there exists a p such that Alice sees p
$\forall p. \neg Sap$ For every p it is not the case that Alice sees p
All apples are fruits$\forall x.(Ax \supset Fx)$ For every x if x is an apple then x is a fruit
Some apples are green$\exists x.(Ax \land Gx)$ There exists an x such that x is an apple AND x is green
All snakes are animals$\forall x.(Sx \supset Ax)$ For every thing x if x is a snake then x is an animal
$\neg \exists x.(Sx \land \neg Ax)$ It is not the case that there exists an x such that x is a snake AND x is not an animal
Some snakes are poisonous$\exists x.(Sx \land Px)$ There exists an x such that x is a snake AND x is poisonous
$\neg \forall x.(Sx \supset \neg Px)$ It is not the case that for every x if x is a snake then x is non-poisonous
Juliet doesn’t like French people$ \neg\exists p.(Fp \land Ljp)$ It is NOT the case that there exists a p such that p is French AND Juliet likes p
$\forall p.(Fp \supset \neg Ljp)$ For every p if p is French then it is not the case that Juliet likes p
Juliet likes all Italians$\forall p.(Ip \supset Ljp)$ For every p if p is Italian then Juliet likes p
Juliet likes all Italians except Romeo$\forall p.(Ip \supset (Ljp \equiv \neg (p=r)))$ For every p if p is Italian then Juliet likes p IF AND ONLY IF p is not Romeo
Every Italian likes someone$\forall p. (Ip \supset \exists q.Lpq)$ For every p if p is Italian then there exists a q such that p likes q
Everyone likes an Italian$\forall p. \exists q.(Iq \land Lpq)$ For every p there exists some q such that q is Italian AND p likes q
Everyone likes this one particular Italian$\exists q.(Iq \land \forall p.Lpq)$ There exists a particular q such that q is Italian AND for every p p likes this one particular q
Pablo shaves all and only those who do not shave themselves$\forall q.(Spq \equiv \neg Sqq)$ For every q Pablo shaves q IF AND ONLY IF it is not that case that q shaves q
Not everyone is libertarian or progressive$\neg \forall p.(Lp \lor Pp)$ It is NOT the case that there exists a p such that p is Libertarian OR p is progressive
$\exists p.(\neg Lp \land \neg Pp)$ There exists a p such that p is NOT libertarian AND p is NOT progressive
Either the queen is rich or some pigs fly$Rq \lor \exists p.(Pp \land Fp)$ The queen is rich OR there exists a p such that p is a pig AND p flies
Everything has a cause$\forall x. \exists y.Cyx$ For every (thing) x there exists some y such that y caused x
Everything has the same cause$\exists y. \forall x.Cyx$ There exists this one (uber thing) y such that for every thing x y caused x
Nothing caused itself$\forall x. \neg Cxx$ For every (thing) x it is not the case that x caused x
$\neg \exists x. Cxx$ It is not the case that there exists an x such that x caused x
Everybody loves somebody, but someone is unloved$(\forall x. \exists y.Lxy) \land (\exists x.\neg \exists y.Lyx)$ For every x there is some y such that x loves y AND ALSO There exists some x such that it is NOT the case that there exists some y such that y loves x
Some number less than 5 is a perfect square $\exists x. (Lx5 \land \exists y.(x=qy))$ There exists an x such that x < 5 AND there exists a y such that x is y squared
$\exists x. (x<5 \land \exists y.(x=y^2))$
Juliet might like Romeo$\lozenge Ljr$ It is possible that Juliet likes Romeo
Two is necessarily equal to two$\Box (2=2)$ It is necessary that 2 equals 2
The thunder god was worshiped by some Athenians$\exists p.(Ap \land Wp(gt))$ There exists a p such that p is an Athenian AND p worships the god of thunder
It is possible that some day the sun-god will become forever awesome$\lozenge \mathbf{FG}A(gs)$ It is possible that at some point in the future it will always be the case that the god of the sun is awesome
Juliet believes that Romeo doesn’t believe that Juliet likes him $\mathscr{B}_j(\neg \mathscr{B}_r Ljr)$ Juliet believes that it is not the case that Romeo believes that Juliet likes Romeo
There is a better than 50-50 chance that Juliet is hungry when it’s raining $pr(Hj \mid R) > 0.5$ The probability that Juliet is hungry, given that it’s raining is bigger than 0.5

Now here’s a summary of common logical notation:

FormMeaningTechnical Term
$T$TrueTruth
$F$FalseFalsity
$\neg A$Not $A$Negation
$A \land B$$A$ and $B$Conjunction
$A \lor B$$A$ or $B$, or bothDisjunction
$A \supset B$Anything other than $A$ and not $B$Material Implication
$A \equiv B$$A$ and $B$ have the same truth valueMaterial Equivalence
$\forall x. A$For every $x$, $A$Universal quantification
$\exists x. A$There exists an $x$ such that $A$Existential quantification
$f\,x$The result of applying function $f$ to $x$Function application
$\iota x. A$The $x$ such that $A$Description
$x = y$$x$ and $y$ are the same objectEquality
$\Box A$In all possible worlds, $A$Necessity
$\lozenge A$In some possible world, $A$Possibility
$\mathbf{P} A$It was (at least once) the case that $A$Past
$\mathbf{F} A$It will (at least at some point) be the case that $A$Future
$\mathbf{H} A$It was always the case that $A$Always has been
$\mathbf{G} A$It will forever be the case that $A$Always going to be
$\mathscr{O} A$$A$ must (morally) be doneObligation
$\mathscr{P} A$$A$ may (morally) be donePermission
$\mathscr{K}_x A$Agent $x$ knows $A$Knowledge
$\mathscr{B}_x A$Agent $x$ believes $A$Belief
$|A|$Truth value of $A$ (in 0.0 ... 1.0)Numerical Truth Value
$pr(A)$Probability of $A$ being trueProbability
$pr(A|B)$Probability of $A$ being true given that $B$ is trueConditional Probability

It takes an enormous amount of practice to translate sentences of English (or other natural language) into sentences of logic. Such translations are not unique, nor are they always even exact, as natural language is fluid and frequently imprecise.

Exercise: Read the SEP article on Conditionals to see how the simple phrase “if...then” can have so many different meanings.

Terms and Formulas

Most systems of logic distinguish between terms and formulas.

Parentheses

Be sure to use parentheses when needed. For example, $Pfb$ is an application of the two-argument predicate $P$ to $f$ and $b$, for instance “Farah pressed the button”; but in $P(fb)$, $P$ is a one-argument predicate and $f$ is a function, as in “The friend of Billie is popular.”

For operators, $\neg$ has the highest precedence, then $\land$, then $\lor$ then $\supset$ then $\equiv$. All operators associate to the right, so $P \supset Q \supset R$ means $P \supset (Q \supset R)$ and does not mean $(P \supset Q) \supset R$.

The . is sugar for a left parenthesis whose implicit made is as far to the right as possible. So $\exists x. Px \land Q$ means $\exists x. (Px \land Q)$ and does not mean $(\exists x. Px) \land Q$. .

You can also just use parentheses everywhere. No shame in that!

Be careful not to confuse terms and formulas. For example, note $\iota x. Px$ is a term, but $\exists x. Px$ is a formula.

Exercise: Identify each of the objects, functions, propositions, and predicates of the expression $\textbf{P}R \supset \neg \exists a. Dta$. Also identify any subterms or subformulas.
Notation conventions

Note how we’ve always used lowercase letters in the term world (objects and functions) and uppercase letters in the formula world (predicates and propositions). This is the way.

If you were a minimalist, you might notice:

That’s cool from a foundational point of view, but as humans, we like to work with objects, functions, terms, propositions, predicates, and formulae as distinct concepts.

Variables

A variable stands for something unspecified.

Every variable occurrence is either bound or free. It’s bound if it is within the scope of a $\forall$, $\exists$, or $\iota$ that binds it or is the binding occurrence itself, and free otherwise. This requires examples! In the following, the free variable occurrences are underlined:

The names of bound variables are rather arbitrary: $\forall x. x = x$ and $\forall y. y = y$ are meant to represent the same sentence.

A term or formula with a free variable is called an open term or open formula. A term or formula with no free variables is called closed. Open formulas are general statements and closed statements are specific statements. When useful to do so, we will indicate that a term or formula has certain free variables by writing $A[x]$ or $A[x,y]$ (read: “there are free occurrences of $x$ in $A$” and “there are free occurrences of $x$ and $y$ in $A$”, respectively).

To increase specificity, we may substitute for the free variables in a term or formula. The notation for substituting $t$ for free occurrences of $x$ in formula $A$ such that no free variable in $t$ becomes bound (i.e., is captured) is $A[x \mapsto t]$ or $A[t/x]$.

Capturing is explicitly disallowed because a capture changes the meaning of the formula. For example, in the formula $\exists x. x \neq y$, the substitution $[y \mapsto x]$ mustn’t replace $y$ with $x$, since you’d end up with $\exists x. x \neq x$, which means something completely different! To properly substitute in such cases, you must rename bound variable occurrences in $A$ to avoid capturing free variables in $t$, like so:

$$(\exists x. x \neq y)[y \mapsto x] \quad=\quad \exists z. z \neq x$$

Where we can safely substitute $t$ for $x$ in $A$ (without any need for renaming), we say $t$ is free for $x$ in $A$.

Judgments

A formula is just a string of symbols: on its own it asserts nothing. To actually claim something, we need a judgment.

The first judgment we’ll see is that a formula is true. We write it:

$$A\;\textsf{true}$$

which is read “$A$ is true.” This looks trivial, but the distinction matters: $A$ is just a formula; $A\;\textsf{true}$ is an assertion about that formula. It is easy to get confused.

A hypothetical judgment is one that asserts something relative to assumptions:

$$ J_1, J_2, \ldots, J_n \vdash J $$

where each of the $J$s are simple judgments. We often use $\mathcal{H}$ for a list of hypotheses so:

$$\mathcal{H} \vdash A\;\textsf{true}$$

is the assertion that “$A$ is true, given that every assertion in $\mathcal{H}$ holds.” The symbol $\vdash$ is called turnstile. Since $A\;\textsf{true}$ is (for now) our only judgment, people often shortcut the notation and abbreviate $A\;\textsf{true}$ as just $A$, so you will see entire judgments shortened to $\mathcal{H} \vdash A$ or $\vdash A$ or even (yikes) just $A$.

AMBIGUOUS NOTATION ALERT

Once we start dropping $\textsf{true}$, the symbol $A$ on its own becomes confusing: sometimes it’s the formula (pure syntax), and sometimes shorthand for the judgment $A\;\textsf{true}$.

If the context is such that you are dealing with judgments rather than formulas, you will have to mentally understand that the $\textsf{true}$ symbols are really present, just not visible. BE CAREFUL.

There is no shame at all, however, in being pedantic and never dropping the $\textsf{true}$s.

What other judgments are there?

In beginning logic, the truth assertion $A\;\textsf{true}$ is pretty much the only one we’ll see. But we’ll see more, especially in computer science. Examples:

$t\;\textsf{type}$
$t$ is a type
$e\!:t$
$e$ has type $t$
$e \Downarrow v$
$e$ evaluates to $v$
$e \Uparrow$
The evaluation of $e$ diverges
$e\;\to\;e'$
$e$ reduces in one step to $e'$
$s\;\mapsto\;s'$
State $s$ transitions in one step to $s'$
$p\;\textsf{halts}$
Program $p$ halts

When you are done reading these notes, you will be ready to return to the deeper philosophical questions about the difference between formulas and judgments, and will then enjoy reading the transcript of the three lectures by Per Martin-Löf.

Arguments

A logical argument is a sequence of judgments, each of which is either a hypothesis or follows from earlier judgments in the sequence via inference rules. The set of inference rules depends on the particular system of logic you are working in. In other words, a particular system will tell you which judgments you are allowed to state and how to infer from existing judgments to new judgments. An argument is valid if all of its judgments are derived by following the rules of the system.

Arguments are often written graphically, with premises above the line and conclusion below. Example:

$ \begin{prooftree} \AxiomC{$B\;\textsf{true}$} \UnaryInfC{$A \lor B\;\textsf{true}$} \AxiomC{$\neg B\;\textsf{true}$} \BinaryInfC{$A\;\textsf{true}$} \end{prooftree} $

If a particular logic system allows you to make a hypothetical judgment $J$ from no prior judgments, $J$ is called an axiom of that system. If a non-hypothetical judgment $J$ is an axiom or can be inferred from other judgments according to the rules of the system, then $J$ is said to be a theorem of that system. Because theorems are non-hypothetical judgments you will often see the notation:

$$ \vdash A $$

to mean $A$ is a theorem, or equivalently, $A$ is provable, $A$ is derivable from the inference rules. etc.

Truth

A system of logic needs to do at least two things. It needs to define:

The first part, truth, is a semantic notion, concerning the relationship between formulas and the world (or model) they describe. Truth values vary according to system: they can be exact (e.g., true, false, both, neither) or a “degree of belief,” or whether something is “justified,” or “achievable,” or “knowable.”

The second part, proof, is a syntactic notion. You blindly follow the rules, deriving new judgments as you go, without consulting the model. You have to hope that whoever designed the inference rules did so in a way that the rules line up with model, so you only derive truthy things as theorems.

Some of the truth values of a system are known as its designated values. These are the truthy ones. Formulas that always have a designated value in a model, no matter what their internal variables are assigned to, are valid. If $A$ is valid, we write;

$$ \vDash A $$ As we saw earlier, a formula you can derive from the inference rules is a theorem. If $A$ is a theorem, we write: $$ \vdash A $$

The notations look similar, but they are different things.

Truth and proof are related, but absolutely not the same thing.

Exercise: Distinguish between an argument being valid and a formula being valid.
Exercise: What do you think it would mean if for some $A$, you had both $\vdash\!A$ and $\vdash\!\neg A$? What about having $\vdash\!A$ but not $\vDash\!A$. What about having $\vDash\!A$ but not $\vdash\!A$? (We’ll cover these ideas later, but think about these questions now before we treat them formally.)

Kinds of Logic

How can there be many different kinds of logic? Well, there could be different ways to understand truth, as we saw above. There can also be different ways to reason, with some inferences acceptable in some contexts but not others. Some systems are deliberately small (in that they cannot capture all forms of reasoning), to simply serve as a stepping stone for more complex forms of reasoning.

Here are some kinds of logics. The list is incomplete. The kinds are also overlapping.

Bivalent Logic

A bivalent system has exactly two truth values, usually called true and false. Contrast this with a non-bivalent system has more than two truth values, perhaps three, four, eight, or an infinite number (e.g. a value $\in 0.0\ldots 1.0$).

Often a bivalent system will identify false with $0$ and true with $1$, as this will scale up nicely to three-valued logics where the third value gets $\frac{1}{2}$, and to infinitely-valued, or fuzzy, logics that admit any value between $0.0$ and $1.0$ inclusive. Bivalency is about complete certainty of truth or falsity with nothing in between.

Bivalent logics are super simple to work with, even if they don’t fully capture the nuances of the real world.

For example, bivalent logical negation is trivial: $\neg \textbf{true} = \textbf{false}$ and $\neg \textbf{false} = \textbf{true}$.

Also, bivalency gives rise to dualities with respect to negation that sometimes facilitate reasoning. The duals are related to each other as $\neg\square A \equiv \blacksquare\neg A$ or as $ \neg(A\circ B) = \neg A\bullet \neg B$.

Exercise: Do you think the following are duals? Why or why not? (a) AND and OR, (b) EVERY and SOME, (c) ONCE and FOREVER, (d) MUST and MAY.

Propositional Logic

Technically, a proposition is a predicate with no arguments, such as “It‘s raining”. (We saw this in the example above, where we represented this with $R$.)

There is a type of logic where we simplify things so much that we ignore subjects, predicates, and objects, where all information is rolled up into single, atomic, nondecomposable sentences. Then propositions can be things like “Pigs fly”, “I am late”, “The moon is square”, and “The baby wants to sleep”. Propositional Logic is a system of reasoning about these things without decomposing them. The traditional operators are:

FormMeaning
$P \land Q$$P$ and $Q$
$P \lor Q$$P$ or $Q$ (or both)
$\neg P$not $P$
$P \supset Q$$P$ materially implies $Q$; e.g., $\neg(P \land \neg Q)$, or equivalently, $\neg P \lor Q$
$P \equiv Q$$P$ and $Q$ have the same truth value
Example: Let $P$ = “Pigs fly”, $Q$ = “The queen is rich”. Then:
$P \land Q$
means “Pigs fly and the queen is rich”
$\neg Q \lor P$
means “The queen is not rich or pigs fly”
$(P \lor Q) \land (\neg P \lor \neg Q)$
means “Pigs fly or the queen is rich, but not both”

Note: The $\land$ and $\lor$ operators are meant to be material, not causal. They cannot distinguish the sentence “I called her and found out about the problem” from “I found out about the problem and called her.”

Exercise: The requirement that propositions be atomic, without any unspecified “variables” within, cannot be stressed strongly enough. Read this 1908 letter by Bertrand Russell (H/T Alissa Crans for the link) where he describes the difference between propositions and non-atomic things he calls statements.

Propositional logic is too weak to deal with everything we need to reason about. But the simplicity buys us so much! Besides being easy to learn and understand, a propositional logic system has many desirable technical properties, many of which we’ll see in these notes.

Syllogistic Logic

Systems of logic featuring syllogisms were studied thousands of years ago; they include reasoning about “all” and “some”, but do not allow general propositions nor connectives like “and” and “or”. Traditionally, only the following eight kinds of statements were considered (capital letters are classes, small letters are instances):

FormExample
$x$ is $A$Socrates is human
$x$ is not $A$Fido is not human
$x$ is $y$Obama is the 44th U.S. President
$x$ is not $y$Italy is not the 2016 Olympic champion in Women’s Water Polo
All $A$ are $B$All dogs are mammals
No $A$ is $B$No dogs are fish
Some $A$ are $B$Some birds are flyers
Some $A$ are not $B$Some markers are not green
For historical use only

Syllogistic logic has been completely superseded by first-order predicate logic.

Exercise: Read this influential 19th century article by John Venn regarding the shortcomings of syllogisms and how the new way of doing logic came to be in the late 1800s. What was Venn trying to capture with his new notation that syllogisms simply could not capture?
Exercise: Those diagrams that Venn introduced in that article in the previous exercise...they look...familiar, don’t they? What do we call those things today?

Predicate Logic

A predicate logic adds objects, functions on objects, predicates, descriptions, and quantifiers (such as $\exists$ and $\forall$) to propositional logic. A first-order logic allows quantification over objects only; In a second-order logic you can quantify over first-order predicates. You can go on forever with these orders. At $\omega$-order logic, you essentially have type theory.

CLASSWORK
For each of the eight examples of syllogistic forms above, we will write the corresponding formula in first-order logic. Then we’ll try to come up with formulae in first-order logic that cannot be expressed in syllogistic logic.

Here is an example of a second-order logic formula. Do you recognize it? It’s the principle of mathematical induction on natural numbers, where $s$ is the successor function (that is, $sn = n+1$):

$$\forall P.((P0 \land \forall n.(Pn \supset P(sn))) \supset \forall n.Pn)$$

Classical Logic

Classical Logic is probably the most widely used logic. It has several properties:

The term “classical” here does mean old or ancient. This was not the logic of the Ancient Greeks, the Ancient Chinese, or the Ancient anyone else. Classical Logic dates from the late 1800s. It’s relatively new. However, it is strongly influenced by the work of a few ancient philosophers.

Some classical logics are entirely truth-functional, which means we can give the meanings of the logical operators purely in terms of the meanings of their components. For example, in a bivalent, propositional, classical logic, we can give the following truth table:

$p$$q$$\neg p$$p \land q$$p \lor q$$p \supset q$$p \equiv q$
TTFTTTT
TFFFTFF
FTTFTTF
FFTFFTT

Sometimes these are shortened to one table per operator.

¬
TF
FT
TF
TTF
FFF
TF
TTT
FTF
TF
TTF
FTT
TF
TTF
FFT
Exercise: For each of the following, express the equations in English and prove that they hold:
  • $T\land x=x$, $\;F\land x=F$, $\;x\land x=x$
  • $T\lor x=T$, $\;F\lor x=x$, $\;x\lor x=x$
  • $T\supset x=x$, $\;F\supset x=T$, $\;x\supset T=T$
Exercise: Suppose that $T = 1$ and $F = 0$. Show that:
  • $\neg A = 1-A$
  • $A \land B = \min(A,B)$
  • $A \lor B = \max(A,B)$
  • $A \supset B = \min(1,\, 1-A+B)$.

Classical logic is quite useful, but there are quite a few things that folks can rightly quibble over, hence the interest in non-classical logics.

Intuitionistic Logic

In intuitionistic logic (often identified with constructive logic), we are not concerned with the truth of a statement as much as we are about its justification. Everything we assert in intuitionistic logic is something justifiable, constructively. So $A$ means “$A$ is provable” and $\neg A$ means “$A$ is refutable” (i.e., it is provable that no proof of $A$ exists—in other words, assuming $A$ allows you to derive falsity). Therefore:

Therefore:

Intuitionistic logic is not truth-functional.

Our familiar logical connectives are read quite differently:

Constructive logic codifies the principles of mathematical reasoning as it is actually practiced. In mathematics a proposition may be judged to be true exactly when it has a proof, and may be judged to be false exactly when it has a refutation. Because there are, and always will be, unsolved problems, we cannot expect in general that a proposition is either true or false, for in most cases we have neither a proof nor a refutation of it. Constructive logic may be described as logic as if people matter, as distinct from classical logic, which may be described as the logic of the mind of god. From a constructive viewpoint the judgment “φ true” means that “there is a proof of φ.” —Robert Harper, Practical Foundations of Programming Languages, Chapter 30.

Intuitionistic logic turns out to be ideal for computer science.

Learn more at Wikipedia and the SEP. And if you prefer a video introduction, here’s Attic Philosophy’s:

Many-Valued Logics

Sometimes bivalent systems are just too restrictive. We run into sentences like “This sentence is false” which appear to be both true and false, or sentences like “This sentence is true” which appear to be neither true nor false. Approaches to handling these seemingly self-contradictory or seemingly meaningless statements include adding to a bivalent system either (1) a third truth value for “other” or (2) two new truth values for “both true and false” and “neither true nor false”.

In general, a many-valued logic is one with three or more truth-values. Many such systems exist. We can have $3$, $4$, or even infinitely many truth values.

Don’t miss the Attic Philosophy videos on this topic

See the Logic playlist, videos 44–51, for Mark Jago’s presentations of many-valued logics, paradoxes, dialetheism, paraconsistent logics, and Curry’s Paradox.

In the case of a three-valued system, the third value is just “other” ($O$). Let’s construct the truth matrices for a truth-functional 3-valued logic. Using the laws from the section on propositional logic we can fill in almost everything:

¬
TF
OO
FT
TOF
TTOF
OOOF
FFFF
TOF
TTTT
OTOO
FTOF
TOF
TTOF
OT?O
FTTT

We have two reasonable options:

Exercise: Do the formulas for computing truth values in the section on propositional logic work with $T = 1$, $O = \frac{1}{2}$, and $F = 0$? Answer for both the Strong Kleene and Łukasiewicz interpretations. If you see that one does not work, modify it so it does.

But now here’s something interesting with multi-valued logics. What does it mean for a sentence to be valid? Does it have to be (1) always true or (2) just never false? Look at these tautologies from classical logic:

Possible Truth Values
Inter­pre­tationExcluded Middle
$A \lor \neg A$
Non-Contra­dic­tion
$\neg(A \land \neg A)$
Self-Impli­ca­tion
$A \supset A$
(Classical Logic)$T$$T$$T$
Strong Kleene $K_3$$T,O$$T,O$$T,O$
Łukasiewicz $Ł_3$$T,O$$T,O$$T$

Under the always-true interpretation of validity, none of those sentences are valid in $K_3$, and only self-implication is valid in $Ł_3$. Under the never-false interpretation, all are valid under all interpretations.

The Logic of Paradoxes ($LP$) is a three-valued logic that uses the $K_3$ truth matrices but the never-false interpretation of validity. (When folks talk about $K_3$ as a complete system they assume the always-true interpretation.) $LP$ is an example of a paraconsistent logic, which we’ll turn to now.

Resources on Many-Valued Logics

The SEP and Wikipedia have quite a few articles on this topic. Notable ones include Many-valued Logics, Four-valued logics, The Liar Paradox, and The Logic of Conditionals.

Paraconsistent Logic

Classical logic, and even several non-classical logics, are explosive, meaning that from a contradiction, anything and everything follows (in Latin: ex falso quodlibet, or ECQ), $ \frac{A \quad \neg A}{B}$. Here’s how it is shown in a classical logic:

$ \begin{prooftree} \AxiomC{$A\;\textsf{true}$} \UnaryInfC{$A \lor B\;\textsf{true}$} \AxiomC{$\neg A\;\textsf{true}$} \BinaryInfC{$B\;\textsf{true}$} \end{prooftree} $

A paraconsistent logic is any logic that is nonexplosive. That’s the definition. Contradictions do not collapse everything into triviality. The argument above is invalid in a paraconsistent logic. There are a few real-life situations where adopting paraconsistency is quite useful.

Exercise: Research some.

The big idea in paraconsistent logic is not to abolish contradictions but to contain them so the logic is not explosive. Approaches to doing so include (1) adding new truth values to essentially allow statements that are both true and false, (2) requiring premisses and conclusions to be somehow relevant to each other, and (3) keeping $A$ and $\neg A$ in separate contexts, much like two people arguing different sides of a sentence.

One well-known paraconsistent logic is $LP$ that we saw above. How is this not explosive? It’s because validity here is about falsity avoidance, so both $T$ and $O$ are its designated values (its “truthy values”). So $\frac{A\quad\neg A}{B}$ cannot be a valid argument: take $A$ to have the value $\textsf{other}$ and therefore $\neg A$ also has the value $\textsf{other}$. You cannot derive any $B$ whatsoever, since a false $B$ must never be come from designated premises!

Exercise: Do $K_3$ and $Ł_3$ explode under the always-true interpretation of validity? Why or why not?

The SEP article on Paraconsistent Logic has quite a few examples. Read the article for an in-depth look, or this video for a short introduction:

In a 3-valued logic, you get paraconsistency when the third value has “both true and false” vibes rather than “neither true nor false” vibes. So the natural next question we might ask: what if we had a logic with four values, embracing both and neither?

Catuṣkoṭi

The Catuṣkoṭi is also known as the “Four Corners.” Propositions take on four values :

Find out more at Wikipedia and the SEP.

This 16-minute by Graham Priest is really good:

The Catuṣkoṭi is sometimes pictured as follows in logic, with the left column being True and the bottom row being False:

True and True Only
Neither True nor False
Both True and False
False and False Only

Here’s a modern take on the Catuṣkoṭi. Consider these four possible responses to a person asking you what they think is a yes-no question:

Yes
Mu
Yeah no
(sometimes)
No

Here’s why it works:

Exercise: Read the Aggi-Vacchagotta Sutta. How does the Buddha’s answers to Vacchagotta’s questions on the nature of a Tathāgata’s reappearance after death relate to, or transcend, the Catuṣkoṭi?
Exercise: What are some other meanings of “Yeah No”?
Exercise: Research other forms of four-valued logics, such as Belnap’s four-valued logic (First-Degree Entailment). Make a list of the uses of four-valued logics in computer science, engineering, philosophy, and linguistics.

And don’t miss this article by Graham Priest.

Relevance Logic

Sometimes the principle of explosion pops up because of irrelevant implications, as in these completely true statements of classical logic:

A relevance logic is a paraconsistent logic that rejects the explosion by requires the antecedent and consequent to be related to each other, usually by requiring both to share some common content (like a variable or a predicate), though there are many different ways to encode relevance.

Read about Relevance Logic in the SEP.

Exercise: Write a research paper on relevance logics.

Discussive Logic

A discussive logic is a paraconsistent logic that allows contradictions to exist in separate contexts. It is based on the idea that two people can discuss the same topic and have different opinions about it, and both can be right in their own context. You can consider it a third “family” of paraconsistent logics (the other two being many-valued logics with a “both true and false” option and relevance logics).

We’ll not say much here, but refer you to the SEP.

Non-monotonic Logic

A non-monotonic logic rejects monotonicity. If a logic is monotonic, then adding new information can change the set of known facts, causing previously known truths to become falsehoods. These kind of logics are good for cases where you have to retract previous knowledge when new facts are known, as in:

See the SEP article on non-monotonic logic.

Free Logic

Descriptions can be tricky. What if no object satisfies the description?

Russell regarded $P(\iota x.Ax)$ as an abbreviation for $\exists x.((\forall y.(Ay \equiv y=x)) \land Px)$. But this means the statement is false unless there is a unique object satisfying the description $A$ and that has the property $P$.

A free logic allows the description of terms that do not denote anything. Read about Free Logic in the SEP.

Fuzzy Logic

A fuzzy logic is one in which facts have a numeric truth value between $0$ and $1$, inclusive. It is a generalization of many-valued logics to an infinite number of truth values. It is useful for statements like “$X$ is tall” or “$X$ is an adult” or “The bike is new.” where truth is thought of as a matter of degree.

Do not confuse fuzzy logic with paraconsistent logic.

Do not confuse fuzzy logic with probability theory.

Read about Fuzzy Logic in the SEP.

Exercise: Discuss the colloquial use of the English suffix -ish and its relation to fuzzy logic.

Modal Logic

Modal Logic deals with modalities, which qualify statements somehow. There are many different kinds of modalities, giving rise to different kinds of logics. Each can be based on classical or non-classical logics, and use numeric truth values, too.

See the SEP article on modal logic.

Alethic Logic (Necessity and Possibility)

The basic alethic modal operators are defined as:

FormMeaning
$\Box A$It is necessary that $A$
$\lozenge A$It is possible that $A$

In classical modal logic, the two operators are duals:

Exercise: Express each of the above equivalences in English.

Deontic Logic (Obligation and Permission)

The basic deontic operators are defined as:

FormMeaning
$\mathscr{O}A$It is obligatory that $A$, or $A$ ought to be (MUST)
$\mathscr{P}A$It is permissible that $A$, or $A$ is allowed (MAY)
Exercise: Are these operators duals? Why or why not?
Exercise: Which of the following do you think should be valid in deontic logic: (a) From $\mathscr{O}A$ infer $\mathscr{P}A$, (b) From $\mathscr{O}A$ infer $A$, (c) $\mathscr{O}(\mathscr{O}A \supset A)$.

Epistemic Logic (Knowledge)

In epistemic logic we have:

FormMeaning
$\mathscr{K}_x A$Agent $x$ knows $A$
$\mathscr{K} A$$A$ is known (by all agents or by some agent whose identity we assume from context)
Exercise: Show how the English word “must” can be used in both deontic and epistemic modalities.

Doxastic Logic (Belief)

In doxastic logic we have:

FormMeaning
$\mathscr{B}_x A$Agent $x$ believes $A$
$\mathscr{B} A$$A$ is believed (by all agents or by some agent whose identity we assume from context)

You may sometimes see the epistemic and the doxastic distinguished in the following context. Let $\Gamma = \exists g. G g$, i.e., there exists a $g$ such that $g$ is a god, or “(at least one) god exists.” Then:

Exercise: Consider the two formulae $\neg \mathscr{B}_x\,\Gamma$ and $\mathscr{B}_x\,\neg \Gamma$. Explain what each is saying in English. Would most English speakers be able to tell the difference? Is one statement ”stronger” than the other?

Temporal Logic

Temporal logic deals with the modalities of time.

FormMeaning
$\mathbf{P}A$$A$ was true (at some point) in the Past
$\mathbf{F}A$$A$ will be true (at some point) in the Future
$\mathbf{H}A$$A$ Has always been true
$\mathbf{G}A$$A$ is always Going to be true

Dynamic Logic

Dynamic Logic brings events into the picture:

FormMeaning
$[e]A$“After event $e$, $A$ is necessarily true”
$\langle e \rangle A$“After event e, A is possibly true”
Exercise: In what sense to the formulas above equate with events “causing” things to be true or not?
Temporal vs. Dynamic Logic

Temporal logic [is] the modal logic of choice for reasoning about concurrent systems with its aspects of synchronization, interference, independence, deadlock, livelock, fairness, etc. These concerns of concurrency would appear to be less central to linguistics, philosophy, and artificial intelligence, the areas in which dynamic logic is most often encountered nowadays. — Wikipedia

Formal Logic

In logic we are not so much concerned with the absolute truth or falsity of premises themselves, but rather with the form of arguments. We can deal with “forms” using a formal systems. Formal systems manipulate formulas.

A formal system (or calculus) is a purely syntactic mechanism used to mechanically generate formulas. It consists of a formal language (alphabet and grammar) and a set of inference rules, and operates entirely without regard to meaning or truth.

A logical system, sometimes called a formal logic, pairs a formal system with a semantics (or model). A logical system has both the syntactic machinery of proof ($\vdash$) and the semantic machinery of truth ($\vDash$), which we want to ultimately try to connect.

To define a logical system we need three parts:

Syntax

What the possible formulas are

Semantics

What the formulas mean

Inference Rules

How judgments can be derived from other judgments

In more detail: A syntax gives a rigorous, formal specification of exactly what is and what is not a formula. A semantics assigns truth values to each formula, usually via reference to a model of some sort. We need only describe the semantic mappings—we don’t show how to compute them step-by-step. The inference rules are what we apply algorithmically (i.e., mechanistically, typographically, symbolically) to judgments to derive new judgments. A formula $A$ for which the non-hypothetical judgment $\vdash A\;\textsf{true}$ is so derivable is called a theorem. Inference rule application is purely syntactic: it never consults the semantics!

That last statement is important.

Inference rules operate on judgments mechanistically, independent of their semantic interpretation.

Following are three examples of logical systems.

A Formalization of Classical Propositional Logic

We begin with the syntax:

Syntax of Classical Propositional Logic
  • A variable is $p$, $q$, $r$, or a variable followed by a prime ($'$) symbol. Nothing else is a variable.
  • A formula is $T$, $F$, any variable, or, for any formulas $A$ and $B$, $\neg A$, $(A \land B)$, $(A \lor B)$, $(A \supset B)$, or $(A \equiv B)$. Nothing else is a formula.

This means that, for example:

    p
    (¬(p′′′ ∧ q) ∨ ¬¬p)
    (r ⊃ p′)

are formulas, but

    ¬≡pp∧))′∧¬q∨(F′′

is not. Neither, by the way is

    p ∧ q

since the syntax above requires parentheses around all formulae formed with binary operators. Look again, closely!

Wait, what? Parentheses are...required?

In this formal syntax, yes they are. That said, you are free to write another formal syntax to capture operator precedence if you like, or you can allow for an informal representation of formulas in which precedence is assumed. That’s what we’ll do from now on.

A semantics assigns truth values to each formula. Because variables are permitted, a semantics must to take into account the truth values of variables before computing the truth values of formulas. That is, while we may be able to assign a truth value of false to $p \land \neg p$, the truth value of $p \supset q$ depends on the previously assigned values of $p$ and $q$. We call a mapping of variables to truth values an interpretation and require semantic definitions to be relative to an interpretation. Here is a semantic definition for classical propositional logic:

Semantics of Classical Propositional Logic
  • The meaning of $T$ relative to any interpretation is true.
  • The meaning of $F$ relative to any interpretation is false.
  • The meaning of $p$ relative to interpretation $\phi$ is $\phi(p)$.
  • The meaning of $(\neg A)$ relative to $\phi$ is true if the meaning of $A$ relative to $\phi$ is false; and false otherwise.
  • The meaning of $(A \land B)$ relative to $\phi$ is true if both of the meanings of $A$ relative to $\phi$ and $B$ relative to $\phi$ are true; and false otherwise.
  • The meaning of $(A \lor B)$ relative to $\phi$ is true if either or both of the meanings of $A$ relative to $\phi$ and $B$ relative to $\phi$ are true; and false otherwise.
  • The meaning of $(A \supset B)$ relative to $\phi$ is true if the meaning of $A$ relative to $\phi$ is false or the meaning of $B$ relative to $\phi$ is true, or both; and false otherwise.
  • The meaning of $(A \equiv B)$ relative to $\phi$ is true if the meanings of $A$ relative to $\phi$ and $B$ relative to $\phi$ are both true or both false; and false otherwise.
Don’t mix syntax and semantics

In particular, note that $T$ is a syntactic element, a formula, just a symbol; while true is from the world of semantics.

Exercise: Given the semantics of classical propositional logic, evaluate the meaning of:

$(\neg p \land (r \supset \neg q)) \lor p)$

under an interpretation in which $p$ is mapped to true, $q$ to false, and $r$ to true.

There are quite a few different ways to represent inference rules. There are two styles of presenting them: (1) the Hilbert-style, which does not use any hypothetical judgments and separates axioms from inference rules, and (2) the Gentzen-style, which is all about hypothetical judgments. Gentzen-style is much easier for to understand and work with, and the only one we’ll be using here. Recall that hypothetical judgments are of the form:

$A_1\;\textsf{true}, ..., A_n\;\textsf{true} \vdash B\;\textsf{true}$

but, as mentioned above, since the only kind of judgment we have is that a formula is true, we can drop the $\textsf{true}$ and just write:

$A_1, ..., A_n \vdash B$

and keep in mind that is really a judgment meaning “$B$ given assumptions $A_1, ..., A_n$.” One set of inference rules for classical propositional logic is:

Inference Rules for Classical Propositional Logic
$$ \frac{}{A \vdash A}\;{\tiny \textrm{ASSUME}} $$ $$ \frac{\mathcal{H} \vdash A}{\mathcal{H}, B \vdash A}\;{\tiny \textrm{WEAKEN}} $$ $$ \frac{\mathcal{H}, A, A \vdash B}{\mathcal{H}, A \vdash B}\;{\tiny \textrm{CONTRACT}} $$ $$ \frac{\mathcal{H_1}, A, B, \mathcal{H_2} \vdash C}{\mathcal{H_1}, B, A, \mathcal{H_2} \vdash C}\;{\tiny \textrm{EXCHANGE}} $$ $$ \frac{\mathcal{H_1} \vdash A \quad\;\; \mathcal{H_2}, A \vdash B}{\mathcal{H_1}, \mathcal{H_2} \vdash B}\;{\tiny \textrm{CUT}} $$
$$ \frac{}{ \vdash T }\;{\tiny \textrm{TRUE-INTRO}} $$ $$ \frac{\mathcal{H} \vdash F}{\mathcal{H} \vdash A}\;{\tiny \textrm{FALSE-ELIM}} $$ $$ \frac{\mathcal{H}, A \vdash F}{\mathcal{H} \vdash \neg A}\;{\tiny \textrm{NEG-INTRO}} $$ $$ \frac{\mathcal{H_1} \vdash \neg A \quad\;\; \mathcal{H_2} \vdash A}{\mathcal{H_1}, \mathcal{H_2} \vdash F}\;{\tiny \textrm{NEG-ELIM}} $$ $$ \frac{\mathcal{H_1} \vdash A \quad\;\; \mathcal{H_2} \vdash B}{\mathcal{H_1}, \mathcal{H_2} \vdash A \land B}\;{\tiny \textrm{CONJ-INTRO}} $$ $$ \frac{\mathcal{H} \vdash A \land B}{\mathcal{H} \vdash A}\;{\tiny \textrm{CONJ-ELIM-1}} $$ $$ \frac{\mathcal{H} \vdash A \land B}{\mathcal{H} \vdash B}\;{\tiny \textrm{CONJ-ELIM-2}} $$ $$ \frac{\mathcal{H} \vdash A}{\mathcal{H} \vdash A\lor B}\;{\tiny \textrm{DISJ-INTRO-1}} $$ $$ \frac{\mathcal{H} \vdash B}{\mathcal{H} \vdash A\lor B}\;{\tiny \textrm{DISJ-INTRO-2}} $$ $$ \frac{\mathcal{H_1} \vdash {A \lor B}\quad\mathcal{H_2}, A \vdash C\quad\mathcal{H_3}, B \vdash{C}}{\mathcal{H_1}, \mathcal{H_2}, \mathcal{H_3} \vdash C}\;{\tiny \textrm{DISJ-ELIM}} $$ $$ \frac{\mathcal{H}, A \vdash B}{\mathcal{H} \vdash A \supset B}\;{\tiny \textrm{IMPL-INTRO}} $$ $$ \frac{\mathcal{H_1} \vdash A\supset B \quad\;\; \mathcal{H_2} \vdash A}{\mathcal{H_1}, \mathcal{H_2} \vdash B}\;{\tiny \textrm{IMPL-ELIM}} $$ $$ \frac{\mathcal{H_1} \vdash A \supset B \quad\;\; \mathcal{H_2} \vdash B \supset A }{\mathcal{H_1}, \mathcal{H_2} \vdash A \equiv B}\;{\tiny \textrm{EQUIV-INTRO}} $$ $$ \frac{\mathcal{H} \vdash A \equiv B}{\mathcal{H} \vdash (A\supset B) \land (B\supset A)}\;{\tiny \textrm{EQUIV-ELIM}} $$ $$ \frac{\mathcal{H}, \neg A\,\vdash\,F}{\mathcal{H}\,\vdash\,A}\;{\tiny \textrm{INDIRECT-PROOF}} $$
Latin Names

Let’s get classically educated! Impress your friends with these Latin terms:

  • $T$ = Verum (sometimes written $\top$)
  • $F$ = Falsum (sometimes written $\bot$)
  • IMPL-ELIM = Modus Ponens (MP)
  • NEG-INTRO = Reductio ad absurdum (RAA)
  • FALSE-ELIM = Ex falso quodlibet (EFQ)

Also not Latin, but worth knowing: IMPL-INTRO is also called “Conditional Proof” (which kind of mirrors the funny name “Indirect Proof”)

If $\mathcal{H}$ is empty in $\mathcal{H} \vdash A$, we say $A$ is a theorem and write $\vdash A$. The sequence of inferences producing a theorem is a proof of that theorem. The goal is to get to something that does not rely on any assumptions. The theorems of a formal logic are exactly those formulas we can reach through the rules.

Example: The following is a proof of the theorem $((p \land (p \supset q)) \supset q$:
$\begin{prooftree} \AxiomC{} \RightLabel{$\;\tiny{\textrm{ASSUME}}$} \UnaryInfC{$p \land (p \supset q) \vdash p \land (p \supset q)$} \RightLabel{$\;\tiny{\textrm{CONJ-ELIM-2}}$} \UnaryInfC{$p \land (p \supset q) \vdash p \supset q$} \AxiomC{} \RightLabel{$\;\tiny{\textrm{ASSUME}}$} \UnaryInfC{$p \land (p \supset q) \vdash p \land (p \supset q)$} \RightLabel{$\;\tiny{\textrm{CONJ-ELIM-1}}$} \UnaryInfC{$p \land (p \supset q) \vdash p$} \RightLabel{$\;\tiny{\textrm{IMPL-ELIM}}$} \BinaryInfC{$p \land (p \supset q) \vdash q$} \RightLabel{$\;\tiny{\textrm{IMPL-INTRO}}$} \UnaryInfC{$\vdash (p \land (p \supset q)) \supset q$} \end{prooftree} $

Finding proofs is a bit of an art form when humans do it themselves, but a very worthy endeavour to undertake to sharpen your logic skills! For complex tasks, computer programs called mechanical proof assistants or automatic theorem provers exist. These programs can systematically apply inference rules to derive theorems. The good ones are really efficient at finding the proofs, that is, they do much better than a brute-force search through all possible inferences. As with AI coding tools, you can run proofs with the human-in-charge, program helps mode; or give the prover full automation permission.

To find proofs on your own, a graphical technique, such as Fitch-style Natural Deduction is powerful. Watch Attic Philosophy’s video #11, video #12, and video #72 in the Logic playlist for a great tutorial on doing proofs with this technique. It works for propositional and first-order logic. Some automated theorem provers use this mechanism internally as well!

You can find additional information on this technique at Wikipedia and Stanford Encyclopedia of Philosophy. We’ll offer just a simple example, a proof of the theorem $\vdash p \land (p \supset q) \supset (p \land q)$:

$\;p \land (p \supset q)$
$\;p$
$\;p \supset q$
$\;q$
$\;p \land q$
$(p \land (p \supset q)) \supset (p \land q)$
Exercise: Watch the Attic Philosophy videos, then give proofs of the following theorems in the Fitch sytle:
  • $\neg F$
  • $(p \supset (q \supset p))$
  • $(p \lor \neg p)$
  • $((p \supset q) \equiv (\neg p \lor q))$
  • $((p \equiv q) \supset ((p \land q) \lor (\neg p \land \neg q)))$
  • $((p \land \neg p) \supset q)$
  • $((p \lor (q \land r)) \supset (p \lor q))$
Derived Rules

The set of inference rules defining a logical system can be extended with derived rules which are those that can be proven using the existing rules. These make things much more convenient for a human doing proofs (if you’re a programmer, think of writing new procedures and functions).

Examples of derived rules that you can prove for classical propositional logic include modus tollens (MT), disjunctive syllogism, the “law” of excluded middle (EM), and double negation elimination (DNE) and a few others:
$$ \frac{\mathcal{H} \vdash A \supset B \quad\;\; \mathcal{H} \vdash \neg B}{\mathcal{H} \vdash \neg A}\;{\tiny \textrm{MT}} $$ $$ \frac{\mathcal{H} \vdash \neg\neg A}{\mathcal{H} \vdash A}\;{\tiny \textrm{DNE}} $$ $$ \frac{}{\mathcal{H} \vdash A \lor \neg A}\;{\tiny \textrm{EM}} $$ $$ \frac{\mathcal{H} \vdash A \lor B \quad\;\; \mathcal{H} \vdash \neg A}{\mathcal{H} \vdash B}\;{\tiny \textrm{DISJ-SYLL}} $$ $$ \frac{\mathcal{H} \vdash A \supset B \quad\;\; \mathcal{H} \vdash B \supset C}{\mathcal{H} \vdash A \supset C}\;{\tiny \textrm{IMPL-TRANS}} $$ $$ \frac{\mathcal{H}\vdash A \land B \supset C}{\mathcal{H}\vdash A \supset (B \supset C)}\;{\tiny \textrm{CURRY}} $$ $$ \frac{\mathcal{H}\vdash A \supset (B \supset C)}{\mathcal{H}\vdash A \land B \supset C}\;{\tiny \textrm{UNCURRY}} $$

Here is how we derive modus tollens:

$\begin{prooftree} \AxiomC{$\mathcal{H} \vdash A \supset B$} \RightLabel{$\;\tiny{\textrm{WEAKEN}}$} \UnaryInfC{$\mathcal{H}, A \vdash A \supset B$} \AxiomC{} \RightLabel{$\;\tiny{\textrm{ASSUME}}$} \UnaryInfC{$\mathcal{H}, A \vdash A$} \RightLabel{$\;\tiny{\textrm{IMPL-ELIM}}$} \BinaryInfC{$\mathcal{H}, A \vdash B$} \AxiomC{$\mathcal{H} \vdash \neg B$} \RightLabel{$\;\tiny{\textrm{WEAKEN}}$} \UnaryInfC{$\mathcal{H}, A \vdash \neg B$} \RightLabel{$\;\tiny{\textrm{NEG-ELIM}}$} \BinaryInfC{$\mathcal{H}, A \vdash F$} \RightLabel{$\;\tiny{\textrm{NEG-INTRO}}$} \UnaryInfC{$\mathcal{H} \vdash \neg A$} \end{prooftree}$
CLASSWORK
We are going to show exactly how to derive the other derived rules.
Yet another reminder: theoremhood is syntactic, not semantic

Theorems are statements that can be derived using the rules of inference, regardless of their truth in any particular model. Proving a theorem is mechanical and syntactic. Truth comes from the semantics. Proof and truth are distinct concepts. We will connect them in our section on metalogic, below.

Formalizing Intuitionistic Propositional Logic

Surprise: you get Intuitionistic Propositional Logic by taking Classical Propositional Logic and simply removing the inference rule INDIRECT-PROOF.

That’s it!

That one simple change is all you need. It makes it impossible to derive excluded middle and double negation elimination and other rules that intuitionists do not accept. It’s rather interesting to show that for most of the classical rules that don’t exist in intuitionistic logic (those that require indirect proof to show), there is a corresponding rule that is intuitionistically (and classically) valid:

Classical ONLYWorks in Intuitionistic also
(EM)  $\dfrac{}{A \lor \neg A}$ (NC)  $\dfrac{}{A \land \neg A}$
(DNE)  $\dfrac{\neg \neg A}{A}$ (DNI)  $\dfrac{\neg A}{\neg \neg A}$
(IMP-TO-DISJ)  $\dfrac{\neg A \supset B}{A \lor B}$   $\dfrac{A \supset B}{\neg A \lor B}$ (DISJ-TO-IMP)  $\dfrac{A \lor B}{\neg A \supset B}$   $\dfrac{\neg A \lor B}{A \supset B}$
(DeMORGAN-NAND)  $\dfrac{\neg (A \land B)}{\neg A \lor \neg B}$ (DeMORGAN-NOR)  $\dfrac{\neg (A \lor B)}{\neg A \land \neg B}$
(CONTRAPOS-NEG-ELIM)  $\dfrac{\neg B \supset \neg A}{A \supset B}$ (CONTRAPOS-NEG-INTRO)  $\dfrac{A \supset B}{\neg B \supset \neg A}$
Exercise: Watch and study the Attic Philosophy video on Natural Deduction in Intuitionistic Logic.
Exercise: Prove Peirce’s Law, $((A \supset B) \supset A) \supset A$, in classical propositional logic. Then show that it is not provable in intuitionistic propositional logic.
Exercise: Is intuitionistic logic, as defined here, explosive?

Formalizing Classical First-Order Logic

Starting with the syntax:

Syntax of Classical First-Order Logic
  • A constant is exclusively $a$, $b$, $c$, etc. or a constant followed by a $'$. A function symbol is exclusively $f$, $g$, $h$, etc. or a function symbol followed by a $'$.
  • A variable is exclusively $x$, $y$, $z$, or a variable followed by a prime ($'$) symbol.
  • A term is exclusively a variable, a constant, or $f(t_1, \ldots t_n)$ for function symbol $f$ and terms $t_i$.
  • A formula is exclusively $T$, $F$, or, for any variable $v$ and formulas $A$ and $B$, $\neg A$, $(A \land B)$, $(A \lor B)$, $(A \supset B)$, $(A \equiv B)$, $(\exists v.A)$, or $(\forall v.A)$.

Parentheses can be removed as long as precedence is respected.

The semantics for first-order logic is significantly more involved than for propositional logic (it requires a domain of discourse and an interpretation of constants and function symbols as objects/functions over that domain), so we’ll leave those details for later.

However, the inference rules are a modest, concise extension of what we’ve already seen.

Inference Rules for Classical First-Order Logic
All inference rules for classical propositional logic, plus:
$$ \frac{\mathcal{H} \vdash A[x \mapsto y]}{\mathcal{H} \vdash \forall x. A}\;{\tiny \textrm{FORALL-INTRO}\;(y\;\textrm{not free in}\;\mathcal{H}\;\textrm{or}\;\forall x. A)} $$ $$ \frac{\mathcal{H} \vdash \forall x. A}{\mathcal{H} \vdash A[x \mapsto t]}\;{\tiny \textrm{FORALL-ELIM}\;(t\;\textrm{free for}\;x\;\textrm{in}\;A)} $$ $$ \frac{\mathcal{H} \vdash A[x \mapsto t]}{\mathcal{H} \vdash \exists x. A}\;{\tiny \textrm{EXISTS-INTRO}\;(t\;\textrm{free for}\;x\;\textrm{in}\;A)} $$ $$ \frac{\mathcal{H} \vdash \exists x. A \quad\;\; \mathcal{H},\,A[x \mapsto y] \vdash C}{\mathcal{H} \vdash C}\;{\tiny \textrm{EXISTS-ELIM}\;(y\;\textrm{not free in}\;\mathcal{H},\;C,\;\textrm{or}\;\exists x. A)} $$
Exercise: Show that each of the side provisos are necessary. Hint: show how a rule could produce an invalid inference if the proviso were not present.

For the history of how first-order logic came to be the workhorse of mathematics and semantics, see this really cool SEP article.

Formalizing Higher-Order Logic

There are many higher-order logics, each with different features and expressive power. In most of these systems, the core idea is that every term has a type, and so higher order logics are sometimes called type theories. We’ll therefore defer discussion of these logics to our notes on Type Theory.

Formalizing Modal Logics

For alethic modal logic, which add the operators $\Box$ and $\lozenge$ to predicate logic, there are quite a few versions, based on the axioms and inference rules they add to the underlying logic. Here are some examples:

Exercise: Do you think that from $\Box A$ you should be allowed to infer $\lozenge A$? Why or why not?
Exercise: Do some research to learn how the semantics of alethic logic formulas are defined.

Properties of Formulae

We’re interested ultimately in valid reasoning—what follows from what—so let’s define some terms:

Satisfiability
If formula $A$ is true under some interpretation $\varphi$ we write $\vDash_{\varphi}A$ and say $\varphi$ satisfies $A$, or that $A$ is satisfiable.
Validity
If formula $A$ is true under all allowable interpretations we write $\vDash A$ and say $A$ is a tautology, or that $A$ is valid.
Entailment
If formula $A$ is true under all allowable interpretations in which formula $B$ is true, we write $B \vDash A$ and say $B$ entails $A$. Entailment is central to reasoning; if our knowledge base contains $B$ and we know that $B$ entails $A$, we know, then, that $A$ is true. Entailment is a purely semantic relation; the syntactic, proof-theoretic analogue $B \vdash A$ is called derivability.

validandsatisfiable.png

By allowable interpretations we mean the interpretations that are permitted by the rules and constraints of the logical system we are working within.

Exercise: Prove the following:
  • If a formula is valid, then it is satisfiable
  • If a formula is unsatisfiable, then it is invalid
  • In classical propositional logic, $A$ is valid iff $\neg A$ is unsatisfiable
  • In classical propositional logic, $A$ is invalid iff $\neg A$ is satisfiable
  • In classical propositional logic, satisfiability and validity are duals

In practice, you might hear people use the term “valid” rather loosely, but try to keep in mind the exact definition of this term.

Exercise: Distinguish the terms valid and true.

More terms! A formula is a:

Metalogic

The definition of truth in a system is generally just stated in precise natural language, or with semantic functions (as in our example above). The derivation of theorems, however, is a purely mechanical process. We would like to know how well, in a logistic system, theorem derivation (proof) correlates with truth (keeping in mind the notion of truth varies between systems).

Soundness
A system is sound iff every theorem is valid, e.g., if $\vdash A$ then $\vDash A$.
Completeness
A system is complete iff every valid formula is a theorem, e.g., if $\vDash A$ then $\vdash A$.
Consistency
A system is consistent iff not every formula is a theorem. (This is known as Post-consistency, named after the logician Emil Post. Another definition, known as semantic consistency, requires that there exists at least one allowable interpretation under which all theorems are simultaneously true. These notions coincide for many mainstream logical systems.)
Decidability
A system is decidable iff there exists an (always-terminating) algorithm to determine whether or not a given formula is a theorem.
Exercise: What are the ramifications of a logistic system that is unsound? That is incomplete? That is inconsistent? That is undecidable?
Exercise: Ponder the definition of consistency for a minute or two or three. Then comment on the usefulness of a system in which everything you could possibly utter were a theorem.
Exercise: Suppose that you had a classical, bivalent logistic system powerful enough to express statements about the provability of its own formulas, for example, “This formula is not provable” or equivalently “I am not provable.” Show that such a system, if consistent, must be incomplete, and if complete, must be inconsistent.

The reasoning about logistic systems themselves is called metalogic.

Recall Practice

Here are some questions useful for your spaced repetition learning. Many of the answers are not found on this page. Some will have popped up in lecture. Others will require you to do your own research.

  1. Logic is the study of ________________.
    reasoning
  2. What is the difference between deduction and induction? In particular how are they in some sense opposites of each other?
    Deduction goes from the general to the specific (and hence always gives a valid conclusion when the premises are true); induction goes from the specific to the general (and is therefore not guaranteed to give you a valid conclusion).
  3. What is abduction?
    Drawing conclusions from strong evidence.
  4. What is the difference between $=$ and $\equiv$?
    $x = y$ means that $x$ and $y$ refer to the same object, while $A \equiv B$ means that the two formulas $A$ and $B$ have the same truth value.
  5. What is an equivalent formula of $A \supset B$, in terms of $\lor$?
    $\neg A \lor B$
  6. What is an equivalent formula of $A \supset B$, in terms of $\land$?
    $\neg (A \land \neg B)$
  7. Describe two ways to represent the object “The president of Mexico” in common logic notation, one with the description operator and the other with a function.
    $\iota p. P m p$, where $m$ is Mexico and $Pxy$ means “the president of $x$ is $y$.”

    $pm$ where $p$ is the function “president of” and $m$ is Mexico.
  8. How do you represent the formula “Juliet once believed that Romeo might someday forever live in Canada”?
    $\mathbf{P}(\mathscr{B}_j\lozenge\mathbf{F}\mathbf{G}(Lrc))$, where $j$ is Juliet, $r$ is Romeo, $c$ is Canada, and $Lxy$ means $x$ lives in $y$.
  9. Give the formula $A \lor B \land C \equiv D \supset E$ in its fully-parenthesized form.
    $((A \lor (B \land C)) \equiv (D \supset E))$
  10. Give the formula $A \land \forall x. Px \supset \neg Qxy$ in its fully-parenthesized form.
    $(A \land (\forall x. (Px \supset \neg Qxy)))$
  11. How to we diagram the inference that judgment $C$ follows from $A$ and $B$?
    $\dfrac{A \;\;\;\; B}{C}$
  12. What’s the difference between a formula and a judgment?
    A formula is a piece of syntax; it asserts nothing on its own. A judgment is an act of assertion — a claim about a formula (or other object), such as that it is true.
  13. What is the primary judgment used in pure logic, and how is it written?
    $A\;\textsf{true}$, read “$A$ is true.”
  14. What is the symbol $\vdash$ called?
    Turnstile.
  15. What does it mean for an argument to be valid?
    Every judgment in the sequence is either a hypothesis or follows from earlier judgments by a rule of inference.
  16. What is a bivalent logic?
    A logic in which every formula has one of two truth values (generally $T$ or $F$).
  17. What is a proposition?
    A predicate of zero arguments. As such, it can be considered a formula on its own, and importantly, it is atomic (nondecomposable).
  18. What is propositional logic good for, if anything?
    It is too weak to be useful for much really, but its simplicity (1) makes it a good introductory logic for learners, and (2) is an example of a system that is both sound and complete.
  19. What is the study of syllogisms relegated to these days?
    The history of logic, since first-order predicate logic encompasses all syllogistic forms and much more.
  20. The principle of mathematical induction is an formula of ________________-order predicate logic.
    Second
  21. What characterizes classical logic? Try to list all six features.
    (1) Bivalence, (2) excluded middle, (3) non-contradiction, (4) monotonicity of entailment, (5) commutativity of conjunction, (6) dualities of conjunction/disjunction and of universal/existential quantification.
  22. What is intuitionistic logic most concerned with?
    Proof, rather than truth.
  23. What does paraconsistent logic study?
    Logics that can handle contradictions without collapsing into triviality.
  24. What is the difference between paraconsistent logic and relevance logic?
    Relevance logic is a kind of paraconsistent logic that prevents explosion by ensuring that the premises are relevant to the conclusion.
  25. Why is paraconsistent logic interesting?
    Humans seem to get by just fine with contradictions.
  26. What are the four corners of the Catuṣkoṭi?
    Being, Not Being, Being and Not Being, Neither Being nor Not Being.
  27. What is a free logic and why might a computer scientist care?
    A free logic is one that does not require that all terms refer to objects. Computer scientists may find ways to deal with that horrible null thing.
  28. How is fuzzy logic different from probability theory?
    Fuzzy logic deals with degrees of truth, while probability theory deals with likelihoods.
  29. What is an alethic logic concerned with and what are its basic operators?
    Alethic logic is concerned with necessity and possibility. Its basic operators are $\Box$ and $\lozenge$.
  30. What is a deontic logic concerned with and what are its basic operators?
    Deontic logic is concerned with obligation and permission. Its basic operators are $\mathscr{O}$ and $\mathscr{P}$.
  31. What is an epistemic logic concerned with and what are its basic operators?
    Epistemic logic is concerned with knowledge. Its basic operators are $\mathscr{K}$ and $\mathscr{K}_x$.
  32. What is a doxastic logic concerned with and what are its basic operators?
    Doxastic logic is concerned with belief. Its basic operators are $\mathscr{B}$ and $\mathscr{B}_x$.
  33. In dynamic logic, how do we denote that after event $e$ occurs, $A$ must be true? How do we denote that after $e$ occurs, $A$ might be true?
    We write $[e]A$ and $\langle e \rangle A$ respectively.
  34. What are the three parts of a definition of a formal logical system?
    Syntax, semantics, inference rules.
  35. What is an interpretation in formal logic, and why are they needed?
    An interpretation is a mapping of variables to truth values. They are needed because the truth value of a formula depends on the truth values of its variables.
  36. What do we call a formula $A$ for which $\vdash A$ holds?
    A theorem.
  37. What do we call a formula $A$ for which $\vDash A$ holds?
    A tautology (or a valid formula.)
  38. How are validity and satisfiability related?
    If something is valid then it is satisfiable, but not the other way around. (Similarly, if something is unsatisfiable, then it is invalid, but not the other way around.)
  39. Give an example of a valid statement of (classical) prepositional logic.
    $p \lor \neg p$
  40. Give an example of a invalid statement of (classical) prepositional logic.
    $p \land \neg p$
  41. Give an example of a satisfiable statement of (classical) prepositional logic that is neither valid nor invalid.
    $p \supset \neg p$
  42. What is a tautology? A contingency? A contradiction?
    A tautology is a formula that is valid (true under all interpretations). A contingency is a formula that is true under some but not all interpretations. A contradiction is a formula that is unsatisfiable (true under no interpretations).
  43. What is a theorem in formal logic?
    A formula that is an axiom or that is derived from axioms via inference rules.
  44. What does it mean for a logical system to be sound?
    Every theorem is true.
  45. What does it mean for a logical system to be complete?
    Every true formula is a theorem.
  46. What does it mean for a logical system to be consistent?
    Post-consistency is: There exists a formula that is not a theorem. (There are other kinds of consistencies, but the high-level intent is that two theorems have contradictory truth values.)
  47. What does it mean for a logical system to be decidable?
    There exists an algorithm (always-terminating effective procedure) to determine whether a given formula is a theorem.
  48. What do we call the field that studies properties of logical systems, such as soundness, completeness, consistency, and decidability?
    Metalogic.

Summary

We’ve covered:

  • What logic is concerned with
  • Common logic symbols
  • Many kinds of logics
  • Formal Logic
  • Axioms, Theorems, and Inference Rules
  • Metalogic (soundness, consistency, completeness, decidability)