:: FSM_1 semantic presentation
begin
definition
let IAlph be set ;
attrc2 is strict ;
struct FSM over IAlph -> 1-sorted ;
aggrFSM(# carrier, Tran, InitS #) -> FSM over IAlph;
sel Tran c2 -> Function of [: the carrier of c2,IAlph:], the carrier of c2;
sel InitS c2 -> Element of the carrier of c2;
end;
definition
let IAlph be set ;
let fsm be FSM over IAlph;
mode State of fsm is Element of fsm;
end;
registration
let X be set ;
cluster non empty finite for FSM over X;
existence
ex b1 being FSM over X st
( not b1 is empty & b1 is finite )
proof
set A = the non empty finite set ;
set T = the Function of [: the non empty finite set ,X:], the non empty finite set ;
set I = the Element of the non empty finite set ;
take S = FSM(# the non empty finite set , the Function of [: the non empty finite set ,X:], the non empty finite set , the Element of the non empty finite set #); ::_thesis: ( not S is empty & S is finite )
thus not S is empty ; ::_thesis: S is finite
thus S is finite ; ::_thesis: verum
end;
end;
definition
let IAlph be non empty set ;
let fsm be non empty FSM over IAlph;
let s be Element of IAlph;
let q be State of fsm;
funcs -succ_of q -> State of fsm equals :: FSM_1:def 1
the Tran of fsm . [q,s];
correctness
coherence
the Tran of fsm . [q,s] is State of fsm;
;
end;
:: deftheorem defines -succ_of FSM_1:def_1_:_
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for s being Element of IAlph
for q being State of fsm holds s -succ_of q = the Tran of fsm . [q,s];
definition
let IAlph be non empty set ;
let fsm be non empty FSM over IAlph;
let q be State of fsm;
let w be FinSequence of IAlph;
func(q,w) -admissible -> FinSequence of the carrier of fsm means :Def2: :: FSM_1:def 2
( it . 1 = q & len it = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = it . i & qi1 = it . (i + 1) & wi -succ_of qi = qi1 ) ) );
existence
ex b1 being FinSequence of the carrier of fsm st
( b1 . 1 = q & len b1 = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = b1 . i & qi1 = b1 . (i + 1) & wi -succ_of qi = qi1 ) ) )
proof
set N = (len w) + 1;
set D = the carrier of fsm;
defpred S1[ Element of NAT , set , set ] means ex wn being Element of IAlph ex q9, q99 being Element of the carrier of fsm st
( w . $1 = wn & q9 = $2 & q99 = $3 & wn -succ_of q9 = q99 );
A1: for n being Element of NAT st 1 <= n & n < (len w) + 1 holds
for x being Element of the carrier of fsm ex y being Element of the carrier of fsm st S1[n,x,y]
proof
let n be Element of NAT ; ::_thesis: ( 1 <= n & n < (len w) + 1 implies for x being Element of the carrier of fsm ex y being Element of the carrier of fsm st S1[n,x,y] )
assume A2: 1 <= n ; ::_thesis: ( not n < (len w) + 1 or for x being Element of the carrier of fsm ex y being Element of the carrier of fsm st S1[n,x,y] )
assume n < (len w) + 1 ; ::_thesis: for x being Element of the carrier of fsm ex y being Element of the carrier of fsm st S1[n,x,y]
then n <= len w by NAT_1:13;
then n in dom w by A2, FINSEQ_3:25;
then reconsider wn = w . n as Element of IAlph by FINSEQ_2:11;
let x be Element of the carrier of fsm; ::_thesis: ex y being Element of the carrier of fsm st S1[n,x,y]
wn -succ_of x = the Tran of fsm . [x,wn] ;
hence ex y being Element of the carrier of fsm st S1[n,x,y] ; ::_thesis: verum
end;
consider p being FinSequence of the carrier of fsm such that
A3: ( len p = (len w) + 1 & ( p . 1 = q or (len w) + 1 = 0 ) & ( for n being Element of NAT st 1 <= n & n < (len w) + 1 holds
S1[n,p . n,p . (n + 1)] ) ) from RECDEF_1:sch_4(A1);
take p ; ::_thesis: ( p . 1 = q & len p = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 ) ) )
thus p . 1 = q by A3; ::_thesis: ( len p = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 ) ) )
thus len p = (len w) + 1 by A3; ::_thesis: for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 )
let i be Nat; ::_thesis: ( 1 <= i & i <= len w implies ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 ) )
assume A4: 1 <= i ; ::_thesis: ( not i <= len w or ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 ) )
assume i <= len w ; ::_thesis: ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 )
then ( i in NAT & i < (len w) + 1 ) by NAT_1:13, ORDINAL1:def_12;
hence ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = p . i & qi1 = p . (i + 1) & wi -succ_of qi = qi1 ) by A3, A4; ::_thesis: verum
end;
uniqueness
for b1, b2 being FinSequence of the carrier of fsm st b1 . 1 = q & len b1 = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = b1 . i & qi1 = b1 . (i + 1) & wi -succ_of qi = qi1 ) ) & b2 . 1 = q & len b2 = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = b2 . i & qi1 = b2 . (i + 1) & wi -succ_of qi = qi1 ) ) holds
b1 = b2
proof
let qs1, qs2 be FinSequence of the carrier of fsm; ::_thesis: ( qs1 . 1 = q & len qs1 = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = qs1 . i & qi1 = qs1 . (i + 1) & wi -succ_of qi = qi1 ) ) & qs2 . 1 = q & len qs2 = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = qs2 . i & qi1 = qs2 . (i + 1) & wi -succ_of qi = qi1 ) ) implies qs1 = qs2 )
assume that
A5: qs1 . 1 = q and
A6: len qs1 = (len w) + 1 and
A7: for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qs1i, qs1i1 being State of fsm st
( wi = w . i & qs1i = qs1 . i & qs1i1 = qs1 . (i + 1) & wi -succ_of qs1i = qs1i1 ) and
A8: qs2 . 1 = q and
A9: len qs2 = (len w) + 1 and
A10: for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qs2i, qs2i1 being State of fsm st
( wi = w . i & qs2i = qs2 . i & qs2i1 = qs2 . (i + 1) & wi -succ_of qs2i = qs2i1 ) ; ::_thesis: qs1 = qs2
defpred S1[ Nat] means ( 1 <= $1 & $1 <= len qs1 implies qs1 . $1 = qs2 . $1 );
A11: now__::_thesis:_for_k_being_Nat_st_S1[k]_holds_
S1[k_+_1]
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A12: S1[k] ; ::_thesis: S1[k + 1]
thus S1[k + 1] ::_thesis: verum
proof
assume that
1 <= k + 1 and
A13: k + 1 <= len qs1 ; ::_thesis: qs1 . (k + 1) = qs2 . (k + 1)
A14: ( 0 = k or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( 0 = k or 1 <= k ) by A14, NAT_1:13;
suppose 0 = k ; ::_thesis: qs1 . (k + 1) = qs2 . (k + 1)
hence qs1 . (k + 1) = qs2 . (k + 1) by A5, A8; ::_thesis: verum
end;
supposeA15: 1 <= k ; ::_thesis: qs1 . (k + 1) = qs2 . (k + 1)
A16: k <= len w by A6, A13, XREAL_1:6;
then ( ex i1 being Element of IAlph ex qs1i, qs1i1 being State of fsm st
( i1 = w . k & qs1i = qs1 . k & qs1i1 = qs1 . (k + 1) & i1 -succ_of qs1i = qs1i1 ) & ex i2 being Element of IAlph ex qs2i, qs2i1 being State of fsm st
( i2 = w . k & qs2i = qs2 . k & qs2i1 = qs2 . (k + 1) & i2 -succ_of qs2i = qs2i1 ) ) by A7, A10, A15;
hence qs1 . (k + 1) = qs2 . (k + 1) by A6, A12, A15, A16, NAT_1:12; ::_thesis: verum
end;
end;
end;
end;
A17: S1[ 0 ] ;
for k being Nat holds S1[k] from NAT_1:sch_2(A17, A11);
hence qs1 = qs2 by A6, A9, FINSEQ_1:14; ::_thesis: verum
end;
end;
:: deftheorem Def2 defines -admissible FSM_1:def_2_:_
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for q being State of fsm
for w being FinSequence of IAlph
for b5 being FinSequence of the carrier of fsm holds
( b5 = (q,w) -admissible iff ( b5 . 1 = q & len b5 = (len w) + 1 & ( for i being Nat st 1 <= i & i <= len w holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = w . i & qi = b5 . i & qi1 = b5 . (i + 1) & wi -succ_of qi = qi1 ) ) ) );
theorem Th1: :: FSM_1:1
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for q being State of fsm holds (q,(<*> IAlph)) -admissible = <*q*>
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for q being State of fsm holds (q,(<*> IAlph)) -admissible = <*q*>
let fsm be non empty FSM over IAlph; ::_thesis: for q being State of fsm holds (q,(<*> IAlph)) -admissible = <*q*>
let q be State of fsm; ::_thesis: (q,(<*> IAlph)) -admissible = <*q*>
set eis = <*> IAlph;
A1: for i being Nat st 1 <= i & i <= len (<*> IAlph) holds
ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = (<*> IAlph) . i & qi = <*q*> . i & qi1 = <*q*> . (i + 1) & wi -succ_of qi = qi1 ) ;
( len <*q*> = (len (<*> IAlph)) + 1 & <*q*> . 1 = q ) by FINSEQ_1:40;
hence (q,(<*> IAlph)) -admissible = <*q*> by A1, Def2; ::_thesis: verum
end;
definition
let IAlph be non empty set ;
let fsm be non empty FSM over IAlph;
let w be FinSequence of IAlph;
let q1, q2 be State of fsm;
predq1,w -leads_to q2 means :Def3: :: FSM_1:def 3
((q1,w) -admissible) . ((len w) + 1) = q2;
end;
:: deftheorem Def3 defines -leads_to FSM_1:def_3_:_
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w being FinSequence of IAlph
for q1, q2 being State of fsm holds
( q1,w -leads_to q2 iff ((q1,w) -admissible) . ((len w) + 1) = q2 );
theorem Th2: :: FSM_1:2
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for q being State of fsm holds q, <*> IAlph -leads_to q
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for q being State of fsm holds q, <*> IAlph -leads_to q
let fsm be non empty FSM over IAlph; ::_thesis: for q being State of fsm holds q, <*> IAlph -leads_to q
let q be State of fsm; ::_thesis: q, <*> IAlph -leads_to q
set eis = <*> IAlph;
A1: <*q*> . ((len (<*> IAlph)) + 1) = <*q*> . (0 + 1)
.= q by FINSEQ_1:40 ;
(q,(<*> IAlph)) -admissible = <*q*> by Th1;
hence q, <*> IAlph -leads_to q by A1, Def3; ::_thesis: verum
end;
definition
let IAlph be non empty set ;
let fsm be non empty FSM over IAlph;
let w be FinSequence of IAlph;
let qseq be FinSequence of the carrier of fsm;
predqseq is_admissible_for w means :Def4: :: FSM_1:def 4
ex q1 being State of fsm st
( q1 = qseq . 1 & (q1,w) -admissible = qseq );
end;
:: deftheorem Def4 defines is_admissible_for FSM_1:def_4_:_
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w being FinSequence of IAlph
for qseq being FinSequence of the carrier of fsm holds
( qseq is_admissible_for w iff ex q1 being State of fsm st
( q1 = qseq . 1 & (q1,w) -admissible = qseq ) );
theorem :: FSM_1:3
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for q being State of fsm holds <*q*> is_admissible_for <*> IAlph
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for q being State of fsm holds <*q*> is_admissible_for <*> IAlph
let fsm be non empty FSM over IAlph; ::_thesis: for q being State of fsm holds <*q*> is_admissible_for <*> IAlph
let q be State of fsm; ::_thesis: <*q*> is_admissible_for <*> IAlph
( (q,(<*> IAlph)) -admissible = <*q*> & q = <*q*> . 1 ) by Th1, FINSEQ_1:40;
hence <*q*> is_admissible_for <*> IAlph by Def4; ::_thesis: verum
end;
definition
let IAlph be non empty set ;
let fsm be non empty FSM over IAlph;
let q be State of fsm;
let w be FinSequence of IAlph;
funcq leads_to_under w -> State of fsm means :Def5: :: FSM_1:def 5
q,w -leads_to it;
existence
ex b1 being State of fsm st q,w -leads_to b1
proof
( len ((q,w) -admissible) = (len w) + 1 & (len w) + 1 in Seg ((len w) + 1) ) by Def2, FINSEQ_1:4;
then (len w) + 1 in dom ((q,w) -admissible) by FINSEQ_1:def_3;
then reconsider IT = ((q,w) -admissible) . ((len w) + 1) as Element of fsm by FINSEQ_2:11;
take IT ; ::_thesis: q,w -leads_to IT
thus q,w -leads_to IT by Def3; ::_thesis: verum
end;
uniqueness
for b1, b2 being State of fsm st q,w -leads_to b1 & q,w -leads_to b2 holds
b1 = b2
proof
let it1, it2 be Element of fsm; ::_thesis: ( q,w -leads_to it1 & q,w -leads_to it2 implies it1 = it2 )
assume that
A1: q,w -leads_to it1 and
A2: q,w -leads_to it2 ; ::_thesis: it1 = it2
((q,w) -admissible) . ((len w) + 1) = it1 by A1, Def3;
hence it1 = it2 by A2, Def3; ::_thesis: verum
end;
end;
:: deftheorem Def5 defines leads_to_under FSM_1:def_5_:_
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for q being State of fsm
for w being FinSequence of IAlph
for b5 being State of fsm holds
( b5 = q leads_to_under w iff q,w -leads_to b5 );
theorem Th4: :: FSM_1:4
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w being FinSequence of IAlph
for q, q9 being State of fsm holds
( ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 iff q,w -leads_to q9 )
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for w being FinSequence of IAlph
for q, q9 being State of fsm holds
( ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 iff q,w -leads_to q9 )
let fsm be non empty FSM over IAlph; ::_thesis: for w being FinSequence of IAlph
for q, q9 being State of fsm holds
( ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 iff q,w -leads_to q9 )
let w be FinSequence of IAlph; ::_thesis: for q, q9 being State of fsm holds
( ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 iff q,w -leads_to q9 )
let q, q9 be State of fsm; ::_thesis: ( ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 iff q,w -leads_to q9 )
hereby ::_thesis: ( q,w -leads_to q9 implies ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 )
set qs = (q,w) -admissible ;
assume A1: ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 ; ::_thesis: q,w -leads_to q9
len ((q,w) -admissible) = (len w) + 1 by Def2;
hence q,w -leads_to q9 by A1, Def3; ::_thesis: verum
end;
assume q,w -leads_to q9 ; ::_thesis: ((q,w) -admissible) . (len ((q,w) -admissible)) = q9
then ((q,w) -admissible) . ((len w) + 1) = q9 by Def3;
hence ((q,w) -admissible) . (len ((q,w) -admissible)) = q9 by Def2; ::_thesis: verum
end;
theorem Th5: :: FSM_1:5
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1 being State of fsm
for k being Element of NAT st 1 <= k & k <= len w1 holds
((q1,(w1 ^ w2)) -admissible) . k = ((q1,w1) -admissible) . k
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1 being State of fsm
for k being Element of NAT st 1 <= k & k <= len w1 holds
((q1,(w1 ^ w2)) -admissible) . k = ((q1,w1) -admissible) . k
let fsm be non empty FSM over IAlph; ::_thesis: for w1, w2 being FinSequence of IAlph
for q1 being State of fsm
for k being Element of NAT st 1 <= k & k <= len w1 holds
((q1,(w1 ^ w2)) -admissible) . k = ((q1,w1) -admissible) . k
let w1, w2 be FinSequence of IAlph; ::_thesis: for q1 being State of fsm
for k being Element of NAT st 1 <= k & k <= len w1 holds
((q1,(w1 ^ w2)) -admissible) . k = ((q1,w1) -admissible) . k
let q1 be State of fsm; ::_thesis: for k being Element of NAT st 1 <= k & k <= len w1 holds
((q1,(w1 ^ w2)) -admissible) . k = ((q1,w1) -admissible) . k
set q1w = (q1,(w1 ^ w2)) -admissible ;
set q1w1 = (q1,w1) -admissible ;
defpred S1[ Element of NAT ] means ( 1 <= $1 & $1 <= len w1 implies ((q1,(w1 ^ w2)) -admissible) . $1 = ((q1,w1) -admissible) . $1 );
A1: now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_
S1[k_+_1]
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A2: S1[k] ; ::_thesis: S1[k + 1]
thus S1[k + 1] ::_thesis: verum
proof
assume that
1 <= k + 1 and
A3: k + 1 <= len w1 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . (k + 1) = ((q1,w1) -admissible) . (k + 1)
A4: ( 0 = k or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( k = 0 or ( 1 <= k & k <= len w1 ) ) by A3, A4, NAT_1:13;
supposeA5: k = 0 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . (k + 1) = ((q1,w1) -admissible) . (k + 1)
hence ((q1,(w1 ^ w2)) -admissible) . (k + 1) = q1 by Def2
.= ((q1,w1) -admissible) . (k + 1) by A5, Def2 ;
::_thesis: verum
end;
supposeA6: ( 1 <= k & k <= len w1 ) ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . (k + 1) = ((q1,w1) -admissible) . (k + 1)
len w1 <= (len w1) + (len w2) by NAT_1:11;
then k <= (len w1) + (len w2) by A6, XXREAL_0:2;
then k <= len (w1 ^ w2) by FINSEQ_1:22;
then A7: ex wk being Element of IAlph ex qwk, qwk1 being State of fsm st
( wk = (w1 ^ w2) . k & qwk = ((q1,(w1 ^ w2)) -admissible) . k & qwk1 = ((q1,(w1 ^ w2)) -admissible) . (k + 1) & wk -succ_of qwk = qwk1 ) by A6, Def2;
( ex w1k being Element of IAlph ex qw1k, qw1k1 being State of fsm st
( w1k = w1 . k & qw1k = ((q1,w1) -admissible) . k & qw1k1 = ((q1,w1) -admissible) . (k + 1) & w1k -succ_of qw1k = qw1k1 ) & k in dom w1 ) by A6, Def2, FINSEQ_3:25;
hence ((q1,(w1 ^ w2)) -admissible) . (k + 1) = ((q1,w1) -admissible) . (k + 1) by A2, A6, A7, FINSEQ_1:def_7; ::_thesis: verum
end;
end;
end;
end;
A8: S1[ 0 ] ;
thus for k being Element of NAT holds S1[k] from NAT_1:sch_1(A8, A1); ::_thesis: verum
end;
theorem Th6: :: FSM_1:6
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
let fsm be non empty FSM over IAlph; ::_thesis: for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
let w1, w2 be FinSequence of IAlph; ::_thesis: for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
let q1, q2 be State of fsm; ::_thesis: ( q1,w1 -leads_to q2 implies ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2 )
assume A1: q1,w1 -leads_to q2 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
set q1w1 = (q1,w1) -admissible ;
set q1w = (q1,(w1 ^ w2)) -admissible ;
percases ( len w1 = 0 or len w1 > 0 ) ;
supposeA2: len w1 = 0 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
( ((q1,w1) -admissible) . 1 = q1 & ((q1,w1) -admissible) . ((len w1) + 1) = q2 ) by A1, Def2, Def3;
hence ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2 by A2, Def2; ::_thesis: verum
end;
supposeA3: len w1 > 0 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = q2
A4: len ((q1,w1) -admissible) = (len w1) + 1 by Def2;
0 + 1 = 1 ;
then A5: 1 <= len w1 by A3, NAT_1:13;
then consider w1k being Element of IAlph, qw1k, qw1k1 being State of fsm such that
A6: w1k = w1 . (len w1) and
A7: qw1k = ((q1,w1) -admissible) . (len w1) and
A8: qw1k1 = ((q1,w1) -admissible) . ((len w1) + 1) and
A9: w1k -succ_of qw1k = qw1k1 by Def2;
len (w1 ^ w2) = (len w1) + (len w2) by FINSEQ_1:22;
then len w1 <= len (w1 ^ w2) by NAT_1:12;
then consider wk being Element of IAlph, qwk, qwk1 being State of fsm such that
A10: wk = (w1 ^ w2) . (len w1) and
A11: ( qwk = ((q1,(w1 ^ w2)) -admissible) . (len w1) & qwk1 = ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) & wk -succ_of qwk = qwk1 ) by A5, Def2;
len w1 in Seg (len w1) by A3, FINSEQ_1:3;
then len w1 in dom w1 by FINSEQ_1:def_3;
then wk = w1k by A10, A6, FINSEQ_1:def_7;
hence ((q1,(w1 ^ w2)) -admissible) . ((len w1) + 1) = qw1k1 by A5, A11, A7, A9, Th5
.= q2 by A1, A8, A4, Th4 ;
::_thesis: verum
end;
end;
end;
theorem Th7: :: FSM_1:7
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
for k being Element of NAT st 1 <= k & k <= (len w2) + 1 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
for k being Element of NAT st 1 <= k & k <= (len w2) + 1 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k
let fsm be non empty FSM over IAlph; ::_thesis: for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
for k being Element of NAT st 1 <= k & k <= (len w2) + 1 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k
let w1, w2 be FinSequence of IAlph; ::_thesis: for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
for k being Element of NAT st 1 <= k & k <= (len w2) + 1 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k
let q1, q2 be State of fsm; ::_thesis: ( q1,w1 -leads_to q2 implies for k being Element of NAT st 1 <= k & k <= (len w2) + 1 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k )
set q1w = (q1,(w1 ^ w2)) -admissible ;
set q2w2 = (q2,w2) -admissible ;
defpred S1[ Element of NAT ] means ( 1 <= $1 & $1 <= (len w2) + 1 implies ((q1,(w1 ^ w2)) -admissible) . ((len w1) + $1) = ((q2,w2) -admissible) . $1 );
assume A1: q1,w1 -leads_to q2 ; ::_thesis: for k being Element of NAT st 1 <= k & k <= (len w2) + 1 holds
((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k
A2: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A3: ( 1 <= k & k <= (len w2) + 1 implies ((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) = ((q2,w2) -admissible) . k ) ; ::_thesis: S1[k + 1]
assume that
1 <= k + 1 and
A4: k + 1 <= (len w2) + 1 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . ((len w1) + (k + 1)) = ((q2,w2) -admissible) . (k + 1)
percases ( k = 0 or 0 < k ) ;
supposeA5: k = 0 ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . ((len w1) + (k + 1)) = ((q2,w2) -admissible) . (k + 1)
hence ((q1,(w1 ^ w2)) -admissible) . ((len w1) + (k + 1)) = q2 by A1, Th6
.= ((q2,w2) -admissible) . (k + 1) by A5, Def2 ;
::_thesis: verum
end;
supposeA6: 0 < k ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . ((len w1) + (k + 1)) = ((q2,w2) -admissible) . (k + 1)
A7: k <= len w2 by A4, XREAL_1:6;
A8: 0 + 1 = 1 ;
then 1 <= k by A6, NAT_1:13;
then A9: ( ex w2i being Element of IAlph ex q2i, q2i1 being State of fsm st
( w2i = w2 . k & q2i = ((q2,w2) -admissible) . k & q2i1 = ((q2,w2) -admissible) . (k + 1) & w2i -succ_of q2i = q2i1 ) & k in dom w2 ) by A7, Def2, FINSEQ_3:25;
len (w1 ^ w2) = (len w1) + (len w2) by FINSEQ_1:22;
then A10: (len w1) + k <= len (w1 ^ w2) by A7, XREAL_1:7;
1 <= (len w1) + k by A6, A8, NAT_1:13;
then ex wi being Element of IAlph ex qi, qi1 being State of fsm st
( wi = (w1 ^ w2) . ((len w1) + k) & qi = ((q1,(w1 ^ w2)) -admissible) . ((len w1) + k) & qi1 = ((q1,(w1 ^ w2)) -admissible) . (((len w1) + k) + 1) & wi -succ_of qi = qi1 ) by A10, Def2;
hence ((q1,(w1 ^ w2)) -admissible) . ((len w1) + (k + 1)) = ((q2,w2) -admissible) . (k + 1) by A3, A4, A6, A8, A9, FINSEQ_1:def_7, NAT_1:13; ::_thesis: verum
end;
end;
end;
A11: S1[ 0 ] ;
thus for n being Element of NAT holds S1[n] from NAT_1:sch_1(A11, A2); ::_thesis: verum
end;
theorem Th8: :: FSM_1:8
for IAlph being non empty set
for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
(q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)
proof
let IAlph be non empty set ; ::_thesis: for fsm being non empty FSM over IAlph
for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
(q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)
let fsm be non empty FSM over IAlph; ::_thesis: for w1, w2 being FinSequence of IAlph
for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
(q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)
let w1, w2 be FinSequence of IAlph; ::_thesis: for q1, q2 being State of fsm st q1,w1 -leads_to q2 holds
(q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)
let q1, q2 be State of fsm; ::_thesis: ( q1,w1 -leads_to q2 implies (q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible) )
set q1w = (q1,(w1 ^ w2)) -admissible ;
set q1w1 = (q1,w1) -admissible ;
set q2w2 = (q2,w2) -admissible ;
set Dw1 = Del (((q1,w1) -admissible),((len w1) + 1));
A1: len ((q1,w1) -admissible) = (len w1) + 1 by Def2;
( len ((q1,w1) -admissible) = (len w1) + 1 & dom ((q1,w1) -admissible) = Seg (len ((q1,w1) -admissible)) ) by Def2, FINSEQ_1:def_3;
then (len w1) + 1 in dom ((q1,w1) -admissible) by FINSEQ_1:3;
then A2: ex m being Nat st
( len ((q1,w1) -admissible) = m + 1 & len (Del (((q1,w1) -admissible),((len w1) + 1))) = m ) by FINSEQ_3:104;
A3: len ((q1,(w1 ^ w2)) -admissible) = (len (w1 ^ w2)) + 1 by Def2
.= ((len w1) + (len w2)) + 1 by FINSEQ_1:22
.= (len (Del (((q1,w1) -admissible),((len w1) + 1)))) + ((len w2) + 1) by A2, A1
.= (len (Del (((q1,w1) -admissible),((len w1) + 1)))) + (len ((q2,w2) -admissible)) by Def2
.= len ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) by FINSEQ_1:22 ;
assume A4: q1,w1 -leads_to q2 ; ::_thesis: (q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)
now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((q1,(w1_^_w2))_-admissible)_holds_
((q1,(w1_^_w2))_-admissible)_._k_=_((Del_(((q1,w1)_-admissible),((len_w1)_+_1)))_^_((q2,w2)_-admissible))_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len ((q1,(w1 ^ w2)) -admissible) implies ((q1,(w1 ^ w2)) -admissible) . b1 = ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . b1 )
assume A5: ( 1 <= k & k <= len ((q1,(w1 ^ w2)) -admissible) ) ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . b1 = ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . b1
percases ( ( 1 <= k & k <= len w1 ) or ( (len w1) + 1 <= k & k <= len ((q1,(w1 ^ w2)) -admissible) ) ) by A5, NAT_1:13;
supposeA6: ( 1 <= k & k <= len w1 ) ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . b1 = ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . b1
then A7: k < (len w1) + 1 by NAT_1:13;
A8: k in dom (Del (((q1,w1) -admissible),((len w1) + 1))) by A2, A1, A6, FINSEQ_3:25;
k in NAT by ORDINAL1:def_12;
hence ((q1,(w1 ^ w2)) -admissible) . k = ((q1,w1) -admissible) . k by A6, Th5
.= (Del (((q1,w1) -admissible),((len w1) + 1))) . k by A7, FINSEQ_3:110
.= ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . k by A8, FINSEQ_1:def_7 ;
::_thesis: verum
end;
supposeA9: ( (len w1) + 1 <= k & k <= len ((q1,(w1 ^ w2)) -admissible) ) ; ::_thesis: ((q1,(w1 ^ w2)) -admissible) . b1 = ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . b1
then k <= (len (Del (((q1,w1) -admissible),((len w1) + 1)))) + (len ((q2,w2) -admissible)) by A3, FINSEQ_1:22;
then A10: ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . k = ((q2,w2) -admissible) . (k - (len w1)) by A2, A1, A9, FINSEQ_1:23;
((len w1) + 1) - (len w1) <= k - (len w1) by A9, XREAL_1:9;
then reconsider i = k - (len w1) as Element of NAT by INT_1:3;
A11: k = (len w1) + i ;
len ((q1,(w1 ^ w2)) -admissible) = (len (w1 ^ w2)) + 1 by Def2;
then k <= ((len w1) + (len w2)) + 1 by A9, FINSEQ_1:22;
then k <= (len w1) + ((len w2) + 1) ;
then A12: i <= (len w2) + 1 by A11, XREAL_1:6;
1 <= i by A9, A11, XREAL_1:6;
hence ((q1,(w1 ^ w2)) -admissible) . k = ((Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible)) . k by A4, A11, A12, A10, Th7; ::_thesis: verum
end;
end;
end;
hence (q1,(w1 ^ w2)) -admissible = (Del (((q1,w1) -admissible),((len w1) + 1))) ^ ((q2,w2) -admissible) by A3, FINSEQ_1:14; ::_thesis: verum
end;
begin
definition
let IAlph be set ;
let OAlph be non empty set ;
attrc3 is strict ;
struct Mealy-FSM over IAlph,OAlph -> FSM over IAlph;
aggrMealy-FSM(# carrier, Tran, OFun, InitS #) -> Mealy-FSM over IAlph,OAlph;
sel OFun c3 -> Function of [: the carrier of c3,IAlph:],OAlph;
attrc3 is strict ;
struct Moore-FSM over IAlph,OAlph -> FSM over IAlph;
aggrMoore-FSM(# carrier, Tran, OFun, InitS #) -> Moore-FSM over IAlph,OAlph;
sel OFun c3 -> Function of the carrier of c3,OAlph;
end;
registration
let IAlph be set ;
let X be non empty finite set ;
let T be Function of [:X,IAlph:],X;
let I be Element of X;
cluster FSM(# X,T,I #) -> non empty finite ;
coherence
( FSM(# X,T,I #) is finite & not FSM(# X,T,I #) is empty ) ;
end;
registration
let IAlph be set ;
let OAlph be non empty set ;
let X be non empty finite set ;
let T be Function of [:X,IAlph:],X;
let O be Function of [:X,IAlph:],OAlph;
let I be Element of X;
cluster Mealy-FSM(# X,T,O,I #) -> non empty finite ;
coherence
( Mealy-FSM(# X,T,O,I #) is finite & not Mealy-FSM(# X,T,O,I #) is empty ) ;
end;
registration
let IAlph be set ;
let OAlph be non empty set ;
let X be non empty finite set ;
let T be Function of [:X,IAlph:],X;
let O be Function of X,OAlph;
let I be Element of X;
cluster Moore-FSM(# X,T,O,I #) -> non empty finite ;
coherence
( Moore-FSM(# X,T,O,I #) is finite & not Moore-FSM(# X,T,O,I #) is empty ) ;
end;
registration
let IAlph be set ;
let OAlph be non empty set ;
cluster non empty finite for Mealy-FSM over IAlph,OAlph;
existence
ex b1 being Mealy-FSM over IAlph,OAlph st
( b1 is finite & not b1 is empty )
proof
set X = the non empty finite set ;
set T = the Function of [: the non empty finite set ,IAlph:], the non empty finite set ;
set O = the Function of [: the non empty finite set ,IAlph:],OAlph;
set I = the Element of the non empty finite set ;
take Mealy-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of [: the non empty finite set ,IAlph:],OAlph, the Element of the non empty finite set #) ; ::_thesis: ( Mealy-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of [: the non empty finite set ,IAlph:],OAlph, the Element of the non empty finite set #) is finite & not Mealy-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of [: the non empty finite set ,IAlph:],OAlph, the Element of the non empty finite set #) is empty )
thus ( Mealy-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of [: the non empty finite set ,IAlph:],OAlph, the Element of the non empty finite set #) is finite & not Mealy-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of [: the non empty finite set ,IAlph:],OAlph, the Element of the non empty finite set #) is empty ) ; ::_thesis: verum
end;
cluster non empty finite for Moore-FSM over IAlph,OAlph;
existence
ex b1 being Moore-FSM over IAlph,OAlph st
( b1 is finite & not b1 is empty )
proof
set X = the non empty finite set ;
set T = the Function of [: the non empty finite set ,IAlph:], the non empty finite set ;
set O = the Function of the non empty finite set ,OAlph;
set I = the Element of the non empty finite set ;
take Moore-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of the non empty finite set ,OAlph, the Element of the non empty finite set #) ; ::_thesis: ( Moore-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of the non empty finite set ,OAlph, the Element of the non empty finite set #) is finite & not Moore-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of the non empty finite set ,OAlph, the Element of the non empty finite set #) is empty )
thus ( Moore-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of the non empty finite set ,OAlph, the Element of the non empty finite set #) is finite & not Moore-FSM(# the non empty finite set , the Function of [: the non empty finite set ,IAlph:], the non empty finite set , the Function of the non empty finite set ,OAlph, the Element of the non empty finite set #) is empty ) ; ::_thesis: verum
end;
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let qt be State of tfsm;
let w be FinSequence of IAlph;
func(qt,w) -response -> FinSequence of OAlph means :Def6: :: FSM_1:def 6
( len it = len w & ( for i being Element of NAT st i in dom w holds
it . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) );
existence
ex b1 being FinSequence of OAlph st
( len b1 = len w & ( for i being Element of NAT st i in dom w holds
b1 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) )
proof
set qs = (qt,w) -admissible ;
deffunc H1( Nat) -> set = the OFun of tfsm . [(((qt,w) -admissible) . $1),(w . $1)];
consider p being FinSequence such that
A1: ( len p = len w & ( for i being Nat st i in dom p holds
p . i = H1(i) ) ) from FINSEQ_1:sch_2();
A2: Seg (len w) = dom w by FINSEQ_1:def_3;
rng p c= OAlph
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng p or y in OAlph )
assume y in rng p ; ::_thesis: y in OAlph
then consider x being set such that
A3: x in dom p and
A4: y = p . x by FUNCT_1:def_3;
reconsider x = x as Element of NAT by A3;
x <= len p by A3, FINSEQ_3:25;
then A5: x <= (len p) + 1 by NAT_1:12;
A6: len ((qt,w) -admissible) = (len p) + 1 by A1, Def2;
dom p = Seg (len p) by FINSEQ_1:def_3;
then reconsider wx = w . x as Element of IAlph by A2, A1, A3, FINSEQ_2:11;
1 <= x by A3, FINSEQ_3:25;
then x in dom ((qt,w) -admissible) by A6, A5, FINSEQ_3:25;
then reconsider qsx = ((qt,w) -admissible) . x as Element of tfsm by FINSEQ_2:11;
p . x = the OFun of tfsm . [qsx,wx] by A1, A3;
hence y in OAlph by A4; ::_thesis: verum
end;
then reconsider p9 = p as FinSequence of OAlph by FINSEQ_1:def_4;
dom p = dom w by A1, FINSEQ_3:29;
then for i being Element of NAT st i in dom w holds
p9 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] by A1;
hence ex b1 being FinSequence of OAlph st
( len b1 = len w & ( for i being Element of NAT st i in dom w holds
b1 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) ) by A1; ::_thesis: verum
end;
uniqueness
for b1, b2 being FinSequence of OAlph st len b1 = len w & ( for i being Element of NAT st i in dom w holds
b1 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) & len b2 = len w & ( for i being Element of NAT st i in dom w holds
b2 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) holds
b1 = b2
proof
let it1, it2 be FinSequence of OAlph; ::_thesis: ( len it1 = len w & ( for i being Element of NAT st i in dom w holds
it1 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) & len it2 = len w & ( for i being Element of NAT st i in dom w holds
it2 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) implies it1 = it2 )
set qs = (qt,w) -admissible ;
assume that
A7: len it1 = len w and
A8: for i being Element of NAT st i in dom w holds
it1 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ; ::_thesis: ( not len it2 = len w or ex i being Element of NAT st
( i in dom w & not it2 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) or it1 = it2 )
assume that
A9: len it2 = len w and
A10: for i being Element of NAT st i in dom w holds
it2 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ; ::_thesis: it1 = it2
A11: dom w = dom it1 by A7, FINSEQ_3:29;
now__::_thesis:_(_len_it1_=_len_it2_&_(_for_i_being_Nat_st_1_<=_i_&_i_<=_len_it1_holds_
it1_._i_=_it2_._i_)_)
thus len it1 = len it2 by A7, A9; ::_thesis: for i being Nat st 1 <= i & i <= len it1 holds
it1 . i = it2 . i
let i be Nat; ::_thesis: ( 1 <= i & i <= len it1 implies it1 . i = it2 . i )
assume ( 1 <= i & i <= len it1 ) ; ::_thesis: it1 . i = it2 . i
then A12: i in dom it1 by FINSEQ_3:25;
then it1 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] by A8, A11;
hence it1 . i = it2 . i by A10, A11, A12; ::_thesis: verum
end;
hence it1 = it2 by FINSEQ_1:14; ::_thesis: verum
end;
end;
:: deftheorem Def6 defines -response FSM_1:def_6_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qt being State of tfsm
for w being FinSequence of IAlph
for b6 being FinSequence of OAlph holds
( b6 = (qt,w) -response iff ( len b6 = len w & ( for i being Element of NAT st i in dom w holds
b6 . i = the OFun of tfsm . [(((qt,w) -admissible) . i),(w . i)] ) ) );
theorem Th9: :: FSM_1:9
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qt being State of tfsm holds (qt,(<*> IAlph)) -response = <*> OAlph
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qt being State of tfsm holds (qt,(<*> IAlph)) -response = <*> OAlph
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qt being State of tfsm holds (qt,(<*> IAlph)) -response = <*> OAlph
let qt be State of tfsm; ::_thesis: (qt,(<*> IAlph)) -response = <*> OAlph
len ((qt,(<*> IAlph)) -response) = len (<*> IAlph) by Def6
.= 0 ;
hence (qt,(<*> IAlph)) -response = <*> OAlph ; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let sfsm be non empty Moore-FSM over IAlph,OAlph;
let qs be State of sfsm;
let w be FinSequence of IAlph;
func(qs,w) -response -> FinSequence of OAlph means :Def7: :: FSM_1:def 7
( len it = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
it . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) );
existence
ex b1 being FinSequence of OAlph st
( len b1 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
b1 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) )
proof
set qs9 = (qs,w) -admissible ;
deffunc H1( Nat) -> set = the OFun of sfsm . (((qs,w) -admissible) . $1);
consider p being FinSequence such that
A1: ( len p = len ((qs,w) -admissible) & ( for i being Nat st i in dom p holds
p . i = H1(i) ) ) from FINSEQ_1:sch_2();
A2: Seg (len ((qs,w) -admissible)) = dom ((qs,w) -admissible) by FINSEQ_1:def_3;
rng p c= OAlph
proof
let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in rng p or y in OAlph )
assume y in rng p ; ::_thesis: y in OAlph
then consider x being set such that
A3: x in dom p and
A4: y = p . x by FUNCT_1:def_3;
reconsider x = x as Element of NAT by A3;
dom p = Seg (len p) by FINSEQ_1:def_3;
then reconsider qsx = ((qs,w) -admissible) . x as State of sfsm by A2, A1, A3, FINSEQ_2:11;
p . x = the OFun of sfsm . qsx by A1, A3;
hence y in OAlph by A4; ::_thesis: verum
end;
then reconsider p9 = p as FinSequence of OAlph by FINSEQ_1:def_4;
A5: len ((qs,w) -admissible) = (len w) + 1 by Def2;
dom p = dom ((qs,w) -admissible) by A1, FINSEQ_3:29;
then for i being Element of NAT st i in dom ((qs,w) -admissible) holds
p9 . i = the OFun of sfsm . (((qs,w) -admissible) . i) by A1;
hence ex b1 being FinSequence of OAlph st
( len b1 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
b1 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) ) by A2, A1, A5; ::_thesis: verum
end;
uniqueness
for b1, b2 being FinSequence of OAlph st len b1 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
b1 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) & len b2 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
b2 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) holds
b1 = b2
proof
let it1, it2 be FinSequence of OAlph; ::_thesis: ( len it1 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
it1 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) & len it2 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
it2 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) implies it1 = it2 )
set qs9 = (qs,w) -admissible ;
assume that
A6: len it1 = (len w) + 1 and
A7: for i being Element of NAT st i in Seg ((len w) + 1) holds
it1 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ; ::_thesis: ( not len it2 = (len w) + 1 or ex i being Element of NAT st
( i in Seg ((len w) + 1) & not it2 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) or it1 = it2 )
assume that
A8: len it2 = (len w) + 1 and
A9: for i being Element of NAT st i in Seg ((len w) + 1) holds
it2 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ; ::_thesis: it1 = it2
now__::_thesis:_(_len_it1_=_len_it2_&_(_for_i_being_Nat_st_1_<=_i_&_i_<=_len_it1_holds_
it1_._i_=_it2_._i_)_)
thus len it1 = len it2 by A6, A8; ::_thesis: for i being Nat st 1 <= i & i <= len it1 holds
it1 . i = it2 . i
let i be Nat; ::_thesis: ( 1 <= i & i <= len it1 implies it1 . i = it2 . i )
assume ( 1 <= i & i <= len it1 ) ; ::_thesis: it1 . i = it2 . i
then A10: i in Seg (len it1) by FINSEQ_1:1;
then it1 . i = the OFun of sfsm . (((qs,w) -admissible) . i) by A6, A7;
hence it1 . i = it2 . i by A6, A9, A10; ::_thesis: verum
end;
hence it1 = it2 by FINSEQ_1:14; ::_thesis: verum
end;
end;
:: deftheorem Def7 defines -response FSM_1:def_7_:_
for IAlph, OAlph being non empty set
for sfsm being non empty Moore-FSM over IAlph,OAlph
for qs being State of sfsm
for w being FinSequence of IAlph
for b6 being FinSequence of OAlph holds
( b6 = (qs,w) -response iff ( len b6 = (len w) + 1 & ( for i being Element of NAT st i in Seg ((len w) + 1) holds
b6 . i = the OFun of sfsm . (((qs,w) -admissible) . i) ) ) );
theorem Th10: :: FSM_1:10
for IAlph, OAlph being non empty set
for w being FinSequence of IAlph
for sfsm being non empty Moore-FSM over IAlph,OAlph
for qs being State of sfsm holds ((qs,w) -response) . 1 = the OFun of sfsm . qs
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for sfsm being non empty Moore-FSM over IAlph,OAlph
for qs being State of sfsm holds ((qs,w) -response) . 1 = the OFun of sfsm . qs
let w be FinSequence of IAlph; ::_thesis: for sfsm being non empty Moore-FSM over IAlph,OAlph
for qs being State of sfsm holds ((qs,w) -response) . 1 = the OFun of sfsm . qs
let sfsm be non empty Moore-FSM over IAlph,OAlph; ::_thesis: for qs being State of sfsm holds ((qs,w) -response) . 1 = the OFun of sfsm . qs
let qs be State of sfsm; ::_thesis: ((qs,w) -response) . 1 = the OFun of sfsm . qs
1 <= (len w) + 1 by NAT_1:12;
then 1 in Seg ((len w) + 1) by FINSEQ_1:1;
hence ((qs,w) -response) . 1 = the OFun of sfsm . (((qs,w) -admissible) . 1) by Def7
.= the OFun of sfsm . qs by Def2 ;
::_thesis: verum
end;
theorem Th11: :: FSM_1:11
for IAlph, OAlph being non empty set
for w1, w2 being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q1t, q2t being State of tfsm st q1t,w1 -leads_to q2t holds
(q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response)
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w1, w2 being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q1t, q2t being State of tfsm st q1t,w1 -leads_to q2t holds
(q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response)
let w1, w2 be FinSequence of IAlph; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q1t, q2t being State of tfsm st q1t,w1 -leads_to q2t holds
(q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response)
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q1t, q2t being State of tfsm st q1t,w1 -leads_to q2t holds
(q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response)
let q1t, q2t be State of tfsm; ::_thesis: ( q1t,w1 -leads_to q2t implies (q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response) )
set q1w1 = (q1t,w1) -response ;
set q2w2 = (q2t,w2) -response ;
set q1w1w2 = (q1t,(w1 ^ w2)) -response ;
set Dq1w1w2a = Del (((q1t,w1) -admissible),((len w1) + 1));
set OF = the OFun of tfsm;
assume A1: q1t,w1 -leads_to q2t ; ::_thesis: (q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response)
A2: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((q1t,(w1_^_w2))_-response)_holds_
((q1t,(w1_^_w2))_-response)_._k_=_(((q1t,w1)_-response)_^_((q2t,w2)_-response))_._k
dom ((q1t,w1) -admissible) = Seg (len ((q1t,w1) -admissible)) by FINSEQ_1:def_3;
then dom ((q1t,w1) -admissible) = Seg ((len w1) + 1) by Def2;
then (len w1) + 1 in dom ((q1t,w1) -admissible) by FINSEQ_1:3;
then consider m being Nat such that
A3: len ((q1t,w1) -admissible) = m + 1 and
A4: len (Del (((q1t,w1) -admissible),((len w1) + 1))) = m by FINSEQ_3:104;
A5: m + 1 = (len w1) + 1 by A3, Def2;
A6: len ((q1t,w1) -response) = len w1 by Def6;
let k be Nat; ::_thesis: ( 1 <= k & k <= len ((q1t,(w1 ^ w2)) -response) implies ((q1t,(w1 ^ w2)) -response) . b1 = (((q1t,w1) -response) ^ ((q2t,w2) -response)) . b1 )
assume that
A7: 1 <= k and
A8: k <= len ((q1t,(w1 ^ w2)) -response) ; ::_thesis: ((q1t,(w1 ^ w2)) -response) . b1 = (((q1t,w1) -response) ^ ((q2t,w2) -response)) . b1
percases ( ( 1 <= k & k <= len ((q1t,w1) -response) ) or ( (len ((q1t,w1) -response)) + 1 <= k & k <= len ((q1t,(w1 ^ w2)) -response) ) ) by A7, A8, NAT_1:13;
supposeA9: ( 1 <= k & k <= len ((q1t,w1) -response) ) ; ::_thesis: ((q1t,(w1 ^ w2)) -response) . b1 = (((q1t,w1) -response) ^ ((q2t,w2) -response)) . b1
then A10: k <= len w1 by Def6;
then A11: k in dom w1 by A9, FINSEQ_3:25;
A12: k in dom (Del (((q1t,w1) -admissible),((len w1) + 1))) by A4, A5, A9, A10, FINSEQ_3:25;
A13: k < (len w1) + 1 by A10, NAT_1:13;
A14: k in dom ((q1t,w1) -response) by A9, FINSEQ_3:25;
k <= len (w1 ^ w2) by A8, Def6;
then k in dom (w1 ^ w2) by A7, FINSEQ_3:25;
hence ((q1t,(w1 ^ w2)) -response) . k = the OFun of tfsm . [(((q1t,(w1 ^ w2)) -admissible) . k),((w1 ^ w2) . k)] by Def6
.= the OFun of tfsm . [(((Del (((q1t,w1) -admissible),((len w1) + 1))) ^ ((q2t,w2) -admissible)) . k),((w1 ^ w2) . k)] by A1, Th8
.= the OFun of tfsm . [((Del (((q1t,w1) -admissible),((len w1) + 1))) . k),((w1 ^ w2) . k)] by A12, FINSEQ_1:def_7
.= the OFun of tfsm . [((Del (((q1t,w1) -admissible),((len w1) + 1))) . k),(w1 . k)] by A11, FINSEQ_1:def_7
.= the OFun of tfsm . [(((q1t,w1) -admissible) . k),(w1 . k)] by A13, FINSEQ_3:110
.= ((q1t,w1) -response) . k by A11, Def6
.= (((q1t,w1) -response) ^ ((q2t,w2) -response)) . k by A14, FINSEQ_1:def_7 ;
::_thesis: verum
end;
supposeA15: ( (len ((q1t,w1) -response)) + 1 <= k & k <= len ((q1t,(w1 ^ w2)) -response) ) ; ::_thesis: ((q1t,(w1 ^ w2)) -response) . b1 = (((q1t,w1) -response) ^ ((q2t,w2) -response)) . b1
then A16: ((len ((q1t,w1) -response)) + 1) - (len ((q1t,w1) -response)) <= k - (len ((q1t,w1) -response)) by XREAL_1:9;
then reconsider p = k - (len ((q1t,w1) -response)) as Element of NAT by INT_1:3;
A17: len ((q1t,(w1 ^ w2)) -response) = len (w1 ^ w2) by Def6
.= (len w1) + (len w2) by FINSEQ_1:22 ;
then k <= (len ((q1t,w1) -response)) + (len w2) by A15, Def6;
then k - (len ((q1t,w1) -response)) <= ((len ((q1t,w1) -response)) + (len w2)) - (len ((q1t,w1) -response)) by XREAL_1:9;
then A18: p in dom w2 by A16, FINSEQ_3:25;
A19: (len (Del (((q1t,w1) -admissible),((len w1) + 1)))) + 1 <= k by A4, A5, A15, Def6;
A20: (len w1) + 1 <= k by A15, Def6;
A21: len ((q1t,(w1 ^ w2)) -response) = len (w1 ^ w2) by Def6
.= (len w1) + (len w2) by FINSEQ_1:22
.= (len ((q1t,w1) -response)) + (len w2) by Def6
.= (len ((q1t,w1) -response)) + (len ((q2t,w2) -response)) by Def6 ;
then A22: (((q1t,w1) -response) ^ ((q2t,w2) -response)) . k = ((q2t,w2) -response) . p by A15, FINSEQ_1:23
.= the OFun of tfsm . [(((q2t,w2) -admissible) . p),(w2 . p)] by A18, Def6
.= the OFun of tfsm . [(((q2t,w2) -admissible) . (k - (len w1))),(w2 . (k - (len ((q1t,w1) -response))))] by Def6
.= the OFun of tfsm . [(((q2t,w2) -admissible) . (k - (len w1))),(w2 . (k - (len w1)))] by Def6 ;
len w2 <= (len w2) + 1 by NAT_1:11;
then A23: (len (Del (((q1t,w1) -admissible),((len w1) + 1)))) + (len w2) <= (len (Del (((q1t,w1) -admissible),((len w1) + 1)))) + ((len w2) + 1) by XREAL_1:6;
k <= (len (Del (((q1t,w1) -admissible),((len w1) + 1)))) + (len w2) by A4, A5, A6, A15, A21, Def6;
then k <= (len (Del (((q1t,w1) -admissible),((len w1) + 1)))) + ((len w2) + 1) by A23, XXREAL_0:2;
then A24: k <= (len (Del (((q1t,w1) -admissible),((len w1) + 1)))) + (len ((q2t,w2) -admissible)) by Def2;
k <= len (w1 ^ w2) by A8, Def6;
then k in dom (w1 ^ w2) by A7, FINSEQ_3:25;
then ((q1t,(w1 ^ w2)) -response) . k = the OFun of tfsm . [(((q1t,(w1 ^ w2)) -admissible) . k),((w1 ^ w2) . k)] by Def6
.= the OFun of tfsm . [(((Del (((q1t,w1) -admissible),((len w1) + 1))) ^ ((q2t,w2) -admissible)) . k),((w1 ^ w2) . k)] by A1, Th8
.= the OFun of tfsm . [(((q2t,w2) -admissible) . (k - (len (Del (((q1t,w1) -admissible),((len w1) + 1)))))),((w1 ^ w2) . k)] by A19, A24, FINSEQ_1:23
.= the OFun of tfsm . [(((q2t,w2) -admissible) . (k - (len w1))),(w2 . (k - (len w1)))] by A4, A5, A15, A17, A20, FINSEQ_1:23 ;
hence ((q1t,(w1 ^ w2)) -response) . k = (((q1t,w1) -response) ^ ((q2t,w2) -response)) . k by A22; ::_thesis: verum
end;
end;
end;
len ((q1t,(w1 ^ w2)) -response) = len (w1 ^ w2) by Def6
.= (len w1) + (len w2) by FINSEQ_1:22
.= (len ((q1t,w1) -response)) + (len w2) by Def6
.= (len ((q1t,w1) -response)) + (len ((q2t,w2) -response)) by Def6
.= len (((q1t,w1) -response) ^ ((q2t,w2) -response)) by FINSEQ_1:22 ;
hence (q1t,(w1 ^ w2)) -response = ((q1t,w1) -response) ^ ((q2t,w2) -response) by A2, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th12: :: FSM_1:12
for IAlph, OAlph being non empty set
for w1, w2 being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11, q12 being State of tfsm1
for q21, q22 being State of tfsm2 st q11,w1 -leads_to q12 & q21,w1 -leads_to q22 & (q12,w2) -response <> (q22,w2) -response holds
(q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w1, w2 being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11, q12 being State of tfsm1
for q21, q22 being State of tfsm2 st q11,w1 -leads_to q12 & q21,w1 -leads_to q22 & (q12,w2) -response <> (q22,w2) -response holds
(q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response
let w1, w2 be FinSequence of IAlph; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11, q12 being State of tfsm1
for q21, q22 being State of tfsm2 st q11,w1 -leads_to q12 & q21,w1 -leads_to q22 & (q12,w2) -response <> (q22,w2) -response holds
(q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q11, q12 being State of tfsm1
for q21, q22 being State of tfsm2 st q11,w1 -leads_to q12 & q21,w1 -leads_to q22 & (q12,w2) -response <> (q22,w2) -response holds
(q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response
let q11, q12 be State of tfsm1; ::_thesis: for q21, q22 being State of tfsm2 st q11,w1 -leads_to q12 & q21,w1 -leads_to q22 & (q12,w2) -response <> (q22,w2) -response holds
(q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response
let q21, q22 be State of tfsm2; ::_thesis: ( q11,w1 -leads_to q12 & q21,w1 -leads_to q22 & (q12,w2) -response <> (q22,w2) -response implies (q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response )
assume that
A1: q11,w1 -leads_to q12 and
A2: q21,w1 -leads_to q22 and
A3: (q12,w2) -response <> (q22,w2) -response ; ::_thesis: (q11,(w1 ^ w2)) -response <> (q21,(w1 ^ w2)) -response
set r12 = (q12,w2) -response ;
set r22 = (q22,w2) -response ;
A4: len ((q22,w2) -response) = len w2 by Def6;
set w = w1 ^ w2;
set r1w1 = (q11,w1) -response ;
set r2w1 = (q21,w1) -response ;
assume A5: (q11,(w1 ^ w2)) -response = (q21,(w1 ^ w2)) -response ; ::_thesis: contradiction
set r21 = (q21,(w1 ^ w2)) -response ;
A6: (q21,(w1 ^ w2)) -response = ((q21,w1) -response) ^ ((q22,w2) -response) by A2, Th11;
set r11 = (q11,(w1 ^ w2)) -response ;
A7: (q11,(w1 ^ w2)) -response = ((q11,w1) -response) ^ ((q12,w2) -response) by A1, Th11;
A8: len ((q11,w1) -response) = len w1 by Def6;
A9: len ((q12,w2) -response) = len w2 by Def6;
then A10: dom w2 = Seg (len ((q12,w2) -response)) by FINSEQ_1:def_3;
then dom w2 = dom ((q12,w2) -response) by FINSEQ_1:def_3;
then consider j being Nat such that
A11: j in dom w2 and
A12: ((q12,w2) -response) . j <> ((q22,w2) -response) . j by A3, A9, A4, FINSEQ_2:9;
A13: len ((q21,w1) -response) = len w1 by Def6;
j in dom ((q12,w2) -response) by A10, A11, FINSEQ_1:def_3;
then A14: ((q11,(w1 ^ w2)) -response) . ((len w1) + j) = ((q12,w2) -response) . j by A8, A7, FINSEQ_1:def_7;
j in dom ((q22,w2) -response) by A9, A4, A10, A11, FINSEQ_1:def_3;
hence contradiction by A5, A13, A12, A6, A14, FINSEQ_1:def_7; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let sfsm be non empty Moore-FSM over IAlph,OAlph;
predtfsm is_similar_to sfsm means :: FSM_1:def 8
for tw being FinSequence of IAlph holds <*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response) = ( the InitS of sfsm,tw) -response ;
end;
:: deftheorem defines is_similar_to FSM_1:def_8_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for sfsm being non empty Moore-FSM over IAlph,OAlph holds
( tfsm is_similar_to sfsm iff for tw being FinSequence of IAlph holds <*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response) = ( the InitS of sfsm,tw) -response );
theorem :: FSM_1:13
for IAlph, OAlph being non empty set
for sfsm being non empty finite Moore-FSM over IAlph,OAlph ex tfsm being non empty finite Mealy-FSM over IAlph,OAlph st tfsm is_similar_to sfsm
proof
let IAlph, OAlph be non empty set ; ::_thesis: for sfsm being non empty finite Moore-FSM over IAlph,OAlph ex tfsm being non empty finite Mealy-FSM over IAlph,OAlph st tfsm is_similar_to sfsm
let sfsm be non empty finite Moore-FSM over IAlph,OAlph; ::_thesis: ex tfsm being non empty finite Mealy-FSM over IAlph,OAlph st tfsm is_similar_to sfsm
set S = the carrier of sfsm;
set T = the Tran of sfsm;
set sOF = the OFun of sfsm;
set IS = the InitS of sfsm;
deffunc H1( Element of the carrier of sfsm, Element of IAlph) -> Element of OAlph = the OFun of sfsm . ( the Tran of sfsm . [$1,$2]);
consider tOF being Function of [: the carrier of sfsm,IAlph:],OAlph such that
A1: for q being Element of the carrier of sfsm
for s being Element of IAlph holds tOF . (q,s) = H1(q,s) from BINOP_1:sch_4();
take tfsm = Mealy-FSM(# the carrier of sfsm, the Tran of sfsm,tOF, the InitS of sfsm #); ::_thesis: tfsm is_similar_to sfsm
let tw be FinSequence of IAlph; :: according to FSM_1:def_8 ::_thesis: <*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response) = ( the InitS of sfsm,tw) -response
set tIS = the InitS of tfsm;
set twa = ( the InitS of tfsm,tw) -admissible ;
set swa = ( the InitS of sfsm,tw) -admissible ;
defpred S1[ Element of NAT ] means ( $1 in Seg ((len tw) + 1) implies (( the InitS of tfsm,tw) -admissible) . $1 = (( the InitS of sfsm,tw) -admissible) . $1 );
A2: for i being Element of NAT st S1[i] holds
S1[i + 1]
proof
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A3: ( i in Seg ((len tw) + 1) implies (( the InitS of tfsm,tw) -admissible) . i = (( the InitS of sfsm,tw) -admissible) . i ) ; ::_thesis: S1[i + 1]
assume i + 1 in Seg ((len tw) + 1) ; ::_thesis: (( the InitS of tfsm,tw) -admissible) . (i + 1) = (( the InitS of sfsm,tw) -admissible) . (i + 1)
then A4: i + 1 <= (len tw) + 1 by FINSEQ_1:1;
percases ( i = 0 or ( i > 0 & i <= len tw ) ) by A4, XREAL_1:6;
supposeA5: i = 0 ; ::_thesis: (( the InitS of tfsm,tw) -admissible) . (i + 1) = (( the InitS of sfsm,tw) -admissible) . (i + 1)
(( the InitS of tfsm,tw) -admissible) . 1 = the InitS of tfsm by Def2;
hence (( the InitS of tfsm,tw) -admissible) . (i + 1) = (( the InitS of sfsm,tw) -admissible) . (i + 1) by A5, Def2; ::_thesis: verum
end;
supposeA6: ( i > 0 & i <= len tw ) ; ::_thesis: (( the InitS of tfsm,tw) -admissible) . (i + 1) = (( the InitS of sfsm,tw) -admissible) . (i + 1)
then A7: i <= (len tw) + 1 by NAT_1:13;
A8: ( 0 + 1 = 1 implies ( 1 <= i & i <= len tw ) ) by A6, NAT_1:13;
then ( ex twi being Element of IAlph ex tqi, tqi1 being Element of tfsm st
( twi = tw . i & tqi = (( the InitS of tfsm,tw) -admissible) . i & tqi1 = (( the InitS of tfsm,tw) -admissible) . (i + 1) & twi -succ_of tqi = tqi1 ) & ex swi being Element of IAlph ex sqi, sqi1 being Element of sfsm st
( swi = tw . i & sqi = (( the InitS of sfsm,tw) -admissible) . i & sqi1 = (( the InitS of sfsm,tw) -admissible) . (i + 1) & swi -succ_of sqi = sqi1 ) ) by Def2;
hence (( the InitS of tfsm,tw) -admissible) . (i + 1) = (( the InitS of sfsm,tw) -admissible) . (i + 1) by A3, A8, A7, FINSEQ_1:1; ::_thesis: verum
end;
end;
end;
A9: S1[ 0 ] by FINSEQ_1:1;
A10: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A9, A2);
now__::_thesis:_(_len_(<*(_the_OFun_of_sfsm_._the_InitS_of_sfsm)*>_^_((_the_InitS_of_tfsm,tw)_-response))_=_(len_tw)_+_1_&_len_((_the_InitS_of_sfsm,tw)_-response)_=_(len_tw)_+_1_&_(_for_i_being_Nat_st_i_in_dom_(<*(_the_OFun_of_sfsm_._the_InitS_of_sfsm)*>_^_((_the_InitS_of_tfsm,tw)_-response))_holds_
(<*(_the_OFun_of_sfsm_._the_InitS_of_sfsm)*>_^_((_the_InitS_of_tfsm,tw)_-response))_._i_=_((_the_InitS_of_sfsm,tw)_-response)_._i_)_)
thus len (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) = (len <*( the OFun of sfsm . the InitS of sfsm)*>) + (len (( the InitS of tfsm,tw) -response)) by FINSEQ_1:22
.= 1 + (len (( the InitS of tfsm,tw) -response)) by FINSEQ_1:40
.= (len tw) + 1 by Def6 ; ::_thesis: ( len (( the InitS of sfsm,tw) -response) = (len tw) + 1 & ( for i being Nat st i in dom (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) holds
(<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . b2 = (( the InitS of sfsm,tw) -response) . b2 ) )
then A11: dom (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) = Seg ((len tw) + 1) by FINSEQ_1:def_3;
thus len (( the InitS of sfsm,tw) -response) = (len tw) + 1 by Def7; ::_thesis: for i being Nat st i in dom (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) holds
(<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . b2 = (( the InitS of sfsm,tw) -response) . b2
let i be Nat; ::_thesis: ( i in dom (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) implies (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . b1 = (( the InitS of sfsm,tw) -response) . b1 )
assume A12: i in dom (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) ; ::_thesis: (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . b1 = (( the InitS of sfsm,tw) -response) . b1
then A13: 1 <= i by A11, FINSEQ_1:1;
A14: i <= (len tw) + 1 by A11, A12, FINSEQ_1:1;
percases ( i = 1 or 1 < i ) by A13, XXREAL_0:1;
supposeA15: i = 1 ; ::_thesis: (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . b1 = (( the InitS of sfsm,tw) -response) . b1
then i in Seg 1 by FINSEQ_1:2, TARSKI:def_1;
then i in dom <*( the OFun of sfsm . the InitS of sfsm)*> by FINSEQ_1:38;
hence (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . i = <*( the OFun of sfsm . the InitS of sfsm)*> . i by FINSEQ_1:def_7
.= the OFun of sfsm . the InitS of sfsm by A15, FINSEQ_1:40
.= (( the InitS of sfsm,tw) -response) . i by A15, Th10 ;
::_thesis: verum
end;
suppose 1 < i ; ::_thesis: (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . b1 = (( the InitS of sfsm,tw) -response) . b1
then consider j being Element of NAT such that
A16: j = i - 1 and
A17: 1 <= j by INT_1:51;
A18: i = j + 1 by A16;
then A19: j <= len tw by A14, XREAL_1:6;
then consider swj being Element of IAlph, swaj, swai being Element of sfsm such that
A20: ( swj = tw . j & swaj = (( the InitS of sfsm,tw) -admissible) . j ) and
A21: ( swai = (( the InitS of sfsm,tw) -admissible) . (j + 1) & swj -succ_of swaj = swai ) by A17, Def2;
A22: j in Seg (len tw) by A17, A19, FINSEQ_1:1;
then A23: j in dom tw by FINSEQ_1:def_3;
j <= (len tw) + 1 by A19, NAT_1:12;
then A24: j in Seg ((len tw) + 1) by A17, FINSEQ_1:1;
len (( the InitS of tfsm,tw) -response) = len tw by Def6;
then ( len <*( the OFun of sfsm . the InitS of sfsm)*> = 1 & j in dom (( the InitS of tfsm,tw) -response) ) by A22, FINSEQ_1:40, FINSEQ_1:def_3;
then (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . i = (( the InitS of tfsm,tw) -response) . j by A18, FINSEQ_1:def_7
.= the OFun of tfsm . [((( the InitS of tfsm,tw) -admissible) . j),(tw . j)] by A23, Def6
.= tOF . (((( the InitS of sfsm,tw) -admissible) . j),(tw . j)) by A10, A24
.= the OFun of sfsm . ( the Tran of sfsm . (swaj,swj)) by A1, A20
.= (( the InitS of sfsm,tw) -response) . i by A11, A12, A16, A21, Def7 ;
hence (<*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response)) . i = (( the InitS of sfsm,tw) -response) . i ; ::_thesis: verum
end;
end;
end;
hence <*( the OFun of sfsm . the InitS of sfsm)*> ^ (( the InitS of tfsm,tw) -response) = ( the InitS of sfsm,tw) -response by FINSEQ_2:9; ::_thesis: verum
end;
theorem :: FSM_1:14
for IAlph being non empty set
for OAlphf being non empty finite set
for tfsmf being non empty finite Mealy-FSM over IAlph,OAlphf ex sfsmf being non empty finite Moore-FSM over IAlph,OAlphf st tfsmf is_similar_to sfsmf
proof
let IAlph be non empty set ; ::_thesis: for OAlphf being non empty finite set
for tfsmf being non empty finite Mealy-FSM over IAlph,OAlphf ex sfsmf being non empty finite Moore-FSM over IAlph,OAlphf st tfsmf is_similar_to sfsmf
let OAlphf be non empty finite set ; ::_thesis: for tfsmf being non empty finite Mealy-FSM over IAlph,OAlphf ex sfsmf being non empty finite Moore-FSM over IAlph,OAlphf st tfsmf is_similar_to sfsmf
let tfsmf be non empty finite Mealy-FSM over IAlph,OAlphf; ::_thesis: ex sfsmf being non empty finite Moore-FSM over IAlph,OAlphf st tfsmf is_similar_to sfsmf
set S = the carrier of tfsmf;
set T = the Tran of tfsmf;
set tOF = the OFun of tfsmf;
set IS = the InitS of tfsmf;
set sS = [: the carrier of tfsmf,OAlphf:];
deffunc H1( Element of [: the carrier of tfsmf,OAlphf:], Element of IAlph) -> Element of [: the carrier of tfsmf,OAlphf:] = [( the Tran of tfsmf . [($1 `1),$2]),( the OFun of tfsmf . [($1 `1),$2])];
consider sT being Function of [:[: the carrier of tfsmf,OAlphf:],IAlph:],[: the carrier of tfsmf,OAlphf:] such that
A1: for q being Element of [: the carrier of tfsmf,OAlphf:]
for s being Element of IAlph holds sT . (q,s) = H1(q,s) from BINOP_1:sch_4();
set sSs = [: the carrier of tfsmf,OAlphf:];
set sTs = sT;
set r0 = the Element of OAlphf;
deffunc H2( Element of the carrier of tfsmf, Element of OAlphf) -> Element of OAlphf = $2;
consider sOF being Function of [: the carrier of tfsmf,OAlphf:],OAlphf such that
A2: for q being Element of the carrier of tfsmf
for r being Element of OAlphf holds sOF . (q,r) = H2(q,r) from BINOP_1:sch_4();
set sI = [ the InitS of tfsmf, the Element of OAlphf];
reconsider sOFs = sOF as Function of [: the carrier of tfsmf,OAlphf:],OAlphf ;
reconsider sfsmf = Moore-FSM(# [: the carrier of tfsmf,OAlphf:],sT,sOFs,[ the InitS of tfsmf, the Element of OAlphf] #) as non empty finite Moore-FSM over IAlph,OAlphf ;
take sfsmf ; ::_thesis: tfsmf is_similar_to sfsmf
reconsider SI = [ the InitS of tfsmf, the Element of OAlphf] as Element of sfsmf ;
thus tfsmf is_similar_to sfsmf ::_thesis: verum
proof
let tw be FinSequence of IAlph; :: according to FSM_1:def_8 ::_thesis: <*( the OFun of sfsmf . the InitS of sfsmf)*> ^ (( the InitS of tfsmf,tw) -response) = ( the InitS of sfsmf,tw) -response
set twa = ( the InitS of tfsmf,tw) -admissible ;
set swa = ( the InitS of sfsmf,tw) -admissible ;
defpred S1[ Element of NAT ] means ( $1 in Seg ((len tw) + 1) implies (( the InitS of tfsmf,tw) -admissible) . $1 = ((( the InitS of sfsmf,tw) -admissible) . $1) `1 );
A3: for i being Element of NAT st S1[i] holds
S1[i + 1]
proof
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
assume A4: S1[i] ; ::_thesis: S1[i + 1]
assume i + 1 in Seg ((len tw) + 1) ; ::_thesis: (( the InitS of tfsmf,tw) -admissible) . (i + 1) = ((( the InitS of sfsmf,tw) -admissible) . (i + 1)) `1
then A5: i + 1 <= (len tw) + 1 by FINSEQ_1:1;
percases ( i = 0 or ( i > 0 & i <= len tw ) ) by A5, XREAL_1:6;
supposeA6: i = 0 ; ::_thesis: (( the InitS of tfsmf,tw) -admissible) . (i + 1) = ((( the InitS of sfsmf,tw) -admissible) . (i + 1)) `1
(( the InitS of tfsmf,tw) -admissible) . 1 = the InitS of tfsmf by Def2
.= [ the InitS of tfsmf, the Element of OAlphf] `1
.= ((( the InitS of sfsmf,tw) -admissible) . 1) `1 by Def2 ;
hence (( the InitS of tfsmf,tw) -admissible) . (i + 1) = ((( the InitS of sfsmf,tw) -admissible) . (i + 1)) `1 by A6; ::_thesis: verum
end;
supposeA7: ( i > 0 & i <= len tw ) ; ::_thesis: (( the InitS of tfsmf,tw) -admissible) . (i + 1) = ((( the InitS of sfsmf,tw) -admissible) . (i + 1)) `1
then A8: i <= (len tw) + 1 by NAT_1:13;
A9: ( 0 + 1 = 1 implies ( 1 <= i & i <= len tw ) ) by A7, NAT_1:13;
then A10: ex twi being Element of IAlph ex tqi, tqi1 being Element of tfsmf st
( twi = tw . i & tqi = (( the InitS of tfsmf,tw) -admissible) . i & tqi1 = (( the InitS of tfsmf,tw) -admissible) . (i + 1) & twi -succ_of tqi = tqi1 ) by Def2;
consider swi being Element of IAlph, sqi, sqi1 being Element of sfsmf such that
A11: ( swi = tw . i & sqi = (( the InitS of sfsmf,tw) -admissible) . i & sqi1 = (( the InitS of sfsmf,tw) -admissible) . (i + 1) ) and
A12: swi -succ_of sqi = sqi1 by A9, Def2;
A13: [( the Tran of tfsmf . [(sqi `1),swi]),( the OFun of tfsmf . [(sqi `1),swi])] `1 = the Tran of tfsmf . [(sqi `1),swi] ;
sqi1 = sT . (sqi,swi) by A12
.= [( the Tran of tfsmf . [(sqi `1),swi]),( the OFun of tfsmf . [(sqi `1),swi])] by A1 ;
hence (( the InitS of tfsmf,tw) -admissible) . (i + 1) = ((( the InitS of sfsmf,tw) -admissible) . (i + 1)) `1 by A4, A9, A8, A10, A11, FINSEQ_1:1, A13; ::_thesis: verum
end;
end;
end;
A14: S1[ 0 ] by FINSEQ_1:1;
A15: for i being Element of NAT holds S1[i] from NAT_1:sch_1(A14, A3);
now__::_thesis:_(_len_(<*(sOF_._[_the_InitS_of_tfsmf,_the_Element_of_OAlphf])*>_^_((_the_InitS_of_tfsmf,tw)_-response))_=_(len_tw)_+_1_&_len_((SI,tw)_-response)_=_(len_tw)_+_1_&_(_for_i_being_Nat_st_i_in_dom_(<*(sOF_._[_the_InitS_of_tfsmf,_the_Element_of_OAlphf])*>_^_((_the_InitS_of_tfsmf,tw)_-response))_holds_
(<*(sOF_._[_the_InitS_of_tfsmf,_the_Element_of_OAlphf])*>_^_((_the_InitS_of_tfsmf,tw)_-response))_._i_=_((SI,tw)_-response)_._i_)_)
thus len (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) = (len <*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*>) + (len (( the InitS of tfsmf,tw) -response)) by FINSEQ_1:22
.= 1 + (len (( the InitS of tfsmf,tw) -response)) by FINSEQ_1:40
.= (len tw) + 1 by Def6 ; ::_thesis: ( len ((SI,tw) -response) = (len tw) + 1 & ( for i being Nat st i in dom (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) holds
(<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . b2 = ((SI,tw) -response) . b2 ) )
then A16: dom (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) = Seg ((len tw) + 1) by FINSEQ_1:def_3;
thus len ((SI,tw) -response) = (len tw) + 1 by Def7; ::_thesis: for i being Nat st i in dom (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) holds
(<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . b2 = ((SI,tw) -response) . b2
let i be Nat; ::_thesis: ( i in dom (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) implies (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . b1 = ((SI,tw) -response) . b1 )
assume A17: i in dom (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) ; ::_thesis: (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . b1 = ((SI,tw) -response) . b1
then A18: 1 <= i by A16, FINSEQ_1:1;
A19: i <= (len tw) + 1 by A16, A17, FINSEQ_1:1;
percases ( i = 1 or 1 < i ) by A18, XXREAL_0:1;
supposeA20: i = 1 ; ::_thesis: (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . b1 = ((SI,tw) -response) . b1
then i in Seg 1 by FINSEQ_1:2, TARSKI:def_1;
then i in dom <*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> by FINSEQ_1:38;
hence (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . i = <*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> . i by FINSEQ_1:def_7
.= sOF . [ the InitS of tfsmf, the Element of OAlphf] by A20, FINSEQ_1:40
.= ((SI,tw) -response) . i by A20, Th10 ;
::_thesis: verum
end;
suppose 1 < i ; ::_thesis: (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . b1 = ((SI,tw) -response) . b1
then consider j being Element of NAT such that
A21: j = i - 1 and
A22: 1 <= j by INT_1:51;
A23: i = j + 1 by A21;
then A24: j <= len tw by A19, XREAL_1:6;
then consider swj being Element of IAlph, swaj, swai being Element of sfsmf such that
A25: swj = tw . j and
A26: swaj = (( the InitS of sfsmf,tw) -admissible) . j and
A27: ( swai = (( the InitS of sfsmf,tw) -admissible) . (j + 1) & swj -succ_of swaj = swai ) by A22, Def2;
j <= (len tw) + 1 by A24, NAT_1:12;
then A28: j in Seg ((len tw) + 1) by A22, FINSEQ_1:1;
reconsider swaj = swaj as Element of [: the carrier of tfsmf,OAlphf:] ;
A29: j in Seg (len tw) by A22, A24, FINSEQ_1:1;
then A30: j in dom tw by FINSEQ_1:def_3;
len (( the InitS of tfsmf,tw) -response) = len tw by Def6;
then ( len <*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> = 1 & j in dom (( the InitS of tfsmf,tw) -response) ) by A29, FINSEQ_1:40, FINSEQ_1:def_3;
hence (<*(sOF . [ the InitS of tfsmf, the Element of OAlphf])*> ^ (( the InitS of tfsmf,tw) -response)) . i = (( the InitS of tfsmf,tw) -response) . j by A23, FINSEQ_1:def_7
.= the OFun of tfsmf . (((( the InitS of tfsmf,tw) -admissible) . j),(tw . j)) by A30, Def6
.= the OFun of tfsmf . ((swaj `1),(tw . j)) by A15, A28, A26
.= sOF . (( the Tran of tfsmf . ((swaj `1),swj)),( the OFun of tfsmf . ((swaj `1),swj))) by A2, A25
.= sOF . (sT . (swaj,swj)) by A1
.= ((SI,tw) -response) . i by A16, A17, A21, A27, Def7 ;
::_thesis: verum
end;
end;
end;
hence <*( the OFun of sfsmf . the InitS of sfsmf)*> ^ (( the InitS of tfsmf,tw) -response) = ( the InitS of sfsmf,tw) -response by FINSEQ_2:9; ::_thesis: verum
end;
end;
begin
definition
let IAlph, OAlph be non empty set ;
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph;
predtfsm1,tfsm2 -are_equivalent means :Def9: :: FSM_1:def 9
for w being FinSequence of IAlph holds ( the InitS of tfsm1,w) -response = ( the InitS of tfsm2,w) -response ;
reflexivity
for tfsm1 being non empty Mealy-FSM over IAlph,OAlph
for w being FinSequence of IAlph holds ( the InitS of tfsm1,w) -response = ( the InitS of tfsm1,w) -response ;
symmetry
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph st ( for w being FinSequence of IAlph holds ( the InitS of tfsm1,w) -response = ( the InitS of tfsm2,w) -response ) holds
for w being FinSequence of IAlph holds ( the InitS of tfsm2,w) -response = ( the InitS of tfsm1,w) -response ;
end;
:: deftheorem Def9 defines -are_equivalent FSM_1:def_9_:_
for IAlph, OAlph being non empty set
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph holds
( tfsm1,tfsm2 -are_equivalent iff for w being FinSequence of IAlph holds ( the InitS of tfsm1,w) -response = ( the InitS of tfsm2,w) -response );
theorem Th15: :: FSM_1:15
for IAlph, OAlph being non empty set
for tfsm1, tfsm2, tfsm3 being non empty Mealy-FSM over IAlph,OAlph st tfsm1,tfsm2 -are_equivalent & tfsm2,tfsm3 -are_equivalent holds
tfsm1,tfsm3 -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm1, tfsm2, tfsm3 being non empty Mealy-FSM over IAlph,OAlph st tfsm1,tfsm2 -are_equivalent & tfsm2,tfsm3 -are_equivalent holds
tfsm1,tfsm3 -are_equivalent
let tfsm1, tfsm2, tfsm3 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( tfsm1,tfsm2 -are_equivalent & tfsm2,tfsm3 -are_equivalent implies tfsm1,tfsm3 -are_equivalent )
assume that
A1: tfsm1,tfsm2 -are_equivalent and
A2: tfsm2,tfsm3 -are_equivalent ; ::_thesis: tfsm1,tfsm3 -are_equivalent
let w1 be FinSequence of IAlph; :: according to FSM_1:def_9 ::_thesis: ( the InitS of tfsm1,w1) -response = ( the InitS of tfsm3,w1) -response
set IS3 = the InitS of tfsm3;
set IS1 = the InitS of tfsm1;
set IS2 = the InitS of tfsm2;
thus ( the InitS of tfsm1,w1) -response = ( the InitS of tfsm2,w1) -response by A1, Def9
.= ( the InitS of tfsm3,w1) -response by A2, Def9 ; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let qa, qb be State of tfsm;
predqa,qb -are_equivalent means :Def10: :: FSM_1:def 10
for w being FinSequence of IAlph holds (qa,w) -response = (qb,w) -response ;
reflexivity
for qa being State of tfsm
for w being FinSequence of IAlph holds (qa,w) -response = (qa,w) -response ;
symmetry
for qa, qb being State of tfsm st ( for w being FinSequence of IAlph holds (qa,w) -response = (qb,w) -response ) holds
for w being FinSequence of IAlph holds (qb,w) -response = (qa,w) -response ;
end;
:: deftheorem Def10 defines -are_equivalent FSM_1:def_10_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm holds
( qa,qb -are_equivalent iff for w being FinSequence of IAlph holds (qa,w) -response = (qb,w) -response );
theorem :: FSM_1:16
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q1, q2, q3 being State of tfsm st q1,q2 -are_equivalent & q2,q3 -are_equivalent holds
q1,q3 -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q1, q2, q3 being State of tfsm st q1,q2 -are_equivalent & q2,q3 -are_equivalent holds
q1,q3 -are_equivalent
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q1, q2, q3 being State of tfsm st q1,q2 -are_equivalent & q2,q3 -are_equivalent holds
q1,q3 -are_equivalent
let q1, q2, q3 be State of tfsm; ::_thesis: ( q1,q2 -are_equivalent & q2,q3 -are_equivalent implies q1,q3 -are_equivalent )
assume that
A1: q1,q2 -are_equivalent and
A2: q2,q3 -are_equivalent ; ::_thesis: q1,q3 -are_equivalent
thus q1,q3 -are_equivalent ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_10 ::_thesis: (q1,w) -response = (q3,w) -response
(q1,w) -response = (q2,w) -response by A1, Def10;
hence (q1,w) -response = (q3,w) -response by A2, Def10; ::_thesis: verum
end;
end;
theorem Th17: :: FSM_1:17
for IAlph, OAlph being non empty set
for s being Element of IAlph
for w being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i
proof
let IAlph, OAlph be non empty set ; ::_thesis: for s being Element of IAlph
for w being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i
let s be Element of IAlph; ::_thesis: for w being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i
let w be FinSequence of IAlph; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i
let qa9, qa be State of tfsm; ::_thesis: ( qa9 = the Tran of tfsm . [qa,s] implies for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i )
set sw = <*s*> ^ w;
A1: len (<*s*> ^ w) = (len <*s*>) + (len w) by FINSEQ_1:22
.= (len w) + 1 by FINSEQ_1:40 ;
defpred S1[ Element of NAT ] means ( $1 in Seg ((len w) + 1) implies ((qa,(<*s*> ^ w)) -admissible) . ($1 + 1) = ((qa9,w) -admissible) . $1 );
A2: (<*s*> ^ w) . 1 = s by FINSEQ_1:41;
assume A3: qa9 = the Tran of tfsm . [qa,s] ; ::_thesis: for i being Element of NAT st i in Seg ((len w) + 1) holds
((qa,(<*s*> ^ w)) -admissible) . (i + 1) = ((qa9,w) -admissible) . i
A4: for j being Element of NAT st S1[j] holds
S1[j + 1]
proof
let j be Element of NAT ; ::_thesis: ( S1[j] implies S1[j + 1] )
assume A5: ( j in Seg ((len w) + 1) implies ((qa,(<*s*> ^ w)) -admissible) . (j + 1) = ((qa9,w) -admissible) . j ) ; ::_thesis: S1[j + 1]
assume A6: j + 1 in Seg ((len w) + 1) ; ::_thesis: ((qa,(<*s*> ^ w)) -admissible) . ((j + 1) + 1) = ((qa9,w) -admissible) . (j + 1)
percases ( j = 0 or j <> 0 ) ;
supposeA7: j = 0 ; ::_thesis: ((qa,(<*s*> ^ w)) -admissible) . ((j + 1) + 1) = ((qa9,w) -admissible) . (j + 1)
set aadm = (qa,(<*s*> ^ w)) -admissible ;
1 <= len (<*s*> ^ w) by A1, A6, A7, FINSEQ_1:1;
then A8: ex swi1 being Element of IAlph ex a1, a11 being Element of tfsm st
( swi1 = (<*s*> ^ w) . 1 & a1 = ((qa,(<*s*> ^ w)) -admissible) . 1 & a11 = ((qa,(<*s*> ^ w)) -admissible) . (1 + 1) & swi1 -succ_of a1 = a11 ) by Def2;
((qa9,w) -admissible) . 1 = qa9 by Def2;
hence ((qa,(<*s*> ^ w)) -admissible) . ((j + 1) + 1) = ((qa9,w) -admissible) . (j + 1) by A3, A2, A7, A8, Def2; ::_thesis: verum
end;
supposeA9: j <> 0 ; ::_thesis: ((qa,(<*s*> ^ w)) -admissible) . ((j + 1) + 1) = ((qa9,w) -admissible) . (j + 1)
set aadm = (qa,(<*s*> ^ w)) -admissible ;
set aadm9 = (qa9,w) -admissible ;
A10: j in Seg (len w) by A6, A9, FINSEQ_1:61;
then A11: j <= len w by FINSEQ_1:1;
then ( 1 <= j + 1 & j + 1 <= len (<*s*> ^ w) ) by A1, NAT_1:12, XREAL_1:7;
then A12: ex swj1 being Element of IAlph ex aj1, aj11 being Element of tfsm st
( swj1 = (<*s*> ^ w) . (j + 1) & aj1 = ((qa,(<*s*> ^ w)) -admissible) . (j + 1) & aj11 = ((qa,(<*s*> ^ w)) -admissible) . ((j + 1) + 1) & swj1 -succ_of aj1 = aj11 ) by Def2;
1 <= j by A10, FINSEQ_1:1;
then A13: ex wj being Element of IAlph ex aj9, aj19 being Element of tfsm st
( wj = w . j & aj9 = ((qa9,w) -admissible) . j & aj19 = ((qa9,w) -admissible) . (j + 1) & wj -succ_of aj9 = aj19 ) by A11, Def2;
j in dom w by A10, FINSEQ_1:def_3;
hence ((qa,(<*s*> ^ w)) -admissible) . ((j + 1) + 1) = ((qa9,w) -admissible) . (j + 1) by A5, A6, A9, A12, A13, FINSEQ_1:61, FINSEQ_3:103; ::_thesis: verum
end;
end;
end;
A14: S1[ 0 ] by FINSEQ_1:1;
thus for i being Element of NAT holds S1[i] from NAT_1:sch_1(A14, A4); ::_thesis: verum
end;
theorem Th18: :: FSM_1:18
for IAlph, OAlph being non empty set
for s being Element of IAlph
for w being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
(qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)
proof
let IAlph, OAlph be non empty set ; ::_thesis: for s being Element of IAlph
for w being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
(qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)
let s be Element of IAlph; ::_thesis: for w being FinSequence of IAlph
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
(qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)
let w be FinSequence of IAlph; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
(qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa9, qa being State of tfsm st qa9 = the Tran of tfsm . [qa,s] holds
(qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)
let qa9, qa be State of tfsm; ::_thesis: ( qa9 = the Tran of tfsm . [qa,s] implies (qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response) )
set OF = the OFun of tfsm;
set asresp = the OFun of tfsm . [qa,s];
A1: len (<*s*> ^ w) = (len <*s*>) + (len w) by FINSEQ_1:22
.= 1 + (len w) by FINSEQ_1:40 ;
assume A2: qa9 = the Tran of tfsm . [qa,s] ; ::_thesis: (qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)
now__::_thesis:_(_len_((qa,(<*s*>_^_w))_-response)_=_1_+_(len_w)_&_len_(<*(_the_OFun_of_tfsm_._[qa,s])*>_^_((qa9,w)_-response))_=_1_+_(len_w)_&_(_for_j_being_Nat_st_j_in_dom_((qa,(<*s*>_^_w))_-response)_holds_
((qa,(<*s*>_^_w))_-response)_._j_=_(<*(_the_OFun_of_tfsm_._[qa,s])*>_^_((qa9,w)_-response))_._j_)_)
thus len ((qa,(<*s*> ^ w)) -response) = 1 + (len w) by A1, Def6; ::_thesis: ( len (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) = 1 + (len w) & ( for j being Nat st j in dom ((qa,(<*s*> ^ w)) -response) holds
((qa,(<*s*> ^ w)) -response) . b2 = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . b2 ) )
then A3: dom ((qa,(<*s*> ^ w)) -response) = Seg (1 + (len w)) by FINSEQ_1:def_3;
thus A4: len (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) = (len <*( the OFun of tfsm . [qa,s])*>) + (len ((qa9,w) -response)) by FINSEQ_1:22
.= 1 + (len ((qa9,w) -response)) by FINSEQ_1:40
.= 1 + (len w) by Def6 ; ::_thesis: for j being Nat st j in dom ((qa,(<*s*> ^ w)) -response) holds
((qa,(<*s*> ^ w)) -response) . b2 = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . b2
let j be Nat; ::_thesis: ( j in dom ((qa,(<*s*> ^ w)) -response) implies ((qa,(<*s*> ^ w)) -response) . b1 = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . b1 )
assume A5: j in dom ((qa,(<*s*> ^ w)) -response) ; ::_thesis: ((qa,(<*s*> ^ w)) -response) . b1 = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . b1
then A6: 1 <= j by A3, FINSEQ_1:1;
A7: j <= 1 + (len w) by A3, A5, FINSEQ_1:1;
A8: j in dom (<*s*> ^ w) by A1, A3, A5, FINSEQ_1:def_3;
percases ( j = 1 or j > 1 ) by A6, XXREAL_0:1;
supposeA9: j = 1 ; ::_thesis: ((qa,(<*s*> ^ w)) -response) . b1 = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . b1
thus ((qa,(<*s*> ^ w)) -response) . j = the OFun of tfsm . [(((qa,(<*s*> ^ w)) -admissible) . j),((<*s*> ^ w) . j)] by A8, Def6
.= the OFun of tfsm . [qa,((<*s*> ^ w) . j)] by A9, Def2
.= the OFun of tfsm . [qa,s] by A9, FINSEQ_1:41
.= (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . j by A9, FINSEQ_1:41 ; ::_thesis: verum
end;
supposeA10: j > 1 ; ::_thesis: ((qa,(<*s*> ^ w)) -response) . b1 = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . b1
then consider i being Element of NAT such that
A11: i = j - 1 and
A12: 1 <= i by INT_1:51;
j <= (len w) + 1 by A3, A5, FINSEQ_1:1;
then j - 1 <= ((len w) + 1) - 1 by XREAL_1:9;
then A13: i in Seg (len w) by A11, A12, FINSEQ_1:1;
then A14: i in Seg (1 + (len w)) by FINSEQ_2:8;
i + 1 in Seg (1 + (len w)) by A13, FINSEQ_1:60;
then A15: i + 1 in dom (<*s*> ^ w) by A1, FINSEQ_1:def_3;
A16: i in dom w by A13, FINSEQ_1:def_3;
len <*( the OFun of tfsm . [qa,s])*> = 1 by FINSEQ_1:40;
then (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . j = ((qa9,w) -response) . i by A4, A7, A10, A11, FINSEQ_1:24
.= the OFun of tfsm . [(((qa9,w) -admissible) . i),(w . i)] by A16, Def6
.= the OFun of tfsm . [(((qa9,w) -admissible) . i),((<*s*> ^ w) . (i + 1))] by A16, FINSEQ_3:103
.= the OFun of tfsm . [(((qa,(<*s*> ^ w)) -admissible) . (i + 1)),((<*s*> ^ w) . (i + 1))] by A2, A14, Th17
.= ((qa,(<*s*> ^ w)) -response) . j by A11, A15, Def6 ;
hence ((qa,(<*s*> ^ w)) -response) . j = (<*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response)) . j ; ::_thesis: verum
end;
end;
end;
hence (qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((qa9,w) -response) by FINSEQ_2:9; ::_thesis: verum
end;
theorem Th19: :: FSM_1:19
for OAlph, IAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm holds
( qa,qb -are_equivalent iff for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent ) )
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm holds
( qa,qb -are_equivalent iff for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent ) )
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm holds
( qa,qb -are_equivalent iff for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent ) )
let qa, qb be State of tfsm; ::_thesis: ( qa,qb -are_equivalent iff for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent ) )
set OF = the OFun of tfsm;
hereby ::_thesis: ( ( for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent ) ) implies qa,qb -are_equivalent )
assume A1: qa,qb -are_equivalent ; ::_thesis: for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent )
let s be Element of IAlph; ::_thesis: ( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent )
set qa9 = the Tran of tfsm . [qa,s];
set qb9 = the Tran of tfsm . [qb,s];
len <*s*> = 1 by FINSEQ_1:40;
then A2: 1 in dom <*s*> by FINSEQ_3:25;
thus A3: the OFun of tfsm . [qa,s] = the OFun of tfsm . [(((qa,<*s*>) -admissible) . 1),s] by Def2
.= the OFun of tfsm . [(((qa,<*s*>) -admissible) . 1),(<*s*> . 1)] by FINSEQ_1:40
.= ((qa,<*s*>) -response) . 1 by A2, Def6
.= ((qb,<*s*>) -response) . 1 by A1, Def10
.= the OFun of tfsm . [(((qb,<*s*>) -admissible) . 1),(<*s*> . 1)] by A2, Def6
.= the OFun of tfsm . [(((qb,<*s*>) -admissible) . 1),s] by FINSEQ_1:40
.= the OFun of tfsm . [qb,s] by Def2 ; ::_thesis: the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent
now__::_thesis:_for_w_being_FinSequence_of_IAlph_holds_((_the_Tran_of_tfsm_._[qa,s]),w)_-response_=_((_the_Tran_of_tfsm_._[qb,s]),w)_-response
let w be FinSequence of IAlph; ::_thesis: (( the Tran of tfsm . [qa,s]),w) -response = (( the Tran of tfsm . [qb,s]),w) -response
A4: ( (qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((( the Tran of tfsm . [qa,s]),w) -response) & (qb,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qb,s])*> ^ ((( the Tran of tfsm . [qb,s]),w) -response) ) by Th18;
(qa,(<*s*> ^ w)) -response = (qb,(<*s*> ^ w)) -response by A1, Def10;
hence (( the Tran of tfsm . [qa,s]),w) -response = (( the Tran of tfsm . [qb,s]),w) -response by A3, A4, FINSEQ_1:33; ::_thesis: verum
end;
hence the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent by Def10; ::_thesis: verum
end;
assume A5: for s being Element of IAlph holds
( the OFun of tfsm . [qa,s] = the OFun of tfsm . [qb,s] & the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent ) ; ::_thesis: qa,qb -are_equivalent
let w be FinSequence of IAlph; :: according to FSM_1:def_10 ::_thesis: (qa,w) -response = (qb,w) -response
percases ( w = <*> IAlph or w <> {} ) ;
supposeA6: w = <*> IAlph ; ::_thesis: (qa,w) -response = (qb,w) -response
hence (qa,w) -response = <*> OAlph by Th9
.= (qb,w) -response by A6, Th9 ;
::_thesis: verum
end;
suppose w <> {} ; ::_thesis: (qa,w) -response = (qb,w) -response
then consider s being Element of IAlph, wt being FinSequence of IAlph such that
s = w . 1 and
A7: w = <*s*> ^ wt by FINSEQ_3:102;
set bsresp = the OFun of tfsm . [qb,s];
set asresp = the OFun of tfsm . [qa,s];
set qb9 = the Tran of tfsm . [qb,s];
set qa9 = the Tran of tfsm . [qa,s];
the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] -are_equivalent by A5;
then A8: (( the Tran of tfsm . [qa,s]),wt) -response = (( the Tran of tfsm . [qb,s]),wt) -response by Def10;
thus (qa,w) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((( the Tran of tfsm . [qa,s]),wt) -response) by A7, Th18
.= <*( the OFun of tfsm . [qb,s])*> ^ ((( the Tran of tfsm . [qb,s]),wt) -response) by A5, A8
.= (qb,w) -response by A7, Th18 ; ::_thesis: verum
end;
end;
end;
theorem :: FSM_1:20
for OAlph, IAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm st qa,qb -are_equivalent holds
for w being FinSequence of IAlph
for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent )
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm st qa,qb -are_equivalent holds
for w being FinSequence of IAlph
for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent )
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm st qa,qb -are_equivalent holds
for w being FinSequence of IAlph
for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent )
let qa, qb be State of tfsm; ::_thesis: ( qa,qb -are_equivalent implies for w being FinSequence of IAlph
for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent ) )
assume A1: qa,qb -are_equivalent ; ::_thesis: for w being FinSequence of IAlph
for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent )
let w be FinSequence of IAlph; ::_thesis: for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent )
defpred S1[ Element of 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 Element of NAT st S1[i] holds
S1[i + 1]
proof
let i be Element of NAT ; ::_thesis: ( S1[i] implies S1[i + 1] )
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 ) ) ; ::_thesis: S1[i + 1]
A4: ( i = 0 or ( 0 < i & 0 + 1 = 1 ) ) ;
assume i + 1 in Seg (len w) ; ::_thesis: ex qai, qbi being Element of tfsm st
( qai = ((qa,w) -admissible) . (i + 1) & qbi = ((qb,w) -admissible) . (i + 1) & qai,qbi -are_equivalent )
then i + 1 <= len w by FINSEQ_1:1;
then A5: ( 0 = i or ( 1 <= i & i <= len w ) ) by A4, NAT_1:13;
percases ( i = 0 or i in Seg (len w) ) by A5, FINSEQ_1:1;
supposeA6: i = 0 ; ::_thesis: ex qai, qbi being Element of tfsm st
( qai = ((qa,w) -admissible) . (i + 1) & qbi = ((qb,w) -admissible) . (i + 1) & qai,qbi -are_equivalent )
reconsider qai = ((qa,w) -admissible) . 1, qbi = ((qb,w) -admissible) . 1 as Element of tfsm by Def2;
take qai ; ::_thesis: ex qbi being Element of tfsm st
( qai = ((qa,w) -admissible) . (i + 1) & qbi = ((qb,w) -admissible) . (i + 1) & qai,qbi -are_equivalent )
take qbi ; ::_thesis: ( qai = ((qa,w) -admissible) . (i + 1) & qbi = ((qb,w) -admissible) . (i + 1) & qai,qbi -are_equivalent )
thus qai = ((qa,w) -admissible) . (i + 1) by A6; ::_thesis: ( qbi = ((qb,w) -admissible) . (i + 1) & qai,qbi -are_equivalent )
thus qbi = ((qb,w) -admissible) . (i + 1) by A6; ::_thesis: qai,qbi -are_equivalent
qai = qa by Def2;
hence qai,qbi -are_equivalent by A1, Def2; ::_thesis: verum
end;
supposeA7: i in Seg (len w) ; ::_thesis: ex qai, qbi being Element of tfsm st
( qai = ((qa,w) -admissible) . (i + 1) & qbi = ((qb,w) -admissible) . (i + 1) & qai,qbi -are_equivalent )
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 ; ::_thesis: ex qbi being Element of tfsm st
( qai19 = ((qa,w) -admissible) . (i + 1) & qbi = ((qb,w) -admissible) . (i + 1) & qai19,qbi -are_equivalent )
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 ; ::_thesis: ( qai19 = ((qa,w) -admissible) . (i + 1) & qbi19 = ((qb,w) -admissible) . (i + 1) & qai19,qbi19 -are_equivalent )
thus qai19 = ((qa,w) -admissible) . (i + 1) by A10; ::_thesis: ( qbi19 = ((qb,w) -admissible) . (i + 1) & qai19,qbi19 -are_equivalent )
thus qbi19 = ((qb,w) -admissible) . (i + 1) by A13; ::_thesis: qai19,qbi19 -are_equivalent
thus qai19,qbi19 -are_equivalent by A3, A7, A9, A11, A12, A14, Th19; ::_thesis: verum
end;
end;
end;
A15: Seg (len w) = dom w by FINSEQ_1:def_3;
A16: S1[ 0 ] by FINSEQ_1:1;
for i being Element of NAT holds S1[i] from NAT_1:sch_1(A16, A2);
hence for i being Element of NAT st i in dom w holds
ex qai, qbi being State of tfsm st
( qai = ((qa,w) -admissible) . i & qbi = ((qb,w) -admissible) . i & qai,qbi -are_equivalent ) by A15; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let qa, qb be State of tfsm;
let k be Nat;
predk -equivalent qa,qb means :Def11: :: FSM_1:def 11
for w being FinSequence of IAlph st len w <= k holds
(qa,w) -response = (qb,w) -response ;
end;
:: deftheorem Def11 defines -equivalent FSM_1:def_11_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k being Nat holds
( k -equivalent qa,qb iff for w being FinSequence of IAlph st len w <= k holds
(qa,w) -response = (qb,w) -response );
theorem Th21: :: FSM_1:21
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa being State of tfsm
for k being Nat holds k -equivalent qa,qa
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa being State of tfsm
for k being Nat holds k -equivalent qa,qa
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa being State of tfsm
for k being Nat holds k -equivalent qa,qa
let qa be State of tfsm; ::_thesis: for k being Nat holds k -equivalent qa,qa
let k be Nat; ::_thesis: k -equivalent qa,qa
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k implies (qa,w) -response = (qa,w) -response )
assume len w <= k ; ::_thesis: (qa,w) -response = (qa,w) -response
thus (qa,w) -response = (qa,w) -response ; ::_thesis: verum
end;
theorem Th22: :: FSM_1:22
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k being Nat st k -equivalent qa,qb holds
k -equivalent qb,qa
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k being Nat st k -equivalent qa,qb holds
k -equivalent qb,qa
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm
for k being Nat st k -equivalent qa,qb holds
k -equivalent qb,qa
let qa, qb be State of tfsm; ::_thesis: for k being Nat st k -equivalent qa,qb holds
k -equivalent qb,qa
let k be Nat; ::_thesis: ( k -equivalent qa,qb implies k -equivalent qb,qa )
assume A1: k -equivalent qa,qb ; ::_thesis: k -equivalent qb,qa
thus k -equivalent qb,qa ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k implies (qb,w) -response = (qa,w) -response )
assume len w <= k ; ::_thesis: (qb,w) -response = (qa,w) -response
hence (qb,w) -response = (qa,w) -response by A1, Def11; ::_thesis: verum
end;
end;
theorem Th23: :: FSM_1:23
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb, qc being State of tfsm
for k being Nat st k -equivalent qa,qb & k -equivalent qb,qc holds
k -equivalent qa,qc
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb, qc being State of tfsm
for k being Nat st k -equivalent qa,qb & k -equivalent qb,qc holds
k -equivalent qa,qc
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb, qc being State of tfsm
for k being Nat st k -equivalent qa,qb & k -equivalent qb,qc holds
k -equivalent qa,qc
let qa, qb, qc be State of tfsm; ::_thesis: for k being Nat st k -equivalent qa,qb & k -equivalent qb,qc holds
k -equivalent qa,qc
let k be Nat; ::_thesis: ( k -equivalent qa,qb & k -equivalent qb,qc implies k -equivalent qa,qc )
assume that
A1: k -equivalent qa,qb and
A2: k -equivalent qb,qc ; ::_thesis: k -equivalent qa,qc
thus k -equivalent qa,qc ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k implies (qa,w) -response = (qc,w) -response )
assume A3: len w <= k ; ::_thesis: (qa,w) -response = (qc,w) -response
then (qa,w) -response = (qb,w) -response by A1, Def11;
hence (qa,w) -response = (qc,w) -response by A2, A3, Def11; ::_thesis: verum
end;
end;
theorem Th24: :: FSM_1:24
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm st qa,qb -are_equivalent holds
k -equivalent qa,qb
proof
let k be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm st qa,qb -are_equivalent holds
k -equivalent qa,qb
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm st qa,qb -are_equivalent holds
k -equivalent qa,qb
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm st qa,qb -are_equivalent holds
k -equivalent qa,qb
let qa, qb be State of tfsm; ::_thesis: ( qa,qb -are_equivalent implies k -equivalent qa,qb )
assume A1: qa,qb -are_equivalent ; ::_thesis: k -equivalent qa,qb
thus k -equivalent qa,qb ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k implies (qa,w) -response = (qb,w) -response )
assume len w <= k ; ::_thesis: (qa,w) -response = (qb,w) -response
thus (qa,w) -response = (qb,w) -response by A1, Def10; ::_thesis: verum
end;
end;
theorem Th25: :: FSM_1:25
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm holds 0 -equivalent qa,qb
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm holds 0 -equivalent qa,qb
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm holds 0 -equivalent qa,qb
let qa, qb be State of tfsm; ::_thesis: 0 -equivalent qa,qb
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= 0 implies (qa,w) -response = (qb,w) -response )
assume len w <= 0 ; ::_thesis: (qa,w) -response = (qb,w) -response
then A1: w = <*> IAlph ;
hence (qa,w) -response = <*> OAlph by Th9
.= (qb,w) -response by A1, Th9 ;
::_thesis: verum
end;
theorem Th26: :: FSM_1:26
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k, m being Nat st k + m -equivalent qa,qb holds
k -equivalent qa,qb
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k, m being Nat st k + m -equivalent qa,qb holds
k -equivalent qa,qb
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm
for k, m being Nat st k + m -equivalent qa,qb holds
k -equivalent qa,qb
let qa, qb be State of tfsm; ::_thesis: for k, m being Nat st k + m -equivalent qa,qb holds
k -equivalent qa,qb
let k, m be Nat; ::_thesis: ( k + m -equivalent qa,qb implies k -equivalent qa,qb )
assume A1: k + m -equivalent qa,qb ; ::_thesis: k -equivalent qa,qb
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k implies (qa,w) -response = (qb,w) -response )
A2: k <= k + m by NAT_1:11;
assume len w <= k ; ::_thesis: (qa,w) -response = (qb,w) -response
then len w <= k + m by A2, XXREAL_0:2;
hence (qa,w) -response = (qb,w) -response by A1, Def11; ::_thesis: verum
end;
theorem Th27: :: FSM_1:27
for OAlph, IAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k being Nat st 1 <= k holds
( k -equivalent qa,qb iff ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) ) )
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for qa, qb being State of tfsm
for k being Nat st 1 <= k holds
( k -equivalent qa,qb iff ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) ) )
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for qa, qb being State of tfsm
for k being Nat st 1 <= k holds
( k -equivalent qa,qb iff ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) ) )
let qa, qb be State of tfsm; ::_thesis: for k being Nat st 1 <= k holds
( k -equivalent qa,qb iff ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) ) )
let k be Nat; ::_thesis: ( 1 <= k implies ( k -equivalent qa,qb iff ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) ) ) )
set OF = the OFun of tfsm;
assume A1: 1 <= k ; ::_thesis: ( k -equivalent qa,qb iff ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) ) )
hereby ::_thesis: ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) implies k -equivalent qa,qb )
assume A2: k -equivalent qa,qb ; ::_thesis: ( 1 -equivalent qa,qb & ( for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ) )
thus A3: 1 -equivalent qa,qb ::_thesis: for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s]
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= 1 implies (qa,w) -response = (qb,w) -response )
assume len w <= 1 ; ::_thesis: (qa,w) -response = (qb,w) -response
then len w <= k by A1, XXREAL_0:2;
hence (qa,w) -response = (qb,w) -response by A2, Def11; ::_thesis: verum
end;
let s be Element of IAlph; ::_thesis: for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s]
let k1 be Element of NAT ; ::_thesis: ( k1 = k - 1 implies k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] )
assume A4: k1 = k - 1 ; ::_thesis: k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s]
set qb9 = the Tran of tfsm . [qb,s];
set qa9 = the Tran of tfsm . [qa,s];
thus k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k1 implies (( the Tran of tfsm . [qa,s]),w) -response = (( the Tran of tfsm . [qb,s]),w) -response )
set sw = <*s*> ^ w;
A5: len <*s*> = 1 by FINSEQ_1:40;
assume len w <= k1 ; ::_thesis: (( the Tran of tfsm . [qa,s]),w) -response = (( the Tran of tfsm . [qb,s]),w) -response
then A6: (len w) + 1 <= k1 + 1 by XREAL_1:7;
len (<*s*> ^ w) = (len <*s*>) + (len w) by FINSEQ_1:22
.= 1 + (len w) by FINSEQ_1:40 ;
then A7: (qa,(<*s*> ^ w)) -response = (qb,(<*s*> ^ w)) -response by A2, A4, A6, Def11;
A8: ( (qa,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((( the Tran of tfsm . [qa,s]),w) -response) & (qb,(<*s*> ^ w)) -response = <*( the OFun of tfsm . [qb,s])*> ^ ((( the Tran of tfsm . [qb,s]),w) -response) ) by Th18;
0 + 1 in Seg (0 + 1) by FINSEQ_1:4;
then A9: 1 in dom <*s*> by A5, FINSEQ_1:def_3;
the OFun of tfsm . [qa,s] = the OFun of tfsm . [(((qa,<*s*>) -admissible) . 1),s] by Def2
.= the OFun of tfsm . [(((qa,<*s*>) -admissible) . 1),(<*s*> . 1)] by FINSEQ_1:def_8
.= ((qa,<*s*>) -response) . 1 by A9, Def6
.= ((qb,<*s*>) -response) . 1 by A3, A5, Def11
.= the OFun of tfsm . [(((qb,<*s*>) -admissible) . 1),(<*s*> . 1)] by A9, Def6
.= the OFun of tfsm . [(((qb,<*s*>) -admissible) . 1),s] by FINSEQ_1:def_8
.= the OFun of tfsm . [qb,s] by Def2 ;
hence (( the Tran of tfsm . [qa,s]),w) -response = (( the Tran of tfsm . [qb,s]),w) -response by A8, A7, FINSEQ_1:33; ::_thesis: verum
end;
end;
assume that
A10: 1 -equivalent qa,qb and
A11: for s being Element of IAlph
for k1 being Element of NAT st k1 = k - 1 holds
k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] ; ::_thesis: k -equivalent qa,qb
thus k -equivalent qa,qb ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_11 ::_thesis: ( len w <= k implies (qa,w) -response = (qb,w) -response )
assume A12: len w <= k ; ::_thesis: (qa,w) -response = (qb,w) -response
percases ( w = <*> IAlph or not w is empty ) ;
supposeA13: w = <*> IAlph ; ::_thesis: (qa,w) -response = (qb,w) -response
hence (qa,w) -response = <*> OAlph by Th9
.= (qb,w) -response by A13, Th9 ;
::_thesis: verum
end;
suppose not w is empty ; ::_thesis: (qa,w) -response = (qb,w) -response
then consider s being Element of IAlph, w9 being FinSequence of IAlph such that
s = w . 1 and
A14: w = <*s*> ^ w9 by FINSEQ_3:102;
reconsider k1 = k - 1 as Element of NAT by A1, INT_1:5;
A15: len <*s*> = 1 by FINSEQ_1:40;
len w = (len <*s*>) + (len w9) by A14, FINSEQ_1:22
.= (len w9) + 1 by FINSEQ_1:40 ;
then A16: ((len w9) + 1) - 1 <= k1 by A12, XREAL_1:9;
0 + 1 in Seg (0 + 1) by FINSEQ_1:4;
then A17: 1 in dom <*s*> by A15, FINSEQ_1:def_3;
set qa9 = the Tran of tfsm . [qa,s];
set qb9 = the Tran of tfsm . [qb,s];
A18: ( (qa,w) -response = <*( the OFun of tfsm . [qa,s])*> ^ ((( the Tran of tfsm . [qa,s]),w9) -response) & (qb,w) -response = <*( the OFun of tfsm . [qb,s])*> ^ ((( the Tran of tfsm . [qb,s]),w9) -response) ) by A14, Th18;
A19: k1 -equivalent the Tran of tfsm . [qa,s], the Tran of tfsm . [qb,s] by A11;
the OFun of tfsm . [qa,s] = the OFun of tfsm . [(((qa,<*s*>) -admissible) . 1),s] by Def2
.= the OFun of tfsm . [(((qa,<*s*>) -admissible) . 1),(<*s*> . 1)] by FINSEQ_1:def_8
.= ((qa,<*s*>) -response) . 1 by A17, Def6
.= ((qb,<*s*>) -response) . 1 by A10, A15, Def11
.= the OFun of tfsm . [(((qb,<*s*>) -admissible) . 1),(<*s*> . 1)] by A17, Def6
.= the OFun of tfsm . [(((qb,<*s*>) -admissible) . 1),s] by FINSEQ_1:def_8
.= the OFun of tfsm . [qb,s] by Def2 ;
hence (qa,w) -response = (qb,w) -response by A18, A19, A16, Def11; ::_thesis: verum
end;
end;
end;
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let i be Nat;
funci -eq_states_EqR tfsm -> Equivalence_Relation of the carrier of tfsm means :Def12: :: FSM_1:def 12
for qa, qb being State of tfsm holds
( [qa,qb] in it iff i -equivalent qa,qb );
existence
ex b1 being Equivalence_Relation of the carrier of tfsm st
for qa, qb being State of tfsm holds
( [qa,qb] in b1 iff i -equivalent qa,qb )
proof
set S = the carrier of tfsm;
defpred S1[ set , set ] means ex qa, qb being Element of the carrier of tfsm st
( qa = $1 & qb = $2 & i -equivalent qa,qb );
A1: for x, y being set st S1[x,y] holds
S1[y,x] by Th22;
A2: for x, y, z being set st S1[x,y] & S1[y,z] holds
S1[x,z] by Th23;
A3: for x being set st x in the carrier of tfsm holds
S1[x,x] by Th21;
consider EqR being Equivalence_Relation of the carrier of tfsm such that
A4: for x, y being set holds
( [x,y] in EqR iff ( x in the carrier of tfsm & y in the carrier of tfsm & S1[x,y] ) ) from EQREL_1:sch_1(A3, A1, A2);
take EqR ; ::_thesis: for qa, qb being State of tfsm holds
( [qa,qb] in EqR iff i -equivalent qa,qb )
let qa, qb be Element of the carrier of tfsm; ::_thesis: ( [qa,qb] in EqR iff i -equivalent qa,qb )
hereby ::_thesis: ( i -equivalent qa,qb implies [qa,qb] in EqR )
assume [qa,qb] in EqR ; ::_thesis: i -equivalent qa,qb
then ex qa9, qb9 being Element of the carrier of tfsm st
( qa9 = qa & qb9 = qb & i -equivalent qa9,qb9 ) by A4;
hence i -equivalent qa,qb ; ::_thesis: verum
end;
assume i -equivalent qa,qb ; ::_thesis: [qa,qb] in EqR
hence [qa,qb] in EqR by A4; ::_thesis: verum
end;
uniqueness
for b1, b2 being Equivalence_Relation of the carrier of tfsm st ( for qa, qb being State of tfsm holds
( [qa,qb] in b1 iff i -equivalent qa,qb ) ) & ( for qa, qb being State of tfsm holds
( [qa,qb] in b2 iff i -equivalent qa,qb ) ) holds
b1 = b2
proof
set S = the carrier of tfsm;
let IT1, IT2 be Equivalence_Relation of the carrier of tfsm; ::_thesis: ( ( for qa, qb being State of tfsm holds
( [qa,qb] in IT1 iff i -equivalent qa,qb ) ) & ( for qa, qb being State of tfsm holds
( [qa,qb] in IT2 iff i -equivalent qa,qb ) ) implies IT1 = IT2 )
assume A5: for qa, qb being Element of the carrier of tfsm holds
( [qa,qb] in IT1 iff i -equivalent qa,qb ) ; ::_thesis: ( ex qa, qb being State of tfsm st
( ( [qa,qb] in IT2 implies i -equivalent qa,qb ) implies ( i -equivalent qa,qb & not [qa,qb] in IT2 ) ) or IT1 = IT2 )
assume A6: for qa, qb being Element of the carrier of tfsm holds
( [qa,qb] in IT2 iff i -equivalent qa,qb ) ; ::_thesis: IT1 = IT2
assume IT1 <> IT2 ; ::_thesis: contradiction
then consider x being set such that
A7: ( ( x in IT1 & not x in IT2 ) or ( x in IT2 & not x in IT1 ) ) by TARSKI:1;
percases ( ( x in IT1 & not x in IT2 ) or ( x in IT2 & not x in IT1 ) ) by A7;
supposeA8: ( x in IT1 & not x in IT2 ) ; ::_thesis: contradiction
then consider qa, qb being set such that
A9: x = [qa,qb] and
A10: ( qa in the carrier of tfsm & qb in the carrier of tfsm ) by RELSET_1:2;
reconsider qa = qa, qb = qb as Element of the carrier of tfsm by A10;
i -equivalent qa,qb by A5, A8, A9;
hence contradiction by A6, A8, A9; ::_thesis: verum
end;
supposeA11: ( x in IT2 & not x in IT1 ) ; ::_thesis: contradiction
then consider qa, qb being set such that
A12: x = [qa,qb] and
A13: ( qa in the carrier of tfsm & qb in the carrier of tfsm ) by RELSET_1:2;
reconsider qa = qa, qb = qb as Element of the carrier of tfsm by A13;
i -equivalent qa,qb by A6, A11, A12;
hence contradiction by A5, A11, A12; ::_thesis: verum
end;
end;
end;
end;
:: deftheorem Def12 defines -eq_states_EqR FSM_1:def_12_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for i being Nat
for b5 being Equivalence_Relation of the carrier of tfsm holds
( b5 = i -eq_states_EqR tfsm iff for qa, qb being State of tfsm holds
( [qa,qb] in b5 iff i -equivalent qa,qb ) );
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let i be Nat;
funci -eq_states_partition tfsm -> non empty a_partition of the carrier of tfsm equals :: FSM_1:def 13
Class (i -eq_states_EqR tfsm);
coherence
Class (i -eq_states_EqR tfsm) is non empty a_partition of the carrier of tfsm ;
end;
:: deftheorem defines -eq_states_partition FSM_1:def_13_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for i being Nat holds i -eq_states_partition tfsm = Class (i -eq_states_EqR tfsm);
theorem Th28: :: FSM_1:28
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph holds (k + 1) -eq_states_partition tfsm is_finer_than k -eq_states_partition tfsm
proof
let k be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph holds (k + 1) -eq_states_partition tfsm is_finer_than k -eq_states_partition tfsm
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph holds (k + 1) -eq_states_partition tfsm is_finer_than k -eq_states_partition tfsm
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: (k + 1) -eq_states_partition tfsm is_finer_than k -eq_states_partition tfsm
set K = k -eq_states_partition tfsm;
set K1 = (k + 1) -eq_states_partition tfsm;
set S = the carrier of tfsm;
let X be set ; :: according to SETFAM_1:def_2 ::_thesis: ( not X in (k + 1) -eq_states_partition tfsm or ex b1 being set st
( b1 in k -eq_states_partition tfsm & X c= b1 ) )
assume A1: X in (k + 1) -eq_states_partition tfsm ; ::_thesis: ex b1 being set st
( b1 in k -eq_states_partition tfsm & X c= b1 )
then reconsider X9 = X as Subset of the carrier of tfsm ;
consider q being Element of the carrier of tfsm such that
A2: q in X by A1, FINSEQ_4:87;
reconsider Y = (proj (k -eq_states_partition tfsm)) . q as Element of k -eq_states_partition tfsm ;
take Y ; ::_thesis: ( Y in k -eq_states_partition tfsm & X c= Y )
thus Y in k -eq_states_partition tfsm ; ::_thesis: X c= Y
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in X or x in Y )
assume A3: x in X ; ::_thesis: x in Y
then x in X9 ;
then reconsider x9 = x as Element of the carrier of tfsm ;
reconsider X9 = X9 as Element of Class ((k + 1) -eq_states_EqR tfsm) by A1;
consider Q being set such that
Q in the carrier of tfsm and
A4: X9 = Class (((k + 1) -eq_states_EqR tfsm),Q) by EQREL_1:def_3;
[x9,Q] in (k + 1) -eq_states_EqR tfsm by A3, A4, EQREL_1:19;
then A5: [Q,x9] in (k + 1) -eq_states_EqR tfsm by EQREL_1:6;
[q,Q] in (k + 1) -eq_states_EqR tfsm by A2, A4, EQREL_1:19;
then [q,x9] in (k + 1) -eq_states_EqR tfsm by A5, EQREL_1:7;
then k + 1 -equivalent q,x9 by Def12;
then k -equivalent q,x9 by Th26;
then [q,x9] in k -eq_states_EqR tfsm by Def12;
then A6: [x9,q] in k -eq_states_EqR tfsm by EQREL_1:6;
reconsider Y9 = Y as Element of Class (k -eq_states_EqR tfsm) ;
consider Q being set such that
A7: Q in the carrier of tfsm and
A8: Y9 = Class ((k -eq_states_EqR tfsm),Q) by EQREL_1:def_3;
reconsider Q = Q as Element of the carrier of tfsm by A7;
q in Y by EQREL_1:def_9;
then Class ((k -eq_states_EqR tfsm),Q) = Class ((k -eq_states_EqR tfsm),q) by A8, EQREL_1:23;
hence x in Y by A6, A8, EQREL_1:19; ::_thesis: verum
end;
theorem Th29: :: FSM_1:29
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for k being Nat st Class (k -eq_states_EqR tfsm) = Class ((k + 1) -eq_states_EqR tfsm) holds
for m being Nat holds Class ((k + m) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm)
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for k being Nat st Class (k -eq_states_EqR tfsm) = Class ((k + 1) -eq_states_EqR tfsm) holds
for m being Nat holds Class ((k + m) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm)
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for k being Nat st Class (k -eq_states_EqR tfsm) = Class ((k + 1) -eq_states_EqR tfsm) holds
for m being Nat holds Class ((k + m) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm)
let k be Nat; ::_thesis: ( Class (k -eq_states_EqR tfsm) = Class ((k + 1) -eq_states_EqR tfsm) implies for m being Nat holds Class ((k + m) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm) )
set S = the carrier of tfsm;
set CEk = Class (k -eq_states_EqR tfsm);
set Ek = k -eq_states_EqR tfsm;
set CEk1 = Class ((k + 1) -eq_states_EqR tfsm);
set Ek1 = (k + 1) -eq_states_EqR tfsm;
defpred S1[ Nat] means Class ((k + $1) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm);
assume Class (k -eq_states_EqR tfsm) = Class ((k + 1) -eq_states_EqR tfsm) ; ::_thesis: for m being Nat holds Class ((k + m) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm)
then A1: k -eq_states_EqR tfsm = (k + 1) -eq_states_EqR tfsm by FINSEQ_4:86;
A2: for m being Nat st S1[m] holds
S1[m + 1]
proof
let m be Nat; ::_thesis: ( S1[m] implies S1[m + 1] )
set CEkm = Class ((k + m) -eq_states_EqR tfsm);
set Ekm = (k + m) -eq_states_EqR tfsm;
set CEkm1 = Class ((k + (m + 1)) -eq_states_EqR tfsm);
set Ekm1 = (k + (m + 1)) -eq_states_EqR tfsm;
assume Class ((k + m) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm) ; ::_thesis: S1[m + 1]
then A3: (k + m) -eq_states_EqR tfsm = k -eq_states_EqR tfsm by FINSEQ_4:86;
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_Class_((k_+_(m_+_1))_-eq_states_EqR_tfsm)_implies_x_in_Class_(k_-eq_states_EqR_tfsm)_)_&_(_x_in_Class_(k_-eq_states_EqR_tfsm)_implies_x_in_Class_((k_+_(m_+_1))_-eq_states_EqR_tfsm)_)_)
let x be set ; ::_thesis: ( ( x in Class ((k + (m + 1)) -eq_states_EqR tfsm) implies x in Class (k -eq_states_EqR tfsm) ) & ( x in Class (k -eq_states_EqR tfsm) implies x in Class ((k + (m + 1)) -eq_states_EqR tfsm) ) )
hereby ::_thesis: ( x in Class (k -eq_states_EqR tfsm) implies x in Class ((k + (m + 1)) -eq_states_EqR tfsm) )
assume A4: x in Class ((k + (m + 1)) -eq_states_EqR tfsm) ; ::_thesis: x in Class (k -eq_states_EqR tfsm)
then reconsider x9 = x as Subset of the carrier of tfsm ;
consider qa being set such that
A5: qa in the carrier of tfsm and
A6: x9 = Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) by A4, EQREL_1:def_3;
reconsider qa = qa as Element of the carrier of tfsm by A5;
A7: x9 c= the carrier of tfsm ;
now__::_thesis:_for_y_being_set_holds_
(_(_y_in_x_implies_y_in_Class_((k_-eq_states_EqR_tfsm),qa)_)_&_(_y_in_Class_((k_-eq_states_EqR_tfsm),qa)_implies_y_in_x_)_)
let y be set ; ::_thesis: ( ( y in x implies y in Class ((k -eq_states_EqR tfsm),qa) ) & ( y in Class ((k -eq_states_EqR tfsm),qa) implies y in x ) )
hereby ::_thesis: ( y in Class ((k -eq_states_EqR tfsm),qa) implies y in x )
assume A8: y in x ; ::_thesis: y in Class ((k -eq_states_EqR tfsm),qa)
then reconsider y9 = y as Element of the carrier of tfsm by A7;
[y,qa] in (k + (m + 1)) -eq_states_EqR tfsm by A6, A8, EQREL_1:19;
then k + (m + 1) -equivalent y9,qa by Def12;
then k -equivalent y9,qa by Th26;
then [y9,qa] in k -eq_states_EqR tfsm by Def12;
hence y in Class ((k -eq_states_EqR tfsm),qa) by EQREL_1:19; ::_thesis: verum
end;
assume A9: y in Class ((k -eq_states_EqR tfsm),qa) ; ::_thesis: y in x
then reconsider y9 = y as Element of the carrier of tfsm ;
[y9,qa] in k -eq_states_EqR tfsm by A9, EQREL_1:19;
then A10: k + 1 -equivalent y9,qa by A1, Def12;
A11: 1 <= k + 1 by NAT_1:11;
A12: now__::_thesis:_for_s_being_Element_of_IAlph
for_k1_being_Element_of_NAT_st_k1_=_((k_+_m)_+_1)_-_1_holds_
k1_-equivalent_the_Tran_of_tfsm_._[y9,s],_the_Tran_of_tfsm_._[qa,s]
let s be Element of IAlph; ::_thesis: for k1 being Element of NAT st k1 = ((k + m) + 1) - 1 holds
k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s]
let k1 be Element of NAT ; ::_thesis: ( k1 = ((k + m) + 1) - 1 implies k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s] )
set Sy9 = the Tran of tfsm . [y9,s];
set Sqa = the Tran of tfsm . [qa,s];
( k in NAT & k = (k + 1) - 1 ) by ORDINAL1:def_12;
then k -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s] by A10, A11, Th27;
then A13: [( the Tran of tfsm . [y9,s]),( the Tran of tfsm . [qa,s])] in k -eq_states_EqR tfsm by Def12;
assume k1 = ((k + m) + 1) - 1 ; ::_thesis: k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s]
hence k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s] by A3, A13, Def12; ::_thesis: verum
end;
( 1 <= (k + m) + 1 & 1 -equivalent y9,qa ) by A10, A11, Th27, NAT_1:11;
then (k + m) + 1 -equivalent y9,qa by A12, Th27;
then [y9,qa] in (k + (m + 1)) -eq_states_EqR tfsm by Def12;
hence y in x by A6, EQREL_1:19; ::_thesis: verum
end;
then x = Class ((k -eq_states_EqR tfsm),qa) by TARSKI:1;
hence x in Class (k -eq_states_EqR tfsm) by EQREL_1:def_3; ::_thesis: verum
end;
assume A14: x in Class (k -eq_states_EqR tfsm) ; ::_thesis: x in Class ((k + (m + 1)) -eq_states_EqR tfsm)
then reconsider x9 = x as Subset of the carrier of tfsm ;
consider qa being set such that
A15: qa in the carrier of tfsm and
A16: x9 = Class ((k -eq_states_EqR tfsm),qa) by A14, EQREL_1:def_3;
reconsider qa = qa as Element of the carrier of tfsm by A15;
now__::_thesis:_for_y_being_set_holds_
(_(_y_in_x_implies_y_in_Class_(((k_+_(m_+_1))_-eq_states_EqR_tfsm),qa)_)_&_(_y_in_Class_(((k_+_(m_+_1))_-eq_states_EqR_tfsm),qa)_implies_y_in_x_)_)
let y be set ; ::_thesis: ( ( y in x implies y in Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) ) & ( y in Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) implies y in x ) )
hereby ::_thesis: ( y in Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) implies y in x )
assume A17: y in x ; ::_thesis: y in Class (((k + (m + 1)) -eq_states_EqR tfsm),qa)
then reconsider y9 = y as Element of the carrier of tfsm by A16;
[y9,qa] in k -eq_states_EqR tfsm by A16, A17, EQREL_1:19;
then A18: k + 1 -equivalent y9,qa by A1, Def12;
A19: 1 <= k + 1 by NAT_1:11;
A20: now__::_thesis:_for_s_being_Element_of_IAlph
for_k1_being_Element_of_NAT_st_k1_=_((k_+_m)_+_1)_-_1_holds_
k1_-equivalent_the_Tran_of_tfsm_._[y9,s],_the_Tran_of_tfsm_._[qa,s]
let s be Element of IAlph; ::_thesis: for k1 being Element of NAT st k1 = ((k + m) + 1) - 1 holds
k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s]
let k1 be Element of NAT ; ::_thesis: ( k1 = ((k + m) + 1) - 1 implies k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s] )
set Sy9 = the Tran of tfsm . [y9,s];
set Sqa = the Tran of tfsm . [qa,s];
( k in NAT & k = (k + 1) - 1 ) by ORDINAL1:def_12;
then k -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s] by A18, A19, Th27;
then A21: [( the Tran of tfsm . [y9,s]),( the Tran of tfsm . [qa,s])] in k -eq_states_EqR tfsm by Def12;
assume k1 = ((k + m) + 1) - 1 ; ::_thesis: k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s]
hence k1 -equivalent the Tran of tfsm . [y9,s], the Tran of tfsm . [qa,s] by A3, A21, Def12; ::_thesis: verum
end;
( 1 <= (k + m) + 1 & 1 -equivalent y9,qa ) by A18, A19, Th27, NAT_1:11;
then (k + m) + 1 -equivalent y9,qa by A20, Th27;
then [y9,qa] in (k + (m + 1)) -eq_states_EqR tfsm by Def12;
hence y in Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) by EQREL_1:19; ::_thesis: verum
end;
assume A22: y in Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) ; ::_thesis: y in x
then reconsider y9 = y as Element of the carrier of tfsm ;
[y,qa] in (k + (m + 1)) -eq_states_EqR tfsm by A22, EQREL_1:19;
then k + (m + 1) -equivalent y9,qa by Def12;
then k -equivalent y9,qa by Th26;
then [y9,qa] in k -eq_states_EqR tfsm by Def12;
hence y in x by A16, EQREL_1:19; ::_thesis: verum
end;
then x = Class (((k + (m + 1)) -eq_states_EqR tfsm),qa) by TARSKI:1;
hence x in Class ((k + (m + 1)) -eq_states_EqR tfsm) by EQREL_1:def_3; ::_thesis: verum
end;
hence Class ((k + (m + 1)) -eq_states_EqR tfsm) = Class (k -eq_states_EqR tfsm) by TARSKI:1; ::_thesis: verum
end;
A23: S1[ 0 ] ;
thus for m being Nat holds S1[m] from NAT_1:sch_2(A23, A2); ::_thesis: verum
end;
theorem :: FSM_1:30
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm holds
for m being Element of NAT holds (k + m) -eq_states_partition tfsm = k -eq_states_partition tfsm by Th29;
theorem Th31: :: FSM_1:31
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st (k + 1) -eq_states_partition tfsm <> k -eq_states_partition tfsm holds
for i being Element of NAT st i <= k holds
(i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm
proof
let k be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st (k + 1) -eq_states_partition tfsm <> k -eq_states_partition tfsm holds
for i being Element of NAT st i <= k holds
(i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph st (k + 1) -eq_states_partition tfsm <> k -eq_states_partition tfsm holds
for i being Element of NAT st i <= k holds
(i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( (k + 1) -eq_states_partition tfsm <> k -eq_states_partition tfsm implies for i being Element of NAT st i <= k holds
(i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm )
assume A1: (k + 1) -eq_states_partition tfsm <> k -eq_states_partition tfsm ; ::_thesis: for i being Element of NAT st i <= k holds
(i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm
let i be Element of NAT ; ::_thesis: ( i <= k implies (i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm )
assume A2: i <= k ; ::_thesis: (i + 1) -eq_states_partition tfsm <> i -eq_states_partition tfsm
A3: ex e being Nat st k + 1 = i + e by A2, NAT_1:10, NAT_1:12;
assume A4: (i + 1) -eq_states_partition tfsm = i -eq_states_partition tfsm ; ::_thesis: contradiction
ex d being Nat st k = i + d by A2, NAT_1:10;
then k -eq_states_partition tfsm = i -eq_states_partition tfsm by A4, Th29;
hence contradiction by A1, A4, A3, Th29; ::_thesis: verum
end;
theorem Th32: :: FSM_1:32
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm or card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm) )
proof
let k be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm or card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm) )
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm or card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm) )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ( k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm or card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm) )
set kp = k -eq_states_partition tfsm;
set k1p = (k + 1) -eq_states_partition tfsm;
card (k -eq_states_partition tfsm) <= card ((k + 1) -eq_states_partition tfsm) by Th28, FINSEQ_4:89;
then A1: ( card (k -eq_states_partition tfsm) = card ((k + 1) -eq_states_partition tfsm) or card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm) ) by XXREAL_0:1;
assume k -eq_states_partition tfsm <> (k + 1) -eq_states_partition tfsm ; ::_thesis: card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm)
hence card (k -eq_states_partition tfsm) < card ((k + 1) -eq_states_partition tfsm) by A1, Th28, FINSEQ_4:91; ::_thesis: verum
end;
theorem Th33: :: FSM_1:33
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q being State of tfsm holds Class ((0 -eq_states_EqR tfsm),q) = the carrier of tfsm
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph
for q being State of tfsm holds Class ((0 -eq_states_EqR tfsm),q) = the carrier of tfsm
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q being State of tfsm holds Class ((0 -eq_states_EqR tfsm),q) = the carrier of tfsm
let q be State of tfsm; ::_thesis: Class ((0 -eq_states_EqR tfsm),q) = the carrier of tfsm
set 0e = 0 -eq_states_EqR tfsm;
set S = the carrier of tfsm;
now__::_thesis:_for_z_being_set_holds_
(_(_z_in_Class_((0_-eq_states_EqR_tfsm),q)_implies_z_in_the_carrier_of_tfsm_)_&_(_z_in_the_carrier_of_tfsm_implies_z_in_Class_((0_-eq_states_EqR_tfsm),q)_)_)
let z be set ; ::_thesis: ( ( z in Class ((0 -eq_states_EqR tfsm),q) implies z in the carrier of tfsm ) & ( z in the carrier of tfsm implies z in Class ((0 -eq_states_EqR tfsm),q) ) )
thus ( z in Class ((0 -eq_states_EqR tfsm),q) implies z in the carrier of tfsm ) ; ::_thesis: ( z in the carrier of tfsm implies z in Class ((0 -eq_states_EqR tfsm),q) )
assume z in the carrier of tfsm ; ::_thesis: z in Class ((0 -eq_states_EqR tfsm),q)
then reconsider z9 = z as Element of the carrier of tfsm ;
0 -equivalent z9,q by Th25;
then [z,q] in 0 -eq_states_EqR tfsm by Def12;
hence z in Class ((0 -eq_states_EqR tfsm),q) by EQREL_1:19; ::_thesis: verum
end;
hence Class ((0 -eq_states_EqR tfsm),q) = the carrier of tfsm by TARSKI:1; ::_thesis: verum
end;
theorem :: FSM_1:34
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph holds 0 -eq_states_partition tfsm = { the carrier of tfsm}
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph holds 0 -eq_states_partition tfsm = { the carrier of tfsm}
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: 0 -eq_states_partition tfsm = { the carrier of tfsm}
set S = the carrier of tfsm;
set SS = { the carrier of tfsm};
set 0p = 0 -eq_states_partition tfsm;
set 0e = 0 -eq_states_EqR tfsm;
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_0_-eq_states_partition_tfsm_implies_x_in_{_the_carrier_of_tfsm}_)_&_(_x_in_{_the_carrier_of_tfsm}_implies_x_in_0_-eq_states_partition_tfsm_)_)
set y = the Element of the carrier of tfsm;
let x be set ; ::_thesis: ( ( x in 0 -eq_states_partition tfsm implies x in { the carrier of tfsm} ) & ( x in { the carrier of tfsm} implies x in 0 -eq_states_partition tfsm ) )
hereby ::_thesis: ( x in { the carrier of tfsm} implies x in 0 -eq_states_partition tfsm )
assume A1: x in 0 -eq_states_partition tfsm ; ::_thesis: x in { the carrier of tfsm}
then reconsider x9 = x as Subset of the carrier of tfsm ;
consider y being set such that
A2: y in the carrier of tfsm and
A3: x9 = Class ((0 -eq_states_EqR tfsm),y) by A1, EQREL_1:def_3;
reconsider y = y as Element of the carrier of tfsm by A2;
Class ((0 -eq_states_EqR tfsm),y) = the carrier of tfsm by Th33;
hence x in { the carrier of tfsm} by A3, TARSKI:def_1; ::_thesis: verum
end;
assume x in { the carrier of tfsm} ; ::_thesis: x in 0 -eq_states_partition tfsm
then A4: x = the carrier of tfsm by TARSKI:def_1;
Class ((0 -eq_states_EqR tfsm), the Element of the carrier of tfsm) in Class (0 -eq_states_EqR tfsm) by EQREL_1:def_3;
hence x in 0 -eq_states_partition tfsm by A4, Th33; ::_thesis: verum
end;
hence 0 -eq_states_partition tfsm = { the carrier of tfsm} by TARSKI:1; ::_thesis: verum
end;
theorem Th35: :: FSM_1:35
for n being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
(n + 1) -eq_states_partition tfsm = n -eq_states_partition tfsm
proof
let n be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
(n + 1) -eq_states_partition tfsm = n -eq_states_partition tfsm
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
(n + 1) -eq_states_partition tfsm = n -eq_states_partition tfsm
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ( n + 1 = card the carrier of tfsm implies (n + 1) -eq_states_partition tfsm = n -eq_states_partition tfsm )
assume A1: n + 1 = card the carrier of tfsm ; ::_thesis: (n + 1) -eq_states_partition tfsm = n -eq_states_partition tfsm
defpred S1[ Element of NAT ] means ( $1 <= n + 1 implies card ($1 -eq_states_partition tfsm) > $1 );
assume A2: (n + 1) -eq_states_partition tfsm <> n -eq_states_partition tfsm ; ::_thesis: contradiction
A3: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A4: ( k <= n + 1 implies card (k -eq_states_partition tfsm) > k ) ; ::_thesis: S1[k + 1]
assume A5: k + 1 <= n + 1 ; ::_thesis: card ((k + 1) -eq_states_partition tfsm) > k + 1
then k <= n by XREAL_1:6;
then A6: (k + 1) -eq_states_partition tfsm <> k -eq_states_partition tfsm by A2, Th31;
k + 1 <= card (k -eq_states_partition tfsm) by A4, A5, NAT_1:13;
hence card ((k + 1) -eq_states_partition tfsm) > k + 1 by A6, Th32, XXREAL_0:2; ::_thesis: verum
end;
A7: S1[ 0 ] ;
for k being Element of NAT holds S1[k] from NAT_1:sch_1(A7, A3);
then card ((n + 1) -eq_states_partition tfsm) > n + 1 ;
hence contradiction by A1, FINSEQ_4:88; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let IT be a_partition of the carrier of tfsm;
attrIT is final means :Def14: :: FSM_1:def 14
for qa, qb being State of tfsm holds
( qa,qb -are_equivalent iff ex X being Element of IT st
( qa in X & qb in X ) );
end;
:: deftheorem Def14 defines final FSM_1:def_14_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for IT being a_partition of the carrier of tfsm holds
( IT is final iff for qa, qb being State of tfsm holds
( qa,qb -are_equivalent iff ex X being Element of IT st
( qa in X & qb in X ) ) );
theorem :: FSM_1:36
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm is final holds
(k + 1) -eq_states_EqR tfsm = k -eq_states_EqR tfsm
proof
let k be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm is final holds
(k + 1) -eq_states_EqR tfsm = k -eq_states_EqR tfsm
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm is final holds
(k + 1) -eq_states_EqR tfsm = k -eq_states_EqR tfsm
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( k -eq_states_partition tfsm is final implies (k + 1) -eq_states_EqR tfsm = k -eq_states_EqR tfsm )
set S = the carrier of tfsm;
set keq = k -eq_states_EqR tfsm;
set k1eq = (k + 1) -eq_states_EqR tfsm;
set kpart = k -eq_states_partition tfsm;
assume A1: k -eq_states_partition tfsm is final ; ::_thesis: (k + 1) -eq_states_EqR tfsm = k -eq_states_EqR tfsm
now__::_thesis:_for_x_being_set_holds_
(_(_x_in_(k_+_1)_-eq_states_EqR_tfsm_implies_x_in_k_-eq_states_EqR_tfsm_)_&_(_x_in_k_-eq_states_EqR_tfsm_implies_x_in_(k_+_1)_-eq_states_EqR_tfsm_)_)
let x be set ; ::_thesis: ( ( x in (k + 1) -eq_states_EqR tfsm implies x in k -eq_states_EqR tfsm ) & ( x in k -eq_states_EqR tfsm implies x in (k + 1) -eq_states_EqR tfsm ) )
hereby ::_thesis: ( x in k -eq_states_EqR tfsm implies x in (k + 1) -eq_states_EqR tfsm )
assume A2: x in (k + 1) -eq_states_EqR tfsm ; ::_thesis: x in k -eq_states_EqR tfsm
then consider a, b being set such that
A3: x = [a,b] and
A4: a in the carrier of tfsm and
A5: b in the carrier of tfsm by RELSET_1:2;
reconsider b = b as Element of the carrier of tfsm by A5;
reconsider a = a as Element of the carrier of tfsm by A4;
k + 1 -equivalent a,b by A2, A3, Def12;
then k -equivalent a,b by Th26;
hence x in k -eq_states_EqR tfsm by A3, Def12; ::_thesis: verum
end;
assume A6: x in k -eq_states_EqR tfsm ; ::_thesis: x in (k + 1) -eq_states_EqR tfsm
then consider a, b being set such that
A7: x = [a,b] and
A8: a in the carrier of tfsm and
A9: b in the carrier of tfsm by RELSET_1:2;
reconsider b = b as Element of the carrier of tfsm by A9;
reconsider a = a as Element of the carrier of tfsm by A8;
reconsider cl = Class ((k -eq_states_EqR tfsm),b) as Element of k -eq_states_partition tfsm by EQREL_1:def_3;
A10: b in cl by EQREL_1:20;
a in cl by A6, A7, EQREL_1:19;
then a,b -are_equivalent by A1, A10, Def14;
then k + 1 -equivalent a,b by Th24;
hence x in (k + 1) -eq_states_EqR tfsm by A7, Def12; ::_thesis: verum
end;
hence (k + 1) -eq_states_EqR tfsm = k -eq_states_EqR tfsm by TARSKI:1; ::_thesis: verum
end;
theorem Th37: :: FSM_1:37
for k being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm holds
k -eq_states_partition tfsm is final
proof
let k be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm holds
k -eq_states_partition tfsm is final
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty Mealy-FSM over IAlph,OAlph st k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm holds
k -eq_states_partition tfsm is final
let tfsm be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm implies k -eq_states_partition tfsm is final )
set S = the carrier of tfsm;
set kpart = k -eq_states_partition tfsm;
set k1part = (k + 1) -eq_states_partition tfsm;
set keq = k -eq_states_EqR tfsm;
assume A1: k -eq_states_partition tfsm = (k + 1) -eq_states_partition tfsm ; ::_thesis: k -eq_states_partition tfsm is final
now__::_thesis:_for_qa,_qb_being_Element_of_tfsm_holds_
(_(_qa,qb_-are_equivalent_implies_ex_X_being_Element_of_k_-eq_states_partition_tfsm_st_
(_qa_in_X_&_qb_in_X_)_)_&_(_ex_X_being_Element_of_k_-eq_states_partition_tfsm_st_
(_qa_in_X_&_qb_in_X_)_implies_qa,qb_-are_equivalent_)_)
let qa, qb be Element of tfsm; ::_thesis: ( ( qa,qb -are_equivalent implies ex X being Element of k -eq_states_partition tfsm st
( qa in X & qb in X ) ) & ( ex X being Element of k -eq_states_partition tfsm st
( qa in X & qb in X ) implies qa,qb -are_equivalent ) )
hereby ::_thesis: ( ex X being Element of k -eq_states_partition tfsm st
( qa in X & qb in X ) implies qa,qb -are_equivalent )
reconsider X = Class ((k -eq_states_EqR tfsm),qb) as Element of k -eq_states_partition tfsm by EQREL_1:def_3;
assume A2: qa,qb -are_equivalent ; ::_thesis: ex X being Element of k -eq_states_partition tfsm st
( qa in X & qb in X )
take X = X; ::_thesis: ( qa in X & qb in X )
k -equivalent qa,qb by A2, Th24;
then [qa,qb] in k -eq_states_EqR tfsm by Def12;
hence ( qa in X & qb in X ) by EQREL_1:19, EQREL_1:20; ::_thesis: verum
end;
given X being Element of k -eq_states_partition tfsm such that A3: qa in X and
A4: qb in X ; ::_thesis: qa,qb -are_equivalent
consider qc being set such that
qc in the carrier of tfsm and
A5: X = Class ((k -eq_states_EqR tfsm),qc) by EQREL_1:def_3;
[qb,qc] in k -eq_states_EqR tfsm by A4, A5, EQREL_1:19;
then A6: [qc,qb] in k -eq_states_EqR tfsm by EQREL_1:6;
[qa,qc] in k -eq_states_EqR tfsm by A3, A5, EQREL_1:19;
then A7: [qa,qb] in k -eq_states_EqR tfsm by A6, EQREL_1:7;
then A8: k -equivalent qa,qb by Def12;
thus qa,qb -are_equivalent ::_thesis: verum
proof
let w be FinSequence of IAlph; :: according to FSM_1:def_10 ::_thesis: (qa,w) -response = (qb,w) -response
consider n being Nat such that
A9: dom w = Seg n by FINSEQ_1:def_2;
n in NAT by ORDINAL1:def_12;
then A10: n = len w by A9, FINSEQ_1:def_3;
percases ( n <= k or n > k ) ;
suppose n <= k ; ::_thesis: (qa,w) -response = (qb,w) -response
hence (qa,w) -response = (qb,w) -response by A8, A10, Def11; ::_thesis: verum
end;
suppose n > k ; ::_thesis: (qa,w) -response = (qb,w) -response
then ex m being Element of NAT st
( n = k + m & 1 <= m ) by FINSEQ_4:84;
then n -eq_states_partition tfsm = k -eq_states_partition tfsm by A1, Th29;
then [qa,qb] in n -eq_states_EqR tfsm by A7, FINSEQ_4:86;
then n -equivalent qa,qb by Def12;
hence (qa,w) -response = (qb,w) -response by A10, Def11; ::_thesis: verum
end;
end;
end;
end;
hence k -eq_states_partition tfsm is final by Def14; ::_thesis: verum
end;
theorem :: FSM_1:38
for n being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
ex k being Element of NAT st
( k <= n & k -eq_states_partition tfsm is final )
proof
let n be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
ex k being Element of NAT st
( k <= n & k -eq_states_partition tfsm is final )
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
ex k being Element of NAT st
( k <= n & k -eq_states_partition tfsm is final )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ( n + 1 = card the carrier of tfsm implies ex k being Element of NAT st
( k <= n & k -eq_states_partition tfsm is final ) )
assume A1: n + 1 = card the carrier of tfsm ; ::_thesis: ex k being Element of NAT st
( k <= n & k -eq_states_partition tfsm is final )
take n ; ::_thesis: ( n <= n & n -eq_states_partition tfsm is final )
thus n <= n ; ::_thesis: n -eq_states_partition tfsm is final
n -eq_states_partition tfsm = (n + 1) -eq_states_partition tfsm by A1, Th35;
hence n -eq_states_partition tfsm is final by Th37; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
func final_states_partition tfsm -> a_partition of the carrier of tfsm means :Def15: :: FSM_1:def 15
it is final ;
existence
ex b1 being a_partition of the carrier of tfsm st b1 is final
proof
reconsider n = card the carrier of tfsm as Element of NAT ;
consider m being Nat such that
A1: n = m + 1 by NAT_1:6;
reconsider m = m as Element of NAT by ORDINAL1:def_12;
take m -eq_states_partition tfsm ; ::_thesis: m -eq_states_partition tfsm is final
m -eq_states_partition tfsm = (m + 1) -eq_states_partition tfsm by A1, Th35;
hence m -eq_states_partition tfsm is final by Th37; ::_thesis: verum
end;
uniqueness
for b1, b2 being a_partition of the carrier of tfsm st b1 is final & b2 is final holds
b1 = b2
proof
let it1, it2 be a_partition of the carrier of tfsm; ::_thesis: ( it1 is final & it2 is final implies it1 = it2 )
assume that
A2: it1 is final and
A3: it2 is final ; ::_thesis: it1 = it2
now__::_thesis:_not_it1_<>_it2
assume it1 <> it2 ; ::_thesis: contradiction
then not for X being set holds
( X in it1 iff X in it2 ) by TARSKI:1;
then consider X being set such that
A4: ( ( X in it1 & not X in it2 ) or ( not X in it1 & X in it2 ) ) ;
percases ( ( X in it1 & not X in it2 ) or ( not X in it1 & X in it2 ) ) by A4;
supposeA5: ( X in it1 & not X in it2 ) ; ::_thesis: contradiction
then reconsider X = X as Subset of tfsm ;
consider qx being Element of tfsm such that
A6: qx in X by A5, FINSEQ_4:87;
union it2 = the carrier of tfsm by EQREL_1:def_4;
then consider Z being set such that
A7: qx in Z and
A8: Z in it2 by TARSKI:def_4;
reconsider Z = Z as Subset of tfsm by A8;
set XZ = X \ Z;
set ZX = Z \ X;
set Y9 = (X \ Z) \/ (Z \ X);
(X \ Z) \/ (Z \ X) <> {}
proof
assume A9: (X \ Z) \/ (Z \ X) = {} ; ::_thesis: contradiction
then Z \ X = {} ;
then A10: Z c= X by XBOOLE_1:37;
X \ Z = {} by A9;
then X c= Z by XBOOLE_1:37;
hence contradiction by A5, A8, A10, XBOOLE_0:def_10; ::_thesis: verum
end;
then consider qy being Element of tfsm such that
A11: qy in (X \ Z) \/ (Z \ X) by SUBSET_1:4;
reconsider X = X as Element of it1 by A5;
A12: now__::_thesis:_not_qy_in_Z_\_X
assume A13: qy in Z \ X ; ::_thesis: contradiction
A14: not qx,qy -are_equivalent
proof
assume qx,qy -are_equivalent ; ::_thesis: contradiction
then consider Z9 being Element of it1 such that
A15: qx in Z9 and
A16: qy in Z9 by A2, Def14;
percases ( X = Z9 or X <> Z9 ) ;
suppose X = Z9 ; ::_thesis: contradiction
hence contradiction by A13, A16, XBOOLE_0:def_5; ::_thesis: verum
end;
suppose X <> Z9 ; ::_thesis: contradiction
then X misses Z9 by EQREL_1:def_4;
then X /\ Z9 = {} by XBOOLE_0:def_7;
hence contradiction by A6, A15, XBOOLE_0:def_4; ::_thesis: verum
end;
end;
end;
qy in Z by A13, XBOOLE_0:def_5;
hence contradiction by A3, A7, A8, A14, Def14; ::_thesis: verum
end;
now__::_thesis:_not_qy_in_X_\_Z
assume A17: qy in X \ Z ; ::_thesis: contradiction
A18: not qx,qy -are_equivalent
proof
assume qx,qy -are_equivalent ; ::_thesis: contradiction
then consider Z9 being Element of it2 such that
A19: qx in Z9 and
A20: qy in Z9 by A3, Def14;
percases ( Z = Z9 or Z <> Z9 ) ;
suppose Z = Z9 ; ::_thesis: contradiction
hence contradiction by A17, A20, XBOOLE_0:def_5; ::_thesis: verum
end;
suppose Z <> Z9 ; ::_thesis: contradiction
then Z misses Z9 by A8, EQREL_1:def_4;
then Z /\ Z9 = {} by XBOOLE_0:def_7;
hence contradiction by A7, A19, XBOOLE_0:def_4; ::_thesis: verum
end;
end;
end;
qy in X by A17, XBOOLE_0:def_5;
hence contradiction by A2, A6, A18, Def14; ::_thesis: verum
end;
hence contradiction by A11, A12, XBOOLE_0:def_3; ::_thesis: verum
end;
supposeA21: ( not X in it1 & X in it2 ) ; ::_thesis: contradiction
then reconsider X = X as Subset of tfsm ;
consider qx being Element of tfsm such that
A22: qx in X by A21, FINSEQ_4:87;
union it1 = the carrier of tfsm by EQREL_1:def_4;
then consider Z being set such that
A23: qx in Z and
A24: Z in it1 by TARSKI:def_4;
reconsider Z = Z as Subset of tfsm by A24;
set XZ = X \ Z;
set ZX = Z \ X;
set Y9 = (X \ Z) \/ (Z \ X);
(X \ Z) \/ (Z \ X) <> {}
proof
assume A25: (X \ Z) \/ (Z \ X) = {} ; ::_thesis: contradiction
then Z \ X = {} ;
then A26: Z c= X by XBOOLE_1:37;
X \ Z = {} by A25;
then X c= Z by XBOOLE_1:37;
hence contradiction by A21, A24, A26, XBOOLE_0:def_10; ::_thesis: verum
end;
then consider qy being Element of tfsm such that
A27: qy in (X \ Z) \/ (Z \ X) by SUBSET_1:4;
reconsider X = X as Element of it2 by A21;
A28: now__::_thesis:_not_qy_in_Z_\_X
assume A29: qy in Z \ X ; ::_thesis: contradiction
A30: not qx,qy -are_equivalent
proof
assume qx,qy -are_equivalent ; ::_thesis: contradiction
then consider Z9 being Element of it2 such that
A31: qx in Z9 and
A32: qy in Z9 by A3, Def14;
percases ( X = Z9 or X <> Z9 ) ;
suppose X = Z9 ; ::_thesis: contradiction
hence contradiction by A29, A32, XBOOLE_0:def_5; ::_thesis: verum
end;
suppose X <> Z9 ; ::_thesis: contradiction
then X misses Z9 by EQREL_1:def_4;
then X /\ Z9 = {} by XBOOLE_0:def_7;
hence contradiction by A22, A31, XBOOLE_0:def_4; ::_thesis: verum
end;
end;
end;
qy in Z by A29, XBOOLE_0:def_5;
hence contradiction by A2, A23, A24, A30, Def14; ::_thesis: verum
end;
now__::_thesis:_not_qy_in_X_\_Z
assume A33: qy in X \ Z ; ::_thesis: contradiction
A34: not qx,qy -are_equivalent
proof
assume qx,qy -are_equivalent ; ::_thesis: contradiction
then consider Z9 being Element of it1 such that
A35: qx in Z9 and
A36: qy in Z9 by A2, Def14;
percases ( Z = Z9 or Z <> Z9 ) ;
suppose Z = Z9 ; ::_thesis: contradiction
hence contradiction by A33, A36, XBOOLE_0:def_5; ::_thesis: verum
end;
suppose Z <> Z9 ; ::_thesis: contradiction
then Z misses Z9 by A24, EQREL_1:def_4;
then Z /\ Z9 = {} by XBOOLE_0:def_7;
hence contradiction by A23, A35, XBOOLE_0:def_4; ::_thesis: verum
end;
end;
end;
qy in X by A33, XBOOLE_0:def_5;
hence contradiction by A3, A22, A34, Def14; ::_thesis: verum
end;
hence contradiction by A27, A28, XBOOLE_0:def_3; ::_thesis: verum
end;
end;
end;
hence it1 = it2 ; ::_thesis: verum
end;
end;
:: deftheorem Def15 defines final_states_partition FSM_1:def_15_:_
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for b4 being a_partition of the carrier of tfsm holds
( b4 = final_states_partition tfsm iff b4 is final );
theorem Th39: :: FSM_1:39
for n being Element of NAT
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
final_states_partition tfsm = n -eq_states_partition tfsm
proof
let n be Element of NAT ; ::_thesis: for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
final_states_partition tfsm = n -eq_states_partition tfsm
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph st n + 1 = card the carrier of tfsm holds
final_states_partition tfsm = n -eq_states_partition tfsm
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ( n + 1 = card the carrier of tfsm implies final_states_partition tfsm = n -eq_states_partition tfsm )
assume n + 1 = card the carrier of tfsm ; ::_thesis: final_states_partition tfsm = n -eq_states_partition tfsm
then (n + 1) -eq_states_partition tfsm = n -eq_states_partition tfsm by Th35;
then n -eq_states_partition tfsm is final by Th37;
hence final_states_partition tfsm = n -eq_states_partition tfsm by Def15; ::_thesis: verum
end;
begin
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
let qf be Element of final_states_partition tfsm;
let s be Element of IAlph;
func(s,qf) -succ_class -> Element of final_states_partition tfsm means :Def16: :: FSM_1:def 16
ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & it = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) );
existence
ex b1 being Element of final_states_partition tfsm ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & b1 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) )
proof
consider q1 being Element of tfsm such that
A1: q1 in qf by FINSEQ_4:87;
set q9 = the Tran of tfsm . [q1,s];
set m = card the carrier of tfsm;
consider n being Nat such that
A2: card the carrier of tfsm = n + 1 by NAT_1:6;
reconsider n = n as Element of NAT by ORDINAL1:def_12;
final_states_partition tfsm = n -eq_states_partition tfsm by A2, Th39;
then reconsider IT = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q1,s])) as Element of final_states_partition tfsm by EQREL_1:def_3;
take IT ; ::_thesis: ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & IT = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) )
thus ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & IT = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) by A2, A1; ::_thesis: verum
end;
uniqueness
for b1, b2 being Element of final_states_partition tfsm st ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & b1 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) & ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & b2 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) holds
b1 = b2
proof
let it1, it2 be Element of final_states_partition tfsm; ::_thesis: ( ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & it1 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) & ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & it2 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) implies it1 = it2 )
given q1 being Element of tfsm, n1 being Element of NAT such that A3: q1 in qf and
A4: ( n1 + 1 = card the carrier of tfsm & it1 = Class ((n1 -eq_states_EqR tfsm),( the Tran of tfsm . [q1,s])) ) ; ::_thesis: ( for q being State of tfsm
for n being Element of NAT holds
( not q in qf or not n + 1 = card the carrier of tfsm or not it2 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) or it1 = it2 )
set q19 = the Tran of tfsm . [q1,s];
set m = n1 + 1;
given q2 being Element of tfsm, n2 being Element of NAT such that A5: q2 in qf and
A6: ( n2 + 1 = card the carrier of tfsm & it2 = Class ((n2 -eq_states_EqR tfsm),( the Tran of tfsm . [q2,s])) ) ; ::_thesis: it1 = it2
set q29 = the Tran of tfsm . [q2,s];
A7: ( 1 <= n1 + 1 & n1 = (n1 + 1) - 1 ) by INT_1:6;
final_states_partition tfsm is final by Def15;
then q1,q2 -are_equivalent by A3, A5, Def14;
then n1 + 1 -equivalent q1,q2 by Th24;
then n1 -equivalent the Tran of tfsm . [q1,s], the Tran of tfsm . [q2,s] by A7, Th27;
then [( the Tran of tfsm . [q1,s]),( the Tran of tfsm . [q2,s])] in n1 -eq_states_EqR tfsm by Def12;
hence it1 = it2 by A4, A6, EQREL_1:35; ::_thesis: verum
end;
end;
:: deftheorem Def16 defines -succ_class FSM_1:def_16_:_
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for qf being Element of final_states_partition tfsm
for s being Element of IAlph
for b6 being Element of final_states_partition tfsm holds
( b6 = (s,qf) -succ_class iff ex q being State of tfsm ex n being Element of NAT st
( q in qf & n + 1 = card the carrier of tfsm & b6 = Class ((n -eq_states_EqR tfsm),( the Tran of tfsm . [q,s])) ) );
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
let qf be Element of final_states_partition tfsm;
let s be Element of IAlph;
func(qf,s) -class_response -> Element of OAlph means :Def17: :: FSM_1:def 17
ex q being State of tfsm st
( q in qf & it = the OFun of tfsm . [q,s] );
existence
ex b1 being Element of OAlph ex q being State of tfsm st
( q in qf & b1 = the OFun of tfsm . [q,s] )
proof
consider q1 being Element of tfsm such that
A1: q1 in qf by FINSEQ_4:87;
take the OFun of tfsm . [q1,s] ; ::_thesis: ex q being State of tfsm st
( q in qf & the OFun of tfsm . [q1,s] = the OFun of tfsm . [q,s] )
thus ex q being State of tfsm st
( q in qf & the OFun of tfsm . [q1,s] = the OFun of tfsm . [q,s] ) by A1; ::_thesis: verum
end;
uniqueness
for b1, b2 being Element of OAlph st ex q being State of tfsm st
( q in qf & b1 = the OFun of tfsm . [q,s] ) & ex q being State of tfsm st
( q in qf & b2 = the OFun of tfsm . [q,s] ) holds
b1 = b2
proof
let it1, it2 be Element of OAlph; ::_thesis: ( ex q being State of tfsm st
( q in qf & it1 = the OFun of tfsm . [q,s] ) & ex q being State of tfsm st
( q in qf & it2 = the OFun of tfsm . [q,s] ) implies it1 = it2 )
given q1 being Element of tfsm such that A2: q1 in qf and
A3: it1 = the OFun of tfsm . [q1,s] ; ::_thesis: ( for q being State of tfsm holds
( not q in qf or not it2 = the OFun of tfsm . [q,s] ) or it1 = it2 )
given q2 being Element of tfsm such that A4: q2 in qf and
A5: it2 = the OFun of tfsm . [q2,s] ; ::_thesis: it1 = it2
final_states_partition tfsm is final by Def15;
then q1,q2 -are_equivalent by A2, A4, Def14;
hence it1 = it2 by A3, A5, Th19; ::_thesis: verum
end;
end;
:: deftheorem Def17 defines -class_response FSM_1:def_17_:_
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for qf being Element of final_states_partition tfsm
for s being Element of IAlph
for b6 being Element of OAlph holds
( b6 = (qf,s) -class_response iff ex q being State of tfsm st
( q in qf & b6 = the OFun of tfsm . [q,s] ) );
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
func the_reduction_of tfsm -> strict Mealy-FSM over IAlph,OAlph means :Def18: :: FSM_1:def 18
( the carrier of it = final_states_partition tfsm & ( for Q being State of it
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of it . (Q,s) & the OFun of tfsm . (q,s) = the OFun of it . (Q,s) ) ) & the InitS of tfsm in the InitS of it );
existence
ex b1 being strict Mealy-FSM over IAlph,OAlph st
( the carrier of b1 = final_states_partition tfsm & ( for Q being State of b1
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of b1 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of b1 . (Q,s) ) ) & the InitS of tfsm in the InitS of b1 )
proof
set part = final_states_partition tfsm;
reconsider m = card the carrier of tfsm as Element of NAT ;
set TR = the Tran of tfsm;
consider n being Nat such that
A1: m = n + 1 by NAT_1:6;
reconsider n = n as Element of NAT by ORDINAL1:def_12;
set IS = Class ((n -eq_states_EqR tfsm), the InitS of tfsm);
final_states_partition tfsm = n -eq_states_partition tfsm by A1, Th39;
then reconsider IS = Class ((n -eq_states_EqR tfsm), the InitS of tfsm) as Element of final_states_partition tfsm by EQREL_1:def_3;
deffunc H1( Element of final_states_partition tfsm, Element of IAlph) -> Element of final_states_partition tfsm = ($2,$1) -succ_class ;
consider Trf being Function of [:(final_states_partition tfsm),IAlph:],(final_states_partition tfsm) such that
A2: for q being Element of final_states_partition tfsm
for i being Element of IAlph holds Trf . (q,i) = H1(q,i) from BINOP_1:sch_4();
deffunc H2( Element of final_states_partition tfsm, Element of IAlph) -> Element of OAlph = ($1,$2) -class_response ;
consider OF being Function of [:(final_states_partition tfsm),IAlph:],OAlph such that
A3: for q being Element of final_states_partition tfsm
for i being Element of IAlph holds OF . (q,i) = H2(q,i) from BINOP_1:sch_4();
take IT = Mealy-FSM(# (final_states_partition tfsm),Trf,OF,IS #); ::_thesis: ( the carrier of IT = final_states_partition tfsm & ( for Q being State of IT
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of IT . (Q,s) & the OFun of tfsm . (q,s) = the OFun of IT . (Q,s) ) ) & the InitS of tfsm in the InitS of IT )
now__::_thesis:_for_Q_being_Element_of_IT
for_s_being_Element_of_IAlph
for_q_being_State_of_tfsm_st_q_in_Q_holds_
(_the_Tran_of_tfsm_._[q,s]_in_the_Tran_of_IT_._(Q,s)_&_the_OFun_of_tfsm_._[q,s]_=_the_OFun_of_IT_._[Q,s]_)
reconsider a19 = 1 as Integer ;
let Q be Element of IT; ::_thesis: for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . [q,s] in the Tran of IT . (Q,s) & the OFun of tfsm . [q,s] = the OFun of IT . [Q,s] )
let s be Element of IAlph; ::_thesis: for q being State of tfsm st q in Q holds
( the Tran of tfsm . [q,s] in the Tran of IT . (Q,s) & the OFun of tfsm . [q,s] = the OFun of IT . [Q,s] )
let q be State of tfsm; ::_thesis: ( q in Q implies ( the Tran of tfsm . [q,s] in the Tran of IT . (Q,s) & the OFun of tfsm . [q,s] = the OFun of IT . [Q,s] ) )
assume A4: q in Q ; ::_thesis: ( the Tran of tfsm . [q,s] in the Tran of IT . (Q,s) & the OFun of tfsm . [q,s] = the OFun of IT . [Q,s] )
reconsider s9 = s as Element of IAlph ;
reconsider Q9 = Q as Element of final_states_partition tfsm ;
consider Q1 being Element of tfsm, n1 being Element of NAT such that
A5: Q1 in Q9 and
n1 + 1 = card the carrier of tfsm and
A6: (s9,Q9) -succ_class = Class ((n1 -eq_states_EqR tfsm),( the Tran of tfsm . [Q1,s9])) by Def16;
final_states_partition tfsm is final by Def15;
then q,Q1 -are_equivalent by A4, A5, Def14;
then A7: n1 + 1 -equivalent q,Q1 by Th24;
reconsider n19 = n1 as Integer ;
( 1 <= n1 + 1 & (n19 + a19) - a19 = n19 ) by NAT_1:11;
then n1 -equivalent the Tran of tfsm . [q,s9], the Tran of tfsm . [Q1,s9] by A7, Th27;
then A8: [( the Tran of tfsm . [q,s9]),( the Tran of tfsm . [Q1,s9])] in n1 -eq_states_EqR tfsm by Def12;
the Tran of IT . (Q9,s9) = Class ((n1 -eq_states_EqR tfsm),( the Tran of tfsm . (Q1,s9))) by A2, A6;
hence the Tran of tfsm . [q,s] in the Tran of IT . (Q,s) by A8, EQREL_1:19; ::_thesis: the OFun of tfsm . [q,s] = the OFun of IT . [Q,s]
A9: the OFun of IT . (Q9,s9) = (Q9,s9) -class_response by A3;
consider Q1 being Element of tfsm such that
A10: Q1 in Q9 and
A11: (Q9,s9) -class_response = the OFun of tfsm . [Q1,s9] by Def17;
final_states_partition tfsm is final by Def15;
then q,Q1 -are_equivalent by A4, A10, Def14;
hence the OFun of tfsm . [q,s] = the OFun of IT . [Q,s] by A9, A11, Th19; ::_thesis: verum
end;
hence ( the carrier of IT = final_states_partition tfsm & ( for Q being State of IT
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of IT . (Q,s) & the OFun of tfsm . (q,s) = the OFun of IT . (Q,s) ) ) & the InitS of tfsm in the InitS of IT ) by EQREL_1:20; ::_thesis: verum
end;
uniqueness
for b1, b2 being strict Mealy-FSM over IAlph,OAlph st the carrier of b1 = final_states_partition tfsm & ( for Q being State of b1
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of b1 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of b1 . (Q,s) ) ) & the InitS of tfsm in the InitS of b1 & the carrier of b2 = final_states_partition tfsm & ( for Q being State of b2
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of b2 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of b2 . (Q,s) ) ) & the InitS of tfsm in the InitS of b2 holds
b1 = b2
proof
let it1, it2 be strict Mealy-FSM over IAlph,OAlph; ::_thesis: ( the carrier of it1 = final_states_partition tfsm & ( for Q being State of it1
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of it1 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of it1 . (Q,s) ) ) & the InitS of tfsm in the InitS of it1 & the carrier of it2 = final_states_partition tfsm & ( for Q being State of it2
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of it2 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of it2 . (Q,s) ) ) & the InitS of tfsm in the InitS of it2 implies it1 = it2 )
set TR = the Tran of tfsm;
assume that
A12: the carrier of it1 = final_states_partition tfsm and
A13: for Q being Element of it1
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of it1 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of it1 . (Q,s) ) and
A14: the InitS of tfsm in the InitS of it1 ; ::_thesis: ( not the carrier of it2 = final_states_partition tfsm or ex Q being State of it2 ex s being Element of IAlph ex q being State of tfsm st
( q in Q & not ( the Tran of tfsm . (q,s) in the Tran of it2 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of it2 . (Q,s) ) ) or not the InitS of tfsm in the InitS of it2 or it1 = it2 )
assume that
A15: the carrier of it2 = final_states_partition tfsm and
A16: for Q being Element of it2
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of it2 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of it2 . (Q,s) ) and
A17: the InitS of tfsm in the InitS of it2 ; ::_thesis: it1 = it2
A18: the OFun of it1 = the OFun of it2
proof
reconsider OF2 = the OFun of it2 as Function of [:(final_states_partition tfsm),IAlph:],OAlph by A15;
reconsider OF1 = the OFun of it1 as Function of [:(final_states_partition tfsm),IAlph:],OAlph by A12;
now__::_thesis:_for_Q_being_Element_of_final_states_partition_tfsm
for_s_being_Element_of_IAlph_holds_OF1_._(Q,s)_=_OF2_._(Q,s)
let Q be Element of final_states_partition tfsm; ::_thesis: for s being Element of IAlph holds OF1 . (Q,s) = OF2 . (Q,s)
let s be Element of IAlph; ::_thesis: OF1 . (Q,s) = OF2 . (Q,s)
consider q being Element of tfsm such that
A19: q in Q by FINSEQ_4:87;
thus OF1 . (Q,s) = the OFun of tfsm . (q,s) by A12, A13, A19
.= OF2 . (Q,s) by A15, A16, A19 ; ::_thesis: verum
end;
hence the OFun of it1 = the OFun of it2 by BINOP_1:2; ::_thesis: verum
end;
A20: the Tran of it1 = the Tran of it2
proof
reconsider T2 = the Tran of it2 as Function of [:(final_states_partition tfsm),IAlph:],(final_states_partition tfsm) by A15;
reconsider T1 = the Tran of it1 as Function of [:(final_states_partition tfsm),IAlph:],(final_states_partition tfsm) by A12;
now__::_thesis:_for_Q_being_Element_of_final_states_partition_tfsm
for_s_being_Element_of_IAlph_holds_T1_._(Q,s)_=_T2_._(Q,s)
let Q be Element of final_states_partition tfsm; ::_thesis: for s being Element of IAlph holds T1 . (Q,s) = T2 . (Q,s)
let s be Element of IAlph; ::_thesis: T1 . (Q,s) = T2 . (Q,s)
reconsider T19 = T1 . [Q,s], T29 = T2 . [Q,s] as Subset of tfsm by TARSKI:def_3;
A21: ( T19 = T29 or T19 misses T29 ) by EQREL_1:def_4;
consider q being Element of tfsm such that
A22: q in Q by FINSEQ_4:87;
( the Tran of tfsm . (q,s) in T1 . (Q,s) & the Tran of tfsm . (q,s) in T2 . (Q,s) ) by A12, A13, A15, A16, A22;
hence T1 . (Q,s) = T2 . (Q,s) by A21, XBOOLE_0:3; ::_thesis: verum
end;
hence the Tran of it1 = the Tran of it2 by BINOP_1:2; ::_thesis: verum
end;
the InitS of it1 = the InitS of it2
proof
the InitS of it2 in final_states_partition tfsm by A15;
then reconsider IS2 = the InitS of it2 as Subset of tfsm ;
the InitS of it1 in final_states_partition tfsm by A12;
then reconsider IS1 = the InitS of it1 as Subset of tfsm ;
( IS1 = IS2 or IS1 misses IS2 ) by A12, A15, EQREL_1:def_4;
hence the InitS of it1 = the InitS of it2 by A14, A17, XBOOLE_0:3; ::_thesis: verum
end;
hence it1 = it2 by A12, A15, A20, A18; ::_thesis: verum
end;
end;
:: deftheorem Def18 defines the_reduction_of FSM_1:def_18_:_
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for b4 being strict Mealy-FSM over IAlph,OAlph holds
( b4 = the_reduction_of tfsm iff ( the carrier of b4 = final_states_partition tfsm & ( for Q being State of b4
for s being Element of IAlph
for q being State of tfsm st q in Q holds
( the Tran of tfsm . (q,s) in the Tran of b4 . (Q,s) & the OFun of tfsm . (q,s) = the OFun of b4 . (Q,s) ) ) & the InitS of tfsm in the InitS of b4 ) );
registration
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
cluster the_reduction_of tfsm -> non empty finite strict ;
coherence
( not the_reduction_of tfsm is empty & the_reduction_of tfsm is finite )
proof
the carrier of (the_reduction_of tfsm) = final_states_partition tfsm by Def18;
hence ( not the_reduction_of tfsm is empty & the_reduction_of tfsm is finite ) ; ::_thesis: verum
end;
end;
theorem Th40: :: FSM_1:40
for IAlph, OAlph being non empty set
for w being FinSequence of IAlph
for rtfsm, tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm
for qr being State of rtfsm st rtfsm = the_reduction_of tfsm & q in qr holds
for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for rtfsm, tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm
for qr being State of rtfsm st rtfsm = the_reduction_of tfsm & q in qr holds
for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k
let w be FinSequence of IAlph; ::_thesis: for rtfsm, tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm
for qr being State of rtfsm st rtfsm = the_reduction_of tfsm & q in qr holds
for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k
let rtfsm, tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for q being State of tfsm
for qr being State of rtfsm st rtfsm = the_reduction_of tfsm & q in qr holds
for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k
let q be State of tfsm; ::_thesis: for qr being State of rtfsm st rtfsm = the_reduction_of tfsm & q in qr holds
for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k
let qr be State of rtfsm; ::_thesis: ( rtfsm = the_reduction_of tfsm & q in qr implies for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k )
set TR = the Tran of tfsm;
assume that
A1: rtfsm = the_reduction_of tfsm and
A2: q in qr ; ::_thesis: for k being Element of NAT st k in Seg ((len w) + 1) holds
((q,w) -admissible) . k in ((qr,w) -admissible) . k
defpred S1[ Element of NAT ] means ( $1 in Seg ((len w) + 1) implies ((q,w) -admissible) . $1 in ((qr,w) -admissible) . $1 );
A3: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A4: ( k in Seg ((len w) + 1) implies ((q,w) -admissible) . k in ((qr,w) -admissible) . k ) ; ::_thesis: S1[k + 1]
assume A5: k + 1 in Seg ((len w) + 1) ; ::_thesis: ((q,w) -admissible) . (k + 1) in ((qr,w) -admissible) . (k + 1)
A6: ( k = 0 or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( k = 0 or 1 <= k ) by A6, NAT_1:13;
supposeA7: k = 0 ; ::_thesis: ((q,w) -admissible) . (k + 1) in ((qr,w) -admissible) . (k + 1)
then ((q,w) -admissible) . (k + 1) = q by Def2;
hence ((q,w) -admissible) . (k + 1) in ((qr,w) -admissible) . (k + 1) by A2, A7, Def2; ::_thesis: verum
end;
supposeA8: 1 <= k ; ::_thesis: ((q,w) -admissible) . (k + 1) in ((qr,w) -admissible) . (k + 1)
A9: k + 1 <= (len w) + 1 by A5, FINSEQ_1:1;
then A10: k <= len w by XREAL_1:6;
then consider w1i being Element of IAlph, q1i, q1i1 being Element of tfsm such that
A11: ( w1i = w . k & q1i = ((q,w) -admissible) . k ) and
A12: ( q1i1 = ((q,w) -admissible) . (k + 1) & w1i -succ_of q1i = q1i1 ) by A8, Def2;
consider w2i being Element of IAlph, q2i, q2i1 being Element of rtfsm such that
A13: ( w2i = w . k & q2i = ((qr,w) -admissible) . k ) and
A14: ( q2i1 = ((qr,w) -admissible) . (k + 1) & w2i -succ_of q2i = q2i1 ) by A8, A10, Def2;
k <= k + 1 by NAT_1:11;
then k <= (len w) + 1 by A9, XXREAL_0:2;
then the Tran of tfsm . (q1i,w1i) in the Tran of rtfsm . (q2i,w2i) by A1, A4, A8, A11, A13, Def18, FINSEQ_1:1;
hence ((q,w) -admissible) . (k + 1) in ((qr,w) -admissible) . (k + 1) by A12, A14; ::_thesis: verum
end;
end;
end;
A15: S1[ 0 ] by FINSEQ_1:1;
thus for k being Element of NAT holds S1[k] from NAT_1:sch_1(A15, A3); ::_thesis: verum
end;
theorem Th41: :: FSM_1:41
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds tfsm, the_reduction_of tfsm -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds tfsm, the_reduction_of tfsm -are_equivalent
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: tfsm, the_reduction_of tfsm -are_equivalent
now__::_thesis:_for_w1_being_FinSequence_of_IAlph_holds_(_the_InitS_of_tfsm,w1)_-response_=_(_the_InitS_of_(the_reduction_of_tfsm),w1)_-response
set rtfsm = the_reduction_of tfsm;
let w1 be FinSequence of IAlph; ::_thesis: ( the InitS of tfsm,w1) -response = ( the InitS of (the_reduction_of tfsm),w1) -response
set ad1 = ( the InitS of tfsm,w1) -admissible ;
set ad2 = ( the InitS of (the_reduction_of tfsm),w1) -admissible ;
set r1 = ( the InitS of tfsm,w1) -response ;
set r2 = ( the InitS of (the_reduction_of tfsm),w1) -response ;
A1: the InitS of tfsm in the InitS of (the_reduction_of tfsm) by Def18;
A2: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((_the_InitS_of_tfsm,w1)_-response)_holds_
((_the_InitS_of_(the_reduction_of_tfsm),w1)_-response)_._k_=_((_the_InitS_of_tfsm,w1)_-response)_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len (( the InitS of tfsm,w1) -response) implies (( the InitS of (the_reduction_of tfsm),w1) -response) . k = (( the InitS of tfsm,w1) -response) . k )
assume that
A3: 1 <= k and
A4: k <= len (( the InitS of tfsm,w1) -response) ; ::_thesis: (( the InitS of (the_reduction_of tfsm),w1) -response) . k = (( the InitS of tfsm,w1) -response) . k
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: (( the InitS of tfsm,w1) -admissible) . k in (( the InitS of (the_reduction_of tfsm),w1) -admissible) . k by A1, Th40;
k in Seg (len (( the InitS of (the_reduction_of tfsm),w1) -admissible)) by A6, Def2;
then k in dom (( the InitS of (the_reduction_of tfsm),w1) -admissible) by FINSEQ_1:def_3;
then A8: (( the InitS of (the_reduction_of tfsm),w1) -admissible) . k is Element of (the_reduction_of tfsm) by FINSEQ_2:11;
k in Seg (len (( the InitS of tfsm,w1) -admissible)) by A6, Def2;
then k in dom (( the InitS of tfsm,w1) -admissible) by FINSEQ_1:def_3;
then A9: (( the InitS of tfsm,w1) -admissible) . 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 (( the InitS of (the_reduction_of tfsm),w1) -response) . k = the OFun of (the_reduction_of tfsm) . (((( the InitS of (the_reduction_of tfsm),w1) -admissible) . k),(w1 . k)) by A10, Def6
.= the OFun of tfsm . (((( the InitS of tfsm,w1) -admissible) . k),(w1 . k)) by A9, A11, A8, A7, Def18
.= (( the InitS of tfsm,w1) -response) . k by A10, Def6 ; ::_thesis: verum
end;
len (( the InitS of tfsm,w1) -response) = len w1 by Def6
.= len (( the InitS of (the_reduction_of tfsm),w1) -response) by Def6 ;
hence ( the InitS of tfsm,w1) -response = ( the InitS of (the_reduction_of tfsm),w1) -response by A2, FINSEQ_1:14; ::_thesis: verum
end;
hence tfsm, the_reduction_of tfsm -are_equivalent by Def9; ::_thesis: verum
end;
begin
definition
let IAlph, OAlph be non empty set ;
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph;
predtfsm1,tfsm2 -are_isomorphic means :Def19: :: FSM_1:def 19
ex Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st
( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm2 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm2 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm2 . ((Tf . q11),s) ) ) );
reflexivity
for tfsm1 being non empty Mealy-FSM over IAlph,OAlph ex Tf being Function of the carrier of tfsm1, the carrier of tfsm1 st
( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm1 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) )
proof
let tfsm1 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ex Tf being Function of the carrier of tfsm1, the carrier of tfsm1 st
( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm1 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) )
take Tf = id the carrier of tfsm1; ::_thesis: ( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm1 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) )
thus Tf is bijective ; ::_thesis: ( Tf . the InitS of tfsm1 = the InitS of tfsm1 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) )
thus Tf . the InitS of tfsm1 = the InitS of tfsm1 by FUNCT_1:17; ::_thesis: for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) )
let q be Element of tfsm1; ::_thesis: for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm1 . ((Tf . q),s) & the OFun of tfsm1 . (q,s) = the OFun of tfsm1 . ((Tf . q),s) )
let s be Element of IAlph; ::_thesis: ( Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm1 . ((Tf . q),s) & the OFun of tfsm1 . (q,s) = the OFun of tfsm1 . ((Tf . q),s) )
thus Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm1 . [q,s] by FUNCT_1:17
.= the Tran of tfsm1 . ((Tf . q),s) by FUNCT_1:17 ; ::_thesis: the OFun of tfsm1 . (q,s) = the OFun of tfsm1 . ((Tf . q),s)
thus the OFun of tfsm1 . (q,s) = the OFun of tfsm1 . ((Tf . q),s) by FUNCT_1:17; ::_thesis: verum
end;
symmetry
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph st ex Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st
( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm2 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm2 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm2 . ((Tf . q11),s) ) ) ) holds
ex Tf being Function of the carrier of tfsm2, the carrier of tfsm1 st
( Tf is bijective & Tf . the InitS of tfsm2 = the InitS of tfsm1 & ( for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) )
proof
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( ex Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st
( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm2 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm2 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm2 . ((Tf . q11),s) ) ) ) implies ex Tf being Function of the carrier of tfsm2, the carrier of tfsm1 st
( Tf is bijective & Tf . the InitS of tfsm2 = the InitS of tfsm1 & ( for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) ) )
given Tf being Function of the carrier of tfsm1, the carrier of tfsm2 such that A1: Tf is bijective and
A2: Tf . the InitS of tfsm1 = the InitS of tfsm2 and
A3: for q being Element of tfsm1
for 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) ) ; ::_thesis: ex Tf being Function of the carrier of tfsm2, the carrier of tfsm1 st
( Tf is bijective & Tf . the InitS of tfsm2 = the InitS of tfsm1 & ( for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf . q11),s) ) ) )
A4: dom Tf = the carrier of tfsm1 by FUNCT_2:def_1;
then A5: rng (Tf ") = the carrier of tfsm1 by A1, FUNCT_1:33;
A6: rng Tf = the carrier of tfsm2 by A1, FUNCT_2:def_3;
then the carrier of tfsm2 = dom (Tf ") by A1, FUNCT_1:33;
then reconsider Tf9 = Tf " as Function of the carrier of tfsm2, the carrier of tfsm1 by A5, FUNCT_2:1;
take Tf9 ; ::_thesis: ( Tf9 is bijective & Tf9 . the InitS of tfsm2 = the InitS of tfsm1 & ( for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf9 . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf9 . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf9 . q11),s) ) ) )
Tf9 is onto by A5, FUNCT_2:def_3;
hence Tf9 is bijective by A1; ::_thesis: ( Tf9 . the InitS of tfsm2 = the InitS of tfsm1 & ( for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf9 . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf9 . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf9 . q11),s) ) ) )
thus the InitS of tfsm1 = Tf9 . the InitS of tfsm2 by A1, A2, A4, FUNCT_1:34; ::_thesis: for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf9 . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf9 . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf9 . q11),s) )
now__::_thesis:_for_q_being_Element_of_tfsm2
for_s_being_Element_of_IAlph_holds_
(_the_Tran_of_tfsm1_._[(Tf9_._q),s]_=_Tf9_._(_the_Tran_of_tfsm2_._(q,s))_&_the_OFun_of_tfsm1_._((Tf9_._q),s)_=_the_OFun_of_tfsm2_._(q,s)_)
let q be Element of tfsm2; ::_thesis: for s being Element of IAlph holds
( the Tran of tfsm1 . [(Tf9 . q),s] = Tf9 . ( the Tran of tfsm2 . (q,s)) & the OFun of tfsm1 . ((Tf9 . q),s) = the OFun of tfsm2 . (q,s) )
let s be Element of IAlph; ::_thesis: ( the Tran of tfsm1 . [(Tf9 . q),s] = Tf9 . ( the Tran of tfsm2 . (q,s)) & the OFun of tfsm1 . ((Tf9 . q),s) = the OFun of tfsm2 . (q,s) )
A7: q = Tf . (Tf9 . q) by A1, A6, FUNCT_1:35;
thus the Tran of tfsm1 . [(Tf9 . q),s] = Tf9 . (Tf . ( the Tran of tfsm1 . ((Tf9 . q),s))) by A1, A4, FUNCT_1:34
.= Tf9 . ( the Tran of tfsm2 . (q,s)) by A3, A7 ; ::_thesis: the OFun of tfsm1 . ((Tf9 . q),s) = the OFun of tfsm2 . (q,s)
thus the OFun of tfsm1 . ((Tf9 . q),s) = the OFun of tfsm2 . (q,s) by A3, A7; ::_thesis: verum
end;
hence for q11 being State of tfsm2
for s being Element of IAlph holds
( Tf9 . ( the Tran of tfsm2 . (q11,s)) = the Tran of tfsm1 . ((Tf9 . q11),s) & the OFun of tfsm2 . (q11,s) = the OFun of tfsm1 . ((Tf9 . q11),s) ) ; ::_thesis: verum
end;
end;
:: deftheorem Def19 defines -are_isomorphic FSM_1:def_19_:_
for IAlph, OAlph being non empty set
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph holds
( tfsm1,tfsm2 -are_isomorphic iff ex Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st
( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm2 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm2 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm2 . ((Tf . q11),s) ) ) ) );
theorem Th42: :: FSM_1:42
for IAlph, OAlph being non empty set
for tfsm1, tfsm2, tfsm3 being non empty Mealy-FSM over IAlph,OAlph st tfsm1,tfsm2 -are_isomorphic & tfsm2,tfsm3 -are_isomorphic holds
tfsm1,tfsm3 -are_isomorphic
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm1, tfsm2, tfsm3 being non empty Mealy-FSM over IAlph,OAlph st tfsm1,tfsm2 -are_isomorphic & tfsm2,tfsm3 -are_isomorphic holds
tfsm1,tfsm3 -are_isomorphic
let tfsm1, tfsm2, tfsm3 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( tfsm1,tfsm2 -are_isomorphic & tfsm2,tfsm3 -are_isomorphic implies tfsm1,tfsm3 -are_isomorphic )
assume that
A1: tfsm1,tfsm2 -are_isomorphic and
A2: tfsm2,tfsm3 -are_isomorphic ; ::_thesis: tfsm1,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
for 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, Def19;
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
for 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, Def19;
take Tf = Tf2 * Tf1; :: according to FSM_1:def_19 ::_thesis: ( Tf is bijective & Tf . the InitS of tfsm1 = the InitS of tfsm3 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm3 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm3 . ((Tf . q11),s) ) ) )
thus Tf is bijective by A3, A6, FINSEQ_4:85; ::_thesis: ( Tf . the InitS of tfsm1 = the InitS of tfsm3 & ( for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm3 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm3 . ((Tf . q11),s) ) ) )
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; ::_thesis: for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm3 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm3 . ((Tf . q11),s) )
now__::_thesis:_for_q_being_Element_of_tfsm1
for_s1_being_Element_of_IAlph_holds_
(_the_Tran_of_tfsm3_._[(Tf_._q),s1]_=_Tf_._(_the_Tran_of_tfsm1_._(q,s1))_&_the_OFun_of_tfsm3_._[(Tf_._q),s1]_=_the_OFun_of_tfsm1_._(q,s1)_)
let q be Element of tfsm1; ::_thesis: for s1 being Element of IAlph holds
( the Tran of tfsm3 . [(Tf . q),s1] = Tf . ( the Tran of tfsm1 . (q,s1)) & the OFun of tfsm3 . [(Tf . q),s1] = the OFun of tfsm1 . (q,s1) )
let s1 be Element of IAlph; ::_thesis: ( the Tran of tfsm3 . [(Tf . q),s1] = Tf . ( the Tran of tfsm1 . (q,s1)) & the OFun of tfsm3 . [(Tf . q),s1] = the OFun of tfsm1 . (q,s1) )
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 ; ::_thesis: the OFun of tfsm3 . [(Tf . q),s1] = the OFun of tfsm1 . (q,s1)
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 ; ::_thesis: verum
end;
hence for q11 being State of tfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm1 . (q11,s)) = the Tran of tfsm3 . ((Tf . q11),s) & the OFun of tfsm1 . (q11,s) = the OFun of tfsm3 . ((Tf . q11),s) ) ; ::_thesis: verum
end;
theorem Th43: :: FSM_1:43
for OAlph, IAlph being non empty set
for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ) holds
for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k
proof
let OAlph, IAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ) holds
for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k
let w be FinSequence of IAlph; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ) holds
for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q11 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ) holds
for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k
let q11 be State of tfsm1; ::_thesis: for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ) holds
for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k
let Tf be Function of the carrier of tfsm1, the carrier of tfsm2; ::_thesis: ( ( for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ) implies for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k )
defpred S1[ Element of NAT ] means ( 1 <= $1 & $1 <= (len w) + 1 implies Tf . (((q11,w) -admissible) . $1) = (((Tf . q11),w) -admissible) . $1 );
assume A1: for q being State of tfsm1
for s being Element of IAlph holds Tf . ( the Tran of tfsm1 . (q,s)) = the Tran of tfsm2 . ((Tf . q),s) ; ::_thesis: for k being Element of NAT st 1 <= k & k <= (len w) + 1 holds
Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k
A2: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A3: ( 1 <= k & k <= (len w) + 1 implies Tf . (((q11,w) -admissible) . k) = (((Tf . q11),w) -admissible) . k ) ; ::_thesis: S1[k + 1]
assume that
1 <= k + 1 and
A4: k + 1 <= (len w) + 1 ; ::_thesis: Tf . (((q11,w) -admissible) . (k + 1)) = (((Tf . q11),w) -admissible) . (k + 1)
A5: ( k = 0 or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( k = 0 or 1 <= k ) by A5, NAT_1:13;
supposeA6: k = 0 ; ::_thesis: Tf . (((q11,w) -admissible) . (k + 1)) = (((Tf . q11),w) -admissible) . (k + 1)
hence Tf . (((q11,w) -admissible) . (k + 1)) = Tf . q11 by Def2
.= (((Tf . q11),w) -admissible) . (k + 1) by A6, Def2 ;
::_thesis: verum
end;
supposeA7: 1 <= k ; ::_thesis: Tf . (((q11,w) -admissible) . (k + 1)) = (((Tf . q11),w) -admissible) . (k + 1)
A8: len w <= (len w) + 1 by NAT_1:11;
A9: k <= len w by A4, XREAL_1:6;
then consider wi being Element of IAlph, qi, qi1 being State of tfsm1 such that
A10: ( wi = w . k & qi = ((q11,w) -admissible) . k ) and
A11: ( qi1 = ((q11,w) -admissible) . (k + 1) & wi -succ_of qi = qi1 ) by A7, Def2;
consider wri being Element of IAlph, qri, qri1 being State of tfsm2 such that
A12: ( wri = w . k & qri = (((Tf . q11),w) -admissible) . k ) and
A13: ( qri1 = (((Tf . q11),w) -admissible) . (k + 1) & wri -succ_of qri = qri1 ) by A7, A9, Def2;
thus Tf . (((q11,w) -admissible) . (k + 1)) = Tf . ( the Tran of tfsm1 . (qi,wi)) by A11
.= the Tran of tfsm2 . (qri,wri) by A1, A3, A7, A9, A8, A10, A12, XXREAL_0:2
.= (((Tf . q11),w) -admissible) . (k + 1) by A13 ; ::_thesis: verum
end;
end;
end;
A14: S1[ 0 ] ;
thus for k being Element of NAT holds S1[k] from NAT_1:sch_1(A14, A2); ::_thesis: verum
end;
theorem Th44: :: FSM_1:44
for OAlph, IAlph being non empty set
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11, q12 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for 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) ) ) holds
( q11,q12 -are_equivalent iff Tf . q11,Tf . q12 -are_equivalent )
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11, q12 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for 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) ) ) holds
( q11,q12 -are_equivalent iff Tf . q11,Tf . q12 -are_equivalent )
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q11, q12 being State of tfsm1
for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for 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) ) ) holds
( q11,q12 -are_equivalent iff Tf . q11,Tf . q12 -are_equivalent )
let q11, q12 be State of tfsm1; ::_thesis: for Tf being Function of the carrier of tfsm1, the carrier of tfsm2 st ( for q being State of tfsm1
for 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) ) ) holds
( q11,q12 -are_equivalent iff Tf . q11,Tf . q12 -are_equivalent )
let Tf be Function of the carrier of tfsm1, the carrier of tfsm2; ::_thesis: ( ( for q being State of tfsm1
for 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) ) ) implies ( q11,q12 -are_equivalent iff Tf . q11,Tf . q12 -are_equivalent ) )
set Stfsm1 = the carrier of tfsm1;
set Stfsm2 = the carrier of tfsm2;
set OF1 = the OFun of tfsm1;
set OF2 = the OFun of tfsm2;
assume A1: for q being Element of the carrier of tfsm1
for 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) ) ; ::_thesis: ( q11,q12 -are_equivalent iff Tf . q11,Tf . q12 -are_equivalent )
hereby ::_thesis: ( Tf . q11,Tf . q12 -are_equivalent implies q11,q12 -are_equivalent )
reconsider Tq2 = Tf . q12 as Element of the carrier of tfsm2 ;
reconsider Tq1 = Tf . q11 as Element of the carrier of tfsm2 ;
assume A2: q11,q12 -are_equivalent ; ::_thesis: Tf . q11,Tf . q12 -are_equivalent
now__::_thesis:_for_w_being_FinSequence_of_IAlph_holds_(Tq1,w)_-response_=_(Tq2,w)_-response
let w be FinSequence of IAlph; ::_thesis: (Tq1,w) -response = (Tq2,w) -response
A3: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((Tq1,w)_-response)_holds_
((Tq1,w)_-response)_._k_=_((Tq2,w)_-response)_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len ((Tq1,w) -response) implies ((Tq1,w) -response) . k = ((Tq2,w) -response) . k )
assume that
A4: 1 <= k and
A5: k <= len ((Tq1,w) -response) ; ::_thesis: ((Tq1,w) -response) . k = ((Tq2,w) -response) . k
len ((Tq1,w) -response) = len w by Def6;
then A6: k in Seg (len w) by A4, A5, FINSEQ_1:1;
then A7: k in Seg ((len w) + 1) by FINSEQ_2:8;
then A8: k <= (len w) + 1 by FINSEQ_1:1;
len ((q11,w) -admissible) = (len w) + 1 by Def2;
then k in dom ((q11,w) -admissible) by A7, FINSEQ_1:def_3;
then reconsider q1a = ((q11,w) -admissible) . k as Element of the carrier of tfsm1 by FINSEQ_2:11;
A9: k in NAT by ORDINAL1:def_12;
len ((q12,w) -admissible) = (len w) + 1 by Def2;
then k in dom ((q12,w) -admissible) by A7, FINSEQ_1:def_3;
then reconsider q2a = ((q12,w) -admissible) . k as Element of the carrier of tfsm1 by FINSEQ_2:11;
A10: k in dom w by A6, FINSEQ_1:def_3;
then reconsider wk = w . k as Element of IAlph by FINSEQ_2:11;
thus ((Tq1,w) -response) . k = the OFun of tfsm2 . [(((Tq1,w) -admissible) . k),(w . k)] by A10, Def6
.= the OFun of tfsm2 . ((Tf . q1a),wk) by A1, A4, A8, A9, Th43
.= the OFun of tfsm1 . (q1a,wk) by A1
.= ((q11,w) -response) . k by A10, Def6
.= ((q12,w) -response) . k by A2, Def10
.= the OFun of tfsm1 . (q2a,wk) by A10, Def6
.= the OFun of tfsm2 . ((Tf . q2a),wk) by A1
.= the OFun of tfsm2 . [(((Tq2,w) -admissible) . k),(w . k)] by A1, A4, A8, A9, Th43
.= ((Tq2,w) -response) . k by A10, Def6 ; ::_thesis: verum
end;
len ((Tq1,w) -response) = len w by Def6
.= len ((Tq2,w) -response) by Def6 ;
hence (Tq1,w) -response = (Tq2,w) -response by A3, FINSEQ_1:14; ::_thesis: verum
end;
hence Tf . q11,Tf . q12 -are_equivalent by Def10; ::_thesis: verum
end;
assume A11: Tf . q11,Tf . q12 -are_equivalent ; ::_thesis: q11,q12 -are_equivalent
now__::_thesis:_for_w_being_FinSequence_of_IAlph_holds_(q11,w)_-response_=_(q12,w)_-response
let w be FinSequence of IAlph; ::_thesis: (q11,w) -response = (q12,w) -response
A12: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((q11,w)_-response)_holds_
((q11,w)_-response)_._k_=_((q12,w)_-response)_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len ((q11,w) -response) implies ((q11,w) -response) . k = ((q12,w) -response) . k )
assume that
A13: 1 <= k and
A14: k <= len ((q11,w) -response) ; ::_thesis: ((q11,w) -response) . k = ((q12,w) -response) . k
len ((q11,w) -response) = len w by Def6;
then A15: k in Seg (len w) by A13, A14, FINSEQ_1:1;
then A16: k in Seg ((len w) + 1) by FINSEQ_2:8;
then A17: ( k in NAT & k <= (len w) + 1 ) by FINSEQ_1:1;
len ((q12,w) -admissible) = (len w) + 1 by Def2;
then k in dom ((q12,w) -admissible) by A16, FINSEQ_1:def_3;
then reconsider q2a = ((q12,w) -admissible) . k as Element of the carrier of tfsm1 by FINSEQ_2:11;
len ((q11,w) -admissible) = (len w) + 1 by Def2;
then k in dom ((q11,w) -admissible) by A16, FINSEQ_1:def_3;
then reconsider q1a = ((q11,w) -admissible) . k as Element of the carrier of tfsm1 by FINSEQ_2:11;
A18: k in dom w by A15, FINSEQ_1:def_3;
then reconsider wk = w . k as Element of IAlph by FINSEQ_2:11;
thus ((q11,w) -response) . k = the OFun of tfsm1 . ((((q11,w) -admissible) . k),(w . k)) by A18, Def6
.= the OFun of tfsm2 . ((Tf . q1a),wk) by A1
.= the OFun of tfsm2 . [((((Tf . q11),w) -admissible) . k),wk] by A1, A13, A17, Th43
.= (((Tf . q11),w) -response) . k by A18, Def6
.= (((Tf . q12),w) -response) . k by A11, Def10
.= the OFun of tfsm2 . [((((Tf . q12),w) -admissible) . k),(w . k)] by A18, Def6
.= the OFun of tfsm2 . ((Tf . q2a),wk) by A1, A13, A17, Th43
.= the OFun of tfsm1 . (q2a,(w . k)) by A1
.= ((q12,w) -response) . k by A18, Def6 ; ::_thesis: verum
end;
len ((q11,w) -response) = len w by Def6
.= len ((q12,w) -response) by Def6 ;
hence (q11,w) -response = (q12,w) -response by A12, FINSEQ_1:14; ::_thesis: verum
end;
hence q11,q12 -are_equivalent by Def10; ::_thesis: verum
end;
theorem Th45: :: FSM_1:45
for IAlph, OAlph being non empty set
for rtfsm, tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for qr1, qr2 being State of rtfsm st rtfsm = the_reduction_of tfsm & qr1 <> qr2 holds
not qr1,qr2 -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for rtfsm, tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for qr1, qr2 being State of rtfsm st rtfsm = the_reduction_of tfsm & qr1 <> qr2 holds
not qr1,qr2 -are_equivalent
let rtfsm, tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for qr1, qr2 being State of rtfsm st rtfsm = the_reduction_of tfsm & qr1 <> qr2 holds
not qr1,qr2 -are_equivalent
let qr1, qr2 be State of rtfsm; ::_thesis: ( rtfsm = the_reduction_of tfsm & qr1 <> qr2 implies not qr1,qr2 -are_equivalent )
assume that
A1: rtfsm = the_reduction_of tfsm and
A2: qr1 <> qr2 ; ::_thesis: not qr1,qr2 -are_equivalent
A3: the carrier of rtfsm = final_states_partition tfsm by A1, Def18;
then reconsider q19 = qr1 as Subset of tfsm by TARSKI:def_3;
consider x being Element of tfsm such that
A4: x in q19 by A3, FINSEQ_4:87;
reconsider q29 = qr2 as Subset of tfsm by A3, TARSKI:def_3;
consider y being Element of tfsm such that
A5: y in q29 by A3, FINSEQ_4:87;
A6: final_states_partition tfsm is final by Def15;
not x,y -are_equivalent
proof
assume x,y -are_equivalent ; ::_thesis: contradiction
then consider X being Element of rtfsm such that
A7: ( x in X & y in X ) by A3, A6, Def14;
A8: q29 misses q19 by A2, A3, EQREL_1:def_4;
X is Subset of tfsm by A3, TARSKI:def_3;
then ( X = q19 or X misses q19 ) by A3, EQREL_1:def_4;
hence contradiction by A4, A5, A7, A8, XBOOLE_0:3; ::_thesis: verum
end;
then consider w being FinSequence of IAlph such that
A9: (x,w) -response <> (y,w) -response by Def10;
set q1adm = (qr1,w) -admissible ;
set q2adm = (qr2,w) -admissible ;
set xadm = (x,w) -admissible ;
set yadm = (y,w) -admissible ;
set xresp = (x,w) -response ;
set yresp = (y,w) -response ;
len ((x,w) -response) = len w by Def6
.= len ((y,w) -response) by Def6 ;
then consider k being Nat such that
A10: ( 1 <= k & k <= len ((x,w) -response) ) and
A11: ((x,w) -response) . k <> ((y,w) -response) . k by A9, FINSEQ_1:14;
len ((x,w) -response) = len w by Def6;
then A12: k in Seg (len w) by A10, FINSEQ_1:1;
then k in Seg ((len w) + 1) by FINSEQ_2:8;
then A13: ((y,w) -admissible) . k in ((qr2,w) -admissible) . k by A1, A5, Th40;
set q1resp = (qr1,w) -response ;
set q2resp = (qr2,w) -response ;
A14: len ((qr1,w) -admissible) = (len w) + 1 by Def2
.= (len ((x,w) -response)) + 1 by Def6 ;
k in Seg (len ((x,w) -response)) by A10, FINSEQ_1:1;
then A15: k in Seg (len ((qr1,w) -admissible)) by A14, FINSEQ_2:8;
then k in dom ((qr1,w) -admissible) by FINSEQ_1:def_3;
then A16: ((qr1,w) -admissible) . k is Element of rtfsm by FINSEQ_2:11;
len ((qr2,w) -admissible) = (len w) + 1 by Def2
.= len ((qr1,w) -admissible) by Def2 ;
then k in dom ((qr2,w) -admissible) by A15, FINSEQ_1:def_3;
then A17: ((qr2,w) -admissible) . k is Element of rtfsm by FINSEQ_2:11;
k in dom w by A12, FINSEQ_1:def_3;
then A18: w . k is Element of IAlph by FINSEQ_2:11;
A19: len ((qr1,w) -admissible) = (len w) + 1 by Def2
.= len ((x,w) -admissible) by Def2 ;
then k in dom ((x,w) -admissible) by A15, FINSEQ_1:def_3;
then A20: ((x,w) -admissible) . k is Element of tfsm by FINSEQ_2:11;
len ((y,w) -admissible) = (len w) + 1 by Def2
.= len ((x,w) -admissible) by Def2 ;
then k in dom ((y,w) -admissible) by A15, A19, FINSEQ_1:def_3;
then A21: ((y,w) -admissible) . k is Element of tfsm by FINSEQ_2:11;
k in Seg ((len w) + 1) by A12, FINSEQ_2:8;
then A22: ((x,w) -admissible) . k in ((qr1,w) -admissible) . k by A1, A4, Th40;
now__::_thesis:_not_(qr1,w)_-response_=_(qr2,w)_-response
assume A23: (qr1,w) -response = (qr2,w) -response ; ::_thesis: contradiction
len w = len ((x,w) -response) by Def6;
then A24: k in dom w by A10, FINSEQ_3:25;
then A25: ((x,w) -response) . k = the OFun of tfsm . ((((x,w) -admissible) . k),(w . k)) by Def6;
A26: ((qr2,w) -response) . k = the OFun of rtfsm . ((((qr2,w) -admissible) . k),(w . k)) by A24, Def6
.= the OFun of tfsm . ((((y,w) -admissible) . k),(w . k)) by A1, A18, A17, A13, A21, Def18 ;
((qr1,w) -response) . k = the OFun of rtfsm . ((((qr1,w) -admissible) . k),(w . k)) by A24, Def6
.= the OFun of tfsm . ((((x,w) -admissible) . k),(w . k)) by A1, A16, A18, A22, A20, Def18 ;
hence contradiction by A11, A23, A24, A26, A25, Def6; ::_thesis: verum
end;
hence not qr1,qr2 -are_equivalent by Def10; ::_thesis: verum
end;
begin
definition
let IAlph, OAlph be non empty set ;
let IT be non empty Mealy-FSM over IAlph,OAlph;
attrIT is reduced means :Def20: :: FSM_1:def 20
for qa, qb being State of IT st qa <> qb holds
not qa,qb -are_equivalent ;
end;
:: deftheorem Def20 defines reduced FSM_1:def_20_:_
for IAlph, OAlph being non empty set
for IT being non empty Mealy-FSM over IAlph,OAlph holds
( IT is reduced iff for qa, qb being State of IT st qa <> qb holds
not qa,qb -are_equivalent );
registration
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
cluster the_reduction_of tfsm -> strict reduced ;
coherence
the_reduction_of tfsm is reduced
proof
let qa, qb be State of (the_reduction_of tfsm); :: according to FSM_1:def_20 ::_thesis: ( qa <> qb implies not qa,qb -are_equivalent )
thus ( qa <> qb implies not qa,qb -are_equivalent ) by Th45; ::_thesis: verum
end;
end;
registration
let IAlph, OAlph be non empty set ;
cluster non empty finite reduced for Mealy-FSM over IAlph,OAlph;
existence
ex b1 being non empty Mealy-FSM over IAlph,OAlph st
( b1 is reduced & b1 is finite )
proof
set M = the non empty finite Mealy-FSM over IAlph,OAlph;
take the_reduction_of the non empty finite Mealy-FSM over IAlph,OAlph ; ::_thesis: ( the_reduction_of the non empty finite Mealy-FSM over IAlph,OAlph is reduced & the_reduction_of the non empty finite Mealy-FSM over IAlph,OAlph is finite )
thus ( the_reduction_of the non empty finite Mealy-FSM over IAlph,OAlph is reduced & the_reduction_of the non empty finite Mealy-FSM over IAlph,OAlph is finite ) ; ::_thesis: verum
end;
end;
theorem Th46: :: FSM_1:46
for IAlph, OAlph being non empty set
for Rtfsm being non empty finite reduced Mealy-FSM over IAlph,OAlph holds Rtfsm, the_reduction_of Rtfsm -are_isomorphic
proof
let IAlph, OAlph be non empty set ; ::_thesis: for Rtfsm being non empty finite reduced Mealy-FSM over IAlph,OAlph holds Rtfsm, the_reduction_of Rtfsm -are_isomorphic
let Rtfsm be non empty finite reduced Mealy-FSM over IAlph,OAlph; ::_thesis: Rtfsm, the_reduction_of Rtfsm -are_isomorphic
set m = Rtfsm;
set rm = the_reduction_of Rtfsm;
set fpm = final_states_partition Rtfsm;
deffunc H1( Element of Rtfsm) -> Element of final_states_partition Rtfsm = (proj (final_states_partition Rtfsm)) . $1;
consider Tf being Function of the carrier of Rtfsm,(final_states_partition Rtfsm) such that
A1: for q being Element of Rtfsm holds Tf . q = H1(q) from FUNCT_2:sch_4();
A2: now__::_thesis:_Tf_is_one-to-one
assume not Tf is one-to-one ; ::_thesis: contradiction
then consider q1, q2 being set such that
A3: ( q1 in the carrier of Rtfsm & q2 in the carrier of Rtfsm ) and
A4: Tf . q1 = Tf . q2 and
A5: q1 <> q2 by FUNCT_2:19;
reconsider q1 = q1, q2 = q2 as State of Rtfsm by A3;
Tf . q1 = (proj (final_states_partition Rtfsm)) . q1 by A1;
then A6: q1 in Tf . q1 by EQREL_1:def_9;
A7: final_states_partition Rtfsm is final by Def15;
Tf . q2 = (proj (final_states_partition Rtfsm)) . q2 by A1;
then A8: q2 in Tf . q2 by EQREL_1:def_9;
not q1,q2 -are_equivalent by A5, Def20;
hence contradiction by A4, A7, A6, A8, Def14; ::_thesis: verum
end;
set Im1 = the InitS of Rtfsm;
A9: final_states_partition Rtfsm c= rng Tf
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in final_states_partition Rtfsm or x in rng Tf )
assume A10: x in final_states_partition Rtfsm ; ::_thesis: x in rng Tf
then reconsider pq = x as Subset of Rtfsm ;
consider q being Element of Rtfsm such that
A11: q in pq by A10, FINSEQ_4:87;
pq = (proj (final_states_partition Rtfsm)) . q by A10, A11, EQREL_1:65;
then Tf . q = pq by A1;
hence x in rng Tf by FUNCT_2:4; ::_thesis: verum
end;
rng Tf c= final_states_partition Rtfsm by RELAT_1:def_19;
then rng Tf = final_states_partition Rtfsm by A9, XBOOLE_0:def_10;
then A12: Tf is onto by FUNCT_2:def_3;
A13: the carrier of (the_reduction_of Rtfsm) = final_states_partition Rtfsm by Def18;
A14: now__::_thesis:_for_q_being_State_of_Rtfsm
for_s_being_Element_of_IAlph_holds_
(_Tf_._(_the_Tran_of_Rtfsm_._(q,s))_=_the_Tran_of_(the_reduction_of_Rtfsm)_._((Tf_._q),s)_&_the_OFun_of_Rtfsm_._(q,s)_=_the_OFun_of_(the_reduction_of_Rtfsm)_._((Tf_._q),s)_)
let q be State of Rtfsm; ::_thesis: for s being Element of IAlph holds
( Tf . ( the Tran of Rtfsm . (q,s)) = the Tran of (the_reduction_of Rtfsm) . ((Tf . q),s) & the OFun of Rtfsm . (q,s) = the OFun of (the_reduction_of Rtfsm) . ((Tf . q),s) )
let s be Element of IAlph; ::_thesis: ( Tf . ( the Tran of Rtfsm . (q,s)) = the Tran of (the_reduction_of Rtfsm) . ((Tf . q),s) & the OFun of Rtfsm . (q,s) = the OFun of (the_reduction_of Rtfsm) . ((Tf . q),s) )
reconsider Tfq = Tf . q as State of (the_reduction_of Rtfsm) by Def18;
A15: the Tran of (the_reduction_of Rtfsm) . [Tfq,s] is State of (the_reduction_of Rtfsm) ;
Tf . q = (proj (final_states_partition Rtfsm)) . q by A1;
then A16: q in Tf . q by EQREL_1:def_9;
then the Tran of Rtfsm . (q,s) in the Tran of (the_reduction_of Rtfsm) . ((Tf . q),s) by A13, Def18;
then the Tran of (the_reduction_of Rtfsm) . [(Tf . q),s] = (proj (final_states_partition Rtfsm)) . ( the Tran of Rtfsm . [q,s]) by A13, A15, EQREL_1:65;
hence Tf . ( the Tran of Rtfsm . (q,s)) = the Tran of (the_reduction_of Rtfsm) . ((Tf . q),s) by A1; ::_thesis: the OFun of Rtfsm . (q,s) = the OFun of (the_reduction_of Rtfsm) . ((Tf . q),s)
thus the OFun of Rtfsm . (q,s) = the OFun of (the_reduction_of Rtfsm) . ((Tf . q),s) by A13, A16, Def18; ::_thesis: verum
end;
the InitS of Rtfsm in the InitS of (the_reduction_of Rtfsm) by Def18;
then the InitS of (the_reduction_of Rtfsm) = (proj (final_states_partition Rtfsm)) . the InitS of Rtfsm by A13, EQREL_1:65;
then Tf . the InitS of Rtfsm = the InitS of (the_reduction_of Rtfsm) by A1;
hence Rtfsm, the_reduction_of Rtfsm -are_isomorphic by A13, A2, A12, A14, Def19; ::_thesis: verum
end;
theorem Th47: :: FSM_1:47
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( tfsm is reduced iff ex M being non empty finite Mealy-FSM over IAlph,OAlph st tfsm, the_reduction_of M -are_isomorphic )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( tfsm is reduced iff ex M being non empty finite Mealy-FSM over IAlph,OAlph st tfsm, the_reduction_of M -are_isomorphic )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ( tfsm is reduced iff ex M being non empty finite Mealy-FSM over IAlph,OAlph st tfsm, the_reduction_of M -are_isomorphic )
set M = tfsm;
hereby ::_thesis: ( ex M being non empty finite Mealy-FSM over IAlph,OAlph st tfsm, the_reduction_of M -are_isomorphic implies tfsm is reduced )
assume tfsm is reduced ; ::_thesis: ex M being non empty finite Mealy-FSM over IAlph,OAlph st tfsm, the_reduction_of M -are_isomorphic
then tfsm, the_reduction_of tfsm -are_isomorphic by Th46;
hence ex M being non empty finite Mealy-FSM over IAlph,OAlph st tfsm, the_reduction_of M -are_isomorphic ; ::_thesis: verum
end;
given MM being non empty finite Mealy-FSM over IAlph,OAlph such that A1: tfsm, the_reduction_of MM -are_isomorphic ; ::_thesis: tfsm is reduced
set rMM = the_reduction_of MM;
consider Tf being Function of the carrier of tfsm, the carrier of (the_reduction_of MM) such that
A2: Tf is bijective and
Tf . the InitS of tfsm = the InitS of (the_reduction_of MM) and
A3: for q being State of tfsm
for s being Element of IAlph holds
( Tf . ( the Tran of tfsm . (q,s)) = the Tran of (the_reduction_of MM) . ((Tf . q),s) & the OFun of tfsm . (q,s) = the OFun of (the_reduction_of MM) . ((Tf . q),s) ) by A1, Def19;
let qa, qb be State of tfsm; :: according to FSM_1:def_20 ::_thesis: ( qa <> qb implies not qa,qb -are_equivalent )
assume qa <> qb ; ::_thesis: not qa,qb -are_equivalent
then Tf . qa <> Tf . qb by A2, FUNCT_2:19;
then not Tf . qa,Tf . qb -are_equivalent by Th45;
hence not qa,qb -are_equivalent by A3, Th44; ::_thesis: verum
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
let IT be State of tfsm;
attrIT is accessible means :Def21: :: FSM_1:def 21
ex w being FinSequence of IAlph st the InitS of tfsm,w -leads_to IT;
end;
:: deftheorem Def21 defines accessible FSM_1:def_21_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph
for IT being State of tfsm holds
( IT is accessible iff ex w being FinSequence of IAlph st the InitS of tfsm,w -leads_to IT );
definition
let IAlph, OAlph be non empty set ;
let IT be non empty Mealy-FSM over IAlph,OAlph;
attrIT is connected means :Def22: :: FSM_1:def 22
for q being State of IT holds q is accessible ;
end;
:: deftheorem Def22 defines connected FSM_1:def_22_:_
for IAlph, OAlph being non empty set
for IT being non empty Mealy-FSM over IAlph,OAlph holds
( IT is connected iff for q being State of IT holds q is accessible );
registration
let IAlph, OAlph be non empty set ;
cluster non empty finite connected for Mealy-FSM over IAlph,OAlph;
existence
ex b1 being non empty finite Mealy-FSM over IAlph,OAlph st b1 is connected
proof
set out = the Element of OAlph;
reconsider S = {1} as non empty finite set ;
reconsider IS = 1 as Element of S by TARSKI:def_1;
set dF = [:S,IAlph:];
set Tr = [:S,IAlph:] --> 1;
reconsider T = [:S,IAlph:] --> 1 as Function of [:S,IAlph:],S ;
reconsider OF = [:S,IAlph:] --> the Element of OAlph as Function of [:S,IAlph:],OAlph ;
reconsider M = Mealy-FSM(# S,T,OF,IS #) as non empty finite Mealy-FSM over IAlph,OAlph ;
take M ; ::_thesis: M is connected
let q be State of M; :: according to FSM_1:def_22 ::_thesis: q is accessible
( q = 1 & the InitS of M, <*> IAlph -leads_to the InitS of M ) by Th2, TARSKI:def_1;
hence q is accessible by Def21; ::_thesis: verum
end;
end;
registration
let IAlph, OAlph be non empty set ;
let Ctfsm be non empty finite connected Mealy-FSM over IAlph,OAlph;
cluster the_reduction_of Ctfsm -> strict connected ;
coherence
the_reduction_of Ctfsm is connected
proof
set c = Ctfsm;
set rtfsm = the_reduction_of Ctfsm;
A1: the InitS of Ctfsm in the InitS of (the_reduction_of Ctfsm) by Def18;
assume not the_reduction_of Ctfsm is connected ; ::_thesis: contradiction
then consider Q being State of (the_reduction_of Ctfsm) such that
A2: not Q is accessible by Def22;
A3: the carrier of (the_reduction_of Ctfsm) = final_states_partition Ctfsm by Def18;
then reconsider Q9 = Q as Subset of Ctfsm by TARSKI:def_3;
Q in the carrier of (the_reduction_of Ctfsm) ;
then Q9 in final_states_partition Ctfsm by Def18;
then consider q being Element of Ctfsm such that
A4: q in Q by FINSEQ_4:87;
q is accessible by Def22;
then consider w being FinSequence of IAlph such that
A5: the InitS of Ctfsm,w -leads_to q by Def21;
1 <= (len w) + 1 by NAT_1:11;
then A6: (len w) + 1 in Seg ((len w) + 1) by FINSEQ_1:1;
then (len w) + 1 in Seg (len (( the InitS of (the_reduction_of Ctfsm),w) -admissible)) by Def2;
then (len w) + 1 in dom (( the InitS of (the_reduction_of Ctfsm),w) -admissible) by FINSEQ_1:def_3;
then A7: (( the InitS of (the_reduction_of Ctfsm),w) -admissible) . ((len w) + 1) in the carrier of (the_reduction_of Ctfsm) by FINSEQ_2:11;
then reconsider QQ = (( the InitS of (the_reduction_of Ctfsm),w) -admissible) . ((len w) + 1) as Subset of Ctfsm by A3;
A8: ( Q9 = QQ or Q9 misses QQ ) by A3, A7, EQREL_1:def_4;
(( the InitS of Ctfsm,w) -admissible) . ((len w) + 1) = q by A5, Def3;
then q in (( the InitS of (the_reduction_of Ctfsm),w) -admissible) . ((len w) + 1) by A1, A6, Th40;
then the InitS of (the_reduction_of Ctfsm),w -leads_to Q by A4, A8, Def3, XBOOLE_0:3;
hence contradiction by A2, Def21; ::_thesis: verum
end;
end;
registration
let IAlph, OAlph be non empty set ;
cluster non empty finite reduced connected for Mealy-FSM over IAlph,OAlph;
existence
ex b1 being non empty Mealy-FSM over IAlph,OAlph st
( b1 is connected & b1 is reduced & b1 is finite )
proof
set cm = the non empty finite connected Mealy-FSM over IAlph,OAlph;
take the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph ; ::_thesis: ( the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph is connected & the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph is reduced & the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph is finite )
thus ( the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph is connected & the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph is reduced & the_reduction_of the non empty finite connected Mealy-FSM over IAlph,OAlph is finite ) ; ::_thesis: verum
end;
end;
definition
let IAlph, OAlph be non empty set ;
let tfsm be non empty Mealy-FSM over IAlph,OAlph;
func accessibleStates tfsm -> set equals :: FSM_1:def 23
{ q where q is State of tfsm : q is accessible } ;
coherence
{ q where q is State of tfsm : q is accessible } is set ;
end;
:: deftheorem defines accessibleStates FSM_1:def_23_:_
for IAlph, OAlph being non empty set
for tfsm being non empty Mealy-FSM over IAlph,OAlph holds accessibleStates tfsm = { q where q is State of tfsm : q is accessible } ;
registration
let IAlph, OAlph be non empty set ;
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph;
cluster accessibleStates tfsm -> non empty finite ;
coherence
( accessibleStates tfsm is finite & not accessibleStates tfsm is empty )
proof
set m = tfsm;
set AS = { q where q is State of tfsm : q is accessible } ;
A1: { q where q is State of tfsm : q is accessible } c= the carrier of tfsm
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { q where q is State of tfsm : q is accessible } or x in the carrier of tfsm )
assume x in { q where q is State of tfsm : q is accessible } ; ::_thesis: x in the carrier of tfsm
then ex q being State of tfsm st
( x = q & q is accessible ) ;
hence x in the carrier of tfsm ; ::_thesis: verum
end;
the InitS of tfsm, <*> IAlph -leads_to the InitS of tfsm by Th2;
then the InitS of tfsm is accessible by Def21;
then the InitS of tfsm in { q where q is State of tfsm : q is accessible } ;
hence ( accessibleStates tfsm is finite & not accessibleStates tfsm is empty ) by A1; ::_thesis: verum
end;
end;
theorem Th48: :: FSM_1:48
for OAlph, IAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( accessibleStates tfsm c= the carrier of tfsm & ( for q being State of tfsm holds
( q in accessibleStates tfsm iff q is accessible ) ) )
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds
( accessibleStates tfsm c= the carrier of tfsm & ( for q being State of tfsm holds
( q in accessibleStates tfsm iff q is accessible ) ) )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ( accessibleStates tfsm c= the carrier of tfsm & ( for q being State of tfsm holds
( q in accessibleStates tfsm iff q is accessible ) ) )
set AS = { q where q is State of tfsm : q is accessible } ;
{ q where q is State of tfsm : q is accessible } c= the carrier of tfsm
proof
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { q where q is State of tfsm : q is accessible } or x in the carrier of tfsm )
assume x in { q where q is State of tfsm : q is accessible } ; ::_thesis: x in the carrier of tfsm
then ex q being State of tfsm st
( x = q & q is accessible ) ;
hence x in the carrier of tfsm ; ::_thesis: verum
end;
hence accessibleStates tfsm c= the carrier of tfsm ; ::_thesis: for q being State of tfsm holds
( q in accessibleStates tfsm iff q is accessible )
let q be State of tfsm; ::_thesis: ( q in accessibleStates tfsm iff q is accessible )
hereby ::_thesis: ( q is accessible implies q in accessibleStates tfsm )
assume q in accessibleStates tfsm ; ::_thesis: q is accessible
then ex q9 being State of tfsm st
( q9 = q & q9 is accessible ) ;
hence q is accessible ; ::_thesis: verum
end;
thus ( q is accessible implies q in accessibleStates tfsm ) ; ::_thesis: verum
end;
theorem Th49: :: FSM_1:49
for OAlph, IAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] is Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm)
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph holds the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] is Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm)
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] is Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm)
set cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:];
A1: accessibleStates tfsm c= the carrier of tfsm by Th48;
then [:(accessibleStates tfsm),IAlph:] c= [: the carrier of tfsm,IAlph:] by ZFMISC_1:96;
then the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] is Function of [:(accessibleStates tfsm),IAlph:], the carrier of tfsm by FUNCT_2:32;
then A2: dom ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) = [:(accessibleStates tfsm),IAlph:] by FUNCT_2:def_1;
rng ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) c= accessibleStates tfsm
proof
set I = the InitS of tfsm;
let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) or x in accessibleStates tfsm )
assume A3: x in rng ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) ; ::_thesis: x in accessibleStates tfsm
then consider d being set such that
A4: d in dom ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) and
A5: x = ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) . d by FUNCT_1:def_3;
A6: d `1 in accessibleStates tfsm by A2, A4, MCART_1:10;
then reconsider q = d `1 as State of tfsm by A1;
reconsider s = d `2 as Element of IAlph by A2, A4, MCART_1:10;
set qsa = (q,<*s*>) -admissible ;
A7: ( ((q,<*s*>) -admissible) . 1 = q & <*s*> . 1 = s ) by Def2, FINSEQ_1:40;
rng ( the Tran of tfsm | [:(accessibleStates tfsm),IAlph:]) c= the carrier of tfsm by RELAT_1:def_19;
then reconsider q1 = x as State of tfsm by A3;
1 <= len <*s*> by FINSEQ_1:39;
then A8: ex wi being Element of IAlph ex qi, qi1 being State of tfsm st
( wi = <*s*> . 1 & qi = ((q,<*s*>) -admissible) . 1 & qi1 = ((q,<*s*>) -admissible) . (1 + 1) & wi -succ_of qi = qi1 ) by Def2;
the Tran of tfsm . d = q1 by A2, A4, A5, FUNCT_1:49;
then A9: ((q,<*s*>) -admissible) . (1 + 1) = q1 by A4, A7, A8, MCART_1:21;
1 + 1 = 2 ;
then A10: 2 <= (len <*s*>) + 1 by FINSEQ_1:39;
q is accessible by A6, Th48;
then consider w being FinSequence of IAlph such that
A11: the InitS of tfsm,w -leads_to q by Def21;
len (w ^ <*s*>) = (len w) + (len <*s*>) by FINSEQ_1:22;
then (len (w ^ <*s*>)) + 1 = ((len w) + 1) + 1 by FINSEQ_1:39
.= (len w) + (1 + 1) ;
then (( the InitS of tfsm,(w ^ <*s*>)) -admissible) . ((len (w ^ <*s*>)) + 1) = q1 by A11, A9, A10, Th7;
then the InitS of tfsm,w ^ <*s*> -leads_to q1 by Def3;
then q1 is accessible by Def21;
hence x in accessibleStates tfsm ; ::_thesis: verum
end;
hence the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] is Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm) by A2, FUNCT_2:def_1, RELSET_1:4; ::_thesis: verum
end;
theorem :: FSM_1:50
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for cTran being Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm)
for cOFun being Function of [:(accessibleStates tfsm),IAlph:],OAlph
for cInitS being Element of accessibleStates tfsm st cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & cInitS = the InitS of tfsm holds
tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for cTran being Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm)
for cOFun being Function of [:(accessibleStates tfsm),IAlph:],OAlph
for cInitS being Element of accessibleStates tfsm st cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & cInitS = the InitS of tfsm holds
tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for cTran being Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm)
for cOFun being Function of [:(accessibleStates tfsm),IAlph:],OAlph
for cInitS being Element of accessibleStates tfsm st cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & cInitS = the InitS of tfsm holds
tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent
set M = tfsm;
let cTran be Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm); ::_thesis: for cOFun being Function of [:(accessibleStates tfsm),IAlph:],OAlph
for cInitS being Element of accessibleStates tfsm st cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & cInitS = the InitS of tfsm holds
tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent
let cOFun be Function of [:(accessibleStates tfsm),IAlph:],OAlph; ::_thesis: for cInitS being Element of accessibleStates tfsm st cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & cInitS = the InitS of tfsm holds
tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent
let cInitS be Element of accessibleStates tfsm; ::_thesis: ( cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & cInitS = the InitS of tfsm implies tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent )
assume that
A1: cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] and
A2: cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] and
A3: cInitS = the InitS of tfsm ; ::_thesis: tfsm, Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) -are_equivalent
let w be FinSequence of IAlph; :: according to FSM_1:def_9 ::_thesis: ( the InitS of tfsm,w) -response = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response
set cm = Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #);
set ma = ( the InitS of tfsm,w) -admissible ;
set cma = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible ;
set mr = ( the InitS of tfsm,w) -response ;
set cmr = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response ;
A4: now__::_thesis:_(_len_((_the_InitS_of_tfsm,w)_-admissible)_=_(len_w)_+_1_&_len_((_the_InitS_of_Mealy-FSM(#_(accessibleStates_tfsm),cTran,cOFun,cInitS_#),w)_-admissible)_=_(len_w)_+_1_&_(_for_j_being_Nat_holds_S1[j]_)_)
defpred S1[ Nat] means ( $1 in dom (( the InitS of tfsm,w) -admissible) implies (( the InitS of tfsm,w) -admissible) . $1 = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . $1 );
thus ( len (( the InitS of tfsm,w) -admissible) = (len w) + 1 & len (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) = (len w) + 1 ) by Def2; ::_thesis: for j being Nat holds S1[j]
then A5: dom (( the InitS of tfsm,w) -admissible) = Seg ((len w) + 1) by FINSEQ_1:def_3;
A6: for k being Nat st S1[k] holds
S1[k + 1]
proof
let j be Nat; ::_thesis: ( S1[j] implies S1[j + 1] )
assume A7: ( j in dom (( the InitS of tfsm,w) -admissible) implies (( the InitS of tfsm,w) -admissible) . j = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j ) ; ::_thesis: S1[j + 1]
A8: ( 0 = j or ( 0 < j & 0 + 1 = 1 ) ) ;
assume j + 1 in dom (( the InitS of tfsm,w) -admissible) ; ::_thesis: (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1)
then A9: j + 1 <= (len w) + 1 by A5, FINSEQ_1:1;
then A10: j <= len w by XREAL_1:6;
A11: j < (len w) + 1 by A9, NAT_1:13;
percases ( 0 = j or 1 <= j ) by A8, NAT_1:13;
supposeA12: 0 = j ; ::_thesis: (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1)
hence (( the InitS of tfsm,w) -admissible) . (j + 1) = the InitS of tfsm by Def2
.= (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1) by A3, A12, Def2 ;
::_thesis: verum
end;
supposeA13: 1 <= j ; ::_thesis: (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1)
then ( ex mwj being Element of IAlph ex mqj, mqj1 being State of tfsm st
( mwj = w . j & mqj = (( the InitS of tfsm,w) -admissible) . j & mqj1 = (( the InitS of tfsm,w) -admissible) . (j + 1) & mwj -succ_of mqj = mqj1 ) & ex cmwj being Element of IAlph ex cmqj, cmqj1 being State of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) st
( cmwj = w . j & cmqj = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j & cmqj1 = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1) & cmwj -succ_of cmqj = cmqj1 ) ) by A10, Def2;
hence (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1) by A1, A5, A7, A11, A13, FINSEQ_1:1, FUNCT_1:49; ::_thesis: verum
end;
end;
end;
A14: S1[ 0 ] by A5, FINSEQ_1:1;
thus for j being Nat holds S1[j] from NAT_1:sch_2(A14, A6); ::_thesis: verum
end;
then A15: ( the InitS of tfsm,w) -admissible = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible by FINSEQ_2:9;
now__::_thesis:_(_len_((_the_InitS_of_tfsm,w)_-response)_=_len_w_&_len_((_the_InitS_of_Mealy-FSM(#_(accessibleStates_tfsm),cTran,cOFun,cInitS_#),w)_-response)_=_len_w_&_(_for_j_being_Nat_st_j_in_dom_((_the_InitS_of_tfsm,w)_-response)_holds_
((_the_InitS_of_tfsm,w)_-response)_._j_=_((_the_InitS_of_Mealy-FSM(#_(accessibleStates_tfsm),cTran,cOFun,cInitS_#),w)_-response)_._j_)_)
thus ( len (( the InitS of tfsm,w) -response) = len w & len (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response) = len w ) by Def6; ::_thesis: for j being Nat st j in dom (( the InitS of tfsm,w) -response) holds
(( the InitS of tfsm,w) -response) . j = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response) . j
then A16: dom (( the InitS of tfsm,w) -response) = Seg (len w) by FINSEQ_1:def_3;
let j be Nat; ::_thesis: ( j in dom (( the InitS of tfsm,w) -response) implies (( the InitS of tfsm,w) -response) . j = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response) . j )
assume A17: j in dom (( the InitS of tfsm,w) -response) ; ::_thesis: (( the InitS of tfsm,w) -response) . j = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response) . j
then A18: j in dom w by A16, FINSEQ_1:def_3;
j in Seg ((len w) + 1) by A16, A17, FINSEQ_2:8;
then j in dom (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) by A4, FINSEQ_1:def_3;
then A19: (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j in accessibleStates tfsm by FINSEQ_2:11;
w . j in IAlph by A18, FINSEQ_2:11;
then A20: [((( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j),(w . j)] in [:(accessibleStates tfsm),IAlph:] by A19, ZFMISC_1:87;
thus (( the InitS of tfsm,w) -response) . j = the OFun of tfsm . [((( the InitS of tfsm,w) -admissible) . j),(w . j)] by A18, Def6
.= cOFun . [((( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j),(w . j)] by A2, A15, A20, FUNCT_1:49
.= (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response) . j by A18, Def6 ; ::_thesis: verum
end;
hence ( the InitS of tfsm,w) -response = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -response by FINSEQ_2:9; ::_thesis: verum
end;
theorem :: FSM_1:51
for OAlph, IAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph ex Ctfsm being non empty finite connected Mealy-FSM over IAlph,OAlph st
( the Tran of Ctfsm = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & the OFun of Ctfsm = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & the InitS of Ctfsm = the InitS of tfsm & tfsm,Ctfsm -are_equivalent )
proof
let OAlph, IAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph ex Ctfsm being non empty finite connected Mealy-FSM over IAlph,OAlph st
( the Tran of Ctfsm = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & the OFun of Ctfsm = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & the InitS of Ctfsm = the InitS of tfsm & tfsm,Ctfsm -are_equivalent )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ex Ctfsm being non empty finite connected Mealy-FSM over IAlph,OAlph st
( the Tran of Ctfsm = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & the OFun of Ctfsm = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & the InitS of Ctfsm = the InitS of tfsm & tfsm,Ctfsm -are_equivalent )
set M = tfsm;
set I = the InitS of tfsm;
accessibleStates tfsm c= the carrier of tfsm by Th48;
then [:(accessibleStates tfsm),IAlph:] c= [: the carrier of tfsm,IAlph:] by ZFMISC_1:96;
then reconsider cOFun = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] as Function of [:(accessibleStates tfsm),IAlph:],OAlph by FUNCT_2:32;
the InitS of tfsm, <*> IAlph -leads_to the InitS of tfsm by Th2;
then the InitS of tfsm is accessible by Def21;
then reconsider cInitS = the InitS of tfsm as Element of accessibleStates tfsm by Th48;
reconsider cTran = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] as Function of [:(accessibleStates tfsm),IAlph:],(accessibleStates tfsm) by Th49;
set cm = Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #);
A1: now__::_thesis:_for_w_being_FinSequence_of_IAlph_holds_(_the_InitS_of_tfsm,w)_-admissible_=_(_the_InitS_of_Mealy-FSM(#_(accessibleStates_tfsm),cTran,cOFun,cInitS_#),w)_-admissible
let w be FinSequence of IAlph; ::_thesis: ( the InitS of tfsm,w) -admissible = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible
set ma = ( the InitS of tfsm,w) -admissible ;
set cma = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible ;
now__::_thesis:_(_len_((_the_InitS_of_tfsm,w)_-admissible)_=_(len_w)_+_1_&_len_((_the_InitS_of_Mealy-FSM(#_(accessibleStates_tfsm),cTran,cOFun,cInitS_#),w)_-admissible)_=_(len_w)_+_1_&_(_for_j_being_Nat_holds_S1[j]_)_)
defpred S1[ Nat] means ( $1 in dom (( the InitS of tfsm,w) -admissible) implies (( the InitS of tfsm,w) -admissible) . $1 = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . $1 );
thus ( len (( the InitS of tfsm,w) -admissible) = (len w) + 1 & len (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) = (len w) + 1 ) by Def2; ::_thesis: for j being Nat holds S1[j]
then A2: dom (( the InitS of tfsm,w) -admissible) = Seg ((len w) + 1) by FINSEQ_1:def_3;
A3: for k being Nat st S1[k] holds
S1[k + 1]
proof
let j be Nat; ::_thesis: ( S1[j] implies S1[j + 1] )
assume A4: ( j in dom (( the InitS of tfsm,w) -admissible) implies (( the InitS of tfsm,w) -admissible) . j = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j ) ; ::_thesis: S1[j + 1]
A5: ( 0 = j or ( 0 < j & 0 + 1 = 1 ) ) ;
assume j + 1 in dom (( the InitS of tfsm,w) -admissible) ; ::_thesis: (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1)
then A6: j + 1 <= (len w) + 1 by A2, FINSEQ_1:1;
then A7: j <= len w by XREAL_1:6;
A8: j < (len w) + 1 by A6, NAT_1:13;
percases ( 0 = j or 1 <= j ) by A5, NAT_1:13;
supposeA9: 0 = j ; ::_thesis: (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1)
hence (( the InitS of tfsm,w) -admissible) . (j + 1) = the InitS of tfsm by Def2
.= (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1) by A9, Def2 ;
::_thesis: verum
end;
supposeA10: 1 <= j ; ::_thesis: (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1)
then ( ex mwj being Element of IAlph ex mqj, mqj1 being State of tfsm st
( mwj = w . j & mqj = (( the InitS of tfsm,w) -admissible) . j & mqj1 = (( the InitS of tfsm,w) -admissible) . (j + 1) & mwj -succ_of mqj = mqj1 ) & ex cmwj being Element of IAlph ex cmqj, cmqj1 being State of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) st
( cmwj = w . j & cmqj = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . j & cmqj1 = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1) & cmwj -succ_of cmqj = cmqj1 ) ) by A7, Def2;
hence (( the InitS of tfsm,w) -admissible) . (j + 1) = (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . (j + 1) by A2, A4, A8, A10, FINSEQ_1:1, FUNCT_1:49; ::_thesis: verum
end;
end;
end;
A11: S1[ 0 ] by A2, FINSEQ_1:1;
thus for j being Nat holds S1[j] from NAT_1:sch_2(A11, A3); ::_thesis: verum
end;
hence ( the InitS of tfsm,w) -admissible = ( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible by FINSEQ_2:9; ::_thesis: verum
end;
now__::_thesis:_for_q_being_State_of_Mealy-FSM(#_(accessibleStates_tfsm),cTran,cOFun,cInitS_#)_holds_q_is_accessible
let q be State of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #); ::_thesis: q is accessible
( q in accessibleStates tfsm & accessibleStates tfsm c= the carrier of tfsm ) by Th48;
then reconsider q9 = q as State of tfsm ;
q9 is accessible by Th48;
then consider w being FinSequence of IAlph such that
A12: the InitS of tfsm,w -leads_to q9 by Def21;
(( the InitS of tfsm,w) -admissible) . ((len w) + 1) = q9 by A12, Def3;
then (( the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w) -admissible) . ((len w) + 1) = q by A1;
then the InitS of Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #),w -leads_to q by Def3;
hence q is accessible by Def21; ::_thesis: verum
end;
then reconsider cm = Mealy-FSM(# (accessibleStates tfsm),cTran,cOFun,cInitS #) as non empty finite connected Mealy-FSM over IAlph,OAlph by Def22;
take cm ; ::_thesis: ( the Tran of cm = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] & the OFun of cm = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & the InitS of cm = the InitS of tfsm & tfsm,cm -are_equivalent )
thus the Tran of cm = the Tran of tfsm | [:(accessibleStates tfsm),IAlph:] ; ::_thesis: ( the OFun of cm = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] & the InitS of cm = the InitS of tfsm & tfsm,cm -are_equivalent )
thus the OFun of cm = the OFun of tfsm | [:(accessibleStates tfsm),IAlph:] ; ::_thesis: ( the InitS of cm = the InitS of tfsm & tfsm,cm -are_equivalent )
thus the InitS of cm = the InitS of tfsm ; ::_thesis: tfsm,cm -are_equivalent
let w be FinSequence of IAlph; :: according to FSM_1:def_9 ::_thesis: ( the InitS of tfsm,w) -response = ( the InitS of cm,w) -response
set ma = ( the InitS of tfsm,w) -admissible ;
set cma = ( the InitS of cm,w) -admissible ;
set mr = ( the InitS of tfsm,w) -response ;
set cmr = ( the InitS of cm,w) -response ;
A13: len (( the InitS of cm,w) -admissible) = (len w) + 1 by Def2;
now__::_thesis:_(_len_((_the_InitS_of_tfsm,w)_-response)_=_len_w_&_len_((_the_InitS_of_cm,w)_-response)_=_len_w_&_(_for_j_being_Nat_st_j_in_dom_((_the_InitS_of_tfsm,w)_-response)_holds_
((_the_InitS_of_tfsm,w)_-response)_._j_=_((_the_InitS_of_cm,w)_-response)_._j_)_)
thus ( len (( the InitS of tfsm,w) -response) = len w & len (( the InitS of cm,w) -response) = len w ) by Def6; ::_thesis: for j being Nat st j in dom (( the InitS of tfsm,w) -response) holds
(( the InitS of tfsm,w) -response) . j = (( the InitS of cm,w) -response) . j
then A14: dom (( the InitS of tfsm,w) -response) = Seg (len w) by FINSEQ_1:def_3;
let j be Nat; ::_thesis: ( j in dom (( the InitS of tfsm,w) -response) implies (( the InitS of tfsm,w) -response) . j = (( the InitS of cm,w) -response) . j )
assume A15: j in dom (( the InitS of tfsm,w) -response) ; ::_thesis: (( the InitS of tfsm,w) -response) . j = (( the InitS of cm,w) -response) . j
then A16: j in dom w by A14, FINSEQ_1:def_3;
j in Seg ((len w) + 1) by A14, A15, FINSEQ_2:8;
then j in dom (( the InitS of cm,w) -admissible) by A13, FINSEQ_1:def_3;
then A17: (( the InitS of cm,w) -admissible) . j in accessibleStates tfsm by FINSEQ_2:11;
w . j in IAlph by A16, FINSEQ_2:11;
then A18: [((( the InitS of cm,w) -admissible) . j),(w . j)] in [:(accessibleStates tfsm),IAlph:] by A17, ZFMISC_1:87;
A19: [((( the InitS of tfsm,w) -admissible) . j),(w . j)] = [((( the InitS of cm,w) -admissible) . j),(w . j)] by A1;
thus (( the InitS of tfsm,w) -response) . j = the OFun of tfsm . [((( the InitS of tfsm,w) -admissible) . j),(w . j)] by A16, Def6
.= cOFun . [((( the InitS of cm,w) -admissible) . j),(w . j)] by A19, A18, FUNCT_1:49
.= (( the InitS of cm,w) -response) . j by A16, Def6 ; ::_thesis: verum
end;
hence ( the InitS of tfsm,w) -response = ( the InitS of cm,w) -response by FINSEQ_2:9; ::_thesis: verum
end;
begin
definition
let IAlph be set ;
let OAlph be non empty set ;
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph;
functfsm1 -Mealy_union tfsm2 -> strict Mealy-FSM over IAlph,OAlph means :Def24: :: FSM_1:def 24
( the carrier of it = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of it = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of it = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of it = the InitS of tfsm1 );
existence
ex b1 being strict Mealy-FSM over IAlph,OAlph st
( the carrier of b1 = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of b1 = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of b1 = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of b1 = the InitS of tfsm1 )
proof
set Oftfsm1 = the OFun of tfsm1;
set Oftfsm2 = the OFun of tfsm2;
set Trtfsm1 = the Tran of tfsm1;
set Trtfsm2 = the Tran of tfsm2;
set Stfsm1 = the carrier of tfsm1;
set Stfsm2 = the carrier of tfsm2;
set Tr = the Tran of tfsm1 +* the Tran of tfsm2;
set Of = the OFun of tfsm1 +* the OFun of tfsm2;
reconsider S = the carrier of tfsm1 \/ the carrier of tfsm2 as non empty set ;
( rng the Tran of tfsm1 c= the carrier of tfsm1 & rng the Tran of tfsm2 c= the carrier of tfsm2 ) by RELAT_1:def_19;
then A1: ( rng ( the Tran of tfsm1 +* the Tran of tfsm2) c= (rng the Tran of tfsm1) \/ (rng the Tran of tfsm2) & (rng the Tran of tfsm1) \/ (rng the Tran of tfsm2) c= the carrier of tfsm1 \/ the carrier of tfsm2 ) by FUNCT_4:17, XBOOLE_1:13;
( dom the OFun of tfsm1 = [: the carrier of tfsm1,IAlph:] & dom the OFun of tfsm2 = [: the carrier of tfsm2,IAlph:] ) by FUNCT_2:def_1;
then A2: dom ( the OFun of tfsm1 +* the OFun of tfsm2) = [: the carrier of tfsm1,IAlph:] \/ [: the carrier of tfsm2,IAlph:] by FUNCT_4:def_1
.= [:( the carrier of tfsm1 \/ the carrier of tfsm2),IAlph:] by ZFMISC_1:97 ;
( rng the OFun of tfsm1 c= OAlph & rng the OFun of tfsm2 c= OAlph ) by RELAT_1:def_19;
then ( rng ( the OFun of tfsm1 +* the OFun of tfsm2) c= (rng the OFun of tfsm1) \/ (rng the OFun of tfsm2) & (rng the OFun of tfsm1) \/ (rng the OFun of tfsm2) c= OAlph \/ OAlph ) by FUNCT_4:17, XBOOLE_1:13;
then reconsider Of = the OFun of tfsm1 +* the OFun of tfsm2 as Function of [:S,IAlph:],OAlph by A2, FUNCT_2:2, XBOOLE_1:1;
( dom the Tran of tfsm1 = [: the carrier of tfsm1,IAlph:] & dom the Tran of tfsm2 = [: the carrier of tfsm2,IAlph:] ) by FUNCT_2:def_1;
then dom ( the Tran of tfsm1 +* the Tran of tfsm2) = [: the carrier of tfsm1,IAlph:] \/ [: the carrier of tfsm2,IAlph:] by FUNCT_4:def_1
.= [:( the carrier of tfsm1 \/ the carrier of tfsm2),IAlph:] by ZFMISC_1:97 ;
then reconsider Tr = the Tran of tfsm1 +* the Tran of tfsm2 as Function of [:S,IAlph:],S by A1, FUNCT_2:2, XBOOLE_1:1;
reconsider IS = the InitS of tfsm1 as Element of S by XBOOLE_0:def_3;
take Mealy-FSM(# S,Tr,Of,IS #) ; ::_thesis: ( the carrier of Mealy-FSM(# S,Tr,Of,IS #) = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of Mealy-FSM(# S,Tr,Of,IS #) = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of Mealy-FSM(# S,Tr,Of,IS #) = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of Mealy-FSM(# S,Tr,Of,IS #) = the InitS of tfsm1 )
thus ( the carrier of Mealy-FSM(# S,Tr,Of,IS #) = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of Mealy-FSM(# S,Tr,Of,IS #) = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of Mealy-FSM(# S,Tr,Of,IS #) = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of Mealy-FSM(# S,Tr,Of,IS #) = the InitS of tfsm1 ) ; ::_thesis: verum
end;
uniqueness
for b1, b2 being strict Mealy-FSM over IAlph,OAlph st the carrier of b1 = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of b1 = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of b1 = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of b1 = the InitS of tfsm1 & the carrier of b2 = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of b2 = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of b2 = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of b2 = the InitS of tfsm1 holds
b1 = b2 ;
end;
:: deftheorem Def24 defines -Mealy_union FSM_1:def_24_:_
for IAlph being set
for OAlph being non empty set
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for b5 being strict Mealy-FSM over IAlph,OAlph holds
( b5 = tfsm1 -Mealy_union tfsm2 iff ( the carrier of b5 = the carrier of tfsm1 \/ the carrier of tfsm2 & the Tran of b5 = the Tran of tfsm1 +* the Tran of tfsm2 & the OFun of b5 = the OFun of tfsm1 +* the OFun of tfsm2 & the InitS of b5 = the InitS of tfsm1 ) );
registration
let IAlph be set ;
let OAlph be non empty set ;
let tfsm1, tfsm2 be non empty finite Mealy-FSM over IAlph,OAlph;
clustertfsm1 -Mealy_union tfsm2 -> non empty finite strict ;
coherence
( not tfsm1 -Mealy_union tfsm2 is empty & tfsm1 -Mealy_union tfsm2 is finite )
proof
the carrier of (tfsm1 -Mealy_union tfsm2) = the carrier of tfsm1 \/ the carrier of tfsm2 by Def24;
hence ( not tfsm1 -Mealy_union tfsm2 is empty & tfsm1 -Mealy_union tfsm2 is finite ) ; ::_thesis: verum
end;
end;
theorem Th52: :: FSM_1:52
for IAlph, OAlph being non empty set
for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -admissible = (q,w) -admissible
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -admissible = (q,w) -admissible
let w be FinSequence of IAlph; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -admissible = (q,w) -admissible
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -admissible = (q,w) -admissible
let q11 be State of tfsm1; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -admissible = (q,w) -admissible
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -admissible = (q,w) -admissible
let q be State of tfsm; ::_thesis: ( tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q implies (q11,w) -admissible = (q,w) -admissible )
assume that
A1: tfsm = tfsm1 -Mealy_union tfsm2 and
A2: the carrier of tfsm1 misses the carrier of tfsm2 and
A3: q11 = q ; ::_thesis: (q11,w) -admissible = (q,w) -admissible
set ad1 = (q11,w) -admissible ;
set ad = (q,w) -admissible ;
defpred S1[ Nat] means ( 1 <= $1 & $1 <= len ((q11,w) -admissible) implies ((q11,w) -admissible) . $1 = ((q,w) -admissible) . $1 );
A4: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A5: ( 1 <= k & k <= len ((q11,w) -admissible) implies ((q11,w) -admissible) . k = ((q,w) -admissible) . k ) ; ::_thesis: S1[k + 1]
assume that
1 <= k + 1 and
A6: k + 1 <= len ((q11,w) -admissible) ; ::_thesis: ((q11,w) -admissible) . (k + 1) = ((q,w) -admissible) . (k + 1)
A7: ( k = 0 or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( k = 0 or 1 <= k ) by A7, NAT_1:13;
supposeA8: k = 0 ; ::_thesis: ((q11,w) -admissible) . (k + 1) = ((q,w) -admissible) . (k + 1)
hence ((q11,w) -admissible) . (k + 1) = q11 by Def2
.= ((q,w) -admissible) . (k + 1) by A3, A8, Def2 ;
::_thesis: verum
end;
supposeA9: 1 <= k ; ::_thesis: ((q11,w) -admissible) . (k + 1) = ((q,w) -admissible) . (k + 1)
k + 1 <= (len w) + 1 by A6, Def2;
then A10: k <= len w by XREAL_1:6;
then consider w1k being Element of IAlph, q1k, q1k1 being Element of tfsm1 such that
A11: ( w1k = w . k & q1k = ((q11,w) -admissible) . k ) and
A12: ( q1k1 = ((q11,w) -admissible) . (k + 1) & w1k -succ_of q1k = q1k1 ) by A9, Def2;
A13: ex wk being Element of IAlph ex qk, qk1 being Element of tfsm st
( wk = w . k & qk = ((q,w) -admissible) . k & qk1 = ((q,w) -admissible) . (k + 1) & wk -succ_of qk = qk1 ) by A9, A10, Def2;
len w <= (len w) + 1 by NAT_1:11;
then A14: k <= (len w) + 1 by A10, XXREAL_0:2;
[: the carrier of tfsm1,IAlph:] misses [: the carrier of tfsm2,IAlph:] by A2, ZFMISC_1:104;
then ( dom the Tran of tfsm2 = [: the carrier of tfsm2,IAlph:] & not [q1k,w1k] in [: the carrier of tfsm2,IAlph:] ) by FUNCT_2:def_1, XBOOLE_0:3;
hence ((q11,w) -admissible) . (k + 1) = ( the Tran of tfsm1 +* the Tran of tfsm2) . [q1k,w1k] by A12, FUNCT_4:11
.= ((q,w) -admissible) . (k + 1) by A1, A5, A9, A11, A13, A14, Def2, Def24 ;
::_thesis: verum
end;
end;
end;
A15: S1[ 0 ] ;
A16: for k being Nat holds S1[k] from NAT_1:sch_2(A15, A4);
len ((q11,w) -admissible) = (len w) + 1 by Def2
.= len ((q,w) -admissible) by Def2 ;
hence (q11,w) -admissible = (q,w) -admissible by A16, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th53: :: FSM_1:53
for IAlph, OAlph being non empty set
for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -response = (q,w) -response
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -response = (q,w) -response
let w be FinSequence of IAlph; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -response = (q,w) -response
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q11 being State of tfsm1
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -response = (q,w) -response
let q11 be State of tfsm1; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -response = (q,w) -response
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q holds
(q11,w) -response = (q,w) -response
let q be State of tfsm; ::_thesis: ( tfsm = tfsm1 -Mealy_union tfsm2 & the carrier of tfsm1 misses the carrier of tfsm2 & q11 = q implies (q11,w) -response = (q,w) -response )
set q1 = q11;
assume that
A1: tfsm = tfsm1 -Mealy_union tfsm2 and
A2: the carrier of tfsm1 misses the carrier of tfsm2 and
A3: q11 = q ; ::_thesis: (q11,w) -response = (q,w) -response
set ad1 = (q11,w) -admissible ;
set res = (q,w) -response ;
set res1 = (q11,w) -response ;
A4: len ((q11,w) -response) = len w by Def6;
A5: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((q11,w)_-response)_holds_
((q11,w)_-response)_._k_=_((q,w)_-response)_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len ((q11,w) -response) implies ((q11,w) -response) . k = ((q,w) -response) . k )
A6: [: the carrier of tfsm1,IAlph:] misses [: the carrier of tfsm2,IAlph:] by A2, ZFMISC_1:104;
assume ( 1 <= k & k <= len ((q11,w) -response) ) ; ::_thesis: ((q11,w) -response) . k = ((q,w) -response) . k
then A7: k in Seg (len w) by A4, FINSEQ_1:1;
then A8: k in dom w by FINSEQ_1:def_3;
k in Seg ((len w) + 1) by A7, FINSEQ_2:8;
then k in Seg (len ((q11,w) -admissible)) by Def2;
then k in dom ((q11,w) -admissible) by FINSEQ_1:def_3;
then A9: ((q11,w) -admissible) . k in the carrier of tfsm1 by FINSEQ_2:11;
w . k in IAlph by A8, FINSEQ_2:11;
then [(((q11,w) -admissible) . k),(w . k)] in [: the carrier of tfsm1,IAlph:] by A9, ZFMISC_1:87;
then A10: ( dom the OFun of tfsm2 = [: the carrier of tfsm2,IAlph:] & not [(((q11,w) -admissible) . k),(w . k)] in [: the carrier of tfsm2,IAlph:] ) by A6, FUNCT_2:def_1, XBOOLE_0:3;
((q11,w) -response) . k = the OFun of tfsm1 . [(((q11,w) -admissible) . k),(w . k)] by A8, Def6
.= ( the OFun of tfsm1 +* the OFun of tfsm2) . [(((q11,w) -admissible) . k),(w . k)] by A10, FUNCT_4:11
.= ( the OFun of tfsm1 +* the OFun of tfsm2) . [(((q,w) -admissible) . k),(w . k)] by A1, A2, A3, Th52
.= the OFun of tfsm . [(((q,w) -admissible) . k),(w . k)] by A1, Def24
.= ((q,w) -response) . k by A8, Def6 ;
hence ((q11,w) -response) . k = ((q,w) -response) . k ; ::_thesis: verum
end;
len ((q11,w) -response) = len w by Def6
.= len ((q,w) -response) by Def6 ;
hence (q11,w) -response = (q,w) -response by A5, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th54: :: FSM_1:54
for IAlph, OAlph being non empty set
for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -admissible = (q,w) -admissible
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -admissible = (q,w) -admissible
let w be FinSequence of IAlph; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -admissible = (q,w) -admissible
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -admissible = (q,w) -admissible
let q21 be State of tfsm2; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -admissible = (q,w) -admissible
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -admissible = (q,w) -admissible
let q be State of tfsm; ::_thesis: ( tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q implies (q21,w) -admissible = (q,w) -admissible )
set q9 = q21;
assume that
A1: tfsm = tfsm1 -Mealy_union tfsm2 and
A2: q21 = q ; ::_thesis: (q21,w) -admissible = (q,w) -admissible
set ad9 = (q21,w) -admissible ;
set ad = (q,w) -admissible ;
defpred S1[ Nat] means ( 1 <= $1 & $1 <= len ((q21,w) -admissible) implies ((q21,w) -admissible) . $1 = ((q,w) -admissible) . $1 );
A3: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A4: ( 1 <= k & k <= len ((q21,w) -admissible) implies ((q21,w) -admissible) . k = ((q,w) -admissible) . k ) ; ::_thesis: S1[k + 1]
assume that
1 <= k + 1 and
A5: k + 1 <= len ((q21,w) -admissible) ; ::_thesis: ((q21,w) -admissible) . (k + 1) = ((q,w) -admissible) . (k + 1)
A6: ( k = 0 or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( k = 0 or 1 <= k ) by A6, NAT_1:13;
supposeA7: k = 0 ; ::_thesis: ((q21,w) -admissible) . (k + 1) = ((q,w) -admissible) . (k + 1)
hence ((q21,w) -admissible) . (k + 1) = q21 by Def2
.= ((q,w) -admissible) . (k + 1) by A2, A7, Def2 ;
::_thesis: verum
end;
supposeA8: 1 <= k ; ::_thesis: ((q21,w) -admissible) . (k + 1) = ((q,w) -admissible) . (k + 1)
k + 1 <= (len w) + 1 by A5, Def2;
then A9: k <= len w by XREAL_1:6;
then consider w9k being Element of IAlph, q9k, q9k1 being Element of tfsm2 such that
A10: ( w9k = w . k & q9k = ((q21,w) -admissible) . k ) and
A11: ( q9k1 = ((q21,w) -admissible) . (k + 1) & w9k -succ_of q9k = q9k1 ) by A8, Def2;
A12: ex wk being Element of IAlph ex qk, qk1 being Element of tfsm st
( wk = w . k & qk = ((q,w) -admissible) . k & qk1 = ((q,w) -admissible) . (k + 1) & wk -succ_of qk = qk1 ) by A8, A9, Def2;
len w <= (len w) + 1 by NAT_1:11;
then A13: k <= (len w) + 1 by A9, XXREAL_0:2;
dom the Tran of tfsm2 = [: the carrier of tfsm2,IAlph:] by FUNCT_2:def_1;
hence ((q21,w) -admissible) . (k + 1) = ( the Tran of tfsm1 +* the Tran of tfsm2) . [q9k,w9k] by A11, FUNCT_4:13
.= ((q,w) -admissible) . (k + 1) by A1, A4, A8, A10, A12, A13, Def2, Def24 ;
::_thesis: verum
end;
end;
end;
A14: S1[ 0 ] ;
A15: for k being Nat holds S1[k] from NAT_1:sch_2(A14, A3);
len ((q21,w) -admissible) = (len w) + 1 by Def2
.= len ((q,w) -admissible) by Def2 ;
hence (q21,w) -admissible = (q,w) -admissible by A15, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th55: :: FSM_1:55
for IAlph, OAlph being non empty set
for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -response = (q,w) -response
proof
let IAlph, OAlph be non empty set ; ::_thesis: for w being FinSequence of IAlph
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -response = (q,w) -response
let w be FinSequence of IAlph; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph
for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -response = (q,w) -response
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: for q21 being State of tfsm2
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -response = (q,w) -response
let q21 be State of tfsm2; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -response = (q,w) -response
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for q being State of tfsm st tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q holds
(q21,w) -response = (q,w) -response
let q be State of tfsm; ::_thesis: ( tfsm = tfsm1 -Mealy_union tfsm2 & q21 = q implies (q21,w) -response = (q,w) -response )
set q9 = q21;
assume that
A1: tfsm = tfsm1 -Mealy_union tfsm2 and
A2: q21 = q ; ::_thesis: (q21,w) -response = (q,w) -response
set ad9 = (q21,w) -admissible ;
set res = (q,w) -response ;
set res9 = (q21,w) -response ;
A3: len ((q21,w) -response) = len w by Def6;
A4: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((q21,w)_-response)_holds_
((q21,w)_-response)_._k_=_((q,w)_-response)_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len ((q21,w) -response) implies ((q21,w) -response) . k = ((q,w) -response) . k )
assume ( 1 <= k & k <= len ((q21,w) -response) ) ; ::_thesis: ((q21,w) -response) . k = ((q,w) -response) . k
then A5: k in Seg (len w) by A3, FINSEQ_1:1;
then A6: k in dom w by FINSEQ_1:def_3;
k in Seg ((len w) + 1) by A5, FINSEQ_2:8;
then k in Seg (len ((q21,w) -admissible)) by Def2;
then k in dom ((q21,w) -admissible) by FINSEQ_1:def_3;
then A7: ((q21,w) -admissible) . k in the carrier of tfsm2 by FINSEQ_2:11;
( dom the OFun of tfsm2 = [: the carrier of tfsm2,IAlph:] & w . k in IAlph ) by A6, FINSEQ_2:11, FUNCT_2:def_1;
then A8: [(((q21,w) -admissible) . k),(w . k)] in dom the OFun of tfsm2 by A7, ZFMISC_1:87;
((q21,w) -response) . k = the OFun of tfsm2 . [(((q21,w) -admissible) . k),(w . k)] by A6, Def6
.= ( the OFun of tfsm1 +* the OFun of tfsm2) . [(((q21,w) -admissible) . k),(w . k)] by A8, FUNCT_4:13
.= ( the OFun of tfsm1 +* the OFun of tfsm2) . [(((q,w) -admissible) . k),(w . k)] by A1, A2, Th54
.= the OFun of tfsm . [(((q,w) -admissible) . k),(w . k)] by A1, Def24
.= ((q,w) -response) . k by A6, Def6 ;
hence ((q21,w) -response) . k = ((q,w) -response) . k ; ::_thesis: verum
end;
len ((q21,w) -response) = len w by Def6
.= len ((q,w) -response) by Def6 ;
hence (q21,w) -response = (q,w) -response by A4, FINSEQ_1:14; ::_thesis: verum
end;
theorem Th56: :: FSM_1:56
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for Rtfsm1, Rtfsm2 being non empty reduced Mealy-FSM over IAlph,OAlph st tfsm = Rtfsm1 -Mealy_union Rtfsm2 & the carrier of Rtfsm1 misses the carrier of Rtfsm2 & Rtfsm1,Rtfsm2 -are_equivalent holds
ex Q being State of (the_reduction_of tfsm) st
( the InitS of Rtfsm1 in Q & the InitS of Rtfsm2 in Q & Q = the InitS of (the_reduction_of tfsm) )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for Rtfsm1, Rtfsm2 being non empty reduced Mealy-FSM over IAlph,OAlph st tfsm = Rtfsm1 -Mealy_union Rtfsm2 & the carrier of Rtfsm1 misses the carrier of Rtfsm2 & Rtfsm1,Rtfsm2 -are_equivalent holds
ex Q being State of (the_reduction_of tfsm) st
( the InitS of Rtfsm1 in Q & the InitS of Rtfsm2 in Q & Q = the InitS of (the_reduction_of tfsm) )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for Rtfsm1, Rtfsm2 being non empty reduced Mealy-FSM over IAlph,OAlph st tfsm = Rtfsm1 -Mealy_union Rtfsm2 & the carrier of Rtfsm1 misses the carrier of Rtfsm2 & Rtfsm1,Rtfsm2 -are_equivalent holds
ex Q being State of (the_reduction_of tfsm) st
( the InitS of Rtfsm1 in Q & the InitS of Rtfsm2 in Q & Q = the InitS of (the_reduction_of tfsm) )
let Rtfsm1, Rtfsm2 be non empty reduced Mealy-FSM over IAlph,OAlph; ::_thesis: ( tfsm = Rtfsm1 -Mealy_union Rtfsm2 & the carrier of Rtfsm1 misses the carrier of Rtfsm2 & Rtfsm1,Rtfsm2 -are_equivalent implies ex Q being State of (the_reduction_of tfsm) st
( the InitS of Rtfsm1 in Q & the InitS of Rtfsm2 in Q & Q = the InitS of (the_reduction_of tfsm) ) )
set rtfsm1 = Rtfsm1;
set rtfsm2 = Rtfsm2;
assume that
A1: tfsm = Rtfsm1 -Mealy_union Rtfsm2 and
A2: the carrier of Rtfsm1 misses the carrier of Rtfsm2 and
A3: Rtfsm1,Rtfsm2 -are_equivalent ; ::_thesis: ex Q being State of (the_reduction_of tfsm) st
( the InitS of Rtfsm1 in Q & the InitS of Rtfsm2 in Q & Q = the InitS of (the_reduction_of tfsm) )
set Srtfsm2 = the carrier of Rtfsm2;
set Stfsm = the carrier of tfsm;
set Srtfsm1 = the carrier of Rtfsm1;
the carrier of tfsm = the carrier of Rtfsm1 \/ the carrier of Rtfsm2 by A1, Def24;
then reconsider IS2 = the InitS of Rtfsm2 as Element of the carrier of tfsm by XBOOLE_0:def_3;
reconsider IS1 = the InitS of Rtfsm1 as Element of the carrier of tfsm by A1, Def24;
now__::_thesis:_for_w_being_FinSequence_of_IAlph_holds_(IS1,w)_-response_=_(IS2,w)_-response
let w be FinSequence of IAlph; ::_thesis: (IS1,w) -response = (IS2,w) -response
( the InitS of Rtfsm1,w) -response = ( the InitS of Rtfsm2,w) -response by A3, Def9;
hence (IS1,w) -response = ( the InitS of Rtfsm2,w) -response by A1, A2, Th53
.= (IS2,w) -response by A1, Th55 ;
::_thesis: verum
end;
then A4: IS1,IS2 -are_equivalent by Def10;
set RUN = the_reduction_of tfsm;
the InitS of tfsm = the InitS of Rtfsm1 by A1, Def24;
then A5: the InitS of Rtfsm1 in the InitS of (the_reduction_of tfsm) by Def18;
set SRUN = the carrier of (the_reduction_of tfsm);
A6: the carrier of (the_reduction_of tfsm) = final_states_partition tfsm by Def18;
final_states_partition tfsm is final by Def15;
then consider X being Element of the carrier of (the_reduction_of tfsm) such that
A7: IS1 in X and
A8: IS2 in X by A6, A4, Def14;
take X ; ::_thesis: ( the InitS of Rtfsm1 in X & the InitS of Rtfsm2 in X & X = the InitS of (the_reduction_of tfsm) )
thus ( the InitS of Rtfsm1 in X & the InitS of Rtfsm2 in X ) by A7, A8; ::_thesis: X = the InitS of (the_reduction_of tfsm)
( X is Subset of the carrier of tfsm & the InitS of (the_reduction_of tfsm) is Subset of the carrier of tfsm ) by A6, TARSKI:def_3;
then ( X = the InitS of (the_reduction_of tfsm) or X misses the InitS of (the_reduction_of tfsm) ) by A6, EQREL_1:def_4;
hence X = the InitS of (the_reduction_of tfsm) by A7, A5, XBOOLE_0:3; ::_thesis: verum
end;
theorem Th57: :: FSM_1:57
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty reduced connected Mealy-FSM over IAlph,OAlph
for q1u, q2u being State of tfsm
for crq11, crq12 being State of CRtfsm1 st crq11 = q1u & crq12 = q2u & the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq11,crq12 -are_equivalent holds
not q1u,q2u -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty reduced connected Mealy-FSM over IAlph,OAlph
for q1u, q2u being State of tfsm
for crq11, crq12 being State of CRtfsm1 st crq11 = q1u & crq12 = q2u & the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq11,crq12 -are_equivalent holds
not q1u,q2u -are_equivalent
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for CRtfsm1, CRtfsm2 being non empty reduced connected Mealy-FSM over IAlph,OAlph
for q1u, q2u being State of tfsm
for crq11, crq12 being State of CRtfsm1 st crq11 = q1u & crq12 = q2u & the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq11,crq12 -are_equivalent holds
not q1u,q2u -are_equivalent
let CRtfsm1, CRtfsm2 be non empty reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: for q1u, q2u being State of tfsm
for crq11, crq12 being State of CRtfsm1 st crq11 = q1u & crq12 = q2u & the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq11,crq12 -are_equivalent holds
not q1u,q2u -are_equivalent
let q1u, q2u be State of tfsm; ::_thesis: for crq11, crq12 being State of CRtfsm1 st crq11 = q1u & crq12 = q2u & the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq11,crq12 -are_equivalent holds
not q1u,q2u -are_equivalent
let crq11, crq12 be State of CRtfsm1; ::_thesis: ( crq11 = q1u & crq12 = q2u & the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq11,crq12 -are_equivalent implies not q1u,q2u -are_equivalent )
set rtfsm1 = CRtfsm1;
set rtfsm2 = CRtfsm2;
set q1 = crq11;
set q2 = crq12;
assume that
A1: crq11 = q1u and
A2: crq12 = q2u and
A3: ( the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 ) ; ::_thesis: ( crq11,crq12 -are_equivalent or not q1u,q2u -are_equivalent )
assume not crq11,crq12 -are_equivalent ; ::_thesis: not q1u,q2u -are_equivalent
then consider w being FinSequence of IAlph such that
A4: (crq11,w) -response <> (crq12,w) -response by Def10;
(q1u,w) -response = (crq11,w) -response by A1, A3, Th53;
then (q1u,w) -response <> (q2u,w) -response by A2, A3, A4, Th53;
hence not q1u,q2u -are_equivalent by Def10; ::_thesis: verum
end;
theorem Th58: :: FSM_1:58
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm2, CRtfsm1 being non empty reduced connected Mealy-FSM over IAlph,OAlph
for q1u, q2u being State of tfsm
for crq21, crq22 being State of CRtfsm2 st crq21 = q1u & crq22 = q2u & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq21,crq22 -are_equivalent holds
not q1u,q2u -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm2, CRtfsm1 being non empty reduced connected Mealy-FSM over IAlph,OAlph
for q1u, q2u being State of tfsm
for crq21, crq22 being State of CRtfsm2 st crq21 = q1u & crq22 = q2u & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq21,crq22 -are_equivalent holds
not q1u,q2u -are_equivalent
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for CRtfsm2, CRtfsm1 being non empty reduced connected Mealy-FSM over IAlph,OAlph
for q1u, q2u being State of tfsm
for crq21, crq22 being State of CRtfsm2 st crq21 = q1u & crq22 = q2u & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq21,crq22 -are_equivalent holds
not q1u,q2u -are_equivalent
let CRtfsm2, CRtfsm1 be non empty reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: for q1u, q2u being State of tfsm
for crq21, crq22 being State of CRtfsm2 st crq21 = q1u & crq22 = q2u & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq21,crq22 -are_equivalent holds
not q1u,q2u -are_equivalent
let q1u, q2u be State of tfsm; ::_thesis: for crq21, crq22 being State of CRtfsm2 st crq21 = q1u & crq22 = q2u & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq21,crq22 -are_equivalent holds
not q1u,q2u -are_equivalent
let crq21, crq22 be State of CRtfsm2; ::_thesis: ( crq21 = q1u & crq22 = q2u & tfsm = CRtfsm1 -Mealy_union CRtfsm2 & not crq21,crq22 -are_equivalent implies not q1u,q2u -are_equivalent )
set rtfsm1 = CRtfsm1;
set rtfsm2 = CRtfsm2;
set q1 = crq21;
set q2 = crq22;
assume that
A1: crq21 = q1u and
A2: crq22 = q2u and
A3: tfsm = CRtfsm1 -Mealy_union CRtfsm2 ; ::_thesis: ( crq21,crq22 -are_equivalent or not q1u,q2u -are_equivalent )
assume not crq21,crq22 -are_equivalent ; ::_thesis: not q1u,q2u -are_equivalent
then consider w being FinSequence of IAlph such that
A4: (crq21,w) -response <> (crq22,w) -response by Def10;
(q1u,w) -response = (crq21,w) -response by A1, A3, Th55;
then (q1u,w) -response <> (q2u,w) -response by A2, A3, A4, Th55;
hence not q1u,q2u -are_equivalent by Def10; ::_thesis: verum
end;
theorem Th59: :: FSM_1:59
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm1 or not q1 <> q2 )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm1 or not q1 <> q2 )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm1 or not q1 <> q2 )
let CRtfsm1, CRtfsm2 be non empty finite reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: ( the carrier of CRtfsm1 misses the carrier of CRtfsm2 & tfsm = CRtfsm1 -Mealy_union CRtfsm2 implies for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm1 or not q1 <> q2 ) )
set rtfsm1 = CRtfsm1;
set rtfsm2 = CRtfsm2;
assume that
A1: the carrier of CRtfsm1 misses the carrier of CRtfsm2 and
A2: tfsm = CRtfsm1 -Mealy_union CRtfsm2 ; ::_thesis: for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm1 or not q1 <> q2 )
given Q being Element of (the_reduction_of tfsm), q1, q2 being Element of Q such that A3: ( q1 in the carrier of CRtfsm1 & q2 in the carrier of CRtfsm1 ) and
A4: q1 <> q2 ; ::_thesis: contradiction
consider tfsm1 being non empty finite Mealy-FSM over IAlph,OAlph such that
A5: CRtfsm1, the_reduction_of tfsm1 -are_isomorphic by Th47;
set tfsm1r = the_reduction_of tfsm1;
consider Tf being Function of the carrier of CRtfsm1, the carrier of (the_reduction_of tfsm1) such that
A6: Tf is bijective and
Tf . the InitS of CRtfsm1 = the InitS of (the_reduction_of tfsm1) and
A7: for q being State of CRtfsm1
for s being Element of IAlph holds
( Tf . ( the Tran of CRtfsm1 . (q,s)) = the Tran of (the_reduction_of tfsm1) . ((Tf . q),s) & the OFun of CRtfsm1 . (q,s) = the OFun of (the_reduction_of tfsm1) . ((Tf . q),s) ) by A5, Def19;
A8: dom Tf = the carrier of CRtfsm1 by FUNCT_2:def_1;
then A9: Tf . q1 <> Tf . q2 by A3, A4, A6, FUNCT_1:def_4;
rng Tf = the carrier of (the_reduction_of tfsm1) by A6, FUNCT_2:def_3;
then reconsider Tq1 = Tf . q1, Tq2 = Tf . q2 as Element of (the_reduction_of tfsm1) by A3, A8, FUNCT_1:def_3;
the carrier of tfsm = the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A2, Def24;
then reconsider q1 = q1, q2 = q2 as Element of tfsm by A3, XBOOLE_0:def_3;
reconsider q19 = q1, q29 = q2 as Element of CRtfsm1 by A3;
not Tq1,Tq2 -are_equivalent by A9, Th45;
then A10: not q19,q29 -are_equivalent by A7, Th44;
set rtfsm = the_reduction_of tfsm;
A11: final_states_partition tfsm is final by Def15;
A12: the carrier of (the_reduction_of tfsm) = final_states_partition tfsm by Def18;
then reconsider Q = Q as Subset of tfsm by TARSKI:def_3;
Q <> {} by A12, EQREL_1:def_4;
then q1,q2 -are_equivalent by A11, A12, Def14;
hence contradiction by A1, A2, A10, Th57; ::_thesis: verum
end;
theorem Th60: :: FSM_1:60
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm2 or not q2 in the carrier of CRtfsm2 or not q1 <> q2 )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm2 or not q2 in the carrier of CRtfsm2 or not q1 <> q2 )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm2 or not q2 in the carrier of CRtfsm2 or not q1 <> q2 )
let CRtfsm1, CRtfsm2 be non empty finite reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: ( tfsm = CRtfsm1 -Mealy_union CRtfsm2 implies for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm2 or not q2 in the carrier of CRtfsm2 or not q1 <> q2 ) )
set rtfsm1 = CRtfsm1;
set rtfsm2 = CRtfsm2;
set rtfsm = the_reduction_of tfsm;
consider tfsm2 being non empty finite Mealy-FSM over IAlph,OAlph such that
A1: CRtfsm2, the_reduction_of tfsm2 -are_isomorphic by Th47;
set tfsm2r = the_reduction_of tfsm2;
consider Tf being Function of the carrier of CRtfsm2, the carrier of (the_reduction_of tfsm2) such that
A2: Tf is bijective and
Tf . the InitS of CRtfsm2 = the InitS of (the_reduction_of tfsm2) and
A3: for q being State of CRtfsm2
for s being Element of IAlph holds
( Tf . ( the Tran of CRtfsm2 . (q,s)) = the Tran of (the_reduction_of tfsm2) . ((Tf . q),s) & the OFun of CRtfsm2 . (q,s) = the OFun of (the_reduction_of tfsm2) . ((Tf . q),s) ) by A1, Def19;
assume A4: tfsm = CRtfsm1 -Mealy_union CRtfsm2 ; ::_thesis: for Q being State of (the_reduction_of tfsm)
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm2 or not q2 in the carrier of CRtfsm2 or not q1 <> q2 )
then A5: the carrier of tfsm = the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by Def24;
given Q being Element of (the_reduction_of tfsm), q1, q2 being Element of Q such that A6: q1 in the carrier of CRtfsm2 and
A7: q2 in the carrier of CRtfsm2 and
A8: q1 <> q2 ; ::_thesis: contradiction
A9: dom Tf = the carrier of CRtfsm2 by FUNCT_2:def_1;
then A10: Tf . q1 <> Tf . q2 by A6, A7, A8, A2, FUNCT_1:def_4;
rng Tf = the carrier of (the_reduction_of tfsm2) by A2, FUNCT_2:def_3;
then reconsider Tq1 = Tf . q1, Tq2 = Tf . q2 as Element of (the_reduction_of tfsm2) by A6, A7, A9, FUNCT_1:def_3;
reconsider q2 = q2 as Element of tfsm by A7, A5, XBOOLE_0:def_3;
reconsider q29 = q2 as Element of CRtfsm2 by A7;
reconsider q1 = q1 as Element of tfsm by A6, A5, XBOOLE_0:def_3;
reconsider q19 = q1 as Element of CRtfsm2 by A6;
not Tq1,Tq2 -are_equivalent by A10, Th45;
then A11: not q19,q29 -are_equivalent by A3, Th44;
A12: the carrier of (the_reduction_of tfsm) = final_states_partition tfsm by Def18;
then reconsider Q = Q as Subset of tfsm by TARSKI:def_3;
A13: final_states_partition tfsm is final by Def15;
Q <> {} by A12, EQREL_1:def_4;
then q1,q2 -are_equivalent by A13, A12, Def14;
hence contradiction by A4, A11, Th58; ::_thesis: verum
end;
theorem Th61: :: FSM_1:61
for IAlph, OAlph being non empty set
for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent & tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm) ex q1, q2 being Element of Q st
( q1 in the carrier of CRtfsm1 & q2 in the carrier of CRtfsm2 & ( for q being Element of Q holds
( q = q1 or q = q2 ) ) )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm being non empty finite Mealy-FSM over IAlph,OAlph
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent & tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm) ex q1, q2 being Element of Q st
( q1 in the carrier of CRtfsm1 & q2 in the carrier of CRtfsm2 & ( for q being Element of Q holds
( q = q1 or q = q2 ) ) )
let tfsm be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent & tfsm = CRtfsm1 -Mealy_union CRtfsm2 holds
for Q being State of (the_reduction_of tfsm) ex q1, q2 being Element of Q st
( q1 in the carrier of CRtfsm1 & q2 in the carrier of CRtfsm2 & ( for q being Element of Q holds
( q = q1 or q = q2 ) ) )
let CRtfsm1, CRtfsm2 be non empty finite reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: ( the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent & tfsm = CRtfsm1 -Mealy_union CRtfsm2 implies for Q being State of (the_reduction_of tfsm) ex q1, q2 being Element of Q st
( q1 in the carrier of CRtfsm1 & q2 in the carrier of CRtfsm2 & ( for q being Element of Q holds
( q = q1 or q = q2 ) ) ) )
set rtfsm1 = CRtfsm1;
set rtfsm2 = CRtfsm2;
assume that
A1: the carrier of CRtfsm1 misses the carrier of CRtfsm2 and
A2: CRtfsm1,CRtfsm2 -are_equivalent and
A3: tfsm = CRtfsm1 -Mealy_union CRtfsm2 ; ::_thesis: for Q being State of (the_reduction_of tfsm) ex q1, q2 being Element of Q st
( q1 in the carrier of CRtfsm1 & q2 in the carrier of CRtfsm2 & ( for q being Element of Q holds
( q = q1 or q = q2 ) ) )
set ISrtfsm2 = the InitS of CRtfsm2;
set ISrtfsm1 = the InitS of CRtfsm1;
A4: the carrier of CRtfsm1 /\ the carrier of CRtfsm2 = {} by A1, XBOOLE_0:def_7;
set Stfsm = the carrier of tfsm;
set Srtfsm2 = the carrier of CRtfsm2;
set Srtfsm1 = the carrier of CRtfsm1;
set rtfsm = the_reduction_of tfsm;
set Srtfsm = the carrier of (the_reduction_of tfsm);
assume ex Q being State of (the_reduction_of tfsm) st
for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm2 or ex q being Element of Q st
( not q = q1 & not q = q2 ) ) ; ::_thesis: contradiction
then consider Q being Element of (the_reduction_of tfsm) such that
A5: for q1, q2 being Element of Q holds
( not q1 in the carrier of CRtfsm1 or not q2 in the carrier of CRtfsm2 or ex q being Element of Q st
( not q = q1 & not q = q2 ) ) ;
A6: the carrier of (the_reduction_of tfsm) = final_states_partition tfsm by Def18;
then reconsider Q = Q as Subset of the carrier of tfsm by TARSKI:def_3;
union (final_states_partition tfsm) = the carrier of tfsm by EQREL_1:def_4
.= the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A3, Def24 ;
then A7: Q c= the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A6, ZFMISC_1:74;
Q in the carrier of (the_reduction_of tfsm) ;
then A8: Q in final_states_partition tfsm by Def18;
then A9: Q <> {} by EQREL_1:def_4;
then consider q being Element of the carrier of tfsm such that
A10: q in Q by SUBSET_1:4;
percases ( q in the carrier of CRtfsm1 or q in the carrier of CRtfsm2 ) by A10, A7, XBOOLE_0:def_3;
supposeA11: q in the carrier of CRtfsm1 ; ::_thesis: contradiction
set Q9 = Q \ {q};
A12: now__::_thesis:_not_Q_\_{q}_<>_{}
A13: Q \ {q} c= Q by XBOOLE_1:36;
reconsider Q = Q as Subset of the carrier of tfsm ;
assume A14: Q \ {q} <> {} ; ::_thesis: contradiction
reconsider Q9 = Q \ {q} as Subset of the carrier of tfsm ;
consider x being Element of the carrier of tfsm such that
A15: x in Q9 by A14, SUBSET_1:4;
A16: Q9 c= the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A7, A13, XBOOLE_1:1;
percases ( x in the carrier of CRtfsm1 or x in the carrier of CRtfsm2 ) by A15, A16, XBOOLE_0:def_3;
supposeA17: x in the carrier of CRtfsm1 ; ::_thesis: contradiction
reconsider x = x as Element of Q by A15, XBOOLE_0:def_5;
reconsider q = q as Element of Q by A10;
( not q in the carrier of CRtfsm1 or not x in the carrier of CRtfsm1 or q = x ) by A1, A3, Th59;
hence contradiction by A11, A15, A17, ZFMISC_1:56; ::_thesis: verum
end;
supposeA18: x in the carrier of CRtfsm2 ; ::_thesis: contradiction
set Q99 = Q9 \ {x};
A19: now__::_thesis:_not_Q9_\_{x}_<>_{}
A20: Q9 \ {x} c= Q9 by XBOOLE_1:36;
reconsider Q9 = Q9 as Subset of the carrier of tfsm ;
assume A21: Q9 \ {x} <> {} ; ::_thesis: contradiction
reconsider Q99 = Q9 \ {x} as Subset of the carrier of tfsm ;
consider y being Element of the carrier of tfsm such that
A22: y in Q99 by A21, SUBSET_1:4;
A23: Q99 c= the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A16, A20, XBOOLE_1:1;
percases ( y in the carrier of CRtfsm1 or y in the carrier of CRtfsm2 ) by A22, A23, XBOOLE_0:def_3;
supposeA24: y in the carrier of CRtfsm1 ; ::_thesis: contradiction
reconsider q = q as Element of Q by A10;
A25: y in Q9 by A22, ZFMISC_1:56;
then reconsider y = y as Element of Q by ZFMISC_1:56;
( not q in the carrier of CRtfsm1 or not y in the carrier of CRtfsm1 or q = y ) by A1, A3, Th59;
hence contradiction by A11, A24, A25, ZFMISC_1:56; ::_thesis: verum
end;
supposeA26: y in the carrier of CRtfsm2 ; ::_thesis: contradiction
reconsider x = x as Element of Q by A15, ZFMISC_1:56;
y in Q9 by A22, ZFMISC_1:56;
then reconsider y = y as Element of Q by ZFMISC_1:56;
( not x in the carrier of CRtfsm2 or not y in the carrier of CRtfsm2 or x = y ) by A3, Th60;
hence contradiction by A18, A22, A26, ZFMISC_1:56; ::_thesis: verum
end;
end;
end;
now__::_thesis:_not_Q9_\_{x}_=_{}
assume A27: Q9 \ {x} = {} ; ::_thesis: contradiction
A28: for z being Element of Q holds
( z = q or z = x )
proof
given z being Element of Q such that A29: z <> q and
A30: z <> x ; ::_thesis: contradiction
z in Q9 by A9, A29, ZFMISC_1:56;
hence contradiction by A27, A30, ZFMISC_1:56; ::_thesis: verum
end;
reconsider x = x as Element of Q by A15, ZFMISC_1:56;
reconsider q = q as Element of Q by A10;
( not q in the carrier of CRtfsm1 or not x in the carrier of CRtfsm2 or ex z being Element of Q st
( z <> q & z <> x ) ) by A5;
hence contradiction by A11, A18, A28; ::_thesis: verum
end;
hence contradiction by A19; ::_thesis: verum
end;
end;
end;
now__::_thesis:_not_Q_\_{q}_=_{}
reconsider q = q as Element of the carrier of CRtfsm1 by A11;
q is accessible by Def22;
then consider w being FinSequence of IAlph such that
A31: the InitS of CRtfsm1,w -leads_to q by Def21;
set adl = the InitS of CRtfsm2 leads_to_under w;
A32: now__::_thesis:_the_InitS_of_CRtfsm2_leads_to_under_w_in_Q
reconsider q = q as Element of the carrier of tfsm ;
assume A33: not the InitS of CRtfsm2 leads_to_under w in Q ; ::_thesis: contradiction
reconsider q1 = q as Element of the carrier of CRtfsm1 ;
the InitS of CRtfsm2 leads_to_under w in the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by XBOOLE_0:def_3;
then reconsider adl = the InitS of CRtfsm2 leads_to_under w as Element of the carrier of tfsm by A3, Def24;
A34: for Y being Element of the carrier of (the_reduction_of tfsm) holds
( not q in Y or not adl in Y )
proof
reconsider Q = Q as Subset of the carrier of tfsm ;
assume ex Y being Element of the carrier of (the_reduction_of tfsm) st
( q in Y & adl in Y ) ; ::_thesis: contradiction
then consider Y being Element of the carrier of (the_reduction_of tfsm) such that
A35: q in Y and
A36: adl in Y ;
reconsider Y = Y as Subset of the carrier of tfsm by A6, TARSKI:def_3;
Y in the carrier of (the_reduction_of tfsm) ;
then Y in final_states_partition tfsm by Def18;
then Y misses Q by A8, A33, A36, EQREL_1:def_4;
hence contradiction by A10, A35, XBOOLE_0:3; ::_thesis: verum
end;
reconsider adl2 = adl as Element of the carrier of CRtfsm2 ;
final_states_partition tfsm is final by Def15;
then not q,adl -are_equivalent by A6, A34, Def14;
then consider dseq being FinSequence of IAlph such that
A37: (q,dseq) -response <> (adl,dseq) -response by Def10;
(q,dseq) -response = (q1,dseq) -response by A1, A3, Th53;
then A38: (q1,dseq) -response <> (adl2,dseq) -response by A3, A37, Th55;
the InitS of CRtfsm2,w -leads_to adl2 by Def5;
then ( the InitS of CRtfsm1,(w ^ dseq)) -response <> ( the InitS of CRtfsm2,(w ^ dseq)) -response by A31, A38, Th12;
hence contradiction by A2, Def9; ::_thesis: verum
end;
assume A39: Q \ {q} = {} ; ::_thesis: contradiction
now__::_thesis:_not_the_InitS_of_CRtfsm2_leads_to_under_w_in_Q
assume A40: the InitS of CRtfsm2 leads_to_under w in Q ; ::_thesis: contradiction
the InitS of CRtfsm2 leads_to_under w <> q by A4, XBOOLE_0:def_4;
hence contradiction by A39, A40, ZFMISC_1:56; ::_thesis: verum
end;
hence contradiction by A32; ::_thesis: verum
end;
hence contradiction by A12; ::_thesis: verum
end;
supposeA41: q in the carrier of CRtfsm2 ; ::_thesis: contradiction
set Q9 = Q \ {q};
A42: now__::_thesis:_not_Q_\_{q}_<>_{}
A43: Q \ {q} c= Q by XBOOLE_1:36;
reconsider Q = Q as Subset of the carrier of tfsm ;
assume A44: Q \ {q} <> {} ; ::_thesis: contradiction
reconsider Q9 = Q \ {q} as Subset of the carrier of tfsm ;
consider x being Element of the carrier of tfsm such that
A45: x in Q9 by A44, SUBSET_1:4;
A46: Q9 c= the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A7, A43, XBOOLE_1:1;
percases ( x in the carrier of CRtfsm1 or x in the carrier of CRtfsm2 ) by A45, A46, XBOOLE_0:def_3;
supposeA47: x in the carrier of CRtfsm1 ; ::_thesis: contradiction
set Q99 = Q9 \ {x};
A48: now__::_thesis:_not_Q9_\_{x}_<>_{}
A49: Q9 \ {x} c= Q9 by XBOOLE_1:36;
reconsider Q9 = Q9 as Subset of the carrier of tfsm ;
assume A50: Q9 \ {x} <> {} ; ::_thesis: contradiction
reconsider Q99 = Q9 \ {x} as Subset of the carrier of tfsm ;
consider y being Element of the carrier of tfsm such that
A51: y in Q99 by A50, SUBSET_1:4;
A52: Q99 c= the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A46, A49, XBOOLE_1:1;
percases ( y in the carrier of CRtfsm1 or y in the carrier of CRtfsm2 ) by A51, A52, XBOOLE_0:def_3;
supposeA53: y in the carrier of CRtfsm1 ; ::_thesis: contradiction
reconsider x = x as Element of Q by A45, ZFMISC_1:56;
y in Q9 by A51, ZFMISC_1:56;
then reconsider y = y as Element of Q by ZFMISC_1:56;
( not x in the carrier of CRtfsm1 or not y in the carrier of CRtfsm1 or x = y ) by A1, A3, Th59;
hence contradiction by A47, A51, A53, ZFMISC_1:56; ::_thesis: verum
end;
supposeA54: y in the carrier of CRtfsm2 ; ::_thesis: contradiction
reconsider q = q as Element of Q by A10;
A55: y in Q9 by A51, ZFMISC_1:56;
then reconsider y = y as Element of Q by ZFMISC_1:56;
( not q in the carrier of CRtfsm2 or not y in the carrier of CRtfsm2 or q = y ) by A3, Th60;
hence contradiction by A41, A54, A55, ZFMISC_1:56; ::_thesis: verum
end;
end;
end;
now__::_thesis:_not_Q9_\_{x}_=_{}
assume A56: Q9 \ {x} = {} ; ::_thesis: contradiction
A57: for z being Element of Q holds
( z = q or z = x )
proof
given z being Element of Q such that A58: z <> q and
A59: z <> x ; ::_thesis: contradiction
z in Q9 by A9, A58, ZFMISC_1:56;
hence contradiction by A56, A59, ZFMISC_1:56; ::_thesis: verum
end;
reconsider x = x as Element of Q by A45, ZFMISC_1:56;
reconsider q = q as Element of Q by A10;
( not x in the carrier of CRtfsm1 or not q in the carrier of CRtfsm2 or ex z being Element of Q st
( z <> x & z <> q ) ) by A5;
hence contradiction by A41, A47, A57; ::_thesis: verum
end;
hence contradiction by A48; ::_thesis: verum
end;
supposeA60: x in the carrier of CRtfsm2 ; ::_thesis: contradiction
reconsider x = x as Element of Q by A45, XBOOLE_0:def_5;
reconsider q = q as Element of Q by A10;
( not q in the carrier of CRtfsm2 or not x in the carrier of CRtfsm2 or q = x ) by A3, Th60;
hence contradiction by A41, A45, A60, ZFMISC_1:56; ::_thesis: verum
end;
end;
end;
now__::_thesis:_not_Q_\_{q}_=_{}
reconsider q = q as Element of the carrier of CRtfsm2 by A41;
q is accessible by Def22;
then consider w being FinSequence of IAlph such that
A61: the InitS of CRtfsm2,w -leads_to q by Def21;
set adl = the InitS of CRtfsm1 leads_to_under w;
A62: now__::_thesis:_the_InitS_of_CRtfsm1_leads_to_under_w_in_Q
reconsider q = q as Element of the carrier of tfsm ;
assume A63: not the InitS of CRtfsm1 leads_to_under w in Q ; ::_thesis: contradiction
reconsider q1 = q as Element of the carrier of CRtfsm2 ;
the InitS of CRtfsm1 leads_to_under w in the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by XBOOLE_0:def_3;
then reconsider adl = the InitS of CRtfsm1 leads_to_under w as Element of the carrier of tfsm by A3, Def24;
A64: for Y being Element of the carrier of (the_reduction_of tfsm) holds
( not q in Y or not adl in Y )
proof
assume ex Y being Element of the carrier of (the_reduction_of tfsm) st
( q in Y & adl in Y ) ; ::_thesis: contradiction
then consider Y being Element of the carrier of (the_reduction_of tfsm) such that
A65: q in Y and
A66: adl in Y ;
reconsider Y = Y as Subset of the carrier of tfsm by A6, TARSKI:def_3;
Y in the carrier of (the_reduction_of tfsm) ;
then Y in final_states_partition tfsm by Def18;
then Y misses Q by A8, A63, A66, EQREL_1:def_4;
hence contradiction by A10, A65, XBOOLE_0:3; ::_thesis: verum
end;
reconsider adl2 = adl as Element of the carrier of CRtfsm1 ;
final_states_partition tfsm is final by Def15;
then not q,adl -are_equivalent by A6, A64, Def14;
then consider dseq being FinSequence of IAlph such that
A67: (q,dseq) -response <> (adl,dseq) -response by Def10;
(q,dseq) -response = (q1,dseq) -response by A3, Th55;
then A68: (q1,dseq) -response <> (adl2,dseq) -response by A1, A3, A67, Th53;
the InitS of CRtfsm1,w -leads_to adl2 by Def5;
then ( the InitS of CRtfsm2,(w ^ dseq)) -response <> ( the InitS of CRtfsm1,(w ^ dseq)) -response by A61, A68, Th12;
hence contradiction by A2, Def9; ::_thesis: verum
end;
assume A69: Q \ {q} = {} ; ::_thesis: contradiction
now__::_thesis:_not_the_InitS_of_CRtfsm1_leads_to_under_w_in_Q
assume A70: the InitS of CRtfsm1 leads_to_under w in Q ; ::_thesis: contradiction
the InitS of CRtfsm1 leads_to_under w <> q by A1, XBOOLE_0:3;
hence contradiction by A69, A70, ZFMISC_1:56; ::_thesis: verum
end;
hence contradiction by A62; ::_thesis: verum
end;
hence contradiction by A42; ::_thesis: verum
end;
end;
end;
begin
theorem Th62: :: FSM_1:62
for IAlph, OAlph being non empty set
for tfsm1, tfsm2 being non empty finite Mealy-FSM over IAlph,OAlph ex fsm1, fsm2 being non empty finite Mealy-FSM over IAlph,OAlph st
( the carrier of fsm1 misses the carrier of fsm2 & fsm1,tfsm1 -are_isomorphic & fsm2,tfsm2 -are_isomorphic )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm1, tfsm2 being non empty finite Mealy-FSM over IAlph,OAlph ex fsm1, fsm2 being non empty finite Mealy-FSM over IAlph,OAlph st
( the carrier of fsm1 misses the carrier of fsm2 & fsm1,tfsm1 -are_isomorphic & fsm2,tfsm2 -are_isomorphic )
deffunc H1( set ) -> set = $1 `2 ;
set z = 0 ;
set zz = 1;
set A = {0};
set B = {1};
let tfsm1, tfsm2 be non empty finite Mealy-FSM over IAlph,OAlph; ::_thesis: ex fsm1, fsm2 being non empty finite Mealy-FSM over IAlph,OAlph st
( the carrier of fsm1 misses the carrier of fsm2 & fsm1,tfsm1 -are_isomorphic & fsm2,tfsm2 -are_isomorphic )
set Stfsm1 = the carrier of tfsm1;
set Tr1 = the Tran of tfsm1;
set Of1 = the OFun of tfsm1;
set Stfsm2 = the carrier of tfsm2;
set Tr2 = the Tran of tfsm2;
set Of2 = the OFun of tfsm2;
set Sfsm1 = [:{0}, the carrier of tfsm1:];
set Sfsm2 = [:{1}, the carrier of tfsm2:];
deffunc H2( Element of [:{0}, the carrier of tfsm1:], Element of IAlph) -> Element of [:{0}, the carrier of tfsm1:] = [($1 `1),( the Tran of tfsm1 . [($1 `2),$2])];
consider T1 being Function of [:[:{0}, the carrier of tfsm1:],IAlph:],[:{0}, the carrier of tfsm1:] such that
A1: for q being Element of [:{0}, the carrier of tfsm1:]
for s being Element of IAlph holds T1 . (q,s) = H2(q,s) from BINOP_1:sch_4();
reconsider I2 = [1, the InitS of tfsm2] as Element of [:{1}, the carrier of tfsm2:] by ZFMISC_1:105;
reconsider sSfsm2 = [:{1}, the carrier of tfsm2:] as non empty finite set ;
reconsider I1 = [0, the InitS of tfsm1] as Element of [:{0}, the carrier of tfsm1:] by ZFMISC_1:105;
set sSfsm1 = [:{0}, the carrier of tfsm1:];
deffunc H3( Element of [:{0}, the carrier of tfsm1:], Element of IAlph) -> Element of OAlph = the OFun of tfsm1 . [($1 `2),$2];
consider O1 being Function of [:[:{0}, the carrier of tfsm1:],IAlph:],OAlph such that
A2: for q being Element of [:{0}, the carrier of tfsm1:]
for s being Element of IAlph holds O1 . (q,s) = H3(q,s) from BINOP_1:sch_4();
reconsider sI2 = I2 as Element of sSfsm2 ;
set sI1 = I1;
reconsider sO1 = O1 as Function of [:[:{0}, the carrier of tfsm1:],IAlph:],OAlph ;
reconsider sT1 = T1 as Function of [:[:{0}, the carrier of tfsm1:],IAlph:],[:{0}, the carrier of tfsm1:] ;
deffunc H4( Element of [:{1}, the carrier of tfsm2:], Element of IAlph) -> Element of [:{1}, the carrier of tfsm2:] = [($1 `1),( the Tran of tfsm2 . [($1 `2),$2])];
consider T2 being Function of [:[:{1}, the carrier of tfsm2:],IAlph:],[:{1}, the carrier of tfsm2:] such that
A3: for q being Element of [:{1}, the carrier of tfsm2:]
for s being Element of IAlph holds T2 . (q,s) = H4(q,s) from BINOP_1:sch_4();
reconsider sT2 = T2 as Function of [:sSfsm2,IAlph:],sSfsm2 ;
take fsm1 = Mealy-FSM(# [:{0}, the carrier of tfsm1:],sT1,sO1,I1 #); ::_thesis: ex fsm2 being non empty finite Mealy-FSM over IAlph,OAlph st
( the carrier of fsm1 misses the carrier of fsm2 & fsm1,tfsm1 -are_isomorphic & fsm2,tfsm2 -are_isomorphic )
deffunc H5( Element of [:{1}, the carrier of tfsm2:], Element of IAlph) -> Element of OAlph = the OFun of tfsm2 . [($1 `2),$2];
consider O2 being Function of [:[:{1}, the carrier of tfsm2:],IAlph:],OAlph such that
A4: for q being Element of [:{1}, the carrier of tfsm2:]
for s being Element of IAlph holds O2 . (q,s) = H5(q,s) from BINOP_1:sch_4();
A5: {0} misses {1} by ZFMISC_1:11;
reconsider sO2 = O2 as Function of [:sSfsm2,IAlph:],OAlph ;
take fsm2 = Mealy-FSM(# sSfsm2,sT2,sO2,sI2 #); ::_thesis: ( the carrier of fsm1 misses the carrier of fsm2 & fsm1,tfsm1 -are_isomorphic & fsm2,tfsm2 -are_isomorphic )
[:{0}, the carrier of tfsm1:] /\ [:{1}, the carrier of tfsm2:] = [:({0} /\ {1}),( the carrier of tfsm1 /\ the carrier of tfsm2):] by ZFMISC_1:100
.= [:{},( the carrier of tfsm1 /\ the carrier of tfsm2):] by A5, XBOOLE_0:def_7
.= {} by ZFMISC_1:90 ;
hence the carrier of fsm1 /\ the carrier of fsm2 = {} ; :: according to XBOOLE_0:def_7 ::_thesis: ( fsm1,tfsm1 -are_isomorphic & fsm2,tfsm2 -are_isomorphic )
thus fsm1,tfsm1 -are_isomorphic ::_thesis: fsm2,tfsm2 -are_isomorphic
proof
deffunc H6( set ) -> set = $1 `2 ;
consider Tf1 being Function such that
A6: ( dom Tf1 = the carrier of fsm1 & ( for q being set st q in the carrier of fsm1 holds
Tf1 . q = H6(q) ) ) from FUNCT_1:sch_3();
A7: rng Tf1 = the carrier of tfsm1
proof
assume A8: not rng Tf1 = the carrier of tfsm1 ; ::_thesis: contradiction
percases ( not rng Tf1 c= the carrier of tfsm1 or not the carrier of tfsm1 c= rng Tf1 ) by A8, XBOOLE_0:def_10;
suppose not rng Tf1 c= the carrier of tfsm1 ; ::_thesis: contradiction
then consider q being set such that
A9: q in rng Tf1 and
A10: not q in the carrier of tfsm1 by TARSKI:def_3;
consider x being set such that
A11: x in dom Tf1 and
A12: q = Tf1 . x by A9, FUNCT_1:def_3;
reconsider x2 = x `2 as Element of the carrier of tfsm1 by A6, A11, MCART_1:10;
x2 in the carrier of tfsm1 ;
hence contradiction by A6, A10, A11, A12; ::_thesis: verum
end;
suppose not the carrier of tfsm1 c= rng Tf1 ; ::_thesis: contradiction
then consider x being set such that
A13: x in the carrier of tfsm1 and
A14: not x in rng Tf1 by TARSKI:def_3;
0 in {0} by TARSKI:def_1;
then [0,x] in [:{0}, the carrier of tfsm1:] by A13, ZFMISC_1:87;
then ( Tf1 . [0,x] in rng Tf1 & Tf1 . [0,x] = [0,x] `2 ) by A6, FUNCT_1:def_3;
hence contradiction by A14; ::_thesis: verum
end;
end;
end;
then reconsider Tf1s = Tf1 as Function of the carrier of fsm1, the carrier of tfsm1 by A6, FUNCT_2:1;
take Tf1s ; :: according to FSM_1:def_19 ::_thesis: ( Tf1s is bijective & Tf1s . the InitS of fsm1 = the InitS of tfsm1 & ( for q11 being State of fsm1
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf1s . q11),s) & the OFun of fsm1 . (q11,s) = the OFun of tfsm1 . ((Tf1s . q11),s) ) ) )
now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_Tf1_&_x2_in_dom_Tf1_&_Tf1_._x1_=_Tf1_._x2_holds_
x1_=_x2
let x1, x2 be set ; ::_thesis: ( x1 in dom Tf1 & x2 in dom Tf1 & Tf1 . x1 = Tf1 . x2 implies x1 = x2 )
assume that
A15: x1 in dom Tf1 and
A16: x2 in dom Tf1 and
A17: Tf1 . x1 = Tf1 . x2 ; ::_thesis: x1 = x2
A18: ( Tf1 . x1 = x1 `2 & Tf1 . x2 = x2 `2 ) by A6, A15, A16;
x1 `1 in {0} by A6, A15, MCART_1:10;
then A19: x1 `1 = 0 by TARSKI:def_1;
A20: x2 `1 in {0} by A6, A16, MCART_1:10;
( x1 = [(x1 `1),(x1 `2)] & x2 = [(x2 `1),(x2 `2)] ) by A6, A15, A16, MCART_1:21;
hence x1 = x2 by A17, A18, A20, A19, TARSKI:def_1; ::_thesis: verum
end;
then ( Tf1s is one-to-one & Tf1s is onto ) by A7, FUNCT_1:def_4, FUNCT_2:def_3;
hence Tf1s is bijective ; ::_thesis: ( Tf1s . the InitS of fsm1 = the InitS of tfsm1 & ( for q11 being State of fsm1
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf1s . q11),s) & the OFun of fsm1 . (q11,s) = the OFun of tfsm1 . ((Tf1s . q11),s) ) ) )
thus Tf1s . the InitS of fsm1 = I1 `2 by A6
.= the InitS of tfsm1 by MCART_1:7 ; ::_thesis: for q11 being State of fsm1
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf1s . q11),s) & the OFun of fsm1 . (q11,s) = the OFun of tfsm1 . ((Tf1s . q11),s) )
now__::_thesis:_for_q_being_State_of_fsm1
for_s_being_Element_of_IAlph_holds_
(_Tf1s_._(_the_Tran_of_fsm1_._(q,s))_=_the_Tran_of_tfsm1_._[(Tf1s_._q),s]_&_the_OFun_of_fsm1_._(q,s)_=_the_OFun_of_tfsm1_._((Tf1s_._q),s)_)
let q be State of fsm1; ::_thesis: for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm1 . (q,s)) = the Tran of tfsm1 . [(Tf1s . q),s] & the OFun of fsm1 . (q,s) = the OFun of tfsm1 . ((Tf1s . q),s) )
let s be Element of IAlph; ::_thesis: ( Tf1s . ( the Tran of fsm1 . (q,s)) = the Tran of tfsm1 . [(Tf1s . q),s] & the OFun of fsm1 . (q,s) = the OFun of tfsm1 . ((Tf1s . q),s) )
reconsider q1 = q `2 as Element of the carrier of tfsm1 by MCART_1:10;
reconsider Tq1 = the Tran of tfsm1 . [q1,s] as Element of the carrier of tfsm1 ;
q `1 in {0} by MCART_1:10;
then A21: [(q `1),Tq1] in [:{0}, the carrier of tfsm1:] by ZFMISC_1:87;
thus Tf1s . ( the Tran of fsm1 . (q,s)) = Tf1s . ((q `1),( the Tran of tfsm1 . ((q `2),s))) by A1
.= [(q `1),( the Tran of tfsm1 . [(q `2),s])] `2 by A6, A21
.= the Tran of tfsm1 . [(q `2),s]
.= the Tran of tfsm1 . [(Tf1s . q),s] by A6 ; ::_thesis: the OFun of fsm1 . (q,s) = the OFun of tfsm1 . ((Tf1s . q),s)
thus the OFun of fsm1 . (q,s) = the OFun of tfsm1 . ((q `2),s) by A2
.= the OFun of tfsm1 . ((Tf1s . q),s) by A6 ; ::_thesis: verum
end;
hence for q11 being State of fsm1
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm1 . (q11,s)) = the Tran of tfsm1 . ((Tf1s . q11),s) & the OFun of fsm1 . (q11,s) = the OFun of tfsm1 . ((Tf1s . q11),s) ) ; ::_thesis: verum
end;
consider Tf1 being Function such that
A22: ( dom Tf1 = the carrier of fsm2 & ( for q being set st q in the carrier of fsm2 holds
Tf1 . q = H1(q) ) ) from FUNCT_1:sch_3();
A23: rng Tf1 = the carrier of tfsm2
proof
assume A24: not rng Tf1 = the carrier of tfsm2 ; ::_thesis: contradiction
percases ( not rng Tf1 c= the carrier of tfsm2 or not the carrier of tfsm2 c= rng Tf1 ) by A24, XBOOLE_0:def_10;
suppose not rng Tf1 c= the carrier of tfsm2 ; ::_thesis: contradiction
then consider q being set such that
A25: q in rng Tf1 and
A26: not q in the carrier of tfsm2 by TARSKI:def_3;
consider x being set such that
A27: x in dom Tf1 and
A28: q = Tf1 . x by A25, FUNCT_1:def_3;
reconsider x2 = x `2 as Element of the carrier of tfsm2 by A22, A27, MCART_1:10;
x2 in the carrier of tfsm2 ;
hence contradiction by A22, A26, A27, A28; ::_thesis: verum
end;
suppose not the carrier of tfsm2 c= rng Tf1 ; ::_thesis: contradiction
then consider x being set such that
A29: x in the carrier of tfsm2 and
A30: not x in rng Tf1 by TARSKI:def_3;
1 in {1} by TARSKI:def_1;
then [1,x] in sSfsm2 by A29, ZFMISC_1:87;
then ( Tf1 . [1,x] in rng Tf1 & Tf1 . [1,x] = [1,x] `2 ) by A22, FUNCT_1:def_3;
hence contradiction by A30; ::_thesis: verum
end;
end;
end;
then reconsider Tf1s = Tf1 as Function of the carrier of fsm2, the carrier of tfsm2 by A22, FUNCT_2:1;
take Tf1s ; :: according to FSM_1:def_19 ::_thesis: ( Tf1s is bijective & Tf1s . the InitS of fsm2 = the InitS of tfsm2 & ( for q11 being State of fsm2
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm2 . (q11,s)) = the Tran of tfsm2 . ((Tf1s . q11),s) & the OFun of fsm2 . (q11,s) = the OFun of tfsm2 . ((Tf1s . q11),s) ) ) )
now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_Tf1_&_x2_in_dom_Tf1_&_Tf1_._x1_=_Tf1_._x2_holds_
x1_=_x2
let x1, x2 be set ; ::_thesis: ( x1 in dom Tf1 & x2 in dom Tf1 & Tf1 . x1 = Tf1 . x2 implies x1 = x2 )
assume that
A31: x1 in dom Tf1 and
A32: x2 in dom Tf1 and
A33: Tf1 . x1 = Tf1 . x2 ; ::_thesis: x1 = x2
A34: ( Tf1 . x1 = x1 `2 & Tf1 . x2 = x2 `2 ) by A22, A31, A32;
x1 `1 in {1} by A22, A31, MCART_1:10;
then A35: x1 `1 = 1 by TARSKI:def_1;
A36: x2 `1 in {1} by A22, A32, MCART_1:10;
( x1 = [(x1 `1),(x1 `2)] & x2 = [(x2 `1),(x2 `2)] ) by A22, A31, A32, MCART_1:21;
hence x1 = x2 by A33, A34, A36, A35, TARSKI:def_1; ::_thesis: verum
end;
then ( Tf1s is one-to-one & Tf1s is onto ) by A23, FUNCT_1:def_4, FUNCT_2:def_3;
hence Tf1s is bijective ; ::_thesis: ( Tf1s . the InitS of fsm2 = the InitS of tfsm2 & ( for q11 being State of fsm2
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm2 . (q11,s)) = the Tran of tfsm2 . ((Tf1s . q11),s) & the OFun of fsm2 . (q11,s) = the OFun of tfsm2 . ((Tf1s . q11),s) ) ) )
thus Tf1s . the InitS of fsm2 = sI2 `2 by A22
.= the InitS of tfsm2 by MCART_1:7 ; ::_thesis: for q11 being State of fsm2
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm2 . (q11,s)) = the Tran of tfsm2 . ((Tf1s . q11),s) & the OFun of fsm2 . (q11,s) = the OFun of tfsm2 . ((Tf1s . q11),s) )
now__::_thesis:_for_q_being_State_of_fsm2
for_s_being_Element_of_IAlph_holds_
(_Tf1s_._(_the_Tran_of_fsm2_._(q,s))_=_the_Tran_of_tfsm2_._[(Tf1s_._q),s]_&_the_OFun_of_fsm2_._(q,s)_=_the_OFun_of_tfsm2_._[(Tf1s_._q),s]_)
let q be State of fsm2; ::_thesis: for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm2 . (q,s)) = the Tran of tfsm2 . [(Tf1s . q),s] & the OFun of fsm2 . (q,s) = the OFun of tfsm2 . [(Tf1s . q),s] )
let s be Element of IAlph; ::_thesis: ( Tf1s . ( the Tran of fsm2 . (q,s)) = the Tran of tfsm2 . [(Tf1s . q),s] & the OFun of fsm2 . (q,s) = the OFun of tfsm2 . [(Tf1s . q),s] )
reconsider q1 = q `2 as Element of the carrier of tfsm2 by MCART_1:10;
set Tq1 = the Tran of tfsm2 . [q1,s];
q `1 in {1} by MCART_1:10;
then A37: [(q `1),( the Tran of tfsm2 . [q1,s])] in [:{1}, the carrier of tfsm2:] by ZFMISC_1:87;
thus Tf1s . ( the Tran of fsm2 . (q,s)) = Tf1s . ((q `1),( the Tran of tfsm2 . ((q `2),s))) by A3
.= [(q `1),( the Tran of tfsm2 . [(q `2),s])] `2 by A22, A37
.= the Tran of tfsm2 . [(q `2),s]
.= the Tran of tfsm2 . [(Tf1s . q),s] by A22 ; ::_thesis: the OFun of fsm2 . (q,s) = the OFun of tfsm2 . [(Tf1s . q),s]
thus the OFun of fsm2 . (q,s) = the OFun of tfsm2 . ((q `2),s) by A4
.= the OFun of tfsm2 . [(Tf1s . q),s] by A22 ; ::_thesis: verum
end;
hence for q11 being State of fsm2
for s being Element of IAlph holds
( Tf1s . ( the Tran of fsm2 . (q11,s)) = the Tran of tfsm2 . ((Tf1s . q11),s) & the OFun of fsm2 . (q11,s) = the OFun of tfsm2 . ((Tf1s . q11),s) ) ; ::_thesis: verum
end;
theorem Th63: :: FSM_1:63
for IAlph, OAlph being non empty set
for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph st tfsm1,tfsm2 -are_isomorphic holds
tfsm1,tfsm2 -are_equivalent
proof
let IAlph, OAlph be non empty set ; ::_thesis: for tfsm1, tfsm2 being non empty Mealy-FSM over IAlph,OAlph st tfsm1,tfsm2 -are_isomorphic holds
tfsm1,tfsm2 -are_equivalent
let tfsm1, tfsm2 be non empty Mealy-FSM over IAlph,OAlph; ::_thesis: ( tfsm1,tfsm2 -are_isomorphic implies tfsm1,tfsm2 -are_equivalent )
assume tfsm1,tfsm2 -are_isomorphic ; ::_thesis: tfsm1,tfsm2 -are_equivalent
then consider Tf being Function of the carrier of tfsm1, the carrier of tfsm2 such that
Tf is bijective and
A1: Tf . the InitS of tfsm1 = the InitS of tfsm2 and
A2: for q being Element of tfsm1
for 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) ) by Def19;
now__::_thesis:_for_w1_being_FinSequence_of_IAlph_holds_(_the_InitS_of_tfsm1,w1)_-response_=_(_the_InitS_of_tfsm2,w1)_-response
let w1 be FinSequence of IAlph; ::_thesis: ( the InitS of tfsm1,w1) -response = ( the InitS of tfsm2,w1) -response
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 Element of NAT st 1 <= k & k <= (len w1) + 1 holds
Tf . ((( the InitS of tfsm1,w1) -admissible) . k) = (( the InitS of tfsm2,w1) -admissible) . k
proof
defpred S1[ Element of NAT ] means ( 1 <= $1 & $1 <= (len w1) + 1 implies Tf . ((( the InitS of tfsm1,w1) -admissible) . $1) = (( the InitS of tfsm2,w1) -admissible) . $1 );
A4: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] )
assume A5: ( 1 <= k & k <= (len w1) + 1 implies Tf . ((( the InitS of tfsm1,w1) -admissible) . k) = (( the InitS of tfsm2,w1) -admissible) . k ) ; ::_thesis: S1[k + 1]
assume that
1 <= k + 1 and
A6: k + 1 <= (len w1) + 1 ; ::_thesis: Tf . ((( the InitS of tfsm1,w1) -admissible) . (k + 1)) = (( the InitS of tfsm2,w1) -admissible) . (k + 1)
A7: ( 0 = k or ( 0 < k & 0 + 1 = 1 ) ) ;
percases ( 0 = k or 1 <= k ) by A7, NAT_1:13;
supposeA8: 0 = k ; ::_thesis: Tf . ((( the InitS of tfsm1,w1) -admissible) . (k + 1)) = (( the InitS of tfsm2,w1) -admissible) . (k + 1)
hence Tf . ((( the InitS of tfsm1,w1) -admissible) . (k + 1)) = the InitS of tfsm2 by A1, Def2
.= (( the InitS of tfsm2,w1) -admissible) . (k + 1) by A8, Def2 ;
::_thesis: verum
end;
supposeA9: 1 <= k ; ::_thesis: Tf . ((( the InitS of tfsm1,w1) -admissible) . (k + 1)) = (( the InitS of tfsm2,w1) -admissible) . (k + 1)
A10: len w1 <= (len w1) + 1 by NAT_1:11;
A11: k <= len w1 by A6, XREAL_1:6;
then consider w1k being Element of IAlph, qk, qk1 being Element of tfsm1 such that
A12: ( w1k = w1 . k & qk = (( the InitS of tfsm1,w1) -admissible) . k ) and
A13: ( qk1 = (( the InitS of tfsm1,w1) -admissible) . (k + 1) & w1k -succ_of qk = qk1 ) by A9, Def2;
consider w2k being Element of IAlph, q2k, q2k1 being Element of tfsm2 such that
A14: ( w2k = w1 . k & q2k = (( the InitS of tfsm2,w1) -admissible) . k ) and
A15: ( q2k1 = (( the InitS of tfsm2,w1) -admissible) . (k + 1) & w2k -succ_of q2k = q2k1 ) by A9, A11, Def2;
thus Tf . ((( the InitS of tfsm1,w1) -admissible) . (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
.= (( the InitS of tfsm2,w1) -admissible) . (k + 1) by A15 ; ::_thesis: verum
end;
end;
end;
A16: S1[ 0 ] ;
thus for i being Element of NAT holds S1[i] from NAT_1:sch_1(A16, A4); ::_thesis: verum
end;
A17: now__::_thesis:_for_k_being_Nat_st_1_<=_k_&_k_<=_len_((_the_InitS_of_tfsm1,w1)_-response)_holds_
((_the_InitS_of_tfsm2,w1)_-response)_._k_=_((_the_InitS_of_tfsm1,w1)_-response)_._k
let k be Nat; ::_thesis: ( 1 <= k & k <= len (( the InitS of tfsm1,w1) -response) implies (( the InitS of tfsm2,w1) -response) . k = (( the InitS of tfsm1,w1) -response) . k )
assume that
A18: 1 <= k and
A19: k <= len (( the InitS of tfsm1,w1) -response) ; ::_thesis: (( the InitS of tfsm2,w1) -response) . k = (( the InitS of tfsm1,w1) -response) . k
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 (( the InitS of tfsm1,w1) -admissible)) by Def2;
then A22: k in dom (( the InitS of tfsm1,w1) -admissible) by FINSEQ_1:def_3;
then A23: 1 <= k by FINSEQ_3:25;
k <= len (( the InitS of tfsm1,w1) -admissible) by A22, FINSEQ_3:25;
then A24: k <= (len w1) + 1 by Def2;
A25: k in NAT by ORDINAL1:def_12;
A26: (( the InitS of tfsm1,w1) -admissible) . k is Element of tfsm1 by A22, FINSEQ_2:11;
thus (( the InitS of tfsm2,w1) -response) . k = the OFun of tfsm2 . [((( the InitS of tfsm2,w1) -admissible) . k),(w1 . k)] by A20, Def6
.= the OFun of tfsm2 . ((Tf . ((( the InitS of tfsm1,w1) -admissible) . k)),(w1 . k)) by A3, A23, A24, A25
.= the OFun of tfsm1 . (((( the InitS of tfsm1,w1) -admissible) . k),(w1 . k)) by A2, A26, A21
.= (( the InitS of tfsm1,w1) -response) . k by A20, Def6 ; ::_thesis: verum
end;
len (( the InitS of tfsm1,w1) -response) = len w1 by Def6
.= len (( the InitS of tfsm2,w1) -response) by Def6 ;
hence ( the InitS of tfsm1,w1) -response = ( the InitS of tfsm2,w1) -response by A17, FINSEQ_1:14; ::_thesis: verum
end;
hence tfsm1,tfsm2 -are_equivalent by Def9; ::_thesis: verum
end;
theorem Th64: :: FSM_1:64
for IAlph, OAlph being non empty set
for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent holds
CRtfsm1,CRtfsm2 -are_isomorphic
proof
let IAlph, OAlph be non empty set ; ::_thesis: for CRtfsm1, CRtfsm2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph st the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent holds
CRtfsm1,CRtfsm2 -are_isomorphic
let CRtfsm1, CRtfsm2 be non empty finite reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: ( the carrier of CRtfsm1 misses the carrier of CRtfsm2 & CRtfsm1,CRtfsm2 -are_equivalent implies CRtfsm1,CRtfsm2 -are_isomorphic )
set rtfsm1 = CRtfsm1;
set rtfsm2 = CRtfsm2;
assume that
A1: the carrier of CRtfsm1 misses the carrier of CRtfsm2 and
A2: CRtfsm1,CRtfsm2 -are_equivalent ; ::_thesis: CRtfsm1,CRtfsm2 -are_isomorphic
set Srtfsm2 = the carrier of CRtfsm2;
set Srtfsm1 = the carrier of CRtfsm1;
set UN = CRtfsm1 -Mealy_union CRtfsm2;
set RUN = the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2);
set SRUN = the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2));
defpred S1[ set , set ] means ex part being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) st
( $1 in part & $2 in part \ {$1} );
A3: the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) = final_states_partition (CRtfsm1 -Mealy_union CRtfsm2) by Def18;
A4: for x being set st x in the carrier of CRtfsm1 holds
ex y being set st S1[x,y]
proof
let x be set ; ::_thesis: ( x in the carrier of CRtfsm1 implies ex y being set st S1[x,y] )
set xs = {x};
A5: union the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) = the carrier of (CRtfsm1 -Mealy_union CRtfsm2) by A3, EQREL_1:def_4;
assume A6: x in the carrier of CRtfsm1 ; ::_thesis: ex y being set st S1[x,y]
then x in the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by XBOOLE_0:def_3;
then x in the carrier of (CRtfsm1 -Mealy_union CRtfsm2) by Def24;
then consider part being set such that
A7: x in part and
A8: part in the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) by A5, TARSKI:def_4;
reconsider part = part as Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) by A8;
consider p, y being Element of part such that
p in the carrier of CRtfsm1 and
A9: y in the carrier of CRtfsm2 and
for z being Element of part holds
( z = p or z = y ) by A1, A2, Th61;
set IT = y;
take y ; ::_thesis: S1[x,y]
x <> y by A1, A6, A9, XBOOLE_0:3;
then y in part \ {x} by A7, ZFMISC_1:56;
hence S1[x,y] by A7; ::_thesis: verum
end;
consider f being Function such that
A10: ( dom f = the carrier of CRtfsm1 & ( for x being set st x in the carrier of CRtfsm1 holds
S1[x,f . x] ) ) from CLASSES1:sch_1(A4);
now__::_thesis:_(_rng_f_c=_the_carrier_of_CRtfsm2_&_the_carrier_of_CRtfsm2_c=_rng_f_)
assume A11: ( not rng f c= the carrier of CRtfsm2 or not the carrier of CRtfsm2 c= rng f ) ; ::_thesis: contradiction
percases ( not rng f c= the carrier of CRtfsm2 or not the carrier of CRtfsm2 c= rng f ) by A11;
suppose not rng f c= the carrier of CRtfsm2 ; ::_thesis: contradiction
then consider y1 being set such that
A12: y1 in rng f and
A13: not y1 in the carrier of CRtfsm2 by TARSKI:def_3;
consider x1 being set such that
A14: x1 in the carrier of CRtfsm1 and
A15: y1 = f . x1 by A10, A12, FUNCT_1:def_3;
consider part1 being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A16: x1 in part1 and
A17: f . x1 in part1 \ {x1} by A10, A14;
A18: now__::_thesis:_not_y1_in_the_carrier_of_CRtfsm1
assume A19: y1 in the carrier of CRtfsm1 ; ::_thesis: contradiction
y1 <> x1 by A15, A17, ZFMISC_1:56;
hence contradiction by A1, A14, A15, A16, A17, A19, Th59; ::_thesis: verum
end;
part1 is Subset of (CRtfsm1 -Mealy_union CRtfsm2) by A3, TARSKI:def_3;
then A20: part1 is Subset of ( the carrier of CRtfsm1 \/ the carrier of CRtfsm2) by Def24;
y1 in part1 by A15, A17;
hence contradiction by A13, A20, A18, XBOOLE_0:def_3; ::_thesis: verum
end;
supposeA21: not the carrier of CRtfsm2 c= rng f ; ::_thesis: contradiction
A22: union the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) = the carrier of (CRtfsm1 -Mealy_union CRtfsm2) by A3, EQREL_1:def_4;
consider y1 being set such that
A23: y1 in the carrier of CRtfsm2 and
A24: not y1 in rng f by A21, TARSKI:def_3;
y1 in the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by A23, XBOOLE_0:def_3;
then y1 in the carrier of (CRtfsm1 -Mealy_union CRtfsm2) by Def24;
then consider Z being set such that
A25: y1 in Z and
A26: Z in the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) by A22, TARSKI:def_4;
reconsider Z = Z as Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) by A26;
A27: Z is Subset of (CRtfsm1 -Mealy_union CRtfsm2) by A3, TARSKI:def_3;
consider q1, q2 being Element of Z such that
A28: q1 in the carrier of CRtfsm1 and
q2 in the carrier of CRtfsm2 and
for q being Element of Z holds
( q = q1 or q = q2 ) by A1, A2, Th61;
consider F being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A29: q1 in F and
A30: f . q1 in F \ {q1} by A10, A28;
F is Subset of (CRtfsm1 -Mealy_union CRtfsm2) by A3, TARSKI:def_3;
then A31: ( Z = F or Z misses F ) by A3, A27, EQREL_1:def_4;
A32: f . q1 in F by A30;
now__::_thesis:_not_y1_<>_f_._q1
A33: now__::_thesis:_not_f_._q1_in_the_carrier_of_CRtfsm1
assume A34: f . q1 in the carrier of CRtfsm1 ; ::_thesis: contradiction
f . q1 <> q1 by A30, ZFMISC_1:56;
hence contradiction by A1, A28, A29, A30, A34, Th59; ::_thesis: verum
end;
Z is Subset of ( the carrier of CRtfsm1 \/ the carrier of CRtfsm2) by A27, Def24;
then A35: ( f . q1 in the carrier of CRtfsm1 or f . q1 in the carrier of CRtfsm2 ) by A25, A29, A31, A32, XBOOLE_0:3, XBOOLE_0:def_3;
assume y1 <> f . q1 ; ::_thesis: contradiction
hence contradiction by A23, A25, A29, A30, A31, A35, A33, Th60, XBOOLE_0:3; ::_thesis: verum
end;
hence contradiction by A10, A24, A28, FUNCT_1:def_3; ::_thesis: verum
end;
end;
end;
then A36: rng f = the carrier of CRtfsm2 by XBOOLE_0:def_10;
A37: now__::_thesis:_for_x1,_x2_being_set_st_x1_in_dom_f_&_x2_in_dom_f_&_f_._x1_=_f_._x2_holds_
not_x1_<>_x2
let x1, x2 be set ; ::_thesis: ( x1 in dom f & x2 in dom f & f . x1 = f . x2 implies not x1 <> x2 )
assume that
A38: x1 in dom f and
A39: x2 in dom f and
A40: f . x1 = f . x2 ; ::_thesis: not x1 <> x2
consider part1 being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A41: ( x1 in part1 & f . x1 in part1 \ {x1} ) by A10, A38;
consider part2 being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A42: ( x2 in part2 & f . x2 in part2 \ {x2} ) by A10, A39;
assume A43: x1 <> x2 ; ::_thesis: contradiction
( part1 is Subset of (CRtfsm1 -Mealy_union CRtfsm2) & part2 is Subset of (CRtfsm1 -Mealy_union CRtfsm2) ) by A3, TARSKI:def_3;
then ( part1 = part2 or part1 misses part2 ) by A3, EQREL_1:def_4;
hence contradiction by A1, A10, A38, A39, A40, A43, A41, A42, Th59, XBOOLE_0:3; ::_thesis: verum
end;
reconsider f = f as Function of the carrier of CRtfsm1, the carrier of CRtfsm2 by A10, A36, FUNCT_2:1;
A44: f . the InitS of CRtfsm1 = the InitS of CRtfsm2
proof
consider part being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A45: ( the InitS of CRtfsm1 in part & f . the InitS of CRtfsm1 in part \ { the InitS of CRtfsm1} ) by A10;
consider Q being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A46: ( the InitS of CRtfsm1 in Q & the InitS of CRtfsm2 in Q ) and
Q = the InitS of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) by A1, A2, Th56;
assume A47: f . the InitS of CRtfsm1 <> the InitS of CRtfsm2 ; ::_thesis: contradiction
( Q is Subset of (CRtfsm1 -Mealy_union CRtfsm2) & part is Subset of (CRtfsm1 -Mealy_union CRtfsm2) ) by A3, TARSKI:def_3;
then ( Q = part or Q misses part ) by A3, EQREL_1:def_4;
hence contradiction by A47, A46, A45, Th60, XBOOLE_0:3; ::_thesis: verum
end;
A48: for q being State of CRtfsm1
for s being Element of IAlph holds
( f . ( the Tran of CRtfsm1 . (q,s)) = the Tran of CRtfsm2 . ((f . q),s) & the OFun of CRtfsm1 . (q,s) = the OFun of CRtfsm2 . ((f . q),s) )
proof
let q be State of CRtfsm1; ::_thesis: for s being Element of IAlph holds
( f . ( the Tran of CRtfsm1 . (q,s)) = the Tran of CRtfsm2 . ((f . q),s) & the OFun of CRtfsm1 . (q,s) = the OFun of CRtfsm2 . ((f . q),s) )
let s be Element of IAlph; ::_thesis: ( f . ( the Tran of CRtfsm1 . (q,s)) = the Tran of CRtfsm2 . ((f . q),s) & the OFun of CRtfsm1 . (q,s) = the OFun of CRtfsm2 . ((f . q),s) )
set q1 = the Tran of CRtfsm1 . [q,s];
set fq = f . q;
set q2 = the Tran of CRtfsm2 . [(f . q),s];
A49: dom the Tran of CRtfsm2 = [: the carrier of CRtfsm2,IAlph:] by FUNCT_2:def_1;
A50: the carrier of (CRtfsm1 -Mealy_union CRtfsm2) = the carrier of CRtfsm1 \/ the carrier of CRtfsm2 by Def24;
then reconsider q9 = q as Element of (CRtfsm1 -Mealy_union CRtfsm2) by XBOOLE_0:def_3;
f . q in rng f by A10, FUNCT_1:def_3;
then reconsider fq9 = f . q9 as Element of (CRtfsm1 -Mealy_union CRtfsm2) by A50, XBOOLE_0:def_3;
set qu = the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [q9,s];
set qfu = the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [fq9,s];
A51: the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [fq9,s] = ( the Tran of CRtfsm1 +* the Tran of CRtfsm2) . [fq9,s] by Def24
.= the Tran of CRtfsm2 . [(f . q),s] by A49, FUNCT_4:13 ;
consider XX being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A52: ( the Tran of CRtfsm1 . [q,s] in XX & f . ( the Tran of CRtfsm1 . [q,s]) in XX \ {( the Tran of CRtfsm1 . [q,s])} ) by A10;
A53: final_states_partition (CRtfsm1 -Mealy_union CRtfsm2) is final by Def15;
ex part being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) st
( q in part & f . q in part \ {q} ) by A10;
then A54: q9,fq9 -are_equivalent by A3, A53, Def14;
then the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [q9,s], the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [fq9,s] -are_equivalent by Th19;
then consider X being Element of the carrier of (the_reduction_of (CRtfsm1 -Mealy_union CRtfsm2)) such that
A55: ( the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [q9,s] in X & the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [fq9,s] in X ) by A3, A53, Def14;
A56: the carrier of CRtfsm1 /\ the carrier of CRtfsm2 = {} by A1, XBOOLE_0:def_7;
A57: dom the Tran of CRtfsm1 = [: the carrier of CRtfsm1,IAlph:] by FUNCT_2:def_1;
then (dom the Tran of CRtfsm1) /\ (dom the Tran of CRtfsm2) = [: the carrier of CRtfsm1,IAlph:] /\ [: the carrier of CRtfsm2,IAlph:] by FUNCT_2:def_1
.= [:{},IAlph:] by A56, ZFMISC_1:99
.= {} by ZFMISC_1:90 ;
then A58: dom the Tran of CRtfsm1 misses dom the Tran of CRtfsm2 by XBOOLE_0:def_7;
A59: the Tran of (CRtfsm1 -Mealy_union CRtfsm2) . [q9,s] = ( the Tran of CRtfsm1 +* the Tran of CRtfsm2) . [q9,s] by Def24
.= the Tran of CRtfsm1 . [q,s] by A57, A58, FUNCT_4:16 ;
A60: X is Subset of (CRtfsm1 -Mealy_union CRtfsm2) by A3, TARSKI:def_3;
now__::_thesis:_not_f_._(_the_Tran_of_CRtfsm1_._[q,s])_<>_the_Tran_of_CRtfsm2_._[(f_._q),s]
XX is Subset of (CRtfsm1 -Mealy_union CRtfsm2) by A3, TARSKI:def_3;
then A61: ( X = XX or X misses XX ) by A3, A60, EQREL_1:def_4;
assume f . ( the Tran of CRtfsm1 . [q,s]) <> the Tran of CRtfsm2 . [(f . q),s] ; ::_thesis: contradiction
hence contradiction by A55, A59, A51, A52, A61, Th60, XBOOLE_0:3; ::_thesis: verum
end;
hence f . ( the Tran of CRtfsm1 . (q,s)) = the Tran of CRtfsm2 . ((f . q),s) ; ::_thesis: the OFun of CRtfsm1 . (q,s) = the OFun of CRtfsm2 . ((f . q),s)
A62: dom the OFun of CRtfsm2 = [: the carrier of CRtfsm2,IAlph:] by FUNCT_2:def_1;
A63: dom the OFun of CRtfsm1 = [: the carrier of CRtfsm1,IAlph:] by FUNCT_2:def_1;
then (dom the OFun of CRtfsm1) /\ (dom the OFun of CRtfsm2) = [:( the carrier of CRtfsm1 /\ the carrier of CRtfsm2),IAlph:] by A62, ZFMISC_1:99
.= {} by A56, ZFMISC_1:90 ;
then dom the OFun of CRtfsm1 misses dom the OFun of CRtfsm2 by XBOOLE_0:def_7;
hence the OFun of CRtfsm1 . (q,s) = ( the OFun of CRtfsm1 +* the OFun of CRtfsm2) . [q,s] by A63, FUNCT_4:16
.= the OFun of (CRtfsm1 -Mealy_union CRtfsm2) . [q9,s] by Def24
.= the OFun of (CRtfsm1 -Mealy_union CRtfsm2) . [fq9,s] by A54, Th19
.= ( the OFun of CRtfsm1 +* the OFun of CRtfsm2) . [(f . q),s] by Def24
.= the OFun of CRtfsm2 . ((f . q),s) by A62, FUNCT_4:13 ;
::_thesis: verum
end;
( f is one-to-one & f is onto ) by A37, A36, FUNCT_1:def_4, FUNCT_2:def_3;
hence CRtfsm1,CRtfsm2 -are_isomorphic by A44, A48, Def19; ::_thesis: verum
end;
theorem Th65: :: FSM_1:65
for IAlph, OAlph being non empty set
for Ctfsm1, Ctfsm2 being non empty finite connected Mealy-FSM over IAlph,OAlph st Ctfsm1,Ctfsm2 -are_equivalent holds
the_reduction_of Ctfsm1, the_reduction_of Ctfsm2 -are_isomorphic
proof
let IAlph, OAlph be non empty set ; ::_thesis: for Ctfsm1, Ctfsm2 being non empty finite connected Mealy-FSM over IAlph,OAlph st Ctfsm1,Ctfsm2 -are_equivalent holds
the_reduction_of Ctfsm1, the_reduction_of Ctfsm2 -are_isomorphic
let Ctfsm1, Ctfsm2 be non empty finite connected Mealy-FSM over IAlph,OAlph; ::_thesis: ( Ctfsm1,Ctfsm2 -are_equivalent implies the_reduction_of Ctfsm1, the_reduction_of Ctfsm2 -are_isomorphic )
assume A1: Ctfsm1,Ctfsm2 -are_equivalent ; ::_thesis: the_reduction_of Ctfsm1, the_reduction_of Ctfsm2 -are_isomorphic
set rtfsm2 = the_reduction_of Ctfsm2;
set rtfsm1 = the_reduction_of Ctfsm1;
consider fsm1, fsm2 being non empty finite Mealy-FSM over IAlph,OAlph such that
A2: the carrier of fsm1 misses the carrier of fsm2 and
A3: fsm1, the_reduction_of Ctfsm1 -are_isomorphic and
A4: fsm2, the_reduction_of Ctfsm2 -are_isomorphic by Th62;
A5: the_reduction_of Ctfsm1,Ctfsm1 -are_equivalent by Th41;
set Srtfsm1 = the carrier of (the_reduction_of Ctfsm1);
set Srtfsm2 = the carrier of (the_reduction_of Ctfsm2);
set ISrtfsm1 = the InitS of (the_reduction_of Ctfsm1);
set ISrtfsm2 = the InitS of (the_reduction_of Ctfsm2);
set Sfsm1 = the carrier of fsm1;
set Sfsm2 = the carrier of fsm2;
set ISfsm1 = the InitS of fsm1;
set ISfsm2 = the InitS of fsm2;
A6: the_reduction_of Ctfsm2,Ctfsm2 -are_equivalent by Th41;
fsm2, the_reduction_of Ctfsm2 -are_equivalent by A4, Th63;
then A7: fsm2,Ctfsm2 -are_equivalent by A6, Th15;
A8: fsm1 is connected
proof
assume not fsm1 is connected ; ::_thesis: contradiction
then consider q1 being Element of the carrier of fsm1 such that
A9: not q1 is accessible by Def22;
consider Tf being Function of the carrier of fsm1, the carrier of (the_reduction_of Ctfsm1) such that
A10: Tf is bijective and
A11: ( Tf . the InitS of fsm1 = the InitS of (the_reduction_of Ctfsm1) & ( for q being State of fsm1
for s being Element of IAlph holds
( Tf . ( the Tran of fsm1 . (q,s)) = the Tran of (the_reduction_of Ctfsm1) . ((Tf . q),s) & the OFun of fsm1 . (q,s) = the OFun of (the_reduction_of Ctfsm1) . ((Tf . q),s) ) ) ) by A3, Def19;
A12: dom Tf = the carrier of fsm1 by FUNCT_2:def_1;
set q = Tf . q1;
Tf . q1 is accessible by Def22;
then consider w being FinSequence of IAlph such that
A13: the InitS of (the_reduction_of Ctfsm1),w -leads_to Tf . q1 by Def21;
A14: 1 <= (len w) + 1 by NAT_1:11;
then Tf . ((( the InitS of fsm1,w) -admissible) . ((len w) + 1)) = (( the InitS of (the_reduction_of Ctfsm1),w) -admissible) . ((len w) + 1) by A11, Th43;
then A15: (Tf ") . (Tf . ((( the InitS of fsm1,w) -admissible) . ((len w) + 1))) = (Tf ") . (Tf . q1) by A13, Def3;
len (( the InitS of fsm1,w) -admissible) = (len w) + 1 by Def2;
then (len w) + 1 in Seg (len (( the InitS of fsm1,w) -admissible)) by A14, FINSEQ_1:1;
then (len w) + 1 in dom (( the InitS of fsm1,w) -admissible) by FINSEQ_1:def_3;
then (( the InitS of fsm1,w) -admissible) . ((len w) + 1) in dom Tf by A12, FINSEQ_2:11;
then (( the InitS of fsm1,w) -admissible) . ((len w) + 1) = (Tf ") . (Tf . q1) by A10, A15, FUNCT_1:34
.= q1 by A10, A12, FUNCT_1:34 ;
then the InitS of fsm1,w -leads_to q1 by Def3;
hence contradiction by A9, Def21; ::_thesis: verum
end;
A16: fsm2 is connected
proof
assume not fsm2 is connected ; ::_thesis: contradiction
then consider q1 being Element of the carrier of fsm2 such that
A17: not q1 is accessible by Def22;
consider Tf being Function of the carrier of fsm2, the carrier of (the_reduction_of Ctfsm2) such that
A18: Tf is bijective and
A19: ( Tf . the InitS of fsm2 = the InitS of (the_reduction_of Ctfsm2) & ( for q being State of fsm2
for s being Element of IAlph holds
( Tf . ( the Tran of fsm2 . (q,s)) = the Tran of (the_reduction_of Ctfsm2) . ((Tf . q),s) & the OFun of fsm2 . (q,s) = the OFun of (the_reduction_of Ctfsm2) . ((Tf . q),s) ) ) ) by A4, Def19;
A20: dom Tf = the carrier of fsm2 by FUNCT_2:def_1;
set q = Tf . q1;
Tf . q1 is accessible by Def22;
then consider w being FinSequence of IAlph such that
A21: the InitS of (the_reduction_of Ctfsm2),w -leads_to Tf . q1 by Def21;
A22: 1 <= (len w) + 1 by NAT_1:11;
then Tf . ((( the InitS of fsm2,w) -admissible) . ((len w) + 1)) = (( the InitS of (the_reduction_of Ctfsm2),w) -admissible) . ((len w) + 1) by A19, Th43;
then A23: (Tf ") . (Tf . ((( the InitS of fsm2,w) -admissible) . ((len w) + 1))) = (Tf ") . (Tf . q1) by A21, Def3;
len (( the InitS of fsm2,w) -admissible) = (len w) + 1 by Def2;
then (len w) + 1 in Seg (len (( the InitS of fsm2,w) -admissible)) by A22, FINSEQ_1:1;
then (len w) + 1 in dom (( the InitS of fsm2,w) -admissible) by FINSEQ_1:def_3;
then (( the InitS of fsm2,w) -admissible) . ((len w) + 1) in dom Tf by A20, FINSEQ_2:11;
then (( the InitS of fsm2,w) -admissible) . ((len w) + 1) = (Tf ") . (Tf . q1) by A18, A23, FUNCT_1:34
.= q1 by A18, A20, FUNCT_1:34 ;
then the InitS of fsm2,w -leads_to q1 by Def3;
hence contradiction by A17, Def21; ::_thesis: verum
end;
fsm1, the_reduction_of Ctfsm1 -are_equivalent by A3, Th63;
then fsm1,Ctfsm1 -are_equivalent by A5, Th15;
then A24: fsm1,Ctfsm2 -are_equivalent by A1, Th15;
reconsider fsm1 = fsm1, fsm2 = fsm2 as non empty finite reduced Mealy-FSM over IAlph,OAlph by A3, A4, Th47;
fsm1,fsm2 -are_isomorphic by A2, A8, A16, A7, A24, Th15, Th64;
then fsm1, the_reduction_of Ctfsm2 -are_isomorphic by A4, Th42;
hence the_reduction_of Ctfsm1, the_reduction_of Ctfsm2 -are_isomorphic by A3, Th42; ::_thesis: verum
end;
theorem :: FSM_1:66
for IAlph, OAlph being non empty set
for M1, M2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph holds
( M1,M2 -are_isomorphic iff M1,M2 -are_equivalent )
proof
let IAlph, OAlph be non empty set ; ::_thesis: for M1, M2 being non empty finite reduced connected Mealy-FSM over IAlph,OAlph holds
( M1,M2 -are_isomorphic iff M1,M2 -are_equivalent )
let M1, M2 be non empty finite reduced connected Mealy-FSM over IAlph,OAlph; ::_thesis: ( M1,M2 -are_isomorphic iff M1,M2 -are_equivalent )
thus ( M1,M2 -are_isomorphic implies M1,M2 -are_equivalent ) by Th63; ::_thesis: ( M1,M2 -are_equivalent implies M1,M2 -are_isomorphic )
A1: M2, the_reduction_of M2 -are_isomorphic by Th46;
assume M1,M2 -are_equivalent ; ::_thesis: M1,M2 -are_isomorphic
then A2: the_reduction_of M1, the_reduction_of M2 -are_isomorphic by Th65;
M1, the_reduction_of M1 -are_isomorphic by Th46;
then M1, the_reduction_of M2 -are_isomorphic by A2, Th42;
hence M1,M2 -are_isomorphic by A1, Th42; ::_thesis: verum
end;