Article TREES_4, MML version 4.99.1005

:: TREES_4:modenot 1
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  mode Node of a1 is Element of proj1 a1;
end;

:: TREES_4:prednot 1 => HIDDEN:pred 1
definition
  let a1, a2 be set;
  pred A1 = A2 means
    proj1 a1 = proj1 a2 &
     (for b1 being Element of proj1 a1 holds
        a1 . b1 = a2 . b1);
  symmetry;
::  for a1, a2 being set
::        st a1 = a2
::     holds a2 = a1;
  reflexivity;
::  for a1 being set holds
::     a1 = a1;
end;

:: TREES_4:dfs 1
definiens
  let a1, a2 be Relation-like Function-like DecoratedTree-like set;
To prove
     a1 = a2
it is sufficient to prove
  thus proj1 a1 = proj1 a2 &
     (for b1 being Element of proj1 a1 holds
        a1 . b1 = a2 . b1);

:: TREES_4:def 1
theorem
for b1, b2 being Relation-like Function-like DecoratedTree-like set holds
   b1 = b2
iff
   proj1 b1 = proj1 b2 &
    (for b3 being Element of proj1 b1 holds
       b1 . b3 = b2 . b3);

:: TREES_4:th 1
theorem
for b1, b2 being Element of NAT
      st elementary_tree b1 c= elementary_tree b2
   holds b1 <= b2;

:: TREES_4:th 2
theorem
for b1, b2 being Element of NAT
      st elementary_tree b1 = elementary_tree b2
   holds b1 = b2;

:: TREES_4:funcnot 1 => TREES_4:func 1
definition
  let a1 be set;
  func root-tree A1 -> Relation-like Function-like DecoratedTree-like set equals
    (elementary_tree 0) --> a1;
end;

:: TREES_4:def 2
theorem
for b1 being set holds
   root-tree b1 = (elementary_tree 0) --> b1;

:: TREES_4:funcnot 2 => TREES_4:func 2
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  redefine func root-tree a2 -> Element of FinTrees a1;
end;

:: TREES_4:th 3
theorem
for b1 being set holds
   proj1 root-tree b1 = elementary_tree 0 & (root-tree b1) . {} = b1;

:: TREES_4:th 4
theorem
for b1, b2 being set
      st root-tree b1 = root-tree b2
   holds b1 = b2;

:: TREES_4:th 5
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
      st proj1 b1 = elementary_tree 0
   holds b1 = root-tree (b1 . {});

:: TREES_4:th 6
theorem
for b1 being set holds
   root-tree b1 = {[{},b1]};

:: TREES_4:funcnot 3 => TREES_4:func 3
definition
  let a1 be set;
  let a2 be Relation-like Function-like FinSequence-like set;
  func A1 -flat_tree A2 -> Relation-like Function-like DecoratedTree-like set means
    proj1 it = elementary_tree len a2 &
     it . {} = a1 &
     (for b1 being Element of NAT
           st b1 < len a2
        holds it . <*b1*> = a2 . (b1 + 1));
end;

:: TREES_4:def 3
theorem
for b1 being set
for b2 being Relation-like Function-like FinSequence-like set
for b3 being Relation-like Function-like DecoratedTree-like set holds
      b3 = b1 -flat_tree b2
   iff
      proj1 b3 = elementary_tree len b2 &
       b3 . {} = b1 &
       (for b4 being Element of NAT
             st b4 < len b2
          holds b3 . <*b4*> = b2 . (b4 + 1));

:: TREES_4:th 7
theorem
for b1, b2 being set
for b3, b4 being Relation-like Function-like FinSequence-like set
      st b1 -flat_tree b3 = b2 -flat_tree b4
   holds b1 = b2 & b3 = b4;

:: TREES_4:th 8
theorem
for b1, b2 being Element of NAT
      st b1 < b2
   holds (elementary_tree b2) | <*b1*> = elementary_tree 0;

:: TREES_4:th 9
theorem
for b1 being set
for b2 being Element of NAT
for b3 being Relation-like Function-like FinSequence-like set
      st b2 < len b3
   holds (b1 -flat_tree b3) | <*b2*> = root-tree (b3 . (b2 + 1));

:: TREES_4:funcnot 4 => TREES_4:func 4
definition
  let a1 be set;
  let a2 be Relation-like Function-like FinSequence-like set;
  assume a2 is DTree-yielding;
  func A1 -tree A2 -> Relation-like Function-like DecoratedTree-like set means
    (ex b1 being Relation-like Function-like FinSequence-like DTree-yielding set st
        a2 = b1 & proj1 it = tree doms b1) &
     it . {} = a1 &
     (for b1 being Element of NAT
           st b1 < len a2
        holds it | <*b1*> = a2 . (b1 + 1));
