:: CIRCTRM1 semantic presentation

theorem Th1: :: CIRCTRM1:1
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Variables of b2
for b4 being Term of b1,b3
for b5 being c-Term of b2,b3 st b5 = b4 holds
the_sort_of b5 = the_sort_of b4
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
func c3 -CircuitStr -> non empty strict ManySortedSign equals :: CIRCTRM1:def 1
ManySortedSign(# (Subtrees a3),([:the OperSymbols of a1,{the carrier of a1}:] -Subtrees a3),([:the OperSymbols of a1,{the carrier of a1}:] -ImmediateSubtrees a3),(incl ([:the OperSymbols of a1,{the carrier of a1}:] -Subtrees a3)) #);
correctness
coherence
ManySortedSign(# (Subtrees c3),([:the OperSymbols of c1,{the carrier of c1}:] -Subtrees c3),([:the OperSymbols of c1,{the carrier of c1}:] -ImmediateSubtrees c3),(incl ([:the OperSymbols of c1,{the carrier of c1}:] -Subtrees c3)) #) is non empty strict ManySortedSign
;
;
end;

:: deftheorem Def1 defines -CircuitStr CIRCTRM1:def 1 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2) holds b3 -CircuitStr = ManySortedSign(# (Subtrees b3),([:the OperSymbols of b1,{the carrier of b1}:] -Subtrees b3),([:the OperSymbols of b1,{the carrier of b1}:] -ImmediateSubtrees b3),(incl ([:the OperSymbols of b1,{the carrier of b1}:] -Subtrees b3)) #);

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
cluster a3 -CircuitStr -> non empty strict unsplit ;
coherence
c3 -CircuitStr is unsplit
proof end;
end;

theorem Th2: :: CIRCTRM1:2
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2) holds
( b3 -CircuitStr is void iff for b4 being Element of b3 holds
( b4 is root & not b4 . {} in [:the OperSymbols of b1,{the carrier of b1}:] ) )
proof end;

theorem Th3: :: CIRCTRM1:3
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2) holds
( b3 is SetWithCompoundTerm of b1,b2 iff not b3 -CircuitStr is void )
proof end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be SetWithCompoundTerm of c1,c2;
cluster a3 -CircuitStr -> non empty strict non void unsplit ;
coherence
not c3 -CircuitStr is void
by Th3;
end;

theorem Th4: :: CIRCTRM1:4
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2) holds
( ( for b4 being Vertex of (b3 -CircuitStr ) holds b4 is Term of b1,b2 ) & ( for b4 being set st b4 in the OperSymbols of (b3 -CircuitStr ) holds
b4 is CompoundTerm of b1,b2 ) )
proof end;

theorem Th5: :: CIRCTRM1:5
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2)
for b4 being Vertex of (b3 -CircuitStr ) holds
( b4 in the OperSymbols of (b3 -CircuitStr ) iff b4 is CompoundTerm of b1,b2 )
proof end;

theorem Th6: :: CIRCTRM1:6
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being SetWithCompoundTerm of b1,b2
for b4 being Gate of (b3 -CircuitStr ) holds
( the ResultSort of (b3 -CircuitStr ) . b4 = b4 & the_result_sort_of b4 = b4 ) by FUNCT_1:35;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be SetWithCompoundTerm of c1,c2;
let c4 be Gate of (c3 -CircuitStr );
cluster the_arity_of a4 -> DTree-yielding ;
coherence
the_arity_of c4 is DTree-yielding
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
cluster -> Relation-like Function-like finite Element of the carrier of (a3 -CircuitStr );
coherence
for b1 being Vertex of (c3 -CircuitStr ) holds
( b1 is finite & b1 is Function-like & b1 is Relation-like )
by Th4;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
cluster -> Relation-like Function-like finite DecoratedTree-like Element of the carrier of (a3 -CircuitStr );
coherence
for b1 being Vertex of (c3 -CircuitStr ) holds b1 is DecoratedTree-like
by Th4;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be SetWithCompoundTerm of c1,c2;
cluster -> Relation-like Function-like finite Element of the OperSymbols of (a3 -CircuitStr );
coherence
for b1 being Gate of (c3 -CircuitStr ) holds
( b1 is finite & b1 is Function-like & b1 is Relation-like )
by Th4;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be SetWithCompoundTerm of c1,c2;
cluster -> Relation-like Function-like finite DecoratedTree-like Element of the OperSymbols of (a3 -CircuitStr );
coherence
for b1 being Gate of (c3 -CircuitStr ) holds b1 is DecoratedTree-like
by Th4;
end;

theorem Th7: :: CIRCTRM1:7
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3, b4 being non empty Subset of (b1 -Terms b2) holds
( the Arity of (b3 -CircuitStr ) tolerates the Arity of (b4 -CircuitStr ) & the ResultSort of (b3 -CircuitStr ) tolerates the ResultSort of (b4 -CircuitStr ) )
proof end;

registration
let c1, c2 be constituted-DTrees set ;
cluster a1 \/ a2 -> constituted-DTrees ;
coherence
c1 \/ c2 is constituted-DTrees
by TREES_3:9;
end;

theorem Th8: :: CIRCTRM1:8
for b1, b2 being non empty constituted-DTrees set holds Subtrees (b1 \/ b2) = (Subtrees b1) \/ (Subtrees b2)
proof end;

theorem Th9: :: CIRCTRM1:9
for b1, b2 being non empty constituted-DTrees set
for b3 being set holds b3 -Subtrees (b1 \/ b2) = (b3 -Subtrees b1) \/ (b3 -Subtrees b2)
proof end;

