Mathematics, Coding and Science Education

2.1 Logic

Helpful Tools for Calculus, Chapter 2: Helpful Tools for the Mathematics of Calculus

Foundations and English

Logic is a very broad topic deserving of its own text. Here we will discuss basic Propositional Logic. We should begin with a description of what it is that Logic attempts to do. Logic can be called the study of correct reasoning. More directly, it describes how conclusions can follow from certain given information.
To first approach this topic we should lay down some groundwork. In Logic, the information and variables that we use are representable only by truth values. We cannot reason with things that do not convey information. For example, sentences like:
“It is Monday.”, “I have a pencil.”, “The time is 9:43am.”, and “Steve is five feet tall.”
are all acceptable sentences for logical reasoning. They convey information that is either true or false. These can be called propositions. A proposition is a statement that is either true or false, but no both or neither. The second part of this definition is helpful for sentences like “This sentence is false” which is false when true and true when false. That example is not a proposition. Other example of sentences that are not propositions include:
“Open the door.”, “It is hot.”, “Yes.”, “Are you from Canada?”, and “I think we could…”
Statements that are not propositions could be opinions, questions, exclamations, or other sentences that cannot be identified as true or false.
Now that we have defined a proposition we can give them a symbol. Often we use the capital letters P, Q, R, S, … to represent propositions. So, we might say P: It is Monday and P is true or false. By organizing our propositions, we can create arguments. An Argument is an ordered list of propositions where the final sentence is the conclusion, and the others are called premises. An argument can be called a ‘good’ argument if it is valid. A valid argument is an argument for which, necessarily, if the premises are true then the conclusion is true. A Valid Argument does not require truthful information! Validity refers to the structure of the argument, not the content. If we want to investigate whether or not an argument is true we might mean that we are checking if the argument is sound. A Sound Argument is a valid argument with true premises. That is to say, there are four categories:

  • An argument with bad form and false premises.
  • An argument with bad form and true premises.
  • An argument with good form and false premises. (Valid)
  • An argument with good form and true premises. (Sound – and Valid)

To construct an argument we need to have some operations with which to relate our propositions. The basic logical operators are the following:

The Conjunction

In English we might say: “And” or “But”
The symbol: ∧
English Example: It is Monday and cloudy.
Logical Example: P∧Q
Truth Table: The conjunction is only true when both parts are true.

PQP∧Q
TTT
TFF
FTF
FFF

Logical Rules: Adjunction and Simplification
Adjunction states that if P is true and Q is true then P∧Q as a whole is true. It basically allows us to put two statements together.
Simplification says that if P∧Q is true then so must be one of the parts. We can simplify P∧Q to say that just P is true.

The Disjunction

In English: “Or”
The symbol: ∨
English Example: I eat cake or pie.
Logical Example: P∨Q
Truth Table: The Disjunction is true as long as one part is true.

PQP∨Q
TTT
TFT
FTT
FFF

Logical Rules: Addition and Modus Tollendo Ponens
Addition is when we have an existing statement, P, that is true and thus we can add another statement to it as an with a disjunction. I like pie, so it also true that I like pie or cake.
Modus Tollendo Ponens is the Latin name for the rule that describes a statement of the form, “I like cake or I like pie. I don’t like pie. So, I like cake.” If it is P or Q, its not P, it must be Q.

The Negation

In English: “Not”, “It is not the case that…”
The symbol: ¬
English Example: I am not evil.
Logical Example: ¬P
Truth Table: The negation inverts the true values; It is the opposite.

P¬P
TF
TF
FT
FT

Logical Rules: Double Negation
If there are two negatives, we can ‘cancel’ them out. “It is not the case that I am not good” means “I am good.”

The Conditional

In English: “If… Then…” and a variety of other phrasings are possible
The symbol: →
English Example: If you read the notes, then you will understand.
Logical Example: P→Q
Truth Table: The conditional statement can only be thought of as false if the first part is true but the conclusion never happens (case 2).

PQP→Q
TTT
TFF
FTT
FFT

Logical Rules: Modus Ponens, Modus Tollens, Conditional Derivation
Modus Ponens is the Latin name attributed to when we have the argument, “If P then Q. P happens. Thus, Q Happens.”
Modus Tollens is the reverse of that: “If P then Q. Q didn’t happen, so P didn’t happen.”
Conditional Derivation is when we make an assumption that P happens and show, through some logical reasoning, that Q must follow. Thus, we can say If P then Q.

The Biconditional

In English: “If and only if”
The symbol: ↔
English Example: It will rain if and only if there are clouds.
Logical Example: P↔Q
Truth Table: The biconditional can be thought of as equivalence, so P and Q should have the same truth values for the biconditional to be true.

PQP↔Q
TTT
TFF
FTF
FFT

Logical Rules: Biconditional, Equivalence
The biconditional rule is a derivation of this operator. We can do this by showing P→Q and Q→P. That is to say (P→Q)∧(Q→P)≡P↔Q.
Equivalence is when we make a statement of the form, “P if and only if Q. P happens. Thus, Q happens.”

