User:Addemf/sandbox/Scientific Reasoning for Non-scientists/Propositional Logic

Now that we've seen the basic idea of abstraction and symbolization, we build a formal system around the idea.

To begin with, because it is simpler, we focus for now on logic at the level of propositions — so-called "propositional logic". This means that we do not focus on the quantifiers from the previous lesson, but we do focus on the operators like $$\land,\lor,\neg,\to$$.



The most important theme throughout this lesson, is the relationship between syntax and semantics.

Syntax is the "dead", mechanical, "calculational" system of writing some symbols followed (according to a formal rule) by certain other symbols. To take one example, everything that a computer does is syntactic.

Semantics is the study of the meaning, which gives those dead symbols life, so to speak. A computer might display symbols, simply because it was programmed to do so. But it is the human mind, reading those symbols, which gives the symbols their meaning.

Syntax
Because our current interest is in propositions, we will no longer write expressions like P(x, y, z) as we did in the previous lesson, since we will have nothing to say about the objects x, y, and z. We will return to object variables when we get to the lessons on "first-order logic".

We will instead use propositional variables, like


 * P, Q, R, ...,

usually denoted by capital italics Roman letters.

From a syntactic point of view, these will be the basic "building blocks" or "atoms" which build up to more complex expressions.

Semantics
The formal definition of exactly what a propositional variable is, would probably be too technical and cause more confusion than insight at this point. Therefore let us just rely on the intuition that a propositional variable is an abstraction of any proposition.

Propositions may be true or false.

Moreover, they must be precisely one of these two options.

Therefore the abstraction of a proposition, is essentially the fact that it may be true or false.

We represent this fact in a so-called "truth table", like so.

The top row shows a propositional variable, and below it, the possible "truth-values" that it could take. These are true and false, annotated as "T" and "F" respectively.

At this moment, that might seem like a needlessly elaborate display of a simple idea. However, things are about to get complicated soon, and it will be valuable to have tables to organize our information.

Caveats
Note that the semantics we are giving here are the semantics of mathematics, but they are not exactly the same as the semantics of everyday speech.

For one thing, the semantics of everyday speech includes much more than propositions.

But also, there are some philosophical disputes about exactly what the semantics of statements are. One could make nonsensical statements, like "green is round", which seems not just false but meaningless. In general, | category mistakes of all kinds often seem neither true nor false but meaningless.

Another example is "the present king of France is bald." There is (as of writing this) no present kind of France. Some philosophers argue that this sentence is technically false (see | the theory of descriptions), but many philosophers and linguists reject this analysis. However, there is no consensus on how to regard such a sentence.

One could go on, but let's not get distracted. Just be aware that the semantics presented here are those used in mathematical settings, and that is a very useful setting for analyzing a wide range of real-world phenomena. But these semantics are narrowly limited.

Syntax
The negation of a propositional variable, like P, is written as $$\neg P$$.

Notice that although P is a propositional variable, $$\neg P$$ is not. Rather, it is an example of what we will eventually call a propositional formula. We are not yet in a position to define this phrase exactly; but toward the end of this lesson, we will.

A propositional formula is essentially just anything that is built from propositional variables using propositional operators (negation, conjunction, disjunction, and conditional).

Moreover, notice that we may negate any propositional formula, not just variables. Therefore


 * $$\neg (\neg P)$$

and
 * $$\neg(\neg(\neg P))$$

are propositional formulas too.

Note the use of parentheses, which will become increasingly important as the complexity of propositional formulas grows. We may write $$(\neg P)$$ if we wanted to, or $$(\neg(\neg P))$$. But we also allow ourselves to omit the outer-most parentheses.

Semantics
The semantics of negation is to switch true to false, and false to true.

Therefore we write the truth table of negation like so

One often wants to juxtapose this, with the truth-table from which the negated values were derived, to help see what happened here.

Therefore we prefer to write the truth-table instead like so.

The left-most column simply records the original arrangement of Ts and Fs.

To the right of the vertical blue separator, we make a column for each symbol. These are the negation and variable.

Under the variable, we simply transcribe the original values.

Under the negation, we compute the new values. These values are special because they are the "final" or "main" values, which are the actual value that $$\neg P$$ takes, for each given value of P.

Here is the truth-table for $$\neg(\neg P)$$.

Be sure to note in which column the main values are recorded. These are in the second column, under the outer-most $$\neg$$.

Draw the truth-table for $$\neg(\neg(\neg P))$$.

We say that two propositional formulas are "equivalent" if they have the same truth-table.

Because we haven't yet, and cannot yet, state the definition of "propositional formula" then we won't yet try to state a formal definition of "equivalent formulas".

However, even at this intuitive and pre-formal stage of explanation, it should be clear that P and $$\neg(\neg P)$$ are equivalent formulas. This is because the "main" column of the truth-table for each, is

