Article TREES_9, MML version 4.99.1005

:: TREES_9:modenot 1 => TREES_9:mode 1
definition
  let a1 be non empty set;
  let a2 be non empty DTree-set of a1;
  let a3 be non empty Element of bool a2;
  redefine mode Element of a3 -> Element of a2;
end;

:: TREES_9:condreg 1
registration
  cluster non empty finite Tree-like -> finite-order (set);
end;

:: TREES_9:th 1
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
   b1 | <*> NAT = b1;

:: TREES_9:th 2
theorem
for b1 being non empty Tree-like set
for b2, b3 being FinSequence of NAT
      st b2 ^ b3 in b1
   holds b1 | (b2 ^ b3) = (b1 | b2) | b3;

:: TREES_9:th 3
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2, b3 being FinSequence of NAT
      st b2 ^ b3 in proj1 b1
   holds b1 | (b2 ^ b3) = (b1 | b2) | b3;

:: TREES_9:attrnot 1 => TREES_9:attr 1
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  attr a1 is root means
    proj1 a1 = elementary_tree 0;
end;

:: TREES_9:dfs 1
definiens
  let a1 be Relation-like Function-like DecoratedTree-like set;
To prove
     a1 is root
it is sufficient to prove
  thus proj1 a1 = elementary_tree 0;

:: TREES_9:def 1
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
      b1 is root
   iff
      proj1 b1 = elementary_tree 0;

:: TREES_9:condreg 2
registration
  cluster Relation-like Function-like DecoratedTree-like root -> finite (set);
end;

:: TREES_9:th 4
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
      b1 is root
   iff
      {} in Leaves proj1 b1;

:: TREES_9:th 5
theorem
for b1 being non empty Tree-like set
for b2 being Element of b1 holds
      b1 | b2 = elementary_tree 0
   iff
      b2 in Leaves b1;

:: TREES_9:th 6
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2 being Element of proj1 b1 holds
      b1 | b2 is root
   iff
      b2 in Leaves proj1 b1;

:: TREES_9:exreg 1
registration
  cluster Relation-like Function-like DecoratedTree-like root set;
end;

:: TREES_9:exreg 2
registration
  cluster Relation-like Function-like finite DecoratedTree-like non root set;
end;

:: TREES_9:funcreg 1
registration
  let a1 be set;
  cluster root-tree a1 -> Relation-like Function-like finite DecoratedTree-like root;
end;

:: TREES_9:attrnot 2 => TREES_9:attr 2
definition
  let a1 be non empty Tree-like set;
  attr a1 is finite-branching means
    for b1 being Element of a1 holds
       succ b1 is finite;
end;

:: TREES_9:dfs 2
definiens
  let a1 be non empty Tree-like set;
To prove
     a1 is finite-branching
it is sufficient to prove
  thus for b1 being Element of a1 holds
       succ b1 is finite;

:: TREES_9:def 2
theorem
for b1 being non empty Tree-like set holds
      b1 is finite-branching
   iff
      for b2 being Element of b1 holds
         succ b2 is finite;

:: TREES_9:condreg 3
registration
  cluster non empty Tree-like finite-order -> finite-branching (set);
end;

:: TREES_9:exreg 3
registration
  cluster non empty finite Tree-like set;
end;

:: TREES_9:attrnot 3 => TREES_9:attr 3
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  attr a1 is finite-order means
    proj1 a1 is finite-order;
end;

:: TREES_9:dfs 3
definiens
  let a1 be Relation-like Function-like DecoratedTree-like set;
To prove
     a1 is finite-order
it is sufficient to prove
  thus proj1 a1 is finite-order;

:: TREES_9:def 3
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
      b1 is finite-order
   iff
      proj1 b1 is finite-order;

:: TREES_9:attrnot 4 => TREES_9:attr 4
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  attr a1 is finite-branching means
    proj1 a1 is finite-branching;
end;

:: TREES_9:dfs 4
definiens
  let a1 be Relation-like Function-like DecoratedTree-like set;
To prove
     a1 is finite-branching
it is sufficient to prove
  thus proj1 a1 is finite-branching;