end;

:: TREES_4:def 4
theorem
for b1 being set
for b2 being Relation-like Function-like FinSequence-like set
   st b2 is DTree-yielding
for b3 being Relation-like Function-like DecoratedTree-like set holds
      b3 = b1 -tree b2
   iff
      (ex b4 being Relation-like Function-like FinSequence-like DTree-yielding set st
          b2 = b4 & proj1 b3 = tree doms b4) &
       b3 . {} = b1 &
       (for b4 being Element of NAT
             st b4 < len b2
          holds b3 | <*b4*> = b2 . (b4 + 1));

:: TREES_4:funcnot 5 => TREES_4:func 5
definition
  let a1 be set;
  let a2 be Relation-like Function-like DecoratedTree-like set;
  func A1 -tree A2 -> Relation-like Function-like DecoratedTree-like set equals
    a1 -tree <*a2*>;
end;

:: TREES_4:def 5
theorem
for b1 being set
for b2 being Relation-like Function-like DecoratedTree-like set holds
   b1 -tree b2 = b1 -tree <*b2*>;

:: TREES_4:funcnot 6 => TREES_4:func 6
definition
  let a1 be set;
  let a2, a3 be Relation-like Function-like DecoratedTree-like set;
  func A1 -tree(A2,A3) -> Relation-like Function-like DecoratedTree-like set equals
    a1 -tree <*a2,a3*>;
end;

:: TREES_4:def 6
theorem
for b1 being set
for b2, b3 being Relation-like Function-like DecoratedTree-like set holds
b1 -tree(b2,b3) = b1 -tree <*b2,b3*>;

:: TREES_4:th 10
theorem
for b1 being set
for b2 being Relation-like Function-like FinSequence-like DTree-yielding set holds
   proj1 (b1 -tree b2) = tree doms b2;

:: TREES_4:th 11
theorem
for b1, b2 being set
for b3 being Relation-like Function-like FinSequence-like DTree-yielding set holds
      b1 in proj1 (b2 -tree b3)
   iff
      (b1 <> {} implies ex b4 being Element of NAT st
         ex b5 being Relation-like Function-like DecoratedTree-like set st
            ex b6 being Element of proj1 b5 st
               b4 < len b3 & b5 = b3 . (b4 + 1) & b1 = <*b4*> ^ b6);

:: TREES_4:th 12
theorem
for b1 being set
for b2 being Relation-like Function-like FinSequence-like DTree-yielding set
for b3 being Element of NAT
for b4 being Relation-like Function-like DecoratedTree-like set
for b5 being Element of proj1 b4
      st b3 < len b2 & b4 = b2 . (b3 + 1)
   holds (b1 -tree b2) . (<*b3*> ^ b5) = b4 . b5;

:: TREES_4:th 13
theorem
for b1 being set
for b2 being Relation-like Function-like DecoratedTree-like set holds
   proj1 (b1 -tree b2) = ^ proj1 b2;

:: TREES_4:th 14
theorem
for b1 being set
for b2, b3 being Relation-like Function-like DecoratedTree-like set holds
proj1 (b1 -tree(b2,b3)) = tree(proj1 b2,proj1 b3);

:: TREES_4:th 15
theorem
for b1, b2 being set
for b3, b4 being Relation-like Function-like FinSequence-like DTree-yielding set
      st b1 -tree b3 = b2 -tree b4
   holds b1 = b2 & b3 = b4;

:: TREES_4:th 16
theorem
for b1, b2 being set
for b3 being Relation-like Function-like FinSequence-like set
      st root-tree b1 = b2 -flat_tree b3
   holds b1 = b2 & b3 = {};

:: TREES_4:th 17
theorem
for b1, b2 being set
for b3 being Relation-like Function-like FinSequence-like set
      st root-tree b1 = b2 -tree b3 & b3 is DTree-yielding
   holds b1 = b2 & b3 = {};

:: TREES_4:th 18
theorem
for b1, b2 being set
for b3, b4 being Relation-like Function-like FinSequence-like set
      st b1 -flat_tree b3 = b2 -tree b4 & b4 is DTree-yielding
   holds b1 = b2 &
    len b3 = len b4 &
    (for b5 being Element of NAT
          st b5 in dom b3
       holds b4 . b5 = root-tree (b3 . b5));

:: TREES_4:th 19
theorem
for b1 being set
for b2 being Relation-like Function-like FinSequence-like DTree-yielding set
for b3 being Element of NAT
for b4 being Relation-like Function-like FinSequence-like set
      st <*b3*> ^ b4 in proj1 (b1 -tree b2)
   holds (b1 -tree b2) . (<*b3*> ^ b4) = b2 ..(b3 + 1,b4);

