Logic

Almost everything I've written about logic here has been taken from a logic textbook I got from a bookstore called "A First Course in Logic" by K. Codell Carter. Though I tried to put things in my own words just to demonstrate my own understanding of it.

Deductive Logic

Deductive logic is a form of logic that can best be described as follows: "A type of logic which depends on premises to guarantee a conclusion, assuming the premises are correct." I know that sounds verbose, but I'm not sure how to define it less verbosely. Whenever you make a deductive argument, you are effectively saying, "If all of these premises are true, then the conclusion must be true."

Syllogistic Logic

Syllogistic logic is a type of deductive logic derived from the Greek philosopher Aristotle in which all statements have a subject and predicate. There are four different types of statements, according to syllogistic logic:

Statement type How to symbolize (xy = x are y) Example
Universal Affirmative Axy All dogs are red
Universal Negative Exy No dogs are red
Particular Affirmative Ixy Some dogs are red
Particular Negative Oxy Some dogs are not red

Symbolism

As mentioned in the previous table, syllogistic statements can be represented in the format Zxy, with Z makring the statement type, x marking the subject, and y marking the predicate. For example, the statement "all cats are obnoxious" can be represented by Aco. "Some dogs are likable" can be represented by Idl, etc.

However, some subjects or predicates can have a line over them, and that means "not". For example, Ads can represent the argument "All dogs do not have scales"

Equivalences

An equivalence is a set of 2 statements in which if one is true, the other must be true as well. There are four different types of equivalences, in syllogistic logic:

Equivalence type Description Universal Rules Examples
Obverses When each statement can be formed from the other by exchanging A for E, E for A, I for O, and O for I, then negating the predicate All syllogistic statements are equivalent to their obverse Axy (ob) Exy
Exy (ob) Axy
Ixy (ob) Oxy
Oxy (ob) Ixy
Axy (ob) Exy
Exy (ob) Axy
Ixy (ob) Oxy
Oxy (ob) Ixy
All dogs are mammals, therefore no dogs are not mammals
No trees are animals, therefore all trees are not animals
Some dogs are friendly, therefore some dogs are not unfriendly
Some cats are not annoying, therefore some cats are unannoying
Converses When each statement can be formed from the other by swapping the subject and predicate All E and I statements are equivalent to their converse Exy (conv) Eyx
Ixy (conv) Iyx
No human has wings, therefore nothing with wings is human
Some cats are orange, therefore some orange things are cats
Contrapositive When each statement can be formed from the other by swapping the subject and predicate, then negating both All A and O statements are equivalent to their contrapositive Axy (cont) Ayx
Oxy (cont) Oyx
Axy (cont) Ayx
Oxy (cont) Oyx
All birds are living, therefore some non-living things are not birds
Some people are not brown-haired, therefore some non-brown-haired things aren't not people

Proofs

Proofs are an important part of deductive logic, no matter the type. A proof is a series of statements which can be advanced from premises to a conclusion. Proofs are a good way to assess the validity of a deductive argument. If you can successfully do a proof of said argument, it is valid. There are a few rules we use when proving syllogistic arguments:

Name Description of the rule Examples
Barbara Given Axy and Ayz, one can attach Axz 1. Apq
2. Aqr
3. Apr 1, 2 Barbara
Darii Given Axy and Ixz, one can attach Iyz 1. Apq
2. Ipr
3. Iqr 1, 2 Darii
Obversion (Ob) Given any statement, one can attach its obverse 1. Apq
2. Epq 1 Ob
Contraposition (Cont) Given any A statement, one can attach its contrapositive 1. Apq
2. Aqp 1 Cont
Conversion (Conv) Given any I statement, one can attach its converse 1. Ipq
2. Iqp 1 Conv

Example of a syllogistic proof

1. Epq
2. Aqr ∴Apr
3. Apq 1 Ob
4. Apr 2, 3 Barbara

Truth-Functional Logic

Truth-functional logic is a type of deductive logic derived from stoic philosophy, largely built specifically by a Greek philosopher named Chrysippus. Rather than being based off subjects and predicates like syllogistic logic, TFL is formed by propositions and what must be true following those propositions. If you've ever studied discrete structures, which basically every computer science student has or will at some point, you are probably already familiar with TFL. There are two components of TFL: statements and connectors. You can of course make new connectors out of existing ones, but there are 4 types of fundamental connectors:

Connector type How to symbolize (A and B are statements, anything else is the connector) Example
Negation ~A Bob's hair is not brown.
Conjunction A•B I am tired and you are happy.
Disjunction AvB I am tired or you are happy.
Conditional A→B If the sun is up, it is daytime.

