reserve a,x,y for object, A,B for set,
  l,m,n for Nat;
reserve X,Y for set, x for object,
  p,q for Function-yielding FinSequence,
  f,g,h for Function;

theorem
  apply(p^q,x) = apply(p,x)$^apply(q,apply(p,x).(len p+1))
proof
  defpred P[Function-yielding FinSequence] means apply(p^$1,x) = apply(p,x)$^
  apply($1,apply(p,x).(len p+1));
A1: len apply(p,x) = len p+1 by Def4;
  then consider r being FinSequence, y being object such that
A2: apply(p,x) = r^<*y*> by CARD_1:27,FINSEQ_1:46;
A3: for p being Function-yielding FinSequence st P[p] for f being Function
  holds P[p^<*f*>]
  proof
    let q such that
A4: apply(p^q,x) = apply(p,x)$^apply(q,apply(p,x).(len p+1));
A5: apply(p^q,x).(len (p^q)+1) = apply(q,apply(p,x).(len p+1)).(len q+1)
    by Th48;
    let f;
A6: len apply(q,apply(p,x).(len p+1)) = len q+1 by Def4;
A7: len apply(q^<*f*>,apply(p,x).(len p+1)) = len(q^<*f*>)+1 by Def4;
    thus apply(p^(q^<*f*>),x) = apply(p^q^<*f*>,x) by FINSEQ_1:32
      .= apply(p^q,x)^<*f.(apply(p^q,x).(len (p^q)+1))*> by Th41
      .= r^apply(q,apply(p,x).(len p+1))^<*f.(apply(p^q,x).(len (p^q)+1))*>
    by A2,A4,A6,CARD_1:27,REWRITE1:2
      .= r^(apply(q,apply(p,x).(len p+1))^<*f.(apply(p^q,x).(len (p^q)+1))*>
    ) by FINSEQ_1:32
      .= r^apply(q^<*f*>,apply(p,x).(len p+1)) by A5,Th41
      .= apply(p,x)$^apply(q^<*f*>,apply(p,x).(len p+1))
            by A2,A7,CARD_1:27,REWRITE1:2;
  end;
  len <*y*> = 1 by FINSEQ_1:40;
  then len p+1 = len r+1 by A1,A2,FINSEQ_1:22;
  then
A8: apply(p,x).(len p+1) = y by A2,FINSEQ_1:42;
  apply(p^{},x) = apply(p,x) by FINSEQ_1:34
    .= apply(p,x)$^<*apply(p,x).(len p+1)*> by A2,A8,REWRITE1:2
    .= apply(p,x)$^apply({},apply(p,x).(len p+1)) by Th39;
  then
A9: P[{}];
  for q holds P[q] from FuncSeqInd(A9,A3);
  hence thesis;
end;
