
theorem Th16:
  for i,j,k being Integer holds (i*j) gcd (i*k) = |.i.| * (j gcd k)
proof
  let i,j,k be Integer;
  per cases;
  suppose
A1: i = 0;
    hence (i*j) gcd (i*k) = 0 * (j gcd k) by INT_2:5
      .= |.i.| * (j gcd k) by A1,ABSVALUE:def 1;
  end;
  suppose
A2: i <> 0;
    set d = j gcd k, e = (i*j) gcd (i*k);
    per cases;
    suppose
A3:   d = 0;
      then
A4:   k = 0 by INT_2:5;
      j = 0 by A3,INT_2:5;
      hence thesis by A3,A4;
    end;
    suppose
A5:   d <> 0;
A6:   e divides i*k by INT_2:21;
A7:   i * d divides i * k by Th8,INT_2:21;
      i * d divides i * j by Th8,INT_2:21;
      then i * d divides e by A7,INT_2:22;
      then consider g being Integer such that
A8:   e = (i * d) * g by INT_1:def 3;
A9:   e divides i*j by INT_2:21;
      d * g divides j & d * g divides k
      proof
        consider h1 being Integer such that
A10:    ((i*d)*g)*h1 = i*j by A8,A9,INT_1:def 3;
        i*((d*g)*h1) = i*j by A10;
        then (d*g)*h1 = j by A2,XCMPLX_1:5;
        hence d * g divides j by INT_1:def 3;
        consider h2 being Integer such that
A11:    ((i*d)*g)*h2 = i*k by A8,A6,INT_1:def 3;
        i*((d*g)*h2) = i*k by A11;
        then (d*g)*h2 = k by A2,XCMPLX_1:5;
        hence thesis by INT_1:def 3;
      end;
      then d * g divides d by INT_2:22;
      then consider h3 being Integer such that
A12:  (d*g)*h3 = d by INT_1:def 3;
      d*(g*h3) = d * 1 by A12;
      then g*h3 = 1 by A5,XCMPLX_1:5;
      then
A13:  g divides 1 by INT_1:def 3;
      per cases by A13,INT_2:13;
      suppose
A14:    g = 1;
        i < 0 implies d*i < 0*i by A5,XREAL_1:69;
        hence thesis by A8,A14,ABSVALUE:def 1;
      end;
      suppose
A15:    g = -1;
A16:    now
          assume i > 0;
          then -- i > 0;
          then -i < 0;
          hence d*(-i) < 0*(-i) by A5,XREAL_1:69;
        end;
        (i*j) gcd (i*k) = (-i)*d by A8,A15;
        hence thesis by A2,A16,ABSVALUE:def 1;
      end;
    end;
  end;
end;
