Week 3 recap Need to know for this course Recursion Be very - - PowerPoint PPT Presentation

week 3 recap need to know for this course
SMART_READER_LITE
LIVE PREVIEW

Week 3 recap Need to know for this course Recursion Be very - - PowerPoint PPT Presentation

Week 3 recap Need to know for this course Recursion Be very comfortable with recursive definitions Recursive datatypes and functions Know how to do structural induction Induction and structural induction 1 2 Summary of topics Well-formed


slide-1
SLIDE 1

Week 3 recap

Recursion Recursive datatypes and functions Induction and structural induction

1

Need to know for this course

Be very comfortable with recursive definitions Know how to do structural induction

2

COMP2111 Week 4 Term 1, 2020 Propositional Logic

3

Summary of topics

Well-formed formulas (SYNTAX) Boolean Algebras Valuations (SEMANTICS) CNF/DNF Proof Natural deduction

4

slide-2
SLIDE 2

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

5

Well-formed formulas

Let Prop = {p, q, r, . . .} be a set of propositional letters. Consider the alphabet Σ = Prop ∪ {⊤, ⊥, ¬, ∧, ∨, →, ↔, (, )}. The well-formed formulas (wffs) over Prop is the smallest set of words over Σ such that: ⊤, ⊥ and all elements of Prop are wffs If ϕ is a wff then ¬ϕ is a wff If ϕ and ψ are wffs then (ϕ ∧ ψ), (ϕ ∨ ψ), (ϕ → ψ), and (ϕ ↔ ψ) are wffs.

6

Examples

The following are well-formed formulas: (p ∧ ¬⊤) ¬(p ∧ ¬⊤) ¬¬(p ∧ ¬⊤) The following are not well-formed formulas: p ∧ ∧ p ∧ ¬⊤ (p ∧ q ∧ r) ¬(¬p)

7

Conventions

