In this note I will show how to implement T*(x,y) in the language of arithmetic.
Any nonempty finite sequence of natural numbers an ...
a2 a1 a0 can be encoded as a single number t,
namely by selecting a number p that is larger than all of them and
regarding an...a2a1a0
to be the p-ary representation of t. The sequence 3 5 7 0 1 for
instance could be encoded by the number 35701, if one selects p to be 10.
The number t is calculated by the formula t = i=0n ai pi.
The sequence 3 5 13 0 1 can not be encoded in base 10 however.
For this sequence one needs to choose p larger than 13. In general the
choice of p depends on the sequence, so the sequence is encoded not
just by t, but really by the pair (t,p).
This encoding is not unique however. The pair (35701,10) for instance is the encoding of the sequence 3 5 7 0 1, but it is also the encoding of the sequence 0 3 5 7 0 1. Because uniqueness is important here, I choose (35701,10) to be the encoding of the sequence 3 5 7 0 1 only, i.e. I only encode sequences an ... a2 a1 a0 with an > 0. Now a pair (0,p) does not encode a sequence, but any pair (t,p) with t > 0 does.
Write Last(t,p,y) if y is the last number in the sequence encoded by t and p, i.e. if y = a0. The formula Last(t,p,y) can be expressed arithmetically as
y < p
r (t = rp+y).
0 < x < p
n
s
(t = xpn+s
s < pn).
u < p v < p
i
r
s
(t = rpi+2+upi+1+vpi+s
s < pi
r+u > 0).
Now the reflexive and transitive closure T*(x,y) of a formula T(x,y) with free variables x and y can almost be defined by
t
p
(First(t,p,x)
Last(t,p,y)
(Neighbours(t,p,u,v)
T(u,v)).
t
p
(First(t,p,x+1)
Last(t,p,y+1)
(Neighbours(t,p,u+1,v+1)
T(u,v)).
Let T(x1,x2,x3,y1,y2,y3) be an arithmetical formula with six free variables x1, x2, x3, y1, y2 and y3. Its reflexive and transitive closure T*(x1,x2,x3,y1,y2,y3) is the smallest predicate satisfying
Next I will show how to implement T*(x1,x2,x3,y1,y2,y3) in the language of arithmetic.
Three equally long nonempty finite sequences of natural numbers an ... a2 a1 a0 and bn ... b2 b1 b0 and cn ... c2 c1 c0 can be encoded by three numbers t1, t2 and t3, namely by selecting a number p that is larger than all numbers in the three sequences and regarding an...a2a1a0 to be the p-ary representation of t1, and bn...b2b1b0 to be the p-ary representation of t2, and cn...c2c1c0 to be the p-ary representation of t3. The triple of sequences is thus encoded by the quadruple (t1,t2,t3,p).
In order to make the encoding unique, I only encode sequences in which an > 0 and bn > 0 and cn > 0.
Write Last(t1,t2,t3,p,y1,y2,y3) if y1, y2 and y3 are the last numbers in the sequences, i.e. if (y1,y2,y3) = (a0,b0,c0). The formula Last(t1,t2,t3,p,y1,y2,y3) can be expressed arithmetically as
y1 < p
r1 (t1=r1p+y1)
y2 < p
r2 (t2 = r2p+y2)
y3 < p
r3 (t3 = r3p+y3).
0 < x1 < p
0 < x2 < p
0 < x3 < p
n (
s1
(t1 = x1pn+s1
s1 < pn)
s2
(t2 = x2pn+s2
s2 < pn)
s3
(t3 = x3pn+s3
s3 < pn)
).
u1 < p u2 < p
u3 < p
v1 < p
v2 < p
v3 < p
i (
r1
s1
(t1=r1pi+2+u1pi+1+v1pi+s1
s1 < pi
r1+u1 > 0)
r2
s2
(t2 = r2pi+2+u2pi+1+v2pi+s2
s2 < pi
r2+u2 > 0)
r3
s3
(t3 = r3pi+2+u3pi+1+v3pi+s3
s3 < pi
r3+u3 > 0)
).
t1
t2
t3
p
(First(t1,t2,t3,p,x1+1,x2+1,x3+1)
Last(t1,t2,t3,p,y1+1,y2+1,y3+1)
(Neighbours(t1,t2,t3,p,u1+1,u2+1,u3+1,v1+1,v2+1,v3+1)
T(u1,u2,u3,v1,v2,v3)).
However, arithmetic only features 0,1,+,x and =. The reason that exponentiation is not included in the definition of arithmetic, is that it doesn't add to the expressiveness of the language: the formula x = yn is expressible in exponentiation-free arithmetic: Let E(i,u,y,j,v,y') be the formula
i = j+1 u = vy
y' = y
"p is prime"
n (q = pn)
d (
d
1
k (q = kd)
k (d = kp)
)
The only requirement on the number p in the implementation of reflexive and transitive closure above, is that it is sufficiently large. No generality is lost if one requires p to be prime. Now the formula First(t,p,x) can be reformulated as
0 < x < p
q
("p is prime"
n (q = pn)
s
(t = xq+s
s < q)).
u < p v < p
q
("p is prime"
i (q = pi)
r
s
(t = rqpp+uqp+vq+s
s < q
r+u > 0)).
Rob van Glabbeek | rvg@cs.stanford.edu |