Article REWRITE1, MML version 4.99.1005

:: REWRITE1:funcnot 1 => REWRITE1:func 1
definition
  let a1, a2 be Relation-like Function-like FinSequence-like set;
  func A1 $^ A2 -> Relation-like Function-like FinSequence-like set means
    it = a1 ^ a2
    if (a1 = {} or a2 = {})
    otherwise ex b1 being Element of NAT st
       ex b2 being Relation-like Function-like FinSequence-like set st
          len a1 = b1 + 1 & b2 = a1 | Seg b1 & it = b2 ^ a2;
end;

:: REWRITE1:def 1
theorem
for b1, b2, b3 being Relation-like Function-like FinSequence-like set holds
(b1 <> {} & b2 <> {} or    (b3 = b1 $^ b2
 iff
    b3 = b1 ^ b2)) &
 (b1 <> {} & b2 <> {} implies    (b3 = b1 $^ b2
 iff
    ex b4 being Element of NAT st
       ex b5 being Relation-like Function-like FinSequence-like set st
          len b1 = b4 + 1 & b5 = b1 | Seg b4 & b3 = b5 ^ b2));

:: REWRITE1:th 1
theorem
for b1 being Relation-like Function-like FinSequence-like set holds
   {} $^ b1 = b1 & b1 $^ {} = b1;

:: REWRITE1:th 2
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3 being set
      st b1 <> {}
   holds (b2 ^ <*b3*>) $^ b1 = b2 ^ b1;

:: REWRITE1:th 3
theorem
for b1, b2 being Relation-like Function-like FinSequence-like set
for b3, b4 being set holds
(b1 ^ <*b3*>) $^ (<*b4*> ^ b2) = (b1 ^ <*b4*>) ^ b2;

:: REWRITE1:th 4
theorem
for b1 being Relation-like Function-like FinSequence-like set
for b2 being set
      st b1 <> {}
   holds <*b2*> $^ b1 = b1;

:: REWRITE1:th 5
theorem
for b1 being Relation-like Function-like FinSequence-like set
      st b1 <> {}
   holds ex b2 being set st
      ex b3 being Relation-like Function-like FinSequence-like set st
         b1 = <*b2*> ^ b3 & len b1 = (len b3) + 1;

:: REWRITE1:sch 1
scheme REWRITE1:sch 1
{F1 -> Relation-like Function-like FinSequence-like set,
  F2 -> Relation-like Function-like FinSequence-like set}:
for b1 being Element of NAT
   st b1 in dom (F1() $^ F2()) & b1 + 1 in dom (F1() $^ F2())
for b2, b3 being set
      st b2 = (F1() $^ F2()) . b1 & b3 = (F1() $^ F2()) . (b1 + 1)
   holds P1[b2, b3]
provided
   for b1 being Element of NAT
         st b1 in dom F1() & b1 + 1 in dom F1()
      holds P1[F1() . b1, F1() . (b1 + 1)]
and
   for b1 being Element of NAT
         st b1 in dom F2() & b1 + 1 in dom F2()
      holds P1[F2() . b1, F2() . (b1 + 1)]
and
   0 < len F1() & 0 < len F2() & F1() . len F1() = F2() . 1;


:: REWRITE1:modenot 1 => REWRITE1:mode 1
definition
  let a1 be Relation-like set;
  mode RedSequence of A1 -> Relation-like Function-like FinSequence-like set means
    0 < len it &
     (for b1 being Element of NAT
           st b1 in dom it & b1 + 1 in dom it
        holds [it . b1,it . (b1 + 1)] in a1);
end;

:: REWRITE1:dfs 2
definiens
  let a1 be Relation-like set;
  let a2 be Relation-like Function-like FinSequence-like set;
To prove
     a2 is RedSequence of a1
it is sufficient to prove
  thus 0 < len a2 &
     (for b1 being Element of NAT
           st b1 in dom a2 & b1 + 1 in dom a2
        holds [a2 . b1,a2 . (b1 + 1)] in a1);

:: REWRITE1:def 2
theorem
for b1 being Relation-like set
for b2 being Relation-like Function-like FinSequence-like set holds
      b2 is RedSequence of b1
   iff
      0 < len b2 &
       (for b3 being Element of NAT
             st b3 in dom b2 & b3 + 1 in dom b2
          holds [b2 . b3,b2 . (b3 + 1)] in b1);

:: REWRITE1:condreg 1
registration
  let a1 be Relation-like set;
  cluster -> non empty (RedSequence of a1);
end;

:: REWRITE1:th 7
theorem
for b1 being Relation-like set
for b2 being set holds
   <*b2*> is RedSequence of b1;

:: REWRITE1:th 8
theorem
for b1 being Relation-like set
for b2, b3 being set
      st [b2,b3] in b1
   holds <*b2,b3*> is RedSequence of b1;

:: REWRITE1:th 9
theorem
for b1 being Relation-like set
for b2, b3 being RedSequence of b1
      st b2 . len b2 = b3 . 1
   holds b2 $^ b3 is RedSequence of b1;