To aid readability some conventions and binding rules can and will be used. Parentheses omitted if there is no ambiguity (e.g. p ∧ q) ¬ binds more tightly than ∧ and ∨, which bind more tightly than → and ↔ (e.g. p ∧ q → r instead of ((p ∧ q) → r) Other conventions (rarely used/assumed in this course):

′ or · for ¬

+ for ∨ · or juxtaposition for ∧ ∧ binds more tightly than ∨ ∧ and ∨ associate to the left: p ∨ q ∨ r instead of ((p ∨ q) ∨ r) → and ↔ associate to the right: p → q → r instead of (p → (q → r))

8

slide-3
SLIDE 3

Conventions

To aid readability some conventions and binding rules can and will be used. Parentheses omitted if there is no ambiguity (e.g. p ∧ q) ¬ binds more tightly than ∧ and ∨, which bind more tightly than → and ↔ (e.g. p ∧ q → r instead of ((p ∧ q) → r) Other conventions (rarely used/assumed in this course):

′ or · for ¬

+ for ∨ · or juxtaposition for ∧ ∧ binds more tightly than ∨ ∧ and ∨ associate to the left: p ∨ q ∨ r instead of ((p ∨ q) ∨ r) → and ↔ associate to the right: p → q → r instead of (p → (q → r))

9

Parse trees

The structure of well-formed formulas (and other grammar-defined syntaxes) can be shown with a parse tree. Example ((P ∧ ¬Q) ∨ ¬(Q → P)) ∨

10

Parse trees

The structure of well-formed formulas (and other grammar-defined syntaxes) can be shown with a parse tree. Example ((P ∧ ¬Q) ∨ ¬(Q → P)) ∨ ∧

11

Parse trees

The structure of well-formed formulas (and other grammar-defined syntaxes) can be shown with a parse tree. Example ((P ∧ ¬Q) ∨ ¬(Q → P)) ∨ ∧ ¬

12

slide-4
SLIDE 4

Parse trees

The structure of well-formed formulas (and other grammar-defined syntaxes) can be shown with a parse tree. Example ((P ∧ ¬Q) ∨ ¬(Q → P)) ∨ ∧ ¬ P ¬ →

13

Parse trees

The structure of well-formed formulas (and other grammar-defined syntaxes) can be shown with a parse tree. Example ((P ∧ ¬Q) ∨ ¬(Q → P)) ∨ ∧ ¬ P ¬ → Q Q P

14

Parse trees formally

Formally, we can define a parse tree as follows: A parse tree is either: (B) A node containing ⊤; (B) A node containing ⊥; (B) A node containing a propositional variable; (R) A node containing ¬ with a single parse tree child; (R) A node containing ∧ with two parse tree children; (R) A node containing ∨ with two parse tree children; (R) A node containing → with two parse tree children; or (R) A node containing ↔ with two parse tree children.

15

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

16

slide-5
SLIDE 5

Definition: Boolean Algebra

A Boolean algebra is a structure (T, ∨, ∧,′ , 0, 1) where 0, 1 ∈ T ∨ : T × T → T (called join) ∧ : T × T → T (called meet)

′ : T → T (called complementation)

and the following laws hold for all x, y, z ∈ T: commutative: x ∨ y = y ∨ x x ∧ y = y ∧ x associative: (x ∨ y) ∨ z = x ∨ (y ∨ z) (x ∧ y) ∧ z = x ∧ (y ∧ z) distributive: x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) identity: x ∨ 0 = x, x ∧ 1 = x complementation: x ∨ x′ = 1, x ∧ x′ = 0

17

Examples of Boolean Algebras

The set of subsets of a set X: T : Pow(X) ∧ : ∩ ∨ : ∪

′ : c

0 : ∅ 1 : X Laws of Boolean algebra follow from Laws of Set Operations.

18

Examples of Boolean Algebras

Example The two element Boolean Algebra : B = ({true, false}, &&, , !, false, true) where !, &&, are defined as: !true = false; !false = true, true && true = true; ... true true = true; ... NB We will often use B for the two element set {true, false}. For simplicity this may also be abbreviated as {T, F} or {1, 0}.

19

Examples of Boolean Algebras

Example Cartesian products of B, that is n-tuples of 0’s and 1’s with Boolean operations, e.g. B4: join: (1, 0, 0, 1) ∨ (1, 1, 0, 0) = (1, 1, 0, 1) meet: (1, 0, 0, 1) ∧ (1, 1, 0, 0) = (1, 0, 0, 0) complement: (1, 0, 0, 1)′ = (0, 1, 1, 0) 0: (0, 0, 0, 0) 1: (1, 1, 1, 1).

20

slide-6
SLIDE 6

Examples of Boolean Algebras

Example Functions from any set S to B; their set is denoted Map(S, B) If f , g : S − → B then (f ∨ g) : S − → B is defined by s → f (s) g(s) (f ∧ g) : S − → B is defined by s → f (s) && g(s) f ′ : S − → B is defined by s →!f (s) 0 : S − → B is the function f (s) = false 1 : S − → B is the function f (s) = true

21

Examples of Boolean Algebras

Example If (T, ∨, ∧,′ , 0, 1) is a Boolean algebra, then the dual algebra (T, ∧, ∨,′ , 1, 0) is also a Boolean Algebra. For example: T : Pow(X) ∧ : ∪ ∨ : ∩

′ : c

0 : X 1 : ∅

22

Every finite Boolean algebra satisfies: |T| = 2k for some k. All algebras with the same number of elements are isomorphic, i.e. “structurally similar”, written ≃. Therefore, studying one such algebra describes properties of all. The algebras mentioned above are all of this form n-tuples ≃ Bn Pow(S) ≃ B|S| Map(S, B) ≃ B|S| NB Boolean algebra as the calculus of two values is fundamental to computer circuits and computer programming. Example: Encoding subsets as bit vectors.

23

Derived laws

The following are all derivable from the Boolean Algebra laws. Idempotence x ∧ x = x x ∨ x = x Double complementation (x′)′ = x Annihilation x ∧ 0 = 0 x ∨ 1 = 1 de Morgan’s Laws (x ∧ y)′ = x′ ∨ y′ (x ∨ y)′ = x′ ∧ y′

24

slide-7
SLIDE 7

Duality

If E is an expression made up with ∧, ∨,′ , 0, 1 and variables; then dual(E) is the expression obtained by replacing ∧ with ∨ and vice-versa; and 0 with 1 and vice-versa. Theorem (Principle of Duality) If you can show E1 = E2 holds in all Boolean Algebrasa, then dual(E1) = dual(E2) holds in all Boolean Algebras.

aby using the Boolean Algebra Laws 25

Duality formally

A Boolean Algebra expression is defined as follows: 0, 1 are expressions A variable, x, y, . . . , is an expression. If E is an expression then E ′ is an expression. If E1 and E2 are expressions, then (E1 ∧ E2) and (E1 ∨ E2) are expressions.

26

Duality formally

If Exp is the set of expressions, we define dual : Exp → Exp as follows: dual(0) = 1, dual(1) = 0 dual(x) = x for all variables x dual(E ′) = dual(E)′ for all expressions E dual((E1 ∧ E2)) = (dual(E1) ∨ dual(E2)) for all expressions E1 and E2 dual((E1 ∨ E2)) = (dual(E1) ∧ dual(E2)) for all expressions E1 and E2

27

Duality example

dual((x ∨ (x ∧ y))) = (dual(x) ∧ dual((x ∧ y))) = (x ∧ dual((x ∧ y))) = (x ∧ (dual(x) ∨ dual(y))) = (x ∧ (x ∨ y))

28

slide-8
SLIDE 8

Duality example

dual((x ∨ (x ∧ y))) = (dual(x) ∧ dual((x ∧ y))) = (x ∧ dual((x ∧ y))) = (x ∧ (dual(x) ∨ dual(y))) = (x ∧ (x ∨ y))

29

Duality example

dual((x ∨ (x ∧ y))) = (dual(x) ∧ dual((x ∧ y))) = (x ∧ dual((x ∧ y))) = (x ∧ (dual(x) ∨ dual(y))) = (x ∧ (x ∨ y))

30

Duality example

dual((x ∨ (x ∧ y))) = (dual(x) ∧ dual((x ∧ y))) = (x ∧ dual((x ∧ y))) = (x ∧ (dual(x) ∨ dual(y))) = (x ∧ (x ∨ y))

31

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

32

slide-9
SLIDE 9

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

33

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

34

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

35

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

36

slide-10
SLIDE 10

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

37

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

38

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

39

Valuations

A truth assignment (or model) is a function v : Prop → B We can extend v to a function [ [·] ]v : WFFs → B recursively: [ [⊤] ]v = true, [ [⊥] ]v = false [ [p] ]v = v(p) [ [¬ϕ] ]v = ![ [ϕ] ]v [ [(ϕ ∧ ψ)] ]v = [ [ϕ] ]v && [ [ψ] ]v [ [(ϕ ∨ ψ)] ]v = [ [ϕ] ]v [ [ψ] ]v [ [(ϕ → ψ)] ]v = ![ [ϕ] ]v [ [ψ] ]v [ [(ϕ ↔ ψ)] ]v = (![ [ϕ] ]v [ [ψ] ]v) && (![ [ψ] ]v [ [ϕ] ]v)

40

slide-11
SLIDE 11

Satisfiability, Validity and Equivalence

A formula ϕ is satisfiable if [ [ϕ] ]v = true for some model v (v satisfies ϕ) valid or a tautology if [ [ϕ] ]v = true for all models v unsatisfiable or a contradiction if [ [ϕ] ]v = false for all models v

41

Logical equivalence

Two formulas, ϕ and ψ, are logically equivalent, ϕ ≡ ψ, if [ [ϕ] ]v = [ [ψ] ]v for all models v. Theorem ≡ is an equivalence relation. Example Commutativity: (p ∨ q) ≡ (q ∨ p) Double negation: ¬¬p ≡ p Contrapositive: (p → q) ≡ (¬q → ¬p) De Morgan’s: (p ∨ q)′ ≡ p′ ∧ q′ Theorem ϕ ≡ ψ if, and only if, (ϕ ↔ ψ) is a tautology.

42

Logical equivalence

Two formulas, ϕ and ψ, are logically equivalent, ϕ ≡ ψ, if [ [ϕ] ]v = [ [ψ] ]v for all models v. Theorem ≡ is an equivalence relation. Example Commutativity: (p ∨ q) ≡ (q ∨ p) Double negation: ¬¬p ≡ p Contrapositive: (p → q) ≡ (¬q → ¬p) De Morgan’s: (p ∨ q)′ ≡ p′ ∧ q′ Theorem ϕ ≡ ψ if, and only if, (ϕ ↔ ψ) is a tautology.

43

Logical equivalence

Two formulas, ϕ and ψ, are logically equivalent, ϕ ≡ ψ, if [ [ϕ] ]v = [ [ψ] ]v for all models v. Theorem ≡ is an equivalence relation. Example Commutativity: (p ∨ q) ≡ (q ∨ p) Double negation: ¬¬p ≡ p Contrapositive: (p → q) ≡ (¬q → ¬p) De Morgan’s: (p ∨ q)′ ≡ p′ ∧ q′ Theorem ϕ ≡ ψ if, and only if, (ϕ ↔ ψ) is a tautology.

44

slide-12
SLIDE 12

Theories and entailment

A set of formulas is a theory A model v satisfies a theory T if [ [ϕ] ]v = true for all ϕ ∈ T A theory T entails a formula ϕ, T | = ϕ, if [ [ϕ] ]v = true for all models v which satisfy T Example T1 = {p}, T2 = ∅, T3 = {⊥} v : p − → true satisfies T1 and T2 but not T3 T1 | = (p ∨ p) and T3 | = (p ∨ p) but T2 does not model (p ∨ p)

45

Theories and entailment

A set of formulas is a theory A model v satisfies a theory T if [ [ϕ] ]v = true for all ϕ ∈ T A theory T entails a formula ϕ, T | = ϕ, if [ [ϕ] ]v = true for all models v which satisfy T Theorem The following are equivalent: ϕ1, ϕ2, . . . , ϕn | = ψ ∅ | = ((ϕ1 ∧ ϕ2) ∧ . . . ϕn) → ψ ((ϕ1 ∧ ϕ2) ∧ . . . ϕn) → ψ is a tautology ∅ | = ϕ1 → (ϕ2 → (. . . → ϕn) → ψ)) . . .)

