Article AOFA_000, MML version 4.99.1005

:: AOFA_000:prednot 1 => not HIDDEN:pred 2
notation
  let a1, a2 be set;
  antonym a1 nin a2 for a1 in a2;
end;

:: AOFA_000:th 1
theorem
for b1, b2, b3 being Relation-like Function-like set
for b4 being set
      st b4 c= proj1 b1 &
         b4 c= proj1 b2 &
         proj2 b3 c= b4 &
         (for b5 being set
               st b5 in b4
            holds b1 . b5 = b2 . b5)
   holds b3 * b1 = b3 * b2;

:: AOFA_000:funcreg 1
registration
  let a1, a2 be non empty set;
  cluster <*a1,a2*> -> non-empty;
end;

:: AOFA_000:funcreg 2
registration
  let a1, a2 be Relation-like non-empty Function-like FinSequence-like set;
  cluster a1 ^ a2 -> Relation-like non-empty Function-like FinSequence-like;
end;

:: AOFA_000:prednot 2 => AOFA_000:pred 1
definition
  let a1 be Relation-like Function-like homogeneous set;
  let a2 be set;
  pred A2 is_a_unity_wrt A1 means
    for b1, b2 being set
          st (<*b1,b2*> in proj1 a1 or <*b2,b1*> in proj1 a1)
       holds <*a2,b1*> in proj1 a1 & a1 . <*a2,b1*> = b1 & <*b1,a2*> in proj1 a1 & a1 . <*b1,a2*> = b1;
end;

:: AOFA_000:dfs 1
definiens
  let a1 be Relation-like Function-like homogeneous set;
  let a2 be set;
To prove
     a2 is_a_unity_wrt a1
it is sufficient to prove
  thus for b1, b2 being set
          st (<*b1,b2*> in proj1 a1 or <*b2,b1*> in proj1 a1)
       holds <*a2,b1*> in proj1 a1 & a1 . <*a2,b1*> = b1 & <*b1,a2*> in proj1 a1 & a1 . <*b1,a2*> = b1;

:: AOFA_000:def 1
theorem
for b1 being Relation-like Function-like homogeneous set
for b2 being set holds
      b2 is_a_unity_wrt b1
   iff
      for b3, b4 being set
            st (<*b3,b4*> in proj1 b1 or <*b4,b3*> in proj1 b1)
         holds <*b2,b3*> in proj1 b1 & b1 . <*b2,b3*> = b3 & <*b3,b2*> in proj1 b1 & b1 . <*b3,b2*> = b3;

:: AOFA_000:attrnot 1 => AOFA_000:attr 1
definition
  let a1 be Relation-like Function-like homogeneous set;
  attr a1 is associative means
    for b1, b2, b3 being set
          st <*b1,b2*> in proj1 a1 &
             <*b2,b3*> in proj1 a1 &
             <*a1 . <*b1,b2*>,b3*> in proj1 a1 &
             <*b1,a1 . <*b2,b3*>*> in proj1 a1
       holds a1 . <*a1 . <*b1,b2*>,b3*> = a1 . <*b1,a1 . <*b2,b3*>*>;
end;

:: AOFA_000:dfs 2
definiens
  let a1 be Relation-like Function-like homogeneous set;
To prove
     a1 is associative
it is sufficient to prove
  thus for b1, b2, b3 being set
          st <*b1,b2*> in proj1 a1 &
             <*b2,b3*> in proj1 a1 &
             <*a1 . <*b1,b2*>,b3*> in proj1 a1 &
             <*b1,a1 . <*b2,b3*>*> in proj1 a1
       holds a1 . <*a1 . <*b1,b2*>,b3*> = a1 . <*b1,a1 . <*b2,b3*>*>;

:: AOFA_000:def 2
theorem
for b1 being Relation-like Function-like homogeneous set holds
      b1 is associative
   iff
      for b2, b3, b4 being set
            st <*b2,b3*> in proj1 b1 &
               <*b3,b4*> in proj1 b1 &
               <*b1 . <*b2,b3*>,b4*> in proj1 b1 &
               <*b2,b1 . <*b3,b4*>*> in proj1 b1
         holds b1 . <*b1 . <*b2,b3*>,b4*> = b1 . <*b2,b1 . <*b3,b4*>*>;

:: AOFA_000:attrnot 2 => AOFA_000:attr 2
definition
  let a1 be Relation-like Function-like homogeneous set;
  attr a1 is unital means
    ex b1 being set st
       b1 is_a_unity_wrt a1;
end;

:: AOFA_000:dfs 3
definiens
  let a1 be Relation-like Function-like homogeneous set;
To prove
     a1 is unital
it is sufficient to prove
  thus ex b1 being set st
       b1 is_a_unity_wrt a1;

:: AOFA_000:def 3
theorem
for b1 being Relation-like Function-like homogeneous set holds
      b1 is unital
   iff
      ex b2 being set st
         b2 is_a_unity_wrt b1;

:: AOFA_000:funcnot 1 => AOFA_000:func 1
definition
  let a1 be set;
  let a2 be non empty set;
  let a3 be FinSequenceSet of a1;
  let a4 be Element of a2;
  redefine func a3 --> a4 -> Function-like Relation of a1 *,a2;
end;

:: AOFA_000:funcreg 3
registration
  let a1 be non empty set;
  let a2 be Element of a1;
  let a3 be natural set;
  cluster (a3 -tuples_on a1) --> a2 -> non empty Function-like homogeneous quasi_total;
end;

:: AOFA_000:th 2
theorem
for b1 being non empty set
for b2 being Element of b1
for b3 being natural set holds
   arity ((b3 -tuples_on b1) --> b2) = b3;

:: AOFA_000:funcreg 4
registration
  let a1 be non empty set;
  let a2 be Element of a1;
  cluster (0 -tuples_on a1) --> a2 -> Function-like homogeneous nullary;
end;

:: AOFA_000:funcreg 5
registration
  let a1 be non empty set;
  let a2 be Element of a1;
  cluster (1 -tuples_on a1) --> a2 -> Function-like homogeneous unary;
end;

:: AOFA_000:funcreg 6
registration
  let a1 be non empty set;
  let a2 be Element of a1;
  cluster (2 -tuples_on a1) --> a2 -> Function-like homogeneous binary;
end;

:: AOFA_000:funcreg 7
registration
  let a1 be non empty set;
  let a2 be Element of a1;
  cluster (3 -tuples_on a1) --> a2 -> Function-like homogeneous ternary;
end;

:: AOFA_000:exreg 1
registration
  let a1 be non empty set;
  cluster non empty Relation-like Function-like homogeneous quasi_total binary associative unital Relation of a1 *,a1;
end;

:: AOFA_000:exreg 2
registration
  let a1 be non empty set;
  cluster non empty Relation-like Function-like homogeneous quasi_total nullary Relation of a1 *,a1;
end;

:: AOFA_000:exreg 3
registration
  let a1 be non empty set;
  cluster non empty Relation-like Function-like homogeneous quasi_total ternary Relation of a1 *,a1;
end;

:: AOFA_000:th 3
theorem
for b1 being non empty set
for b2 being FinSequence of FinTrees b1
for b3, b4 being set
      st b4 in rng b2
   holds b4 <> b3 -tree b2;

:: AOFA_000:funcnot 2 => AOFA_000:func 2
definition
  let a1, a2 be Relation-like Function-like set;
  let a3 be set;
  func (A1,A3)+* A2 -> Relation-like Function-like set equals
    a2 +* (a1 | a3);
end;

:: AOFA_000:def 4
theorem
for b1, b2 being Relation-like Function-like set
for b3 being set holds
   (b1,b3)+* b2 = b2 +* (b1 | b3);

:: AOFA_000:th 4
theorem
for b1, b2 being Relation-like Function-like set
for b3, b4 being set
      st b3 in b4 & b4 c= proj1 b1
   holds ((b1,b4)+* b2) . b3 = b1 . b3;

:: AOFA_000:th 5
theorem
for b1, b2 being Relation-like Function-like set
for b3, b4 being set
      st not b3 in b4 & b3 in proj1 b2
   holds ((b1,b4)+* b2) . b3 = b2 . b3;

:: AOFA_000:funcnot 3 => AOFA_000:func 3
definition
  let a1, a2 be non empty set;
  let a3, a4 be Element of Funcs(a1,a2);
  let a5 be set;
  redefine func (a3,a5)+* a4 -> Element of Funcs(a1,a2);
end;

:: AOFA_000:funcnot 4 => AOFA_000:func 4
definition
  let a1, a2, a3 be non empty set;
  let a4 be Element of Funcs(a1,a2);
  let a5 be Element of Funcs(a2,a3);
  redefine func a5 * a4 -> Element of Funcs(a1,a3);
end;

:: AOFA_000:funcnot 5 => AOFA_000:func 5
definition
  let a1 be Relation-like Function-like set;
  let a2 be set;
  func A1 orbit A2 -> set equals
    {(iter(a1,b1)) . a2 where b1 is Element of NAT: a2 in proj1 iter(a1,b1)};
end;

:: AOFA_000:def 5
theorem
for b1 being Relation-like Function-like set
for b2 being set holds
   b1 orbit b2 = {(iter(b1,b3)) . b2 where b3 is Element of NAT: b2 in proj1 iter(b1,b3)};

:: AOFA_000:th 6
theorem
for b1 being Relation-like Function-like set
for b2 being set
      st b2 in proj1 b1
   holds b2 in b1 orbit b2;

:: AOFA_000:th 7
theorem
for b1 being Relation-like Function-like set
for b2, b3 being set
      st proj2 b1 c= proj1 b1 & b3 in b1 orbit b2
   holds b1 . b3 in b1 orbit b2;

:: AOFA_000:th 8
theorem
for b1 being Relation-like Function-like set
for b2 being set
      st b2 in proj1 b1
   holds b1 . b2 in b1 orbit b2;

:: AOFA_000:th 9
theorem
for b1 being Relation-like Function-like set
for b2 being set
      st b2 in proj1 b1 & b1 . b2 in proj1 b1
   holds b1 orbit (b1 . b2) c= b1 orbit b2;

:: AOFA_000:funcnot 6 => AOFA_000:func 6
definition
  let a1 be Relation-like Function-like set;
  let a2, a3 be set;
  assume proj2 a1 c= proj1 a1;
  func (A2,A3)iter A1 -> Relation-like Function-like set means
    proj1 it = proj1 a1 &
     (for b1 being set
           st b1 in proj1 a1
        holds (a1 orbit b1 c= a2 implies it . b1 = a3) &
         (for b2 being natural set
               st not (iter(a1,b2)) . b1 in a2 &
                  (for b3 being natural set
                        st b3 < b2
                     holds (iter(a1,b3)) . b1 in a2)
            holds it . b1 = (iter(a1,b2)) . b1));
end;

:: AOFA_000:def 6
theorem
for b1 being Relation-like Function-like set
   st proj2 b1 c= proj1 b1
for b2, b3 being set
for b4 being Relation-like Function-like set holds
      b4 = (b2,b3)iter b1
   iff
      proj1 b4 = proj1 b1 &
       (for b5 being set
             st b5 in proj1 b1
          holds (b1 orbit b5 c= b2 implies b4 . b5 = b3) &
           (for b6 being natural set
                 st not (iter(b1,b6)) . b5 in b2 &
                    (for b7 being natural set
                          st b7 < b6
                       holds (iter(b1,b7)) . b5 in b2)
              holds b4 . b5 = (iter(b1,b6)) . b5));

:: AOFA_000:funcnot 7 => AOFA_000:func 7
definition
  let a1 be Relation-like Function-like set;
  let a2 be set;
  let a3 be Relation-like Function-like set;
  assume proj2 a1 c= proj1 a1;
  func (A2,A3)iter A1 -> Relation-like Function-like set means
    proj1 it = proj1 a1 &
     (for b1 being set
           st b1 in proj1 a1
        holds (a1 orbit b1 c= a2 implies it . b1 = a3 . b1) &
         (for b2 being natural set
               st not (iter(a1,b2)) . b1 in a2 &
                  (for b3 being natural set
                        st b3 < b2
                     holds (iter(a1,b3)) . b1 in a2)
            holds it . b1 = (iter(a1,b2)) . b1));