:: TREES_9:def 4
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
      b1 is finite-branching
   iff
      proj1 b1 is finite-branching;

:: TREES_9:condreg 4
registration
  cluster Relation-like Function-like finite DecoratedTree-like -> finite-order (set);
end;

:: TREES_9:condreg 5
registration
  cluster Relation-like Function-like DecoratedTree-like finite-order -> finite-branching (set);
end;

:: TREES_9:exreg 4
registration
  cluster Relation-like Function-like finite DecoratedTree-like set;
end;

:: TREES_9:funcreg 2
registration
  let a1 be Relation-like Function-like DecoratedTree-like finite-order set;
  cluster proj1 a1 -> finite-order;
end;

:: TREES_9:funcreg 3
registration
  let a1 be Relation-like Function-like DecoratedTree-like finite-branching set;
  cluster proj1 a1 -> finite-branching;
end;

:: TREES_9:funcreg 4
registration
  let a1 be non empty Tree-like finite-branching set;
  let a2 be Element of a1;
  cluster succ a2 -> finite;
end;

:: TREES_9:sch 1
scheme TREES_9:sch 1
{F1 -> set,
  F2 -> finite set}:
for b1 being Element of NAT holds
      F1(b1) in F2()
   iff
      b1 < card F2()
provided
   for b1 being set
         st b1 in F2()
      holds ex b2 being Element of NAT st
         b1 = F1(b2)
and
   for b1, b2 being Element of NAT
         st b1 < b2 & F1(b2) in F2()
      holds F1(b1) in F2()
and
   for b1, b2 being Element of NAT
         st F1(b1) = F1(b2)
      holds b1 = b2;


:: TREES_9:exreg 5
registration
  let a1 be set;
  cluster Relation-like Function-like one-to-one empty finite FinSequence-like FinSequence of a1;
end;

:: TREES_9:th 7
theorem
for b1 being non empty Tree-like finite-branching set
for b2 being Element of b1
for b3 being Element of NAT holds
      b2 ^ <*b3*> in succ b2
   iff
      b3 < card succ b2;

:: TREES_9:funcnot 1 => TREES_9:func 1
definition
  let a1 be non empty Tree-like finite-branching set;
  let a2 be Element of a1;
  func A2 succ -> one-to-one FinSequence of a1 means
    len it = card succ a2 &
     rng it = succ a2 &
     (for b1 being Element of NAT
           st b1 < len it
        holds it . (b1 + 1) = a2 ^ <*b1*>);
end;

:: TREES_9:def 5
theorem
for b1 being non empty Tree-like finite-branching set
for b2 being Element of b1
for b3 being one-to-one FinSequence of b1 holds
      b3 = b2 succ
   iff
      len b3 = card succ b2 &
       rng b3 = succ b2 &
       (for b4 being Element of NAT
             st b4 < len b3
          holds b3 . (b4 + 1) = b2 ^ <*b4*>);

:: TREES_9:funcnot 2 => TREES_9:func 2
definition
  let a1 be Relation-like Function-like DecoratedTree-like finite-branching set;
  let a2 be Relation-like Function-like FinSequence-like set;
  assume a2 in proj1 a1;
  func succ(A1,A2) -> Relation-like Function-like FinSequence-like set means
    ex b1 being Element of proj1 a1 st
       b1 = a2 & it = b1 succ * a1;
end;

:: TREES_9:def 6
theorem
for b1 being Relation-like Function-like DecoratedTree-like finite-branching set
for b2 being Relation-like Function-like FinSequence-like set
   st b2 in proj1 b1
for b3 being Relation-like Function-like FinSequence-like set holds
      b3 = succ(b1,b2)
   iff
      ex b4 being Element of proj1 b1 st
         b4 = b2 & b3 = b4 succ * b1;

:: TREES_9:th 8
theorem
for b1 being Relation-like Function-like DecoratedTree-like finite-branching set holds
   ex b2 being set st
      ex b3 being Relation-like Function-like FinSequence-like DTree-yielding set st
         b1 = b2 -tree b3;

