reserve X,x for set;
reserve k,m,n for Element of NAT,
  p,q,r,s,r9,s9 for Element of HP-WFF,
  T1,T2 for Tree;
reserve T1,T2 for DecoratedTree;
reserve t,t1 for FinSequence;

theorem Th35:
  for f being Element of dom Subformulae p holds (Subformulae p)|f
  = Subformulae((Subformulae p).f)
proof
  let f be Element of dom Subformulae p;
  defpred P[FinSequence of NAT] means ex q being Element of HP-WFF st q = (
  Subformulae p).$1 & (Subformulae p)|$1 = Subformulae q;
A1: for f being Element of dom Subformulae p st P[f qua FinSequence of NAT]
  for n st f^<*n*> in dom Subformulae p holds P[f^<*n*>qua FinSequence of NAT]
  proof
    let f be Element of dom Subformulae p;
    given q being Element of HP-WFF such that
    q = (Subformulae p).f and
A2: (Subformulae p)|f = Subformulae q;
    let n such that
A3: f^<*n*> in dom Subformulae p;
A4: (Subformulae p)|(f^<*n*>) = (Subformulae q)|<*n*> by A2,A3,TREES_9:3;
A5: (dom Subformulae p)|f = dom Subformulae q by A2,TREES_2:def 10;
    then
A6: <*n*> in dom Subformulae q by A3,TREES_1:def 6;
    then
A7: (Subformulae p).(f^<*n*>) = (Subformulae q).<*n*> by A2,A5,TREES_2:def 10;
    per cases by Th9;
    suppose
      q is conjunctive;
      then consider r,s such that
A8:   q = r '&' s;
A9:   Subformulae q = (r '&' s)-tree(Subformulae r,Subformulae s) by A8,Th32;
      then
A10:  dom Subformulae q = tree(dom Subformulae r, dom Subformulae s) by
TREES_4:14;
      now
        per cases by A6,A10,Th5;
        suppose
A11:      n= 0;
          take r;
          thus r = (Subformulae r).{} by Th34
            .= (Subformulae p).(f^<*n*>) by A7,A9,A11,Th7;
          thus (Subformulae p)|(f^<*n*>) = Subformulae r by A4,A9,A11,Th8;
        end;
        suppose
A12:      n= 1;
          take s;
          thus s = (Subformulae s).{} by Th34
            .= (Subformulae p).(f^<*n*>) by A7,A9,A12,Th7;
          thus (Subformulae p)|(f^<*n*>) = Subformulae s by A4,A9,A12,Th8;
        end;
      end;
      hence thesis;
    end;
    suppose
      q is conditional;
      then consider r,s such that
A13:  q = r => s;
A14:  Subformulae q = (r => s)-tree(Subformulae r,Subformulae s) by A13,Th33;
      then
A15:  dom Subformulae q = tree(dom Subformulae r, dom Subformulae s) by
TREES_4:14;
      now
        per cases by A6,A15,Th5;
        suppose
A16:      n= 0;
          take r;
          thus r = (Subformulae r).{} by Th34
            .= (Subformulae p).(f^<*n*>) by A7,A14,A16,Th7;
          thus (Subformulae p)|(f^<*n*>) = Subformulae r by A4,A14,A16,Th8;
        end;
        suppose
A17:      n= 1;
          take s;
          thus s = (Subformulae s).{} by Th34
            .= (Subformulae p).(f^<*n*>) by A7,A14,A17,Th7;
          thus (Subformulae p)|(f^<*n*>) = Subformulae s by A4,A14,A17,Th8;
        end;
      end;
      hence thesis;
    end;
    suppose
      q is simple;
      then consider k such that
A18:  q = prop k;
      Subformulae q = root-tree prop k by A18,Def9;
      then dom Subformulae q = { {} } by TREES_1:29,TREES_4:3;
      hence thesis by A6,TARSKI:def 1;
    end;
    suppose
      q = VERUM;
      then dom Subformulae q = { {} } by Th30,TREES_1:29,TREES_4:3;
      hence thesis by A6,TARSKI:def 1;
    end;
  end;
  (Subformulae p).{} = p by Th34;
  then
A19: P[(<*>NAT) qua FinSequence of NAT] by TREES_9:1;
  for f being Element of dom Subformulae p holds P[f qua FinSequence of
  NAT] from InTreeInd(A19,A1);
  then P[f qua FinSequence of NAT];
  hence thesis;
end;