:: REWRITE1:th 10
theorem
for b1 being Relation-like set
for b2 being RedSequence of b1 holds
   Rev b2 is RedSequence of b1 ~;

:: REWRITE1:th 11
theorem
for b1, b2 being Relation-like set
   st b1 c= b2
for b3 being RedSequence of b1 holds
   b3 is RedSequence of b2;

:: REWRITE1:prednot 1 => REWRITE1:pred 1
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A1 reduces A2,A3 means
    ex b1 being RedSequence of a1 st
       b1 . 1 = a2 & b1 . len b1 = a3;
end;

:: REWRITE1:dfs 3
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a1 reduces a2,a3
it is sufficient to prove
  thus ex b1 being RedSequence of a1 st
       b1 . 1 = a2 & b1 . len b1 = a3;

:: REWRITE1:def 3
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b1 reduces b2,b3
iff
   ex b4 being RedSequence of b1 st
      b4 . 1 = b2 & b4 . len b4 = b3;

:: REWRITE1:prednot 2 => REWRITE1:pred 2
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A2,A3 are_convertible_wrt A1 means
    a1 \/ (a1 ~) reduces a2,a3;
end;

:: REWRITE1:dfs 4
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a2,a3 are_convertible_wrt a1
it is sufficient to prove
  thus a1 \/ (a1 ~) reduces a2,a3;

:: REWRITE1:def 4
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b2,b3 are_convertible_wrt b1
iff
   b1 \/ (b1 ~) reduces b2,b3;

:: REWRITE1:th 12
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b1 reduces b2,b3
iff
   ex b4 being Relation-like Function-like FinSequence-like set st
      0 < len b4 &
       b4 . 1 = b2 &
       b4 . len b4 = b3 &
       (for b5 being Element of NAT
             st b5 in dom b4 & b5 + 1 in dom b4
          holds [b4 . b5,b4 . (b5 + 1)] in b1);

:: REWRITE1:th 13
theorem
for b1 being Relation-like set
for b2 being set holds
   b1 reduces b2,b2;

:: REWRITE1:th 14
theorem
for b1, b2 being set
      st {} reduces b1,b2
   holds b1 = b2;

:: REWRITE1:th 15
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b1 reduces b2,b3 & not b2 in field b1
   holds b2 = b3;

:: REWRITE1:th 16
theorem
for b1 being Relation-like set
for b2, b3 being set
      st [b2,b3] in b1
   holds b1 reduces b2,b3;

:: REWRITE1:th 17
theorem
for b1 being Relation-like set
for b2, b3, b4 being set
      st b1 reduces b2,b3 & b1 reduces b3,b4
   holds b1 reduces b2,b4;

:: REWRITE1:th 18
theorem
for b1 being Relation-like set
for b2 being RedSequence of b1
for b3, b4 being Element of NAT
      st b3 in dom b2 & b4 in dom b2 & b3 <= b4
   holds b1 reduces b2 . b3,b2 . b4;

:: REWRITE1:th 19
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b1 reduces b2,b3 & b2 <> b3
   holds b2 in field b1 & b3 in field b1;

:: REWRITE1:th 20
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b1 reduces b2,b3
   holds    b2 in field b1
   iff
      b3 in field b1;

:: REWRITE1:th 21
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b1 reduces b2,b3
iff
   (b2 = b3 or [b2,b3] in b1 [*]);

:: REWRITE1:th 22
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b1 reduces b2,b3
iff
   b1 [*] reduces b2,b3;

:: REWRITE1:th 23
theorem
for b1, b2 being Relation-like set
   st b1 c= b2
for b3, b4 being set
      st b1 reduces b3,b4
   holds b2 reduces b3,b4;

:: REWRITE1:th 24
theorem
for b1 being Relation-like set
for b2, b3, b4 being set holds
   b1 reduces b3,b4
iff
   b1 \/ id b2 reduces b3,b4;

:: REWRITE1:th 25
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b1 reduces b2,b3
   holds b1 ~ reduces b3,b2;

:: REWRITE1:th 26
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b1 reduces b2,b3
   holds b2,b3 are_convertible_wrt b1 & b3,b2 are_convertible_wrt b1;

:: REWRITE1:th 27
theorem
for b1 being Relation-like set
for b2 being set holds
   b2,b2 are_convertible_wrt b1;

:: REWRITE1:th 28
theorem
for b1, b2 being set
      st b1,b2 are_convertible_wrt {}
   holds b1 = b2;

:: REWRITE1:th 29
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_convertible_wrt b1 & not b2 in field b1
   holds b2 = b3;

:: REWRITE1:th 30
theorem
for b1 being Relation-like set
for b2, b3 being set
      st [b2,b3] in b1
   holds b2,b3 are_convertible_wrt b1;

:: REWRITE1:th 31
theorem
for b1 being Relation-like set
for b2, b3, b4 being set
      st b2,b3 are_convertible_wrt b1 & b3,b4 are_convertible_wrt b1
   holds b2,b4 are_convertible_wrt b1;

