reserve a,b,p,k,l,m,n,s,h,i,j,t,i1,i2 for natural Number;

theorem Th28:
  m > 0 implies n gcd m = m gcd (n mod m)
proof
  set r=n mod m, x=n gcd m, y=m gcd r;
  assume m>0;
  then consider t be Nat such that
A1: n = m * t + r and r < m by Def2;
  reconsider t as Element of NAT by ORDINAL1:def 12;
A2: x divides n by Def5;
A3: x divides m by Def5;
  then x divides r by A2,Th11;
  then
A4: x divides y by A3,Def5;
A5: y divides m by Def5;
A6: y divides r by Def5;
  y divides m*t by A5,Th9;
  then y divides n by A1,A6,Th8;
  then y divides x by A5,Def5;
  hence thesis by A4,Th5;
end;