46

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

47

Terminology and Rules

For readability we assume associativity of ∧ and ∨, and write ϕ for ¬ϕ. A literal is an expression p or p, where p is a propositional atom. A propositional formula is in CNF (conjunctive normal form) if it has the form

  • i

Ci where each clause Ci is a disjunction of literals e.g. p ∨ q ∨ r. A propositional formula is in DNF (disjunctive normal form) if it has the form

  • i

Ci where each clause Ci is a conjunction of literals e.g. p ∧ q ∧ r.

48

slide-13
SLIDE 13

Motivation

Finding satisfying assignments of formulas in DNF is straightforward Disproving validity of formulas in CNF is straightforward Karnaugh maps can be used to simplify formulas

49

CNF and DNF are named after their top level operators; no deeper nesting of ∧ or ∨ is permitted. We can assume in every clause (disjunct for the CNF, conjunct for the DNF) any given variable (literal) appears only

  • nce; preferably, no literal and its negation together.

x ∨ x = x, x ∧ x = x x ∧ x = 0, x ∨ x = 1 x ∧ 0 = 0, x ∧ 1 = x, x ∨ 0 = x, x ∨ 1 = 1

A preferred form for an expression is DNF, with as few terms as possible. In deriving such minimal simplifications the two basic rules are absorption and combining the opposites. Fact

