reserve a,b,c,k,l,m,n for Nat,
  i,j,x,y for Integer;

theorem Th10:
  m,n are_coprime implies for k holds ex i,j st i*m + j*n = k
proof
  reconsider a9=1, 09=0 as Integer;
  assume
A1: m,n are_coprime;
  then consider a such that
A2: ex i0,j0 being Integer st a = i0*m + j0*n & a>0 and
A3: for c st (ex i,j st c = i*m + j*n & c>0) holds a <= c by Th9;
  let k;
  consider i0,j0 being Integer such that
A4: a = i0*m + j0*n and
A5: a > 0 by A2;
A6: for c st (ex i,j st c = i*m + j*n & c > 0) holds c mod a = 0
  proof
    let b;
    assume ex i,j st b = i*m + j*n & b > 0;
    then consider i,j such that
A7: b=i*m + j*n and
    b>0;
    set t2 = j - ((b div a)*j0);
    set t1 = i - ((b div a)*i0);
A8: b mod a + a*(b div a) - a*(b div a) = b - a*(b div a) by A5,NAT_D:2;
    then reconsider c = t1*m + t2*n as Element of NAT by A4,A7;
    assume
A9: b mod a <> 0;
    c < a by A4,A5,A7,A8,NAT_D:1;
    hence contradiction by A3,A4,A9,A7,A8;
  end;
A10: a divides n
  proof
    per cases;
    suppose
      n = 0;
      hence thesis by NAT_D:6;
    end;
    suppose
      n > 0;
      then 09*m + a9*n > 0;
      then n mod a = 0 by A6;
      then n = a*(n div a) + 0 by A2,NAT_D:2;
      hence thesis by NAT_D:3;
    end;
  end;
  a divides m
  proof
    per cases;
    suppose
      m = 0;
      hence thesis by NAT_D:6;
    end;
    suppose
      m > 0;
      then a9*m + 09*n > 0;
      then m mod a = 0 by A6;
      then m = a*(m div a) + 0 by A2,NAT_D:2;
      hence thesis by NAT_D:3;
    end;
  end;
  then a divides (m gcd n) by A10,NAT_D:def 5;
  then a divides 1 by A1,INT_2:def 3;
  then ex b be Nat st 1 = a*b by NAT_D:def 3;
  then i0*m + j0*n = 1 by A4,NAT_1:15;
  then k = k*(i0*m + j0*n) .= (k*i0)*m + k*(j0*n);
  then k = (k*i0)*m + (k*j0)*n;
  hence thesis;
end;
