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 Th24:
  Mersenne(17) is prime
  proof
    set M = Mersenne(17);
    assume M is non prime;
    then consider n being Element of NAT such that
A1: 1 < n and
A2: n*n <= M and
A3: n is prime and
A4: n divides M by Lm13,NAT_4:14;
    set p = 2*8+1;
    consider k being Nat such that
A5: n = 2*k*p+1 by A3,A4,XPRIMES1:17,Th23;
    n = 34*k+1 by A5;
    then k = 0 or ... or k = 10 by A2,Lm13,Lm26,NAT_1:60;
    then per cases;
    suppose k = 0;
      hence contradiction by A1,A5;
    end;
    suppose k = 1;
      hence contradiction by A3,A5,XPRIMES0:35;
    end;
    suppose k = 2;
      hence contradiction by A3,A5,XPRIMES0:69;
    end;
    suppose
A6:   k = 3;
      M = 103*1272+55 by Lm13;
      hence contradiction by A4,A5,A6,NAT_4:9;
    end;
    suppose
A7:   k = 4;
      M = 137*956+99 by Lm13;
      hence contradiction by A4,A5,A7,NAT_4:9;
    end;
    suppose k = 5;
      hence contradiction by A3,A5,XPRIMES0:171;
    end;
    suppose k = 6;
      hence contradiction by A3,A5,XPRIMES0:205;
    end;
    suppose
A8:   k = 7;
      M = 239*548+99 by Lm13;
      hence contradiction by A4,A5,A8,NAT_4:9;
    end;
    suppose k = 8;
      hence contradiction by A3,A5,XPRIMES0:273;
    end;
    suppose
A9:   k = 9;
      M = 307*426+289 by Lm13;
      hence contradiction by A4,A5,A9,NAT_4:9;
    end;
    suppose k = 10;
      hence contradiction by A3,A5,XPRIMES0:341;
    end;
  end;
