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;

theorem Th41:
  tfsm, the_reduction_of tfsm-are_equivalent
proof
  now
    set rtfsm = the_reduction_of tfsm;
    let w1 be FinSequence of IAlph;
    set ad1 = (the InitS of tfsm,w1)-admissible;
    set ad2 = (the InitS of rtfsm, w1)-admissible;
    set r1=(the InitS of tfsm,w1)-response;
    set r2=(the InitS of rtfsm,w1)-response;
A1: the InitS of tfsm in the InitS of rtfsm by Def18;
A2: now
      let k be Nat;
      assume that
A3:   1 <= k and
A4:   k <= len r1;
      k <= len w1 by A4,Def6;
      then
A5:   k in Seg len w1 by A3,FINSEQ_1:1;
      then
A6:   k in Seg (len w1 + 1) by FINSEQ_2:8;
      then
A7:   ad1.k in ad2.k by A1,Th40;
      k in Seg len ad2 by A6,Def2;
      then k in dom ad2 by FINSEQ_1:def 3;
      then
A8:   ad2.k is Element of rtfsm by FINSEQ_2:11;
      k in Seg len ad1 by A6,Def2;
      then k in dom ad1 by FINSEQ_1:def 3;
      then
A9:   ad1.k is Element of tfsm by FINSEQ_2:11;
A10:  k in dom w1 by A5,FINSEQ_1:def 3;
      then
A11:  w1.k is Element of IAlph by FINSEQ_2:11;
      thus r2.k = (the OFun of rtfsm).(ad2.k, w1.k) by A10,Def6
        .= (the OFun of tfsm).(ad1.k, w1.k) by A9,A11,A8,A7,Def18
        .= r1.k by A10,Def6;
    end;
    len r1 = len w1 by Def6
      .= len r2 by Def6;
    hence r1 = r2 by A2,FINSEQ_1:14;
  end;
  hence thesis;
end;