1

Absorption: x ∨ (x ∧ y) ≡ x

2

Combining the opposites: (x ∧ y) ∨ (x ∧ y) ≡ x

50

Theorem For every Boolean expression φ, there exists an equivalent expression in conjunctive normal form and an equivalent expression in disjunctive normal form. Proof. We show how to apply the equivalences already introduced to convert any given formula to an equivalent one in CNF, DNF is similar.

51

Step 1: Push Negations Down

Using De Morgan’s laws and the double negation rule x ∨ y ≡ x ∧ y x ∧ y ≡ x ∨ y x ≡ x we push negations down towards the atoms until we obtain a formula that is formed from literals using only ∧ and ∨.

52

slide-14
SLIDE 14

Step 2: Use Distribution to Convert to CNF

Using the distribution rules x ∨ (y1 ∧ . . . ∧ yn) = (x ∨ y1) ∧ . . . ∧ (x ∨ yn) (y1 ∧ . . . ∧ yn) ∨ x = (y1 ∨ x) ∧ . . . ∧ (yn ∨ x) we obtain a CNF formula.

53

CNF/DNF in Propositional Logic

Using the equivalence A → B ≡ ¬A ∨ B we first eliminate all occurrences of → Example ¬(¬p ∧ ((r ∧ s) → q)) ≡ ¬(¬p ∧ (¬(r ∧ s) ∨ q))

54

Step 1: Example p(rs ∨ q) = p ∨ rs ∨ q = p ∨ rs ∧ q = p ∨ rsq Step 2: Example p ∨ rsq = (p ∨ r)(p ∨ sq) = (p ∨ r)(p ∨ s)(p ∨ q) CNF

55

Canonical Form DNF

Given a Boolean expression E, we can construct an equivalent DNF E dnf from the lines of the truth table where E is true: Given an assignment v from {x1 . . . xi} to B, define the literal ℓi =

  • xi

if v(xi) = true xi if v(xi) = false and a product tv = ℓ1 ∧ ℓ2 ∧ . . . ∧ ℓn. Example If v(x1) = true and v(x2) = false then tv = x1 ∧ x2 The canonical DNF of E is E dnf =

  • [

[E] ]v=true

tv

56

slide-15
SLIDE 15

Example If E is defined by x y E F F T F T F T F T T T T then E dnf = (x ∧ y) ∨ (x ∧ y) ∨ (x ∧ y) Note that this can be simplified to either y ∨ (x ∧ y)

  • r

(x ∧ y) ∨ x

57

Canonical CNF

After pushing negations down, the negation of a DNF is a CNF (and vice versa). ⇒ Given an expression E, we can obtain an equivalent CNF by finding a DNF for ¬E and then applying De Morgan’s laws. ⇔ Look at rows in the truth table of E that contain false and negate the literals.

58

Example If E is defined by x y E F F F F T F T F T T T F then E cnf = (x ∨ y) ∧ (x ∨ y) ∧ (x + y).