What formula is equivalent to $$\neg P$$?

Syntax
For any two propositional variables, say P and Q, their conjunction is $$P\land Q$$.

Again note the importance of parentheses when formulas become complex. Without parentheses


 * $$\neg P\land Q$$

has two equally valid readings. Either


 * $$\neg(P\land Q)$$

or


 * $$(\neg P)\land Q$$

This concern is even more serious than the one that we pointed out for negation. Here, one cannot reasonably guess the intended formula if it is un-parenthesized.

Moreover, we will see in the section on syntax, that the two formulas have different meaning. So it is quite important that we distinguish between them.

Semantics
The semantics of conjunction is that the conjunction should be true when both conjuncts are true, and false otherwise. This is given in the truth-table below.

Notice the need for four rows now, because there are two variables, each of which could be T or F. Therefore the full set of possibilities for the pair of variables, P and Q, are: TT, TF, FT, or FF.

In general, every time there is an extra variable, the number of rows doubles. Therefore, if a table requires three variables then its table requires $$2\cdot 4 = 8$$ rows.

Complete the following list of all triples of truth-values for three variables.

The list is generated by starting from TTT.

Then take the right-most truth-value and flip it. If that value was T then we have the subsequent row.

If that value was F then proceed left to the next value and repeat the process.

TTT

TTF

TFT

TFF

FTT

[row 6: What goes here?]

[row 7: What goes here?]

FFF

How many rows are in a truth-table for four variables?

List the first eight rows, using the algorithm of the previous exercise.

As an exercise in reading the truth-table for conjunction, check that you understand:

When P is F and Q is T then $$P\land Q$$ is F. Of course "P is F" is an abbreviation of "P is false".

We may summarize this by writing $$F\land T = F$$. Similarly we may summarize the first row of the truth-table by writing $$T\land T=T$$, and so on.

Use the previous problem, Double negation equivalence, to prove that $$P\land Q$$ is equivalent to $$Q\land P$$.

(This is fact is called the "commutativity" of conjunction.)

Here I will produce the truth-table for $$(\neg P)\land Q$$, and show you the sequence by which I populate it with values.

First, draw the basic table and copy the values from the left two columns over to any variables.

''Step 1. Transcribe.''

Next, compute the first available operator's column. In this case, we cannot compute the $$\land$$ but we can compute the $$\neg$$, so we start here.

Values are bolded to indicate that they are the values from which the new values are computed, using the negation rule.

''Step 2. Column 3''

Next, use the values under the negation and under Q to compute $$\land$$. Note again the bolded values to see how the values under $$\land$$ were computed.

''Step 3. Column 5''

Note that this last column, column 5, is the "final" value for the proposition.

In the presentation above, we computed entire columns all at once. This can be nice because it is fast.

However, because this can be confusing, let's just take one row and focus on its computation. Selecting somewhat randomly, let's focus on the second row.

To summarize how this row was computed,

1. We transcribe the values for P and Q from the left of the blue separator to the right.

2. Because of the parentheses, we first compute the negation. It reads the T in the fourth column (under P) and results in F in the third column.

3. Next we compute the conjunction, reading F on the left and T on the right. According to the rule for conjunction, this evaluates to F.

Draw the truth-table for $$\neg(P\land Q)$$.

Identify a final value in its truth-table, which does not match one of the final values for the truth-table of $$(\neg P)\land Q$$.

Conclude that $$\neg(P\land Q)$$ and $$(\neg P)\land Q$$ have different semantics.

Show that $$P\land (Q\land R)$$ is equivalent to $$(P\land Q)\land R$$. This fact is called the "associativity" of conjunction.

Use this fact, without computing any more truth-tables, to argue that $$P\land (Q\land (R\land S))$$ is equivalent to $$(P\land Q)\land(R\land S)$$.

The associativity of conjunction, shown in the exercise above, demonstrates that a sentence does not need parentheses when it is formed only from conjunction. That is because we might interpret


 * $$P\land Q\land R$$

as either $$(P\land Q)\land R$$ or $$P\land (Q\land R)$$. But because these are equivalent, then it is not important which one we mean when we write the un-parenthesized version.

Therefore we will write $$P\land Q\land R$$ without additional parentheses. Likewise we may write $$P\land Q\land R\land S$$ without parentheses, because any way of parenthesizing it will always be equivalent to every other way.

And so on, we may omit parentheses when a sentence is constructed only from conjunction, with any number of variables.

Syntax
The syntax for disjunction is almost identical to that of conjunction.

For "P or Q" we write $$P\lor Q$$.

Semantics
The semantics of disjunction, are that the disjunction is true when one or the other disjunct is true. This is reflected in the truth-table

Note that a somewhat simpler rule to remember is that $$P\lor Q$$ is F when both disjuncts are F. Otherwise it is T.

