defpred S1[ object , object ] means ex g being Gate of (X -CircuitStr) st
( g = $1 & $2 = the_action_of (g,A) );
A4: now :: thesis: for x being object st x in the carrier' of (X -CircuitStr) holds
ex y being object st S1[x,y]
let x be object ; :: thesis: ( x in the carrier' of (X -CircuitStr) implies ex y being object st S1[x,y] )
assume x in the carrier' of (X -CircuitStr) ; :: thesis: ex y being object st S1[x,y]
then reconsider g = x as Gate of (X -CircuitStr) ;
reconsider y = the_action_of (g,A) as object ;
take y = y; :: thesis: S1[x,y]
thus S1[x,y] ; :: thesis: verum
end;
consider CHARACT being ManySortedSet of the carrier' of (X -CircuitStr) such that
A5: for x being object st x in the carrier' of (X -CircuitStr) holds
S1[x,CHARACT . x] from PBOOLE:sch 3(A4);
A6: dom CHARACT = the carrier' of (X -CircuitStr) by PARTFUN1:def 2;
CHARACT is Function-yielding
proof
let x be object ; :: according to FUNCOP_1:def 6 :: thesis: ( not x in proj1 CHARACT or CHARACT . x is set )
assume x in dom CHARACT ; :: thesis: CHARACT . x is set
then ex g being Gate of (X -CircuitStr) st
( g = x & CHARACT . x = the_action_of (g,A) ) by A5, A6;
hence CHARACT . x is set ; :: thesis: verum
end;
then reconsider CHARACT = CHARACT as ManySortedFunction of the carrier' of (X -CircuitStr) ;
CHARACT is ManySortedFunction of ((X -CircuitSorts A) #) * the Arity of (X -CircuitStr),(X -CircuitSorts A) * the ResultSort of (X -CircuitStr)
proof
let i be object ; :: according to PBOOLE:def 15 :: thesis: ( not i in the carrier' of (X -CircuitStr) or CHARACT . i is Element of bool [:((((X -CircuitSorts A) #) * the Arity of (X -CircuitStr)) . i),(((X -CircuitSorts A) * the ResultSort of (X -CircuitStr)) . i):] )
assume A7: i in the carrier' of (X -CircuitStr) ; :: thesis: CHARACT . i is Element of bool [:((((X -CircuitSorts A) #) * the Arity of (X -CircuitStr)) . i),(((X -CircuitSorts A) * the ResultSort of (X -CircuitStr)) . i):]
then not X -CircuitStr is void ;
then reconsider X9 = X as SetWithCompoundTerm of S,V by Th3;
reconsider g = i as Gate of (X9 -CircuitStr) by A7;
the_result_sort_of g = g ;
then reconsider v = g as Vertex of (X9 -CircuitStr) ;
reconsider I = i as CompoundTerm of S,V by A7, Th4;
I . {} in [: the carrier' of S,{ the carrier of S}:] by MSATERM:def 6;
then consider o, y being object such that
A8: o in the carrier' of S and
A9: y in { the carrier of S} and
A10: I . {} = [o,y] by ZFMISC_1:84;
reconsider o = o as OperSymbol of S by A8;
A11: o = (I . {}) `1 by A10;
A12: y = the carrier of S by A9, TARSKI:def 1;
ex g being Gate of (X -CircuitStr) st
( g = i & CHARACT . i = the_action_of (g,A) ) by A5, A7;
then A13: CHARACT . i = the_action_of (g,A)
.= the Charact of A . o by A11, Def3 ;
A14: ( the Sorts of A * the ResultSort of S) . o = the Sorts of A . (the_result_sort_of o) by FUNCT_2:15
.= the Sorts of A . (the_sort_of I) by A10, A12, MSATERM:17 ;
A15: ((X -CircuitSorts A) * the ResultSort of (X -CircuitStr)) . g = (X -CircuitSorts A) . (the_result_sort_of g) by FUNCT_2:15
.= the_sort_of (v,A) by Def4
.= the Sorts of A . (the_sort_of I) by Def2 ;
A16: (((X -CircuitSorts A) #) * the Arity of (X -CircuitStr)) . g = ((X -CircuitSorts A) #) . (the_arity_of g) by FUNCT_2:15
.= product ((X9 -CircuitSorts A) * (the_arity_of g)) by FINSEQ_2:def 5
.= product ( the Sorts of A * (the_arity_of o)) by A10, A12, Th13 ;
(( the Sorts of A #) * the Arity of S) . o = ( the Sorts of A #) . (the_arity_of o) by FUNCT_2:15
.= product ( the Sorts of A * (the_arity_of o)) by FINSEQ_2:def 5 ;
hence CHARACT . i is Element of bool [:((((X -CircuitSorts A) #) * the Arity of (X -CircuitStr)) . i),(((X -CircuitSorts A) * the ResultSort of (X -CircuitStr)) . i):] by A13, A14, A15, A16, PBOOLE:def 15; :: thesis: verum
end;
then reconsider CHARACT = CHARACT as ManySortedFunction of ((X -CircuitSorts A) #) * the Arity of (X -CircuitStr),(X -CircuitSorts A) * the ResultSort of (X -CircuitStr) ;
take CHARACT ; :: thesis: for g being Gate of (X -CircuitStr) st g in the carrier' of (X -CircuitStr) holds
CHARACT . g = the_action_of (g,A)

let g be Gate of (X -CircuitStr); :: thesis: ( g in the carrier' of (X -CircuitStr) implies CHARACT . g = the_action_of (g,A) )
assume g in the carrier' of (X -CircuitStr) ; :: thesis: CHARACT . g = the_action_of (g,A)
then ex h being Gate of (X -CircuitStr) st
( h = g & CHARACT . g = the_action_of (h,A) ) by A5;
hence CHARACT . g = the_action_of (g,A) ; :: thesis: verum