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 Th66:
  G is C-supported & f in C-Execution(A,b,\falseC) implies
  (t1 value_at(C,s) < t2 value_at(C,s) iff
  f.(s, b gt(t2,t1,A)) in (\falseC)-States(the generators of G,b)) &
  (t1 value_at(C,s) <= t2 value_at(C,s) iff
  f.(s, b leq(t1,t2,A)) in (\falseC)-States(the generators of G,b)) &
  (for x holds f.(s, b gt(t1,t2,A)).I.x = s.I.x &
  f.(s, b leq(t1,t2,A)).I.x = s.I.x) &
  for c being pure Element of (the generators of G).the bool-sort of S
  st c <> b holds
  f.(s, b gt(t1,t2,A)).(the bool-sort of S).c = s.(the bool-sort of S).c &
  f.(s, b leq(t1,t2,A)).(the bool-sort of S).c = s.(the bool-sort of S).c
  proof assume
A1: G is C-supported & f in C-Execution(A,b,\falseC);
A2: f.(s, b gt(t2,t1,A)) is ManySortedFunction of the generators of G,
    the Sorts of C by AOFA_A00:48;
    reconsider b0 = @b as Element of G, the bool-sort of S
    by AOFA_A00:def 22;
A3: \not(leq(t2,t1)) value_at (C,s)
    = \not(leq(t2,t1) value_at(C,s)) by Th31
    .= \not(leq(t2 value_at(C,s), t1 value_at(C,s))) by Th45;
    then
A4: f.(s, b gt(t2,t1,A)).(the bool-sort of S).b
    = succ(s, b0, \not(leq(t2 value_at(C,s), t1 value_at(C,s)))).
    (the bool-sort of S).b by A1,AOFA_A00:def 28
    .= \not(leq(t2 value_at(C,s), t1 value_at(C,s))) by A1,AOFA_A00:def 27;
A5: 'not' FALSE = TRUE & TRUE <> FALSE &
    for x being boolean object holds x <> FALSE iff x = TRUE
    by XBOOLEAN:def 3;
    \trueC = TRUE by AOFA_A00:def 32;
    then
A6: \falseC = 'not' TRUE by AOFA_A00:def 32 .= FALSE;
    t1 value_at(C,s) < t2 value_at(C,s) iff
    leq(t2 value_at(C,s), t1 value_at(C,s)) = FALSE by AOFA_A00:55;
    then t1 value_at(C,s) < t2 value_at(C,s) iff
    \notleq(t2 value_at(C,s), t1 value_at(C,s)) <> \falseC by A6,A3,A5,Th33;
    hence (t1 value_at(C,s) < t2 value_at(C,s) iff
    f.(s, b gt(t2,t1,A)) in (\falseC)-States(the generators of G,b))
    by A2,A4,AOFA_A00:def 20;
A7: f.(s, b leq(t1,t2,A)) is ManySortedFunction of the generators of G,
    the Sorts of C by AOFA_A00:48;
    leq(t1,t2) value_at (C,s)
    = leq(t1 value_at(C,s), t2 value_at(C,s)) by Th45;
    then
A8: f.(s, b leq(t1,t2,A)).(the bool-sort of S).b
    = succ(s, b0, leq(t1 value_at(C,s), t2 value_at(C,s))).
    (the bool-sort of S).b by A1,AOFA_A00:def 28
    .= leq(t1 value_at(C,s), t2 value_at(C,s)) by A1,AOFA_A00:def 27;
    \trueC = TRUE by AOFA_A00:def 32;
    then
A9: \falseC = 'not' TRUE by AOFA_A00:def 32 .= FALSE;
    t1 value_at(C,s) <= t2 value_at(C,s) iff
    leq(t1 value_at(C,s), t2 value_at(C,s)) <> \falseC
    by A9,AOFA_A00:55;
    hence t1 value_at(C,s) <= t2 value_at(C,s) iff
    f.(s, b leq(t1,t2,A)) in (\falseC)-States(the generators of G,b)
    by A7,A8,AOFA_A00:def 20;
    b in (FreeGen T).the bool-sort of S by Def4;
    then
A10: vf b0 = (the bool-sort of S)-singleton(b) by AOFA_A00:41;
    hereby let x;
A11:   I <> the bool-sort of S by AOFA_A00:53;
A12:   x in (FreeGen T).I by Def4;
A13:   x nin (vf b0).I by A10,A11,AOFA_A00:6;
      thus f.(s, b gt(t1,t2,A)).I.x
      = succ(s,b0,\notleq(t1,t2)value_at(C,s)).I.x by A1,AOFA_A00:def 28
      .= s.I.x by A11,A12,A13,A1,AOFA_A00:def 27;
      thus f.(s, b leq(t1,t2,A)).I.x
      = succ(s,b0,leq(t1,t2)value_at(C,s)).I.x by A1,AOFA_A00:def 28
      .= s.I.x by A11,A12,A13,A1,AOFA_A00:def 27;
    end;
    let c be pure Element of (the generators of G).the bool-sort of S;
    assume A14: c <> b;
    (vf b0).the bool-sort of S = {b} by A10,AOFA_A00:6;
    then
A15: c nin (vf b0).the bool-sort of S by A14,TARSKI:def 1;
A16: c in (FreeGen T).the bool-sort of S by Def4;
    thus f.(s, b gt(t1,t2,A)).(the bool-sort of S).c
    = succ(s,b0,\notleq(t1,t2)value_at(C,s)).(the bool-sort of S).c
    by A1,AOFA_A00:def 28
    .= s.(the bool-sort of S).c by A14,A15,A16,A1,AOFA_A00:def 27;
    thus f.(s, b leq(t1,t2,A)).(the bool-sort of S).c
    = succ(s,b0,leq(t1,t2)value_at(C,s)).(the bool-sort of S).c
    by A1,AOFA_A00:def 28
    .= s.(the bool-sort of S).c by A14,A15,A16,A1,AOFA_A00:def 27;
  end;