:: REWRITE1:th 32
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_convertible_wrt b1
   holds b3,b2 are_convertible_wrt b1;

:: REWRITE1:th 33
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_convertible_wrt b1 & b2 <> b3
   holds b2 in field b1 & b3 in field b1;

:: REWRITE1:prednot 3 => REWRITE1:pred 3
definition
  let a1 be Relation-like set;
  let a2 be set;
  pred A2 is_a_normal_form_wrt A1 means
    for b1 being set holds
       not [a2,b1] in a1;
end;

:: REWRITE1:dfs 5
definiens
  let a1 be Relation-like set;
  let a2 be set;
To prove
     a2 is_a_normal_form_wrt a1
it is sufficient to prove
  thus for b1 being set holds
       not [a2,b1] in a1;

:: REWRITE1:def 5
theorem
for b1 being Relation-like set
for b2 being set holds
      b2 is_a_normal_form_wrt b1
   iff
      for b3 being set holds
         not [b2,b3] in b1;

:: REWRITE1:th 34
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2 is_a_normal_form_wrt b1 & b1 reduces b2,b3
   holds b2 = b3;

:: REWRITE1:th 35
theorem
for b1 being Relation-like set
for b2 being set
      st not b2 in field b1
   holds b2 is_a_normal_form_wrt b1;

:: REWRITE1:prednot 4 => REWRITE1:pred 4
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A3 is_a_normal_form_of A2,A1 means
    a3 is_a_normal_form_wrt a1 & a1 reduces a2,a3;
end;

:: REWRITE1:dfs 6
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a3 is_a_normal_form_of a2,a1
it is sufficient to prove
  thus a3 is_a_normal_form_wrt a1 & a1 reduces a2,a3;

:: REWRITE1:def 6
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b3 is_a_normal_form_of b2,b1
iff
   b3 is_a_normal_form_wrt b1 & b1 reduces b2,b3;

:: REWRITE1:prednot 5 => REWRITE1:pred 5
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A2,A3 are_convergent_wrt A1 means
    ex b1 being set st
       a1 reduces a2,b1 & a1 reduces a3,b1;
end;

:: REWRITE1:dfs 7
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a2,a3 are_convergent_wrt a1
it is sufficient to prove
  thus ex b1 being set st
       a1 reduces a2,b1 & a1 reduces a3,b1;

:: REWRITE1:def 7
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b2,b3 are_convergent_wrt b1
iff
   ex b4 being set st
      b1 reduces b2,b4 & b1 reduces b3,b4;

:: REWRITE1:prednot 6 => REWRITE1:pred 6
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A2,A3 are_divergent_wrt A1 means
    ex b1 being set st
       a1 reduces b1,a2 & a1 reduces b1,a3;
end;

:: REWRITE1:dfs 8
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a2,a3 are_divergent_wrt a1
it is sufficient to prove
  thus ex b1 being set st
       a1 reduces b1,a2 & a1 reduces b1,a3;

:: REWRITE1:def 8
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b2,b3 are_divergent_wrt b1
iff
   ex b4 being set st
      b1 reduces b4,b2 & b1 reduces b4,b3;

:: REWRITE1:prednot 7 => REWRITE1:pred 7
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A2,A3 are_convergent<=1_wrt A1 means
    ex b1 being set st
       ([a2,b1] in a1 or a2 = b1) & ([a3,b1] in a1 or a3 = b1);
end;

:: REWRITE1:dfs 9
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a2,a3 are_convergent<=1_wrt a1
it is sufficient to prove
  thus ex b1 being set st
       ([a2,b1] in a1 or a2 = b1) & ([a3,b1] in a1 or a3 = b1);

:: REWRITE1:def 9
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b2,b3 are_convergent<=1_wrt b1
iff
   ex b4 being set st
      ([b2,b4] in b1 or b2 = b4) & ([b3,b4] in b1 or b3 = b4);

:: REWRITE1:prednot 8 => REWRITE1:pred 8
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A2,A3 are_divergent<=1_wrt A1 means
    ex b1 being set st
       ([b1,a2] in a1 or a2 = b1) & ([b1,a3] in a1 or a3 = b1);
end;

:: REWRITE1:dfs 10
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a2,a3 are_divergent<=1_wrt a1
it is sufficient to prove
  thus ex b1 being set st
       ([b1,a2] in a1 or a2 = b1) & ([b1,a3] in a1 or a3 = b1);

:: REWRITE1:def 10
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b2,b3 are_divergent<=1_wrt b1
iff
   ex b4 being set st
      ([b4,b2] in b1 or b2 = b4) & ([b4,b3] in b1 or b3 = b4);

:: REWRITE1:th 36
theorem
for b1 being Relation-like set
for b2 being set
      st not b2 in field b1
   holds b2 is_a_normal_form_of b2,b1;

:: REWRITE1:th 37
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b1 reduces b2,b3
   holds b2,b3 are_convergent_wrt b1 & b2,b3 are_divergent_wrt b1 & b3,b2 are_convergent_wrt b1 & b3,b2 are_divergent_wrt b1;

