SLIDE 1 G¨
- del Numbers of Terms and Formulas
We assign a unique number to each symbol in LNT as follows: ¬ 1 _ 3 8 5 = 7 9 S 11 + 13 · 15 E 17 < 19 ( 21 ) 23 vi 2i Suppose s :⌘ s1 . . . sn is a string of symbols, which constituting a well-formed term or formula of LNT. Naively, we could encode s by the number h#(s1), . . . , #(sn)i where #(si) is the number corresponding to the symbol si. However, it much better to encode s according to the inductive type of terms and formulas.
SLIDE 2 Def 5.7.1. For each term t and formula ', the G¨
are defined as follows: p¬↵q = h1, p↵qi p+t1t2q = h13, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p· t1t2q = h15, pt1q, pt2qi p(8vi)(↵)q = h5, pviq, p↵qi pEt1t2q = h17, pt1q, pt2qi p=t1t2q = h7, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p0q = h9i pviq = h2ii. pStq = h11, ptqi
SLIDE 3 Def 5.7.1. For each term t and formula ', the G¨
are defined as follows: p¬↵q = h1, p↵qi p+t1t2q = h13, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p· t1t2q = h15, pt1q, pt2qi p(8vi)(↵)q = h5, pviq, p↵qi pEt1t2q = h17, pt1q, pt2qi p=t1t2q = h7, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p0q = h9i pviq = h2ii. pStq = h11, ptqi
- Obs. ptq and p'q are never divisible by 7. (Why?)
SLIDE 4 Def 5.7.1. For each term t and formula ', the G¨
are defined as follows: p¬↵q = h1, p↵qi p+t1t2q = h13, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p· t1t2q = h15, pt1q, pt2qi p(8vi)(↵)q = h5, pviq, p↵qi pEt1t2q = h17, pt1q, pt2qi p=t1t2q = h7, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p0q = h9i pviq = h2ii. pStq = h11, ptqi
- Example. p=0S0q = h7, p0q, pS0qi
= h7, h9i, h11, h9iii = h7, 210, h11, 210ii = 28310255(21231025+1). Notice how fast pSSSS0q grows: pSSSS0q = h11, h11, h11, h11, h9iiiii = 2123212321232123210
SLIDE 5
Next Steps (Section 5.8) ∆-definability of sets Terms := {ptq : terms t} = {a 2 N : a = ptq for some term t}, Formulas := {p'q : formulas '} = {a 2 N : a = p'q for some formula '}.
SLIDE 6
∆-Definition of Terms = {ptq : t is a term}
p¬↵q = h1, p↵qi p=t1t2q = h7, pt1q, pt2qi p+t1t2q = h13, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p0q = h9i p· t1t2q = h15, pt1q, pt2qi pviq = h2ii p(8vi)(↵)q = h5, pviq, p↵qi pStq = h11, ptqi pEt1t2q = h17, pt1q, pt2qi
SLIDE 7 ∆-Definition of Terms = {ptq : t is a term}
p¬↵q = h1, p↵qi p=t1t2q = h7, pt1q, pt2qi p+t1t2q = h13, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p0q = h9i p· t1t2q = h15, pt1q, pt2qi pviq = h2ii p(8vi)(↵)q = h5, pviq, p↵qi pStq = h11, ptqi pEt1t2q = h17, pt1q, pt2qi
Recall the inductive definition of an LNT-term t: it is either
- a variable symbol vi,
- St1 where t1 is term,
- the constant symbol 0,
- +t1t2 or · t1t2 or Et1t2 where t1, t2 are terms.
SLIDE 8 ∆-Definition of Terms = {ptq : t is a term}
p¬↵q = h1, p↵qi p=t1t2q = h7, pt1q, pt2qi p+t1t2q = h13, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p0q = h9i p· t1t2q = h15, pt1q, pt2qi pviq = h2ii p(8vi)(↵)q = h5, pviq, p↵qi pStq = h11, ptqi pEt1t2q = h17, pt1q, pt2qi
Recall the inductive definition of an LNT-term t: it is either
- a variable symbol vi,
- St1 where t1 is term,
- the constant symbol 0,
- +t1t2 or · t1t2 or Et1t2 where t1, t2 are terms.
Let’s start with ∆-definition of Variables := {pviq : i = 1, 2, . . . } (= {22i+1 : i = 1, 2, . . . }). by the formula Variable(x) :⌘ (9y < x)[Even(y) ^ (0 < y) ^ (x = 2Sy)].
SLIDE 9 ∆-Definition of Terms = {ptq : t is a term}
p¬↵q = h1, p↵qi p=t1t2q = h7, pt1q, pt2qi p+t1t2q = h13, pt1q, pt2qi p<t1t2q = h19, pt1q, pt2qi p(↵ _ )q = h3, p↵q, pqi p0q = h9i p· t1t2q = h15, pt1q, pt2qi pviq = h2ii p(8vi)(↵)q = h5, pviq, p↵qi pStq = h11, ptqi pEt1t2q = h17, pt1q, pt2qi
Recall the inductive definition of an LNT-term t: it is either
- a variable symbol vi,
- St1 where t1 is term,
- the constant symbol 0,
- +t1t2 or · t1t2 or Et1t2 where t1, t2 are terms.
We would like to write: Term(x) :⌘ Variable(x) _
“x is p0q”
z }| { x = 210 _
“x is pSt1q for some term t1”
z }| { (9y < x)[Term(y) ^ x = 212·3
Sy
| {z }
h11,yi
] _ · · · |{z}
“x is +t1t2 or · t1t2 or Et1t2”
However, there is a problem with this “∆-formula”: It is a not legitimate for- mula of first-order logic! Note the circular use of the subformula Term(y).
SLIDE 10 ∆-Definition of Terms = {ptq : t is a term}
- Definition. A term construction sequence for a term t is a finite sequence
- f terms (t1, . . . , t`) such that t` :⌘ t and, for each k 2 {1, . . . , `}, the term tk
is either
- a variable symbol,
- the constant symbol 0,
- Stj for some j < k, or
- +titj or · titj or Etitj for some i, j < k.
SLIDE 11 ∆-Definition of Terms = {ptq : t is a term}
- Definition. A term construction sequence for a term t is a finite sequence
- f terms (t1, . . . , t`) such that t` :⌘ t and, for each k 2 {1, . . . , `}, the term tk
is either
- a variable symbol,
- the constant symbol 0,
- Stj for some j < k, or
- +titj or · titj or Etitj for some i, j < k.
- Example. (0, v1, Sv1, +0Sv1) is term construction sequence for the +0Sv1.
SLIDE 12 ∆-Definition of Terms = {ptq : t is a term}
- Definition. A term construction sequence for a term t is a finite sequence
- f terms (t1, . . . , t`) such that t` :⌘ t and, for each k 2 {1, . . . , `}, the term tk
is either
- a variable symbol,
- the constant symbol 0,
- Stj for some j < k, or
- +titj or · titj or Etitj for some i, j < k.
- Example. (0, v1, Sv1, +0Sv1) is term construction sequence for the +0Sv1.
- Lemma. Every term t has a term construction sequence of length at most the
number of symbols in t. (Easy proof by induction.)
SLIDE 13 ∆-Definition of Terms = {ptq : t is a term}
- Definition. A term construction sequence for a term t is a finite sequence
- f terms (t1, . . . , t`) such that t` :⌘ t and, for each k 2 {1, . . . , `}, the term tk
is either
- a variable symbol,
- the constant symbol 0,
- Stj for some j < k, or
- +titj or · titj or Etitj for some i, j < k.
Key to defining Terms: We will write a ∆-formula defining the set TermConSeq = {(c, a) : c = hpt1q, . . . , pt`qi and a = pt`q where (t1, . . . , t`) is a term construction sequence}.
SLIDE 14
∆-Definition of Terms = {ptq : t is a term} TermConSeq(c, a) :⌘ Codenumber(c) ^ (9` < c) " Length(c, `) ^ IthElement(a, `, c) ^ (8k `)(9ek < c) " IthElement(ek, k, c) ^ B B B B @ Variable(ek) _ ek = 210 } } } “ek is p0q” _ (9j < k)(9ej < c)[IthElement(ej, j, c) ^
“ek is pSejq”
z }| { ek = 212 · 3
Sej]
_ · · · 1 C C C C A ## Key to defining Terms: We will write a ∆-formula defining the set TermConSeq = {(c, a) : c = hpt1q, . . . , pt`qi and a = pt`q where (t1, . . . , t`) is a term construction sequence}.
SLIDE 15
∆-Definition of Terms = {ptq : t is a term} Now there is an obvious way to define Term(a): Term(a) :⌘ (9c)TermConSeq(c, a). To make this a ∆-formula, we need an upper bound on c as a function of a.
SLIDE 16
∆-Definition of Terms = {ptq : t is a term} Now there is an obvious way to define Term(a): Term(a) :⌘ (9c)TermConSeq(c, a). To make this a ∆-formula, we need an upper bound on c as a function of a. Suppose a = ptq. Another easy lemma by induction: The number of symbols in t is at most a. Therefore, there exists a term construction sequence (t1, . . . , t`) for t with length a. We may assume that each tk is a subterm of t, so that ptkq ptq = a for all k 2 {1, . . . , `}. Let c := hpt1q, . . . , pt`qi. We have c = 2pt1q+13pt2q+1 · · · (p`)pt`q+1 (p`)pt1q+···+pt`q+` (p`)`a+` (pa)a2+a (a + 1)a3 using the (easy) fact that the ath prime number pa is at most (a + 1)a.
SLIDE 17
∆-Definition of Terms = {ptq : t is a term} Now there is an obvious way to define Term(a): Term(a) :⌘ (9c)TermConSeq(c, a). To make this a ∆-formula, we need an upper bound on c as a function of a. We may therefore take Term(a) :⌘ (9c (a + 1)a3)TermConSeq(c, a).
SLIDE 18 Construction Sequences for Other Recursive Definitions In a similar way, using the notion of a formula construction sequence, we get a ∆-definition of the set Formulas = {p'q : ' is a formula}.
- Definition. A formula construction sequence for a formula ' is a finite
sequence of terms ('1, . . . , '`) such that '` :⌘ ' and, for each k 2 {1, . . . , `}, the term 'k is either
- =t1t2 for some terms t1 and t2
- <t1t2 for some terms t1 and t2
- ¬'j for some j < k
- ('i _ 'j) for some i, j < k
- (8x)('i) for some i < k and x 2 Vars
SLIDE 19
Construction Sequences for General Recursive Definitions This idea is very general: using an appropriate notion of construction sequence, we get a ∆-definition of any recursively defined set or function. Suppose want a ∆-formula Factorial(x, y) defining the function Factorial : N ! N (i.e., the {(a, b) 2 N2 : b = a!}). Key idea: Write a ∆-formula defining the set FactorialConstSeq := {(a, b, c) 2 N3 : b = a! and c = h0!, 1!, 2!, . . . , a!i} using Codenumber, Length, IthElement as subformulas. (Details in tutorial.) Homework Problem (PSET 4). Write down a ∆-formula defining the function Fibonacci : N ! N.
SLIDE 20 Next Steps (Sections 5.11–5.12) The following are ∆-definable: LogicalAxiom :=
- p'q : ' is a logical axiom
RuleOfInference :=
- (hp1q, . . . , pnqi, p'q) : ({1, . . . , n}, ') is a
rule of inference AxiomN :=
DeductionN :=
- (hp1q, . . . , p1qi, p'q) : (1, . . . , n) is a
deduction from N of ' . Important ∆-definable functions: Num(a) := p a q, TermSub(puq, pxq, ptq) := pux
t q,
Sub(p'q, pxq, ptq) := p'x
t q.
SLIDE 21
∆-definable sets and functions Using an appropriate notion of “construction sequence”, we get a ∆-formula Num(x, y) which defines the function Num(a) := p a q.
SLIDE 22 ∆-definable sets and functions Using an appropriate notion of “construction sequence”, we get a ∆-formula Num(x, y) which defines the function Num(a) := p a q. This means:
= Num(a, b) for all (a, b) 2 N2 such that b = p a q
= ¬Num(a, b) for all (a, b) 2 N2 such that b 6= p a q
SLIDE 23
∆-definable sets and functions Similarly (by a more complicated “construction sequence”), there is a ∆-formula Sub(x1, x2, x3, y) which define the function Sub(p'q, pxq, ptq) := p'x
t q.
SLIDE 24 ∆-definable sets and functions Similarly (by a more complicated “construction sequence”), there is a ∆-formula Sub(x1, x2, x3, y) which define the function Sub(p'q, pxq, ptq) := p'x
t q.
This means: for all (a, b, c, d) 2 N4,
= Sub(a, b, c, d) if a = p'q and b = pxq and c = ptq and d = p'x
t q for
some formula ' and variable symbol x and term t
= ¬Sub(a, b, c, d) otherwise.
SLIDE 25 ∆-definable sets and functions Using ∆-formulas Num(x, y) and Sub(x1, x2, x3, y) (among other useful ∆- formulas such as Free and Substitutable)), we get ∆-formulas defining sets: LogicalAxiom :=
- p'q : ' is a logical axiom
AxiomN :=
, RuleOfInf :=
- (c, a) : c = hp1q, . . . , pnqi and a = p'q
where ({1, . . . , n}, ') is a rule of inference . Finally, we get a ∆-formula DeductionN(y, z) which defines the set DeductionN :=
- (c, a) : c = hp1q, . . . , p1qi and a = p'q
where (1, . . . , n) is a deduction from N of ' .
SLIDE 26
The Σ-formula ThmN(x) The set ThmN := {p'q : N ` '} is defined by Σ-formula ThmN(x) :⌘ (9y)DeductionN(y, x).
SLIDE 27 The Σ-formula ThmN(x) The set ThmN := {p'q : N ` '} is defined by Σ-formula ThmN(x) :⌘ (9y)DeductionN(y, x). This means: for every a 2 N,
= Thm(a) if a = p'q for some formula ' such that N ` ', (In this case, N ` Thm(a) since N proves every Σ-sentence which is true in N by Proposition 5.3.13.)
= ¬Thm(a) otherwise. (We cannot conclude that N ` ¬Thm(a) since ¬Thm(a) is (equivalent to) a Π-sentence.)
SLIDE 28
The Σ-formula ThmN(x) The set ThmN := {p'q : N ` '} is defined by Σ-formula ThmN(x) :⌘ (9y)DeductionN(y, x). There is no obvious way to rewrite ThmN(x) as a ∆-sentence (in fact, this is impossible). For instance, we cannot replace (9y) with (9y < xxx), since this would imply that every formula of length ` provable by ' has a deduction of length < ``` (which is false).
SLIDE 29
Representable ) Σ-Definable Previously, we showed that every ∆-definable set is representable. (This is a straightforward corollary of Proposition 5.3.13: N proves every Σ- sentence which is true in N.) Next, we show that every representable set is Σ-definable.