152 Lecture 24
Encoding Huge Numbers
Recall from Lecture 23 the definition
I
n
= {z | z is an integer and 0 ≤ z<2
2
n
}.
Let
n
=
p∈I
n
p prime
p,
the product of all the primes less than 2
2
n
. By [51, Theorem 414, p. 341],
n
≥ 2
c2
2
n
for some constant c>0; so for n ≥ 1+loglog
1
c
,
n
≥ 2
2
2
n−1
.
We can define the number
n
with a short formula:
L
n
(x)
def
⇐⇒ x ≥ 1 ∧∀p (prime
n
(p) → div
n
(p, x))
∧∀y ≥ 1(∀p (prime
n
(p) → div
n
(p, y))) → x ≤ y.
In other words,
n
is the least positive integer divisible by all primes less
than 2
2
n
. Once we have defined
n
,wecansaythatx is an integer in the
range 0 ≤ x<
n
by just saying ∃L
n
() ∧ 0 ≤ x<.Herewearealso
using the fact that variables range over integers, which was not true with
Th(R, +, ≤).
Chinese Remaindering
The Chinese remainder theorem (Theorem B.1) says that we can do arith-
metic on numbers modulo
n
by doing arithmetic on their remainders mod-
ulo primes less than 2
2
n
.
We can express that r is the remainder of x modulo a prime p<2
2
n
with the predicate rem
n
(x, p, r) defined in Lecture 23. However, to get the
higher complexity bound, we must amend the definition slightly to avoid
saying anything about the size of x. We therefore redefine
intdiv
n
(x, y, q, r)
def
⇐⇒ ∃u mult
n
(u, q, y) ∧ x = u + r ∧ 0 ≤ r<y. (24.1)
Here we are taking advantage of the fact that quantifiers range over integers,
so that we do not have to include the predicates I
n
(q)andI
n
(r). We also
amend the definition of bit
n
(x, y) to replace the subexpression I
n
(x) ∧
I
n
(y)withx<
n
∧ y<
n
. The definitions of the other predicates—
rem
n
(x, y, r), div
n
(y, x), and so on—are the same. The inductive definition
of mult
n
(u, q, y) given in Lecture 23 constrains y to be in I
n
, but does not
say anything about u and q.Thusintdiv
n
(x, y, q, r), defined as in (24.1),
says nothing about the size of x or q.Consequently,div
n
(y, x), although
constraining y to be in I
n
, says nothing about x.