reserve i,j for Nat;
reserve i,j for Nat,
  x for variable,
  l for quasi-loci;
reserve C for initialized ConstructorSignature,
  c for constructor OperSymbol of C;

theorem Th32:  :: to mozna uogolnic na X zamkniety na poddrzewa
               :: (troche dodatkowych pojec i twierdzen)
  for S being non empty non void ManySortedSign
  for Y being non empty-yielding ManySortedSet of the carrier of S
  for X,o being set, p being DTree-yielding FinSequence
  st ex C st X = Union the Sorts of Free(S, Y)
  holds o-tree p in X implies p is FinSequence of X
  proof
    let S be non empty non void ManySortedSign;
    let Y be non empty-yielding ManySortedSet of the carrier of S;
    let X,o be set;
    let p be DTree-yielding FinSequence;
    given C such that
A1: X = Union the Sorts of Free(S, Y);
    assume o-tree p in X; then
    reconsider e = o-tree p as Element of Free(S, Y) by A1;
    rng p c= X
    proof
      let z be object; assume z in rng p; then
      consider i being object such that
A2:   i in dom p & z = p.i by FUNCT_1:def 3;
      reconsider i as Nat by A2;
      reconsider ppi = p.i as DecoratedTree by A2,TREES_3:24;
A3:   1 <= i & i <= len p by A2,FINSEQ_3:25; then
A4:   (i-'1)+1 = i by XREAL_1:235;
then A5:   i-'1 < len p by A3,NAT_1:13;
A6:   len doms p = len p by TREES_3:38;
A7:   (doms p).i = dom ppi by A2,FUNCT_6:22;
A8:   dom e = tree doms p by TREES_4:10;
      <*i-'1*>^<*>NAT = <*i-'1*> & <*>NAT in dom ppi
      by FINSEQ_1:34,TREES_1:22; then
      reconsider q = <*i-'1*> as Element of dom e
      by A4,A5,A6,A7,A8,TREES_3:def 15;
      e|q = z by A2,A4,A5,TREES_4:def 4; then
      z is Element of Free(S, Y) by MSAFREE3:33;
      hence thesis by A1;
    end;
    hence p is FinSequence of X by FINSEQ_1:def 4;
  end;
