Propositional Logic Study Notes

Foundations of Logic and Proofs

  • The rules of logic define the precise meaning of mathematical statements and are used to distinguish between valid and invalid mathematical arguments.

  • Logic serves as the fundamental basis for all mathematical reasoning and automated reasoning.

  • Mathematical arguments used to prove a statement is true are called proofs. Once a statement is proven, it is referred to as a theorem.

  • Applications of logic in computer science include:

    • The design of computing machines and computer circuits.

    • The specification of systems.

    • Artificial intelligence.

    • Computer programming and development of programming languages.

    • Establishing the security of a system.

    • Verifying that algorithms and computer programs produce correct results for all possible inputs.

  • Automated reasoning systems allow computers to construct their own proofs.

  • A conjecture is a statement proposed to be true but not yet proven. Studying conjectures is a primary method for developing mathematical knowledge.

Propositional Logic and Propositions

  • Propositional logic (or propositional calculus) is the branch of logic that deals with propositions. It was first developed systematically by the Greek philosopher Aristotle more than 2300 years ago.

  • Definition: A proposition is a declarative sentence (a sentence declaring a fact) that is either true or false, but not both.

  • The truth value of a proposition is denoted as T (true) or F (false).

  • Examples of propositions:

    • "Washington, D.C., is the capital of the United States of America." (Truth value: T)

    • "Toronto is the capital of Canada." (Truth value: F)

    • "1+1=21 + 1 = 2" (Truth value: T)

    • "2+2=32 + 2 = 3" (Truth value: F)

  • Sentences that are not propositions:

    • Questions: "What time is it?"

    • Commands: "Read this carefully."

    • Sentences with variables: "x+1=2x + 1 = 2" and "x+y=zx + y = z" are not propositions because they are neither true nor false until values are assigned to the variables.

  • Propositional variables (or statement variables) are letters used to represent propositions, such as pp, qq, rr, and ss.

Biography: Aristotle (384 B.C.E.–322 B.C.E.)

  • Born in Stagirus (Stagira) in northern Greece; his father was the personal physician to the King of Macedonia.

  • At age 17, he was sent to Athens and joined Plato’s Academy, where he remained for 20 years.

  • He tutored Alexander (later Alexander the Great), the son of King Philip of Macedonia, for five years.

  • He founded his own school, the Lyceum, in Athens. His followers were called "peripatetics" ("to walk about") because Aristotle walked while discussing philosophy.

  • Following the death of Alexander the Great in 323 B.C.E., he fled to Chalcis to avoid charges of impiety, where he died a year later of a stomach ailment.

  • His works spanned logic, philosophy, psychology, physics, and natural history. His writings were preserved in a vault and rediscovered roughly 200 years later by a book collector, eventually being issued in new editions in Rome.

Compound Propositions and Logical Operators

  • New propositions, called compound propositions, are formed from existing propositions using logical operators (also called connectives).

  • The methods for producing compound propositions were discussed by George Boole in 1854 in his book The Laws of Thought.

Negation

  • Definition: Let pp be a proposition. The negation of pp, denoted by pp (or p{p}), is the statement "It is not the case that pp."

  • The truth value of pp is the opposite of the truth value of pp.

  • Example: The negation of "Michael’s PC runs Linux" is "Michael’s PC does not run Linux."

  • Example: The negation of "Vandana’s smartphone has at least 32GB of memory" is "Vandana’s smartphone has less than 32GB of memory."

Conjunction

  • Definition: The conjunction of pp and qq, denoted by p∧qp \wedge q, is the proposition "pp and qq."

  • The conjunction p∧qp \wedge q is true when both pp and qq are true and is false otherwise.

  • In natural language, the word "but" is often used similarly to "and" in a conjunction (e.g., "The sun is shining, but it is raining").

Disjunction

  • Definition: The disjunction of pp and qq, denoted by p∨qp \vee q, is the proposition "pp or qq."

  • The disjunction p∨qp \vee q is false when both pp and qq are false and is true otherwise (at least one is true).

  • Inclusive vs. Exclusive Or:

    • Inclusive Or (disjunction): True if either or both propositions are true. Example: "Students who have taken calculus or computer science can take this class."

    • Exclusive Or: True if exactly one of the propositions is true. Example: "Soup or salad comes with an entre." (meaning you cannot have both).

Exclusive Or (XOR)

  • Definition: The exclusive or of pp and qq, denoted by p⊕qp \oplus q, is the proposition that is true when exactly one of pp and qq is true and is false otherwise.

Biography: George Boole (1815–1864)

  • A self-taught mathematician born in Lincoln, England, and the son of a cobbler.

  • Published The Mathematical Analysis of Logic in 1848.

  • Appointed professor of mathematics at Queen’s College in Cork, Ireland, in 1849.

  • Best known for his 1854 work, The Laws of Thought, which introduced Boolean algebra.

  • He died of pneumonia in 1864 after walking to a lecture in a rainstorm and becoming soaking wet.

