.

The command ChineseRemainderTheorem implements the algorithm suggested by Theorem 5.1.4. In the following example, we compute a prime over $ (3)$ and a prime over $ (5)$ of the ring of integers of $ \mathbf{Q}(\sqrt[3]{2})$, and find an element of $ \O_K$ that is congruent to $ \sqrt[3]{2}$ modulo one prime and $ 1$ modulo the other.
   > R<x> := PolynomialRing(RationalField());
   > K<a> := NumberField(x^3-2);
   > OK := RingOfIntegers(K);
   > I := Factorization(3*OK)[1][1];
   > J := Factorization(5*OK)[1][1];
   > I;
   Prime Ideal of OK
   Two element generators:
       [3, 0, 0]
       [4, 1, 0]
   > J;
   Prime Ideal of OK
   Two element generators:
       [5, 0, 0]
       [7, 1, 0]
   > b := ChineseRemainderTheorem(I, J, OK!a, OK!1);
   > K!b;
   -4
   > b - a in I;
   true
   > b - 1 in J;
   true



William Stein 2012-09-24