59

Karnaugh Maps

For up to four variables (propositional symbols) a diagrammatic method of simplification called Karnaugh maps works quite well. For every propositional function of k = 2, 3, 4 variables we construct a rectangular array of 2k cells. We mark the squares corresponding to the value true with eg “+” and try to cover these squares with as few rectangles with sides 1 or 2 or 4 as possible. Example yz y ¯ z ¯ y ¯ z ¯ yz x + + + ¯ x + + +

60

slide-16
SLIDE 16

For optimisation, the idea is to cover the + squares with the minimum number of rectangles. One cannot cover any empty cells. The rectangles can go ‘around the corner’/the actual map should be seen as a torus. Rectangles must have sides of 1, 2 or 4 squares (three adjacent cells are useless). Example yz y ¯ z ¯ y ¯ z ¯ yz x + + + ¯ x + + +

☛ ✡ ✟ ✠ ☛ ✡ ✟ ✠ ✔ ✕ ✗ ✖

E = (x ∧ y) ∨ (¯ x ∧ ¯ y) ∨ z Canonical form would consist of writing all cells separately (6

61

For optimisation, the idea is to cover the + squares with the minimum number of rectangles. One cannot cover any empty cells. The rectangles can go ‘around the corner’/the actual map should be seen as a torus. Rectangles must have sides of 1, 2 or 4 squares (three adjacent cells are useless). Example yz y ¯ z ¯ y ¯ z ¯ yz x + + + ¯ x + + +

☛ ✡ ✟ ✠ ☛ ✡ ✟ ✠ ✔ ✕ ✗ ✖

E = (x ∧ y) ∨ (¯ x ∧ ¯ y) ∨ z Canonical form would consist of writing all cells separately (6

62

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

63

Motivation

Given a theory T and a formula ϕ, how do we show T | = ϕ? Consider all valuations v (SEMANTIC approach) Use a sequence of deductive rules to show that ϕ is a logical consequence of T (SYNTACTIC approach)

64

slide-17
SLIDE 17

Formal proofs

A formal way to show that a formula logically follows from a theory. Highly disciplined way of reasoning (good for computers) A sequence of formulas where each step is a deduction based

  • n earlier steps

Based entirely on rewriting formulas – no semantic interpretations needed

65

Proof stucture

Premises Subgoal Subgoal . . . Conclusion

66

Proof stucture

Premises Subgoal Subgoal . . . Conclusion Inference rules

67

Proof stucture

Premises Subgoal Subgoal . . . Conclusion Inference rules

subproof subproof premises

68

slide-18
SLIDE 18

Inference rules

In its simplest form, an inference rule is a statement of the form: If I have a proof of this then I have a proof of that

69

Inference rules

In its simplest form, an inference rule is a statement of the form: If I have a proof of this then I have a proof of that A more complicated form: If I have a proof of this (under these assumptions) then I have a proof of that (under these* assumptions) NB The sets of assumptions need not be the same!

70

Inference rules

In its simplest form, an inference rule is a statement of the form: If I have a proof of this then I have a proof of that Yet more complicated form: If I have a proof of this (under these assumptions) and I have a proof of this (under these assumptions) and ... then I have a proof of that (under these assumptions) NB The sets of assumptions need not be the same!

71

Inference rules: notation

If T is a theory and ϕ is a formula, we write T ⊢ ϕ to denote a proof of ϕ under the assumptions T. So an inference rule is a statement of the form: If T1 ⊢ ϕ1 and T2 ⊢ ϕ2 and ... and Tn ⊢ ϕn then T ⊢ ψ Alternative notation: T1 ⊢ ϕ1 T2 ⊢ ϕ2 · · · Tn ⊢ ϕn T ⊢ ψ

72

slide-19
SLIDE 19

Inference rules: notation

If T is a theory and ϕ is a formula, we write T ⊢ ϕ to denote a proof of ϕ under the assumptions T. So an inference rule is a statement of the form: If T1 ⊢ ϕ1 and T2 ⊢ ϕ2 and ... and Tn ⊢ ϕn then T ⊢ ψ Alternative notation: T1 ⊢ ϕ1 T2 ⊢ ϕ2 · · · Tn ⊢ ϕn T ⊢ ψ

73

Inference rules: notation

If T is a theory and ϕ is a formula, we write T ⊢ ϕ to denote a proof of ϕ under the assumptions T. So an inference rule is a statement of the form: If T1 ⊢ ϕ1 and T2 ⊢ ϕ2 and ... and Tn ⊢ ϕn then T ⊢ ψ Alternative notation: ϕ1 ϕ2 · · · ϕn ψ (If T1 = T2 = . . . = T)

74

Inference rules: notation

If T is a theory and ϕ is a formula, we write T ⊢ ϕ to denote a proof of ϕ under the assumptions T. So an inference rule is a statement of the form: If T1 ⊢ ϕ1 and T2 ⊢ ϕ2 and ... and Tn ⊢ ϕn then T ⊢ ψ Alternative notation: ϕ1 [α] . . . ϕ2 · · · ϕn ψ (If T2 = T ∪ {α})

75

Inference rules: examples

∧-elimination: A ∧ B

(∧-E1)

A ∧-introduction: A B

(∧-I)

A ∧ B ∨-elimination: A ∨ B [A] . . . C [B] . . . C

(∨-E)

C

76

slide-20
SLIDE 20

Inference rules: examples

∧-elimination: A ∧ B

(∧-E1)

A ∧-introduction: A B

(∧-I)

A ∧ B ∨-elimination: A ∨ B [A] . . . C [B] . . . C

(∨-E)

C

77

Inference rules: examples

∧-elimination: A ∧ B

(∧-E1)

A ∧-introduction: A B

(∧-I)

A ∧ B ∨-elimination: A ∨ B [A] . . . C [B] . . . C

(∨-E)

C

78

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

79

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

80

slide-21
SLIDE 21

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

81

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

82

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

83

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

84

slide-22
SLIDE 22

Proof layout

Default layout: tabular Example: Prove: A → B, B → C ⊢ A → C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2 A → C → -I 5

85

Premises

You may assume anything, but it may not be helpful! You must discharge any assumptions you make along the way. For example, Prove: A → B, B → C ⊢ B ∧ C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2, 3 B ∧ C ∧-I 4, 5

86

Premises

You may assume anything, but it may not be helpful! You must discharge any assumptions you make along the way. For example, Prove: A → B, B → C ⊢ B ∧ C Line Premises Formula Rule References 1 A → B Premise 2 B → C Premise 3 A Premise 4 1, 3 B → -E 1, 3 5 1, 2, 3 C → -E 2, 4 6 1, 2, 3 B ∧ C ∧-I 4, 5

87

Other proof layouts: Proof tree

Upside-down tree (root at bottom): Natural structure arising from rule syntax Premises at leaves Conclusion at root B → C A → B [A]

(→-E)

B

(→-E)

C

(→-I)

A → C

88

slide-23
SLIDE 23

Other proof layouts: Fitch-style

Style used in online tool Premises ruled off from subgoals Subproofs are indented

  • 1. A → B
  • 2. B → C
  • 3. A
  • 4. B

→-E: 1,3

  • 5. C

→-E: 2,4

  • 6. A → C

→-I: 3–5

89

Proof systems

There are many proof systems, defined by the default axioms (“free” premises), and inference rules: Natural deduction Hilbert systems Sequent calculus Resolution

90

Proof systems

Two key properties of a “good” system: Soundness: The system only proves valid statements: If T ⊢ ϕ then T | = ϕ. Completeness: The system can prove any valid statement: If T | = ϕ then T ⊢ ϕ. NB Soundness is straightforward: check every axiom and inference rule. Completeness (with consistency) is trickier, and may not even exist (e.g. G¨

  • del’s incompleteness theorem).

91

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

92

slide-24
SLIDE 24

Online resources

Open logic project (https://proofs.openlogicproject.org/) Freely available textbooks Online proof checker Sample exercises

93

Natural deduction

Proof system intended to mirror “natural reasoning”: No axioms (no inherent truths) 15 inference rules: primarily grouped into pairs (and trios) of rules tasked with introducing and eliminating boolean

  • perators from the chain of reasoning.

Operator Introduction Elimination ∧ ∧-I ∧-E1 ∧-E2 ∨ ∨-I1 ∨-I2 ∨-E → →-I →-E ↔ ↔-I ↔-E1 ↔-E2 ¬ ¬-I ¬-E IP ⊥ ¬-E X

94

∧ Introduction and Elimination

∧-introduction: A B

(∧-I)

A ∧ B ∧-elimination (1): A ∧ B

(∧-E1)

A ∧-elimination (2): A ∧ B

(∧-E2)

B

95

∧ Introduction and Elimination

∧-introduction: A B

(∧-I)

A ∧ B ∧-elimination (1): A ∧ B

(∧-E1)

A ∧-elimination (2): A ∧ B

(∧-E2)

B

96

slide-25
SLIDE 25

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

97

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

98

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

99

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

100

slide-26
SLIDE 26

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

101

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

102

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

103

Proof example

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) Line Premises Formula Rule References 1 (A ∧ B) ∧ C Premise 2 1 A ∧ B ∧-E1 1 3 1 A ∧-E1 2 4 1 B ∧-E2 2 5 1 C ∧-E2 1 6 1 B ∧ C ∧-I 4, 5 7 1 A ∧ (B ∧ C) ∧-I 3, 6

104

slide-27
SLIDE 27

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

105

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

106

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

107

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

108

slide-28
SLIDE 28

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

109

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

110

Proof example (Fitch)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C)

  • 1. (A ∧ B) ∧ C
  • 2. A ∧ B

∧-E1: 1

  • 3. A

∧-E1: 2

  • 4. B

∧-E2: 2

  • 5. C

∧-E2: 1

  • 6. B ∧ C

∧-I: 4,5

  • 7. A ∧ (B ∧ C)

∧-I: 3,6

111

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

112

slide-29
SLIDE 29

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

113

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

114

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

115

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

116

slide-30
SLIDE 30

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

117

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

118

Proof example (Tree)

Prove: (A ∧ B) ∧ C ⊢ A ∧ (B ∧ C) (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E1)

A (A ∧ B) ∧ C

(∧-E1)

A ∧ B

(∧-E2)

B (A ∧ B) ∧ C

(∧-E2)

C

(∧-I)

B ∧ C

(∧-I)

A ∧ (B ∧ C)

119

∨ Introduction and Elimination

∨-introduction (1): A

(∨-I1)

A ∨ B ∨-introduction (2): B

(∨-I1)

A ∨ B ∨-elimination: A ∨ B [A] . . . C [B] . . . C

(∨-E)

C

120

slide-31
SLIDE 31

∨ Introduction and Elimination

∨-introduction (1): A

(∨-I1)

A ∨ B ∨-introduction (2): B

(∨-I1)

A ∨ B ∨-elimination: A ∨ B [A] . . . C [B] . . . C

(∨-E)

C

121

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

122

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

123

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

124

slide-32
SLIDE 32

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

125

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

126

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

127

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

128

slide-33
SLIDE 33

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

129

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

130

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

131

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

132

slide-34
SLIDE 34

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

133

Proof example

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C) Line Premises Formula Rule References 1 A ∨ (B ∧ C) Premise 2 A Premise 3 2 A ∨ B ∨-I1 2 4 2 A ∨ C ∨-I1 2 5 2 (A ∨ B) ∧ (A ∨ C) ∧-I 3, 4 6 (B ∧ C) Premise 7 6 B ∧-E1 6 8 6 A ∨ B ∨-I2 7 9 6 C ∧-E2 6 10 6 A ∨ C ∨-I2 9 11 6 (A ∨ B) ∧ (A ∨ C) ∧-I 8, 10 12 1 (A ∨ B) ∧ (A ∨ C) ∨-E 5, 11

