reserve d,i,j,k,m,n,p,q,x,k1,k2 for Nat,
  a,c,i1,i2,i3,i5 for Integer;

theorem Th48:
  p > 1 & i,p are_coprime & order(i,p) divides n implies (i |^ n) mod p = 1
proof
  assume that
A1: p > 1 and
A2: i,p are_coprime and
A3: order(i,p) divides n;
  consider t being Nat such that
A4: n = order(i,p)*t by A3,NAT_D:def 3;
  reconsider t as Element of NAT by ORDINAL1:def 12;
  (i |^ n) mod p = ((i |^ order(i,p)) |^ t) mod p by A4,NEWTON:9
    .= (((i |^ order(i,p)) mod p) |^ t ) mod p by EULER_2:22
    .= ((1) |^ t) mod p by A1,A2,Def2
    .= 1 by A1,NAT_D:24;
  hence thesis;
end;