:: TREES_4:th 20
theorem
for b1 being set holds
   b1 -flat_tree {} = root-tree b1 & b1 -tree {} = root-tree b1;

:: TREES_4:th 21
theorem
for b1, b2 being set holds
b1 -flat_tree <*b2*> = ((elementary_tree 1) --> b1) with-replacement(<*0*>,root-tree b2);

:: TREES_4:th 22
theorem
for b1 being set
for b2 being Relation-like Function-like DecoratedTree-like set holds
   b1 -tree <*b2*> = ((elementary_tree 1) --> b1) with-replacement(<*0*>,b2);

:: TREES_4:funcnot 7 => TREES_4:func 7
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  let a3 be FinSequence of a1;
  redefine func a2 -flat_tree a3 -> Function-like DecoratedTree-like ParametrizedSubset of a1;
end;

:: TREES_4:funcnot 8 => TREES_4:func 8
definition
  let a1 be non empty set;
  let a2 be non empty DTree-set of a1;
  let a3 be Element of a1;
  let a4 be FinSequence of a2;
  redefine func a3 -tree a4 -> Function-like DecoratedTree-like ParametrizedSubset of a1;
end;

:: TREES_4:funcnot 9 => TREES_4:func 9
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  let a3 be Function-like DecoratedTree-like ParametrizedSubset of a1;
  redefine func a2 -tree a3 -> Function-like DecoratedTree-like ParametrizedSubset of a1;
end;

:: TREES_4:funcnot 10 => TREES_4:func 10
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  let a3, a4 be Function-like DecoratedTree-like ParametrizedSubset of a1;
  redefine func a2 -tree(a3,a4) -> Function-like DecoratedTree-like ParametrizedSubset of a1;
end;

:: TREES_4:funcnot 11 => TREES_4:func 11
definition
  let a1 be non empty set;
  let a2 be FinSequence of FinTrees a1;
  redefine func doms a2 -> FinSequence of FinTrees;
end;

:: TREES_4:funcnot 12 => TREES_4:func 12
definition
  let a1 be non empty set;
  let a2 be Element of a1;
  let a3 be FinSequence of FinTrees a1;
  redefine func a2 -tree a3 -> Element of FinTrees a1;
end;

:: TREES_4:modenot 2 => TREES_4:mode 1
definition
  let a1 be non empty set;
  let a2 be Element of bool a1;
  redefine mode FinSequence of a2 -> FinSequence of a1;
end;

:: TREES_4:condreg 1
registration
  let a1 be non empty constituted-DTrees set;
  let a2 be Element of bool a1;
  cluster -> DTree-yielding (FinSequence of a2);
end;

:: TREES_4:sch 1
scheme TREES_4:sch 1
{F1 -> non empty Tree-like set,
  F2 -> non empty Tree-like set}:
ex b1 being non empty Tree-like set st
   for b2 being Relation-like Function-like FinSequence-like set holds
         b2 in b1
      iff
         (not b2 in F1() implies ex b3 being Element of F1() st
            ex b4 being Element of F2() st
               P1[b3] & b2 = b3 ^ b4)


:: TREES_4:funcnot 13 => TREES_4:func 13
definition
  let a1, a2 be Relation-like Function-like DecoratedTree-like set;
  let a3 be set;
  func (A1,A3)<- A2 -> Relation-like Function-like DecoratedTree-like set means
    (for b1 being Relation-like Function-like FinSequence-like set holds
           b1 in proj1 it
        iff
           (not b1 in proj1 a1 implies ex b2 being Element of proj1 a1 st
              ex b3 being Element of proj1 a2 st
                 b2 in Leaves proj1 a1 & a1 . b2 = a3 & b1 = b2 ^ b3)) &
     (for b1 being Element of proj1 a1
           st (b1 in Leaves proj1 a1 implies a1 . b1 <> a3)
        holds it . b1 = a1 . b1) &
     (for b1 being Element of proj1 a1
     for b2 being Element of proj1 a2
           st b1 in Leaves proj1 a1 & a1 . b1 = a3
        holds it . (b1 ^ b2) = a2 . b2);
end;

:: TREES_4:def 7
theorem
for b1, b2 being Relation-like Function-like DecoratedTree-like set
for b3 being set
for b4 being Relation-like Function-like DecoratedTree-like set holds
      b4 = (b1,b3)<- b2
   iff
      (for b5 being Relation-like Function-like FinSequence-like set holds
             b5 in proj1 b4
          iff
             (not b5 in proj1 b1 implies ex b6 being Element of proj1 b1 st
                ex b7 being Element of proj1 b2 st
                   b6 in Leaves proj1 b1 & b1 . b6 = b3 & b5 = b6 ^ b7)) &
       (for b5 being Element of proj1 b1
             st (b5 in Leaves proj1 b1 implies b1 . b5 <> b3)
          holds b4 . b5 = b1 . b5) &
       (for b5 being Element of proj1 b1
       for b6 being Element of proj1 b2
             st b5 in Leaves proj1 b1 & b1 . b5 = b3
          holds b4 . (b5 ^ b6) = b2 . b6);