134

Proof example (Fitch)

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C)

  • 1. A ∨ (B ∧ C)
  • 2. A
  • 3. A ∨ B

∨-I1: 2

  • 4. A ∨ C

∨-I1: 2

  • 5. (A ∨ B) ∧ (A ∨ C)

∧-I: 3,4

  • 6. B ∧ C
  • 7. B

∧-E1: 6

  • 8. A ∨ B

∨-I2: 7

  • 9. C

∧-E2: 6

  • 10. A ∨ C

∨-I2: 9

  • 11. (A ∨ B) ∧ (A ∨ C)

∧-I: 8,10

  • 12. (A ∨ B) ∧ (A ∨ C)

∨-E: 1,3–5,6–11

135

Proof example (Fitch)

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C)

  • 1. A ∨ (B ∧ C)
  • 2. A
  • 3. A ∨ B

∨-I1: 2

  • 4. A ∨ C

∨-I1: 2

  • 5. (A ∨ B) ∧ (A ∨ C)

∧-I: 3,4

  • 6. B ∧ C
  • 7. B

∧-E1: 6

  • 8. A ∨ B

∨-I2: 7

  • 9. C

∧-E2: 6

  • 10. A ∨ C

∨-I2: 9

  • 11. (A ∨ B) ∧ (A ∨ C)