:: TREES_9:funcreg 5
registration
  let a1 be Relation-like Function-like finite DecoratedTree-like set;
  let a2 be Element of proj1 a1;
  cluster a1 | a2 -> Relation-like Function-like finite DecoratedTree-like;
end;

:: TREES_9:th 10
theorem
for b1 being non empty finite Tree-like set
for b2 being Element of b1
      st b1 = b1 | b2
   holds b2 = {};

:: TREES_9:condreg 6
registration
  let a1 be non empty set;
  let a2 be non empty Element of bool FinTrees a1;
  cluster -> finite (Element of a2);
end;

:: TREES_9:funcnot 3 => TREES_9:func 3
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  func Subtrees A1 -> set equals
    {a1 | b1 where b1 is Element of proj1 a1: TRUE};
end;

:: TREES_9:def 7
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
   Subtrees b1 = {b1 | b2 where b2 is Element of proj1 b1: TRUE};

:: TREES_9:funcreg 6
registration
  let a1 be Relation-like Function-like DecoratedTree-like set;
  cluster Subtrees a1 -> non empty constituted-DTrees;
end;

:: TREES_9:funcnot 4 => TREES_9:func 4
definition
  let a1 be non empty set;
  let a2 be Function-like DecoratedTree-like ParametrizedSubset of a1;
  redefine func Subtrees a2 -> non empty Element of bool Trees a1;
end;

:: TREES_9:funcnot 5 => TREES_9:func 5
definition
  let a1 be non empty set;
  let a2 be Function-like finite DecoratedTree-like ParametrizedSubset of a1;
  redefine func Subtrees a2 -> non empty Element of bool FinTrees a1;
end;

:: TREES_9:condreg 7
registration
  let a1 be Relation-like Function-like finite DecoratedTree-like set;
  cluster -> finite (Element of Subtrees a1);
end;

:: TREES_9:th 11
theorem
for b1 being set
for b2 being Relation-like Function-like DecoratedTree-like set holds
      b1 in Subtrees b2
   iff
      ex b3 being Element of proj1 b2 st
         b1 = b2 | b3;

:: TREES_9:th 12
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
   b1 in Subtrees b1;

:: TREES_9:th 13
theorem
for b1, b2 being Relation-like Function-like DecoratedTree-like set
      st b1 is finite & Subtrees b1 = Subtrees b2
   holds b1 = b2;

:: TREES_9:th 14
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2 being Element of proj1 b1 holds
   Subtrees (b1 | b2) c= Subtrees b1;

:: TREES_9:funcnot 6 => TREES_9:func 6
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  func FixedSubtrees A1 -> Element of bool [:proj1 a1,Subtrees a1:] equals
    {[b1,a1 | b1] where b1 is Element of proj1 a1: TRUE};
end;

:: TREES_9:def 8
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
   FixedSubtrees b1 = {[b2,b1 | b2] where b2 is Element of proj1 b1: TRUE};

:: TREES_9:funcreg 7
registration
  let a1 be Relation-like Function-like DecoratedTree-like set;
  cluster FixedSubtrees a1 -> non empty;
end;

:: TREES_9:th 15
theorem
for b1 being set
for b2 being Relation-like Function-like DecoratedTree-like set holds
      b1 in FixedSubtrees b2
   iff
      ex b3 being Element of proj1 b2 st
         b1 = [b3,b2 | b3];

:: TREES_9:th 16
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
   [{},b1] in FixedSubtrees b1;

:: TREES_9:th 17
theorem
for b1, b2 being Relation-like Function-like DecoratedTree-like set
      st FixedSubtrees b1 = FixedSubtrees b2
   holds b1 = b2;

:: TREES_9:funcnot 7 => TREES_9:func 7
definition
  let a1 be Relation-like Function-like DecoratedTree-like set;
  let a2 be set;
  func A2 -Subtrees A1 -> Element of bool Subtrees a1 equals
    {a1 | b1 where b1 is Element of proj1 a1: (b1 in Leaves proj1 a1 implies a1 . b1 in a2)};
end;

