reserve a,b,i,k,m,n for Nat;
reserve s,z for non zero Nat;
reserve c for Complex;

theorem Th39:
  2|^(2|^z) mod 3 = 1
  proof
    defpred P[non zero Nat] means 2|^(2|^$1) mod 3 = 1;
A1: P[1]
    proof
      2|^(2|^1) = 2*2 by POLYEQ_5:1
      .= 3*1+1;
      hence thesis by NAT_D:def 2;
    end;
A2: for s st P[s] holds P[s+1]
    proof
      let s such that
A3:   P[s];
      2|^(s+1) = 2|^s*2 by NEWTON:6;
      then
A4:   2|^(2|^(s+1)) = 2|^(2|^s)|^2 by NEWTON:9
      .= 2|^(2|^s)*2|^(2|^s) by POLYEQ_5:1;
      (2|^(2|^s)*2|^(2|^s)) mod 3 = (1*1) mod 3 by A3,NAT_D:67;
      hence thesis by A4,NAT_D:24;
    end;
    for s holds P[s] from NAT_1:sch 10(A1,A2);
    hence thesis;
  end;