theorem Th10: :: CIRCTRM1:10
for b1, b2 being non empty constituted-DTrees set st ( for b3 being Element of b1 holds b3 is finite ) & ( for b3 being Element of b2 holds b3 is finite ) holds
for b3 being set holds b3 -ImmediateSubtrees (b1 \/ b2) = (b3 -ImmediateSubtrees b1) +* (b3 -ImmediateSubtrees b2)
proof end;

theorem Th11: :: CIRCTRM1:11
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3, b4 being non empty Subset of (b1 -Terms b2) holds (b3 \/ b4) -CircuitStr = (b3 -CircuitStr ) +* (b4 -CircuitStr )
proof end;

theorem Th12: :: CIRCTRM1:12
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2)
for b4 being set holds
( b4 in InputVertices (b3 -CircuitStr ) iff ( b4 in Subtrees b3 & ex b5 being SortSymbol of b1ex b6 being Element of b2 . b5 st b4 = root-tree [b6,b5] ) )
proof end;

theorem Th13: :: CIRCTRM1:13
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being SetWithCompoundTerm of b1,b2
for b4 being Gate of (b3 -CircuitStr ) holds b4 = (b4 . {} ) -tree (the_arity_of b4)
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
let c4 be Vertex of (c3 -CircuitStr );
let c5 be MSAlgebra of c1;
func the_sort_of c4,c5 -> set means :Def2: :: CIRCTRM1:def 2
for b1 being Term of a1,a2 st b1 = a4 holds
a6 = the Sorts of a5 . (the_sort_of b1);
uniqueness
for b1, b2 being set st ( for b3 being Term of c1,c2 st b3 = c4 holds
b1 = the Sorts of c5 . (the_sort_of b3) ) & ( for b3 being Term of c1,c2 st b3 = c4 holds
b2 = the Sorts of c5 . (the_sort_of b3) ) holds
b1 = b2
proof end;
existence
ex b1 being set st
for b2 being Term of c1,c2 st b2 = c4 holds
b1 = the Sorts of c5 . (the_sort_of b2)
proof end;
end;

