reserve k,n,m,l,p for Nat;
reserve n0,m0 for non zero Nat;
reserve f for FinSequence;
reserve x,X,Y for set;
reserve f1,f2,f3 for FinSequence of REAL;
reserve n1,n2,m1,m2 for Nat;
reserve I,j for set;
reserve f,g for Function of I, NAT;
reserve J,K for finite Subset of I;

theorem
  n0 is even & n0 is perfect implies
  ex p being Nat st 2|^p -' 1 is prime & n0 = 2|^(p -' 1)*(2|^p -' 1)
proof
  assume n0 is even;
  then consider k9,n9 be Nat such that
A1: n9 is odd and
A2: k9 > 0 and
A3: n0 = 2|^k9 * n9 by Th2;
  reconsider n2=n9 as non zero Nat by A1;
  set p=k9+1;
A4: p - 1 = p -' 1 by XREAL_0:def 2;
  then
A5: 2|^p - 1 = 2|^(p-'1+1)-2+1 .= 2|^(p-'1)*2-2+1 by NEWTON:6
    .= 2*(2|^(p-'1)-1)+1;
  assume n0 is perfect;
  then
A6: sigma n0 = 2 * n0;
  take p;
  2|^p > p by NEWTON:86;
  then
A7: 2|^p - 1 > p - 1 by XREAL_1:14;
  then
A8: 2|^p - 1 = 2|^p -' 1 by XREAL_0:def 2;
  sigma(2|^(p -' 1)) = (2|^(p -' 1 + 1) - 1)/(2 - 1) by Th30,INT_2:28
    .= 2|^p - 1 by A4;
  then
A9: (2|^p - 1)*sigma(n9) = 2 * 2|^(p -' 1)*n9 by A1,A3,A6,A4,Th3,Th37
    .= 2|^p*n9 by A4,NEWTON:6;
  then (2|^p -' 1) divides 2|^p*n2 by A8,INT_1:def 3;
  then (2|^p -' 1) divides n2 by A8,A5,Th3,EULER_1:13;
  then consider n99 be Nat such that
A10: n9 = (2|^p -' 1)*n99 by NAT_D:def 3;
  sigma(n9)*(2|^p - 1) = 2|^p*n99*(2|^p - 1) by A8,A9,A10;
  then
A11: sigma(n2) = (2|^p - 1)*n99 + n99 by A7,XCMPLX_1:5
    .= n9 + n99 by A7,A10,XREAL_0:def 2;
A12: n99 divides n9 by A10,NAT_D:def 3;
  k9>=0+1 by A2,NAT_1:13;
  then
B01: k9+1 >= 1+1 by XREAL_1:7;
  2|^p > p by NEWTON:86;
  then 2|^p > 2 by B01,XXREAL_0:2;
  then
A13: 2|^p -1 > 2-1 by XREAL_1:14;
  then (2|^p -' 1)*n2 > 1*n2 by A8,XREAL_1:68;
  then
A14: n99=1 by A10,A12,A11,Th33;
  hence 2|^p -' 1 is prime by A8,A10,A12,A13,A11,Th33;
  thus n0 = 2|^(p -' 1)*(2|^p -' 1) by A3,A4,A10,A14;
end;
