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;

theorem Th42:
  tfsm1,tfsm2-are_isomorphic & tfsm2,tfsm3-are_isomorphic implies
  tfsm1,tfsm3-are_isomorphic
proof
  assume that
A1: tfsm1,tfsm2-are_isomorphic and
A2: tfsm2,tfsm3-are_isomorphic;
  consider Tf1 being Function of the carrier of tfsm1, the carrier of tfsm2
  such that
A3: Tf1 is bijective and
A4: Tf1.the InitS of tfsm1 = the InitS of tfsm2 and
A5: for q being Element of tfsm1, s1 being Element of IAlph holds Tf1.((
  the Tran of tfsm1).(q, s1)) = (the Tran of tfsm2).(Tf1.q, s1) & (the OFun of
  tfsm1).(q,s1) = (the OFun of tfsm2).(Tf1.q, s1) by A1;
  consider Tf2 being Function of the carrier of tfsm2, the carrier of tfsm3
  such that
A6: Tf2 is bijective and
A7: Tf2.the InitS of tfsm2 = the InitS of tfsm3 and
A8: for q being Element of tfsm2, s1 being Element of IAlph holds Tf2.((
  the Tran of tfsm2).(q, s1)) = (the Tran of tfsm3).(Tf2.q, s1) & (the OFun of
  tfsm2).(q,s1) = (the OFun of tfsm3).(Tf2.q, s1) by A2;
  take Tf = Tf2 * Tf1;
  thus Tf is bijective by A3,A6,FINSEQ_4:85;
A9: dom Tf1 = the carrier of tfsm1 by FUNCT_2:def 1;
  hence Tf.the InitS of tfsm1 = the InitS of tfsm3 by A4,A7,FUNCT_1:13;
  now
    let q be Element of tfsm1, s1 be Element of IAlph;
    thus (the Tran of tfsm3).[Tf.q, s1] = (the Tran of tfsm3).(Tf2.(Tf1.q), s1
    ) by A9,FUNCT_1:13
      .= Tf2.((the Tran of tfsm2).(Tf1.q, s1)) by A8
      .= Tf2.(Tf1.((the Tran of tfsm1).(q,s1))) by A5
      .= Tf.((the Tran of tfsm1).(q, s1)) by A9,FUNCT_1:13;
    thus (the OFun of tfsm3).[Tf.q, s1] = (the OFun of tfsm3).(Tf2.(Tf1.q), s1
    ) by A9,FUNCT_1:13
      .= (the OFun of tfsm2).(Tf1.q, s1) by A8
      .= (the OFun of tfsm1).(q,s1) by A5;
  end;
  hence thesis;
end;
