second order propositional logic type theory week 08 2006 04 03 0 - - PowerPoint PPT Presentation

second order propositional logic
SMART_READER_LITE
LIVE PREVIEW

second order propositional logic type theory week 08 2006 04 03 0 - - PowerPoint PPT Presentation

second order propositional logic type theory week 08 2006 04 03 0 the course 1st order propositional logic simple type theory 1st order predicate logic type theory with dependent types P 2nd order propositional logic


slide-1
SLIDE 1

second order propositional logic

type theory week 08 2006 04 03

slide-2
SLIDE 2

the course

1st order propositional logic ↔ simple type theory λ→ 1st order predicate logic ↔ type theory with dependent types λP 2nd order propositional logic ↔ polymorphic type theory λ2

1

slide-3
SLIDE 3

2nd order propositional logic

propositional logic

a b c . . . A → B ⊥ ⊤ ¬A A ∧ B A ∨ B

2

slide-4
SLIDE 4

predicate logic

a(. . .) b(. . .) c(. . .) . . . A → B ⊥ ⊤ ¬A A ∧ B A ∨ B ∀x . A ∃ x . A x y z . . . f(. . .) g(. . .) h(. . .) . . .

3

slide-5
SLIDE 5

second order propositional logic

a b c . . . A → B ⊥ ⊤ ¬A A ∧ B A ∨ B ∀a . A ∃ a . A

4

slide-6
SLIDE 6

example

a → a ∀a. a → a if it’s tuesday, then it’s tuesday for every proposition, that proposition implies itself

5

slide-7
SLIDE 7

the rules

introduction rules elimination rules I[x]→ E→ E⊥ I⊤ I[x]¬ E¬ I∧ El ∧ Er∧ Il ∨ Ir∨ E∨ I∀ E∀ I∃ E∃

6

slide-8
SLIDE 8

propositional logic: rules for implication

implication introduction [Ax] . . . B A → B I[x]→ implication elimination . . . A → B . . . A B E→

7

slide-9
SLIDE 9

propositional logic: rules for falsum and truth

falsum elimination . . . ⊥ A E⊥ truth introduction ⊤ I⊤

8

slide-10
SLIDE 10

propositional logic: rules for conjunction

conjunction introduction . . . A . . . B A ∧ B I∧ conjunction elimination . . . A ∧ B A El∧ . . . A ∧ B B Er∧

9

slide-11
SLIDE 11

propositional logic: rules for disjunction

disjunction introduction . . . A A ∨ B Il∨ . . . B A ∨ B Il∨ disjunction elimination . . . A ∨ B . . . A → C . . . B → C C E∨

10

slide-12
SLIDE 12

2nd order propositional logic: rules for universal quantification

universal quantification introduction . . . A ∀a. A I∀ variable condition: a not a free variable in any open assumption universal quantification elimination . . . ∀a. A A[a := B] E∀

11

slide-13
SLIDE 13

2nd order propositional logic: rules for existential quantification

existential quantifier introduction . . . A[a := B] ∃a. A I∃ existential quantifier elimination . . . ∃a. A . . . ∀a. (A → B) B E∃ variable condition: a not a free variable in B

12

slide-14
SLIDE 14

variable conditions

  • for rule I∀

check: variable does not occur in any of the available assumptions

  • for rule E∃

check: variable does not occur in the conclusion

13

slide-15
SLIDE 15

examples

example 1

(∀b. b) → a

14

slide-16
SLIDE 16

example 2

a → ∀b. ((a → b) → b)

15

slide-17
SLIDE 17

example 3

(∃b. a) → a

16

slide-18
SLIDE 18

example 4

∃b.((a → b) ∨ (b → a))

17

slide-19
SLIDE 19

example 5

∀a. ∀b. ((a → b) ∨ (b → a)) this needs classical logic ∀a. (a ∨ ¬a)

18

slide-20
SLIDE 20

non-example 6

a → ∀a. a

19

slide-21
SLIDE 21

non-example 7

(∃a. a) → a

20

slide-22
SLIDE 22

higher order logic

the ‘order’ of a variable

first order

  • bject

second order set of objects predicate on objects function from objects to objects third order set of second order objects predicate on predicates on objects function from second order objects to . . . etc.

21

slide-23
SLIDE 23

example from 2nd order predicate logic

induction principle for natural numbers ∀a.

  • a(0) → (∀m. a(m) → a(S(m))) → ∀n. a(n)
  • m

1st order variable n 1st order variable 1st order constant a 2nd order variable S 2nd order constant

22

slide-24
SLIDE 24
  • nly predicates without arguments

quantify over predicates → 2nd order predicate logic . . . the same without terms → 2nd order propositional logic

23

slide-25
SLIDE 25

impredicative encoding of inductive types

the connectives in Coq

→ hard-wired into the type theory ∀ hard-wired into the type theory ⊥ inductive type ∧ inductive type ∨ inductive type ∃ inductive type

24

slide-26
SLIDE 26

inductive definition of False

Inductive False : Prop := . False_ind : ∀a. ⊥ → a the constructors are the introduction rules the induction principle is the elimination rule

25

slide-27
SLIDE 27

inductive definition of and

Inductive and (a b : Prop) : Prop := conj : a → b → a ∧ b . and_ind : ∀a b c. (a → b → c) → (a ∧ b) → c the constructor is the introduction rule the induction principle gives the elimination rules

26

slide-28
SLIDE 28

alternative version of conjunction elimination

conjunction elimination: alternative version . . . A ∧ B . . . A → B → C C E∧ conjunction elimination: normal version . . . A ∧ B A El∧ . . . A ∧ B B Er∧

27

slide-29
SLIDE 29

inductive definition of or

Inductive or (a b : Prop) : Prop :=

  • r_introl : a → a ∨ b

| or_intror : b → a ∨ b .

  • r_ind : ∀a b c. (a → c) → (b → c) → (a ∨ b) → c

the constructors are the introduction rules the induction principle is the elimination rule

28

slide-30
SLIDE 30

impredicative definition of False

⊥ := ∀a. a induction principle next to impredicative definition ∀a. ⊥ → a ∀a. a

29

slide-31
SLIDE 31

impredicative definition of and

a ∧ b := ∀c. (a → b → c) → c induction principle next to impredicative definition ∀a b. ∀c. (a ∧ b) → (a → b → c) → c ∀c. (a → b → c) → c

30

slide-32
SLIDE 32

impredicative definition of or

a ∨ b := ∀c. (a → c) → (b → c) → c induction principle next to impredicative definition ∀a b. ∀c. (a ∨ b) → (a → c) → (b → c) → c ∀c. (a → c) → (b → c) → c

31

slide-33
SLIDE 33

impredicative definitions for other inductive types

impredicative definition of the booleans

∀a. a → a → a

32

slide-34
SLIDE 34

impredicative definition of the natural numbers

∀a. a → (a → a) → a

33

slide-35
SLIDE 35

why have inductive types as primitive then?

  • one can prove less equalities
  • one gets weaker induction principles
  • some people don’t like impredicativity

34