reserve a,b,c,d,m,x,n,j,k,l for Nat,
  t,u,v,z for Integer,
  f,F for FinSequence of NAT;
reserve p,q,r,s for real number;
reserve a,b,c,d,m,x,n,k,l for Nat,
  t,z for Integer,
  f,F,G for FinSequence of REAL;
reserve q,r,s for real number;
reserve D for set;

theorem
  a|^2 + b|^2 = c|^2 implies 5 divides a or 5 divides b or 5 divides c
  proof
    assume
    A1: a|^2 + b|^2 = c|^2;
    A1a: a|^2 + (b|^2 - 1) = (c|^2 -1) &
      (a|^2 - 2) + (b|^2 + 1) = (c|^2 -1) by A1;
    A1b: a|^2 + (b|^2 + 1) = (c|^2 +1) &
      (a|^2 + 2) + (b|^2 - 1) = (c|^2 +1) by A1;
    A2: 2*2+1 = 5; then
    per cases by Th70,PEPIN:59;
    suppose
      5 divides c;
      hence thesis;
    end;
    suppose
      B1: 5 divides c|^2 - 1;
      per cases by A2,Th70,PEPIN:59;
      suppose 5 divides b;
        hence thesis;
      end;
      suppose 5 divides b|^2 - 1; then
        5 divides a|^2 by A1a,B1,INT_2:1;
        hence thesis by NAT_3:5,PEPIN:59;
      end;
      suppose 5 divides b|^2 + 1;
        hence thesis by A1a,B1,INT_2:1,Th85;
      end;
    end;
    suppose
      B2: 5 divides c|^2 + 1;
      per cases by A2,Th70,PEPIN:59;
      suppose 5 divides b;
        hence thesis;
      end;
      suppose 5 divides b|^2 + 1; then
        5 divides a|^2 by A1b,B2,INT_2:1;
        hence thesis by NAT_3:5,PEPIN:59;
      end;
      suppose 5 divides b|^2 - 1;
        hence thesis by A1b,B2,INT_2:1,Th85;
      end;
    end;
  end;
