:: FSM_1 semantic presentation

theorem Th1: :: FSM_1:1
for b1, b2 being Nat st b1 < b2 holds
ex b3 being Nat st
( b2 = b1 + b3 & 1 <= b3 )
proof end;

theorem Th2: :: FSM_1:2
canceled;

theorem Th3: :: FSM_1:3
canceled;

theorem Th4: :: FSM_1:4
canceled;

theorem Th5: :: FSM_1:5
canceled;

theorem Th6: :: FSM_1:6
canceled;

theorem Th7: :: FSM_1:7
for b1 being set
for b2, b3 being non empty set
for b4 being Function of b1,b2
for b5 being Function of b2,b3 st b4 is bijective & b5 is bijective holds
b5 * b4 is bijective
proof end;

theorem Th8: :: FSM_1:8
for b1 being set
for b2, b3 being Equivalence_Relation of b1 st Class b2 = Class b3 holds
b2 = b3
proof end;

theorem Th9: :: FSM_1:9
for b1 being non empty set
for b2 being a_partition of b1 holds not b2 is empty ;

theorem Th10: :: FSM_1:10
for b1 being finite set
for b2 being a_partition of b1 holds b2 is finite
proof end;

registration
let c1 be finite set ;
cluster -> finite a_partition of a1;
coherence
for b1 being a_partition of c1 holds b1 is finite
by Th10;
end;

registration
let c1 be non empty finite set ;
cluster non empty finite a_partition of a1;
existence
ex b1 being a_partition of c1 st
( not b1 is empty & b1 is finite )
proof end;
end;

theorem Th11: :: FSM_1:11
for b1 being non empty set
for b2 being a_partition of b1
for b3 being set st b3 in b2 holds
ex b4 being Element of b1 st b4 in b3
proof end;

theorem Th12: :: FSM_1:12
for b1 being non empty finite set
for b2 being a_partition of b1 holds card b2 <= card b1
proof end;

theorem Th13: :: FSM_1:13
for b1 being non empty finite set
for b2, b3 being a_partition of b1 st b2 is_finer_than b3 holds
card b3 <= card b2
proof end;

theorem Th14: :: FSM_1:14
for b1 being non empty finite set
for b2, b3 being a_partition of b1 st b2 is_finer_than b3 holds
for b4 being Element of b3 ex b5 being Element of b2 st b5 c= b4
proof end;

theorem Th15: :: FSM_1:15
for b1 being non empty finite set
for b2, b3 being a_partition of b1 st b2 is_finer_than b3 & card b2 = card b3 holds
b2 = b3
proof end;

