reserve a,b,c,k,k9,m,n,n9,p,p9 for Nat;
reserve i,i9 for Integer;
reserve X for Pythagorean_triple;

theorem
  n > 2 implies ex X st X is non degenerate & n in X
proof
  assume
A1: n > 2;
  per cases;
  suppose
    n is even;
    then consider m being Nat such that
A2: n = 2*m;
    reconsider m as Element of NAT by ORDINAL1:def 12;
    set c = 1*(m^2 + 1^2);
    set b = 1*(2*1*m);
    2*m > 2*1 by A1,A2;
    then
A3: m > 1 by XREAL_1:64;
    then m^2 > 1^2 by SQUARE_1:16;
    then m^2 - 1^2 > 0 by XREAL_1:50;
    then reconsider a = 1*(m^2 - 1^2) as Element of NAT by INT_1:3;
    reconsider X = { a,b,c } as Pythagorean_triple by A3,Def5;
    take X;
    a <> 0 by A3,SQUARE_1:16;
    hence not 0 in X by A1,A2,ENUMSET1:def 1;
    thus thesis by A2,ENUMSET1:def 1;
  end;
  suppose
    n is odd;
    then consider i such that
A4: n = 2*i + 1 by ABIAN:1;
A5: 2*i >= 2*1 by A1,A4,INT_1:7;
    then i >= 1 by XREAL_1:68;
    then reconsider m = i as Element of NAT by INT_1:3;
    reconsider a = 1*((m + 1)^2 - m^2) as Element of NAT by A4,ORDINAL1:def 12;
    set b = 1*(2*m*(m + 1));
    set c = 1*((m + 1)^2 + m^2);
    m <= m + 1 by NAT_1:11;
    then reconsider X = { a,b,c } as Pythagorean_triple by Def5;
    take X;
    a = 2*m + 1 & c = m^2 + 2*m + m^2 + 1;
    hence not 0 in X by A5,ENUMSET1:def 1;
    thus thesis by A4,ENUMSET1:def 1;
  end;
end;