end;

:: AOFA_000:def 7
theorem
for b1 being Relation-like Function-like set
   st proj2 b1 c= proj1 b1
for b2 being set
for b3, b4 being Relation-like Function-like set holds
   b4 = (b2,b3)iter b1
iff
   proj1 b4 = proj1 b1 &
    (for b5 being set
          st b5 in proj1 b1
       holds (b1 orbit b5 c= b2 implies b4 . b5 = b3 . b5) &
        (for b6 being natural set
              st not (iter(b1,b6)) . b5 in b2 &
                 (for b7 being natural set
                       st b7 < b6
                    holds (iter(b1,b7)) . b5 in b2)
           holds b4 . b5 = (iter(b1,b6)) . b5));

:: AOFA_000:th 10
theorem
for b1, b2 being Relation-like Function-like set
for b3, b4 being set
      st proj2 b1 c= proj1 b1 & b3 in proj1 b1 & not b1 orbit b3 c= b4
   holds ex b5 being natural set st
      ((b4,b2)iter b1) . b3 = (iter(b1,b5)) . b3 &
       not (iter(b1,b5)) . b3 in b4 &
       (for b6 being natural set
             st b6 < b5
          holds (iter(b1,b6)) . b3 in b4);

:: AOFA_000:th 11
theorem
for b1, b2 being Relation-like Function-like set
for b3, b4 being set
      st proj2 b1 c= proj1 b1 & b3 in proj1 b1 & b1 * b2 = b2 & b3 in b4
   holds ((b4,b2)iter b1) . b3 = ((b4,b2)iter b1) . (b1 . b3);

:: AOFA_000:th 12
theorem
for b1, b2 being Relation-like Function-like set
for b3, b4 being set
      st proj2 b1 c= proj1 b1 & b3 in proj1 b1 & not b3 in b4
   holds ((b4,b2)iter b1) . b3 = b3;

:: AOFA_000:funcnot 8 => AOFA_000:func 8
definition
  let a1 be non empty set;
  let a2 be Element of Funcs(a1,a1);
  let a3 be set;
  let a4 be Element of Funcs(a1,a1);
  redefine func (a3,a4)iter a2 -> Element of Funcs(a1,a1);
end;

:: AOFA_000:th 13
theorem
for b1 being non empty set
for b2 being non empty FinSequence of NAT holds
   ex b3 being non empty partial quasi_total non-empty UAStr st
      the carrier of b3 = b1 & signature b3 = b2;

:: AOFA_000:th 14
theorem
for b1 being non empty FinSequence of NAT holds
   ex b2 being non empty partial quasi_total non-empty UAStr st
      the carrier of b2 = NAT &
       signature b2 = b1 &
       (for b3, b4 being natural set
             st b3 in dom b1 & b4 = b1 . b3
          holds (the charact of b2) . b3 = (b4 -tuples_on NAT) --> b3);

:: AOFA_000:th 15
theorem
for b1 being non empty FinSequence of NAT
for b2, b3 being natural set
   st b2 in dom b1 & b3 = b1 . b2
for b4 being non empty set
for b5 being Function-like quasi_total Relation of b3 -tuples_on b4,b4 holds
   ex b6 being non empty partial quasi_total non-empty UAStr st
      the carrier of b6 = b4 & signature b6 = b1 & (the charact of b6) . b2 = b5;

:: AOFA_000:condreg 1
registration
  let a1 be non empty FinSequence of NAT;
  let a2 be non empty disjoint_with_NAT set;
  cluster -> Relation-like Function-like (Element of the carrier of FreeUnivAlgNSG(a1,a2));
end;

:: AOFA_000:condreg 2
registration
  let a1 be non empty FinSequence of NAT;
  let a2 be non empty disjoint_with_NAT set;
  cluster -> DecoratedTree-like (Element of the carrier of FreeUnivAlgNSG(a1,a2));
end;

:: AOFA_000:condreg 3
registration
  let a1 be non empty FinSequence of NAT;
  let a2 be non empty disjoint_with_NAT set;
  cluster -> DTree-yielding (FinSequence of the carrier of FreeUnivAlgNSG(a1,a2));
end;

:: AOFA_000:th 16
theorem
for b1 being non empty DTConstrStr
for b2 being set
      st b2 in TS b1 &
         (for b3 being Element of the carrier of b1
               st b3 in Terminals b1
            holds b2 <> root-tree b3)
   holds ex b3 being Element of the carrier of b1 st
      ex b4 being FinSequence of TS b1 st
         b3 ==> roots b4 & b2 = b3 -tree b4;

:: AOFA_000:th 17
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being non empty FinSequence of NAT
for b3 being natural set
   st b3 in dom b2
for b4 being FinSequence of the carrier of FreeUnivAlgNSG(b2,b1)
      st len b4 = b2 . b3
   holds (Den(In(b3,dom the charact of FreeUnivAlgNSG(b2,b1)),FreeUnivAlgNSG(b2,b1))) . b4 = b3 -tree b4;

:: AOFA_000:funcnot 9 => AOFA_000:func 9
definition
  let a1 be non-empty UAStr;
  let a2 be Element of bool the carrier of a1;
  let a3 be natural set;
  func A2 |^ A3 -> Element of bool the carrier of a1 means
    ex b1 being Function-like quasi_total Relation of NAT,bool the carrier of a1 st
       it = b1 . a3 &
        b1 . 0 = a2 &
        (for b2 being natural set holds
           b1 . (b2 + 1) = (b1 . b2) \/ {(Den(b3,a1)) . b4 where b3 is Element of dom the charact of a1, b4 is Element of (the carrier of a1) *: b4 in dom Den(b3,a1) & rng b4 c= b1 . b2});
end;

:: AOFA_000:def 8
theorem
for b1 being non-empty UAStr
for b2 being Element of bool the carrier of b1
for b3 being natural set
for b4 being Element of bool the carrier of b1 holds
      b4 = b2 |^ b3
   iff
      ex b5 being Function-like quasi_total Relation of NAT,bool the carrier of b1 st
         b4 = b5 . b3 &
          b5 . 0 = b2 &
          (for b6 being natural set holds
             b5 . (b6 + 1) = (b5 . b6) \/ {(Den(b7,b1)) . b8 where b7 is Element of dom the charact of b1, b8 is Element of (the carrier of b1) *: b8 in dom Den(b7,b1) & rng b8 c= b5 . b6});

:: AOFA_000:th 18
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1 holds
   b2 |^ 0 = b2;

:: AOFA_000:th 19
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1
for b3 being natural set holds
   b2 |^ (b3 + 1) = (b2 |^ b3) \/ {(Den(b4,b1)) . b5 where b4 is Element of dom the charact of b1, b5 is Element of (the carrier of b1) *: b5 in dom Den(b4,b1) & rng b5 c= b2 |^ b3};

:: AOFA_000:th 20
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1
for b3 being natural set
for b4 being set holds
      b4 in b2 |^ (b3 + 1)
   iff
      (not b4 in b2 |^ b3 implies ex b5 being Element of dom the charact of b1 st
         ex b6 being Element of (the carrier of b1) * st
            b4 = (Den(b5,b1)) . b6 & b6 in dom Den(b5,b1) & rng b6 c= b2 |^ b3);

:: AOFA_000:th 21
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1
for b3, b4 being natural set
      st b3 <= b4
   holds b2 |^ b3 c= b2 |^ b4;

:: AOFA_000:th 22
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2, b3 being Element of bool the carrier of b1
   st b2 c= b3
for b4 being natural set holds
   b2 |^ b4 c= b3 |^ b4;

:: AOFA_000:th 23
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1
for b3 being natural set
for b4 being set holds
      b4 in b2 |^ (b3 + 1)
   iff
      (not b4 in b2 implies ex b5 being Element of dom the charact of b1 st
         ex b6 being Element of (the carrier of b1) * st
            b4 = (Den(b5,b1)) . b6 & b6 in dom Den(b5,b1) & rng b6 c= b2 |^ b3);

:: AOFA_000:sch 1
scheme AOFA_000:sch 1
{F1 -> non empty set,
  F2 -> set}:
ex b1 being natural set st
   for b2 being Element of F1()
         st b2 in F2()
      holds P1[b2, b1]
provided
   F2() is finite
and
   for b1 being Element of F1()
         st b1 in F2()
      holds ex b2 being natural set st
         P1[b1, b2]
and
   for b1 being Element of F1()
   for b2, b3 being natural set
         st P1[b1, b2] & b2 <= b3
      holds P1[b1, b3];


:: AOFA_000:th 24
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1 holds
   ex b3 being Element of bool the carrier of b1 st
      b3 = union {b2 |^ b4 where b4 is Element of NAT: TRUE} &
       b3 is opers_closed(b1);

:: AOFA_000:th 25
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2, b3 being Element of bool the carrier of b1
      st b3 is opers_closed(b1) & b2 c= b3
   holds union {b2 |^ b4 where b4 is Element of NAT: TRUE} c= b3;

:: AOFA_000:funcnot 10 => AOFA_000:func 10
definition
  let a1 be non empty partial quasi_total non-empty UAStr;
  func Generators A1 -> Element of bool the carrier of a1 equals
    (the carrier of a1) \ union {rng b1 where b1 is Element of Operations a1: TRUE};
end;

:: AOFA_000:def 9
theorem
for b1 being non empty partial quasi_total non-empty UAStr holds
   Generators b1 = (the carrier of b1) \ union {rng b2 where b2 is Element of Operations b1: TRUE};

:: AOFA_000:th 26
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of the carrier of b1 holds
      b2 in Generators b1
   iff
      for b3 being Element of Operations b1 holds
         not b2 in rng b3;

:: AOFA_000:th 27
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1
      st b2 is opers_closed(b1)
   holds Constants b1 c= b2;

:: AOFA_000:th 28
theorem
for b1 being non empty partial quasi_total non-empty UAStr
      st Constants b1 = {}
   holds {} b1 is opers_closed(b1);

:: AOFA_000:th 29
theorem
for b1 being non empty partial quasi_total non-empty UAStr
   st Constants b1 = {}
for b2 being GeneratorSet of b1 holds
   b2 <> {};

:: AOFA_000:th 30
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1 holds
      b2 is GeneratorSet of b1
   iff
      for b3 being Element of the carrier of b1 holds
         ex b4 being natural set st
            b3 in b2 |^ b4;

:: AOFA_000:th 31
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1
for b3 being GeneratorSet of b1
      st b3 c= b2
   holds b2 is GeneratorSet of b1;

:: AOFA_000:th 32
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being GeneratorSet of b1
for b3 being Element of the carrier of b1
      st for b4 being Element of Operations b1 holds
           not b3 in rng b4
   holds b3 in b2;

:: AOFA_000:th 33
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being GeneratorSet of b1 holds
   Generators b1 c= b2;

:: AOFA_000:th 34
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2 being free GeneratorSet of b1 holds
   b2 = Generators b1;

:: AOFA_000:funcreg 8
registration
  let a1 be non empty partial quasi_total non-empty free UAStr;
  cluster Generators a1 -> free;
end;

:: AOFA_000:funcnot 11 => AOFA_000:func 11
definition
  let a1 be non empty partial quasi_total non-empty free UAStr;
  redefine func Generators a1 -> GeneratorSet of a1;
end;

:: AOFA_000:funcreg 9
registration
  let a1, a2 be set;
  cluster [:a1,a2:] -> disjoint_with_NAT;
end;