:: REWRITE1:th 38
theorem
for b1 being Relation-like set
for b2, b3 being set
      st (b2,b3 are_convergent_wrt b1 or b2,b3 are_divergent_wrt b1)
   holds b2,b3 are_convertible_wrt b1;

:: REWRITE1:th 39
theorem
for b1 being Relation-like set
for b2 being set holds
   b2,b2 are_convergent_wrt b1 & b2,b2 are_divergent_wrt b1;

:: REWRITE1:th 40
theorem
for b1, b2 being set
      st (b1,b2 are_convergent_wrt {} or b1,b2 are_divergent_wrt {})
   holds b1 = b2;

:: REWRITE1:th 41
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_convergent_wrt b1
   holds b3,b2 are_convergent_wrt b1;

:: REWRITE1:th 42
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_divergent_wrt b1
   holds b3,b2 are_divergent_wrt b1;

:: REWRITE1:th 43
theorem
for b1 being Relation-like set
for b2, b3, b4 being set
      st (b1 reduces b2,b3 & b3,b4 are_convergent_wrt b1 or b2,b3 are_convergent_wrt b1 & b1 reduces b4,b3)
   holds b2,b4 are_convergent_wrt b1;

:: REWRITE1:th 44
theorem
for b1 being Relation-like set
for b2, b3, b4 being set
      st (b1 reduces b3,b2 & b3,b4 are_divergent_wrt b1 or b2,b3 are_divergent_wrt b1 & b1 reduces b3,b4)
   holds b2,b4 are_divergent_wrt b1;

:: REWRITE1:th 45
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_convergent<=1_wrt b1
   holds b2,b3 are_convergent_wrt b1;

:: REWRITE1:th 46
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_divergent<=1_wrt b1
   holds b2,b3 are_divergent_wrt b1;

:: REWRITE1:prednot 9 => REWRITE1:pred 9
definition
  let a1 be Relation-like set;
  let a2 be set;
  pred A2 has_a_normal_form_wrt A1 means
    ex b1 being set st
       b1 is_a_normal_form_of a2,a1;
end;

:: REWRITE1:dfs 11
definiens
  let a1 be Relation-like set;
  let a2 be set;
To prove
     a2 has_a_normal_form_wrt a1
it is sufficient to prove
  thus ex b1 being set st
       b1 is_a_normal_form_of a2,a1;

:: REWRITE1:def 11
theorem
for b1 being Relation-like set
for b2 being set holds
      b2 has_a_normal_form_wrt b1
   iff
      ex b3 being set st
         b3 is_a_normal_form_of b2,b1;

:: REWRITE1:th 47
theorem
for b1 being Relation-like set
for b2 being set
      st not b2 in field b1
   holds b2 has_a_normal_form_wrt b1;

:: REWRITE1:funcnot 2 => REWRITE1:func 2
definition
  let a1 be Relation-like set;
  let a2 be set;
  assume a2 has_a_normal_form_wrt a1 &
     (for b1, b2 being set
           st b1 is_a_normal_form_of a2,a1 & b2 is_a_normal_form_of a2,a1
        holds b1 = b2);
  func nf(A2,A1) -> set means
    it is_a_normal_form_of a2,a1;
end;

:: REWRITE1:def 12
theorem
for b1 being Relation-like set
for b2 being set
   st b2 has_a_normal_form_wrt b1 &
      (for b3, b4 being set
            st b3 is_a_normal_form_of b2,b1 & b4 is_a_normal_form_of b2,b1
         holds b3 = b4)
for b3 being set holds
      b3 = nf(b2,b1)
   iff
      b3 is_a_normal_form_of b2,b1;

:: REWRITE1:attrnot 1 => REWRITE1:attr 1
definition
  let a1 be Relation-like set;
  attr a1 is co-well_founded means
    a1 ~ is well_founded;
end;

:: REWRITE1:dfs 13
definiens
  let a1 be Relation-like set;
To prove
     a1 is co-well_founded
it is sufficient to prove
  thus a1 ~ is well_founded;

:: REWRITE1:def 13
theorem
for b1 being Relation-like set holds
      b1 is co-well_founded
   iff
      b1 ~ is well_founded;

:: REWRITE1:attrnot 2 => REWRITE1:attr 2
definition
  let a1 be Relation-like set;
  attr a1 is weakly-normalizing means
    for b1 being set
          st b1 in field a1
       holds b1 has_a_normal_form_wrt a1;
end;

:: REWRITE1:dfs 14
definiens
  let a1 be Relation-like set;
To prove
     a1 is weakly-normalizing
it is sufficient to prove
  thus for b1 being set
          st b1 in field a1
       holds b1 has_a_normal_form_wrt a1;

:: REWRITE1:def 14
theorem
for b1 being Relation-like set holds
      b1 is weakly-normalizing
   iff
      for b2 being set
            st b2 in field b1
         holds b2 has_a_normal_form_wrt b1;

:: REWRITE1:attrnot 3 => REWRITE1:attr 3
definition
  let a1 be Relation-like set;
  attr a1 is strongly-normalizing means
    for b1 being ManySortedSet of NAT holds
       ex b2 being Element of NAT st
          not [b1 . b2,b1 . (b2 + 1)] in a1;
