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;
reserve Rtfsm1, Rtfsm2 for reduced non empty Mealy-FSM over IAlph, OAlph;
reserve CRtfsm1, CRtfsm2 for connected reduced non empty Mealy-FSM over IAlph
  , OAlph,
  q1u, q2u for State of tfsm;
reserve CRtfsm1, CRtfsm2 for connected reduced finite non empty Mealy-FSM
  over IAlph, OAlph;

theorem Th63:
  tfsm1, tfsm2-are_isomorphic implies tfsm1, tfsm2-are_equivalent
proof
  assume tfsm1, tfsm2-are_isomorphic;
  then consider Tf such that
  Tf is bijective and
A1: Tf.the InitS of tfsm1 = the InitS of tfsm2 and
A2: for q being Element of tfsm1, s being Element of IAlph holds Tf.((
the Tran of tfsm1).(q, s)) = (the Tran of tfsm2).(Tf.q, s) & (the OFun of tfsm1
  ).(q,s) = (the OFun of tfsm2).(Tf.q, s);
  now
    let w1 be FinSequence of IAlph;
    set rw1 = (the InitS of tfsm1,w1)-response;
    set rw2 = (the InitS of tfsm2, w1)-response;
    set aw1 = (the InitS of tfsm1,w1)-admissible;
    set aw2 = (the InitS of tfsm2,w1)-admissible;
A3: for k being Nat st 1<=k & k<= len w1 +1 holds Tf.(aw1.k) = aw2.k
    proof
      defpred P[Nat] means 1 <= $1 & $1 <= len w1 + 1 implies Tf.(
      aw1.$1) = aw2.$1;
A4:   for k being Nat st P[k] holds P[k + 1]
      proof
        let k be Nat;
        assume
A5:     1 <= k & k <= len w1 + 1 implies Tf.(aw1.k) = aw2.k;
        assume that
        1 <= (k+1) and
A6:     (k+1) <= len w1 + 1;
A7:     0 = k or 0 < k & 0+1 = 1;
        per cases by A7,NAT_1:13;
        suppose
A8:       0 = k;
          hence Tf.(aw1.(k+1)) = the InitS of tfsm2 by A1,Def2
            .= aw2.(k+1) by A8,Def2;
        end;
        suppose
A9:       1 <= k;
A10:      len w1 <= len w1 + 1 by NAT_1:11;
A11:      k <= len w1 by A6,XREAL_1:6;
          then consider
          w1k be Element of IAlph, qk, qk1 be Element of tfsm1 such
          that
A12:      w1k= w1.k & qk = aw1.k and
A13:      qk1 = aw1.(k+1) & w1k-succ_of qk = qk1 by A9,Def2;
          consider w2k be Element of IAlph, q2k, q2k1 be Element of tfsm2 such
          that
A14:      w2k= w1.k & q2k = aw2.k and
A15:      q2k1 = aw2.(k+1) & w2k-succ_of q2k = q2k1 by A9,A11,Def2;
          thus Tf.(aw1.(k+1)) = Tf.((the Tran of tfsm1).(qk, w1k)) by A13
            .= (the Tran of tfsm2).(q2k, w2k) by A2,A5,A9,A11,A12,A14,A10,
XXREAL_0:2
            .= aw2.(k+1) by A15;
        end;
      end;
A16:  P[0];
      thus for i being Nat holds P[i] from NAT_1:sch 2 (A16, A4);
    end;
A17: now
      let k be Nat;
      assume that
A18:  1 <= k and
A19:  k <= len rw1;
      k <= len w1 by A19,Def6;
      then
A20:  k in dom w1 by A18,FINSEQ_3:25;
      then
A21:  w1.k is Element of IAlph by FINSEQ_2:11;
      k in Seg len w1 by A20,FINSEQ_1:def 3;
      then k in Seg (len w1 + 1) by FINSEQ_2:8;
      then k in Seg len aw1 by Def2;
      then
A22:  k in dom aw1 by FINSEQ_1:def 3;
      then
A23:  1 <= k by FINSEQ_3:25;
      k <= len aw1 by A22,FINSEQ_3:25;
      then
A24:  k <= len w1 + 1 by Def2;
A25:  aw1.k is Element of tfsm1 by A22,FINSEQ_2:11;
      thus rw2.k = (the OFun of tfsm2).[aw2.k, w1.k] by A20,Def6
        .= (the OFun of tfsm2).(Tf.(aw1.k), w1.k) by A3,A23,A24
        .= (the OFun of tfsm1).(aw1.k, w1.k) by A2,A25,A21
        .= rw1.k by A20,Def6;
    end;
    len rw1 = len w1 by Def6
      .= len rw2 by Def6;
    hence rw1 = rw2 by A17,FINSEQ_1:14;
  end;
  hence thesis;
end;
