
theorem
  for u being INT-valued FinSequence, m being CR_Sequence st len u =
  len m ex z being Integer st 0 <= z & z < Product(m) & for i being Nat
  st i in dom u holds z,u.i are_congruent_mod m.i
proof
  let u be INT-valued FinSequence, m be CR_Sequence;
  assume
A1: len u = len m;
  take z = to_int(u,m);
  now
    set c = the CR_coefficients of m;
    let i be Nat;
    assume
A2: i in dom u;
    set s = Sum(u(#)c) mod Product(m);
    s mod Product(m) = Sum(u(#)c) mod Product(m) by NAT_D:65;
    then
A3: s, Sum(u(#)c) are_congruent_mod Product(m) by NAT_D:64;
A4: dom m = Seg(len u) by A1,FINSEQ_1:def 3
      .= dom u by FINSEQ_1:def 3;
    then ex y being Integer st y * m.i = Product(m) by A2,Th10;
    then s, Sum(u(#)c) are_congruent_mod m.i by A3,INT_1:20;
    then
A5: s mod m.i = Sum(u(#)c) mod m.i by NAT_D:64;
    dom m = Seg(len u) by A1,FINSEQ_1:def 3
      .= dom u by FINSEQ_1:def 3;
    then m.i in rng m by A2,FUNCT_1:3;
    then
A6: m.i > 0 by PARTFUN3:def 1;
    Sum(u(#)c), u.i are_congruent_mod m.i by A1,A2,A4,Th29;
    then Sum(u(#)c) mod m.i = u.i mod m.i by NAT_D:64;
    then s,u.i are_congruent_mod m.i by A6,A5,NAT_D:64;
    hence z,u.i are_congruent_mod m.i by A1,Def5;
  end;
  hence thesis by A1,Th31;
end;