Show that $$\neg(P\lor Q)$$ and $$(\neg P)\lor Q$$ are not equivalent.

The proof should very similar to that given for conjunction and negation, earlier.

Decide whether parentheses are needed for a sentence constructed only from the disjunction operator.

The answer should be decided in a process nearly identical to the one above for conjunction.

Investigate whether $$P\land (Q\lor R)$$ is equivalent to $$(P\land Q)\lor R$$.

Use this to decide whether parentheses are needed for propositions constructed only from conjunction and disjunction.

The logical law of De Morgan's states that


 * $$\neg(P\land Q) \equiv (\neg P)\lor (\neg Q)$$

and
 * $$\neg(P\lor Q) \equiv (\neg P)\land (\neg Q)$$

This shows an important relationship between these three operators, $$\neg, \land,\lor$$.

Prove both of these claims of equivalence.

Consider the sentence
 * "2 is not odd and prime."

Part 1.

Is this sentence true?

Part 2.

Consider the sentence's abstraction


 * "t is not $$O(t)$$ and $$P(t)$$."

Which symbolization seems most correct for the intended meaning of the original sentence? Either


 * $$(\neg O(t)) \land P(t)$$

or
 * $$\neg(O(t)\land P(t))$$

?

Hint: There is a subtle difference between what is communicated by the sentence "2 is not odd and prime" and the sentence "2 is not odd and is prime". It is precisely the difference between the two symbolizations.

Syntax
The conditional symbol is $$\to$$, a binary operator. Therefore the syntax for the conditional "if P then Q" is


 * $$ P\to Q$$

Semantics
The semantics of the conditional are given by the truth-table

A simple way to describe this is: The conditional is true when the antecedent is false, or the consequent is true.

Why would this be the semantics of the conditional? For negation, conjunction, and disjunction, the reasons for the semantics are probably close to self-evident. But this rule for the conditional may seem not to obviously match what we think of when we think "If P then Q."

The important idea that we mean to capture in the semantics of the conditional, is the "flow of truth" from the antecedent (P) to the consequent (Q).

Notice that, in this table, P is true on the first two rows. Where Q is true (row 1), we say that the conditional is true. This is because, apparently, in a sense the truth of P successfully flowed to Q.

On the other hand, where P is true and Q is false (row 2), it seems that the flow of truth from P to Q was unsuccessful. Therefore the conditional is marked false here.

But what about the rows at which P is false (rows 3 and 4)? Well, since P is not true then we don't require truth to "flow" toward Q in this scenario. In this case, Q may be true or false, independent of P, and still the conditional should be true.

Consider the sentence "If a natural number is divisible by 4 then it's divisible by 2." This is a true sentence.

Now consider the instance in which the number is 3. The sentence, specialized for this instance, would be "If 3 is divisible by 4 then it is divisible by 2." This should still be a true sentence, because 3 is not divisible by 4. In cases where the antecedent is false, we still recognize the conditional as true.

Part 1.

Show that $$P\to Q$$ is equivalent to $$(\neg P)\lor Q$$ and also equivalent to $$(\neg Q)\to (\neg P)$$.

Part 2.

Show that $$P\to Q$$ is not equivalent to $$Q\to P$$.

Part 3.

Decide whether $$P\to (Q\to R)$$ is equivalent to $$(P\to Q)\to R$$.

Part 4.

Decide whether $$P \to Q$$ is equivalent to $$(\neg P)\to(\neg Q)$$.

Part 5.

Draw the truth-table for $$(P\to Q)\land (Q\to P)$$.

Argue that if the formula above is true then P and Q must have the same truth-value.

An Emphatic Caveat
The semantics that we give here for the conditional are, as I've also said at the beginning, the semantics of the conditional in mathematical settings.

It is especially important not to confuse the semantics for this mathematical conditional, with the semantics of every kind of conditional sentence. The conditional given by the truth-table is called the | material conditional.

Some conditional sentences expression causation, like
 * "If you put a magnet next to iron, then there will be an attractive force between them."

This kind of conditional sentence very much does not have the semantics given by the truth-table above.

There are also counter-factual conditionals, like
 * "If Franz Ferdinand hadn't been killed Europe wouldn't have gone to war."

Again, the semantics of such a sentence are not at all like the semantics of the truth-table.

Later in this course we will discuss causation further, although we will not discuss counter-factuals. To see a wide-ranging discussion of the semantics of conditionals, one could consult A Philosophical Guide to Conditionals by Bennett.

Propositional Formulas
Now that we can talk about all of the symbols of propositional logic, we are in a position to define the precise definition of a propositional formula. By now the intuitive idea should already be clear.

Set $$\mathcal F_0=\{P, Q\}$$.

Compute $$\neg \mathcal F_0$$ and $$\mathcal F_1$$.

Then repeat the exercise if $$\mathcal F_0 = \{P\}$$.