reserve X for set;
reserve a,b,c,k,m,n for Nat;
reserve i,j for Integer;
reserve r,s for Real;
reserve p,p1,p2,p3 for Prime;
reserve z for Complex;

theorem
  { [x,y,z] where x,y,z is positive Nat : 1+x^2+y^2 = z^2 } is infinite
  proof
    set A = { [x,y,z] where x,y,z is positive Nat : 1+x^2+y^2 = z^2 };
    deffunc x(Nat) = 2*$1;
    deffunc y(Nat) = 2*$1^2;
    deffunc z(Nat) = 2*$1^2+1;
    deffunc F(Nat) = [x($1),y($1),z($1)];
    consider f being ManySortedSet of NATPLUS such that
A1: for d being Element of NATPLUS holds f.d = F(d) from PBOOLE:sch 5;
A2: dom f = NATPLUS by PARTFUN1:def 2;
A3: rng f c= A
    proof
      let y be object;
      assume y in rng f;
      then consider k being object such that
A4:   k in dom f and
A5:   f.k = y by FUNCT_1:def 3;
      reconsider k as Element of NATPLUS by A4,PARTFUN1:def 2;
A6:   1+x(k)^2+y(k)^2 = z(k)^2;
      F(k) = f.k by A1;
      hence thesis by A5,A6;
    end;
    f is one-to-one
    proof
      let x1,x2 be object such that
A7:   x1 in dom f & x2 in dom f and
A8:   f.x1 = f.x2;
      reconsider x1,x2 as Element of NATPLUS by A7,PARTFUN1:def 2;
      F(x1) = f.x1 & F(x2) = f.x2 by A1;
      then x(x1) = x(x2) by A8,XTUPLE_0:3;
      hence thesis;
    end;
    hence thesis by A2,A3,CARD_1:59;
  end;