Examples

Example 1: Translate the following English sentence into Logic:
If it rains, then I will bring an umbrella.


Solution:
Let P= It is raining / it rains
Q= I will bring an umbrella
P→Q


Example 2: Translate the following English sentence into Logic:
It is not the case that John is both tall and wealthy.
Solution:
Let P= John is tall
Q= John is wealthy
¬(P∧Q)


Example 3: Translate the following English sentence into Logic:
If and only if there is cake or pie, then I will both arrive to the party and be early.

Solution:
Let P= There is cake
Q= There is pie
R= I will arrive to the party
S= I will be early to the party
(P∨Q)↔(R∧S)

Showing Validity

In order to show that an argument is valid, we can use a couple of different options. The first option is to create a truth table containing the variables, the premises and the conclusion and show that were the premises are true, then necessarily the conclusion is true.

Example 4: Make a truth table to show that the following argument is valid:
P→Q
P
∴Q


Solution:

CasesPremisesConclusion
PQP→QPQ
TTTTT
TFFTF
FTTFT
FFTFF

Since the row that has both true premises results in a true conclusion, we can identify this argument as valid.

Example 5: Make a truth table to show that the following argument is not valid:
(¬P∨Q)→R
¬Q
∴R


Solution:

CasesScratch WorkPremisesConclusion
PQR¬P(¬P∨Q)(¬P∨Q)→R¬QR
TTTFTTFT
TTFFTFFF
TFTFFTTT
TFFFFTTF
FTTTTTFT
FTFTTFFF
FFTTTTTT
FFFTTFTF

Since there is at least one row that has both true premises results in a false conclusion, we can identify this argument as not valid.

Other Methods of Proof

This can be quite tedious as we get examples with more and more variables. For each variable, the number of rows required doubles. This is because for each variable there are two options (true or false) so if we have three variables there are 2^3 possible combinations. In general, for n variables there would need to be 2^n rows in the truth table.
A second method for evaluating the validity of an argument is by using a Fitch Bar. A Fitch Bar is a structure used to describe a logical argument and cite reasoning. It is similar to what some might have seen used in a “T-Chart Proof.” A vertical line is placed to label the main argument. Numbers for each line are placed on the left with the step and the reason for why it happens on the right side. Often we use horizontal bars to divide the sections into givens, argument and the conclusion. Additional vertical bars and indenting may be used in order to provide a smaller sub-argument in a proof.


Example 6: Prove the following argument is valid:
P∧Q
P→R
∴R


Solution:

1.P∧Q Given
2.P→R Given
3.P    Simplification, line 1
4.R   Modus Ponens, lines 3, 4

Example 7: Prove the following argument is valid:
¬R
S→R
P
P→(T→S)
∴¬T


Solution:

1.¬R Given
2.S→R Given
3.P Given
4.P→(T→S) Given
5.¬S  Modus Tollens, lines 1, 2
6.(T→S)   Modus Ponens, lines 3, 4
7.¬T    Modus Tollens, lines 5, 6

Example 8: Prove the following argument is valid:
P∨Q
Q→S
¬S∧T
∴T∧P


Solution:

1.P∨Q Given
2.Q→S Given
3.¬S∧T Given
4.T     Simplification, line 3
5.¬S    Simplification, line 3
6.¬Q   Modus Tollens, lines 5, 2
7.P   Modus Tollendo Ponens, lines 6, 1
8.T∧P    Adjunction, lines 4, 7

Example 9: Prove the following argument is valid:
(P∧Q)↔R
P↔S
S∧Q
∴R


Solution:

1.(P∧Q)↔R Given
2.P↔S Given
3.S∧Q Given
4.S    Simplification, line 3
5.Q     Simplification, line 3
6.P     Equivalence, lines 4, 2
7.P∧Q Adjunction, lines 6, 5
8.R     Equivalence, lines 7, 1

Proof by Condradiction

The last topic we will discuss is a method of proving an argument that does not arise from any of the above operators. Reductio Ad Absurdum, also known as Indirect Proof or Proof by Contradiction, is a way to show that an argument is valid. This method is particularly wonderful because of its unique approach and versatility.
A proof by contradiction starts by assuming something, generally the opposite of the goal, then shows that it is leads to a contradiction, thus it was wrong and the opposite must be true. In conversation we do this often. “Assume P is true. But that means that Q is also true, but it isn’t! Q is false! That must mean that P is not true.”

Example 10: Prove the following argument is valid:
P→R
Q→R
P∨Q
∴R


Solution:

1.P→R Given

Q→R Given

P∨Q Given
 
2. 
3. 
 4.¬R    Assumption for the Purpose of Indirect Derivation
 5.¬Q  Modus Tollens, lines 4, 2
 6.¬P   Modus Tollens, lines 4, 1
 7.P    Modus Tollendo Ponens, lines 5, 3
8.R   Indirect Derivation, lines 4-7

There is much more to be learned in the field of logic. However, this will be more than sufficient for the understanding of calculus.

Next Section: 2.2 Proof