<<

Revision on propositional : Propositions. Logical Connectives. Truth values and truth tables. Propositional formulae. Tautologies. Logical equivalence. Logical consequence. Logical correctness of propositional arguments.

Valentin Goranko DTU Informatics

August 2010

V Goranko Propositions and propositional logical connectives Proposition: statement which can be assigned a (unique) : true or false. Propositional logical connectives: • : not, denoted by ¬; • conjunction: and, denoted by ∧ (or, sometimes by &); • disjunction: or, denoted by ∨; • implication: if . . . then . . . , denoted by →; • biconditional: . . . if and only if . . . , denoted by ↔. Examples of composite propositions: • “It is not the case that two plus two equals five.” • “Two plus two equals five and/or the sun is hot.” • “If two plus two equals five then the sun is hot.” • “Two plus two equals five if and only if the sun is hot.”

“Mary is not clever or, if Mary likes logic then Mary is

clever and Mary is not lazy.” V Goranko The propositional connectives as truth value functions

Each propositional connective acts on the truth values of the component propositions in a precise way:

• ¬A is true if and only if A is false. • A ∧ B is true if and only if both A and B are true. • A ∨ B is true if and only if either of A or B (possibly both) is true. • A → B is true if and only if A is false or B is true, i.e. if the truth of A implies the truth of B. • A ↔ B is true if and only if A and B have the same truth-values.

V Goranko Truth tables

These rules can be summarized in the following truth tables, where T stands for ‘true’ and stands for ’false’:

p ¬p T F F T

p q p ∧ q p ∨ q p → q p ↔ q T T T T T T T F F T F F F T F T T F F F F F T T

V Goranko Computing the truth value of a proposition

Suppose that “Mary is clever.”: T; “Mary is lazy.”: F; “Mary likes logic.”: T To compute the truth value of the composite proposition: “Mary is not clever or, if Mary likes logic then Mary is clever and Mary is not lazy.” we first write it in a symbolic form, by introducing symbolic names for the atomic propositions occurring in it: A:“ Mary is clever.” B:“ Mary is lazy.” C:“ Mary likes logic.”

V Goranko Then, the proposition can be written symbolically as:

(¬A) ∨ (C → (A ∧ ¬B)).

Now, we compute its truth value step by step, applying the truth-tables of the respective logical connectives:

(¬T) ∨ (T → (T ∧ ¬F))

= F ∨ (T → (T ∧ T))

= F ∨ (T → T)

= F ∨ T

= T. V Goranko Propositional formulae Propositional constants: > which represents a true proposition, and ⊥ which represents a false proposition. Propositional variables: variables that range over propositions. Usually denoted by p, q, r, possibly with indices. Inductive definition of propositional formulae: 1. Every propositional constant and every propositional variable is a . 2. If A is a propositional formula then ¬A is a propositional formula. 3. If A, B are propositional formulae then (A ∨ B), (A ∧ B), (A → B), (A ↔ B) are propositional formulae.

Examples:

>, ¬>, p, ¬p, ¬¬p, (p ∨ ¬q), (p1 ∧ ¬(p2 → ¬p1))

Outermost pairs of parentheses will often be omitted. V Goranko Construction trees, subformulae, main connectives Construction tree: a tree with nodes labelled with propositional constants, variables, and propositional connectives, such that:

1. Every leaf is labelled by a propositional constant or variable. 2. Propositional constants and variables label only leaves. 3. Every node labelled with ¬ has exactly one successor node. 4. Every node labelled with any of ∧, ∨, →, ↔ has exactly two successor nodes - left and right successor.

Every construction tree defines a formula C, built starting from the leaves and going towards the root, by applying at every node the formula construction rule corresponding to the label at that node. The formulae constructed in the process are the subformulae of C. The propositional connective labelling the root of the construction tree of a formula C is the main connective of C. V Goranko Truth tables of propositional formulae

Example: (p ∨ ¬(q ∧ ¬r)) → ¬¬r

p q r ¬r ¬¬r q ∧ ¬r ¬(q ∧ ¬r) p ∨ ¬(q ∧ ¬r) (p ∨ ¬(q ∧ ¬r)) → ¬¬r T T T F T F T T T T T F T F T F T F T F T F T F T T T T F F T F F T T F F T T F T F T T T F T F T F T F F T F F T F F F

V Goranko Simplified truth tables

p q r (p ∨ ¬ (q ∧ ¬ r)) → ¬ ¬ r T T T TTTTFFTTTFT T T F TTFTTTFFFTF T F T TTTFFFTTTFT T F F TTTFFTFFFTF F T T FTTTFFTTTFT F T F FFFTTTFTFTF F F T F F F

V Goranko Tautologies (or, propositionally valid formula): a formula that obtains truth value T for every assignment of truth values to the occurring variables. Notation: |= A. Examples: |= p ∨ ¬p, |= ¬(p ∧ ¬p), |= ((p ∧ (p → q)) → q) Testing tautologies with truth-tables:

p q p → q p ∧ (p → q) (p ∧ (p → q)) → q T T T T T T F F F T F T T F T F F T F T V Goranko Contradictions, satisfiable formulae

Contradiction is a formula that always takes truth value F. Examples: p ∧ ¬p, ¬((p ∧ q) → p) Thus, the negation of a tautology is a contradiction and the negation of a contradiction is a tautology. A formula is satisfiable if it is not a contradiction. Example: p, p ∧ ¬q, etc.

V Goranko Logical equivalence of propositional formulae Propositional formulae A and B are logically equivalent, denoted A ≡ B, if they obtain the same truth value under any truth (of the variables occurring in them). Examples: ¬(p ∧ q) ≡ ¬p ∨ ¬q p q ¬ (p ∧ q) ¬ p ∨ ¬ q T T FTTT FTFFT T F TTFF FTTTF F T TFFT TFTFT F F TFFF TFTTF

p ∧ (p ∨ q) ≡ p ∧ p ≡ p p q p ∧ (p ∨ q) p ∧ p T T TTTTT TTT T F TTTTF TTT F T FFFTT FFF

F F FFFFF FFF V Goranko Some basic properties of logical equivalence

I A ≡ B iff |= A ↔ B. I ≡ is an equivalence relation. I Moreover, ≡ is a congruence with respect to the propositional connectives, i.e.:

B if A ≡ B then ¬A ≡ ¬B, and B if A1 ≡ B1 and A2 ≡ B2 then (A1 • A2) ≡ (B1 • B2), where • ∈ {∧, ∨, →, ↔}. Theorem for equivalent replacement: Let A, B, C be any propositional formulae p be a propositional variable. If A ≡ B then C(A/p) ≡ C(B/p).

V Goranko Some important logical equivalences

• Idempotency: p ∧ p ≡ p; p ∨ p ≡ p. • Commutativity: p ∧ q ≡ q ∧ p; p ∨ q ≡ q ∨ p. • Associativity: (p ∧ (q ∧ r)) ≡ ((p ∧ q) ∧ r); (p ∨ (q ∨ r)) ≡ ((p ∨ q) ∨ r). Note that this property allows us to omit the parentheses in multiple conjunctions and disjunctions. • Absorption: p ∧ (p ∨ q) ≡ p; p ∨ (p ∧ q) ≡ p. • Distributivity: p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r);

p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r). V Goranko Other useful logical equivalences

• A ∨ ¬A ≡ >; A ∧ ¬A ≡ ⊥;

• A ∧ > ≡ A; A ∧ ⊥ ≡ ⊥;

• A ∨ > ≡ >; A ∨ ⊥ ≡ A.

• A → B ≡ ¬A ∨ B.

• A ↔ B ≡ (A → B) ∧ (B → A).

• A → B ≡ ¬B → ¬A.

V Goranko Propositional logical consequence

A propositional formula C is a logical consequence from the propositional formulae A1,..., An, denoted

A1,..., An |= C, if C is true whenever all A1,..., An are true, i.e., every assignment of truth-values to the variables occurring in A1,..., An, C which renders the formulae A1,..., An true, renders the formula C true, too.

If A1,..., An |= C, we also say that C follows logically from A1,..., An, and that A1,..., An logically imply C. Logical consequence is reducible to validity:

A1,..., An |= C iff A1 ∧ ... ∧ An |= C iff |= (A1 ∧ ... ∧ An) → C.

V Goranko Testing propositional consequence with truth tables I p, p → q |= q p q p p → q q T T T T T T F T F F F T F T T F F F T F

I p → r, q → r |= (p ∨ q) → r p q r p → r q → r p ∨ q (p ∨ q) → r T T T T T T T T T F F F T F T F T T T T T T F F F T T F F T T T T T T F T F T F T F F F T T T F T F F F T T F T V Goranko Valid rules of propositional inference

A rule of propositional inference (for short, inference rule) is a scheme: P ,..., P 1 n , C where P1,..., Pn, C are propositional formulae. The formulae P1,..., Pn are called premises of the inference rule, and C is its conclusion. An inference rule is valid if its conclusion logically follows from the premises. A propositional inference is an instance of a rule, where propositions are uniformly replaced by the propositional variables. A propositional inference is logically correct (or, valid) if it is an instance of a valid inference rule.

V Goranko Propositional inference: examples I Consider the propositional inference: Mary is singing. If Mary is singing, then Mary is happy. Mary is happy. It is obtained from the following rule, called Modus Ponens: p, p → q q This rule is valid, therefore, the inference is logically correct. I Now consider the propositional inference: 2 plus 2 equals 4. If 5 is greater than 3, then 2 plus 2 equals 4. 5 is greater than 3. It is based on the rule p, q → p q which is not valid. Therefore, the inference is not logically correct.V Goranko