:: TREES_4:funcnot 14 => TREES_4:func 14
definition
  let a1 be non empty set;
  let a2, a3 be Function-like DecoratedTree-like ParametrizedSubset of a1;
  let a4 be set;
  redefine func (a2,a4)<- a3 -> Function-like DecoratedTree-like ParametrizedSubset of a1;
end;

:: TREES_4:th 23
theorem
for b1, b2 being Relation-like Function-like DecoratedTree-like set
for b3 being set
      st (b3 in proj2 b1 implies not b3 in Leaves b1)
   holds (b1,b3)<- b2 = b1;

:: TREES_4:th 24
theorem
for b1, b2 being non empty set
for b3 being Function-like DecoratedTree-like ParametrizedSubset of [:b1,b2:] holds
   proj1 (b3 `1) = proj1 b3 & proj1 (b3 `2) = proj1 b3;

:: TREES_4:th 25
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2 holds
   (root-tree [b3,b4]) `1 = root-tree b3 &
    (root-tree [b3,b4]) `2 = root-tree b4;

:: TREES_4:th 26
theorem
for b1, b2 being set holds
<:root-tree b1,root-tree b2:> = root-tree [b1,b2];

:: TREES_4:th 27
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2
for b5 being non empty DTree-set of [:b1,b2:]
for b6 being non empty DTree-set of b1
for b7 being FinSequence of b5
for b8 being FinSequence of b6
      st dom b8 = dom b7 &
         (for b9 being Element of NAT
            st b9 in dom b7
         for b10 being Function-like DecoratedTree-like ParametrizedSubset of [:b1,b2:]
               st b10 = b7 . b9
            holds b8 . b9 = b10 `1)
   holds ([b3,b4] -tree b7) `1 = b3 -tree b8;

:: TREES_4:th 28
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2
for b5 being non empty DTree-set of [:b1,b2:]
for b6 being non empty DTree-set of b2
for b7 being FinSequence of b5
for b8 being FinSequence of b6
      st dom b8 = dom b7 &
         (for b9 being Element of NAT
            st b9 in dom b7
         for b10 being Function-like DecoratedTree-like ParametrizedSubset of [:b1,b2:]
               st b10 = b7 . b9
            holds b8 . b9 = b10 `2)
   holds ([b3,b4] -tree b7) `2 = b4 -tree b8;

:: TREES_4:th 29
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2
for b5 being non empty DTree-set of [:b1,b2:]
for b6 being FinSequence of b5 holds
   ex b7 being FinSequence of Trees b1 st
      dom b7 = dom b6 &
       (for b8 being Element of NAT
             st b8 in dom b6
          holds ex b9 being Element of b5 st
             b9 = b6 . b8 & b7 . b8 = b9 `1) &
       ([b3,b4] -tree b6) `1 = b3 -tree b7;

:: TREES_4:th 30
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2
for b5 being non empty DTree-set of [:b1,b2:]
for b6 being FinSequence of b5 holds
   ex b7 being FinSequence of Trees b2 st
      dom b7 = dom b6 &
       (for b8 being Element of NAT
             st b8 in dom b6
          holds ex b9 being Element of b5 st
             b9 = b6 . b8 & b7 . b8 = b9 `2) &
       ([b3,b4] -tree b6) `2 = b4 -tree b7;

:: TREES_4:th 31
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2
for b5 being FinSequence of FinTrees [:b1,b2:] holds
   ex b6 being FinSequence of FinTrees b1 st
      dom b6 = dom b5 &
       (for b7 being Element of NAT
             st b7 in dom b5
          holds ex b8 being Element of FinTrees [:b1,b2:] st
             b8 = b5 . b7 & b6 . b7 = b8 `1) &
       ([b3,b4] -tree b5) `1 = b3 -tree b6;

:: TREES_4:th 32
theorem
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being Element of b2
for b5 being FinSequence of FinTrees [:b1,b2:] holds
   ex b6 being FinSequence of FinTrees b2 st
      dom b6 = dom b5 &
       (for b7 being Element of NAT
             st b7 in dom b5
          holds ex b8 being Element of FinTrees [:b1,b2:] st
             b8 = b5 . b7 & b6 . b7 = b8 `2) &
       ([b3,b4] -tree b5) `2 = b4 -tree b6;