definition
let c1 be set ;
attr a2 is strict;
struct FSM of c1 -> 1-sorted ;
aggr FSM(# carrier, Tran, InitS #) -> FSM of a1;
sel Tran c2 -> Function of [:the carrier of a2,a1:],the carrier of a2;
sel InitS c2 -> Element of the carrier of a2;
end;

definition
let c1 be set ;
let c2 be FSM of c1;
mode State of a2 is Element of a2;
end;

registration
let c1 be set ;
cluster non empty finite FSM of a1;
existence
ex b1 being FSM of c1 st
( not b1 is empty & b1 is finite )
proof end;
end;

registration
cluster non empty finite 1-sorted ;
existence
ex b1 being 1-sorted st
( b1 is finite & not b1 is empty )
proof end;
end;

registration
let c1 be finite 1-sorted ;
cluster the carrier of a1 -> finite ;
coherence
the carrier of c1 is finite
by GROUP_1:def 14;
end;

definition
let c1 be non empty set ;
let c2 be non empty FSM of c1;
let c3 be Element of c1;
let c4 be State of c2;
func c3 -succ_of c4 -> State of a2 equals :: FSM_1:def 1
the Tran of a2 . [a4,a3];
correctness
coherence
the Tran of c2 . [c4,c3] is State of c2
;
;
end;

:: deftheorem Def1 defines -succ_of FSM_1:def 1 :
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being Element of b1
for b4 being State of b2 holds b3 -succ_of b4 = the Tran of b2 . [b4,b3];

definition
let c1 be non empty set ;
let c2 be non empty FSM of c1;
let c3 be State of c2;
let c4 be FinSequence of c1;
func c3,c4 -admissible -> FinSequence of the carrier of a2 means :Def2: :: FSM_1:def 2
( a5 . 1 = a3 & len a5 = (len a4) + 1 & ( for b1 being Nat st 1 <= b1 & b1 <= len a4 holds
ex b2 being Element of a1ex b3, b4 being State of a2 st
( b2 = a4 . b1 & b3 = a5 . b1 & b4 = a5 . (b1 + 1) & b2 -succ_of b3 = b4 ) ) );
existence
ex b1 being FinSequence of the carrier of c2 st
( b1 . 1 = c3 & len b1 = (len c4) + 1 & ( for b2 being Nat st 1 <= b2 & b2 <= len c4 holds
ex b3 being Element of c1ex b4, b5 being State of c2 st
( b3 = c4 . b2 & b4 = b1 . b2 & b5 = b1 . (b2 + 1) & b3 -succ_of b4 = b5 ) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of the carrier of c2 st b1 . 1 = c3 & len b1 = (len c4) + 1 & ( for b3 being Nat st 1 <= b3 & b3 <= len c4 holds
ex b4 being Element of c1ex b5, b6 being State of c2 st
( b4 = c4 . b3 & b5 = b1 . b3 & b6 = b1 . (b3 + 1) & b4 -succ_of b5 = b6 ) ) & b2 . 1 = c3 & len b2 = (len c4) + 1 & ( for b3 being Nat st 1 <= b3 & b3 <= len c4 holds
ex b4 being Element of c1ex b5, b6 being State of c2 st
( b4 = c4 . b3 & b5 = b2 . b3 & b6 = b2 . (b3 + 1) & b4 -succ_of b5 = b6 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines -admissible FSM_1:def 2 :
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being State of b2
for b4 being FinSequence of b1
for b5 being FinSequence of the carrier of b2 holds
( b5 = b3,b4 -admissible iff ( b5 . 1 = b3 & len b5 = (len b4) + 1 & ( for b6 being Nat st 1 <= b6 & b6 <= len b4 holds
ex b7 being Element of b1ex b8, b9 being State of b2 st
( b7 = b4 . b6 & b8 = b5 . b6 & b9 = b5 . (b6 + 1) & b7 -succ_of b8 = b9 ) ) ) );

theorem Th16: :: FSM_1:16
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being State of b2 holds b3,(<*> b1) -admissible = <*b3*>
proof end;

definition
let c1 be non empty set ;
let c2 be non empty FSM of c1;
let c3 be FinSequence of c1;
let c4, c5 be State of c2;
pred c4,c3 -leads_to c5 means :Def3: :: FSM_1:def 3
(a4,a3 -admissible ) . ((len a3) + 1) = a5;
end;

:: deftheorem Def3 defines -leads_to FSM_1:def 3 :
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being FinSequence of b1
for b4, b5 being State of b2 holds
( b4,b3 -leads_to b5 iff (b4,b3 -admissible ) . ((len b3) + 1) = b5 );

theorem Th17: :: FSM_1:17
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being State of b2 holds b3, <*> b1 -leads_to b3
proof end;

definition
let c1 be non empty set ;
let c2 be non empty FSM of c1;
let c3 be FinSequence of c1;
let c4 be FinSequence of the carrier of c2;
pred c4 is_admissible_for c3 means :Def4: :: FSM_1:def 4
ex b1 being State of a2 st
( b1 = a4 . 1 & b1,a3 -admissible = a4 );
end;

:: deftheorem Def4 defines is_admissible_for FSM_1:def 4 :
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being FinSequence of b1
for b4 being FinSequence of the carrier of b2 holds
( b4 is_admissible_for b3 iff ex b5 being State of b2 st
( b5 = b4 . 1 & b5,b3 -admissible = b4 ) );

theorem Th18: :: FSM_1:18
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being State of b2 holds <*b3*> is_admissible_for <*> b1
proof end;

definition
let c1 be non empty set ;
let c2 be non empty FSM of c1;
let c3 be State of c2;
let c4 be FinSequence of c1;
func c3 leads_to_under c4 -> State of a2 means :Def5: :: FSM_1:def 5
a3,a4 -leads_to a5;
existence
ex b1 being State of c2 st c3,c4 -leads_to b1
proof end;
uniqueness
for b1, b2 being State of c2 st c3,c4 -leads_to b1 & c3,c4 -leads_to b2 holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines leads_to_under FSM_1:def 5 :
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being State of b2
for b4 being FinSequence of b1
for b5 being State of b2 holds
( b5 = b3 leads_to_under b4 iff b3,b4 -leads_to b5 );

theorem Th19: :: FSM_1:19
for b1 being non empty set
for b2 being non empty FSM of b1
for b3 being FinSequence of b1
for b4, b5 being State of b2 holds
( (b4,b3 -admissible ) . (len (b4,b3 -admissible )) = b5 iff b4,b3 -leads_to b5 )
proof end;

theorem Th20: :: FSM_1:20
for b1 being non empty set
for b2 being non empty FSM of b1
for b3, b4 being FinSequence of b1
for b5 being State of b2
for b6 being Nat st 1 <= b6 & b6 <= len b3 holds
(b5,(b3 ^ b4) -admissible ) . b6 = (b5,b3 -admissible ) . b6
proof end;

theorem Th21: :: FSM_1:21
for b1 being non empty set
for b2 being non empty FSM of b1
for b3, b4 being FinSequence of b1
for b5, b6 being State of b2 st b5,b3 -leads_to b6 holds
(b5,(b3 ^ b4) -admissible ) . ((len b3) + 1) = b6
proof end;

theorem Th22: :: FSM_1:22
for b1 being non empty set
for b2 being non empty FSM of b1
for b3, b4 being FinSequence of b1
for b5, b6 being State of b2 st b5,b3 -leads_to b6 holds
for b7 being Nat st 1 <= b7 & b7 <= (len b4) + 1 holds
(b5,(b3 ^ b4) -admissible ) . ((len b3) + b7) = (b6,b4 -admissible ) . b7
proof end;

theorem Th23: :: FSM_1:23
for b1 being non empty set
for b2 being non empty FSM of b1
for b3, b4 being FinSequence of b1
for b5, b6 being State of b2 st b5,b3 -leads_to b6 holds
b5,(b3 ^ b4) -admissible = (Del (b5,b3 -admissible ),((len b3) + 1)) ^ (b6,b4 -admissible )
proof end;

definition
let c1 be set ;
let c2 be non empty set ;
attr a3 is strict;
struct Mealy-FSM of c1,c2 -> FSM of a1;
aggr Mealy-FSM(# carrier, Tran, OFun, InitS #) -> Mealy-FSM of a1,a2;
sel OFun c3 -> Function of [:the carrier of a3,a1:],a2;
attr a3 is strict;
struct Moore-FSM of c1,c2 -> FSM of a1;
aggr Moore-FSM(# carrier, Tran, OFun, InitS #) -> Moore-FSM of a1,a2;
sel OFun c3 -> Function of the carrier of a3,a2;
end;

registration
let c1 be set ;
let c2 be non empty finite set ;
let c3 be Function of [:c2,c1:],c2;
let c4 be Element of c2;
cluster FSM(# a2,a3,a4 #) -> non empty finite ;
coherence
( FSM(# c2,c3,c4 #) is finite & not FSM(# c2,c3,c4 #) is empty )
by GROUP_1:def 14, STRUCT_0:def 1;
end;

registration
let c1 be set ;
let c2 be non empty set ;
let c3 be non empty finite set ;
let c4 be Function of [:c3,c1:],c3;
let c5 be Function of [:c3,c1:],c2;
let c6 be Element of c3;
cluster Mealy-FSM(# a3,a4,a5,a6 #) -> non empty finite ;
coherence
( Mealy-FSM(# c3,c4,c5,c6 #) is finite & not Mealy-FSM(# c3,c4,c5,c6 #) is empty )
by GROUP_1:def 14, STRUCT_0:def 1;
end;

registration
let c1 be set ;
let c2 be non empty set ;
let c3 be non empty finite set ;
let c4 be Function of [:c3,c1:],c3;
let c5 be Function of c3,c2;
let c6 be Element of c3;
cluster Moore-FSM(# a3,a4,a5,a6 #) -> non empty finite ;
coherence
( Moore-FSM(# c3,c4,c5,c6 #) is finite & not Moore-FSM(# c3,c4,c5,c6 #) is empty )
by GROUP_1:def 14, STRUCT_0:def 1;
end;

registration
let c1 be set ;
let c2 be non empty set ;
cluster non empty finite Mealy-FSM of a1,a2;
existence
ex b1 being Mealy-FSM of c1,c2 st
( b1 is finite & not b1 is empty )
proof end;
cluster non empty finite Moore-FSM of a1,a2;
existence
ex b1 being Moore-FSM of c1,c2 st
( b1 is finite & not b1 is empty )
proof end;
end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4 be State of c3;
let c5 be FinSequence of c1;
func c4,c5 -response -> FinSequence of a2 means :Def6: :: FSM_1:def 6
( len a6 = len a5 & ( for b1 being Nat st b1 in dom a5 holds
a6 . b1 = the OFun of a3 . [((a4,a5 -admissible ) . b1),(a5 . b1)] ) );
existence
ex b1 being FinSequence of c2 st
( len b1 = len c5 & ( for b2 being Nat st b2 in dom c5 holds
b1 . b2 = the OFun of c3 . [((c4,c5 -admissible ) . b2),(c5 . b2)] ) )
proof end;
uniqueness
for b1, b2 being FinSequence of c2 st len b1 = len c5 & ( for b3 being Nat st b3 in dom c5 holds
b1 . b3 = the OFun of c3 . [((c4,c5 -admissible ) . b3),(c5 . b3)] ) & len b2 = len c5 & ( for b3 being Nat st b3 in dom c5 holds
b2 . b3 = the OFun of c3 . [((c4,c5 -admissible ) . b3),(c5 . b3)] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines -response FSM_1:def 6 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being State of b3
for b5 being FinSequence of b1
for b6 being FinSequence of b2 holds
( b6 = b4,b5 -response iff ( len b6 = len b5 & ( for b7 being Nat st b7 in dom b5 holds
b6 . b7 = the OFun of b3 . [((b4,b5 -admissible ) . b7),(b5 . b7)] ) ) );

theorem Th24: :: FSM_1:24
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being State of b3 holds b4,(<*> b1) -response = <*> b2
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Moore-FSM of c1,c2;
let c4 be State of c3;
let c5 be FinSequence of c1;
func c4,c5 -response -> FinSequence of a2 means :Def7: :: FSM_1:def 7
( len a6 = (len a5) + 1 & ( for b1 being Nat st b1 in Seg ((len a5) + 1) holds
a6 . b1 = the OFun of a3 . ((a4,a5 -admissible ) . b1) ) );
existence
ex b1 being FinSequence of c2 st
( len b1 = (len c5) + 1 & ( for b2 being Nat st b2 in Seg ((len c5) + 1) holds
b1 . b2 = the OFun of c3 . ((c4,c5 -admissible ) . b2) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of c2 st len b1 = (len c5) + 1 & ( for b3 being Nat st b3 in Seg ((len c5) + 1) holds
b1 . b3 = the OFun of c3 . ((c4,c5 -admissible ) . b3) ) & len b2 = (len c5) + 1 & ( for b3 being Nat st b3 in Seg ((len c5) + 1) holds
b2 . b3 = the OFun of c3 . ((c4,c5 -admissible ) . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines -response FSM_1:def 7 :
for b1, b2 being non empty set
for b3 being non empty Moore-FSM of b1,b2
for b4 being State of b3
for b5 being FinSequence of b1
for b6 being FinSequence of b2 holds
( b6 = b4,b5 -response iff ( len b6 = (len b5) + 1 & ( for b7 being Nat st b7 in Seg ((len b5) + 1) holds
b6 . b7 = the OFun of b3 . ((b4,b5 -admissible ) . b7) ) ) );

theorem Th25: :: FSM_1:25
for b1, b2 being non empty set
for b3 being FinSequence of b1
for b4 being non empty Moore-FSM of b1,b2
for b5 being State of b4 holds (b5,b3 -response ) . 1 = the OFun of b4 . b5
proof end;

theorem Th26: :: FSM_1:26
for b1, b2 being non empty set
for b3, b4 being FinSequence of b1
for b5 being non empty Mealy-FSM of b1,b2
for b6, b7 being State of b5 st b6,b3 -leads_to b7 holds
b6,(b3 ^ b4) -response = (b6,b3 -response ) ^ (b7,b4 -response )
proof end;

theorem Th27: :: FSM_1:27
for b1, b2 being non empty set
for b3, b4 being FinSequence of b1
for b5, b6 being non empty Mealy-FSM of b1,b2
for b7, b8 being State of b5
for b9, b10 being State of b6 st b7,b3 -leads_to b8 & b9,b3 -leads_to b10 & b8,b4 -response <> b10,b4 -response holds
b7,(b3 ^ b4) -response <> b9,(b3 ^ b4) -response
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4 be non empty Moore-FSM of c1,c2;
pred c3 is_similar_to c4 means :: FSM_1:def 8
for b1 being FinSequence of a1 holds <*(the OFun of a4 . the InitS of a4)*> ^ (the InitS of a3,b1 -response ) = the InitS of a4,b1 -response ;
end;

:: deftheorem Def8 defines is_similar_to FSM_1:def 8 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being non empty Moore-FSM of b1,b2 holds
( b3 is_similar_to b4 iff for b5 being FinSequence of b1 holds <*(the OFun of b4 . the InitS of b4)*> ^ (the InitS of b3,b5 -response ) = the InitS of b4,b5 -response );

theorem Th28: :: FSM_1:28
for b1, b2 being non empty set
for b3 being non empty finite Moore-FSM of b1,b2 ex b4 being non empty finite Mealy-FSM of b1,b2 st b4 is_similar_to b3
proof end;

theorem Th29: :: FSM_1:29
for b1 being non empty set
for b2 being non empty finite set
for b3 being non empty finite Mealy-FSM of b1,b2 ex b4 being non empty finite Moore-FSM of b1,b2 st b3 is_similar_to b4
proof end;

definition
let c1, c2 be non empty set ;
let c3, c4 be non empty Mealy-FSM of c1,c2;
pred c3,c4 -are_equivalent means :Def9: :: FSM_1:def 9
for b1 being FinSequence of a1 holds the InitS of a3,b1 -response = the InitS of a4,b1 -response ;
reflexivity
for b1 being non empty Mealy-FSM of c1,c2
for b2 being FinSequence of c1 holds the InitS of b1,b2 -response = the InitS of b1,b2 -response
;
symmetry
for b1, b2 being non empty Mealy-FSM of c1,c2 st ( for b3 being FinSequence of c1 holds the InitS of b1,b3 -response = the InitS of b2,b3 -response ) holds
for b3 being FinSequence of c1 holds the InitS of b2,b3 -response = the InitS of b1,b3 -response
;
end;

:: deftheorem Def9 defines -are_equivalent FSM_1:def 9 :
for b1, b2 being non empty set
for b3, b4 being non empty Mealy-FSM of b1,b2 holds
( b3,b4 -are_equivalent iff for b5 being FinSequence of b1 holds the InitS of b3,b5 -response = the InitS of b4,b5 -response );

theorem Th30: :: FSM_1:30
for b1, b2 being non empty set
for b3, b4, b5 being non empty Mealy-FSM of b1,b2 st b3,b4 -are_equivalent & b4,b5 -are_equivalent holds
b3,b5 -are_equivalent
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4, c5 be State of c3;
pred c4,c5 -are_equivalent means :Def10: :: FSM_1:def 10
for b1 being FinSequence of a1 holds a4,b1 -response = a5,b1 -response ;
reflexivity
for b1 being State of c3
for b2 being FinSequence of c1 holds b1,b2 -response = b1,b2 -response
;
symmetry
for b1, b2 being State of c3 st ( for b3 being FinSequence of c1 holds b1,b3 -response = b2,b3 -response ) holds
for b3 being FinSequence of c1 holds b2,b3 -response = b1,b3 -response
;
end;

:: deftheorem Def10 defines -are_equivalent FSM_1:def 10 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4, b5 being State of b3 holds
( b4,b5 -are_equivalent iff for b6 being FinSequence of b1 holds b4,b6 -response = b5,b6 -response );

theorem Th31: :: FSM_1:31
canceled;

theorem Th32: :: FSM_1:32
canceled;

theorem Th33: :: FSM_1:33
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4, b5, b6 being State of b3 st b4,b5 -are_equivalent & b5,b6 -are_equivalent holds
b4,b6 -are_equivalent
proof end;

theorem Th34: :: FSM_1:34
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being FinSequence of b1
for b5 being non empty Mealy-FSM of b1,b2
for b6, b7 being State of b5 st b6 = the Tran of b5 . [b7,b3] holds
for b8 being Nat st b8 in Seg ((len b4) + 1) holds
(b7,(<*b3*> ^ b4) -admissible ) . (b8 + 1) = (b6,b4 -admissible ) . b8
proof end;

theorem Th35: :: FSM_1:35
for b1, b2 being non empty set
for b3 being Element of b1
for b4 being FinSequence of b1
for b5 being non empty Mealy-FSM of b1,b2
for b6, b7 being State of b5 st b6 = the Tran of b5 . [b7,b3] holds
b7,(<*b3*> ^ b4) -response = <*(the OFun of b5 . [b7,b3])*> ^ (b6,b4 -response )
proof end;

theorem Th36: :: FSM_1:36
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b2,b1
for b4, b5 being State of b3 holds
( b4,b5 -are_equivalent iff for b6 being Element of b2 holds
( the OFun of b3 . [b4,b6] = the OFun of b3 . [b5,b6] & the Tran of b3 . [b4,b6],the Tran of b3 . [b5,b6] -are_equivalent ) )
proof end;

theorem Th37: :: FSM_1:37
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b2,b1
for b4, b5 being State of b3 st b4,b5 -are_equivalent holds
for b6 being FinSequence of b2
for b7 being Nat st b7 in dom b6 holds
ex b8, b9 being State of b3 st
( b8 = (b4,b6 -admissible ) . b7 & b9 = (b5,b6 -admissible ) . b7 & b8,b9 -are_equivalent )
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4, c5 be State of c3;
let c6 be Nat;
pred c6 -equivalent c4,c5 means :Def11: :: FSM_1:def 11
for b1 being FinSequence of a1 st len b1 <= a6 holds
a4,b1 -response = a5,b1 -response ;
end;

:: deftheorem Def11 defines -equivalent FSM_1:def 11 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4, b5 being State of b3
for b6 being Nat holds
( b6 -equivalent b4,b5 iff for b7 being FinSequence of b1 st len b7 <= b6 holds
b4,b7 -response = b5,b7 -response );

theorem Th38: :: FSM_1:38
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3
for b5 being State of b4 holds b1 -equivalent b5,b5
proof end;

theorem Th39: :: FSM_1:39
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3
for b5, b6 being State of b4 st b1 -equivalent b5,b6 holds
b1 -equivalent b6,b5
proof end;

theorem Th40: :: FSM_1:40
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3
for b5, b6, b7 being State of b4 st b1 -equivalent b5,b6 & b1 -equivalent b6,b7 holds
b1 -equivalent b5,b7
proof end;

theorem Th41: :: FSM_1:41
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3
for b5, b6 being State of b4 st b5,b6 -are_equivalent holds
b1 -equivalent b5,b6
proof end;

theorem Th42: :: FSM_1:42
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4, b5 being State of b3 holds 0 -equivalent b4,b5
proof end;

theorem Th43: :: FSM_1:43
for b1, b2 being Nat
for b3, b4 being non empty set
for b5 being non empty Mealy-FSM of b3,b4
for b6, b7 being State of b5 st b1 + b2 -equivalent b6,b7 holds
b1 -equivalent b6,b7
proof end;

theorem Th44: :: FSM_1:44
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b3,b2
for b5, b6 being State of b4 st 1 <= b1 holds
( b1 -equivalent b5,b6 iff ( 1 -equivalent b5,b6 & ( for b7 being Element of b3
for b8 being Nat st b8 = b1 - 1 holds
b8 -equivalent the Tran of b4 . [b5,b7],the Tran of b4 . [b6,b7] ) ) )
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4 be Nat;
func c4 -eq_states_EqR c3 -> Equivalence_Relation of the carrier of a3 means :Def12: :: FSM_1:def 12
for b1, b2 being State of a3 holds
( [b1,b2] in a5 iff a4 -equivalent b1,b2 );
existence
ex b1 being Equivalence_Relation of the carrier of c3 st
for b2, b3 being State of c3 holds
( [b2,b3] in b1 iff c4 -equivalent b2,b3 )
proof end;
uniqueness
for b1, b2 being Equivalence_Relation of the carrier of c3 st ( for b3, b4 being State of c3 holds
( [b3,b4] in b1 iff c4 -equivalent b3,b4 ) ) & ( for b3, b4 being State of c3 holds
( [b3,b4] in b2 iff c4 -equivalent b3,b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def12 defines -eq_states_EqR FSM_1:def 12 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being Nat
for b5 being Equivalence_Relation of the carrier of b3 holds
( b5 = b4 -eq_states_EqR b3 iff for b6, b7 being State of b3 holds
( [b6,b7] in b5 iff b4 -equivalent b6,b7 ) );

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4 be Nat;
func c4 -eq_states_partition c3 -> non empty a_partition of the carrier of a3 equals :: FSM_1:def 13
Class (a4 -eq_states_EqR a3);
coherence
Class (c4 -eq_states_EqR c3) is non empty a_partition of the carrier of c3
;
end;

:: deftheorem Def13 defines -eq_states_partition FSM_1:def 13 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being Nat holds b4 -eq_states_partition b3 = Class (b4 -eq_states_EqR b3);

theorem Th45: :: FSM_1:45
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3 holds (b1 + 1) -eq_states_partition b4 is_finer_than b1 -eq_states_partition b4
proof end;

theorem Th46: :: FSM_1:46
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3 st Class (b1 -eq_states_EqR b4) = Class ((b1 + 1) -eq_states_EqR b4) holds
for b5 being Nat holds Class ((b1 + b5) -eq_states_EqR b4) = Class (b1 -eq_states_EqR b4)
proof end;

theorem Th47: :: FSM_1:47
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3 st b1 -eq_states_partition b4 = (b1 + 1) -eq_states_partition b4 holds
for b5 being Nat holds (b1 + b5) -eq_states_partition b4 = b1 -eq_states_partition b4 by Th46;

theorem Th48: :: FSM_1:48
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3 st (b1 + 1) -eq_states_partition b4 <> b1 -eq_states_partition b4 holds
for b5 being Nat st b5 <= b1 holds
(b5 + 1) -eq_states_partition b4 <> b5 -eq_states_partition b4
proof end;

theorem Th49: :: FSM_1:49
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty finite Mealy-FSM of b2,b3 holds
( b1 -eq_states_partition b4 = (b1 + 1) -eq_states_partition b4 or card (b1 -eq_states_partition b4) < card ((b1 + 1) -eq_states_partition b4) )
proof end;

theorem Th50: :: FSM_1:50
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being State of b3 holds Class (0 -eq_states_EqR b3),b4 = the carrier of b3
proof end;

theorem Th51: :: FSM_1:51
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2 holds 0 -eq_states_partition b3 = {the carrier of b3}
proof end;

theorem Th52: :: FSM_1:52
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty finite Mealy-FSM of b2,b3 st b1 + 1 = card the carrier of b4 holds
(b1 + 1) -eq_states_partition b4 = b1 -eq_states_partition b4
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4 be a_partition of the carrier of c3;
attr a4 is final means :Def14: :: FSM_1:def 14
for b1, b2 being State of a3 holds
( b1,b2 -are_equivalent iff ex b3 being Element of a4 st
( b1 in b3 & b2 in b3 ) );
end;

:: deftheorem Def14 defines final FSM_1:def 14 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being a_partition of the carrier of b3 holds
( b4 is final iff for b5, b6 being State of b3 holds
( b5,b6 -are_equivalent iff ex b7 being Element of b4 st
( b5 in b7 & b6 in b7 ) ) );

theorem Th53: :: FSM_1:53
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3 st b1 -eq_states_partition b4 is final holds
(b1 + 1) -eq_states_EqR b4 = b1 -eq_states_EqR b4
proof end;

theorem Th54: :: FSM_1:54
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty Mealy-FSM of b2,b3 holds
( b1 -eq_states_partition b4 = (b1 + 1) -eq_states_partition b4 iff b1 -eq_states_partition b4 is final )
proof end;

theorem Th55: :: FSM_1:55
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty finite Mealy-FSM of b2,b3 st b1 + 1 = card the carrier of b4 holds
ex b5 being Nat st
( b5 <= b1 & b5 -eq_states_partition b4 is final )
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty finite Mealy-FSM of c1,c2;
func final_states_partition c3 -> a_partition of the carrier of a3 means :Def15: :: FSM_1:def 15
a4 is final;
existence
ex b1 being a_partition of the carrier of c3 st b1 is final
proof end;
uniqueness
for b1, b2 being a_partition of the carrier of c3 st b1 is final & b2 is final holds
b1 = b2
proof end;
end;

:: deftheorem Def15 defines final_states_partition FSM_1:def 15 :
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4 being a_partition of the carrier of b3 holds
( b4 = final_states_partition b3 iff b4 is final );

theorem Th56: :: FSM_1:56
for b1 being Nat
for b2, b3 being non empty set
for b4 being non empty finite Mealy-FSM of b2,b3 st b1 + 1 = card the carrier of b4 holds
final_states_partition b4 = b1 -eq_states_partition b4
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty finite Mealy-FSM of c1,c2;
let c4 be Element of final_states_partition c3;
let c5 be Element of c1;
func c5,c4 -succ_class -> Element of final_states_partition a3 means :Def16: :: FSM_1:def 16
ex b1 being State of a3ex b2 being Nat st
( b1 in a4 & b2 + 1 = card the carrier of a3 & a6 = Class (b2 -eq_states_EqR a3),(the Tran of a3 . [b1,a5]) );
existence
ex b1 being Element of final_states_partition c3ex b2 being State of c3ex b3 being Nat st
( b2 in c4 & b3 + 1 = card the carrier of c3 & b1 = Class (b3 -eq_states_EqR c3),(the Tran of c3 . [b2,c5]) )
proof end;
uniqueness
for b1, b2 being Element of final_states_partition c3 st ex b3 being State of c3ex b4 being Nat st
( b3 in c4 & b4 + 1 = card the carrier of c3 & b1 = Class (b4 -eq_states_EqR c3),(the Tran of c3 . [b3,c5]) ) & ex b3 being State of c3ex b4 being Nat st
( b3 in c4 & b4 + 1 = card the carrier of c3 & b2 = Class (b4 -eq_states_EqR c3),(the Tran of c3 . [b3,c5]) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def16 defines -succ_class FSM_1:def 16 :
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4 being Element of final_states_partition b3
for b5 being Element of b1
for b6 being Element of final_states_partition b3 holds
( b6 = b5,b4 -succ_class iff ex b7 being State of b3ex b8 being Nat st
( b7 in b4 & b8 + 1 = card the carrier of b3 & b6 = Class (b8 -eq_states_EqR b3),(the Tran of b3 . [b7,b5]) ) );

definition
let c1, c2 be non empty set ;
let c3 be non empty finite Mealy-FSM of c1,c2;
let c4 be Element of final_states_partition c3;
let c5 be Element of c1;
func c4,c5 -class_response -> Element of a2 means :Def17: :: FSM_1:def 17
ex b1 being State of a3 st
( b1 in a4 & a6 = the OFun of a3 . [b1,a5] );
existence
ex b1 being Element of c2ex b2 being State of c3 st
( b2 in c4 & b1 = the OFun of c3 . [b2,c5] )
proof end;
uniqueness
for b1, b2 being Element of c2 st ex b3 being State of c3 st
( b3 in c4 & b1 = the OFun of c3 . [b3,c5] ) & ex b3 being State of c3 st
( b3 in c4 & b2 = the OFun of c3 . [b3,c5] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def17 defines -class_response FSM_1:def 17 :
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4 being Element of final_states_partition b3
for b5 being Element of b1
for b6 being Element of b2 holds
( b6 = b4,b5 -class_response iff ex b7 being State of b3 st
( b7 in b4 & b6 = the OFun of b3 . [b7,b5] ) );

definition
let c1, c2 be non empty set ;
let c3 be non empty finite Mealy-FSM of c1,c2;
func the_reduction_of c3 -> strict Mealy-FSM of a1,a2 means :Def18: :: FSM_1:def 18
( the carrier of a4 = final_states_partition a3 & ( for b1 being State of a4
for b2 being Element of a1
for b3 being State of a3 st b3 in b1 holds
( the Tran of a3 . [b3,b2] in the Tran of a4 . [b1,b2] & the OFun of a3 . [b3,b2] = the OFun of a4 . [b1,b2] ) ) & the InitS of a3 in the InitS of a4 );
existence
ex b1 being strict Mealy-FSM of c1,c2 st
( the carrier of b1 = final_states_partition c3 & ( for b2 being State of b1
for b3 being Element of c1
for b4 being State of c3 st b4 in b2 holds
( the Tran of c3 . [b4,b3] in the Tran of b1 . [b2,b3] & the OFun of c3 . [b4,b3] = the OFun of b1 . [b2,b3] ) ) & the InitS of c3 in the InitS of b1 )
proof end;
uniqueness
for b1, b2 being strict Mealy-FSM of c1,c2 st the carrier of b1 = final_states_partition c3 & ( for b3 being State of b1
for b4 being Element of c1
for b5 being State of c3 st b5 in b3 holds
( the Tran of c3 . [b5,b4] in the Tran of b1 . [b3,b4] & the OFun of c3 . [b5,b4] = the OFun of b1 . [b3,b4] ) ) & the InitS of c3 in the InitS of b1 & the carrier of b2 = final_states_partition c3 & ( for b3 being State of b2
for b4 being Element of c1
for b5 being State of c3 st b5 in b3 holds
( the Tran of c3 . [b5,b4] in the Tran of b2 . [b3,b4] & the OFun of c3 . [b5,b4] = the OFun of b2 . [b3,b4] ) ) & the InitS of c3 in the InitS of b2 holds
b1 = b2
proof end;
end;

:: deftheorem Def18 defines the_reduction_of FSM_1:def 18 :
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4 being strict Mealy-FSM of b1,b2 holds
( b4 = the_reduction_of b3 iff ( the carrier of b4 = final_states_partition b3 & ( for b5 being State of b4
for b6 being Element of b1
for b7 being State of b3 st b7 in b5 holds
( the Tran of b3 . [b7,b6] in the Tran of b4 . [b5,b6] & the OFun of b3 . [b7,b6] = the OFun of b4 . [b5,b6] ) ) & the InitS of b3 in the InitS of b4 ) );

registration
let c1, c2 be non empty set ;
let c3 be non empty finite Mealy-FSM of c1,c2;
cluster the_reduction_of a3 -> non empty finite strict ;
coherence
( not the_reduction_of c3 is empty & the_reduction_of c3 is finite )
proof end;
end;

theorem Th57: :: FSM_1:57
for b1, b2 being non empty set
for b3 being FinSequence of b1
for b4, b5 being non empty finite Mealy-FSM of b1,b2
for b6 being State of b5
for b7 being State of b4 st b4 = the_reduction_of b5 & b6 in b7 holds
for b8 being Nat st b8 in Seg ((len b3) + 1) holds
(b6,b3 -admissible ) . b8 in (b7,b3 -admissible ) . b8
proof end;

theorem Th58: :: FSM_1:58
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2 holds b3, the_reduction_of b3 -are_equivalent
proof end;

definition
let c1, c2 be non empty set ;
let c3, c4 be non empty Mealy-FSM of c1,c2;
pred c3,c4 -are_isomorphic means :Def19: :: FSM_1:def 19
ex b1 being Function of the carrier of a3,the carrier of a4 st
( b1 is bijective & b1 . the InitS of a3 = the InitS of a4 & ( for b2 being State of a3
for b3 being Element of a1 holds
( b1 . (the Tran of a3 . [b2,b3]) = the Tran of a4 . [(b1 . b2),b3] & the OFun of a3 . [b2,b3] = the OFun of a4 . [(b1 . b2),b3] ) ) );
reflexivity
for b1 being non empty Mealy-FSM of c1,c2 ex b2 being Function of the carrier of b1,the carrier of b1 st
( b2 is bijective & b2 . the InitS of b1 = the InitS of b1 & ( for b3 being State of b1
for b4 being Element of c1 holds
( b2 . (the Tran of b1 . [b3,b4]) = the Tran of b1 . [(b2 . b3),b4] & the OFun of b1 . [b3,b4] = the OFun of b1 . [(b2 . b3),b4] ) ) )
proof end;
symmetry
for b1, b2 being non empty Mealy-FSM of c1,c2 st ex b3 being Function of the carrier of b1,the carrier of b2 st
( b3 is bijective & b3 . the InitS of b1 = the InitS of b2 & ( for b4 being State of b1
for b5 being Element of c1 holds
( b3 . (the Tran of b1 . [b4,b5]) = the Tran of b2 . [(b3 . b4),b5] & the OFun of b1 . [b4,b5] = the OFun of b2 . [(b3 . b4),b5] ) ) ) holds
ex b3 being Function of the carrier of b2,the carrier of b1 st
( b3 is bijective & b3 . the InitS of b2 = the InitS of b1 & ( for b4 being State of b2
for b5 being Element of c1 holds
( b3 . (the Tran of b2 . [b4,b5]) = the Tran of b1 . [(b3 . b4),b5] & the OFun of b2 . [b4,b5] = the OFun of b1 . [(b3 . b4),b5] ) ) )
proof end;
end;

:: deftheorem Def19 defines -are_isomorphic FSM_1:def 19 :
for b1, b2 being non empty set
for b3, b4 being non empty Mealy-FSM of b1,b2 holds
( b3,b4 -are_isomorphic iff ex b5 being Function of the carrier of b3,the carrier of b4 st
( b5 is bijective & b5 . the InitS of b3 = the InitS of b4 & ( for b6 being State of b3
for b7 being Element of b1 holds
( b5 . (the Tran of b3 . [b6,b7]) = the Tran of b4 . [(b5 . b6),b7] & the OFun of b3 . [b6,b7] = the OFun of b4 . [(b5 . b6),b7] ) ) ) );

theorem Th59: :: FSM_1:59
for b1, b2 being non empty set
for b3, b4, b5 being non empty Mealy-FSM of b1,b2 st b3,b4 -are_isomorphic & b4,b5 -are_isomorphic holds
b3,b5 -are_isomorphic
proof end;

theorem Th60: :: FSM_1:60
for b1, b2 being non empty set
for b3 being FinSequence of b2
for b4, b5 being non empty Mealy-FSM of b2,b1
for b6 being State of b4
for b7 being Function of the carrier of b4,the carrier of b5 st ( for b8 being State of b4
for b9 being Element of b2 holds b7 . (the Tran of b4 . [b8,b9]) = the Tran of b5 . [(b7 . b8),b9] ) holds
for b8 being Nat st 1 <= b8 & b8 <= (len b3) + 1 holds
b7 . ((b6,b3 -admissible ) . b8) = ((b7 . b6),b3 -admissible ) . b8
proof end;

theorem Th61: :: FSM_1:61
for b1, b2 being non empty set
for b3, b4 being non empty Mealy-FSM of b2,b1
for b5, b6 being State of b3
for b7 being Function of the carrier of b3,the carrier of b4 st b7 . the InitS of b3 = the InitS of b4 & ( for b8 being State of b3
for b9 being Element of b2 holds
( b7 . (the Tran of b3 . [b8,b9]) = the Tran of b4 . [(b7 . b8),b9] & the OFun of b3 . [b8,b9] = the OFun of b4 . [(b7 . b8),b9] ) ) holds
( b5,b6 -are_equivalent iff b7 . b5,b7 . b6 -are_equivalent )
proof end;

theorem Th62: :: FSM_1:62
for b1, b2 being non empty set
for b3, b4 being non empty finite Mealy-FSM of b1,b2
for b5, b6 being State of b3 st b3 = the_reduction_of b4 & b5 <> b6 holds
not b5,b6 -are_equivalent
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
attr a3 is reduced means :Def20: :: FSM_1:def 20
for b1, b2 being State of a3 st b1 <> b2 holds
not b1,b2 -are_equivalent ;
end;

:: deftheorem Def20 defines reduced FSM_1:def 20 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2 holds
( b3 is reduced iff for b4, b5 being State of b3 st b4 <> b5 holds
not b4,b5 -are_equivalent );

theorem Th63: :: FSM_1:63
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2 holds the_reduction_of b3 is reduced
proof end;

registration
let c1, c2 be non empty set ;
cluster non empty finite reduced Mealy-FSM of a1,a2;
existence
ex b1 being non empty Mealy-FSM of c1,c2 st
( b1 is reduced & b1 is finite )
proof end;
end;

theorem Th64: :: FSM_1:64
for b1, b2 being non empty set
for b3 being non empty finite reduced Mealy-FSM of b1,b2 holds b3, the_reduction_of b3 -are_isomorphic
proof end;

theorem Th65: :: FSM_1:65
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2 holds
( b3 is reduced iff ex b4 being non empty finite Mealy-FSM of b1,b2 st b3, the_reduction_of b4 -are_isomorphic )
proof end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
let c4 be State of c3;
attr a4 is accessible means :Def21: :: FSM_1:def 21
ex b1 being FinSequence of a1 st the InitS of a3,b1 -leads_to a4;
end;

:: deftheorem Def21 defines accessible FSM_1:def 21 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2
for b4 being State of b3 holds
( b4 is accessible iff ex b5 being FinSequence of b1 st the InitS of b3,b5 -leads_to b4 );

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
attr a3 is connected means :Def22: :: FSM_1:def 22
for b1 being State of a3 holds b1 is accessible;
end;

:: deftheorem Def22 defines connected FSM_1:def 22 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2 holds
( b3 is connected iff for b4 being State of b3 holds b4 is accessible );

registration
let c1, c2 be non empty set ;
cluster non empty finite connected Mealy-FSM of a1,a2;
existence
ex b1 being non empty finite Mealy-FSM of c1,c2 st b1 is connected
proof end;
end;

theorem Th66: :: FSM_1:66
for b1, b2 being non empty set
for b3 being non empty finite connected Mealy-FSM of b1,b2 holds the_reduction_of b3 is connected
proof end;

registration
let c1, c2 be non empty set ;
cluster non empty finite reduced connected Mealy-FSM of a1,a2;
existence
ex b1 being non empty Mealy-FSM of c1,c2 st
( b1 is connected & b1 is reduced & b1 is finite )
proof end;
end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Mealy-FSM of c1,c2;
func accessibleStates c3 -> set equals :: FSM_1:def 23
{ b1 where B is State of a3 : b1 is accessible } ;
coherence
{ b1 where B is State of c3 : b1 is accessible } is set
;
end;

:: deftheorem Def23 defines accessibleStates FSM_1:def 23 :
for b1, b2 being non empty set
for b3 being non empty Mealy-FSM of b1,b2 holds accessibleStates b3 = { b4 where B is State of b3 : b4 is accessible } ;

registration
let c1, c2 be non empty set ;
let c3 be non empty finite Mealy-FSM of c1,c2;
cluster accessibleStates a3 -> non empty finite ;
coherence
( accessibleStates c3 is finite & not accessibleStates c3 is empty )
proof end;
end;

theorem Th67: :: FSM_1:67
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b2,b1 holds
( accessibleStates b3 c= the carrier of b3 & ( for b4 being State of b3 holds
( b4 in accessibleStates b3 iff b4 is accessible ) ) )
proof end;

theorem Th68: :: FSM_1:68
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b2,b1 holds the Tran of b3 | [:(accessibleStates b3),b2:] is Function of [:(accessibleStates b3),b2:], accessibleStates b3
proof end;

theorem Th69: :: FSM_1:69
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4 being Function of [:(accessibleStates b3),b1:], accessibleStates b3
for b5 being Function of [:(accessibleStates b3),b1:],b2
for b6 being Element of accessibleStates b3 st b4 = the Tran of b3 | [:(accessibleStates b3),b1:] & b5 = the OFun of b3 | [:(accessibleStates b3),b1:] & b6 = the InitS of b3 holds
b3, Mealy-FSM(# (accessibleStates b3),b4,b5,b6 #) -are_equivalent
proof end;

theorem Th70: :: FSM_1:70
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b2,b1 ex b4 being non empty finite connected Mealy-FSM of b2,b1 st
( the Tran of b4 = the Tran of b3 | [:(accessibleStates b3),b2:] & the OFun of b4 = the OFun of b3 | [:(accessibleStates b3),b2:] & the InitS of b4 = the InitS of b3 & b3,b4 -are_equivalent )
proof end;

definition
let c1 be set ;
let c2 be non empty set ;
let c3, c4 be non empty Mealy-FSM of c1,c2;
func c3 -Mealy_union c4 -> strict Mealy-FSM of a1,a2 means :Def24: :: FSM_1:def 24
( the carrier of a5 = the carrier of a3 \/ the carrier of a4 & the Tran of a5 = the Tran of a3 +* the Tran of a4 & the OFun of a5 = the OFun of a3 +* the OFun of a4 & the InitS of a5 = the InitS of a3 );
existence
ex b1 being strict Mealy-FSM of c1,c2 st
( the carrier of b1 = the carrier of c3 \/ the carrier of c4 & the Tran of b1 = the Tran of c3 +* the Tran of c4 & the OFun of b1 = the OFun of c3 +* the OFun of c4 & the InitS of b1 = the InitS of c3 )
proof end;
uniqueness
for b1, b2 being strict Mealy-FSM of c1,c2 st the carrier of b1 = the carrier of c3 \/ the carrier of c4 & the Tran of b1 = the Tran of c3 +* the Tran of c4 & the OFun of b1 = the OFun of c3 +* the OFun of c4 & the InitS of b1 = the InitS of c3 & the carrier of b2 = the carrier of c3 \/ the carrier of c4 & the Tran of b2 = the Tran of c3 +* the Tran of c4 & the OFun of b2 = the OFun of c3 +* the OFun of c4 & the InitS of b2 = the InitS of c3 holds
b1 = b2
;
end;

:: deftheorem Def24 defines -Mealy_union FSM_1:def 24 :
for b1 being set
for b2 being non empty set
for b3, b4 being non empty Mealy-FSM of b1,b2
for b5 being strict Mealy-FSM of b1,b2 holds
( b5 = b3 -Mealy_union b4 iff ( the carrier of b5 = the carrier of b3 \/ the carrier of b4 & the Tran of b5 = the Tran of b3 +* the Tran of b4 & the OFun of b5 = the OFun of b3 +* the OFun of b4 & the InitS of b5 = the InitS of b3 ) );

registration
let c1 be set ;
let c2 be non empty set ;
let c3, c4 be non empty finite Mealy-FSM of c1,c2;
cluster a3 -Mealy_union a4 -> non empty finite strict ;
coherence
( not c3 -Mealy_union c4 is empty & c3 -Mealy_union c4 is finite )
proof end;
end;

theorem Th71: :: FSM_1:71
for b1, b2 being non empty set
for b3 being FinSequence of b1
for b4, b5 being non empty Mealy-FSM of b1,b2
for b6 being State of b4
for b7 being non empty finite Mealy-FSM of b1,b2
for b8 being State of b7 st b7 = b4 -Mealy_union b5 & the carrier of b4 misses the carrier of b5 & b6 = b8 holds
b6,b3 -admissible = b8,b3 -admissible
proof end;

theorem Th72: :: FSM_1:72
for b1, b2 being non empty set
for b3 being FinSequence of b1
for b4, b5 being non empty Mealy-FSM of b1,b2
for b6 being State of b4
for b7 being non empty finite Mealy-FSM of b1,b2
for b8 being State of b7 st b7 = b4 -Mealy_union b5 & the carrier of b4 misses the carrier of b5 & b6 = b8 holds
b6,b3 -response = b8,b3 -response
proof end;

theorem Th73: :: FSM_1:73
for b1, b2 being non empty set
for b3 being FinSequence of b1
for b4, b5 being non empty Mealy-FSM of b1,b2
for b6 being State of b5
for b7 being non empty finite Mealy-FSM of b1,b2
for b8 being State of b7 st b7 = b4 -Mealy_union b5 & the carrier of b4 misses the carrier of b5 & b6 = b8 holds
b6,b3 -admissible = b8,b3 -admissible
proof end;

theorem Th74: :: FSM_1:74
for b1, b2 being non empty set
for b3 being FinSequence of b1
for b4, b5 being non empty Mealy-FSM of b1,b2
for b6 being State of b5
for b7 being non empty finite Mealy-FSM of b1,b2
for b8 being State of b7 st b7 = b4 -Mealy_union b5 & the carrier of b4 misses the carrier of b5 & b6 = b8 holds
b6,b3 -response = b8,b3 -response
proof end;

theorem Th75: :: FSM_1:75
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4, b5 being non empty reduced Mealy-FSM of b1,b2 st b3 = b4 -Mealy_union b5 & the carrier of b4 misses the carrier of b5 & b4,b5 -are_equivalent holds
ex b6 being State of (the_reduction_of b3) st
( the InitS of b4 in b6 & the InitS of b5 in b6 & b6 = the InitS of (the_reduction_of b3) )
proof end;

theorem Th76: :: FSM_1:76
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4, b5 being non empty reduced connected Mealy-FSM of b1,b2
for b6, b7 being State of b3
for b8, b9 being State of b4 st b8 = b6 & b9 = b7 & the carrier of b4 misses the carrier of b5 & b4,b5 -are_equivalent & b3 = b4 -Mealy_union b5 & not b8,b9 -are_equivalent holds
not b6,b7 -are_equivalent
proof end;

theorem Th77: :: FSM_1:77
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4, b5 being non empty reduced connected Mealy-FSM of b1,b2
for b6, b7 being State of b3
for b8, b9 being State of b4 st b8 = b6 & b9 = b7 & the carrier of b5 misses the carrier of b4 & b5,b4 -are_equivalent & b3 = b5 -Mealy_union b4 & not b8,b9 -are_equivalent holds
not b6,b7 -are_equivalent
proof end;

theorem Th78: :: FSM_1:78
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4, b5 being non empty finite reduced connected Mealy-FSM of b1,b2 st the carrier of b4 misses the carrier of b5 & b4,b5 -are_equivalent & b3 = b4 -Mealy_union b5 holds
for b6 being State of (the_reduction_of b3)
for b7, b8 being Element of b6 holds
( not b7 in the carrier of b4 or not b8 in the carrier of b4 or not b7 <> b8 )
proof end;

theorem Th79: :: FSM_1:79
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4, b5 being non empty finite reduced connected Mealy-FSM of b1,b2 st the carrier of b4 misses the carrier of b5 & b4,b5 -are_equivalent & b3 = b4 -Mealy_union b5 holds
for b6 being State of (the_reduction_of b3)
for b7, b8 being Element of b6 holds
( not b7 in the carrier of b5 or not b8 in the carrier of b5 or not b7 <> b8 )
proof end;

theorem Th80: :: FSM_1:80
for b1, b2 being non empty set
for b3 being non empty finite Mealy-FSM of b1,b2
for b4, b5 being non empty finite reduced connected Mealy-FSM of b1,b2 st the carrier of b4 misses the carrier of b5 & b4,b5 -are_equivalent & b3 = b4 -Mealy_union b5 holds
for b6 being State of (the_reduction_of b3) ex b7, b8 being Element of b6 st
( b7 in the carrier of b4 & b8 in the carrier of b5 & ( for b9 being Element of b6 holds
( b9 = b7 or b9 = b8 ) ) )
proof end;

theorem Th81: :: FSM_1:81
for b1, b2 being non empty set
for b3, b4 being non empty finite Mealy-FSM of b1,b2 ex b5, b6 being non empty finite Mealy-FSM of b1,b2 st
( the carrier of b5 misses the carrier of b6 & b5,b3 -are_isomorphic & b6,b4 -are_isomorphic )
proof end;

theorem Th82: :: FSM_1:82
for b1, b2 being non empty set
for b3, b4 being non empty Mealy-FSM of b1,b2 st b3,b4 -are_isomorphic holds
b3,b4 -are_equivalent
proof end;

theorem Th83: :: FSM_1:83
for b1, b2 being non empty set
for b3, b4 being non empty finite reduced connected Mealy-FSM of b1,b2 st the carrier of b3 misses the carrier of b4 & b3,b4 -are_equivalent holds
b3,b4 -are_isomorphic
proof end;

theorem Th84: :: FSM_1:84
for b1, b2 being non empty set
for b3, b4 being non empty finite connected Mealy-FSM of b1,b2 st b3,b4 -are_equivalent holds
the_reduction_of b3, the_reduction_of b4 -are_isomorphic
proof end;

theorem Th85: :: FSM_1:85
for b1, b2 being non empty set
for b3, b4 being non empty finite reduced connected Mealy-FSM of b1,b2 holds
( b3,b4 -are_isomorphic iff b3,b4 -are_equivalent )
proof end;