∧-I: 8,10

  • 12. (A ∨ B) ∧ (A ∨ C)

∨-E: 1,3–5,6–11

136

slide-35
SLIDE 35

Proof example (Fitch)

Prove: A ∨ (B ∧ C) ⊢ (A ∨ B) ∧ (A ∨ C)

  • 1. A ∨ (B ∧ C)
  • 2. A
  • 3. A ∨ B

∨-I1: 2

  • 4. A ∨ C

∨-I1: 2

  • 5. (A ∨ B) ∧ (A ∨ C)

∧-I: 3,4

  • 6. B ∧ C
  • 7. B

∧-E1: 6

  • 8. A ∨ B

∨-I2: 7

  • 9. C

∧-E2: 6

  • 10. A ∨ C

∨-I2: 9

  • 11. (A ∨ B) ∧ (A ∨ C)

∧-I: 8,10

  • 12. (A ∨ B) ∧ (A ∨ C)

∨-E: 1,3–5,6–11

137

→ Introduction and Elimination

→-introduction: [A] . . . B

(→-I)

A → B →-elimination: (Modus Ponens) A → B A

(→-E)

B

138

↔ Introduction and Elimination

↔-introduction: [A] . . . B [B] . . . A

(↔-I)

A ↔ B ↔-elimination (1): A ↔ B A

