reserve x,y,z for Real,
  a,b,c,d,e,f,g,h for Nat,
  k,l,m,n,m1,n1,m2,n2 for Integer,
  q for Rational;
reserve fs,fs1,fs2,fs3 for FinSequence;
reserve D for non empty set,
  v,v1,v2,v3 for object,
  fp for FinSequence of NAT,
  fr,fr1,fr2 for FinSequence of INT,
  ft for FinSequence of REAL;
reserve x,y,t for Integer;

theorem
  a gcd b=1 & a*b=c|^d implies ex e,f st a=e|^d & b=f|^d
proof
  assume that
A1: (a gcd b)=1 and
A2: a*b=c|^d;
  set e=a gcd c;
  e divides c by NAT_D:def 5;
  then
A3: e|^d divides c|^d by Th14;
  e divides a by NAT_D:def 5;
  then e gcd b=1 by A1,Th15,NEWTON:57;
  then e|^d gcd b=1 by Th12;
  then e|^d divides a by A2,A3,Th29;
  then consider g be Nat such that
A4: (e|^d)*g=a by NAT_D:def 3;
  reconsider g as Element of NAT by ORDINAL1:def 12;
A5: now
    assume
A6: d<>0;
    then consider d1 being Nat such that
A7: d=1+d1 by NAT_1:10,14;
    reconsider d1 as Element of NAT by ORDINAL1:def 12;
A8: d>=1 by A6,NAT_1:14;
A9: now
      assume
A10:  e<>0;
      then
A11:  a<>0 or c <>0 by INT_2:5;
      then
A12:  a <> 0 by A2,CARD_4:3;
A13:  now
        reconsider e1=e as Real;
        assume
A14:    c <>0;
        then consider a1,c1 being Integer such that
A15:    a=e*a1 and
A16:    e*c1=c and
A17:    a1,(c1 qua Integer) are_coprime by INT_2:23;
        reconsider a1,c1 as Element of NAT by A12,A14,A15,A16,Lm6;
        a1=(e|^(d1+1))*g/e by A4,A7,A10,A15,XCMPLX_1:89
          .=(e*(e|^d1)*g)/e by NEWTON:6
          .=e*((e|^d1)*g)/e
          .=(e|^d1)*g by A10,XCMPLX_1:89;
        then
A18:    g divides a1;
        (a1 gcd c1)=1 by A17,INT_2:def 3;
        then (g gcd c1)=1 by A18,Th15,NEWTON:57;
        then
A19:    (g gcd c1|^d)=1 by Th12;
A20:    e1|^d<>0 by A10,CARD_4:3;
        c1=c/e by A10,A16,XCMPLX_1:89;
        then
A21:    c1|^d=(e|^d)*(g*b)/(e|^d) by A2,A4,PREPOWER:8
          .=g*b by A20,XCMPLX_1:89;
        then g divides (c1|^d);
        then g=1 by A19,NEWTON:49;
        hence thesis by A4,A21;
      end;
      now
        assume 0=c;
        then
A22:    b=0 by A2,A8,A11,NEWTON:11,XCMPLX_1:6;
        then a=1 by A1,NEWTON:52;
        then
A23:    a=1|^d;
        b=0|^d by A6,A22,NAT_1:14,NEWTON:11;
        hence thesis by A23;
      end;
      hence thesis by A13;
    end;
    now
      assume e=0;
      then
A24:  a=0 by INT_2:5;
      then b=1 by A1,NEWTON:52;
      then
A25:  b=1|^d;
      a=0|^d by A6,A24,NAT_1:14,NEWTON:11;
      hence thesis by A25;
    end;
    hence thesis by A9;
  end;
  now
    assume
A26: d=0;
    then
A27: a*b=1 by A2,NEWTON:4;
    then b divides 1;
    then b=1 by Th15;
    then
A28: b=1|^0;
    a divides 1 by A27;
    then a=1 by Th15;
    then a=1|^0;
    hence thesis by A26,A28;
  end;
  hence thesis by A5;
end;