end;

:: REWRITE1:dfs 15
definiens
  let a1 be Relation-like set;
To prove
     a1 is strongly-normalizing
it is sufficient to prove
  thus for b1 being ManySortedSet of NAT holds
       ex b2 being Element of NAT st
          not [b1 . b2,b1 . (b2 + 1)] in a1;

:: REWRITE1:def 15
theorem
for b1 being Relation-like set holds
      b1 is strongly-normalizing
   iff
      for b2 being ManySortedSet of NAT holds
         ex b3 being Element of NAT st
            not [b2 . b3,b2 . (b3 + 1)] in b1;

:: REWRITE1:attrnot 4 => REWRITE1:attr 1
definition
  let a1 be Relation-like set;
  attr a1 is co-well_founded means
    for b1 being set
          st b1 c= field a1 & b1 <> {}
       holds ex b2 being set st
          b2 in b1 &
           (for b3 being set
                 st b3 in b1 & b2 <> b3
              holds not [b2,b3] in a1);
end;

:: REWRITE1:dfs 16
definiens
  let a1 be Relation-like set;
To prove
     a1 is co-well_founded
it is sufficient to prove
  thus for b1 being set
          st b1 c= field a1 & b1 <> {}
       holds ex b2 being set st
          b2 in b1 &
           (for b3 being set
                 st b3 in b1 & b2 <> b3
              holds not [b2,b3] in a1);

:: REWRITE1:def 16
theorem
for b1 being Relation-like set holds
      b1 is co-well_founded
   iff
      for b2 being set
            st b2 c= field b1 & b2 <> {}
         holds ex b3 being set st
            b3 in b2 &
             (for b4 being set
                   st b4 in b2 & b3 <> b4
                holds not [b3,b4] in b1);

:: REWRITE1:sch 2
scheme REWRITE1:sch 2
{F1 -> Relation-like set}:
for b1 being set
      st b1 in field F1()
   holds P1[b1]
provided
   F1() is co-well_founded
and
   for b1 being set
         st for b2 being set
                 st [b1,b2] in F1() & b1 <> b2
              holds P1[b2]
      holds P1[b1];


:: REWRITE1:condreg 2
registration
  cluster Relation-like strongly-normalizing -> irreflexive co-well_founded (set);
end;

:: REWRITE1:condreg 3
registration
  cluster Relation-like irreflexive co-well_founded -> strongly-normalizing (set);
end;

:: REWRITE1:condreg 4
registration
  cluster empty Relation-like -> weakly-normalizing strongly-normalizing (set);
end;

:: REWRITE1:exreg 1
registration
  cluster empty Relation-like set;
end;

:: REWRITE1:th 48
theorem
for b1 being Relation-like co-well_founded set
for b2 being Relation-like set
      st b2 c= b1
   holds b2 is co-well_founded;

:: REWRITE1:condreg 5
registration
  cluster Relation-like strongly-normalizing -> weakly-normalizing (set);
end;

:: REWRITE1:prednot 10 => REWRITE1:pred 10
definition
  let a1, a2 be Relation-like set;
  pred A1 commutes-weakly_with A2 means
    for b1, b2, b3 being set
          st [b1,b2] in a1 & [b1,b3] in a2
       holds ex b4 being set st
          a2 reduces b2,b4 & a1 reduces b3,b4;
  symmetry;
::  for a1, a2 being Relation-like set
::        st a1 commutes-weakly_with a2
::     holds a2 commutes-weakly_with a1;
end;

:: REWRITE1:dfs 17
definiens
  let a1, a2 be Relation-like set;
To prove
     a1 commutes-weakly_with a2
it is sufficient to prove
  thus for b1, b2, b3 being set
          st [b1,b2] in a1 & [b1,b3] in a2
       holds ex b4 being set st
          a2 reduces b2,b4 & a1 reduces b3,b4;

:: REWRITE1:def 17
theorem
for b1, b2 being Relation-like set holds
   b1 commutes-weakly_with b2
iff
   for b3, b4, b5 being set
         st [b3,b4] in b1 & [b3,b5] in b2
      holds ex b6 being set st
         b2 reduces b4,b6 & b1 reduces b5,b6;

:: REWRITE1:prednot 11 => REWRITE1:pred 11
definition
  let a1, a2 be Relation-like set;
  pred A1 commutes_with A2 means
    for b1, b2, b3 being set
          st a1 reduces b1,b2 & a2 reduces b1,b3
       holds ex b4 being set st
          a2 reduces b2,b4 & a1 reduces b3,b4;
  symmetry;
::  for a1, a2 being Relation-like set
::        st a1 commutes_with a2
::     holds a2 commutes_with a1;
end;

:: REWRITE1:dfs 18
definiens
  let a1, a2 be Relation-like set;
To prove
     a1 commutes_with a2
