Next: Rational Function Reconstruction
Up: Interpolation and Rational Reconstruction
Previous: Evaluation, interpolation
We start with the elementary case of the
Chinese Remaindering Theorem
(Theorem 1).
Then we give a much more abstract version
(Theorem 2).
Then we state the Chinese Remaindering Theorem
and
the
Chinese Remaindering Algorithm
in the context of Euclidean domains.
Theorem 1 (Sun-Tsu, first century AD)
Let m
mathend000# and n
mathend000# be two relatively prime integers.
Let
s, t
mathend000# be such that
s m + t n = 1
mathend000#.
For every
a, b
mathend000# there exists
c
mathend000#
such that
where a convenient c
mathend000# is given by
c = a + (b - a) s m = b + (a - b)t n |
(46) |
Therefore for every
a, b
mathend000# the system
of equations
  |
(47) |
has a solution.
Proof.
First observe that Relation (
46) implies
c a mod m and c b mod n. |
(48) |
Now assume that
x
c mod
m n
mathend000# holds.
This implies
x c mod m and x c mod n |
(49) |
Thus Relations (48) and (49) lead to
x a mod m and x b mod n |
(50) |
Conversly
-
x
a mod m
mathend000# implies
x
c mod m
mathend000# that is m
mathend000# divides x - c
mathend000# and
-
x
b mod n
mathend000# implies
x
c mod n
mathend000# that is n
mathend000# divides x - c
mathend000#.
Since m
mathend000# and n
mathend000# are relatively prime it follows that m n
mathend000# divides x - c
mathend000#.
(Gauss Lemma).
Theorem 2
Let R
mathend000# be a commutative ring with unity and
I0, I1,..., In-1
mathend000# be ideals of R
mathend000#.
We consider the direct product of residue class rings
R/I0 x ... x R/In-1
mathend000#
(additions and multiplications are computed componentwise)
together with the homomorphism
M :  |
(51) |
Then we have
Proof.
The first statement is obvious.
Let us prove the second one.
Let
r,
r0,
r1,...,
rn-1
mathend000# be in R
mathend000#.
We look for the pre-image of
(
,...,
)
mathend000#.
Hence we look for r
mathend000# such that
M(r) = ( ,..., ) |
(53) |
that is
or
At this point of the proof we need the following lemma.
CONTINUING THEOREM'S
Proof.
With the previous lemma
Relation (
55),
for all
i,
j
mathend000# such that
0
i < j
n - 1
mathend000# holds, leads to
=  |
(61) |
or equivalently
= . |
(62) |
Relation (62) is a necessary condition
for the existence of a pre-image of r
mathend000# via the homomorphism M
mathend000#.
Therefore we proved the second statement of the theorem.
Let us prove the third one.
Let us ssume first that M
mathend000# is surjective.
Let i, j
mathend000# be such that
0
i < j
n - 1
mathend000#.
There exists r
R
mathend000# such that
Hence
1 - r Ii and r Ij |
(64) |
which implies
Ii + Ij = 1
mathend000#.
Conversly, let us assume that the ideals
I0,..., In-1
mathend000#
are pairwise coprime.
Let i
mathend000# be in the range
0 ... n - 1
mathend000# and consider
the product I
mathend000# of all ideals
I0,..., In-1
mathend000#
except Ii
mathend000#.
It is a classical result that Ii
mathend000# and I
mathend000# are coprime.
Let
ui
Ii
mathend000# and vi
I
mathend000# such that
ui + vi = 1
mathend000#.
Observe that for all
j = 0 ... n - 1
mathend000# we have
Now consider
(
,...,
)
R/I0 x ... x R/In-1
mathend000#.
Then
r = v0r0 + ... + vn-1rn-1 |
(66) |
satisfies
M(r) = ( ,..., ) |
(67) |
This concludes the proof of the theorem.
Corollary 1
Let R
mathend000# be a commutative ring with unity and
I0,..., In-1
mathend000# be ideals of R
mathend000#
such that we have
Ii + Ij = R
mathend000# for every i, j
mathend000# with
0
i < j
n - 1
mathend000#.
Let I
mathend000# be the product of the ideals
I0,..., In-1
mathend000#.
Then we have the ring isomorphism
R/I R/I0 x ... x R/In-1 |
(68) |
and the group isomorphism of the multiplicative groups
(R/I) * (R/I0) * x ... x (R/In-1) * |
(69) |
Proof.
The following ring isomorphism follows from Theorem
2
R/( Ii) R/I0 x ... x R/In-1 |
(70) |
It is a well known fact that if the ideals
I0,...,
In-1
mathend000# are pairwise coprime
(
Ii + Ij = R
mathend000# for every i, j
mathend000# with
0
i < j
n - 1
mathend000#)
then their product is equal to their intersection [van91].
Therefore, we have the ring isomorphism of the statement.
The group isomorphism follows from the previous ring isomorphism
and the fact that the element
( ,..., ) R/I0 x ... x R/In-1 |
(71) |
is a unit iff every
mathend000#
is a unit of R/Ii
mathend000#.
From now on R
mathend000# denotes an Euclidean domain.
Corollary 2
Let
m0,..., mn-1
mathend000# be n
mathend000# elements pairwise coprime in the Euclidean domain R
mathend000#.
(Hence, for all
0
i < j < n
mathend000# we have
gcd(mi, mj) = 1
mathend000#.)
Let
m = m0 ... mr-1
mathend000#.
Then, we have the ring isomorphism
R/m R/m0 x ... x R/mn-1 |
(72) |
and the group isomorphism of the multiplicative groups
(R/m) * (R/m0) * x ... x (R/mn-1) * |
(73) |
Proof.
Assume that the algorithm terminates without error,
that is the case if every
gi
mathend000# is the gcd of mi
mathend000# and
mathend000#
(which are assumed to be coprime).
Then, for
i = 0 ... n - 1
mathend000# we have
ui mi + vi = 1 |
(74) |
Hence
rivi rimod mi |
(75) |
and for
j = 0 ... n - 1
mathend000# with j
i
mathend000# we have
rivi 0 mod mj |
(76) |
The specification of Algorithm 4 follow
easily from Relation (75) and (76).
Remark 6
It is important to observe that Algorithm 4
computes a solution r
mathend000# of the system of equations given by
r rimod mi for i = 0 ... n - 1 |
(77) |
Any other solution r'
mathend000# of (77)
satisfies
r
r'mod m
mathend000# where m
mathend000# is the product
of the moduli
m0,..., mr-1
mathend000#.
This follows from the fact the mi
mathend000#'s are pairwise coprime
and from Corollary 2.
Therefore the set all solutions of (77)
is of the form
{r + k m | k R} |
(78) |
However, in practice, we need only one solution.
In the next two results
(Theorem 3
and Theorem 4)
by imposing
where d
mathend000# is the Euclidean size of R
mathend000#,
we manage to restrict to a unique solution.
Proof.
Except for the complexity result (that can be found
in [
GG99] as Theorem 5.7) and the uniqueness, this theorem follows
from Algorithm
4.
The uniqueness follows from the constraint
deg(
f ) <
n
mathend000#.
Indeed, assume that there are two polynomials f
mathend000# and g
mathend000# solutions
of (80).
Then we have
f g mod mi for i = 0 ... r - 1. |
(81) |
and thus
f g mod m |
(82) |
Hence m
mathend000# divides f - g
mathend000# although
deg(m) = n > deg(f - g)
mathend000# holds.
Therefore f = g
mathend000#.
Proof.
Except for the complexity result (that can be found
in [
GG99] as Theorem 5.8) and the uniqueness,
this theorem follows
from Algorithm
4.
The proof of the uniqueness is quite easy to establish.
We reproduce below the ALDOR code for the Chinese Remaindering Algorithm.
More precisely, the operation interpolate satisfies exactly the
specification of Algorithm 4.
After the definition of the ChineseRemaindering domain
we prove that its operation combine satisifies the
specification of Algorithm 4
for the case of two moduli m1
mathend000# and m2
mathend000#.
The reader is left with the proof of the operation interpolate
which implements the general case (with r
2
mathend000# moduli).
ChineseRemaindering(E: EuclideanDomain): with {
combine: (E, E) -> (E, E) -> E;
interpolate: (List E, List E) -> E;
} == add {
combine(m1: E, m2: E): (E, E) -> E == {
local u1: E;
assert(m1 = unitCanonical m1);
assert(m2 = unitCanonical m2);
fn(r1: E, r2: E): E == {
r1__new := r1 rem m1;
r := (r2 - r1__new) rem m2 ;
r := (r * u1) rem m2 ;
r := r1__new + r * m1;
}
(u1, u2, g) := extendedEuclidean(m1, m2);
fn
}
interpolate(lm: List E, lr: List E): E == {
m := first lm;
r := first lr rem m;
for mi in rest lm for ri in rest lr repeat {
r := combine(m, mi)(r, ri);
m := m * mi;
}
return r;
}
}
Proof.
We need to prove that
combine(m1,m2)(r1,r2) returns a qunatity
congruent to that computed by Algorithm
4
modulo
m1 m2
mathend000#.
According to Algorithm 4 the case of two moduli m1
mathend000# and m2
mathend000#
requires the following computations
- r
mathend000# := 0
mathend000#
-
(u1, v1, g1)
mathend000# := extendedEuclidean(m1, m2
mathend000#)
- c1
mathend000# := r1v1
mathend000# rem m1
mathend000#
- r
mathend000# :=
r + c1m2
mathend000#
-
(u2, v2, g2)
mathend000# := extendedEuclidean(m2, m1
mathend000#)
- c2
mathend000# := r2v2
mathend000# rem m2
mathend000#
- r
mathend000# :=
r + c2m1
mathend000#
This can be simplified as follows:
-
(u1, v1, g1)
mathend000# := extendedEuclidean(m1, m2
mathend000#)
- c1
mathend000# := r1v1
mathend000# rem m1
mathend000#
- c2
mathend000# := r2u1
mathend000# rem m2
mathend000#
- r
mathend000# :=
c1m2 + c2m1
mathend000#
From the relations
c1m2 r1v1m2mod m1m2, |
c2m1 r2u1m1mod m1m2, |
u1m1 + v1m2 = 1, |
|
(84) |
we deduce the following congruences
mod m1m2
mathend000#
r |
 |
c1m2 + c2m1 |
|
 |
r1v1m2 + r2u1m1 |
|
 |
r1(1 - u1m1) + r2u1m1 |
|
 |
r1 + (r2 - r1)u1m1 |
|
(85) |
This last expression is exactly the quantity computed
by combine(m1,m2)(r1,r2).
This proves the implementation of the above operation combine.
Next: Rational Function Reconstruction
Up: Interpolation and Rational Reconstruction
Previous: Evaluation, interpolation
Marc Moreno Maza
2007-01-10