Conditional Statements

  • Definition: The conditional statement p→qp \rightarrow q is the proposition "if pp, then q$."\n* The conditional statement is false only when pistrueandis true andq is false; it is true otherwise.\n* p is called the hypothesis (or antecedent or premise).\n* q is called the conclusion (or consequence).\n\n## Terminology for p \rightarrow q\n* "if p,then, thenq"\n* "pimpliesimpliesq"\n* "ponlyifonly ifq"\n* "pissufficientforis sufficient forq"\n* "qwhenwhenp"\n* "qisnecessaryforis necessary forp"\n* "qunlessunlessp"\n* Understanding "ponlyifonly ifq":Thismeans": This meanspcannotbetruewhencannot be true whenqisfalse.Ifis false. Ifpisfalse,thestatementsaysnothingaboutis false, the statement says nothing aboutq.\n* Understanding "qunlessunlessp":Thismeansif": This means ifpisfalse(meaningis false (meaningpistrue),thenis true), thenq must be true.\n\n## Conditional Statements in Logic vs. English\n* In natural language, conditional statements usually imply a cause-and-effect relationship.\n* In mathematical reasoning, p \rightarrow qisdefinedsolelybytruthvalues.Forexample,"IfJuanhasasmartphone,thenis defined solely by truth values. For example, "If Juan has a smartphone, then2 + 3 = 5" is considered a true conditional statement simply because the conclusion is true.\n\n## Programming Language "If-Then"\n* The `if p then S` construction in programming is an instruction, not a proposition. \n* Segment Sisexecutedifis executed ifpistrue,butnotifis true, but not ifp is false.\n\n# Derived Conditional Statements\n\n* Converse: The converse of p \rightarrow qisthepropositionis the propositionq \rightarrow p.\n* Contrapositive: The contrapositive of p \rightarrow qisthepropositionis the propositionq \rightarrow p.\n* Inverse: The inverse of p \rightarrow qisthepropositionis the propositionp \rightarrow q.\n* Equivalence:\n * The contrapositive always has the same truth value as the original conditional statement (p \rightarrow q).\n * The converse and the inverse are equivalent to each other, but they are NOT equivalent to the original statement p \rightarrow q.\n\n# Biconditional Statements\n\n* Definition: The biconditional statement p \leftrightarrow qistheproposition"is the proposition "pifandonlyifif and only ifq$."

  • The biconditional is true when pp and qq have the same truth values (both T or both F) and is false otherwise.

  • Also known as bi-implications.

  • Abbreviation: "iff" stands for "if and only if."

  • p↔qp \leftrightarrow q has the same truth value as (p→q)∧(q→p)(p \rightarrow q) \wedge (q \rightarrow p).

  • Common terminology:

    • "pp is necessary and sufficient for qq"

    • "if pp then qq, and conversely"

Truth Tables and Operator Precedence

  • Truth tables determine the truth values of compound propositions by evaluating sub-expressions for all combinations of variable truth values.

  • Precedence rules reduce the number of parentheses needed:

    1. Negation:

    2. Conjunction: ∧\wedge

    3. Disjunction: ∨\vee

    4. Conditional: →\rightarrow

    5. Biconditional: ↔\leftrightarrow

  • Example: p∧qp \wedge q means (p)∧q(p) \wedge q, not (p∧q)(p \wedge q).

  • Example: p∧q∨rp \wedge q \vee r is evaluated as (p∧q)∨r(p \wedge q) \vee r.

Logic and Bit Operations

  • A bit is a binary digit: 0 (zero) or 1 (one). The term was introduced by John Tukey in 1946.

  • Truth values are represented by bits: 1 for T (True) and 0 for F (False).

  • A Boolean variable is a variable with a value of either true or false.

  • Bit Operators:

    • OR corresponds to ∨\vee

    • AND corresponds to ∧\wedge

    • XOR corresponds to ⊕\oplus

  • Bit Strings:

    • Definition: A sequence of zero or more bits.

    • Length: The number of bits in the string.

    • Bitwise operations (OR, AND, XOR) are performed on strings of the same length by operating on each pair of bits in corresponding positions.

Biography: John Wilder Tukey (1915–2000)

  • American statistician who coined the terms "bit" and "software."

  • Studied chemistry and mathematics at Brown University and received a Ph.D. from Princeton in 1939.

  • Founded the Statistics Department at Princeton in 1966.

  • Known for developing the fast Fourier transform with J. W. Cooley.

  • Received the National Medal of Science and served on the President’s Science Advisory Committee.

Summary of Truth Tables

Logical Connectives Truth Values

pp

qq

pp

p∧qp \wedge q

p∨qp \vee q

p⊕qp \oplus q

p→qp \rightarrow q

p↔qp \leftrightarrow q

T

T

F

T

T

F

T

T

T

F

F

F

T

T

F

F

F

T

T

F

T

T

T

F

F

F

T

F

F

F

T

T

Bitwise Operator Truth Values

xx

yy

x∨yx \vee y

x∧yx \wedge y

x⊕yx \oplus y

0

0

0

0

0

0

1

1

0

1

1

0

1

0

1

1

1

1

1

0