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;

theorem Th28:
  ex m1,n1 st m gcd n = m*m1+n*n1
proof
  m gcd n=|.m.| gcd |.n.| by INT_2:34;
  then consider m1,n1 such that
A1: |.m.|*m1+|.n.|*n1=(m gcd n) by Th27;
  now
    per cases;
    suppose
      m>=0 & n>=0;
      then |.m.|=m & |.n.|=n by ABSVALUE:def 1;
      hence thesis by A1;
    end;
    suppose
A2:   m>=0 & n<0;
      then |.n.|=-n by ABSVALUE:def 1;
      then (m gcd n)=m*m1+n*(-n1) by A1,A2,ABSVALUE:def 1;
      hence thesis;
    end;
    suppose
A3:   m<0 & n>=0;
      then |.m.|=-m by ABSVALUE:def 1;
      then (m gcd n)=m*(-m1)+n*n1 by A1,A3,ABSVALUE:def 1;
      hence thesis;
    end;
    suppose
      m<0 & n<0;
      then |.m.|=-m & |.n.|=-n by ABSVALUE:def 1;
      then m gcd n=m*(-m1)+n*(-n1) by A1;
      hence thesis;
    end;
  end;
  hence thesis;
end;