:: AOFA_000:th 35
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2 being GeneratorSet of b1
for b3 being non empty partial quasi_total non-empty UAStr
for b4, b5 being Function-like quasi_total Relation of the carrier of b1,the carrier of b3
      st b4 is_homomorphism b1,b3 & b5 is_homomorphism b1,b3 & b4 | b2 = b5 | b2
   holds b4 = b5;

:: AOFA_000:th 36
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2, b3 being Element of dom the charact of b1
for b4, b5 being Relation-like Function-like FinSequence-like set
      st b4 in dom Den(b2,b1) &
         b5 in dom Den(b3,b1) &
         (Den(b2,b1)) . b4 = (Den(b3,b1)) . b5
   holds b2 = b3 & b4 = b5;

:: AOFA_000:th 37
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2, b3 being Element of Operations b1
for b4, b5 being Relation-like Function-like FinSequence-like set
      st b4 in dom b2 & b5 in dom b3 & b2 . b4 = b3 . b5
   holds b2 = b3 & b4 = b5;

:: AOFA_000:th 38
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2 being Element of dom the charact of b1
for b3 being Relation-like Function-like FinSequence-like set
   st b3 in dom Den(b2,b1)
for b4 being set
      st b4 in proj2 b3
   holds b4 <> (Den(b2,b1)) . b3;

:: AOFA_000:th 39
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2 being GeneratorSet of b1
for b3 being Element of dom the charact of b1
   st for b4 being Element of dom the charact of b1
     for b5 being Relation-like Function-like FinSequence-like set
           st b5 in dom Den(b4,b1) & (Den(b4,b1)) . b5 in b2
        holds b4 <> b3
for b4 being Relation-like Function-like FinSequence-like set
   st b4 in dom Den(b3,b1)
for b5 being natural set
      st (Den(b3,b1)) . b4 in b2 |^ (b5 + 1)
   holds proj2 b4 c= b2 |^ b5;

:: AOFA_000:th 40
theorem
for b1 being non empty partial quasi_total non-empty free UAStr
for b2 being Element of dom the charact of b1
for b3 being Relation-like Function-like FinSequence-like set
   st b3 in dom Den(b2,b1)
for b4 being natural set
      st (Den(b2,b1)) . b3 in (Generators b1) |^ (b4 + 1)
   holds proj2 b3 c= (Generators b1) |^ b4;

:: AOFA_000:attrnot 3 => AOFA_000:attr 3
definition
  let a1 be non empty UAStr;
  attr a1 is with_empty-instruction means
    1 in dom the charact of a1 &
     (the charact of a1) . 1 is non empty Function-like homogeneous quasi_total nullary Relation of (the carrier of a1) *,the carrier of a1;
end;

:: AOFA_000:dfs 10
definiens
  let a1 be non empty UAStr;
To prove
     a1 is with_empty-instruction
it is sufficient to prove
  thus 1 in dom the charact of a1 &
     (the charact of a1) . 1 is non empty Function-like homogeneous quasi_total nullary Relation of (the carrier of a1) *,the carrier of a1;

:: AOFA_000:def 10
theorem
for b1 being non empty UAStr holds
      b1 is with_empty-instruction
   iff
      1 in dom the charact of b1 &
       (the charact of b1) . 1 is non empty Function-like homogeneous quasi_total nullary Relation of (the carrier of b1) *,the carrier of b1;

:: AOFA_000:attrnot 4 => AOFA_000:attr 4
definition
  let a1 be non empty UAStr;
  attr a1 is with_catenation means
    2 in dom the charact of a1 &
     (the charact of a1) . 2 is non empty Function-like homogeneous quasi_total binary Relation of (the carrier of a1) *,the carrier of a1;
end;

:: AOFA_000:dfs 11
definiens
  let a1 be non empty UAStr;
To prove
     a1 is with_catenation
it is sufficient to prove
  thus 2 in dom the charact of a1 &
     (the charact of a1) . 2 is non empty Function-like homogeneous quasi_total binary Relation of (the carrier of a1) *,the carrier of a1;

:: AOFA_000:def 11
theorem
for b1 being non empty UAStr holds
      b1 is with_catenation
   iff
      2 in dom the charact of b1 &
       (the charact of b1) . 2 is non empty Function-like homogeneous quasi_total binary Relation of (the carrier of b1) *,the carrier of b1;

:: AOFA_000:attrnot 5 => AOFA_000:attr 5
definition
  let a1 be non empty UAStr;
  attr a1 is with_if-instruction means
    3 in dom the charact of a1 &
     (the charact of a1) . 3 is non empty Function-like homogeneous quasi_total ternary Relation of (the carrier of a1) *,the carrier of a1;
end;

:: AOFA_000:dfs 12
definiens
  let a1 be non empty UAStr;
To prove
     a1 is with_if-instruction
it is sufficient to prove
  thus 3 in dom the charact of a1 &
     (the charact of a1) . 3 is non empty Function-like homogeneous quasi_total ternary Relation of (the carrier of a1) *,the carrier of a1;

:: AOFA_000:def 12
theorem
for b1 being non empty UAStr holds
      b1 is with_if-instruction
   iff
      3 in dom the charact of b1 &
       (the charact of b1) . 3 is non empty Function-like homogeneous quasi_total ternary Relation of (the carrier of b1) *,the carrier of b1;

:: AOFA_000:attrnot 6 => AOFA_000:attr 6
definition
  let a1 be non empty UAStr;
  attr a1 is with_while-instruction means
    4 in dom the charact of a1 &
     (the charact of a1) . 4 is non empty Function-like homogeneous quasi_total binary Relation of (the carrier of a1) *,the carrier of a1;
end;

:: AOFA_000:dfs 13
definiens
  let a1 be non empty UAStr;
To prove
     a1 is with_while-instruction
it is sufficient to prove
  thus 4 in dom the charact of a1 &
     (the charact of a1) . 4 is non empty Function-like homogeneous quasi_total binary Relation of (the carrier of a1) *,the carrier of a1;

:: AOFA_000:def 13
theorem
for b1 being non empty UAStr holds
      b1 is with_while-instruction
   iff
      4 in dom the charact of b1 &
       (the charact of b1) . 4 is non empty Function-like homogeneous quasi_total binary Relation of (the carrier of b1) *,the carrier of b1;

:: AOFA_000:attrnot 7 => AOFA_000:attr 7
definition
  let a1 be non empty UAStr;
  attr a1 is associative means
    (the charact of a1) . 2 is non empty Function-like homogeneous quasi_total binary associative Relation of (the carrier of a1) *,the carrier of a1;
end;

:: AOFA_000:dfs 14
definiens
  let a1 be non empty UAStr;
To prove
     a1 is associative
it is sufficient to prove
  thus (the charact of a1) . 2 is non empty Function-like homogeneous quasi_total binary associative Relation of (the carrier of a1) *,the carrier of a1;

:: AOFA_000:def 14
theorem
for b1 being non empty UAStr holds
      b1 is associative
   iff
      (the charact of b1) . 2 is non empty Function-like homogeneous quasi_total binary associative Relation of (the carrier of b1) *,the carrier of b1;

:: AOFA_000:attrnot 8 => AOFA_000:attr 8
definition
  let a1 be non-empty UAStr;
  attr a1 is unital means
    ex b1 being non empty Function-like homogeneous quasi_total binary Relation of (the carrier of a1) *,the carrier of a1 st
       b1 = (the charact of a1) . 2 &
        (Den(In(1,dom the charact of a1),a1)) . {} is_a_unity_wrt b1;
end;

:: AOFA_000:dfs 15
definiens
  let a1 be non-empty UAStr;
To prove
     a1 is unital
it is sufficient to prove
  thus ex b1 being non empty Function-like homogeneous quasi_total binary Relation of (the carrier of a1) *,the carrier of a1 st
       b1 = (the charact of a1) . 2 &
        (Den(In(1,dom the charact of a1),a1)) . {} is_a_unity_wrt b1;

:: AOFA_000:def 15
theorem
for b1 being non-empty UAStr holds
      b1 is unital
   iff
      ex b2 being non empty Function-like homogeneous quasi_total binary Relation of (the carrier of b1) *,the carrier of b1 st
         b2 = (the charact of b1) . 2 &
          (Den(In(1,dom the charact of b1),b1)) . {} is_a_unity_wrt b2;

:: AOFA_000:th 41
theorem
for b1 being non empty set
for b2 being Element of b1
for b3 being non empty Function-like homogeneous quasi_total binary associative unital Relation of b1 *,b1
   st b2 is_a_unity_wrt b3
for b4 being non empty Function-like homogeneous quasi_total ternary Relation of b1 *,b1
for b5 being non empty Function-like homogeneous quasi_total binary Relation of b1 *,b1 holds
   ex b6 being strict non-empty UAStr st
      the carrier of b6 = b1 &
       the charact of b6 = <*(0 -tuples_on b1) --> b2,b3*> ^ <*b4,b5*> &
       b6 is with_empty-instruction &
       b6 is with_catenation &
       b6 is unital &
       b6 is associative &
       b6 is with_if-instruction &
       b6 is with_while-instruction &
       b6 is quasi_total &
       b6 is partial;

:: AOFA_000:exreg 4
registration
  cluster non empty strict partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction associative unital UAStr;
end;

:: AOFA_000:modenot 1
definition
  mode preIfWhileAlgebra is non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
end;

:: AOFA_000:modenot 2
definition
  let a1 be non empty UAStr;
  mode Algorithm of a1 is Element of the carrier of a1;
end;

:: AOFA_000:th 42
theorem
for b1 being non-empty with_empty-instruction UAStr holds
   dom Den(In(1,dom the charact of b1),b1) = {{}};

:: AOFA_000:funcnot 12 => AOFA_000:func 12
definition
  let a1 be non-empty with_empty-instruction UAStr;
  func EmptyIns A1 -> Element of the carrier of a1 equals
    (Den(In(1,dom the charact of a1),a1)) . {};
end;

:: AOFA_000:def 16
theorem
for b1 being non-empty with_empty-instruction UAStr holds
   EmptyIns b1 = (Den(In(1,dom the charact of b1),b1)) . {};

:: AOFA_000:th 43
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction UAStr
for b2 being Element of Operations b1
      st b2 = Den(In(1,dom the charact of b1),b1)
   holds arity b2 = 0 & EmptyIns b1 in rng b2;

:: AOFA_000:th 44
theorem
for b1 being non-empty with_catenation UAStr holds
   dom Den(In(2,dom the charact of b1),b1) = 2 -tuples_on the carrier of b1;

:: AOFA_000:funcnot 13 => AOFA_000:func 13
definition
  let a1 be non-empty with_catenation UAStr;
  let a2, a3 be Element of the carrier of a1;
  func A2 \; A3 -> Element of the carrier of a1 equals
    (Den(In(2,dom the charact of a1),a1)) . <*a2,a3*>;
end;

:: AOFA_000:def 17
theorem
for b1 being non-empty with_catenation UAStr
for b2, b3 being Element of the carrier of b1 holds
b2 \; b3 = (Den(In(2,dom the charact of b1),b1)) . <*b2,b3*>;

:: AOFA_000:th 45
theorem
for b1 being non-empty with_empty-instruction with_catenation unital UAStr
for b2 being Element of the carrier of b1 holds
   (EmptyIns b1) \; b2 = b2 & b2 \; EmptyIns b1 = b2;

:: AOFA_000:th 46
theorem
for b1 being non-empty with_catenation associative UAStr
for b2, b3, b4 being Element of the carrier of b1 holds
(b2 \; b3) \; b4 = b2 \; (b3 \; b4);

:: AOFA_000:th 47
theorem
for b1 being non-empty with_if-instruction UAStr holds
   dom Den(In(3,dom the charact of b1),b1) = 3 -tuples_on the carrier of b1;