(↔-E1)

B ↔-elimination (2): A ↔ B B

(↔-E1)

A

139

¬ Introduction and Elimination and Indirect Proof

¬-introduction: [A] . . . ⊥

(¬-I)

¬A ¬-elimination: (⊥-introduction) A ¬A

(¬-E)

⊥ Indirect proof: [¬A] . . . ⊥

(IP)

A

140

slide-36
SLIDE 36

¬ Introduction and Elimination and Indirect Proof

¬-introduction: [A] . . . ⊥

(¬-I)

¬A ¬-elimination: (⊥-introduction) A ¬A

(¬-E)

⊥ Indirect proof: [¬A] . . . ⊥

(IP)

A

141

Proof example: double negation

Prove: A ⊢ ¬¬A Line Premises Formula Rule References 1 A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 ¬¬A ¬-I 3

142

Proof example: double negation

Prove: A ⊢ ¬¬A Line Premises Formula Rule References 1 A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 ¬¬A ¬-I 3

143

Proof example: double negation

Prove: A ⊢ ¬¬A Line Premises Formula Rule References 1 A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 ¬¬A ¬-I 3

144

slide-37
SLIDE 37

Proof example: double negation

Prove: A ⊢ ¬¬A Line Premises Formula Rule References 1 A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 ¬¬A ¬-I 3

145

Proof example: double negation

Prove: ¬¬A ⊢ A Line Premises Formula Rule References 1 ¬¬A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 A IP 3

146

Proof example: double negation

Prove: ¬¬A ⊢ A Line Premises Formula Rule References 1 ¬¬A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 A IP 3

147

Proof example: double negation

Prove: ¬¬A ⊢ A Line Premises Formula Rule References 1 ¬¬A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 A IP 3

148

slide-38
SLIDE 38

Proof example: double negation

Prove: ¬¬A ⊢ A Line Premises Formula Rule References 1 ¬¬A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 A ?IP 3

149

Proof example: double negation

Prove: ¬¬A ⊢ A Line Premises Formula Rule References 1 ¬¬A Premise 2 ¬A Premise 3 1, 2 ⊥ ¬-E 1, 2 4 1 A IP 3

150

Explosion

Explosion: (⊥-elimination) ⊥

(X)

A

151

Soundness and completeness

Theorem Natural deduction is sound and complete. That is, T ⊢ ϕ if and only if T | = ϕ Corollary The following are equivalent: ϕ1, ϕ2, . . . , ϕn | = ϕ ϕ1 ∧ · · · ∧ ϕn) → ϕ is a tautology ϕ1 → (ϕ2 → (· · · → (ϕn → ϕ)) · · · ) is a tautology ϕ1, ϕ2, . . . , ϕn ⊢ ϕ ϕ1, ϕ2, . . . , ϕn−1 ⊢ ϕn → ϕ (and so on)

152

slide-39
SLIDE 39

Soundness and completeness

Theorem Natural deduction is sound and complete. That is, T ⊢ ϕ if and only if T | = ϕ Corollary The following are equivalent: ϕ1, ϕ2, . . . , ϕn | = ϕ ϕ1 ∧ · · · ∧ ϕn) → ϕ is a tautology ϕ1 → (ϕ2 → (· · · → (ϕn → ϕ)) · · · ) is a tautology ϕ1, ϕ2, . . . , ϕn ⊢ ϕ ϕ1, ϕ2, . . . , ϕn−1 ⊢ ϕn → ϕ (and so on)

153

Derived rules

Several useful rules available in the proof checker (not needed for Assignment!) Double negation elimination: ¬¬A

(DNE)

A Reiteration: A

(R)

A Law of excluded middle: [A] . . . B [¬A] . . . B

(LEM)

B

154

Derived rules

Disjunctive syllogism: A ∨ B ¬A

(DS)

B Modus Tollens: A → B ¬B

(MT)

¬A De Morgans Laws (e.g.): ¬(A ∨ B)

(DM)

¬A ∧ ¬B

155

Summary of topics

Well-formed formulas Boolean Algebras Valuations CNF/DNF Proof Natural deduction

156