it is sufficient to prove
  thus for b1, b2, b3 being set
          st a1 reduces b1,b2 & a2 reduces b1,b3
       holds ex b4 being set st
          a2 reduces b2,b4 & a1 reduces b3,b4;

:: REWRITE1:def 18
theorem
for b1, b2 being Relation-like set holds
   b1 commutes_with b2
iff
   for b3, b4, b5 being set
         st b1 reduces b3,b4 & b2 reduces b3,b5
      holds ex b6 being set st
         b2 reduces b4,b6 & b1 reduces b5,b6;

:: REWRITE1:th 49
theorem
for b1, b2 being Relation-like set
      st b1 commutes_with b2
   holds b1 commutes-weakly_with b2;

:: REWRITE1:attrnot 5 => REWRITE1:attr 4
definition
  let a1 be Relation-like set;
  attr a1 is with_UN_property means
    for b1, b2 being set
          st b1 is_a_normal_form_wrt a1 & b2 is_a_normal_form_wrt a1 & b1,b2 are_convertible_wrt a1
       holds b1 = b2;
end;

:: REWRITE1:dfs 19
definiens
  let a1 be Relation-like set;
To prove
     a1 is with_UN_property
it is sufficient to prove
  thus for b1, b2 being set
          st b1 is_a_normal_form_wrt a1 & b2 is_a_normal_form_wrt a1 & b1,b2 are_convertible_wrt a1
       holds b1 = b2;

:: REWRITE1:def 19
theorem
for b1 being Relation-like set holds
      b1 is with_UN_property
   iff
      for b2, b3 being set
            st b2 is_a_normal_form_wrt b1 & b3 is_a_normal_form_wrt b1 & b2,b3 are_convertible_wrt b1
         holds b2 = b3;

:: REWRITE1:attrnot 6 => REWRITE1:attr 5
definition
  let a1 be Relation-like set;
  attr a1 is with_NF_property means
    for b1, b2 being set
          st b1 is_a_normal_form_wrt a1 & b1,b2 are_convertible_wrt a1
       holds a1 reduces b2,b1;
end;

:: REWRITE1:dfs 20
definiens
  let a1 be Relation-like set;
To prove
     a1 is with_NF_property
it is sufficient to prove
  thus for b1, b2 being set
          st b1 is_a_normal_form_wrt a1 & b1,b2 are_convertible_wrt a1
       holds a1 reduces b2,b1;

:: REWRITE1:def 20
theorem
for b1 being Relation-like set holds
      b1 is with_NF_property
   iff
      for b2, b3 being set
            st b2 is_a_normal_form_wrt b1 & b2,b3 are_convertible_wrt b1
         holds b1 reduces b3,b2;

:: REWRITE1:attrnot 7 => REWRITE1:attr 6
definition
  let a1 be Relation-like set;
  attr a1 is subcommutative means
    for b1, b2, b3 being set
          st [b1,b2] in a1 & [b1,b3] in a1
       holds b2,b3 are_convergent<=1_wrt a1;
end;

:: REWRITE1:dfs 21
definiens
  let a1 be Relation-like set;
To prove
     a1 is subcommutative
it is sufficient to prove
  thus for b1, b2, b3 being set
          st [b1,b2] in a1 & [b1,b3] in a1
       holds b2,b3 are_convergent<=1_wrt a1;

:: REWRITE1:def 21
theorem
for b1 being Relation-like set holds
      b1 is subcommutative
   iff
      for b2, b3, b4 being set
            st [b2,b3] in b1 & [b2,b4] in b1
         holds b3,b4 are_convergent<=1_wrt b1;

:: REWRITE1:attrnot 8 => REWRITE1:attr 7
definition
  let a1 be Relation-like set;
  attr a1 is confluent means
    for b1, b2 being set
          st b1,b2 are_divergent_wrt a1
       holds b1,b2 are_convergent_wrt a1;
end;

:: REWRITE1:dfs 22
definiens
  let a1 be Relation-like set;
To prove
     a1 is confluent
it is sufficient to prove
  thus for b1, b2 being set
          st b1,b2 are_divergent_wrt a1
       holds b1,b2 are_convergent_wrt a1;

:: REWRITE1:def 22
theorem
for b1 being Relation-like set holds
      b1 is confluent
   iff
      for b2, b3 being set
            st b2,b3 are_divergent_wrt b1
         holds b2,b3 are_convergent_wrt b1;

:: REWRITE1:attrnot 9 => REWRITE1:attr 8
definition
  let a1 be Relation-like set;
  attr a1 is with_Church-Rosser_property means
    for b1, b2 being set
          st b1,b2 are_convertible_wrt a1
       holds b1,b2 are_convergent_wrt a1;
end;

:: REWRITE1:dfs 23
definiens
  let a1 be Relation-like set;
To prove
     a1 is with_Church-Rosser_property
it is sufficient to prove
  thus for b1, b2 being set
          st b1,b2 are_convertible_wrt a1
       holds b1,b2 are_convergent_wrt a1;

:: REWRITE1:def 23
theorem
for b1 being Relation-like set holds
      b1 is with_Church-Rosser_property
   iff
      for b2, b3 being set
            st b2,b3 are_convertible_wrt b1
         holds b2,b3 are_convergent_wrt b1;