:: AOFA_000:funcnot 14 => AOFA_000:func 14
definition
  let a1 be non-empty with_if-instruction UAStr;
  let a2, a3, a4 be Element of the carrier of a1;
  func if-then-else(A2,A3,A4) -> Element of the carrier of a1 equals
    (Den(In(3,dom the charact of a1),a1)) . <*a2,a3,a4*>;
end;

:: AOFA_000:def 18
theorem
for b1 being non-empty with_if-instruction UAStr
for b2, b3, b4 being Element of the carrier of b1 holds
if-then-else(b2,b3,b4) = (Den(In(3,dom the charact of b1),b1)) . <*b2,b3,b4*>;

:: AOFA_000:funcnot 15 => AOFA_000:func 15
definition
  let a1 be non-empty with_empty-instruction with_if-instruction UAStr;
  let a2, a3 be Element of the carrier of a1;
  func if-then(A2,A3) -> Element of the carrier of a1 equals
    if-then-else(a2,a3,EmptyIns a1);
end;

:: AOFA_000:def 19
theorem
for b1 being non-empty with_empty-instruction with_if-instruction UAStr
for b2, b3 being Element of the carrier of b1 holds
if-then(b2,b3) = if-then-else(b2,b3,EmptyIns b1);

:: AOFA_000:th 48
theorem
for b1 being non-empty with_while-instruction UAStr holds
   dom Den(In(4,dom the charact of b1),b1) = 2 -tuples_on the carrier of b1;

:: AOFA_000:funcnot 16 => AOFA_000:func 16
definition
  let a1 be non-empty with_while-instruction UAStr;
  let a2, a3 be Element of the carrier of a1;
  func while(A2,A3) -> Element of the carrier of a1 equals
    (Den(In(4,dom the charact of a1),a1)) . <*a2,a3*>;
end;

:: AOFA_000:def 20
theorem
for b1 being non-empty with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1 holds
while(b2,b3) = (Den(In(4,dom the charact of b1),b1)) . <*b2,b3*>;

:: AOFA_000:funcnot 17 => AOFA_000:func 17
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2, a3, a4, a5 be Element of the carrier of a1;
  func for-do(A2,A3,A5,A4) -> Element of the carrier of a1 equals
    a2 \; while(a3,a4 \; a5);
end;

:: AOFA_000:def 21
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3, b4, b5 being Element of the carrier of b1 holds
for-do(b2,b3,b5,b4) = b2 \; while(b3,b4 \; b5);

:: AOFA_000:funcnot 18 => AOFA_000:func 18
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  func ElementaryInstructions A1 -> Element of bool the carrier of a1 equals
    ((((the carrier of a1) \ {EmptyIns a1}) \ rng Den(In(3,dom the charact of a1),a1)) \ rng Den(In(4,dom the charact of a1),a1)) \ {b1 \; b2 where b1 is Element of the carrier of a1, b2 is Element of the carrier of a1: b1 <> b1 \; b2 & b2 <> b1 \; b2};
end;

:: AOFA_000:def 22
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
   ElementaryInstructions b1 = ((((the carrier of b1) \ {EmptyIns b1}) \ rng Den(In(3,dom the charact of b1),b1)) \ rng Den(In(4,dom the charact of b1),b1)) \ {b2 \; b3 where b2 is Element of the carrier of b1, b3 is Element of the carrier of b1: b2 <> b2 \; b3 & b3 <> b2 \; b3};

:: AOFA_000:th 49
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
   not EmptyIns b1 in ElementaryInstructions b1;

:: AOFA_000:th 50
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
      st b2 <> b2 \; b3 & b3 <> b2 \; b3
   holds not b2 \; b3 in ElementaryInstructions b1;

:: AOFA_000:th 51
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3, b4 being Element of the carrier of b1 holds
not if-then-else(b2,b3,b4) in ElementaryInstructions b1;

:: AOFA_000:th 52
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1 holds
not while(b2,b3) in ElementaryInstructions b1;

:: AOFA_000:th 53
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
      st not b2 in ElementaryInstructions b1 &
         b2 <> EmptyIns b1 &
         (for b3, b4 being Element of the carrier of b1
               st b2 = b3 \; b4 & b3 <> b3 \; b4
            holds b4 = b3 \; b4) &
         (for b3, b4, b5 being Element of the carrier of b1 holds
         b2 <> if-then-else(b3,b4,b5))
   holds ex b3, b4 being Element of the carrier of b1 st
      b2 = while(b3,b4);

:: AOFA_000:attrnot 9 => AOFA_000:attr 9
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  attr a1 is infinite means
    ElementaryInstructions a1 is infinite;
end;

:: AOFA_000:dfs 23
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
To prove
     a1 is infinite
it is sufficient to prove
  thus ElementaryInstructions a1 is infinite;

:: AOFA_000:def 23
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
      b1 is infinite
   iff
      ElementaryInstructions b1 is infinite;

:: AOFA_000:attrnot 10 => AOFA_000:attr 10
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  attr a1 is degenerated means
    ((for b1, b2 being Element of the carrier of a1 holds
     (b1 <> EmptyIns a1 implies b1 \; b2 <> b2) &
      (b2 <> EmptyIns a1 implies b1 \; b2 <> b1) &
      ((b1 = EmptyIns a1 implies b2 <> EmptyIns a1) implies b1 \; b2 <> EmptyIns a1)) &
     (for b1, b2, b3 being Element of the carrier of a1 holds
     if-then-else(b1,b2,b3) <> EmptyIns a1) &
     (for b1, b2 being Element of the carrier of a1 holds
     while(b1,b2) <> EmptyIns a1) &
     (for b1, b2, b3, b4, b5 being Element of the carrier of a1
           st b1 <> EmptyIns a1 & b2 <> EmptyIns a1
        holds b1 \; b2 <> if-then-else(b3,b4,b5)) &
     (for b1, b2, b3, b4 being Element of the carrier of a1
           st b1 <> EmptyIns a1 & b2 <> EmptyIns a1
        holds b1 \; b2 <> while(b3,b4))) implies ex b1, b2, b3, b4, b5 being Element of the carrier of a1 st
       if-then-else(b1,b2,b3) = while(b4,b5);
end;

:: AOFA_000:dfs 24
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
To prove
     a1 is degenerated
it is sufficient to prove
  thus ((for b1, b2 being Element of the carrier of a1 holds
     (b1 <> EmptyIns a1 implies b1 \; b2 <> b2) &
      (b2 <> EmptyIns a1 implies b1 \; b2 <> b1) &
      ((b1 = EmptyIns a1 implies b2 <> EmptyIns a1) implies b1 \; b2 <> EmptyIns a1)) &
     (for b1, b2, b3 being Element of the carrier of a1 holds
     if-then-else(b1,b2,b3) <> EmptyIns a1) &
     (for b1, b2 being Element of the carrier of a1 holds
     while(b1,b2) <> EmptyIns a1) &
     (for b1, b2, b3, b4, b5 being Element of the carrier of a1
           st b1 <> EmptyIns a1 & b2 <> EmptyIns a1
        holds b1 \; b2 <> if-then-else(b3,b4,b5)) &
     (for b1, b2, b3, b4 being Element of the carrier of a1
           st b1 <> EmptyIns a1 & b2 <> EmptyIns a1
        holds b1 \; b2 <> while(b3,b4))) implies ex b1, b2, b3, b4, b5 being Element of the carrier of a1 st
       if-then-else(b1,b2,b3) = while(b4,b5);

:: AOFA_000:def 24
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
      b1 is degenerated
   iff
      ((for b2, b3 being Element of the carrier of b1 holds
       (b2 <> EmptyIns b1 implies b2 \; b3 <> b3) &
        (b3 <> EmptyIns b1 implies b2 \; b3 <> b2) &
        ((b2 = EmptyIns b1 implies b3 <> EmptyIns b1) implies b2 \; b3 <> EmptyIns b1)) &
       (for b2, b3, b4 being Element of the carrier of b1 holds
       if-then-else(b2,b3,b4) <> EmptyIns b1) &
       (for b2, b3 being Element of the carrier of b1 holds
       while(b2,b3) <> EmptyIns b1) &
       (for b2, b3, b4, b5, b6 being Element of the carrier of b1
             st b2 <> EmptyIns b1 & b3 <> EmptyIns b1
          holds b2 \; b3 <> if-then-else(b4,b5,b6)) &
       (for b2, b3, b4, b5 being Element of the carrier of b1
             st b2 <> EmptyIns b1 & b3 <> EmptyIns b1
          holds b2 \; b3 <> while(b4,b5)) implies ex b2, b3, b4, b5, b6 being Element of the carrier of b1 st
         if-then-else(b2,b3,b4) = while(b5,b6));

:: AOFA_000:attrnot 11 => AOFA_000:attr 11
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  attr a1 is well_founded means
    ElementaryInstructions a1 is GeneratorSet of a1;
end;

:: AOFA_000:dfs 25
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
To prove
     a1 is well_founded
it is sufficient to prove
  thus ElementaryInstructions a1 is GeneratorSet of a1;

:: AOFA_000:def 25
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
      b1 is well_founded
   iff
      ElementaryInstructions b1 is GeneratorSet of b1;

:: AOFA_000:funcnot 19 => AOFA_000:func 19
definition
  func ECIW-signature -> non empty FinSequence of NAT equals
    <*0,2*> ^ <*3,2*>;
end;

:: AOFA_000:def 26
theorem
ECIW-signature = <*0,2*> ^ <*3,2*>;

:: AOFA_000:th 54
theorem
len ECIW-signature = 4 & dom ECIW-signature = Seg 4 & ECIW-signature . 1 = 0 & ECIW-signature . 2 = 2 & ECIW-signature . 3 = 3 & ECIW-signature . 4 = 2;

:: AOFA_000:attrnot 12 => AOFA_000:attr 12
definition
  let a1 be non empty partial non-empty UAStr;
  attr a1 is ECIW-strict means
    signature a1 = ECIW-signature;
end;

:: AOFA_000:dfs 27
definiens
  let a1 be non empty partial non-empty UAStr;
To prove
     a1 is ECIW-strict
it is sufficient to prove
  thus signature a1 = ECIW-signature;

:: AOFA_000:def 27
theorem
for b1 being non empty partial non-empty UAStr holds
      b1 is ECIW-strict
   iff
      signature b1 = ECIW-signature;

:: AOFA_000:th 55
theorem
for b1 being non empty partial non-empty UAStr
   st b1 is ECIW-strict
for b2 being Element of dom the charact of b1
      st b2 <> 1 & b2 <> 2 & b2 <> 3
   holds b2 = 4;

:: AOFA_000:funcreg 10
registration
  let a1 be non empty disjoint_with_NAT set;
  cluster FreeUnivAlgNSG(ECIW-signature,a1) -> non empty strict partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction;
end;

:: AOFA_000:th 56
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st for b3 being Element of b1 holds
           b2 <> root-tree b3
   holds ex b3 being natural set st
      ex b4 being FinSequence of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) st
         b3 in Seg 4 & b2 = b3 -tree b4 & len b4 = ECIW-signature . b3;

:: AOFA_000:th 57
theorem
for b1 being non empty disjoint_with_NAT set holds
   EmptyIns FreeUnivAlgNSG(ECIW-signature,b1) = 1 -tree {};

:: AOFA_000:th 58
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being FinSequence of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st 1 -tree b2 is Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
   holds b2 = {};

:: AOFA_000:th 59
theorem
for b1 being non empty disjoint_with_NAT set
for b2, b3 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) holds
b2 \; b3 = 2 -tree(b2,b3);

:: AOFA_000:th 60
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being FinSequence of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st 2 -tree b2 is Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
   holds ex b3, b4 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) st
      b2 = <*b3,b4*>;

:: AOFA_000:th 61
theorem
for b1 being non empty disjoint_with_NAT set
for b2, b3 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) holds
b2 \; b3 <> b2 & b2 \; b3 <> b3;

