reserve a,b,m,x,y,i1,i2,i3,i for Integer,
  k,p,q,n for Nat,
  c,c1,c2 for Element of NAT,
  z for set;
reserve fp,fp1 for FinSequence of NAT,

  b,c,d, n for Element of NAT,
  a for Nat;

theorem
  (for b,c st b in dom fp & c in dom fp & b<>c holds (fp.b gcd fp.c)=1)
  & (for b st b in dom fp holds fp.b > 0) implies for fp1 st (for b st b in dom
  fp holds (x-fp1.b) mod fp.b = 0 & (y-fp1.b) mod fp.b = 0) holds x,y
  are_congruent_mod Product(fp)
proof
  assume that
A1: for b,c st b in dom fp & c in dom fp & b<>c holds (fp.b gcd fp.c)=1 and
A2: for b st b in dom fp holds fp.b > 0;
  let fp1 such that
A3: for b st b in dom fp holds (x-fp1.b) mod fp.b = 0 & (y-fp1.b) mod fp
  .b = 0;
  per cases;
  suppose
    x>=y;
    then (x-y) in NAT by INT_1:3,XREAL_1:48;
    then reconsider k=(x-y) as Nat;
    for b st b in dom fp holds fp.b divides k
    proof
      let b such that
A4:   b in dom fp;
A5:   fp.b > 0 by A2,A4;
      (y-fp1.b) mod fp.b = 0 by A3,A4;
      then
A6:   fp.b divides (y-fp1.b) by A5,INT_1:62;
      (x-fp1.b) mod fp.b = 0 by A3,A4;
      then fp.b divides (x-fp1.b) by A5,INT_1:62;
      then fp.b divides ((x-fp1.b)-(y-fp1.b)) by A6,Lm4;
      then consider i being Integer such that
A7:   x-y=(fp.b)*i;
      i>=0
      proof
        assume i<0;
        then k<0 by A2,A4,A7,XREAL_1:132;
        hence contradiction;
      end;
      then i in NAT by INT_1:3;
      then reconsider i as Nat;
      thus thesis by A7;
    end;
    then Product fp divides k by A1,Th38;
    hence thesis;
  end;
  suppose
    x<y;
    then y-x>0 by XREAL_1:50;
    then (y-x) in NAT by INT_1:3;
    then reconsider k=y-x as Nat;
    for b st b in dom fp holds fp.b divides k
    proof
      let b such that
A8:   b in dom fp;
A9:   fp.b > 0 by A2,A8;
      (y-fp1.b) mod fp.b = 0 by A3,A8;
      then
A10:  fp.b divides (y-fp1.b) by A9,INT_1:62;
      (x-fp1.b) mod fp.b = 0 by A3,A8;
      then fp.b divides (x-fp1.b) by A9,INT_1:62;
      then fp.b divides ((y-fp1.b)-(x-fp1.b)) by A10,Lm4;
      then consider i being Integer such that
A11:  y-x=(fp.b)*i;
      k=(fp.b)*i by A11;
      then i>=0 by A2,A8,XREAL_1:132;
      then i in NAT by INT_1:3;
      then reconsider i as Nat;
      thus thesis by A11;
    end;
    then Product fp divides k by A1,Th38;
    then y,x are_congruent_mod Product fp;
    hence thesis by INT_1:14;
  end;
end;
