reserve a,b,c,k,m,n for Nat;
reserve p for Prime;

theorem Th38:
  for q,s,t being Prime st q^2 = s^2 + t^2 holds
  s is even & t is odd or s is odd & t is even
  proof
    let q,s,t be Prime such that
A1: q^2 = s^2 + t^2;
    assume s is odd or t is even;
    then per cases;
    suppose
A2:   s is odd;
      now
        assume
A3:     t is odd;
        then q is even by A1,A2;
        then
A4:     q = 2 by LAGRA4SQ:13;
        9 <= s^2 & 9 <= t^2 by A2,A3,Lm4;
        then 9+9 <= s^2 + t^2 by XREAL_1:7;
        hence contradiction by A1,A4;
      end;
      hence thesis by A2;
    end;
    suppose t is even;
      then t = 2 by LAGRA4SQ:13;
      then q^2 - s^2 = 4 by A1;
      hence thesis by Th35;
    end;
  end;