:: AOFA_000:th 62
theorem
for b1 being non empty disjoint_with_NAT set
for b2, b3, b4, b5 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st b2 \; b3 = b4 \; b5
   holds b2 = b4 & b3 = b5;

:: AOFA_000:th 63
theorem
for b1 being non empty disjoint_with_NAT set
for b2, b3, b4 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) holds
if-then-else(b2,b3,b4) = 3 -tree <*b2,b3,b4*>;

:: AOFA_000:th 64
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being FinSequence of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st 3 -tree b2 is Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
   holds ex b3, b4, b5 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) st
      b2 = <*b3,b4,b5*>;

:: AOFA_000:th 65
theorem
for b1 being non empty disjoint_with_NAT set
for b2, b3, b4, b5, b6, b7 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st if-then-else(b2,b4,b5) = if-then-else(b3,b6,b7)
   holds b2 = b3 & b4 = b6 & b5 = b7;

:: AOFA_000:th 66
theorem
for b1 being non empty disjoint_with_NAT set
for b2, b3 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) holds
while(b2,b3) = 4 -tree(b2,b3);

:: AOFA_000:th 67
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being FinSequence of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st 4 -tree b2 is Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
   holds ex b3, b4 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1) st
      b2 = <*b3,b4*>;

:: AOFA_000:th 68
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
      st b2 in ElementaryInstructions FreeUnivAlgNSG(ECIW-signature,b1)
   holds ex b3 being Element of b1 st
      b2 = b3 -tree {};

:: AOFA_000:th 69
theorem
for b1 being non empty disjoint_with_NAT set
for b2 being FinSequence of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
for b3 being Element of b1
      st b3 -tree b2 is Element of the carrier of FreeUnivAlgNSG(ECIW-signature,b1)
   holds b2 = {};

:: AOFA_000:th 70
theorem
for b1 being non empty disjoint_with_NAT set holds
   ElementaryInstructions FreeUnivAlgNSG(ECIW-signature,b1) = FreeGenSetNSG(ECIW-signature,b1) &
    Card b1 = Card FreeGenSetNSG(ECIW-signature,b1);

:: AOFA_000:exreg 5
registration
  cluster infinite disjoint_with_NAT set;
end;

:: AOFA_000:funcreg 11
registration
  let a1 be infinite disjoint_with_NAT set;
  cluster FreeUnivAlgNSG(ECIW-signature,a1) -> non empty strict partial quasi_total non-empty infinite;
end;

:: AOFA_000:funcreg 12
registration
  let a1 be non empty disjoint_with_NAT set;
  cluster FreeUnivAlgNSG(ECIW-signature,a1) -> non empty strict partial quasi_total non-empty ECIW-strict;
end;

:: AOFA_000:th 71
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
   Generators b1 c= ElementaryInstructions b1;

:: AOFA_000:th 72
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
   st b1 is free
for b2, b3, b4 being Element of the carrier of b1 holds
EmptyIns b1 <> b3 \; b4 & EmptyIns b1 <> if-then-else(b2,b3,b4) & EmptyIns b1 <> while(b2,b3);

:: AOFA_000:th 73
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
   st b1 is free
for b2, b3, b4, b5, b6 being Element of the carrier of b1 holds
b2 \; b3 <> b2 &
 b2 \; b3 <> b3 &
 (b2 \; b3 = b5 \; b6 implies b2 = b5 & b3 = b6) &
 b2 \; b3 <> if-then-else(b4,b5,b6) &
 b2 \; b3 <> while(b4,b5);

:: AOFA_000:th 74
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
   st b1 is free
for b2, b3, b4, b5, b6, b7 being Element of the carrier of b1 holds
if-then-else(b2,b3,b4) <> b2 &
 if-then-else(b2,b3,b4) <> b3 &
 if-then-else(b2,b3,b4) <> b4 &
 if-then-else(b2,b3,b4) <> while(b5,b6) &
 (if-then-else(b2,b3,b4) = if-then-else(b5,b6,b7) implies b2 = b5 & b3 = b6 & b4 = b7);

:: AOFA_000:th 75
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
   st b1 is free
for b2, b3, b4, b5 being Element of the carrier of b1 holds
while(b2,b3) <> b2 &
 while(b2,b3) <> b3 &
 (while(b2,b3) = while(b4,b5) implies b2 = b4 & b3 = b5);

:: AOFA_000:condreg 4
registration
  cluster non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction -> non degenerated well_founded (UAStr);
end;

:: AOFA_000:exreg 6
registration
  cluster non empty strict partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction infinite non degenerated well_founded ECIW-strict UAStr;
end;

:: AOFA_000:modenot 3
definition
  mode IfWhileAlgebra is non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction non degenerated well_founded ECIW-strict UAStr;
end;

:: AOFA_000:funcreg 13
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction infinite UAStr;
  cluster ElementaryInstructions a1 -> infinite;
end;

:: AOFA_000:th 76
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of bool the carrier of b1
for b3 being natural set holds
   EmptyIns b1 in b2 |^ (b3 + 1) &
    (for b4, b5, b6 being Element of the carrier of b1
          st b4 in b2 |^ b3 & b5 in b2 |^ b3 & b6 in b2 |^ b3
       holds b5 \; b6 in b2 |^ (b3 + 1) & if-then-else(b4,b5,b6) in b2 |^ (b3 + 1) & while(b4,b5) in b2 |^ (b3 + 1));

:: AOFA_000:th 77
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr
for b2 being set
for b3 being natural set
      st b2 in (ElementaryInstructions b1) |^ (b3 + 1) &
         not b2 in (ElementaryInstructions b1) |^ b3 &
         b2 <> EmptyIns b1 &
         (for b4, b5 being Element of the carrier of b1
               st b2 = b4 \; b5 & b4 in (ElementaryInstructions b1) |^ b3
            holds not b5 in (ElementaryInstructions b1) |^ b3) &
         (for b4, b5, b6 being Element of the carrier of b1
               st b2 = if-then-else(b4,b5,b6) & b4 in (ElementaryInstructions b1) |^ b3 & b5 in (ElementaryInstructions b1) |^ b3
            holds not b6 in (ElementaryInstructions b1) |^ b3)
   holds ex b4, b5 being Element of the carrier of b1 st
      b2 = while(b4,b5) & b4 in (ElementaryInstructions b1) |^ b3 & b5 in (ElementaryInstructions b1) |^ b3;

:: AOFA_000:th 78
theorem
for b1 being non empty partial quasi_total non-empty UAStr
for b2 being Element of bool the carrier of b1 holds
   Constants b1 c= b2 |^ 1;

:: AOFA_000:th 79
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr holds
      b1 is well_founded
   iff
      for b2 being Element of the carrier of b1 holds
         ex b3 being natural set st
            b2 in (ElementaryInstructions b1) |^ b3;

:: AOFA_000:sch 2
scheme AOFA_000:sch 2
{F1 -> non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction well_founded ECIW-strict UAStr,
  F2 -> Element of the carrier of F1()}:
P1[F2()]
provided
   for b1 being Element of the carrier of F1()
         st b1 in ElementaryInstructions F1()
      holds P1[b1]
and
   P1[EmptyIns F1()]
and
   for b1, b2 being Element of the carrier of F1()
         st P1[b1] & P1[b2]
      holds P1[b1 \; b2]
and
   for b1, b2, b3 being Element of the carrier of F1()
         st P1[b1] & P1[b2] & P1[b3]
      holds P1[if-then-else(b1,b2,b3)]
and
   for b1, b2 being Element of the carrier of F1()
         st P1[b1] & P1[b2]
      holds P1[while(b1,b2)];


:: AOFA_000:attrnot 13 => AOFA_000:attr 13
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
  attr a3 is complying_with_empty-instruction means
    for b1 being Element of a2 holds
       a3 .(b1,EmptyIns a1) = b1;
end;

:: AOFA_000:dfs 28
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
To prove
     a3 is complying_with_empty-instruction
it is sufficient to prove
  thus for b1 being Element of a2 holds
       a3 .(b1,EmptyIns a1) = b1;

:: AOFA_000:def 28
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,the carrier of b1:],b2 holds
      b3 is complying_with_empty-instruction(b1, b2)
   iff
      for b4 being Element of b2 holds
         b3 .(b4,EmptyIns b1) = b4;

:: AOFA_000:attrnot 14 => AOFA_000:attr 14
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
  attr a3 is complying_with_catenation means
    for b1 being Element of a2
    for b2, b3 being Element of the carrier of a1 holds
    a3 .(b1,b2 \; b3) = a3 .(a3 .(b1,b2),b3);
end;

:: AOFA_000:dfs 29
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
To prove
     a3 is complying_with_catenation
it is sufficient to prove
  thus for b1 being Element of a2
    for b2, b3 being Element of the carrier of a1 holds
    a3 .(b1,b2 \; b3) = a3 .(a3 .(b1,b2),b3);

:: AOFA_000:def 29
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Function-like quasi_total Relation of [:b2,the carrier of b1:],b2 holds
      b3 is complying_with_catenation(b1, b2)
   iff
      for b4 being Element of b2
      for b5, b6 being Element of the carrier of b1 holds
      b3 .(b4,b5 \; b6) = b3 .(b3 .(b4,b5),b6);

:: AOFA_000:prednot 3 => AOFA_000:pred 2
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
  pred A4 complies_with_if_wrt A3 means
    for b1 being Element of a2
    for b2, b3, b4 being Element of the carrier of a1 holds
    (a4 .(b1,b2) in a3 implies a4 .(b1,if-then-else(b2,b3,b4)) = a4 .(a4 .(b1,b2),b3)) &
     (a4 .(b1,b2) in a3 or a4 .(b1,if-then-else(b2,b3,b4)) = a4 .(a4 .(b1,b2),b4));
end;

:: AOFA_000:dfs 30
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
To prove
     a4 complies_with_if_wrt a3
it is sufficient to prove
  thus for b1 being Element of a2
    for b2, b3, b4 being Element of the carrier of a1 holds
    (a4 .(b1,b2) in a3 implies a4 .(b1,if-then-else(b2,b3,b4)) = a4 .(a4 .(b1,b2),b3)) &
     (a4 .(b1,b2) in a3 or a4 .(b1,if-then-else(b2,b3,b4)) = a4 .(a4 .(b1,b2),b4));

:: AOFA_000:def 30
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Function-like quasi_total Relation of [:b2,the carrier of b1:],b2 holds
      b4 complies_with_if_wrt b3
   iff
      for b5 being Element of b2
      for b6, b7, b8 being Element of the carrier of b1 holds
      (b4 .(b5,b6) in b3 implies b4 .(b5,if-then-else(b6,b7,b8)) = b4 .(b4 .(b5,b6),b7)) &
       (b4 .(b5,b6) in b3 or b4 .(b5,if-then-else(b6,b7,b8)) = b4 .(b4 .(b5,b6),b8));

:: AOFA_000:prednot 4 => AOFA_000:pred 3
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
  pred A4 complies_with_while_wrt A3 means
    for b1 being Element of a2
    for b2, b3 being Element of the carrier of a1 holds
    (a4 .(b1,b2) in a3 implies a4 .(b1,while(b2,b3)) = a4 .(a4 .(a4 .(b1,b2),b3),while(b2,b3))) &
     (a4 .(b1,b2) in a3 or a4 .(b1,while(b2,b3)) = a4 .(b1,b2));
end;

:: AOFA_000:dfs 31
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
To prove
     a4 complies_with_while_wrt a3
it is sufficient to prove
  thus for b1 being Element of a2
    for b2, b3 being Element of the carrier of a1 holds
    (a4 .(b1,b2) in a3 implies a4 .(b1,while(b2,b3)) = a4 .(a4 .(a4 .(b1,b2),b3),while(b2,b3))) &
     (a4 .(b1,b2) in a3 or a4 .(b1,while(b2,b3)) = a4 .(b1,b2));

