reserve i,i1,i2,i3,i4,i5,j,r,a,b,x,y for Integer,
  d,e,k,n for Nat,
  fp,fk for FinSequence of INT,
  f,f1,f2 for FinSequence of REAL,
  p for Prime;
reserve fr for FinSequence of REAL;
reserve fr,f for FinSequence of INT;
reserve b,m for Nat;
reserve b for Integer;

theorem
  p>2 & a gcd p = 1 & b gcd p = 1 & not a is_quadratic_residue_mod p &
  not b is_quadratic_residue_mod p implies a*b is_quadratic_residue_mod p
proof
  assume that
A1: p>2 and
A2: a gcd p = 1 and
A3: b gcd p = 1 and
A4: not a is_quadratic_residue_mod p and
A5: not b is_quadratic_residue_mod p;
A6: a*b gcd p = 1 by A2,A3,WSIERP_1:6;
  set l = (p-'1) div 2;
  (b|^l + 1) mod p = 0 by A1,A3,A5,Th21;
  then
A7: p divides (b|^l + 1) by INT_1:62;
A8: (a|^l +1)*(b|^l +1) = a|^l * b|^l +a|^l*1 +1*b|^l +1*1
    .= (a*b)|^l +a|^l + b|^l +1 by NEWTON:7
    .= ((a*b)|^l +1) +(a|^l + 1) - (1- b|^l);
  (a|^l +1) mod p = 0 by A1,A2,A4,Th21; then
A9: p divides (a|^l +1) by INT_1:62; then
A10: p divides (a|^l +1)*(b|^l +1) by INT_2:2;
   now
    assume not a*b is_quadratic_residue_mod p;
    then ((a*b)|^l +1) mod p = 0 by A1,A6,Th21;
    then p divides ((a*b)|^l +1) by INT_1:62;
    then p divides ((a*b)|^l +1) +(a|^l + 1) by A9,WSIERP_1:4;
    then p divides (1- b|^l) by A10,A8,Th2;
    then p divides ((b|^l +1) + (1- b|^l)) by A7,WSIERP_1:4;
    hence contradiction by A1,NAT_D:7;
  end;
  hence thesis;
end;
