reserve A for QC-alphabet;
reserve n,k,m for Nat;
reserve F,G,G9,H,H9 for Element of QC-WFF(A);
reserve t, t9, t99 for Element of dom tree_of_subformulae(F);

theorem Th10:
  G in rng tree_of_subformulae(F) iff G is_subformula_of F
proof
  now
    set T = dom tree_of_subformulae(F);
    defpred P[set] means ex H st (tree_of_subformulae(F)).$1 = H & H
    is_subformula_of F;
    assume G in rng tree_of_subformulae(F);
    then consider t being object such that
A1: t in dom tree_of_subformulae(F) and
A2: (tree_of_subformulae(F)).t = G by FUNCT_1:def 3;
    reconsider t as Element of T by A1;
A3: for t being Element of T, n st P[t] & t^<*n*> in T holds P[t^<*n*>]
    proof
      let t be Element of T, n;
      assume that
A4:   P[t] and
A5:   t^<*n*> in T;
      (tree_of_subformulae(F)).(t^<*n*>) is Element of QC-WFF(A)
         by A5,FUNCT_1:102;
      then consider H9 such that
A6:   (tree_of_subformulae(F)).(t^<*n*>) = H9;
      consider H such that
A7:   (tree_of_subformulae(F)).t = H and
A8:   H is_subformula_of F by A4;
      ex G9 st G9 = (tree_of_subformulae(F)).(t^<*n*>) & G9
      is_immediate_constituent_of (tree_of_subformulae(F)).t by A5,Th6;
      then H9 is_subformula_of H by A7,A6,QC_LANG2:52;
      hence thesis by A8,A6,QC_LANG2:57;
    end;
A9: P[{}]
    by Def2;
    for t being Element of T holds P[t] from TREES_2:sch 1(A9,A3);
    then ex H st (tree_of_subformulae(F)).t = H & H is_subformula_of F;
    hence G is_subformula_of F by A2;
  end;
  hence G in rng tree_of_subformulae(F) implies G is_subformula_of F;
  assume G is_subformula_of F;
  hence thesis by Th5,Th9;
end;