:: REWRITE1:attrnot 10 => REWRITE1:attr 9
definition
  let a1 be Relation-like set;
  attr a1 is locally-confluent means
    for b1, b2, b3 being set
          st [b1,b2] in a1 & [b1,b3] in a1
       holds b2,b3 are_convergent_wrt a1;
end;

:: REWRITE1:dfs 24
definiens
  let a1 be Relation-like set;
To prove
     a1 is locally-confluent
it is sufficient to prove
  thus for b1, b2, b3 being set
          st [b1,b2] in a1 & [b1,b3] in a1
       holds b2,b3 are_convergent_wrt a1;

:: REWRITE1:def 24
theorem
for b1 being Relation-like set holds
      b1 is locally-confluent
   iff
      for b2, b3, b4 being set
            st [b2,b3] in b1 & [b2,b4] in b1
         holds b3,b4 are_convergent_wrt b1;

:: REWRITE1:prednot 12 => REWRITE1:attr 6
notation
  let a1 be Relation-like set;
  synonym a1 has_diamond_property for subcommutative;
end;

:: REWRITE1:prednot 13 => REWRITE1:attr 8
notation
  let a1 be Relation-like set;
  synonym a1 has_Church-Rosser_property for with_Church-Rosser_property;
end;

:: REWRITE1:prednot 14 => REWRITE1:attr 9
notation
  let a1 be Relation-like set;
  synonym a1 has_weak-Church-Rosser_property for locally-confluent;
end;

:: REWRITE1:th 50
theorem
for b1 being Relation-like set
   st b1 is subcommutative
for b2, b3, b4 being set
      st b1 reduces b2,b3 & [b2,b4] in b1
   holds b3,b4 are_convergent_wrt b1;

:: REWRITE1:th 51
theorem
for b1 being Relation-like set holds
      b1 is confluent
   iff
      b1 commutes_with b1;

:: REWRITE1:th 52
theorem
for b1 being Relation-like set holds
      b1 is confluent
   iff
      for b2, b3, b4 being set
            st b1 reduces b2,b3 & [b2,b4] in b1
         holds b3,b4 are_convergent_wrt b1;

:: REWRITE1:th 53
theorem
for b1 being Relation-like set holds
      b1 is locally-confluent
   iff
      b1 commutes-weakly_with b1;

:: REWRITE1:condreg 6
registration
  cluster Relation-like with_Church-Rosser_property -> confluent (set);
end;

:: REWRITE1:condreg 7
registration
  cluster Relation-like confluent -> with_Church-Rosser_property locally-confluent (set);
end;

:: REWRITE1:condreg 8
registration
  cluster Relation-like subcommutative -> confluent (set);
end;

:: REWRITE1:condreg 9
registration
  cluster Relation-like with_Church-Rosser_property -> with_NF_property (set);
end;

:: REWRITE1:condreg 10
registration
  cluster Relation-like with_NF_property -> with_UN_property (set);
end;

:: REWRITE1:condreg 11
registration
  cluster Relation-like weakly-normalizing with_UN_property -> with_Church-Rosser_property (set);
end;

:: REWRITE1:condreg 12
registration
  cluster empty Relation-like -> subcommutative (set);
end;

:: REWRITE1:exreg 2
registration
  cluster empty Relation-like set;
end;

:: REWRITE1:th 54
theorem
for b1 being Relation-like with_UN_property set
for b2, b3, b4 being set
      st b3 is_a_normal_form_of b2,b1 & b4 is_a_normal_form_of b2,b1
   holds b3 = b4;

:: REWRITE1:th 55
theorem
for b1 being Relation-like weakly-normalizing with_UN_property set
for b2 being set holds
   nf(b2,b1) is_a_normal_form_of b2,b1;

:: REWRITE1:th 56
theorem
for b1 being Relation-like weakly-normalizing with_UN_property set
for b2, b3 being set
      st b2,b3 are_convertible_wrt b1
   holds nf(b2,b1) = nf(b3,b1);

:: REWRITE1:condreg 13
registration
  cluster Relation-like strongly-normalizing locally-confluent -> confluent (set);
end;

:: REWRITE1:attrnot 11 => REWRITE1:attr 10
definition
  let a1 be Relation-like set;
  attr a1 is complete means
    a1 is confluent & a1 is strongly-normalizing;
end;

:: REWRITE1:dfs 25
definiens
  let a1 be Relation-like set;
To prove
     a1 is complete
it is sufficient to prove
  thus a1 is confluent & a1 is strongly-normalizing;

:: REWRITE1:def 25
theorem
for b1 being Relation-like set holds
      b1 is complete
   iff
      b1 is confluent & b1 is strongly-normalizing;

:: REWRITE1:condreg 14
registration
  cluster Relation-like complete -> strongly-normalizing confluent (set);
end;

:: REWRITE1:condreg 15
registration
  cluster Relation-like strongly-normalizing confluent -> complete (set);
end;