:: AOFA_000:def 31
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Function-like quasi_total Relation of [:b2,the carrier of b1:],b2 holds
      b4 complies_with_while_wrt b3
   iff
      for b5 being Element of b2
      for b6, b7 being Element of the carrier of b1 holds
      (b4 .(b5,b6) in b3 implies b4 .(b5,while(b6,b7)) = b4 .(b4 .(b4 .(b5,b6),b7),while(b6,b7))) &
       (b4 .(b5,b6) in b3 or b4 .(b5,while(b6,b7)) = b4 .(b5,b6));

:: AOFA_000:th 80
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being non empty set
for b5 being Element of bool b4
for b6 being Function-like quasi_total Relation of [:b4,the carrier of b1:],b4
   st b6 is complying_with_empty-instruction(b1, b4) & b6 complies_with_if_wrt b5
for b7 being Element of b4
      st not b6 .(b7,b2) in b5
   holds b6 .(b7,if-then(b2,b3)) = b6 .(b7,b2);

:: AOFA_000:th 81
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2 holds
   pr1(b2,the carrier of b1) is complying_with_empty-instruction(b1, b2) & pr1(b2,the carrier of b1) is complying_with_catenation(b1, b2) & pr1(b2,the carrier of b1) complies_with_if_wrt b3 & pr1(b2,the carrier of b1) complies_with_while_wrt b3;

:: AOFA_000:modenot 4 => AOFA_000:mode 1
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  mode ExecutionFunction of A1,A2,A3 -> Function-like quasi_total Relation of [:a2,the carrier of a1:],a2 means
    it is complying_with_empty-instruction(a1, a2) & it is complying_with_catenation(a1, a2) & it complies_with_if_wrt a3 & it complies_with_while_wrt a3;
end;

:: AOFA_000:dfs 32
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Function-like quasi_total Relation of [:a2,the carrier of a1:],a2;
To prove
     a4 is ExecutionFunction of a1,a2,a3
it is sufficient to prove
  thus a4 is complying_with_empty-instruction(a1, a2) & a4 is complying_with_catenation(a1, a2) & a4 complies_with_if_wrt a3 & a4 complies_with_while_wrt a3;

:: AOFA_000:def 32
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Function-like quasi_total Relation of [:b2,the carrier of b1:],b2 holds
      b4 is ExecutionFunction of b1,b2,b3
   iff
      b4 is complying_with_empty-instruction(b1, b2) & b4 is complying_with_catenation(b1, b2) & b4 complies_with_if_wrt b3 & b4 complies_with_while_wrt b3;

:: AOFA_000:condreg 5
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  cluster -> complying_with_empty-instruction complying_with_catenation (ExecutionFunction of a1,a2,a3);
end;

:: AOFA_000:prednot 5 => AOFA_000:pred 4
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be Element of the carrier of a1;
  let a3 be non empty set;
  let a4 be Element of a3;
  let a5 be Element of bool a3;
  let a6 be ExecutionFunction of a1,a3,a5;
  pred A6 iteration_terminates_for A2,A4 means
    ex b1 being non empty FinSequence of a3 st
       b1 . 1 = a4 &
        not b1 . len b1 in a5 &
        (for b2 being natural set
              st 1 <= b2 & b2 < len b1
           holds b1 . b2 in a5 &
            b1 . (b2 + 1) = a6 .(b1 . b2,a2));
end;

:: AOFA_000:dfs 33
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be Element of the carrier of a1;
  let a3 be non empty set;
  let a4 be Element of a3;
  let a5 be Element of bool a3;
  let a6 be ExecutionFunction of a1,a3,a5;
To prove
     a6 iteration_terminates_for a2,a4
it is sufficient to prove
  thus ex b1 being non empty FinSequence of a3 st
       b1 . 1 = a4 &
        not b1 . len b1 in a5 &
        (for b2 being natural set
              st 1 <= b2 & b2 < len b1
           holds b1 . b2 in a5 &
            b1 . (b2 + 1) = a6 .(b1 . b2,a2));

:: AOFA_000:def 33
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of b3
for b5 being Element of bool b3
for b6 being ExecutionFunction of b1,b3,b5 holds
      b6 iteration_terminates_for b2,b4
   iff
      ex b7 being non empty FinSequence of b3 st
         b7 . 1 = b4 &
          not b7 . len b7 in b5 &
          (for b8 being natural set
                st 1 <= b8 & b8 < len b7
             holds b7 . b8 in b5 &
              b7 . (b8 + 1) = b6 .(b7 . b8,b2));

:: AOFA_000:funcnot 20 => AOFA_000:func 20
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be Element of the carrier of a1;
  let a3 be non empty set;
  let a4 be Element of a3;
  let a5 be Element of bool a3;
  let a6 be ExecutionFunction of a1,a3,a5;
  func iteration-degree(A2,A4,A6) -> Element of ExtREAL means
    ex b1 being non empty FinSequence of a3 st
       it = (len b1) - 1 &
        b1 . 1 = a4 &
        not b1 . len b1 in a5 &
        (for b2 being natural set
              st 1 <= b2 & b2 < len b1
           holds b1 . b2 in a5 &
            b1 . (b2 + 1) = a6 .(b1 . b2,a2))
    if a6 iteration_terminates_for a2,a4
    otherwise it = +infty;
end;

:: AOFA_000:def 34
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of b3
for b5 being Element of bool b3
for b6 being ExecutionFunction of b1,b3,b5
for b7 being Element of ExtREAL holds
   (b6 iteration_terminates_for b2,b4 implies    (b7 = iteration-degree(b2,b4,b6)
    iff
       ex b8 being non empty FinSequence of b3 st
          b7 = (len b8) - 1 &
           b8 . 1 = b4 &
           not b8 . len b8 in b5 &
           (for b9 being natural set
                 st 1 <= b9 & b9 < len b8
              holds b8 . b9 in b5 &
               b8 . (b9 + 1) = b6 .(b8 . b9,b2)))) &
    (b6 iteration_terminates_for b2,b4 or    (b7 = iteration-degree(b2,b4,b6)
    iff
       b7 = +infty));

:: AOFA_000:th 82
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of bool b3
for b5 being Element of b3
for b6 being ExecutionFunction of b1,b3,b4 holds
      b6 iteration_terminates_for b2,b5
   iff
      iteration-degree(b2,b5,b6) < +infty;

:: AOFA_000:th 83
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of bool b3
for b5 being Element of b3
for b6 being ExecutionFunction of b1,b3,b4
      st not b5 in b4
   holds b6 iteration_terminates_for b2,b5 & iteration-degree(b2,b5,b6) = 0;

:: AOFA_000:th 84
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of bool b3
for b5 being Element of b3
for b6 being ExecutionFunction of b1,b3,b4
      st b5 in b4
   holds (b6 iteration_terminates_for b2,b5 implies b6 iteration_terminates_for b2,b6 .(b5,b2)) &
    (b6 iteration_terminates_for b2,b6 .(b5,b2) implies b6 iteration_terminates_for b2,b5) &
    iteration-degree(b2,b5,b6) = 1. + iteration-degree(b2,b6 .(b5,b2),b6);

:: AOFA_000:th 85
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of bool b3
for b5 being Element of b3
for b6 being ExecutionFunction of b1,b3,b4 holds
   0 <= iteration-degree(b2,b5,b6);

:: AOFA_000:sch 3
scheme AOFA_000:sch 3
{F1 -> non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr,
  F2 -> Element of the carrier of F1(),
  F3 -> non empty set,
  F4 -> Element of F3(),
  F5 -> Element of bool F3(),
  F6 -> ExecutionFunction of F1(),F3(),F5(),
  F7 -> natural set}:
F6() iteration_terminates_for F2(),F4()
provided
      (F4() in F5()
   iff
      P1[F4()])
and
   for b1 being Element of F3()
         st P1[b1]
      holds (P1[F6() .(b1,F2())] implies F6() .(b1,F2()) in F5()) & (F6() .(b1,F2()) in F5() implies P1[F6() .(b1,F2())]) & F7(F6() .(b1,F2())) < F7(b1);


:: AOFA_000:sch 4
scheme AOFA_000:sch 4
{F1 -> non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr,
  F2 -> Element of the carrier of F1(),
  F3 -> non empty set,
  F4 -> Element of F3(),
  F5 -> Element of bool F3(),
  F6 -> ExecutionFunction of F1(),F3(),F5(),
  F7 -> natural set}:
F6() iteration_terminates_for F2(),F4()
provided
   P1[F4()]
and
      (F4() in F5()
   iff
      P2[F4()])
and
   for b1 being Element of F3()
         st P1[b1] & b1 in F5() & P2[b1]
      holds P1[F6() .(b1,F2())] & (P2[F6() .(b1,F2())] implies F6() .(b1,F2()) in F5()) & (F6() .(b1,F2()) in F5() implies P2[F6() .(b1,F2())]) & F7(F6() .(b1,F2())) < F7(b1);


:: AOFA_000:th 86
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being non empty set
for b5 being Element of bool b4
for b6 being Element of b4
for b7 being ExecutionFunction of b1,b4,b5
for b8 being non empty FinSequence of b4
      st b8 . 1 = b7 .(b6,b2) &
         not b8 . len b8 in b5 &
         (for b9 being natural set
               st 1 <= b9 & b9 < len b8
            holds b8 . b9 in b5 &
             b8 . (b9 + 1) = b7 .(b8 . b9,b3 \; b2))
   holds b7 .(b6,while(b2,b3)) = b8 . len b8;

