reserve
  S for (4,1) integer bool-correct non empty non void BoolSignature,
  X for non-empty ManySortedSet of the carrier of S,
  T for vf-free integer all_vars_including inheriting_operations free_in_itself
  (X,S)-terms VarMSAlgebra over S,
  C for (4,1) integer bool-correct non-empty image of T,
  G for basic GeneratorSystem over S,X,T,
  A for IfWhileAlgebra of the generators of G,
  I for integer SortSymbol of S,
  x,y,z,m for pure (Element of (the generators of G).I),
  b for pure (Element of (the generators of G).the bool-sort of S),
  t,t1,t2 for Element of T,I,
  P for Algorithm of A,
  s,s1,s2 for Element of C-States(the generators of G);
reserve
  f for ExecutionFunction of A, C-States(the generators of G),
  (\falseC)-States(the generators of G, b);
reserve u for ManySortedFunction of FreeGen T, the Sorts of C;

theorem Th67:
  G is C-supported & f in C-Execution(A,b,\falseC) implies
  f.(s, t is_odd(b,A)).(the bool-sort of S).b = (t value_at(C,s)) mod 2 &
  f.(s, t is_even(b,A)).(the bool-sort of S).b = ((t value_at(C,s))+1) mod 2 &
  for z holds f.(s, t is_odd(b,A)).I.z = s.I.z &
  f.(s, t is_even(b,A)).I.z = s.I.z
  proof assume
A1: G is C-supported & f in C-Execution(A,b,\falseC);
    reconsider b0 = @b as Element of G,the bool-sort of S by AOFA_A00:def 22;
A2: \2(T,I) value_at(C,s) = 2 & \0(T,I) value_at(C,s) = 0 by Th36,Th40;
    then
A3: (t value_at(C,s)) mod (\2(T,I) value_at(C,s))
    = (t value_at(C,s)) mod 2 by Th64;
    then
A4: leq((t value_at(C,s)) mod (\2(T,I) value_at(C,s)),
    \0(T,I) value_at(C,s))
    = IFGT((t value_at(C,s)) mod 2, 0, FALSE, TRUE) by A2,AOFA_A00:55;
    reconsider Z = IFGT((t value_at(C,s)) mod 2, 0, FALSE, TRUE) as boolean
    object;
A5: f.(s, t is_odd(b,A)).(the bool-sort of S).b
    = succ(s,b0,\notleq(t mod \2(T,I),\0(T,I)) value_at(C,s))
    .(the bool-sort of S).b by A1,AOFA_A00:def 28
    .= \notleq(t mod \2(T,I),\0(T,I)) value_at(C,s) by A1,AOFA_A00:def 27
    .= \not(leq(t mod \2(T,I),\0(T,I)) value_at(C,s)) by Th31
    .= \notleq((t mod \2(T,I)) value_at(C,s),\0(T,I) value_at(C,s)) by Th45
    .= \notleq((t value_at(C,s)) mod (\2(T,I) value_at(C,s)),
    \0(T,I) value_at(C,s)) by Th44
    .= 'not' Z by A4,AOFA_A00:def 32;
    hereby
      per cases by PRE_FF:6;
      suppose
A6:     (t value_at(C,s)) mod 2 = 0;
        hence f.(s, t is_odd(b,A)).(the bool-sort of S).b
        = 'not' TRUE by A5,XXREAL_0:def 11
        .= (t value_at(C,s)) mod 2 by A6;
      end;
      suppose
A7:     (t value_at(C,s)) mod 2 = 1;
        hence f.(s, t is_odd(b,A)).(the bool-sort of S).b
        = 'not' FALSE by A5,XXREAL_0:def 11
        .= (t value_at(C,s)) mod 2 by A7;
      end;
    end;
A8: f.(s, t is_even(b,A)).(the bool-sort of S).b
    = succ(s,b0,leq(t mod \2(T,I),\0(T,I)) value_at(C,s))
    .(the bool-sort of S).b by A1,AOFA_A00:def 28
    .= leq(t mod \2(T,I),\0(T,I)) value_at(C,s) by A1,AOFA_A00:def 27
    .= leq((t mod \2(T,I)) value_at(C,s),\0(T,I) value_at(C,s)) by Th45
    .= leq((t value_at(C,s)) mod (\2(T,I) value_at(C,s)),
    \0(T,I) value_at(C,s)) by Th44
    .= IFGT((t value_at(C,s)) mod 2, 0, FALSE, TRUE) by A3,A2,AOFA_A00:55;
    hereby
      per cases by PRE_FF:6;
      suppose
A9:     (t value_at(C,s)) mod 2 = 0;
        hence f.(s, t is_even(b,A)).(the bool-sort of S).b
        = (0+1) mod 2 by Th1,A8,XXREAL_0:def 11
        .= ((t value_at(C,s))+1) mod 2 by A9,Th1,NAT_D:66;
      end;
      suppose
A10:     (t value_at(C,s)) mod 2 = 1;
        hence f.(s, t is_even(b,A)).(the bool-sort of S).b
        = 1+1 mod 2 by Th1,A8,XXREAL_0:def 11
        .= ((t value_at(C,s))+1) mod 2 by A10,Th1,NAT_D:66;
      end;
    end;
    let z;
A11: I <> the bool-sort of S by AOFA_A00:53;
    b in (FreeGen T).the bool-sort of S by Def4;
    then (vf @b) = (the bool-sort of S)-singleton(b) by AOFA_A00:41;
    then
A12: z nin (vf @b).I by A11,AOFA_A00:6;
A13: z in (FreeGen T).I by Def4;
    thus f.(s, t is_odd(b,A)).I.z
    = succ(s,b0,\notleq(t mod \2(T,I),\0(T,I)) value_at(C,s)).I.z
    by A1,AOFA_A00:def 28
    .= s.I.z by A1,A11,A12,A13,AOFA_A00:def 27;
    thus f.(s, t is_even(b,A)).I.z
    = succ(s,b0,leq(t mod \2(T,I),\0(T,I)) value_at(C,s)).I.z
    by A1,AOFA_A00:def 28
    .= s.I.z by A1,A11,A12,A13,AOFA_A00:def 27;
  end;
