
theorem Th19:
  for n being Nat holds
    -1,1 are_congruent_mod n iff (n = 2 or n = 1)
proof
  let n be Nat;
   hereby assume -1,1 are_congruent_mod n;
   then consider k being Integer such that A1: n * k = -2;
   k < 0 & n <> 0 by A1;
   then A2: k <= -1 by INT_1:8;
   now assume A3: n <> 2;
     now assume n <> 1;
       then not(n=0 or ... or n = 2) by A1,A3;
       then not(n <= 2);
       then n >= 2+1 by NAT_1:13;
       then n >= 3 & k < 0 by A1;
       then A4: n * k <= 3 * k by XREAL_1:65;
       3 * k <= 3 * (-1) by A2,XREAL_1:64;
       hence contradiction by A1,A4,XXREAL_0:2;
       end;
     hence n = 1;
     end;
   hence n = 2 or n = 1;
   end;
   assume A5: n = 2 or n = 1;
   per cases by A5;
   suppose n = 2;
     then n * (-1) = -2;
     hence -1,1 are_congruent_mod n;
     end;
   suppose n = 1;
     hence -1,1 are_congruent_mod n by INT_1:13;
     end;
end;