:: AOFA_000:th 87
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being Element of the carrier of b1
for b6 being Element of b2 holds
      not b4 iteration_terminates_for b5,b6
   iff
      ((curry' b4) . b5) orbit b6 c= b3;

:: AOFA_000:sch 5
scheme AOFA_000:sch 5
{F1 -> non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr,
  F2 -> Element of the carrier of F1(),
  F3 -> Element of the carrier of F1(),
  F4 -> non empty set,
  F5 -> Element of F4(),
  F6 -> Element of bool F4(),
  F7 -> ExecutionFunction of F1(),F4(),F6()}:
P1[F7() .(F5(),while(F2(),F3()))] & not (P2[F7() .(F5(),while(F2(),F3()))])
provided
   P1[F5()]
and
   F7() iteration_terminates_for F3() \; F2(),F7() .(F5(),F2())
and
   for b1 being Element of F4()
         st P1[b1] & b1 in F6() & P2[b1]
      holds P1[F7() .(b1,F3())]
and
   for b1 being Element of F4()
         st P1[b1]
      holds P1[F7() .(b1,F2())] & (F7() .(b1,F2()) in F6() implies P2[F7() .(b1,F2())]) & (P2[F7() .(b1,F2())] implies F7() .(b1,F2()) in F6());


:: AOFA_000:sch 6
scheme AOFA_000:sch 6
{F1 -> non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr,
  F2 -> Element of the carrier of F1(),
  F3 -> Element of the carrier of F1(),
  F4 -> non empty set,
  F5 -> Element of F4(),
  F6 -> Element of bool F4(),
  F7 -> ExecutionFunction of F1(),F4(),F6()}:
P1[F5()]
provided
   P1[F7() .(F5(),while(F2(),F3()))]
and
   F7() iteration_terminates_for F3() \; F2(),F7() .(F5(),F2())
and
   for b1 being Element of F4()
         st P1[F7() .(F7() .(b1,F2()),F3())] & F7() .(b1,F2()) in F6()
      holds P1[F7() .(b1,F2())]
and
   for b1 being Element of F4()
         st P1[F7() .(b1,F2())]
      holds P1[b1];


:: AOFA_000:th 88
theorem
for b1 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being natural set
      st b2 \; b3 in (ElementaryInstructions b1) |^ b4
   holds ex b5 being natural set st
      b4 = b5 + 1 & b2 in (ElementaryInstructions b1) |^ b5 & b3 in (ElementaryInstructions b1) |^ b5;

:: AOFA_000:th 89
theorem
for b1 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3, b4 being Element of the carrier of b1
for b5 being natural set
      st if-then-else(b2,b3,b4) in (ElementaryInstructions b1) |^ b5
   holds ex b6 being natural set st
      b5 = b6 + 1 & b2 in (ElementaryInstructions b1) |^ b6 & b3 in (ElementaryInstructions b1) |^ b6 & b4 in (ElementaryInstructions b1) |^ b6;

:: AOFA_000:th 90
theorem
for b1 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being natural set
      st while(b2,b3) in (ElementaryInstructions b1) |^ b4
   holds ex b5 being natural set st
      b4 = b5 + 1 & b2 in (ElementaryInstructions b1) |^ b5 & b3 in (ElementaryInstructions b1) |^ b5;

:: AOFA_000:sch 7
scheme AOFA_000:sch 7
{F1 -> non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr,
  F2 -> non empty set,
  F3 -> Element of F2(),
  F4 -> set,
  F5 -> Element of F2(),
  F6 -> Element of F2(),
  F7 -> Element of F2()}:
ex b1 being Function-like quasi_total Relation of the carrier of F1(),F2() st
   (for b2 being Element of the carrier of F1()
          st b2 in ElementaryInstructions F1()
       holds b1 . b2 = F4(b2)) &
    b1 . EmptyIns F1() = F3() &
    (for b2, b3 being Element of the carrier of F1() holds
    b1 . (b2 \; b3) = F5(b1 . b2, b1 . b3)) &
    (for b2, b3, b4 being Element of the carrier of F1() holds
    b1 . if-then-else(b2,b3,b4) = F7(b1 . b2, b1 . b3, b1 . b4)) &
    (for b2, b3 being Element of the carrier of F1() holds
    b1 . while(b2,b3) = F6(b1 . b2, b1 . b3))
provided
   for b1 being Element of the carrier of F1()
         st b1 in ElementaryInstructions F1()
      holds F4(b1) in F2();


:: AOFA_000:th 91
theorem
for b1 being non empty set
for b2 being Element of bool b1
for b3 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr
for b4 being Function-like quasi_total Relation of [:b1,ElementaryInstructions b3:],b1
for b5 being Element of b1 holds
   ex b6 being ExecutionFunction of b3,b1,b2 st
      b6 | [:b1,ElementaryInstructions b3:] = b4 &
       (for b7 being Element of b1
       for b8, b9 being Element of the carrier of b3
             st not b6 iteration_terminates_for b9 \; b8,b6 .(b7,b8)
          holds b6 .(b7,while(b8,b9)) = b5);

:: AOFA_000:th 92
theorem
for b1 being non empty set
for b2 being Element of bool b1
for b3 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr
for b4 being Function-like quasi_total Relation of [:b1,ElementaryInstructions b3:],b1
for b5 being Function-like quasi_total Relation of Funcs(b1,b1),Funcs(b1,b1)
      st for b6 being Element of Funcs(b1,b1) holds
           (b5 . b6) * b6 = b5 . b6
   holds ex b6 being ExecutionFunction of b3,b1,b2 st
      b6 | [:b1,ElementaryInstructions b3:] = b4 &
       (for b7, b8 being Element of the carrier of b3
       for b9 being Element of b1
             st not b6 iteration_terminates_for b8 \; b7,b6 .(b9,b7)
          holds b6 .(b9,while(b7,b8)) = (b5 . ((curry' b6) . (b8 \; b7))) . (b6 .(b9,b7)));

:: AOFA_000:th 93
theorem
for b1 being non empty set
for b2 being Element of bool b1
for b3 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr
for b4, b5 being ExecutionFunction of b3,b1,b2
      st b4 | [:b1,ElementaryInstructions b3:] = b5 | [:b1,ElementaryInstructions b3:] &
         (for b6 being Element of b1
         for b7, b8 being Element of the carrier of b3
               st not b4 iteration_terminates_for b8 \; b7,b4 .(b6,b7)
            holds b4 .(b6,while(b7,b8)) = b5 .(b6,while(b7,b8)))
   holds b4 = b5;

:: AOFA_000:funcnot 21 => AOFA_000:func 21
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be ExecutionFunction of a1,a2,a3;
  func TerminatingPrograms(A1,A2,A3,A4) -> Element of bool [:a2,the carrier of a1:] means
    [:a2,ElementaryInstructions a1:] c= it &
     [:a2,{EmptyIns a1}:] c= it &
     (for b1 being Element of a2
     for b2, b3, b4 being Element of the carrier of a1 holds
     ([b1,b3] in it & [a4 .(b1,b3),b4] in it implies [b1,b3 \; b4] in it) &
      ([b1,b2] in it & [a4 .(b1,b2),b3] in it & a4 .(b1,b2) in a3 implies [b1,if-then-else(b2,b3,b4)] in it) &
      ([b1,b2] in it & [a4 .(b1,b2),b4] in it & not a4 .(b1,b2) in a3 implies [b1,if-then-else(b2,b3,b4)] in it) &
      ([b1,b2] in it &
       (ex b5 being non empty FinSequence of a2 st
          b5 . 1 = a4 .(b1,b2) &
           not b5 . len b5 in a3 &
           (for b6 being natural set
                 st 1 <= b6 & b6 < len b5
              holds b5 . b6 in a3 &
               [b5 . b6,b3 \; b2] in it &
               b5 . (b6 + 1) = a4 .(b5 . b6,b3 \; b2))) implies [b1,while(b2,b3)] in it)) &
     (for b1 being Element of bool [:a2,the carrier of a1:]
           st [:a2,ElementaryInstructions a1:] c= b1 &
              [:a2,{EmptyIns a1}:] c= b1 &
              (for b2 being Element of a2
              for b3, b4, b5 being Element of the carrier of a1 holds
              ([b2,b4] in b1 & [a4 .(b2,b4),b5] in b1 implies [b2,b4 \; b5] in b1) &
               ([b2,b3] in b1 & [a4 .(b2,b3),b4] in b1 & a4 .(b2,b3) in a3 implies [b2,if-then-else(b3,b4,b5)] in b1) &
               ([b2,b3] in b1 & [a4 .(b2,b3),b5] in b1 & not a4 .(b2,b3) in a3 implies [b2,if-then-else(b3,b4,b5)] in b1) &
               ([b2,b3] in b1 &
                (ex b6 being non empty FinSequence of a2 st
                   b6 . 1 = a4 .(b2,b3) &
                    not b6 . len b6 in a3 &
                    (for b7 being natural set
                          st 1 <= b7 & b7 < len b6
                       holds b6 . b7 in a3 &
                        [b6 . b7,b4 \; b3] in b1 &
                        b6 . (b7 + 1) = a4 .(b6 . b7,b4 \; b3))) implies [b2,while(b3,b4)] in b1))
        holds it c= b1);
end;

:: AOFA_000:def 35
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being Element of bool [:b2,the carrier of b1:] holds
      b5 = TerminatingPrograms(b1,b2,b3,b4)
   iff
      [:b2,ElementaryInstructions b1:] c= b5 &
       [:b2,{EmptyIns b1}:] c= b5 &
       (for b6 being Element of b2
       for b7, b8, b9 being Element of the carrier of b1 holds
       ([b6,b8] in b5 & [b4 .(b6,b8),b9] in b5 implies [b6,b8 \; b9] in b5) &
        ([b6,b7] in b5 & [b4 .(b6,b7),b8] in b5 & b4 .(b6,b7) in b3 implies [b6,if-then-else(b7,b8,b9)] in b5) &
        ([b6,b7] in b5 & [b4 .(b6,b7),b9] in b5 & not b4 .(b6,b7) in b3 implies [b6,if-then-else(b7,b8,b9)] in b5) &
        ([b6,b7] in b5 &
         (ex b10 being non empty FinSequence of b2 st
            b10 . 1 = b4 .(b6,b7) &
             not b10 . len b10 in b3 &
             (for b11 being natural set
                   st 1 <= b11 & b11 < len b10
                holds b10 . b11 in b3 &
                 [b10 . b11,b8 \; b7] in b5 &
                 b10 . (b11 + 1) = b4 .(b10 . b11,b8 \; b7))) implies [b6,while(b7,b8)] in b5)) &
       (for b6 being Element of bool [:b2,the carrier of b1:]
             st [:b2,ElementaryInstructions b1:] c= b6 &
                [:b2,{EmptyIns b1}:] c= b6 &
                (for b7 being Element of b2
                for b8, b9, b10 being Element of the carrier of b1 holds
                ([b7,b9] in b6 & [b4 .(b7,b9),b10] in b6 implies [b7,b9 \; b10] in b6) &
                 ([b7,b8] in b6 & [b4 .(b7,b8),b9] in b6 & b4 .(b7,b8) in b3 implies [b7,if-then-else(b8,b9,b10)] in b6) &
                 ([b7,b8] in b6 & [b4 .(b7,b8),b10] in b6 & not b4 .(b7,b8) in b3 implies [b7,if-then-else(b8,b9,b10)] in b6) &
                 ([b7,b8] in b6 &
                  (ex b11 being non empty FinSequence of b2 st
                     b11 . 1 = b4 .(b7,b8) &
                      not b11 . len b11 in b3 &
                      (for b12 being natural set
                            st 1 <= b12 & b12 < len b11
                         holds b11 . b12 in b3 &
                          [b11 . b12,b9 \; b8] in b6 &
                          b11 . (b12 + 1) = b4 .(b11 . b12,b9 \; b8))) implies [b7,while(b8,b9)] in b6))
          holds b5 c= b6);

:: AOFA_000:attrnot 15 => AOFA_000:attr 15
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be Element of the carrier of a1;
  attr a2 is absolutely-terminating means
    for b1 being non empty set
    for b2 being Element of b1
    for b3 being Element of bool b1
    for b4 being ExecutionFunction of a1,b1,b3 holds
       [b2,a2] in TerminatingPrograms(a1,b1,b3,b4);
end;

:: AOFA_000:dfs 36
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be Element of the carrier of a1;
To prove
     a2 is absolutely-terminating
it is sufficient to prove
  thus for b1 being non empty set
    for b2 being Element of b1
    for b3 being Element of bool b1
    for b4 being ExecutionFunction of a1,b1,b3 holds
       [b2,a2] in TerminatingPrograms(a1,b1,b3,b4);

:: AOFA_000:def 36
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1 holds
      b2 is absolutely-terminating(b1)
   iff
      for b3 being non empty set
      for b4 being Element of b3
      for b5 being Element of bool b3
      for b6 being ExecutionFunction of b1,b3,b5 holds
         [b4,b2] in TerminatingPrograms(b1,b3,b5,b6);

:: AOFA_000:prednot 6 => AOFA_000:pred 5
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Element of the carrier of a1;
  let a5 be ExecutionFunction of a1,a2,a3;
  pred A4 is_terminating_wrt A5 means
    for b1 being Element of a2 holds
       [b1,a4] in TerminatingPrograms(a1,a2,a3,a5);
end;

:: AOFA_000:dfs 37
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Element of the carrier of a1;
  let a5 be ExecutionFunction of a1,a2,a3;
To prove
     a4 is_terminating_wrt a5
it is sufficient to prove
  thus for b1 being Element of a2 holds
       [b1,a4] in TerminatingPrograms(a1,a2,a3,a5);

:: AOFA_000:def 37
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of the carrier of b1
for b5 being ExecutionFunction of b1,b2,b3 holds
      b4 is_terminating_wrt b5
   iff
      for b6 being Element of b2 holds
         [b6,b4] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:prednot 7 => AOFA_000:pred 6
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Element of the carrier of a1;
  let a5 be ExecutionFunction of a1,a2,a3;
  let a6 be set;
  pred A4 is_terminating_wrt A5,A6 means
    for b1 being Element of a2
          st b1 in a6
       holds [b1,a4] in TerminatingPrograms(a1,a2,a3,a5);
end;

:: AOFA_000:dfs 38
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Element of the carrier of a1;
  let a5 be ExecutionFunction of a1,a2,a3;
  let a6 be set;
To prove
     a4 is_terminating_wrt a5,a6
it is sufficient to prove
  thus for b1 being Element of a2
          st b1 in a6
       holds [b1,a4] in TerminatingPrograms(a1,a2,a3,a5);

:: AOFA_000:def 38
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of the carrier of b1
for b5 being ExecutionFunction of b1,b2,b3
for b6 being set holds
      b4 is_terminating_wrt b5,b6
   iff
      for b7 being Element of b2
            st b7 in b6
         holds [b7,b4] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:prednot 8 => AOFA_000:pred 7
definition
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Element of the carrier of a1;
  let a5 be ExecutionFunction of a1,a2,a3;
  let a6 be set;
  pred A6 is_invariant_wrt A4,A5 means
    for b1 being Element of a2
          st b1 in a6
       holds a5 .(b1,a4) in a6;
end;

:: AOFA_000:dfs 39
definiens
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2 be non empty set;
  let a3 be Element of bool a2;
  let a4 be Element of the carrier of a1;
  let a5 be ExecutionFunction of a1,a2,a3;
  let a6 be set;
To prove
     a6 is_invariant_wrt a4,a5
it is sufficient to prove
  thus for b1 being Element of a2
          st b1 in a6
       holds a5 .(b1,a4) in a6;

:: AOFA_000:def 39
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of the carrier of b1
for b5 being ExecutionFunction of b1,b2,b3
for b6 being set holds
      b6 is_invariant_wrt b4,b5
   iff
      for b7 being Element of b2
            st b7 in b6
         holds b5 .(b7,b4) in b6;

:: AOFA_000:th 94
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
for b3 being non empty set
for b4 being Element of bool b3
for b5 being Element of b3
for b6 being ExecutionFunction of b1,b3,b4
      st b2 in ElementaryInstructions b1
   holds [b5,b2] in TerminatingPrograms(b1,b3,b4,b6);

:: AOFA_000:th 95
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being Element of the carrier of b1
      st b2 in ElementaryInstructions b1
   holds b2 is absolutely-terminating(b1);

:: AOFA_000:th 96
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of b2
for b5 being ExecutionFunction of b1,b2,b3 holds
   [b4,EmptyIns b1] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:funcreg 14
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  cluster EmptyIns a1 -> absolutely-terminating;
end;

:: AOFA_000:exreg 7
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  cluster absolutely-terminating Element of the carrier of a1;
end;

:: AOFA_000:th 97
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being non empty set
for b5 being Element of bool b4
for b6 being Element of b4
for b7 being ExecutionFunction of b1,b4,b5
      st b1 is free &
         [b6,b2 \; b3] in TerminatingPrograms(b1,b4,b5,b7)
   holds [b6,b2] in TerminatingPrograms(b1,b4,b5,b7) &
    [b7 .(b6,b2),b3] in TerminatingPrograms(b1,b4,b5,b7);

:: AOFA_000:funcreg 15
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2, a3 be absolutely-terminating Element of the carrier of a1;
  cluster a2 \; a3 -> absolutely-terminating;
end;

:: AOFA_000:th 98
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3, b4 being Element of the carrier of b1
for b5 being non empty set
for b6 being Element of bool b5
for b7 being Element of b5
for b8 being ExecutionFunction of b1,b5,b6
      st b1 is free &
         [b7,if-then-else(b2,b3,b4)] in TerminatingPrograms(b1,b5,b6,b8)
   holds [b7,b2] in TerminatingPrograms(b1,b5,b6,b8) &
    (b8 .(b7,b2) in b6 implies [b8 .(b7,b2),b3] in TerminatingPrograms(b1,b5,b6,b8)) &
    (b8 .(b7,b2) in b6 or [b8 .(b7,b2),b4] in TerminatingPrograms(b1,b5,b6,b8));

:: AOFA_000:funcreg 16
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2, a3, a4 be absolutely-terminating Element of the carrier of a1;
  cluster if-then-else(a2,a3,a4) -> absolutely-terminating;
end;

:: AOFA_000:funcreg 17
registration
  let a1 be non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr;
  let a2, a3 be absolutely-terminating Element of the carrier of a1;
  cluster if-then(a2,a3) -> absolutely-terminating;
end;

:: AOFA_000:th 99
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being non empty set
for b5 being Element of bool b4
for b6 being Element of b4
for b7 being ExecutionFunction of b1,b4,b5
      st b1 is free &
         [b6,while(b2,b3)] in TerminatingPrograms(b1,b4,b5,b7)
   holds [b6,b2] in TerminatingPrograms(b1,b4,b5,b7) &
    (ex b8 being non empty FinSequence of b4 st
       b8 . 1 = b7 .(b6,b2) &
        not b8 . len b8 in b5 &
        (for b9 being natural set
              st 1 <= b9 & b9 < len b8
           holds b8 . b9 in b5 &
            [b8 . b9,b3 \; b2] in TerminatingPrograms(b1,b4,b5,b7) &
            b8 . (b9 + 1) = b7 .(b8 . b9,b3 \; b2)));

:: AOFA_000:th 100
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2, b3 being Element of the carrier of b1
for b4 being non empty set
for b5 being Element of bool b4
for b6 being Element of b4
for b7 being ExecutionFunction of b1,b4,b5
      st b1 is free &
         [b6,while(b2,b3)] in TerminatingPrograms(b1,b4,b5,b7) &
         b7 .(b6,b2) in b5
   holds [b7 .(b6,b2),b3] in TerminatingPrograms(b1,b4,b5,b7);

:: AOFA_000:th 101
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of b2
for b5 being ExecutionFunction of b1,b2,b3
for b6, b7 being absolutely-terminating Element of the carrier of b1
      st b5 iteration_terminates_for b7 \; b6,b5 .(b4,b6)
   holds [b4,while(b6,b7)] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:th 102
theorem
for b1 being non empty set
for b2 being Element of bool b1
for b3 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr
for b4, b5 being ExecutionFunction of b3,b1,b2
      st b4 | [:b1,ElementaryInstructions b3:] = b5 | [:b1,ElementaryInstructions b3:]
   holds TerminatingPrograms(b3,b1,b2,b4) = TerminatingPrograms(b3,b1,b2,b5);

:: AOFA_000:th 103
theorem
for b1 being non empty set
for b2 being Element of bool b1
for b3 being non empty partial quasi_total non-empty free with_empty-instruction with_catenation with_if-instruction with_while-instruction ECIW-strict UAStr
for b4, b5 being ExecutionFunction of b3,b1,b2
   st b4 | [:b1,ElementaryInstructions b3:] = b5 | [:b1,ElementaryInstructions b3:]
for b6 being Element of b1
for b7 being Element of the carrier of b3
      st [b6,b7] in TerminatingPrograms(b3,b1,b2,b4)
   holds b4 .(b6,b7) = b5 .(b6,b7);

:: AOFA_000:th 104
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being absolutely-terminating Element of the carrier of b1 holds
   b5 is_terminating_wrt b4;

:: AOFA_000:th 105
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being Element of the carrier of b1 holds
      b5 is_terminating_wrt b4
   iff
      b5 is_terminating_wrt b4,b2;

:: AOFA_000:th 106
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being Element of the carrier of b1
   st b5 is_terminating_wrt b4
for b6 being set holds
   b5 is_terminating_wrt b4,b6;

:: AOFA_000:th 107
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being absolutely-terminating Element of the carrier of b1
for b6 being set holds
   b5 is_terminating_wrt b4,b6;

:: AOFA_000:th 108
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being Element of the carrier of b1 holds
   b2 is_invariant_wrt b5,b4;

:: AOFA_000:th 109
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being set
for b6, b7 being Element of the carrier of b1
      st b5 is_invariant_wrt b6,b4 & b5 is_invariant_wrt b7,b4
   holds b5 is_invariant_wrt b6 \; b7,b4;

:: AOFA_000:th 110
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5, b6 being Element of the carrier of b1
      st b5 is_terminating_wrt b4 & b6 is_terminating_wrt b4
   holds b5 \; b6 is_terminating_wrt b4;

:: AOFA_000:th 111
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being set
for b6, b7 being Element of the carrier of b1
      st b6 is_terminating_wrt b4,b5 & b7 is_terminating_wrt b4,b5 & b5 is_invariant_wrt b6,b4
   holds b6 \; b7 is_terminating_wrt b4,b5;

:: AOFA_000:th 112
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5, b6, b7 being Element of the carrier of b1
      st b5 is_terminating_wrt b4 & b6 is_terminating_wrt b4 & b7 is_terminating_wrt b4
   holds if-then-else(b5,b6,b7) is_terminating_wrt b4;

:: AOFA_000:th 113
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being set
for b6, b7, b8 being Element of the carrier of b1
      st b6 is_terminating_wrt b4,b5 & b7 is_terminating_wrt b4,b5 & b8 is_terminating_wrt b4,b5 & b5 is_invariant_wrt b6,b4
   holds if-then-else(b6,b7,b8) is_terminating_wrt b4,b5;

:: AOFA_000:th 114
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of b2
for b5 being ExecutionFunction of b1,b2,b3
for b6, b7 being Element of the carrier of b1
      st b6 is_terminating_wrt b5 & b7 is_terminating_wrt b5 & b5 iteration_terminates_for b7 \; b6,b5 .(b4,b6)
   holds [b4,while(b6,b7)] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:th 115
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of b2
for b5 being ExecutionFunction of b1,b2,b3
for b6 being set
for b7, b8 being Element of the carrier of b1
      st b7 is_terminating_wrt b5,b6 & b8 is_terminating_wrt b5,b6 & b6 is_invariant_wrt b7,b5 & b6 is_invariant_wrt b8,b5 & b5 iteration_terminates_for b8 \; b7,b5 .(b4,b7) & b4 in b6
   holds [b4,while(b7,b8)] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:th 116
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being Element of b2
for b5 being ExecutionFunction of b1,b2,b3
for b6 being set
for b7, b8 being Element of the carrier of b1
      st b7 is_terminating_wrt b5 &
         b8 is_terminating_wrt b5,b6 &
         b6 is_invariant_wrt b7,b5 &
         (for b9 being Element of b2
               st b9 in b6 & b5 .(b5 .(b9,b8),b7) in b3
            holds b5 .(b9,b8) in b6) &
         b5 iteration_terminates_for b8 \; b7,b5 .(b4,b7) &
         b4 in b6
   holds [b4,while(b7,b8)] in TerminatingPrograms(b1,b2,b3,b5);

:: AOFA_000:th 117
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5, b6 being Element of the carrier of b1
      st b5 is_terminating_wrt b4 &
         b6 is_terminating_wrt b4 &
         (for b7 being Element of b2 holds
            b4 iteration_terminates_for b6 \; b5,b7)
   holds while(b5,b6) is_terminating_wrt b4;

:: AOFA_000:th 118
theorem
for b1 being non empty partial quasi_total non-empty with_empty-instruction with_catenation with_if-instruction with_while-instruction UAStr
for b2 being non empty set
for b3 being Element of bool b2
for b4 being ExecutionFunction of b1,b2,b3
for b5 being set
for b6, b7 being Element of the carrier of b1
      st b6 is_terminating_wrt b4 &
         b7 is_terminating_wrt b4,b5 &
         b5 is_invariant_wrt b6,b4 &
         (for b8 being Element of b2
               st b8 in b5 & b4 .(b4 .(b8,b7),b6) in b3
            holds b4 .(b8,b7) in b5) &
         (for b8 being Element of b2
               st b4 .(b8,b6) in b5
            holds b4 iteration_terminates_for b7 \; b6,b4 .(b8,b6))
   holds while(b6,b7) is_terminating_wrt b4,b5;