:: TREES_9:def 9
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2 being set holds
   b2 -Subtrees b1 = {b1 | b3 where b3 is Element of proj1 b1: (b3 in Leaves proj1 b1 implies b1 . b3 in b2)};

:: TREES_9:th 18
theorem
for b1 being set
for b2 being Relation-like Function-like DecoratedTree-like set
for b3 being set holds
      b1 in b3 -Subtrees b2
   iff
      ex b4 being Element of proj1 b2 st
         b1 = b2 | b4 &
          (b4 in Leaves proj1 b2 implies b2 . b4 in b3);

:: TREES_9:th 19
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2 being set holds
      b2 -Subtrees b1 is empty
   iff
      b1 is root & not b1 . {} in b2;

:: TREES_9:funcnot 8 => TREES_9:func 8
definition
  let a1 be Relation-like Function-like finite DecoratedTree-like set;
  let a2 be set;
  func A2 -ImmediateSubtrees A1 -> Function-like quasi_total Relation of a2 -Subtrees a1,(Subtrees a1) * means
    for b1 being Relation-like Function-like DecoratedTree-like set
       st b1 in a2 -Subtrees a1
    for b2 being FinSequence of Subtrees a1
          st b2 = it . b1
       holds b1 = (b1 . {}) -tree b2;
end;

:: TREES_9:def 10
theorem
for b1 being Relation-like Function-like finite DecoratedTree-like set
for b2 being set
for b3 being Function-like quasi_total Relation of b2 -Subtrees b1,(Subtrees b1) * holds
      b3 = b2 -ImmediateSubtrees b1
   iff
      for b4 being Relation-like Function-like DecoratedTree-like set
         st b4 in b2 -Subtrees b1
      for b5 being FinSequence of Subtrees b1
            st b5 = b3 . b4
         holds b4 = (b4 . {}) -tree b5;

:: TREES_9:funcnot 9 => TREES_9:func 9
definition
  let a1 be non empty constituted-DTrees set;
  func Subtrees A1 -> set equals
    {b1 | b2 where b1 is Element of a1, b2 is Element of proj1 b1: TRUE};
end;

:: TREES_9:def 11
theorem
for b1 being non empty constituted-DTrees set holds
   Subtrees b1 = {b2 | b3 where b2 is Element of b1, b3 is Element of proj1 b2: TRUE};

:: TREES_9:funcreg 8
registration
  let a1 be non empty constituted-DTrees set;
  cluster Subtrees a1 -> non empty constituted-DTrees;
end;

:: TREES_9:funcnot 10 => TREES_9:func 10
definition
  let a1 be non empty set;
  let a2 be non empty Element of bool Trees a1;
  redefine func Subtrees a2 -> non empty Element of bool Trees a1;
end;

:: TREES_9:funcnot 11 => TREES_9:func 11
definition
  let a1 be non empty set;
  let a2 be non empty Element of bool FinTrees a1;
  redefine func Subtrees a2 -> non empty Element of bool FinTrees a1;
end;

:: TREES_9:th 20
theorem
for b1 being set
for b2 being non empty constituted-DTrees set holds
      b1 in Subtrees b2
   iff
      ex b3 being Element of b2 st
         ex b4 being Element of proj1 b3 st
            b1 = b3 | b4;

:: TREES_9:th 21
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2 being non empty constituted-DTrees set
      st b1 in b2
   holds b1 in Subtrees b2;

:: TREES_9:th 22
theorem
for b1, b2 being non empty constituted-DTrees set
      st b1 c= b2
   holds Subtrees b1 c= Subtrees b2;

:: TREES_9:funcreg 9
registration
  let a1 be Relation-like Function-like DecoratedTree-like set;
  cluster {a1} -> constituted-DTrees;
end;

:: TREES_9:th 23
theorem
for b1 being Relation-like Function-like DecoratedTree-like set holds
   Subtrees {b1} = Subtrees b1;

:: TREES_9:th 24
theorem
for b1 being non empty constituted-DTrees set holds
   Subtrees b1 = union {Subtrees b2 where b2 is Element of b1: TRUE};

