
theorem
  for a,b be square Nat st a,b are_coprime holds
    (a - b)/2 is square implies b mod 3 = 1
  proof
    let a,b be square Nat such that
    A1: a,b are_coprime;
    assume (a - b)/2 is square; then
    reconsider s = (a - b)/2 as square Nat;
    A2: (a + -b) mod 3 = (2*s) mod 3
    .= ((2 mod (2+1))*(s mod 3)) mod 3 by NAT_D:67
    .= (2*(s mod 3)) mod 3;
    A3: a mod 3 is trivial & b mod 3 is trivial & s mod 3 is trivial by SM3;
    A4: not 3 is trivial;
    per cases by A3,NAT_2:def 1;
    suppose
      s mod 3 = 1; then
      B2: 2 mod (2 + 1) = ((a mod 3) - (b mod 3)) mod 3 by A2,INT_6:7;
      per cases by A3,NAT_2:def 1;
      suppose
        C1: a mod 3 = 0;
        max (a mod 3, b mod 3) > 0 by A1,A4,COM; then
        not b mod 3 = 0 by C1;
        hence thesis by A3,NAT_2:def 1;
      end;
      suppose
        C1: a mod 3 = 1;
        per cases by A3,NAT_2:def 1;
        suppose b mod 3 = 0;
          hence thesis by C1,B2;
        end;
        suppose b mod 3 = 1;
          hence thesis;
        end;
      end;
    end;
    suppose
      B1: s mod 3 = 0;
      2*s, b*1 are_coprime by NEWTON02:5,A1; then
      max (b mod 3, s mod 3) > 0 by NEWTON01:41,A4,COM; then
      b mod 3 > 0 by B1;
      hence thesis by A3,NAT_2:def 1;
    end;
  end;