:: deftheorem Def2 defines the_sort_of CIRCTRM1:def 2 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2)
for b4 being Vertex of (b3 -CircuitStr )
for b5 being MSAlgebra of b1
for b6 being set holds
( b6 = the_sort_of b4,b5 iff for b7 being Term of b1,b2 st b7 = b4 holds
b6 = the Sorts of b5 . (the_sort_of b7) );

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
let c4 be Vertex of (c3 -CircuitStr );
let c5 be non-empty MSAlgebra of c1;
cluster the_sort_of a4,a5 -> non empty ;
coherence
not the_sort_of c4,c5 is empty
proof end;
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
assume E15: c3 is SetWithCompoundTerm of c1,c2 ;
let c4 be Gate of (c3 -CircuitStr );
let c5 be MSAlgebra of c1;
func the_action_of c4,c5 -> Function means :Def3: :: CIRCTRM1:def 3
for b1 being SetWithCompoundTerm of a1,a2 st b1 = a3 holds
for b2 being Gate of (b1 -CircuitStr ) st b2 = a4 holds
a6 = the Charact of a5 . ((b2 . {} ) `1 );
uniqueness
for b1, b2 being Function st ( for b3 being SetWithCompoundTerm of c1,c2 st b3 = c3 holds
for b4 being Gate of (b3 -CircuitStr ) st b4 = c4 holds
b1 = the Charact of c5 . ((b4 . {} ) `1 ) ) & ( for b3 being SetWithCompoundTerm of c1,c2 st b3 = c3 holds
for b4 being Gate of (b3 -CircuitStr ) st b4 = c4 holds
b2 = the Charact of c5 . ((b4 . {} ) `1 ) ) holds
b1 = b2
proof end;
existence
ex b1 being Function st
for b2 being SetWithCompoundTerm of c1,c2 st b2 = c3 holds
for b3 being Gate of (b2 -CircuitStr ) st b3 = c4 holds
b1 = the Charact of c5 . ((b3 . {} ) `1 )
proof end;
end;

:: deftheorem Def3 defines the_action_of CIRCTRM1:def 3 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2) st b3 is SetWithCompoundTerm of b1,b2 holds
for b4 being Gate of (b3 -CircuitStr )
for b5 being MSAlgebra of b1
for b6 being Function holds
( b6 = the_action_of b4,b5 iff for b7 being SetWithCompoundTerm of b1,b2 st b7 = b3 holds
for b8 being Gate of (b7 -CircuitStr ) st b8 = b4 holds
b6 = the Charact of b5 . ((b8 . {} ) `1 ) );

scheme :: CIRCTRM1:sch 1
s1{ F1() -> non empty set , F2() -> V2 ManySortedSet of F1(), F3() -> V2 ManySortedSet of F1(), P1[ set , set , set ] } :
ex b1 being ManySortedFunction of F2(),F3() st
for b2 being Element of F1()
for b3 being Element of F2() . b2 holds P1[b2,b3,(b1 . b2) . b3]
provided
E16: for b1 being Element of F1()
for b2 being Element of F2() . b1 ex b3 being Element of F3() . b1 st P1[b1,b2,b3]
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
let c4 be MSAlgebra of c1;
func c3 -CircuitSorts c4 -> ManySortedSet of the carrier of (a3 -CircuitStr ) means :Def4: :: CIRCTRM1:def 4
for b1 being Vertex of (a3 -CircuitStr ) holds a5 . b1 = the_sort_of b1,a4;
uniqueness
for b1, b2 being ManySortedSet of the carrier of (c3 -CircuitStr ) st ( for b3 being Vertex of (c3 -CircuitStr ) holds b1 . b3 = the_sort_of b3,c4 ) & ( for b3 being Vertex of (c3 -CircuitStr ) holds b2 . b3 = the_sort_of b3,c4 ) holds
b1 = b2
proof end;
existence
ex b1 being ManySortedSet of the carrier of (c3 -CircuitStr ) st
for b2 being Vertex of (c3 -CircuitStr ) holds b1 . b2 = the_sort_of b2,c4
proof end;
end;

:: deftheorem Def4 defines -CircuitSorts CIRCTRM1:def 4 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2)
for b4 being MSAlgebra of b1
for b5 being ManySortedSet of the carrier of (b3 -CircuitStr ) holds
( b5 = b3 -CircuitSorts b4 iff for b6 being Vertex of (b3 -CircuitStr ) holds b5 . b6 = the_sort_of b6,b4 );

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
let c4 be non-empty MSAlgebra of c1;
cluster a3 -CircuitSorts a4 -> V2 ;
coherence
c3 -CircuitSorts c4 is non-empty
proof end;
end;

theorem Th14: :: CIRCTRM1:14
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty MSAlgebra of b1
for b4 being SetWithCompoundTerm of b1,b2
for b5 being Gate of (b4 -CircuitStr )
for b6 being OperSymbol of b1 st b5 . {} = [b6,the carrier of b1] holds
(b4 -CircuitSorts b3) * (the_arity_of b5) = the Sorts of b3 * (the_arity_of b6)
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
let c4 be non-empty MSAlgebra of c1;
func c3 -CircuitCharact c4 -> ManySortedFunction of ((a3 -CircuitSorts a4) # ) * the Arity of (a3 -CircuitStr ),(a3 -CircuitSorts a4) * the ResultSort of (a3 -CircuitStr ) means :Def5: :: CIRCTRM1:def 5
for b1 being Gate of (a3 -CircuitStr ) st b1 in the OperSymbols of (a3 -CircuitStr ) holds
a5 . b1 = the_action_of b1,a4;
uniqueness
for b1, b2 being ManySortedFunction of ((c3 -CircuitSorts c4) # ) * the Arity of (c3 -CircuitStr ),(c3 -CircuitSorts c4) * the ResultSort of (c3 -CircuitStr ) st ( for b3 being Gate of (c3 -CircuitStr ) st b3 in the OperSymbols of (c3 -CircuitStr ) holds
b1 . b3 = the_action_of b3,c4 ) & ( for b3 being Gate of (c3 -CircuitStr ) st b3 in the OperSymbols of (c3 -CircuitStr ) holds
b2 . b3 = the_action_of b3,c4 ) holds
b1 = b2
proof end;
existence
ex b1 being ManySortedFunction of ((c3 -CircuitSorts c4) # ) * the Arity of (c3 -CircuitStr ),(c3 -CircuitSorts c4) * the ResultSort of (c3 -CircuitStr ) st
for b2 being Gate of (c3 -CircuitStr ) st b2 in the OperSymbols of (c3 -CircuitStr ) holds
b1 . b2 = the_action_of b2,c4
proof end;
end;

:: deftheorem Def5 defines -CircuitCharact CIRCTRM1:def 5 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2)
for b4 being non-empty MSAlgebra of b1
for b5 being ManySortedFunction of ((b3 -CircuitSorts b4) # ) * the Arity of (b3 -CircuitStr ),(b3 -CircuitSorts b4) * the ResultSort of (b3 -CircuitStr ) holds
( b5 = b3 -CircuitCharact b4 iff for b6 being Gate of (b3 -CircuitStr ) st b6 in the OperSymbols of (b3 -CircuitStr ) holds
b5 . b6 = the_action_of b6,b4 );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non empty Subset of (c1 -Terms c2);
let c4 be non-empty MSAlgebra of c1;
func c3 -Circuit c4 -> strict non-empty MSAlgebra of a3 -CircuitStr equals :: CIRCTRM1:def 6
MSAlgebra(# (a3 -CircuitSorts a4),(a3 -CircuitCharact a4) #);
correctness
coherence
MSAlgebra(# (c3 -CircuitSorts c4),(c3 -CircuitCharact c4) #) is strict non-empty MSAlgebra of c3 -CircuitStr
;
proof end;
end;

:: deftheorem Def6 defines -Circuit CIRCTRM1:def 6 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non empty Subset of (b1 -Terms b2)
for b4 being non-empty MSAlgebra of b1 holds b3 -Circuit b4 = MSAlgebra(# (b3 -CircuitSorts b4),(b3 -CircuitCharact b4) #);

theorem Th15: :: CIRCTRM1:15
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty MSAlgebra of b1
for b4 being non empty Subset of (b1 -Terms b2)
for b5 being Vertex of (b4 -CircuitStr ) holds the Sorts of (b4 -Circuit b3) . b5 = the_sort_of b5,b3 by Def4;

theorem Th16: :: CIRCTRM1:16
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty locally-finite MSAlgebra of b1
for b4 being SetWithCompoundTerm of b1,b2
for b5 being OperSymbol of (b4 -CircuitStr ) holds Den b5,(b4 -Circuit b3) = the_action_of b5,b3 by Def5;

theorem Th17: :: CIRCTRM1:17
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty locally-finite MSAlgebra of b1
for b4 being SetWithCompoundTerm of b1,b2
for b5 being OperSymbol of (b4 -CircuitStr )
for b6 being OperSymbol of b1 st b5 . {} = [b6,the carrier of b1] holds
Den b5,(b4 -Circuit b3) = Den b6,b3
proof end;

theorem Th18: :: CIRCTRM1:18
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty locally-finite MSAlgebra of b1
for b4 being non empty Subset of (b1 -Terms b2) holds b4 -Circuit b3 is locally-finite
proof end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be SetWithCompoundTerm of c1,c2;
let c4 be non-empty locally-finite MSAlgebra of c1;
cluster a3 -Circuit a4 -> strict non-empty locally-finite ;
coherence
c3 -Circuit c4 is locally-finite
by Th18;
end;

theorem Th19: :: CIRCTRM1:19
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3, b4 being SetWithCompoundTerm of b1,b2
for b5 being non-empty MSAlgebra of b1 holds b3 -Circuit b5 tolerates b4 -Circuit b5
proof end;

theorem Th20: :: CIRCTRM1:20
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3, b4 being SetWithCompoundTerm of b1,b2
for b5 being non-empty MSAlgebra of b1 holds (b3 \/ b4) -Circuit b5 = (b3 -Circuit b5) +* (b4 -Circuit b5)
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be Variables of c2;
let c4 be DecoratedTree;
assume E23: c4 is Term of c1,c3 ;
let c5 be ManySortedFunction of c3,the Sorts of c2;
func c4 @ c5,c2 -> set means :Def7: :: CIRCTRM1:def 7
ex b1 being c-Term of a2,a3 st
( b1 = a4 & a6 = b1 @ a5 );
correctness
existence
ex b1 being set ex b2 being c-Term of c2,c3 st
( b2 = c4 & b1 = b2 @ c5 )
;
uniqueness
for b1, b2 being set st ex b3 being c-Term of c2,c3 st
( b3 = c4 & b1 = b3 @ c5 ) & ex b3 being c-Term of c2,c3 st
( b3 = c4 & b2 = b3 @ c5 ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def7 defines @ CIRCTRM1:def 7 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Variables of b2
for b4 being DecoratedTree st b4 is Term of b1,b3 holds
for b5 being ManySortedFunction of b3,the Sorts of b2
for b6 being set holds
( b6 = b4 @ b5,b2 iff ex b7 being c-Term of b2,b3 st
( b7 = b4 & b6 = b7 @ b5 ) );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be SetWithCompoundTerm of c1,c2;
let c4 be non-empty locally-finite MSAlgebra of c1;
let c5 be State of (c3 -Circuit c4);
set c6 = [:the OperSymbols of c1,{the carrier of c1}:];
defpred S1[ set , set , set ] means ( root-tree [a2,a1] in Subtrees c3 implies a3 = c5 . (root-tree [a2,a1]) );
E24: for b1 being Vertex of c1
for b2 being Element of c2 . b1 ex b3 being Element of the Sorts of c4 . b1 st S1[b1,b2,b3]
proof end;
mode CompatibleValuation of c5 -> ManySortedFunction of a2,the Sorts of a4 means :Def8: :: CIRCTRM1:def 8
for b1 being Vertex of a1
for b2 being Element of a2 . b1 st root-tree [b2,b1] in Subtrees a3 holds
(a6 . b1) . b2 = a5 . (root-tree [b2,b1]);
existence
ex b1 being ManySortedFunction of c2,the Sorts of c4 st
for b2 being Vertex of c1
for b3 being Element of c2 . b2 st root-tree [b3,b2] in Subtrees c3 holds
(b1 . b2) . b3 = c5 . (root-tree [b3,b2])
proof end;
end;

:: deftheorem Def8 defines CompatibleValuation CIRCTRM1:def 8 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being SetWithCompoundTerm of b1,b2
for b4 being non-empty locally-finite MSAlgebra of b1
for b5 being State of (b3 -Circuit b4)
for b6 being ManySortedFunction of b2,the Sorts of b4 holds
( b6 is CompatibleValuation of b5 iff for b7 being Vertex of b1
for b8 being Element of b2 . b7 st root-tree [b8,b7] in Subtrees b3 holds
(b6 . b7) . b8 = b5 . (root-tree [b8,b7]) );

theorem Th21: :: CIRCTRM1:21
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being State of (b4 -Circuit b2)
for b6 being CompatibleValuation of b5
for b7 being Nat holds b6 is CompatibleValuation of Following b5,b7
proof end;

registration
let c1 be set ;
let c2 be non empty non void ManySortedSign ;
let c3 be V2 ManySortedSet of the carrier of c2;
let c4 be FinSequence of c2 -Terms c3;
cluster a1 -tree a4 -> finite ;
coherence
c1 -tree c4 is finite
proof end;
end;

theorem Th22: :: CIRCTRM1:22
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being State of (b4 -Circuit b2)
for b6 being CompatibleValuation of b5
for b7 being Term of b1,b3 st b7 in Subtrees b4 holds
( Following b5,(1 + (height (dom b7))) is_stable_at b7 & (Following b5,(1 + (height (dom b7)))) . b7 = b7 @ b6,b2 )
proof end;

theorem Th23: :: CIRCTRM1:23
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3 st ( for b5 being Term of b1,b3
for b6 being OperSymbol of b1 holds
( not b5 in Subtrees b4 or not b5 . {} = [b6,the carrier of b1] or not the_arity_of b6 = {} ) ) holds
for b5 being State of (b4 -Circuit b2)
for b6 being CompatibleValuation of b5
for b7 being Term of b1,b3 st b7 in Subtrees b4 holds
( Following b5,(height (dom b7)) is_stable_at b7 & (Following b5,(height (dom b7))) . b7 = b7 @ b6,b2 )
proof end;

registration
let c1 be set ;
cluster id a1 -> one-to-one ;
coherence
id c1 is one-to-one
by FUNCT_1:52;
end;

registration
let c1 be one-to-one Function;
cluster a1 " -> one-to-one ;
coherence
c1 " is one-to-one
by FUNCT_1:62;
let c2 be one-to-one Function;
cluster a1 * a2 -> one-to-one ;
coherence
c2 * c1 is one-to-one
by FUNCT_1:46;
end;

definition
let c1, c2 be non empty ManySortedSign ;
let c3, c4 be Function;
pred c1,c2 are_equivalent_wrt c3,c4 means :Def9: :: CIRCTRM1:def 9
( a3 is one-to-one & a4 is one-to-one & a3,a4 form_morphism_between a1,a2 & a3 " ,a4 " form_morphism_between a2,a1 );
end;

:: deftheorem Def9 defines are_equivalent_wrt CIRCTRM1:def 9 :
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function holds
( b1,b2 are_equivalent_wrt b3,b4 iff ( b3 is one-to-one & b4 is one-to-one & b3,b4 form_morphism_between b1,b2 & b3 " ,b4 " form_morphism_between b2,b1 ) );

theorem Th24: :: CIRCTRM1:24
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function st b1,b2 are_equivalent_wrt b3,b4 holds
( the carrier of b2 = b3 .: the carrier of b1 & the OperSymbols of b2 = b4 .: the OperSymbols of b1 )
proof end;

theorem Th25: :: CIRCTRM1:25
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function st b1,b2 are_equivalent_wrt b3,b4 holds
( rng b3 = the carrier of b2 & rng b4 = the OperSymbols of b2 )
proof end;

theorem Th26: :: CIRCTRM1:26
for b1 being non empty ManySortedSign holds b1,b1 are_equivalent_wrt id the carrier of b1, id the OperSymbols of b1
proof end;

theorem Th27: :: CIRCTRM1:27
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function st b1,b2 are_equivalent_wrt b3,b4 holds
b2,b1 are_equivalent_wrt b3 " ,b4 "
proof end;

theorem Th28: :: CIRCTRM1:28
for b1, b2, b3 being non empty ManySortedSign
for b4, b5, b6, b7 being Function st b1,b2 are_equivalent_wrt b4,b5 & b2,b3 are_equivalent_wrt b6,b7 holds
b1,b3 are_equivalent_wrt b6 * b4,b7 * b5
proof end;

theorem Th29: :: CIRCTRM1:29
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function st b1,b2 are_equivalent_wrt b3,b4 holds
( b3 .: (InputVertices b1) = InputVertices b2 & b3 .: (InnerVertices b1) = InnerVertices b2 )
proof end;

definition
let c1, c2 be non empty ManySortedSign ;
pred c1,c2 are_equivalent means :: CIRCTRM1:def 10
ex b1, b2 being one-to-one Function st a1,a2 are_equivalent_wrt b1,b2;
reflexivity
for b1 being non empty ManySortedSign ex b2, b3 being one-to-one Function st b1,b1 are_equivalent_wrt b2,b3
proof end;
symmetry
for b1, b2 being non empty ManySortedSign st ex b3, b4 being one-to-one Function st b1,b2 are_equivalent_wrt b3,b4 holds
ex b3, b4 being one-to-one Function st b2,b1 are_equivalent_wrt b3,b4
proof end;
end;

:: deftheorem Def10 defines are_equivalent CIRCTRM1:def 10 :
for b1, b2 being non empty ManySortedSign holds
( b1,b2 are_equivalent iff ex b3, b4 being one-to-one Function st b1,b2 are_equivalent_wrt b3,b4 );

theorem Th30: :: CIRCTRM1:30
for b1, b2, b3 being non empty ManySortedSign st b1,b2 are_equivalent & b2,b3 are_equivalent holds
b1,b3 are_equivalent
proof end;

definition
let c1, c2 be non empty ManySortedSign ;
let c3 be Function;
pred c3 preserves_inputs_of c1,c2 means :: CIRCTRM1:def 11
a3 .: (InputVertices a1) c= InputVertices a2;
end;

:: deftheorem Def11 defines preserves_inputs_of CIRCTRM1:def 11 :
for b1, b2 being non empty ManySortedSign
for b3 being Function holds
( b3 preserves_inputs_of b1,b2 iff b3 .: (InputVertices b1) c= InputVertices b2 );

theorem Th31: :: CIRCTRM1:31
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function st b3,b4 form_morphism_between b1,b2 holds
for b5 being Vertex of b1 holds b3 . b5 is Vertex of b2
proof end;

theorem Th32: :: CIRCTRM1:32
for b1, b2 being non empty non void ManySortedSign
for b3, b4 being Function st b3,b4 form_morphism_between b1,b2 holds
for b5 being Gate of b1 holds b4 . b5 is Gate of b2
proof end;

theorem Th33: :: CIRCTRM1:33
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function st b3,b4 form_morphism_between b1,b2 holds
b3 .: (InnerVertices b1) c= InnerVertices b2
proof end;

theorem Th34: :: CIRCTRM1:34
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function st b3,b4 form_morphism_between b1,b2 holds
for b5 being Vertex of b1 st b5 in InnerVertices b1 holds
for b6 being Vertex of b2 st b6 = b3 . b5 holds
action_at b6 = b4 . (action_at b5)
proof end;

definition
let c1, c2 be non empty ManySortedSign ;
let c3, c4 be Function;
let c5 be non-empty MSAlgebra of c1;
let c6 be non-empty MSAlgebra of c2;
pred c3,c4 form_embedding_of c5,c6 means :Def12: :: CIRCTRM1:def 12
( a3 is one-to-one & a4 is one-to-one & a3,a4 form_morphism_between a1,a2 & the Sorts of a5 = the Sorts of a6 * a3 & the Charact of a5 = the Charact of a6 * a4 );
end;

:: deftheorem Def12 defines form_embedding_of CIRCTRM1:def 12 :
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function
for b5 being non-empty MSAlgebra of b1
for b6 being non-empty MSAlgebra of b2 holds
( b3,b4 form_embedding_of b5,b6 iff ( b3 is one-to-one & b4 is one-to-one & b3,b4 form_morphism_between b1,b2 & the Sorts of b5 = the Sorts of b6 * b3 & the Charact of b5 = the Charact of b6 * b4 ) );

theorem Th35: :: CIRCTRM1:35
for b1 being non empty ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds id the carrier of b1, id the OperSymbols of b1 form_embedding_of b2,b2
proof end;

theorem Th36: :: CIRCTRM1:36
for b1, b2, b3 being non empty ManySortedSign
for b4, b5, b6, b7 being Function
for b8 being non-empty MSAlgebra of b1
for b9 being non-empty MSAlgebra of b2
for b10 being non-empty MSAlgebra of b3 st b4,b5 form_embedding_of b8,b9 & b6,b7 form_embedding_of b9,b10 holds
b6 * b4,b7 * b5 form_embedding_of b8,b10
proof end;

definition
let c1, c2 be non empty ManySortedSign ;
let c3, c4 be Function;
let c5 be non-empty MSAlgebra of c1;
let c6 be non-empty MSAlgebra of c2;
pred c5,c6 are_similar_wrt c3,c4 means :Def13: :: CIRCTRM1:def 13
( a3,a4 form_embedding_of a5,a6 & a3 " ,a4 " form_embedding_of a6,a5 );
end;

:: deftheorem Def13 defines are_similar_wrt CIRCTRM1:def 13 :
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function
for b5 being non-empty MSAlgebra of b1
for b6 being non-empty MSAlgebra of b2 holds
( b5,b6 are_similar_wrt b3,b4 iff ( b3,b4 form_embedding_of b5,b6 & b3 " ,b4 " form_embedding_of b6,b5 ) );

theorem Th37: :: CIRCTRM1:37
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function
for b5 being non-empty MSAlgebra of b1
for b6 being non-empty MSAlgebra of b2 st b5,b6 are_similar_wrt b3,b4 holds
b1,b2 are_equivalent_wrt b3,b4
proof end;

theorem Th38: :: CIRCTRM1:38
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function
for b5 being non-empty MSAlgebra of b1
for b6 being non-empty MSAlgebra of b2 holds
( b5,b6 are_similar_wrt b3,b4 iff ( b1,b2 are_equivalent_wrt b3,b4 & the Sorts of b5 = the Sorts of b6 * b3 & the Charact of b5 = the Charact of b6 * b4 ) )
proof end;

theorem Th39: :: CIRCTRM1:39
for b1 being non empty ManySortedSign
for b2 being non-empty MSAlgebra of b1 holds b2,b2 are_similar_wrt id the carrier of b1, id the OperSymbols of b1
proof end;

theorem Th40: :: CIRCTRM1:40
for b1, b2 being non empty ManySortedSign
for b3, b4 being Function
for b5 being non-empty MSAlgebra of b1
for b6 being non-empty MSAlgebra of b2 st b5,b6 are_similar_wrt b3,b4 holds
b6,b5 are_similar_wrt b3 " ,b4 "
proof end;

theorem Th41: :: CIRCTRM1:41
for b1, b2, b3 being non empty ManySortedSign
for b4, b5, b6, b7 being Function
for b8 being non-empty MSAlgebra of b1
for b9 being non-empty MSAlgebra of b2
for b10 being non-empty MSAlgebra of b3 st b8,b9 are_similar_wrt b4,b5 & b9,b10 are_similar_wrt b6,b7 holds
b8,b10 are_similar_wrt b6 * b4,b7 * b5
proof end;

definition
let c1, c2 be non empty ManySortedSign ;
let c3 be non-empty MSAlgebra of c1;
let c4 be non-empty MSAlgebra of c2;
pred c3,c4 are_similar means :: CIRCTRM1:def 14
ex b1, b2 being Function st a3,a4 are_similar_wrt b1,b2;
end;

:: deftheorem Def14 defines are_similar CIRCTRM1:def 14 :
for b1, b2 being non empty ManySortedSign
for b3 being non-empty MSAlgebra of b1
for b4 being non-empty MSAlgebra of b2 holds
( b3,b4 are_similar iff ex b5, b6 being Function st b3,b4 are_similar_wrt b5,b6 );

theorem Th42: :: CIRCTRM1:42
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 holds
( dom b3 = the carrier of b1 & rng b3 c= the carrier of b2 & dom b4 = the OperSymbols of b1 & rng b4 c= the OperSymbols of b2 )
proof end;

theorem Th43: :: CIRCTRM1:43
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 holds
for b7 being Gate of b1
for b8 being Gate of b2 st b8 = b4 . b7 holds
Den b8,b6 = Den b7,b5
proof end;

theorem Th44: :: CIRCTRM1:44
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 holds
for b7 being Gate of b1
for b8 being Gate of b2 st b8 = b4 . b7 holds
for b9 being State of b5
for b10 being State of b6 st b9 = b10 * b3 holds
b8 depends_on_in b10 = b7 depends_on_in b9
proof end;

theorem Th45: :: CIRCTRM1:45
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 holds
for b7 being State of b6 holds b7 * b3 is State of b5
proof end;

theorem Th46: :: CIRCTRM1:46
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b2
for b6 being non-empty Circuit of b1 st b3,b4 form_embedding_of b5,b6 holds
for b7 being State of b6
for b8 being State of b5 st b8 = b7 * b3 & ( for b9 being Vertex of b2 st b9 in InputVertices b2 holds
b7 is_stable_at b3 . b9 ) holds
Following b8 = (Following b7) * b3
proof end;

theorem Th47: :: CIRCTRM1:47
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 & b3 preserves_inputs_of b1,b2 holds
for b7 being State of b6
for b8 being State of b5 st b8 = b7 * b3 holds
Following b8 = (Following b7) * b3
proof end;

theorem Th48: :: CIRCTRM1:48
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 & b3 preserves_inputs_of b1,b2 holds
for b7 being State of b6
for b8 being State of b5 st b8 = b7 * b3 holds
for b9 being Nat holds Following b8,b9 = (Following b7,b9) * b3
proof end;

theorem Th49: :: CIRCTRM1:49
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 & b3 preserves_inputs_of b1,b2 holds
for b7 being State of b6
for b8 being State of b5 st b8 = b7 * b3 & b7 is stable holds
b8 is stable
proof end;

theorem Th50: :: CIRCTRM1:50
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b3,b4 form_embedding_of b5,b6 & b3 preserves_inputs_of b1,b2 holds
for b7 being State of b6
for b8 being State of b5 st b8 = b7 * b3 holds
for b9 being Vertex of b1 holds
( b8 is_stable_at b9 iff b7 is_stable_at b3 . b9 )
proof end;

theorem Th51: :: CIRCTRM1:51
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
for b7 being State of b6 holds b7 * b3 is State of b5
proof end;

theorem Th52: :: CIRCTRM1:52
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
for b7 being State of b5
for b8 being State of b6 holds
( b7 = b8 * b3 iff b8 = b7 * (b3 " ) )
proof end;

theorem Th53: :: CIRCTRM1:53
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
( b3 .: (InputVertices b1) = InputVertices b2 & b3 .: (InnerVertices b1) = InnerVertices b2 )
proof end;

theorem Th54: :: CIRCTRM1:54
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
b3 preserves_inputs_of b1,b2
proof end;

theorem Th55: :: CIRCTRM1:55
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
for b7 being State of b5
for b8 being State of b6 st b7 = b8 * b3 holds
Following b7 = (Following b8) * b3
proof end;

theorem Th56: :: CIRCTRM1:56
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
for b7 being State of b5
for b8 being State of b6 st b7 = b8 * b3 holds
for b9 being Nat holds Following b7,b9 = (Following b8,b9) * b3
proof end;

theorem Th57: :: CIRCTRM1:57
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b1
for b6 being non-empty Circuit of b2 st b5,b6 are_similar_wrt b3,b4 holds
for b7 being State of b5
for b8 being State of b6 st b7 = b8 * b3 holds
( b7 is stable iff b8 is stable )
proof end;

theorem Th58: :: CIRCTRM1:58
for b1, b2 being non empty non void Circuit-like ManySortedSign
for b3, b4 being Function
for b5 being non-empty Circuit of b2
for b6 being non-empty Circuit of b1 st b5,b6 are_similar_wrt b3,b4 holds
for b7 being State of b5
for b8 being State of b6 st b7 = b8 * b3 holds
for b9 being Vertex of b2 holds
( b7 is_stable_at b9 iff b8 is_stable_at b3 . b9 )
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be V2 ManySortedSet of the carrier of c1;
let c4 be non empty Subset of (c1 -Terms c3);
let c5 be non empty non void Circuit-like ManySortedSign ;
let c6 be non-empty Circuit of c5;
pred c6 calculates c4,c2 means :Def15: :: CIRCTRM1:def 15
ex b1, b2 being Function st
( b1,b2 form_embedding_of a4 -Circuit a2,a6 & b1 preserves_inputs_of a4 -CircuitStr ,a5 );
pred c4,c2 specifies c6 means :: CIRCTRM1:def 16
a6,a4 -Circuit a2 are_similar ;
end;

:: deftheorem Def15 defines calculates CIRCTRM1:def 15 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being V2 ManySortedSet of the carrier of b1
for b4 being non empty Subset of (b1 -Terms b3)
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 holds
( b6 calculates b4,b2 iff ex b7, b8 being Function st
( b7,b8 form_embedding_of b4 -Circuit b2,b6 & b7 preserves_inputs_of b4 -CircuitStr ,b5 ) );

:: deftheorem Def16 defines specifies CIRCTRM1:def 16 :
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being V2 ManySortedSet of the carrier of b1
for b4 being non empty Subset of (b1 -Terms b3)
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 holds
( b4,b2 specifies b6 iff b6,b4 -Circuit b2 are_similar );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non-empty MSAlgebra of c1;
let c4 be non empty Subset of (c1 -Terms c2);
let c5 be non empty non void Circuit-like ManySortedSign ;
let c6 be non-empty Circuit of c5;
assume c6 calculates c4,c3 ;
then consider c7, c8 being Function such that
E58: c7,c8 form_embedding_of c4 -Circuit c3,c6 and
E59: c7 preserves_inputs_of c4 -CircuitStr ,c5 by Def15;
E60: c7 is one-to-one by E58, Def12;
mode SortMap of c4,c3,c6 -> one-to-one Function means :Def17: :: CIRCTRM1:def 17
( a7 preserves_inputs_of a4 -CircuitStr ,a5 & ex b1 being Function st a7,b1 form_embedding_of a4 -Circuit a3,a6 );
existence
ex b1 being one-to-one Function st
( b1 preserves_inputs_of c4 -CircuitStr ,c5 & ex b2 being Function st b1,b2 form_embedding_of c4 -Circuit c3,c6 )
by E58, E59, E60;
end;

:: deftheorem Def17 defines SortMap CIRCTRM1:def 17 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty MSAlgebra of b1
for b4 being non empty Subset of (b1 -Terms b2)
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b6 calculates b4,b3 holds
for b7 being one-to-one Function holds
( b7 is SortMap of b4,b3,b6 iff ( b7 preserves_inputs_of b4 -CircuitStr ,b5 & ex b8 being Function st b7,b8 form_embedding_of b4 -Circuit b3,b6 ) );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
let c3 be non-empty MSAlgebra of c1;
let c4 be non empty Subset of (c1 -Terms c2);
let c5 be non empty non void Circuit-like ManySortedSign ;
let c6 be non-empty Circuit of c5;
assume E59: c6 calculates c4,c3 ;
let c7 be SortMap of c4,c3,c6;
consider c8 being Function such that
E60: c7,c8 form_embedding_of c4 -Circuit c3,c6 by E59, Def17;
E61: c8 is one-to-one by E60, Def12;
mode OperMap of c4,c3,c6,c7 -> one-to-one Function means :: CIRCTRM1:def 18
a7,a8 form_embedding_of a4 -Circuit a3,a6;
existence
ex b1 being one-to-one Function st c7,b1 form_embedding_of c4 -Circuit c3,c6
by E60, E61;
end;

:: deftheorem Def18 defines OperMap CIRCTRM1:def 18 :
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1
for b3 being non-empty MSAlgebra of b1
for b4 being non empty Subset of (b1 -Terms b2)
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b6 calculates b4,b3 holds
for b7 being SortMap of b4,b3,b6
for b8 being one-to-one Function holds
( b8 is OperMap of b4,b3,b6,b7 iff b7,b8 form_embedding_of b4 -Circuit b3,b6 );

theorem Th59: :: CIRCTRM1:59
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b4,b2 specifies b6 holds
b6 calculates b4,b2
proof end;

theorem Th60: :: CIRCTRM1:60
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b6 calculates b4,b2 holds
for b7 being SortMap of b4,b2,b6
for b8 being Term of b1,b3 st b8 in Subtrees b4 holds
for b9 being State of b6 holds
( Following b9,(1 + (height (dom b8))) is_stable_at b7 . b8 & ( for b10 being State of (b4 -Circuit b2) st b10 = b9 * b7 holds
for b11 being CompatibleValuation of b10 holds (Following b9,(1 + (height (dom b8)))) . (b7 . b8) = b8 @ b11,b2 ) )
proof end;

theorem Th61: :: CIRCTRM1:61
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b6 calculates b4,b2 holds
for b7 being Term of b1,b3 st b7 in Subtrees b4 holds
ex b8 being Vertex of b5 st
for b9 being State of b6 holds
( Following b9,(1 + (height (dom b7))) is_stable_at b8 & ex b10 being SortMap of b4,b2,b6 st
for b11 being State of (b4 -Circuit b2) st b11 = b9 * b10 holds
for b12 being CompatibleValuation of b11 holds (Following b9,(1 + (height (dom b7)))) . b8 = b7 @ b12,b2 )
proof end;

theorem Th62: :: CIRCTRM1:62
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b4,b2 specifies b6 holds
for b7 being SortMap of b4,b2,b6
for b8 being State of b6
for b9 being Term of b1,b3 st b9 in Subtrees b4 holds
( Following b8,(1 + (height (dom b9))) is_stable_at b7 . b9 & ( for b10 being State of (b4 -Circuit b2) st b10 = b8 * b7 holds
for b11 being CompatibleValuation of b10 holds (Following b8,(1 + (height (dom b9)))) . (b7 . b9) = b9 @ b11,b2 ) )
proof end;

theorem Th63: :: CIRCTRM1:63
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra of b1
for b3 being Variables of b2
for b4 being SetWithCompoundTerm of b1,b3
for b5 being non empty non void Circuit-like ManySortedSign
for b6 being non-empty Circuit of b5 st b4,b2 specifies b6 holds
for b7 being Term of b1,b3 st b7 in Subtrees b4 holds
ex b8 being Vertex of b5 st
for b9 being State of b6 holds
( Following b9,(1 + (height (dom b7))) is_stable_at b8 & ex b10 being SortMap of b4,b2,b6 st
for b11 being State of (b4 -Circuit b2) st b11 = b9 * b10 holds
for b12 being CompatibleValuation of b11 holds (Following b9,(1 + (height (dom b7)))) . b8 = b7 @ b12,b2 )
proof end;