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;

theorem
  qa, qb-are_equivalent implies for w, i st i in dom w ex qai, qbi being
  State of tfsm st qai = (qa, w)-admissible.i & qbi = ((qb, w)-admissible.i) &
  qai, qbi-are_equivalent
proof
  assume
A1: qa, qb-are_equivalent;
  let w be FinSequence of IAlph;
  defpred P[Nat] means $1 in Seg len w implies ex qai, qbi being
Element of tfsm st qai = (qa, w)-admissible.$1 & qbi = ((qb, w)-admissible.$1)
  & qai, qbi-are_equivalent;
A2: for i being Nat st P[i] holds P[i+1]
  proof
    let i be Nat;
    assume
A3: i in Seg len w implies ex qai, qbi being Element of tfsm st qai =
(qa, w)-admissible.i & qbi = (qb, w)-admissible.i & qai, qbi-are_equivalent;
A4: i=0 or 0<i & 0+1=1;
    assume (i+1) in Seg len w;
    then i+1<=len w by FINSEQ_1:1;
    then
A5: 0 = i or 1 <= i & i <= len w by A4,NAT_1:13;
    per cases by A5,FINSEQ_1:1;
    suppose
A6:   i = 0;
      reconsider qai = (qa,w)-admissible.1, qbi = (qb,w)-admissible.1 as
      Element of tfsm by Def2;
      take qai, qbi;
      thus qai = (qa, w)-admissible.(i+1) by A6;
      thus qbi = (qb, w)-admissible.(i+1) by A6;
      qai = qa by Def2;
      hence thesis by A1,Def2;
    end;
    suppose
A7:   i in Seg len w;
      then
A8:   1 <= i & i <= len w by FINSEQ_1:1;
      then consider
      wi being Element of IAlph, qai9, qai19 being Element of tfsm
      such that
A9:   wi = w.i & qai9 = (qa, w)-admissible.i and
A10:  qai19 = (qa, w)-admissible.(i+1) and
A11:  wi-succ_of qai9 = qai19 by Def2;
      take qai19;
      consider wi9 being Element of IAlph, qbi9, qbi19 being Element of tfsm
      such that
A12:  wi9 = w.i & qbi9 = (qb, w)-admissible.i and
A13:  qbi19 = (qb, w)-admissible.(i+1) and
A14:  wi9-succ_of qbi9 = qbi19 by A8,Def2;
      take qbi19;
      thus qai19 = (qa, w)-admissible.(i+1) by A10;
      thus qbi19 = (qb, w)-admissible.(i+1) by A13;
      thus thesis by A3,A7,A9,A11,A12,A14,Th19;
    end;
  end;
A15: Seg len w = dom w by FINSEQ_1:def 3;
A16: P[0] by FINSEQ_1:1;
  for i being Nat holds P[i] from NAT_1:sch 2 (A16, A2);
  hence thesis by A15;
end;
