reserve i,s,t,m,n,k for Nat,
        c,d,e for Element of NAT,
        fn for FinSequence of NAT,
        x,y for Integer;
reserve p for Prime;

theorem
  for i,n st n>1 & i,n are_coprime holds
    order(i,n),s are_coprime iff order(i|^s,n) = order(i,n)
proof let i,n;
  assume A1:n>1 & i,n are_coprime;
  thus order(i,n),s are_coprime implies order(i|^s,n) = order(i,n)
    proof assume order(i,n),s are_coprime;
      then order(i,n) gcd s = 1 by INT_2:def 3;
      then order(i,n) div (order(i,n) gcd s) = order(i,n) by NAT_2:4;
     hence thesis by A1,Th14;
    end;
   assume order(i|^s,n) = order(i,n);
   then A2:order(i,n) div (order(i,n) gcd s) = order(i,n) by A1,Th14;
   set d = order(i,n) gcd s;
A3:d divides order(i,n) by NAT_D:def 5;
   then A4:(order(i,n) div d)*1 = (order(i,n) div d)*d by A2,NAT_D:3;
A5:order(i,n)>0 by A1,PEPIN:def 2;
   then A6:d<=order(i,n) by A3,NAT_D:7;
   d<>0 by A5,INT_2:5;
   then order(i,n) div d <> 0 by A6,NAT_2:13;
   then d = 1 by A4,XCMPLX_1:5;
  hence thesis by INT_2:def 3;
end;
