reserve m, n, i, k for Nat;
reserve IAlph, OAlph for non empty set,
  fsm for non empty FSM over IAlph,
  s for Element of IAlph,
  w, w1, w2 for FinSequence of IAlph,
  q, q9, q1, q2 for State of fsm;
reserve tfsm, tfsm1, tfsm2, tfsm3 for non empty Mealy-FSM over IAlph, OAlph,
  sfsm for non empty Moore-FSM over IAlph, OAlph,
  qs for State of sfsm,
  q, q1, q2 , q3, qa, qb, qc, qa9, qt, q1t, q2t for State of tfsm,
  q11, q12 for State of tfsm1,
  q21, q22 for State of tfsm2;
reserve OAlphf for finite non empty set,
  tfsmf for finite non empty Mealy-FSM over IAlph, OAlphf,
  sfsmf for finite non empty Moore-FSM over IAlph, OAlphf;
reserve tfsm, rtfsm for finite non empty Mealy-FSM over IAlph, OAlph,
  q for State of tfsm;
reserve qr1, qr2 for State of rtfsm,
  Tf for Function of the carrier of tfsm1, the carrier of tfsm2;
reserve Rtfsm for reduced finite non empty Mealy-FSM over IAlph, OAlph;
reserve Ctfsm, Ctfsm1, Ctfsm2 for connected finite non empty Mealy-FSM over
  IAlph, OAlph;

theorem Th55:
  tfsm = tfsm1-Mealy_union tfsm2 & q21 = q implies (q21,w)
  -response = (q,w)-response
proof
  set q9 = q21;
  assume that
A1: tfsm = tfsm1-Mealy_union tfsm2 and
A2: q9 = q;
  set ad9 = (q9,w)-admissible;
  set res = (q,w)-response, res9 = (q9,w)-response;
A3: len res9 = len w by Def6;
A4: now
    let k be Nat;
    assume 1 <= k & k <= len res9;
    then
A5: k in Seg len w by A3,FINSEQ_1:1;
    then
A6: k in dom w by FINSEQ_1:def 3;
    k in Seg (len w + 1) by A5,FINSEQ_2:8;
    then k in Seg len ad9 by Def2;
    then k in dom ad9 by FINSEQ_1:def 3;
    then
A7: ad9.k in the carrier of tfsm2 by FINSEQ_2:11;
    dom (the OFun of tfsm2) = [:the carrier of tfsm2,IAlph:] & w.k in
    IAlph by A6,FINSEQ_2:11,FUNCT_2:def 1;
    then
A8: [ad9.k, w.k ] in dom (the OFun of tfsm2) by A7,ZFMISC_1:87;
    res9.k = (the OFun of tfsm2).[(q9,w)-admissible.k,w.k] by A6,Def6
      .= ((the OFun of tfsm1) +* (the OFun of tfsm2)).[ad9.k,w.k] by A8,
FUNCT_4:13
      .= ((the OFun of tfsm1) +* (the OFun of tfsm2)). [(q,w)-admissible.k,w
    .k] by A1,A2,Th54
      .= (the OFun of tfsm).[(q,w)-admissible.k, w.k] by A1,Def24
      .= res.k by A6,Def6;
    hence res9.k = res.k;
  end;
  len res9 = len w by Def6
    .= len res by Def6;
  hence thesis by A4,FINSEQ_1:14;
end;
