reserve x,y for Real,
  i, j for non zero Element of NAT,
  I, O for non empty set,
  s,s1,s2,s3 for Element of I,
  w, w1, w2 for FinSequence of I,
  t for Element of O,
  S for non empty FSM over I,
  q, q1 for State of S;
reserve n, m, o, p for non zero Element of NAT,
  M for non empty Moore-SM_Final over I, O,
  q for State of M;

theorem Th21:
  s leads_to_final_state_of M implies
  for t1, t2 being Element of O st t1 is_result_of s, M & t2 is_result_of s, M
  holds t1 = t2
proof
  assume that
A1: s leads_to_final_state_of M;
  let t1, t2 being Element of O;
  given m such that
A2: for w1 st w1.1=s holds (m <= len w1+1 implies
  t1 = (the OFun of M).(GEN(w1, the InitS of M).m) &
  GEN(w1, the InitS of M).m in the FinalS of M) &
  for n st n < m & n <= len w1+1 holds
  not GEN(w1, the InitS of M).n in the FinalS of M;
  given o such that
A3: for w2 st w2.1=s holds (o <= len w2+1 implies
  t2 = (the OFun of M).(GEN(w2, the InitS of M).o) &
  GEN(w2, the InitS of M).o in the FinalS of M) &
  for p st p < o & p <= len w2+1 holds
  not GEN(w2, the InitS of M).p in the FinalS of M;
  consider q being State of M such that
A4: q is_accessible_via s and
A5: q in the FinalS of M by A1;
  consider w being FinSequence of I such that
A6: the InitS of M,<*s*>^w-leads_to q by A4;
  set w1 = <*s*>^w;
A7: GEN(w1, the InitS of M).(len w1+1) = q by A6;
A8: (<*s*>^w).1 = s by FINSEQ_1:41;
  then
A9: len(<*s*>^w)+1 >= m by A2,A5,A7;
A10: o <= len w1+1 by A3,A5,A7,A8;
A11: o < m or o = m or o > m by XXREAL_0:1;
A12: w1.1 = s by FINSEQ_1:41;
  then
A13: t1 = (the OFun of M).(GEN(w1, the InitS of M).m) by A2,A9;
A14: GEN(w1, the InitS of M).m in the FinalS of M by A2,A9,A12;
  GEN(w1, the InitS of M).o in the FinalS of M by A3,A10,A12;
  hence thesis by A2,A3,A9,A10,A11,A12,A13,A14;
end;