:: REWRITE1:exreg 3
registration
  cluster empty Relation-like set;
end;

:: REWRITE1:exreg 4
registration
  cluster non empty Relation-like complete set;
end;

:: REWRITE1:th 57
theorem
for b1, b2 being Relation-like with_Church-Rosser_property set
      st b1 commutes_with b2
   holds b1 \/ b2 is with_Church-Rosser_property;

:: REWRITE1:th 58
theorem
for b1 being Relation-like set holds
      b1 is confluent
   iff
      b1 [*] is locally-confluent;

:: REWRITE1:th 59
theorem
for b1 being Relation-like set holds
      b1 is confluent
   iff
      b1 [*] is subcommutative;

:: REWRITE1:prednot 15 => REWRITE1:pred 12
definition
  let a1, a2 be Relation-like set;
  pred A1,A2 are_equivalent means
    for b1, b2 being set holds
       b1,b2 are_convertible_wrt a1
    iff
       b1,b2 are_convertible_wrt a2;
  symmetry;
::  for a1, a2 being Relation-like set
::        st a1,a2 are_equivalent
::     holds a2,a1 are_equivalent;
end;

:: REWRITE1:dfs 26
definiens
  let a1, a2 be Relation-like set;
To prove
     a1,a2 are_equivalent
it is sufficient to prove
  thus for b1, b2 being set holds
       b1,b2 are_convertible_wrt a1
    iff
       b1,b2 are_convertible_wrt a2;

:: REWRITE1:def 26
theorem
for b1, b2 being Relation-like set holds
   b1,b2 are_equivalent
iff
   for b3, b4 being set holds
      b3,b4 are_convertible_wrt b1
   iff
      b3,b4 are_convertible_wrt b2;

:: REWRITE1:prednot 16 => REWRITE1:pred 13
definition
  let a1 be Relation-like set;
  let a2, a3 be set;
  pred A2,A3 are_critical_wrt A1 means
    a2,a3 are_divergent<=1_wrt a1 & not a2,a3 are_convergent_wrt a1;
end;

:: REWRITE1:dfs 27
definiens
  let a1 be Relation-like set;
  let a2, a3 be set;
To prove
     a2,a3 are_critical_wrt a1
it is sufficient to prove
  thus a2,a3 are_divergent<=1_wrt a1 & not a2,a3 are_convergent_wrt a1;

:: REWRITE1:def 27
theorem
for b1 being Relation-like set
for b2, b3 being set holds
   b2,b3 are_critical_wrt b1
iff
   b2,b3 are_divergent<=1_wrt b1 & not b2,b3 are_convergent_wrt b1;

:: REWRITE1:th 60
theorem
for b1 being Relation-like set
for b2, b3 being set
      st b2,b3 are_critical_wrt b1
   holds b2,b3 are_convertible_wrt b1;

:: REWRITE1:th 61
theorem
for b1 being Relation-like set
      st for b2, b3 being set holds
        not b2,b3 are_critical_wrt b1
   holds b1 is locally-confluent;

:: REWRITE1:th 62
theorem
for b1, b2 being Relation-like set
      st for b3, b4 being set
              st [b3,b4] in b2
           holds b3,b4 are_critical_wrt b1
   holds b1,b1 \/ b2 are_equivalent;

:: REWRITE1:th 63
theorem
for b1 being Relation-like set holds
   ex b2 being Relation-like complete set st
      field b2 c= field b1 &
       (for b3, b4 being set holds
          b3,b4 are_convertible_wrt b1
       iff
          b3,b4 are_convergent_wrt b2);

:: REWRITE1:modenot 2 => REWRITE1:mode 2
definition
  let a1 be Relation-like set;
  mode Completion of A1 -> Relation-like complete set means
    for b1, b2 being set holds
       b1,b2 are_convertible_wrt a1
    iff
       b1,b2 are_convergent_wrt it;
end;

:: REWRITE1:dfs 28
definiens
  let a1 be Relation-like set;
  let a2 be Relation-like complete set;
To prove
     a2 is Completion of a1
it is sufficient to prove
  thus for b1, b2 being set holds
       b1,b2 are_convertible_wrt a1
    iff
       b1,b2 are_convergent_wrt a2;

:: REWRITE1:def 28
theorem
for b1 being Relation-like set
for b2 being Relation-like complete set holds
      b2 is Completion of b1
   iff
      for b3, b4 being set holds
         b3,b4 are_convertible_wrt b1
      iff
         b3,b4 are_convergent_wrt b2;

:: REWRITE1:th 64
theorem
for b1 being Relation-like set
for b2 being Completion of b1 holds
   b1,b2 are_equivalent;

:: REWRITE1:th 65
theorem
for b1 being Relation-like set
for b2 being Relation-like complete set
      st b1,b2 are_equivalent
   holds b2 is Completion of b1;

:: REWRITE1:th 66
theorem
for b1 being Relation-like set
for b2 being Completion of b1
for b3, b4 being set holds
   b3,b4 are_convertible_wrt b1
iff
   nf(b3,b2) = nf(b4,b2);