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 Th25:
  Mersenne(19) is prime
  proof
    set M = Mersenne(19);
    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 Lm14,NAT_4:14;
    set p = 2*9+1;
    consider k being Nat such that
A5: n = 2*k*p+1 by A3,A4,XPRIMES1:19,Th23;
    n = 38*k+1 by A5;
    then k = 0 or ... or k = 19 by A2,Lm14,Lm27,NAT_1:60;
    then per cases;
    suppose k = 0;
      hence contradiction by A1,A5;
    end;
    suppose k = 1;
      hence contradiction by A3,A5,XPRIMES0:39;
    end;
    suppose k = 2;
      hence contradiction by A3,A5,XPRIMES0:77;
    end;
    suppose k = 3;
      hence contradiction by A3,A5,XPRIMES0:115;
    end;
    suppose k = 4;
      hence contradiction by A3,A5,XPRIMES0:153;
    end;
    suppose
A6:   k = 5;
      M = 191*2744+183 by Lm14;
      hence contradiction by A4,A5,A6,NAT_4:9;
    end;
    suppose
A7:   k = 6;
      M = 229*2289+106 by Lm14;
      hence contradiction by A4,A5,A7,NAT_4:9;
    end;
    suppose k = 7;
      hence contradiction by A3,A5,XPRIMES0:267;
    end;
    suppose k = 8;
      hence contradiction by A3,A5,XPRIMES0:305;
    end;
    suppose k = 9;
      hence contradiction by A3,A5,XPRIMES0:343;
    end;
    suppose k = 10;
      hence contradiction by A3,A5,XPRIMES0:381;
    end;
    suppose
A8:   k = 11;
      M = 419*1251+118 by Lm14;
      hence contradiction by A4,A5,A8,NAT_4:9;
    end;
    suppose
A9:   k = 12;
      M = 457*1147+108 by Lm14;
      hence contradiction by A4,A5,A9,NAT_4:9;
    end;
    suppose k = 13;
      hence contradiction by A3,A5,XPRIMES0:495;
    end;
    suppose k = 14;
      hence contradiction by A3,A5,XPRIMES0:533;
    end;
    suppose
A10:  k = 15;
      M = 571*918+109 by Lm14;
      hence contradiction by A4,A5,A10,NAT_4:9;
    end;
    suppose k = 16;
      hence contradiction by A3,A5,XPRIMES0:609;
    end;
    suppose
A11:  k = 17;
      M = 647*810+217 by Lm14;
      hence contradiction by A4,A5,A11,NAT_4:9;
    end;
    suppose k = 18;
      hence contradiction by A3,A5,XPRIMES0:685;
    end;
    suppose k = 19;
      hence contradiction by A3,A5,XPRIMES0:723;
    end;
  end;