Truth tables

An important part of TFL is truth tables. These are tables which decide the truth output of a given statement, given every permutation of truth of the statements within a compound statement. Again, if you have ever taken a discrete structures course, as is common among Computer Science students, you have likely already worked with this before. Such tables are important both for defining the fundamental connectors, and for comparing the truth values for different statements. Here are different truth tables for the different fundamental connectors:

Connector type How to symbolize Truth table
Negation ~A
A ~A
T F
F T
Conjunction A•B
A B A•B
T T T
T F F
F T F
F F F
Disjunction AvB
A B AvB
T T T
T F T
F T T
F F F
Conditional A→B
A B A→B
T T T
T F F
F T T
F F T

As you can see, for each individual part of a compound statement, you list the different possibilities for true and false. The number of rows needed is 2^n, with n being the number of basic statements within the compound statement. there is a truth table for ~AvB:

A B ~A ~AvB
T T F T
T F F F
F T T T
F F T T

Through this, we can see that ~AvB is true unless A is true and B is false. This is what truth tables are useful for, observing if a given statement can ever be true or false, and if so, specicically how.

There are 3 types of truth table outcomes:

  1. Tautology -The statement is true on every row. For example, Av~A.
  2. Self-contradiction -The statement is false on every row. For example, A•~A.
  3. Contingency -The statement is true on some rows and false on other rows. For example, A→B.

If invalid, basic truth-functional arguments can actually be quite easy to refute via truth tables. For example:

"If the plant is poison ivy, it will have toothed leaves. This plant has toothed leaves, therefore it is poison ivy."

In this example, I can let P mean "plant is poison ivy" and T mean "plant has toothed leaves". Doing this, I can translate the argument as follows, with ∴ meaning "therefore":

P→T
T
∴P

This, however, is the truth table for P→T, marking the premises with P and the conclusion with C:

C P P
P T P→T
T T T
T F F
F T T
F F T

This argument assumes both premises are true, however, so there is no point in leaving rows where one or both of the premises is false. Therefore, we can shorten the truth table to the following:

C P P
P T P→T
T T T
F T T

As you can see, the conclusion has a reasonable possibility of being false, since there are rows where both premises are true but the conclusion is not, specifically row 3. Therefore this argument is invalid.

In more complex arguments, another trick you can do is add the independent variables (aka the statement letters) and only include instances where the premises are true but the conclusion is false. Take the following argument for example:

AvB
A→C
B→D
∴CvD

In order for the conclusion to be false, both C and D need to be false. Because we want premises 2 and 3 to be true, we need to also make A and B false since lack of applicability is the only way we can make those true.

P P P C
A B C D AvB A→C B→D CvD
F F F F T T F

However, it is impossible for premise 1 to be true in this case because both A and B are false. It is therefore impossible to find an example where all of the premises are true but the conclusion is false, so this argument is valid.

Proofs

Here is a list of rules for TFL proofs that can be used:

Full Name Shorthand Name Description of the rule Examples
Simplification Simp Given A•B, both A and B are true 1. C•D ∴C
2. C 1 Simp
Conjunction Conj Given A and B, A•B is true 1. E
2. F ∴E•F
3. E•F 1,2 Conj
Disjunctive Syllogism DS Given AvB and ~A, B is true and vice versa 1. GvH
2. ~H ∴G
3. G 1,2 DS
Addition Add Given A, AvB and BvA are both true 1. I ∴IvJ
2. IvJ 1 Add
Biconditional Exchange BE If A→B and B→A, then A↔B. If A↔B, then A→B and B→A 1. K→L
2. L→K ∴K↔L
3. K↔L 1,2 BE
Modus Ponens MP If A→B and A, then B 1. M→N
2. M ∴N
3. N 1,2 MP
Conditional Proof CP If B can be proven from assuming A, then A→B 1. A→B ∴A→(A•B)
⮦2. A
↓3. B 1,2 MP
↳4. A•B 2,3 Add
5. A→(A•B) 2-4 CP
Indirect Proof IP If B•~B can be proven from assuming A, then ~A 1. A→(B→C)
2. A→~(B→C) ∴~A
⮦3. A
↓4. B→C 1,3 MP
↓5. ~(B→C) 2,3 MP
↳6. (B→C)•~(B→C) 4,5 Conj
7. ~A 3-6 IP

You can, of course, create more rules, if you can deductively prove them to be true, these are just the important base rules. Basically any other rules created using deductive logic can be made using these.