:: TREES_9:funcnot 12 => TREES_9:func 12
definition
  let a1 be non empty constituted-DTrees set;
  let a2 be set;
  func A2 -Subtrees A1 -> Element of bool Subtrees a1 equals
    {b1 | b2 where b1 is Element of a1, b2 is Element of proj1 b1: (b2 in Leaves proj1 b1 implies b1 . b2 in a2)};
end;

:: TREES_9:def 12
theorem
for b1 being non empty constituted-DTrees set
for b2 being set holds
   b2 -Subtrees b1 = {b3 | b4 where b3 is Element of b1, b4 is Element of proj1 b3: (b4 in Leaves proj1 b3 implies b3 . b4 in b2)};

:: TREES_9:th 25
theorem
for b1, b2 being set
for b3 being non empty constituted-DTrees set holds
      b1 in b2 -Subtrees b3
   iff
      ex b4 being Element of b3 st
         ex b5 being Element of proj1 b4 st
            b1 = b4 | b5 &
             (b5 in Leaves proj1 b4 implies b4 . b5 in b2);

:: TREES_9:th 26
theorem
for b1 being set
for b2 being non empty constituted-DTrees set holds
      b1 -Subtrees b2 is empty
   iff
      for b3 being Element of b2 holds
         b3 is root & not b3 . {} in b1;

:: TREES_9:th 27
theorem
for b1 being Relation-like Function-like DecoratedTree-like set
for b2 being set holds
   b2 -Subtrees {b1} = b2 -Subtrees b1;

:: TREES_9:th 28
theorem
for b1 being set
for b2 being non empty constituted-DTrees set holds
   b1 -Subtrees b2 = union {b1 -Subtrees b3 where b3 is Element of b2: TRUE};

:: TREES_9:funcnot 13 => TREES_9:func 13
definition
  let a1 be non empty constituted-DTrees set;
  let a2 be set;
  assume for b1 being Element of a1 holds
       b1 is finite;
  func A2 -ImmediateSubtrees A1 -> Function-like quasi_total Relation of a2 -Subtrees a1,(Subtrees a1) * means
    for b1 being Relation-like Function-like DecoratedTree-like set
       st b1 in a2 -Subtrees a1
    for b2 being FinSequence of Subtrees a1
          st b2 = it . b1
       holds b1 = (b1 . {}) -tree b2;
end;

:: TREES_9:def 13
theorem
for b1 being non empty constituted-DTrees set
   st for b2 being Element of b1 holds
        b2 is finite
for b2 being set
for b3 being Function-like quasi_total Relation of b2 -Subtrees b1,(Subtrees b1) * holds
      b3 = b2 -ImmediateSubtrees b1
   iff
      for b4 being Relation-like Function-like DecoratedTree-like set
         st b4 in b2 -Subtrees b1
      for b5 being FinSequence of Subtrees b1
            st b5 = b3 . b4
         holds b4 = (b4 . {}) -tree b5;

:: TREES_9:exreg 6
registration
  let a1 be non empty Tree-like set;
  cluster Relation-like Function-like empty finite FinSequence-like Element of a1;
end;

:: TREES_9:th 29
theorem
for b1 being Relation-like Function-like finite DecoratedTree-like set
for b2 being Element of proj1 b1 holds
   len succ(b1,b2) = len (b2 succ) & dom succ(b1,b2) = dom (b2 succ);

:: TREES_9:th 30
theorem
for b1 being Relation-like Function-like FinSequence-like FinTree-yielding set
for b2 being empty Element of tree b1 holds
   card succ b2 = len b1;

:: TREES_9:th 31
theorem
for b1 being Relation-like Function-like finite DecoratedTree-like set
for b2 being set
for b3 being Relation-like Function-like FinSequence-like DTree-yielding set
   st b1 = b2 -tree b3
for b4 being empty Element of proj1 b1 holds
   succ(b1,b4) = roots b3;

:: TREES_9:th 32
theorem
for b1 being Relation-like Function-like finite DecoratedTree-like set
for b2 being Element of proj1 b1
for b3 being Element of proj1 (b1 | b2) holds
   succ(b1,b2 ^ b3) = succ(b1 | b2,b3);