:: GFACIRC1 semantic presentation

scheme :: GFACIRC1:sch 1
s1{ F1( set ) -> Element of BOOLEAN } :
ex b1 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st
for b2 being Element of BOOLEAN holds b1 . <*b2*> = F1(b2)
proof end;

scheme :: GFACIRC1:sch 2
s2{ F1( set ) -> Element of BOOLEAN } :
for b1, b2 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st ( for b3 being Element of BOOLEAN holds b1 . <*b3*> = F1(b3) ) & ( for b3 being Element of BOOLEAN holds b2 . <*b3*> = F1(b3) ) holds
b1 = b2
proof end;

scheme :: GFACIRC1:sch 3
s3{ F1( set ) -> Element of BOOLEAN } :
( ex b1 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st
for b2 being Element of BOOLEAN holds b1 . <*b2*> = F1(b2) & ( for b1, b2 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st ( for b3 being Element of BOOLEAN holds b1 . <*b3*> = F1(b3) ) & ( for b3 being Element of BOOLEAN holds b2 . <*b3*> = F1(b3) ) holds
b1 = b2 ) )
proof end;

definition
func inv1 -> Function of 1 -tuples_on BOOLEAN , BOOLEAN means :Def1: :: GFACIRC1:def 1
for b1 being Element of BOOLEAN holds a1 . <*b1*> = 'not' b1;
existence
ex b1 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st
for b2 being Element of BOOLEAN holds b1 . <*b2*> = 'not' b2
proof end;
uniqueness
for b1, b2 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st ( for b3 being Element of BOOLEAN holds b1 . <*b3*> = 'not' b3 ) & ( for b3 being Element of BOOLEAN holds b2 . <*b3*> = 'not' b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines inv1 GFACIRC1:def 1 :
for b1 being Function of 1 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = inv1 iff for b2 being Element of BOOLEAN holds b1 . <*b2*> = 'not' b2 );

theorem Th1: :: GFACIRC1:1
for b1 being Element of BOOLEAN holds
( inv1 . <*b1*> = 'not' b1 & inv1 . <*b1*> = nand2 . <*b1,b1*> & inv1 . <*0*> = 1 & inv1 . <*1*> = 0 )
proof end;

definition
func buf1 -> Function of 1 -tuples_on BOOLEAN , BOOLEAN means :Def2: :: GFACIRC1:def 2
for b1 being Element of BOOLEAN holds a1 . <*b1*> = b1;
existence
ex b1 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st
for b2 being Element of BOOLEAN holds b1 . <*b2*> = b2
proof end;
uniqueness
for b1, b2 being Function of 1 -tuples_on BOOLEAN , BOOLEAN st ( for b3 being Element of BOOLEAN holds b1 . <*b3*> = b3 ) & ( for b3 being Element of BOOLEAN holds b2 . <*b3*> = b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines buf1 GFACIRC1:def 2 :
for b1 being Function of 1 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = buf1 iff for b2 being Element of BOOLEAN holds b1 . <*b2*> = b2 );

theorem Th2: :: GFACIRC1:2
for b1 being Element of BOOLEAN holds
( buf1 . <*b1*> = b1 & buf1 . <*b1*> = and2 . <*b1,b1*> & buf1 . <*0*> = 0 & buf1 . <*1*> = 1 )
proof end;

definition
func and2c -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def3: :: GFACIRC1:def 3
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = b1 '&' ('not' b2);
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 '&' ('not' b3)
proof end;
uniqueness
for b1, b2 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4 being Element of BOOLEAN holds b1 . <*b3,b4*> = b3 '&' ('not' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = b3 '&' ('not' b4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines and2c GFACIRC1:def 3 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = and2c iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 '&' ('not' b3) );

theorem Th3: :: GFACIRC1:3
for b1, b2 being Element of BOOLEAN holds
( and2c . <*b1,b2*> = b1 '&' ('not' b2) & and2c . <*b1,b2*> = and2a . <*b2,b1*> & and2c . <*b1,b2*> = nor2a . <*b1,b2*> & and2c . <*0,0*> = 0 & and2c . <*0,1*> = 0 & and2c . <*1,0*> = 1 & and2c . <*1,1*> = 0 )
proof end;

definition
func xor2c -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def4: :: GFACIRC1:def 4
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = b1 'xor' ('not' b2);
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 'xor' ('not' b3)
proof end;
uniqueness
for b1, b2 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4 being Element of BOOLEAN holds b1 . <*b3,b4*> = b3 'xor' ('not' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = b3 'xor' ('not' b4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines xor2c GFACIRC1:def 4 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = xor2c iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 'xor' ('not' b3) );

theorem Th4: :: GFACIRC1:4
for b1, b2 being Element of BOOLEAN holds
( xor2c . <*b1,b2*> = b1 'xor' ('not' b2) & xor2c . <*b1,b2*> = xor2a . <*b1,b2*> & xor2c . <*b1,b2*> = or2 . <*(and2b . <*b1,b2*>),(and2 . <*b1,b2*>)*> & xor2c . <*0,0*> = 1 & xor2c . <*0,1*> = 0 & xor2c . <*1,0*> = 0 & xor2c . <*1,1*> = 1 )
proof end;

theorem Th5: :: GFACIRC1:5
for b1, b2 being Element of BOOLEAN holds
( 'not' (b1 'xor' b2) = ('not' b1) 'xor' b2 & 'not' (b1 'xor' b2) = b1 'xor' ('not' b2) & ('not' b1) 'xor' ('not' b2) = b1 'xor' b2 )
proof end;

theorem Th6: :: GFACIRC1:6
for b1, b2 being Element of BOOLEAN holds
( inv1 . <*(xor2 . <*b1,b2*>)*> = xor2a . <*b1,b2*> & inv1 . <*(xor2 . <*b1,b2*>)*> = xor2c . <*b1,b2*> & xor2 . <*(inv1 . <*b1*>),(inv1 . <*b2*>)*> = xor2 . <*b1,b2*> )
proof end;

theorem Th7: :: GFACIRC1:7
for b1, b2, b3 being Element of BOOLEAN holds 'not' ((b1 'xor' ('not' b2)) 'xor' b3) = (b1 'xor' ('not' b2)) 'xor' ('not' b3) by Th5;

theorem Th8: :: GFACIRC1:8
for b1, b2, b3 being Element of BOOLEAN holds inv1 . <*(xor2 . <*(xor2c . <*b1,b2*>),b3*>)*> = xor2c . <*(xor2c . <*b1,b2*>),b3*>
proof end;

theorem Th9: :: GFACIRC1:9
for b1, b2, b3 being Element of BOOLEAN holds (('not' b1) 'xor' b2) 'xor' ('not' b3) = (b1 'xor' ('not' b2)) 'xor' ('not' b3)
proof end;

theorem Th10: :: GFACIRC1:10
for b1, b2, b3 being Element of BOOLEAN holds xor2c . <*(xor2a . <*b1,b2*>),b3*> = xor2c . <*(xor2c . <*b1,b2*>),b3*> by Th4;

theorem Th11: :: GFACIRC1:11
for b1, b2, b3 being Element of BOOLEAN holds 'not' ((('not' b1) 'xor' ('not' b2)) 'xor' ('not' b3)) = (b1 'xor' b2) 'xor' b3
proof end;

theorem Th12: :: GFACIRC1:12
for b1, b2, b3 being Element of BOOLEAN holds inv1 . <*(xor2c . <*(xor2b . <*b1,b2*>),b3*>)*> = xor2 . <*(xor2 . <*b1,b2*>),b3*>
proof end;

Lemma10: for b1, b2, b3 being Function of 2 -tuples_on BOOLEAN , BOOLEAN
for b4, b5, b6 being set st b4 <> [<*b5,b6*>,b2] & b5 <> [<*b6,b4*>,b3] & b6 <> [<*b4,b5*>,b1] holds
( not [<*b4,b5*>,b1] in {b5,b6} & not b6 in {[<*b4,b5*>,b1],[<*b5,b6*>,b2]} & not b4 in {[<*b4,b5*>,b1],[<*b5,b6*>,b2]} & not [<*b6,b4*>,b3] in {b4,b5,b6} )
proof end;

Lemma11: for b1, b2, b3 being Function of 2 -tuples_on BOOLEAN , BOOLEAN
for b4 being Function of 3 -tuples_on BOOLEAN , BOOLEAN
for b5, b6, b7 being set holds {b5,b6,b7} \ {[<*[<*b5,b6*>,b1],[<*b6,b7*>,b2],[<*b7,b5*>,b3]*>,b4]} = {b5,b6,b7}
proof end;

Lemma12: for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN
for b2, b3, b4 being set st b4 <> [<*b2,b3*>,b1] holds
for b5 being State of (2GatesCircuit b2,b3,b4,b1) holds
( (Following b5) . (2GatesCircOutput b2,b3,b4,b1) = b1 . <*(b5 . [<*b2,b3*>,b1]),(b5 . b4)*> & (Following b5) . [<*b2,b3*>,b1] = b1 . <*(b5 . b2),(b5 . b3)*> & (Following b5) . b2 = b5 . b2 & (Following b5) . b3 = b5 . b3 & (Following b5) . b4 = b5 . b4 )
proof end;

definition
let c1, c2, c3 be set ;
func GFA0CarryIStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 5
((1GateCircStr <*a1,a2*>,and2 ) +* (1GateCircStr <*a2,a3*>,and2 )) +* (1GateCircStr <*a3,a1*>,and2 );
coherence
((1GateCircStr <*c1,c2*>,and2 ) +* (1GateCircStr <*c2,c3*>,and2 )) +* (1GateCircStr <*c3,c1*>,and2 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def5 defines GFA0CarryIStr GFACIRC1:def 5 :
for b1, b2, b3 being set holds GFA0CarryIStr b1,b2,b3 = ((1GateCircStr <*b1,b2*>,and2 ) +* (1GateCircStr <*b2,b3*>,and2 )) +* (1GateCircStr <*b3,b1*>,and2 );

definition
let c1, c2, c3 be set ;
func GFA0CarryICirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA0CarryIStr a1,a2,a3 equals :: GFACIRC1:def 6
((1GateCircuit a1,a2,and2 ) +* (1GateCircuit a2,a3,and2 )) +* (1GateCircuit a3,a1,and2 );
coherence
((1GateCircuit c1,c2,and2 ) +* (1GateCircuit c2,c3,and2 )) +* (1GateCircuit c3,c1,and2 ) is strict gate`2=den Boolean Circuit of GFA0CarryIStr c1,c2,c3
;
end;

:: deftheorem Def6 defines GFA0CarryICirc GFACIRC1:def 6 :
for b1, b2, b3 being set holds GFA0CarryICirc b1,b2,b3 = ((1GateCircuit b1,b2,and2 ) +* (1GateCircuit b2,b3,and2 )) +* (1GateCircuit b3,b1,and2 );

definition
let c1, c2, c3 be set ;
func GFA0CarryStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 7
(GFA0CarryIStr a1,a2,a3) +* (1GateCircStr <*[<*a1,a2*>,and2 ],[<*a2,a3*>,and2 ],[<*a3,a1*>,and2 ]*>,or3 );
coherence
(GFA0CarryIStr c1,c2,c3) +* (1GateCircStr <*[<*c1,c2*>,and2 ],[<*c2,c3*>,and2 ],[<*c3,c1*>,and2 ]*>,or3 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def7 defines GFA0CarryStr GFACIRC1:def 7 :
for b1, b2, b3 being set holds GFA0CarryStr b1,b2,b3 = (GFA0CarryIStr b1,b2,b3) +* (1GateCircStr <*[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]*>,or3 );

definition
let c1, c2, c3 be set ;
func GFA0CarryCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA0CarryStr a1,a2,a3 equals :: GFACIRC1:def 8
(GFA0CarryICirc a1,a2,a3) +* (1GateCircuit [<*a1,a2*>,and2 ],[<*a2,a3*>,and2 ],[<*a3,a1*>,and2 ],or3 );
coherence
(GFA0CarryICirc c1,c2,c3) +* (1GateCircuit [<*c1,c2*>,and2 ],[<*c2,c3*>,and2 ],[<*c3,c1*>,and2 ],or3 ) is strict gate`2=den Boolean Circuit of GFA0CarryStr c1,c2,c3
;
end;

:: deftheorem Def8 defines GFA0CarryCirc GFACIRC1:def 8 :
for b1, b2, b3 being set holds GFA0CarryCirc b1,b2,b3 = (GFA0CarryICirc b1,b2,b3) +* (1GateCircuit [<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ],or3 );

definition
let c1, c2, c3 be set ;
func GFA0CarryOutput c1,c2,c3 -> Element of InnerVertices (GFA0CarryStr a1,a2,a3) equals :: GFACIRC1:def 9
[<*[<*a1,a2*>,and2 ],[<*a2,a3*>,and2 ],[<*a3,a1*>,and2 ]*>,or3 ];
coherence
[<*[<*c1,c2*>,and2 ],[<*c2,c3*>,and2 ],[<*c3,c1*>,and2 ]*>,or3 ] is Element of InnerVertices (GFA0CarryStr c1,c2,c3)
proof end;
end;

:: deftheorem Def9 defines GFA0CarryOutput GFACIRC1:def 9 :
for b1, b2, b3 being set holds GFA0CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]*>,or3 ];

theorem Th13: :: GFACIRC1:13
for b1, b2, b3 being set holds InnerVertices (GFA0CarryIStr b1,b2,b3) = {[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]}
proof end;

theorem Th14: :: GFACIRC1:14
for b1, b2, b3 being set holds InnerVertices (GFA0CarryStr b1,b2,b3) = {[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]} \/ {(GFA0CarryOutput b1,b2,b3)}
proof end;

theorem Th15: :: GFACIRC1:15
for b1, b2, b3 being set holds InnerVertices (GFA0CarryStr b1,b2,b3) is Relation
proof end;

theorem Th16: :: GFACIRC1:16
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
InputVertices (GFA0CarryIStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th17: :: GFACIRC1:17
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
InputVertices (GFA0CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th18: :: GFACIRC1:18
for b1, b2, b3 being non pair set holds not InputVertices (GFA0CarryStr b1,b2,b3) is with_pair
proof end;

theorem Th19: :: GFACIRC1:19
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA0CarryStr b1,b2,b3) & b2 in the carrier of (GFA0CarryStr b1,b2,b3) & b3 in the carrier of (GFA0CarryStr b1,b2,b3) & [<*b1,b2*>,and2 ] in the carrier of (GFA0CarryStr b1,b2,b3) & [<*b2,b3*>,and2 ] in the carrier of (GFA0CarryStr b1,b2,b3) & [<*b3,b1*>,and2 ] in the carrier of (GFA0CarryStr b1,b2,b3) & [<*[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]*>,or3 ] in the carrier of (GFA0CarryStr b1,b2,b3) )
proof end;

theorem Th20: :: GFACIRC1:20
for b1, b2, b3 being set holds
( [<*b1,b2*>,and2 ] in InnerVertices (GFA0CarryStr b1,b2,b3) & [<*b2,b3*>,and2 ] in InnerVertices (GFA0CarryStr b1,b2,b3) & [<*b3,b1*>,and2 ] in InnerVertices (GFA0CarryStr b1,b2,b3) & GFA0CarryOutput b1,b2,b3 in InnerVertices (GFA0CarryStr b1,b2,b3) )
proof end;

theorem Th21: :: GFACIRC1:21
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
( b1 in InputVertices (GFA0CarryStr b1,b2,b3) & b2 in InputVertices (GFA0CarryStr b1,b2,b3) & b3 in InputVertices (GFA0CarryStr b1,b2,b3) )
proof end;

theorem Th22: :: GFACIRC1:22
for b1, b2, b3 being non pair set holds InputVertices (GFA0CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th23: :: GFACIRC1:23
for b1, b2, b3 being set
for b4 being State of (GFA0CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,and2 ] = b5 '&' b6 & (Following b4) . [<*b2,b3*>,and2 ] = b6 '&' b7 & (Following b4) . [<*b3,b1*>,and2 ] = b7 '&' b5 )
proof end;

theorem Th24: :: GFACIRC1:24
for b1, b2, b3 being set
for b4 being State of (GFA0CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,and2 ] & b6 = b4 . [<*b2,b3*>,and2 ] & b7 = b4 . [<*b3,b1*>,and2 ] holds
(Following b4) . (GFA0CarryOutput b1,b2,b3) = (b5 'or' b6) 'or' b7
proof end;

theorem Th25: :: GFACIRC1:25
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
for b4 being State of (GFA0CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA0CarryOutput b1,b2,b3) = ((b5 '&' b6) 'or' (b6 '&' b7)) 'or' (b7 '&' b5) & (Following b4,2) . [<*b1,b2*>,and2 ] = b5 '&' b6 & (Following b4,2) . [<*b2,b3*>,and2 ] = b6 '&' b7 & (Following b4,2) . [<*b3,b1*>,and2 ] = b7 '&' b5 )
proof end;

theorem Th26: :: GFACIRC1:26
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
for b4 being State of (GFA0CarryCirc b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA0AdderStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 10
2GatesCircStr a1,a2,a3,xor2 ;
coherence
2GatesCircStr c1,c2,c3,xor2 is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def10 defines GFA0AdderStr GFACIRC1:def 10 :
for b1, b2, b3 being set holds GFA0AdderStr b1,b2,b3 = 2GatesCircStr b1,b2,b3,xor2 ;

definition
let c1, c2, c3 be set ;
func GFA0AdderCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA0AdderStr a1,a2,a3 equals :: GFACIRC1:def 11
2GatesCircuit a1,a2,a3,xor2 ;
coherence
2GatesCircuit c1,c2,c3,xor2 is strict gate`2=den Boolean Circuit of GFA0AdderStr c1,c2,c3
;
end;

:: deftheorem Def11 defines GFA0AdderCirc GFACIRC1:def 11 :
for b1, b2, b3 being set holds GFA0AdderCirc b1,b2,b3 = 2GatesCircuit b1,b2,b3,xor2 ;

definition
let c1, c2, c3 be set ;
func GFA0AdderOutput c1,c2,c3 -> Element of InnerVertices (GFA0AdderStr a1,a2,a3) equals :: GFACIRC1:def 12
2GatesCircOutput a1,a2,a3,xor2 ;
coherence
2GatesCircOutput c1,c2,c3,xor2 is Element of InnerVertices (GFA0AdderStr c1,c2,c3)
;
end;

:: deftheorem Def12 defines GFA0AdderOutput GFACIRC1:def 12 :
for b1, b2, b3 being set holds GFA0AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2 ;

theorem Th27: :: GFACIRC1:27
for b1, b2, b3 being set holds InnerVertices (GFA0AdderStr b1,b2,b3) = {[<*b1,b2*>,xor2 ]} \/ {(GFA0AdderOutput b1,b2,b3)}
proof end;

theorem Th28: :: GFACIRC1:28
for b1, b2, b3 being set holds InnerVertices (GFA0AdderStr b1,b2,b3) is Relation by FACIRC_1:58;

theorem Th29: :: GFACIRC1:29
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
InputVertices (GFA0AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th30: :: GFACIRC1:30
for b1, b2, b3 being non pair set holds not InputVertices (GFA0AdderStr b1,b2,b3) is with_pair by FACIRC_1:59;

theorem Th31: :: GFACIRC1:31
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA0AdderStr b1,b2,b3) & b2 in the carrier of (GFA0AdderStr b1,b2,b3) & b3 in the carrier of (GFA0AdderStr b1,b2,b3) & [<*b1,b2*>,xor2 ] in the carrier of (GFA0AdderStr b1,b2,b3) & [<*[<*b1,b2*>,xor2 ],b3*>,xor2 ] in the carrier of (GFA0AdderStr b1,b2,b3) ) by FACIRC_1:60, FACIRC_1:61;

theorem Th32: :: GFACIRC1:32
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2 ] in InnerVertices (GFA0AdderStr b1,b2,b3) & GFA0AdderOutput b1,b2,b3 in InnerVertices (GFA0AdderStr b1,b2,b3) )
proof end;

theorem Th33: :: GFACIRC1:33
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
( b1 in InputVertices (GFA0AdderStr b1,b2,b3) & b2 in InputVertices (GFA0AdderStr b1,b2,b3) & b3 in InputVertices (GFA0AdderStr b1,b2,b3) )
proof end;

theorem Th34: :: GFACIRC1:34
for b1, b2, b3 being non pair set holds InputVertices (GFA0AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th35: :: GFACIRC1:35
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA0AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,xor2 ] = b5 'xor' b6 & (Following b4) . b1 = b5 & (Following b4) . b2 = b6 & (Following b4) . b3 = b7 )
proof end;

theorem Th36: :: GFACIRC1:36
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA0AdderCirc b1,b2,b3)
for b5, b6, b7, b8 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,xor2 ] & b6 = b4 . b1 & b7 = b4 . b2 & b8 = b4 . b3 holds
(Following b4) . (GFA0AdderOutput b1,b2,b3) = b5 'xor' b8
proof end;

theorem Th37: :: GFACIRC1:37
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA0AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA0AdderOutput b1,b2,b3) = (b5 'xor' b6) 'xor' b7 & (Following b4,2) . [<*b1,b2*>,xor2 ] = b5 'xor' b6 & (Following b4,2) . b1 = b5 & (Following b4,2) . b2 = b6 & (Following b4,2) . b3 = b7 )
proof end;

theorem Th38: :: GFACIRC1:38
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA0AdderCirc b1,b2,b3) holds Following b4,2 is stable by FACIRC_1:63;

definition
let c1, c2, c3 be set ;
func BitGFA0Str c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 13
(GFA0AdderStr a1,a2,a3) +* (GFA0CarryStr a1,a2,a3);
coherence
(GFA0AdderStr c1,c2,c3) +* (GFA0CarryStr c1,c2,c3) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def13 defines BitGFA0Str GFACIRC1:def 13 :
for b1, b2, b3 being set holds BitGFA0Str b1,b2,b3 = (GFA0AdderStr b1,b2,b3) +* (GFA0CarryStr b1,b2,b3);

definition
let c1, c2, c3 be set ;
func BitGFA0Circ c1,c2,c3 -> strict gate`2=den Boolean Circuit of BitGFA0Str a1,a2,a3 equals :: GFACIRC1:def 14
(GFA0AdderCirc a1,a2,a3) +* (GFA0CarryCirc a1,a2,a3);
coherence
(GFA0AdderCirc c1,c2,c3) +* (GFA0CarryCirc c1,c2,c3) is strict gate`2=den Boolean Circuit of BitGFA0Str c1,c2,c3
;
end;

:: deftheorem Def14 defines BitGFA0Circ GFACIRC1:def 14 :
for b1, b2, b3 being set holds BitGFA0Circ b1,b2,b3 = (GFA0AdderCirc b1,b2,b3) +* (GFA0CarryCirc b1,b2,b3);

theorem Th39: :: GFACIRC1:39
for b1, b2, b3 being set holds InnerVertices (BitGFA0Str b1,b2,b3) = (({[<*b1,b2*>,xor2 ]} \/ {(GFA0AdderOutput b1,b2,b3)}) \/ {[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]}) \/ {(GFA0CarryOutput b1,b2,b3)}
proof end;

theorem Th40: :: GFACIRC1:40
for b1, b2, b3 being set holds InnerVertices (BitGFA0Str b1,b2,b3) is Relation
proof end;

theorem Th41: :: GFACIRC1:41
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
InputVertices (BitGFA0Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th42: :: GFACIRC1:42
for b1, b2, b3 being non pair set holds InputVertices (BitGFA0Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th43: :: GFACIRC1:43
for b1, b2, b3 being non pair set holds not InputVertices (BitGFA0Str b1,b2,b3) is with_pair
proof end;

theorem Th44: :: GFACIRC1:44
for b1, b2, b3 being set holds
( b1 in the carrier of (BitGFA0Str b1,b2,b3) & b2 in the carrier of (BitGFA0Str b1,b2,b3) & b3 in the carrier of (BitGFA0Str b1,b2,b3) & [<*b1,b2*>,xor2 ] in the carrier of (BitGFA0Str b1,b2,b3) & [<*[<*b1,b2*>,xor2 ],b3*>,xor2 ] in the carrier of (BitGFA0Str b1,b2,b3) & [<*b1,b2*>,and2 ] in the carrier of (BitGFA0Str b1,b2,b3) & [<*b2,b3*>,and2 ] in the carrier of (BitGFA0Str b1,b2,b3) & [<*b3,b1*>,and2 ] in the carrier of (BitGFA0Str b1,b2,b3) & [<*[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]*>,or3 ] in the carrier of (BitGFA0Str b1,b2,b3) )
proof end;

theorem Th45: :: GFACIRC1:45
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2 ] in InnerVertices (BitGFA0Str b1,b2,b3) & GFA0AdderOutput b1,b2,b3 in InnerVertices (BitGFA0Str b1,b2,b3) & [<*b1,b2*>,and2 ] in InnerVertices (BitGFA0Str b1,b2,b3) & [<*b2,b3*>,and2 ] in InnerVertices (BitGFA0Str b1,b2,b3) & [<*b3,b1*>,and2 ] in InnerVertices (BitGFA0Str b1,b2,b3) & GFA0CarryOutput b1,b2,b3 in InnerVertices (BitGFA0Str b1,b2,b3) )
proof end;

theorem Th46: :: GFACIRC1:46
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
( b1 in InputVertices (BitGFA0Str b1,b2,b3) & b2 in InputVertices (BitGFA0Str b1,b2,b3) & b3 in InputVertices (BitGFA0Str b1,b2,b3) )
proof end;

definition
let c1, c2, c3 be set ;
func BitGFA0CarryOutput c1,c2,c3 -> Element of InnerVertices (BitGFA0Str a1,a2,a3) equals :: GFACIRC1:def 15
[<*[<*a1,a2*>,and2 ],[<*a2,a3*>,and2 ],[<*a3,a1*>,and2 ]*>,or3 ];
coherence
[<*[<*c1,c2*>,and2 ],[<*c2,c3*>,and2 ],[<*c3,c1*>,and2 ]*>,or3 ] is Element of InnerVertices (BitGFA0Str c1,c2,c3)
proof end;
end;

:: deftheorem Def15 defines BitGFA0CarryOutput GFACIRC1:def 15 :
for b1, b2, b3 being set holds BitGFA0CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2 ],[<*b2,b3*>,and2 ],[<*b3,b1*>,and2 ]*>,or3 ];

definition
let c1, c2, c3 be set ;
func BitGFA0AdderOutput c1,c2,c3 -> Element of InnerVertices (BitGFA0Str a1,a2,a3) equals :: GFACIRC1:def 16
2GatesCircOutput a1,a2,a3,xor2 ;
coherence
2GatesCircOutput c1,c2,c3,xor2 is Element of InnerVertices (BitGFA0Str c1,c2,c3)
proof end;
end;

:: deftheorem Def16 defines BitGFA0AdderOutput GFACIRC1:def 16 :
for b1, b2, b3 being set holds BitGFA0AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2 ;

theorem Th47: :: GFACIRC1:47
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
for b4 being State of (BitGFA0Circ b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA0AdderOutput b1,b2,b3) = (b5 'xor' b6) 'xor' b7 & (Following b4,2) . (GFA0CarryOutput b1,b2,b3) = ((b5 '&' b6) 'or' (b6 '&' b7)) 'or' (b7 '&' b5) )
proof end;

theorem Th48: :: GFACIRC1:48
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2 ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2 ] holds
for b4 being State of (BitGFA0Circ b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA1CarryIStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 17
((1GateCircStr <*a1,a2*>,and2c ) +* (1GateCircStr <*a2,a3*>,and2a )) +* (1GateCircStr <*a3,a1*>,and2 );
coherence
((1GateCircStr <*c1,c2*>,and2c ) +* (1GateCircStr <*c2,c3*>,and2a )) +* (1GateCircStr <*c3,c1*>,and2 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def17 defines GFA1CarryIStr GFACIRC1:def 17 :
for b1, b2, b3 being set holds GFA1CarryIStr b1,b2,b3 = ((1GateCircStr <*b1,b2*>,and2c ) +* (1GateCircStr <*b2,b3*>,and2a )) +* (1GateCircStr <*b3,b1*>,and2 );

definition
let c1, c2, c3 be set ;
func GFA1CarryICirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA1CarryIStr a1,a2,a3 equals :: GFACIRC1:def 18
((1GateCircuit a1,a2,and2c ) +* (1GateCircuit a2,a3,and2a )) +* (1GateCircuit a3,a1,and2 );
coherence
((1GateCircuit c1,c2,and2c ) +* (1GateCircuit c2,c3,and2a )) +* (1GateCircuit c3,c1,and2 ) is strict gate`2=den Boolean Circuit of GFA1CarryIStr c1,c2,c3
;
end;

:: deftheorem Def18 defines GFA1CarryICirc GFACIRC1:def 18 :
for b1, b2, b3 being set holds GFA1CarryICirc b1,b2,b3 = ((1GateCircuit b1,b2,and2c ) +* (1GateCircuit b2,b3,and2a )) +* (1GateCircuit b3,b1,and2 );

definition
let c1, c2, c3 be set ;
func GFA1CarryStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 19
(GFA1CarryIStr a1,a2,a3) +* (1GateCircStr <*[<*a1,a2*>,and2c ],[<*a2,a3*>,and2a ],[<*a3,a1*>,and2 ]*>,or3 );
coherence
(GFA1CarryIStr c1,c2,c3) +* (1GateCircStr <*[<*c1,c2*>,and2c ],[<*c2,c3*>,and2a ],[<*c3,c1*>,and2 ]*>,or3 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def19 defines GFA1CarryStr GFACIRC1:def 19 :
for b1, b2, b3 being set holds GFA1CarryStr b1,b2,b3 = (GFA1CarryIStr b1,b2,b3) +* (1GateCircStr <*[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]*>,or3 );

definition
let c1, c2, c3 be set ;
func GFA1CarryCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA1CarryStr a1,a2,a3 equals :: GFACIRC1:def 20
(GFA1CarryICirc a1,a2,a3) +* (1GateCircuit [<*a1,a2*>,and2c ],[<*a2,a3*>,and2a ],[<*a3,a1*>,and2 ],or3 );
coherence
(GFA1CarryICirc c1,c2,c3) +* (1GateCircuit [<*c1,c2*>,and2c ],[<*c2,c3*>,and2a ],[<*c3,c1*>,and2 ],or3 ) is strict gate`2=den Boolean Circuit of GFA1CarryStr c1,c2,c3
;
end;

:: deftheorem Def20 defines GFA1CarryCirc GFACIRC1:def 20 :
for b1, b2, b3 being set holds GFA1CarryCirc b1,b2,b3 = (GFA1CarryICirc b1,b2,b3) +* (1GateCircuit [<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ],or3 );

definition
let c1, c2, c3 be set ;
func GFA1CarryOutput c1,c2,c3 -> Element of InnerVertices (GFA1CarryStr a1,a2,a3) equals :: GFACIRC1:def 21
[<*[<*a1,a2*>,and2c ],[<*a2,a3*>,and2a ],[<*a3,a1*>,and2 ]*>,or3 ];
coherence
[<*[<*c1,c2*>,and2c ],[<*c2,c3*>,and2a ],[<*c3,c1*>,and2 ]*>,or3 ] is Element of InnerVertices (GFA1CarryStr c1,c2,c3)
proof end;
end;

:: deftheorem Def21 defines GFA1CarryOutput GFACIRC1:def 21 :
for b1, b2, b3 being set holds GFA1CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]*>,or3 ];

theorem Th49: :: GFACIRC1:49
for b1, b2, b3 being set holds InnerVertices (GFA1CarryIStr b1,b2,b3) = {[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]}
proof end;

theorem Th50: :: GFACIRC1:50
for b1, b2, b3 being set holds InnerVertices (GFA1CarryStr b1,b2,b3) = {[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]} \/ {(GFA1CarryOutput b1,b2,b3)}
proof end;

theorem Th51: :: GFACIRC1:51
for b1, b2, b3 being set holds InnerVertices (GFA1CarryStr b1,b2,b3) is Relation
proof end;

theorem Th52: :: GFACIRC1:52
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
InputVertices (GFA1CarryIStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th53: :: GFACIRC1:53
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
InputVertices (GFA1CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th54: :: GFACIRC1:54
for b1, b2, b3 being non pair set holds not InputVertices (GFA1CarryStr b1,b2,b3) is with_pair
proof end;

theorem Th55: :: GFACIRC1:55
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA1CarryStr b1,b2,b3) & b2 in the carrier of (GFA1CarryStr b1,b2,b3) & b3 in the carrier of (GFA1CarryStr b1,b2,b3) & [<*b1,b2*>,and2c ] in the carrier of (GFA1CarryStr b1,b2,b3) & [<*b2,b3*>,and2a ] in the carrier of (GFA1CarryStr b1,b2,b3) & [<*b3,b1*>,and2 ] in the carrier of (GFA1CarryStr b1,b2,b3) & [<*[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]*>,or3 ] in the carrier of (GFA1CarryStr b1,b2,b3) )
proof end;

theorem Th56: :: GFACIRC1:56
for b1, b2, b3 being set holds
( [<*b1,b2*>,and2c ] in InnerVertices (GFA1CarryStr b1,b2,b3) & [<*b2,b3*>,and2a ] in InnerVertices (GFA1CarryStr b1,b2,b3) & [<*b3,b1*>,and2 ] in InnerVertices (GFA1CarryStr b1,b2,b3) & GFA1CarryOutput b1,b2,b3 in InnerVertices (GFA1CarryStr b1,b2,b3) )
proof end;

theorem Th57: :: GFACIRC1:57
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
( b1 in InputVertices (GFA1CarryStr b1,b2,b3) & b2 in InputVertices (GFA1CarryStr b1,b2,b3) & b3 in InputVertices (GFA1CarryStr b1,b2,b3) )
proof end;

theorem Th58: :: GFACIRC1:58
for b1, b2, b3 being non pair set holds InputVertices (GFA1CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th59: :: GFACIRC1:59
for b1, b2, b3 being set
for b4 being State of (GFA1CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,and2c ] = b5 '&' ('not' b6) & (Following b4) . [<*b2,b3*>,and2a ] = ('not' b6) '&' b7 & (Following b4) . [<*b3,b1*>,and2 ] = b7 '&' b5 )
proof end;

theorem Th60: :: GFACIRC1:60
for b1, b2, b3 being set
for b4 being State of (GFA1CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,and2c ] & b6 = b4 . [<*b2,b3*>,and2a ] & b7 = b4 . [<*b3,b1*>,and2 ] holds
(Following b4) . (GFA1CarryOutput b1,b2,b3) = (b5 'or' b6) 'or' b7
proof end;

theorem Th61: :: GFACIRC1:61
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
for b4 being State of (GFA1CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA1CarryOutput b1,b2,b3) = ((b5 '&' ('not' b6)) 'or' (('not' b6) '&' b7)) 'or' (b7 '&' b5) & (Following b4,2) . [<*b1,b2*>,and2c ] = b5 '&' ('not' b6) & (Following b4,2) . [<*b2,b3*>,and2a ] = ('not' b6) '&' b7 & (Following b4,2) . [<*b3,b1*>,and2 ] = b7 '&' b5 )
proof end;

theorem Th62: :: GFACIRC1:62
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
for b4 being State of (GFA1CarryCirc b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA1AdderStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 22
2GatesCircStr a1,a2,a3,xor2c ;
coherence
2GatesCircStr c1,c2,c3,xor2c is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def22 defines GFA1AdderStr GFACIRC1:def 22 :
for b1, b2, b3 being set holds GFA1AdderStr b1,b2,b3 = 2GatesCircStr b1,b2,b3,xor2c ;

definition
let c1, c2, c3 be set ;
func GFA1AdderCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA1AdderStr a1,a2,a3 equals :: GFACIRC1:def 23
2GatesCircuit a1,a2,a3,xor2c ;
coherence
2GatesCircuit c1,c2,c3,xor2c is strict gate`2=den Boolean Circuit of GFA1AdderStr c1,c2,c3
;
end;

:: deftheorem Def23 defines GFA1AdderCirc GFACIRC1:def 23 :
for b1, b2, b3 being set holds GFA1AdderCirc b1,b2,b3 = 2GatesCircuit b1,b2,b3,xor2c ;

definition
let c1, c2, c3 be set ;
func GFA1AdderOutput c1,c2,c3 -> Element of InnerVertices (GFA1AdderStr a1,a2,a3) equals :: GFACIRC1:def 24
2GatesCircOutput a1,a2,a3,xor2c ;
coherence
2GatesCircOutput c1,c2,c3,xor2c is Element of InnerVertices (GFA1AdderStr c1,c2,c3)
;
end;

:: deftheorem Def24 defines GFA1AdderOutput GFACIRC1:def 24 :
for b1, b2, b3 being set holds GFA1AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2c ;

theorem Th63: :: GFACIRC1:63
for b1, b2, b3 being set holds InnerVertices (GFA1AdderStr b1,b2,b3) = {[<*b1,b2*>,xor2c ]} \/ {(GFA1AdderOutput b1,b2,b3)}
proof end;

theorem Th64: :: GFACIRC1:64
for b1, b2, b3 being set holds InnerVertices (GFA1AdderStr b1,b2,b3) is Relation by FACIRC_1:58;

theorem Th65: :: GFACIRC1:65
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
InputVertices (GFA1AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th66: :: GFACIRC1:66
for b1, b2, b3 being non pair set holds not InputVertices (GFA1AdderStr b1,b2,b3) is with_pair by FACIRC_1:59;

theorem Th67: :: GFACIRC1:67
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA1AdderStr b1,b2,b3) & b2 in the carrier of (GFA1AdderStr b1,b2,b3) & b3 in the carrier of (GFA1AdderStr b1,b2,b3) & [<*b1,b2*>,xor2c ] in the carrier of (GFA1AdderStr b1,b2,b3) & [<*[<*b1,b2*>,xor2c ],b3*>,xor2c ] in the carrier of (GFA1AdderStr b1,b2,b3) ) by FACIRC_1:60, FACIRC_1:61;

theorem Th68: :: GFACIRC1:68
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2c ] in InnerVertices (GFA1AdderStr b1,b2,b3) & GFA1AdderOutput b1,b2,b3 in InnerVertices (GFA1AdderStr b1,b2,b3) )
proof end;

theorem Th69: :: GFACIRC1:69
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
( b1 in InputVertices (GFA1AdderStr b1,b2,b3) & b2 in InputVertices (GFA1AdderStr b1,b2,b3) & b3 in InputVertices (GFA1AdderStr b1,b2,b3) )
proof end;

theorem Th70: :: GFACIRC1:70
for b1, b2, b3 being non pair set holds InputVertices (GFA1AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th71: :: GFACIRC1:71
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA1AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,xor2c ] = b5 'xor' ('not' b6) & (Following b4) . b1 = b5 & (Following b4) . b2 = b6 & (Following b4) . b3 = b7 )
proof end;

theorem Th72: :: GFACIRC1:72
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA1AdderCirc b1,b2,b3)
for b5, b6, b7, b8 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,xor2c ] & b6 = b4 . b1 & b7 = b4 . b2 & b8 = b4 . b3 holds
(Following b4) . (GFA1AdderOutput b1,b2,b3) = b5 'xor' ('not' b8)
proof end;

theorem Th73: :: GFACIRC1:73
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA1AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA1AdderOutput b1,b2,b3) = (b5 'xor' ('not' b6)) 'xor' ('not' b7) & (Following b4,2) . [<*b1,b2*>,xor2c ] = b5 'xor' ('not' b6) & (Following b4,2) . b1 = b5 & (Following b4,2) . b2 = b6 & (Following b4,2) . b3 = b7 )
proof end;

theorem Th74: :: GFACIRC1:74
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA1AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
(Following b4,2) . (GFA1AdderOutput b1,b2,b3) = 'not' ((b5 'xor' ('not' b6)) 'xor' b7)
proof end;

theorem Th75: :: GFACIRC1:75
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA1AdderCirc b1,b2,b3) holds Following b4,2 is stable by FACIRC_1:63;

definition
let c1, c2, c3 be set ;
func BitGFA1Str c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 25
(GFA1AdderStr a1,a2,a3) +* (GFA1CarryStr a1,a2,a3);
coherence
(GFA1AdderStr c1,c2,c3) +* (GFA1CarryStr c1,c2,c3) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def25 defines BitGFA1Str GFACIRC1:def 25 :
for b1, b2, b3 being set holds BitGFA1Str b1,b2,b3 = (GFA1AdderStr b1,b2,b3) +* (GFA1CarryStr b1,b2,b3);

definition
let c1, c2, c3 be set ;
func BitGFA1Circ c1,c2,c3 -> strict gate`2=den Boolean Circuit of BitGFA1Str a1,a2,a3 equals :: GFACIRC1:def 26
(GFA1AdderCirc a1,a2,a3) +* (GFA1CarryCirc a1,a2,a3);
coherence
(GFA1AdderCirc c1,c2,c3) +* (GFA1CarryCirc c1,c2,c3) is strict gate`2=den Boolean Circuit of BitGFA1Str c1,c2,c3
;
end;

:: deftheorem Def26 defines BitGFA1Circ GFACIRC1:def 26 :
for b1, b2, b3 being set holds BitGFA1Circ b1,b2,b3 = (GFA1AdderCirc b1,b2,b3) +* (GFA1CarryCirc b1,b2,b3);

theorem Th76: :: GFACIRC1:76
for b1, b2, b3 being set holds InnerVertices (BitGFA1Str b1,b2,b3) = (({[<*b1,b2*>,xor2c ]} \/ {(GFA1AdderOutput b1,b2,b3)}) \/ {[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]}) \/ {(GFA1CarryOutput b1,b2,b3)}
proof end;

theorem Th77: :: GFACIRC1:77
for b1, b2, b3 being set holds InnerVertices (BitGFA1Str b1,b2,b3) is Relation
proof end;

theorem Th78: :: GFACIRC1:78
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
InputVertices (BitGFA1Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th79: :: GFACIRC1:79
for b1, b2, b3 being non pair set holds InputVertices (BitGFA1Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th80: :: GFACIRC1:80
for b1, b2, b3 being non pair set holds not InputVertices (BitGFA1Str b1,b2,b3) is with_pair
proof end;

theorem Th81: :: GFACIRC1:81
for b1, b2, b3 being set holds
( b1 in the carrier of (BitGFA1Str b1,b2,b3) & b2 in the carrier of (BitGFA1Str b1,b2,b3) & b3 in the carrier of (BitGFA1Str b1,b2,b3) & [<*b1,b2*>,xor2c ] in the carrier of (BitGFA1Str b1,b2,b3) & [<*[<*b1,b2*>,xor2c ],b3*>,xor2c ] in the carrier of (BitGFA1Str b1,b2,b3) & [<*b1,b2*>,and2c ] in the carrier of (BitGFA1Str b1,b2,b3) & [<*b2,b3*>,and2a ] in the carrier of (BitGFA1Str b1,b2,b3) & [<*b3,b1*>,and2 ] in the carrier of (BitGFA1Str b1,b2,b3) & [<*[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]*>,or3 ] in the carrier of (BitGFA1Str b1,b2,b3) )
proof end;

theorem Th82: :: GFACIRC1:82
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2c ] in InnerVertices (BitGFA1Str b1,b2,b3) & GFA1AdderOutput b1,b2,b3 in InnerVertices (BitGFA1Str b1,b2,b3) & [<*b1,b2*>,and2c ] in InnerVertices (BitGFA1Str b1,b2,b3) & [<*b2,b3*>,and2a ] in InnerVertices (BitGFA1Str b1,b2,b3) & [<*b3,b1*>,and2 ] in InnerVertices (BitGFA1Str b1,b2,b3) & GFA1CarryOutput b1,b2,b3 in InnerVertices (BitGFA1Str b1,b2,b3) )
proof end;

theorem Th83: :: GFACIRC1:83
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
( b1 in InputVertices (BitGFA1Str b1,b2,b3) & b2 in InputVertices (BitGFA1Str b1,b2,b3) & b3 in InputVertices (BitGFA1Str b1,b2,b3) )
proof end;

definition
let c1, c2, c3 be set ;
func BitGFA1CarryOutput c1,c2,c3 -> Element of InnerVertices (BitGFA1Str a1,a2,a3) equals :: GFACIRC1:def 27
[<*[<*a1,a2*>,and2c ],[<*a2,a3*>,and2a ],[<*a3,a1*>,and2 ]*>,or3 ];
coherence
[<*[<*c1,c2*>,and2c ],[<*c2,c3*>,and2a ],[<*c3,c1*>,and2 ]*>,or3 ] is Element of InnerVertices (BitGFA1Str c1,c2,c3)
proof end;
end;

:: deftheorem Def27 defines BitGFA1CarryOutput GFACIRC1:def 27 :
for b1, b2, b3 being set holds BitGFA1CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2c ],[<*b2,b3*>,and2a ],[<*b3,b1*>,and2 ]*>,or3 ];

definition
let c1, c2, c3 be set ;
func BitGFA1AdderOutput c1,c2,c3 -> Element of InnerVertices (BitGFA1Str a1,a2,a3) equals :: GFACIRC1:def 28
2GatesCircOutput a1,a2,a3,xor2c ;
coherence
2GatesCircOutput c1,c2,c3,xor2c is Element of InnerVertices (BitGFA1Str c1,c2,c3)
proof end;
end;

:: deftheorem Def28 defines BitGFA1AdderOutput GFACIRC1:def 28 :
for b1, b2, b3 being set holds BitGFA1AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2c ;

theorem Th84: :: GFACIRC1:84
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
for b4 being State of (BitGFA1Circ b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA1AdderOutput b1,b2,b3) = 'not' ((b5 'xor' ('not' b6)) 'xor' b7) & (Following b4,2) . (GFA1CarryOutput b1,b2,b3) = ((b5 '&' ('not' b6)) 'or' (('not' b6) '&' b7)) 'or' (b7 '&' b5) )
proof end;

theorem Th85: :: GFACIRC1:85
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2a ] & b2 <> [<*b3,b1*>,and2 ] & b3 <> [<*b1,b2*>,and2c ] holds
for b4 being State of (BitGFA1Circ b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA2CarryIStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 29
((1GateCircStr <*a1,a2*>,and2a ) +* (1GateCircStr <*a2,a3*>,and2c )) +* (1GateCircStr <*a3,a1*>,and2b );
coherence
((1GateCircStr <*c1,c2*>,and2a ) +* (1GateCircStr <*c2,c3*>,and2c )) +* (1GateCircStr <*c3,c1*>,and2b ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def29 defines GFA2CarryIStr GFACIRC1:def 29 :
for b1, b2, b3 being set holds GFA2CarryIStr b1,b2,b3 = ((1GateCircStr <*b1,b2*>,and2a ) +* (1GateCircStr <*b2,b3*>,and2c )) +* (1GateCircStr <*b3,b1*>,and2b );

definition
let c1, c2, c3 be set ;
func GFA2CarryICirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA2CarryIStr a1,a2,a3 equals :: GFACIRC1:def 30
((1GateCircuit a1,a2,and2a ) +* (1GateCircuit a2,a3,and2c )) +* (1GateCircuit a3,a1,and2b );
coherence
((1GateCircuit c1,c2,and2a ) +* (1GateCircuit c2,c3,and2c )) +* (1GateCircuit c3,c1,and2b ) is strict gate`2=den Boolean Circuit of GFA2CarryIStr c1,c2,c3
;
end;

:: deftheorem Def30 defines GFA2CarryICirc GFACIRC1:def 30 :
for b1, b2, b3 being set holds GFA2CarryICirc b1,b2,b3 = ((1GateCircuit b1,b2,and2a ) +* (1GateCircuit b2,b3,and2c )) +* (1GateCircuit b3,b1,and2b );

definition
let c1, c2, c3 be set ;
func GFA2CarryStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 31
(GFA2CarryIStr a1,a2,a3) +* (1GateCircStr <*[<*a1,a2*>,and2a ],[<*a2,a3*>,and2c ],[<*a3,a1*>,and2b ]*>,nor3 );
coherence
(GFA2CarryIStr c1,c2,c3) +* (1GateCircStr <*[<*c1,c2*>,and2a ],[<*c2,c3*>,and2c ],[<*c3,c1*>,and2b ]*>,nor3 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def31 defines GFA2CarryStr GFACIRC1:def 31 :
for b1, b2, b3 being set holds GFA2CarryStr b1,b2,b3 = (GFA2CarryIStr b1,b2,b3) +* (1GateCircStr <*[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]*>,nor3 );

definition
let c1, c2, c3 be set ;
func GFA2CarryCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA2CarryStr a1,a2,a3 equals :: GFACIRC1:def 32
(GFA2CarryICirc a1,a2,a3) +* (1GateCircuit [<*a1,a2*>,and2a ],[<*a2,a3*>,and2c ],[<*a3,a1*>,and2b ],nor3 );
coherence
(GFA2CarryICirc c1,c2,c3) +* (1GateCircuit [<*c1,c2*>,and2a ],[<*c2,c3*>,and2c ],[<*c3,c1*>,and2b ],nor3 ) is strict gate`2=den Boolean Circuit of GFA2CarryStr c1,c2,c3
;
end;

:: deftheorem Def32 defines GFA2CarryCirc GFACIRC1:def 32 :
for b1, b2, b3 being set holds GFA2CarryCirc b1,b2,b3 = (GFA2CarryICirc b1,b2,b3) +* (1GateCircuit [<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ],nor3 );

definition
let c1, c2, c3 be set ;
func GFA2CarryOutput c1,c2,c3 -> Element of InnerVertices (GFA2CarryStr a1,a2,a3) equals :: GFACIRC1:def 33
[<*[<*a1,a2*>,and2a ],[<*a2,a3*>,and2c ],[<*a3,a1*>,and2b ]*>,nor3 ];
coherence
[<*[<*c1,c2*>,and2a ],[<*c2,c3*>,and2c ],[<*c3,c1*>,and2b ]*>,nor3 ] is Element of InnerVertices (GFA2CarryStr c1,c2,c3)
proof end;
end;

:: deftheorem Def33 defines GFA2CarryOutput GFACIRC1:def 33 :
for b1, b2, b3 being set holds GFA2CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]*>,nor3 ];

theorem Th86: :: GFACIRC1:86
for b1, b2, b3 being set holds InnerVertices (GFA2CarryIStr b1,b2,b3) = {[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]}
proof end;

theorem Th87: :: GFACIRC1:87
for b1, b2, b3 being set holds InnerVertices (GFA2CarryStr b1,b2,b3) = {[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]} \/ {(GFA2CarryOutput b1,b2,b3)}
proof end;

theorem Th88: :: GFACIRC1:88
for b1, b2, b3 being set holds InnerVertices (GFA2CarryStr b1,b2,b3) is Relation
proof end;

theorem Th89: :: GFACIRC1:89
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
InputVertices (GFA2CarryIStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th90: :: GFACIRC1:90
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
InputVertices (GFA2CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th91: :: GFACIRC1:91
for b1, b2, b3 being non pair set holds not InputVertices (GFA2CarryStr b1,b2,b3) is with_pair
proof end;

theorem Th92: :: GFACIRC1:92
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA2CarryStr b1,b2,b3) & b2 in the carrier of (GFA2CarryStr b1,b2,b3) & b3 in the carrier of (GFA2CarryStr b1,b2,b3) & [<*b1,b2*>,and2a ] in the carrier of (GFA2CarryStr b1,b2,b3) & [<*b2,b3*>,and2c ] in the carrier of (GFA2CarryStr b1,b2,b3) & [<*b3,b1*>,and2b ] in the carrier of (GFA2CarryStr b1,b2,b3) & [<*[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]*>,nor3 ] in the carrier of (GFA2CarryStr b1,b2,b3) )
proof end;

theorem Th93: :: GFACIRC1:93
for b1, b2, b3 being set holds
( [<*b1,b2*>,and2a ] in InnerVertices (GFA2CarryStr b1,b2,b3) & [<*b2,b3*>,and2c ] in InnerVertices (GFA2CarryStr b1,b2,b3) & [<*b3,b1*>,and2b ] in InnerVertices (GFA2CarryStr b1,b2,b3) & GFA2CarryOutput b1,b2,b3 in InnerVertices (GFA2CarryStr b1,b2,b3) )
proof end;

theorem Th94: :: GFACIRC1:94
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
( b1 in InputVertices (GFA2CarryStr b1,b2,b3) & b2 in InputVertices (GFA2CarryStr b1,b2,b3) & b3 in InputVertices (GFA2CarryStr b1,b2,b3) )
proof end;

theorem Th95: :: GFACIRC1:95
for b1, b2, b3 being non pair set holds InputVertices (GFA2CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th96: :: GFACIRC1:96
for b1, b2, b3 being set
for b4 being State of (GFA2CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,and2a ] = ('not' b5) '&' b6 & (Following b4) . [<*b2,b3*>,and2c ] = b6 '&' ('not' b7) & (Following b4) . [<*b3,b1*>,and2b ] = ('not' b7) '&' ('not' b5) )
proof end;

theorem Th97: :: GFACIRC1:97
for b1, b2, b3 being set
for b4 being State of (GFA2CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,and2a ] & b6 = b4 . [<*b2,b3*>,and2c ] & b7 = b4 . [<*b3,b1*>,and2b ] holds
(Following b4) . (GFA2CarryOutput b1,b2,b3) = 'not' ((b5 'or' b6) 'or' b7)
proof end;

theorem Th98: :: GFACIRC1:98
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
for b4 being State of (GFA2CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA2CarryOutput b1,b2,b3) = 'not' (((('not' b5) '&' b6) 'or' (b6 '&' ('not' b7))) 'or' (('not' b7) '&' ('not' b5))) & (Following b4,2) . [<*b1,b2*>,and2a ] = ('not' b5) '&' b6 & (Following b4,2) . [<*b2,b3*>,and2c ] = b6 '&' ('not' b7) & (Following b4,2) . [<*b3,b1*>,and2b ] = ('not' b7) '&' ('not' b5) )
proof end;

theorem Th99: :: GFACIRC1:99
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
for b4 being State of (GFA2CarryCirc b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA2AdderStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 34
2GatesCircStr a1,a2,a3,xor2c ;
coherence
2GatesCircStr c1,c2,c3,xor2c is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def34 defines GFA2AdderStr GFACIRC1:def 34 :
for b1, b2, b3 being set holds GFA2AdderStr b1,b2,b3 = 2GatesCircStr b1,b2,b3,xor2c ;

definition
let c1, c2, c3 be set ;
func GFA2AdderCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA2AdderStr a1,a2,a3 equals :: GFACIRC1:def 35
2GatesCircuit a1,a2,a3,xor2c ;
coherence
2GatesCircuit c1,c2,c3,xor2c is strict gate`2=den Boolean Circuit of GFA2AdderStr c1,c2,c3
;
end;

:: deftheorem Def35 defines GFA2AdderCirc GFACIRC1:def 35 :
for b1, b2, b3 being set holds GFA2AdderCirc b1,b2,b3 = 2GatesCircuit b1,b2,b3,xor2c ;

definition
let c1, c2, c3 be set ;
func GFA2AdderOutput c1,c2,c3 -> Element of InnerVertices (GFA2AdderStr a1,a2,a3) equals :: GFACIRC1:def 36
2GatesCircOutput a1,a2,a3,xor2c ;
coherence
2GatesCircOutput c1,c2,c3,xor2c is Element of InnerVertices (GFA2AdderStr c1,c2,c3)
;
end;

:: deftheorem Def36 defines GFA2AdderOutput GFACIRC1:def 36 :
for b1, b2, b3 being set holds GFA2AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2c ;

theorem Th100: :: GFACIRC1:100
for b1, b2, b3 being set holds InnerVertices (GFA2AdderStr b1,b2,b3) = {[<*b1,b2*>,xor2c ]} \/ {(GFA2AdderOutput b1,b2,b3)}
proof end;

theorem Th101: :: GFACIRC1:101
for b1, b2, b3 being set holds InnerVertices (GFA2AdderStr b1,b2,b3) is Relation by FACIRC_1:58;

theorem Th102: :: GFACIRC1:102
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
InputVertices (GFA2AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th103: :: GFACIRC1:103
for b1, b2, b3 being non pair set holds not InputVertices (GFA2AdderStr b1,b2,b3) is with_pair by FACIRC_1:59;

theorem Th104: :: GFACIRC1:104
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA2AdderStr b1,b2,b3) & b2 in the carrier of (GFA2AdderStr b1,b2,b3) & b3 in the carrier of (GFA2AdderStr b1,b2,b3) & [<*b1,b2*>,xor2c ] in the carrier of (GFA2AdderStr b1,b2,b3) & [<*[<*b1,b2*>,xor2c ],b3*>,xor2c ] in the carrier of (GFA2AdderStr b1,b2,b3) ) by FACIRC_1:60, FACIRC_1:61;

theorem Th105: :: GFACIRC1:105
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2c ] in InnerVertices (GFA2AdderStr b1,b2,b3) & GFA2AdderOutput b1,b2,b3 in InnerVertices (GFA2AdderStr b1,b2,b3) )
proof end;

theorem Th106: :: GFACIRC1:106
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
( b1 in InputVertices (GFA2AdderStr b1,b2,b3) & b2 in InputVertices (GFA2AdderStr b1,b2,b3) & b3 in InputVertices (GFA2AdderStr b1,b2,b3) )
proof end;

theorem Th107: :: GFACIRC1:107
for b1, b2, b3 being non pair set holds InputVertices (GFA2AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th108: :: GFACIRC1:108
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA2AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,xor2c ] = b5 'xor' ('not' b6) & (Following b4) . b1 = b5 & (Following b4) . b2 = b6 & (Following b4) . b3 = b7 )
proof end;

theorem Th109: :: GFACIRC1:109
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA2AdderCirc b1,b2,b3)
for b5, b6, b7, b8 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,xor2c ] & b6 = b4 . b1 & b7 = b4 . b2 & b8 = b4 . b3 holds
(Following b4) . (GFA2AdderOutput b1,b2,b3) = b5 'xor' ('not' b8)
proof end;

theorem Th110: :: GFACIRC1:110
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA2AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA2AdderOutput b1,b2,b3) = (b5 'xor' ('not' b6)) 'xor' ('not' b7) & (Following b4,2) . [<*b1,b2*>,xor2c ] = b5 'xor' ('not' b6) & (Following b4,2) . b1 = b5 & (Following b4,2) . b2 = b6 & (Following b4,2) . b3 = b7 )
proof end;

theorem Th111: :: GFACIRC1:111
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA2AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
(Following b4,2) . (GFA2AdderOutput b1,b2,b3) = (('not' b5) 'xor' b6) 'xor' ('not' b7)
proof end;

theorem Th112: :: GFACIRC1:112
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] holds
for b4 being State of (GFA2AdderCirc b1,b2,b3) holds Following b4,2 is stable by FACIRC_1:63;

definition
let c1, c2, c3 be set ;
func BitGFA2Str c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 37
(GFA2AdderStr a1,a2,a3) +* (GFA2CarryStr a1,a2,a3);
coherence
(GFA2AdderStr c1,c2,c3) +* (GFA2CarryStr c1,c2,c3) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def37 defines BitGFA2Str GFACIRC1:def 37 :
for b1, b2, b3 being set holds BitGFA2Str b1,b2,b3 = (GFA2AdderStr b1,b2,b3) +* (GFA2CarryStr b1,b2,b3);

definition
let c1, c2, c3 be set ;
func BitGFA2Circ c1,c2,c3 -> strict gate`2=den Boolean Circuit of BitGFA2Str a1,a2,a3 equals :: GFACIRC1:def 38
(GFA2AdderCirc a1,a2,a3) +* (GFA2CarryCirc a1,a2,a3);
coherence
(GFA2AdderCirc c1,c2,c3) +* (GFA2CarryCirc c1,c2,c3) is strict gate`2=den Boolean Circuit of BitGFA2Str c1,c2,c3
;
end;

:: deftheorem Def38 defines BitGFA2Circ GFACIRC1:def 38 :
for b1, b2, b3 being set holds BitGFA2Circ b1,b2,b3 = (GFA2AdderCirc b1,b2,b3) +* (GFA2CarryCirc b1,b2,b3);

theorem Th113: :: GFACIRC1:113
for b1, b2, b3 being set holds InnerVertices (BitGFA2Str b1,b2,b3) = (({[<*b1,b2*>,xor2c ]} \/ {(GFA2AdderOutput b1,b2,b3)}) \/ {[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]}) \/ {(GFA2CarryOutput b1,b2,b3)}
proof end;

theorem Th114: :: GFACIRC1:114
for b1, b2, b3 being set holds InnerVertices (BitGFA2Str b1,b2,b3) is Relation
proof end;

theorem Th115: :: GFACIRC1:115
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
InputVertices (BitGFA2Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th116: :: GFACIRC1:116
for b1, b2, b3 being non pair set holds InputVertices (BitGFA2Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th117: :: GFACIRC1:117
for b1, b2, b3 being non pair set holds not InputVertices (BitGFA2Str b1,b2,b3) is with_pair
proof end;

theorem Th118: :: GFACIRC1:118
for b1, b2, b3 being set holds
( b1 in the carrier of (BitGFA2Str b1,b2,b3) & b2 in the carrier of (BitGFA2Str b1,b2,b3) & b3 in the carrier of (BitGFA2Str b1,b2,b3) & [<*b1,b2*>,xor2c ] in the carrier of (BitGFA2Str b1,b2,b3) & [<*[<*b1,b2*>,xor2c ],b3*>,xor2c ] in the carrier of (BitGFA2Str b1,b2,b3) & [<*b1,b2*>,and2a ] in the carrier of (BitGFA2Str b1,b2,b3) & [<*b2,b3*>,and2c ] in the carrier of (BitGFA2Str b1,b2,b3) & [<*b3,b1*>,and2b ] in the carrier of (BitGFA2Str b1,b2,b3) & [<*[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]*>,nor3 ] in the carrier of (BitGFA2Str b1,b2,b3) )
proof end;

theorem Th119: :: GFACIRC1:119
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2c ] in InnerVertices (BitGFA2Str b1,b2,b3) & GFA2AdderOutput b1,b2,b3 in InnerVertices (BitGFA2Str b1,b2,b3) & [<*b1,b2*>,and2a ] in InnerVertices (BitGFA2Str b1,b2,b3) & [<*b2,b3*>,and2c ] in InnerVertices (BitGFA2Str b1,b2,b3) & [<*b3,b1*>,and2b ] in InnerVertices (BitGFA2Str b1,b2,b3) & GFA2CarryOutput b1,b2,b3 in InnerVertices (BitGFA2Str b1,b2,b3) )
proof end;

theorem Th120: :: GFACIRC1:120
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
( b1 in InputVertices (BitGFA2Str b1,b2,b3) & b2 in InputVertices (BitGFA2Str b1,b2,b3) & b3 in InputVertices (BitGFA2Str b1,b2,b3) )
proof end;

definition
let c1, c2, c3 be set ;
func BitGFA2CarryOutput c1,c2,c3 -> Element of InnerVertices (BitGFA2Str a1,a2,a3) equals :: GFACIRC1:def 39
[<*[<*a1,a2*>,and2a ],[<*a2,a3*>,and2c ],[<*a3,a1*>,and2b ]*>,nor3 ];
coherence
[<*[<*c1,c2*>,and2a ],[<*c2,c3*>,and2c ],[<*c3,c1*>,and2b ]*>,nor3 ] is Element of InnerVertices (BitGFA2Str c1,c2,c3)
proof end;
end;

:: deftheorem Def39 defines BitGFA2CarryOutput GFACIRC1:def 39 :
for b1, b2, b3 being set holds BitGFA2CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2a ],[<*b2,b3*>,and2c ],[<*b3,b1*>,and2b ]*>,nor3 ];

definition
let c1, c2, c3 be set ;
func BitGFA2AdderOutput c1,c2,c3 -> Element of InnerVertices (BitGFA2Str a1,a2,a3) equals :: GFACIRC1:def 40
2GatesCircOutput a1,a2,a3,xor2c ;
coherence
2GatesCircOutput c1,c2,c3,xor2c is Element of InnerVertices (BitGFA2Str c1,c2,c3)
proof end;
end;

:: deftheorem Def40 defines BitGFA2AdderOutput GFACIRC1:def 40 :
for b1, b2, b3 being set holds BitGFA2AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2c ;

theorem Th121: :: GFACIRC1:121
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
for b4 being State of (BitGFA2Circ b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA2AdderOutput b1,b2,b3) = (('not' b5) 'xor' b6) 'xor' ('not' b7) & (Following b4,2) . (GFA2CarryOutput b1,b2,b3) = 'not' (((('not' b5) '&' b6) 'or' (b6 '&' ('not' b7))) 'or' (('not' b7) '&' ('not' b5))) )
proof end;

theorem Th122: :: GFACIRC1:122
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2c ] & b1 <> [<*b2,b3*>,and2c ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2a ] holds
for b4 being State of (BitGFA2Circ b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA3CarryIStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 41
((1GateCircStr <*a1,a2*>,and2b ) +* (1GateCircStr <*a2,a3*>,and2b )) +* (1GateCircStr <*a3,a1*>,and2b );
coherence
((1GateCircStr <*c1,c2*>,and2b ) +* (1GateCircStr <*c2,c3*>,and2b )) +* (1GateCircStr <*c3,c1*>,and2b ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def41 defines GFA3CarryIStr GFACIRC1:def 41 :
for b1, b2, b3 being set holds GFA3CarryIStr b1,b2,b3 = ((1GateCircStr <*b1,b2*>,and2b ) +* (1GateCircStr <*b2,b3*>,and2b )) +* (1GateCircStr <*b3,b1*>,and2b );

definition
let c1, c2, c3 be set ;
func GFA3CarryICirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA3CarryIStr a1,a2,a3 equals :: GFACIRC1:def 42
((1GateCircuit a1,a2,and2b ) +* (1GateCircuit a2,a3,and2b )) +* (1GateCircuit a3,a1,and2b );
coherence
((1GateCircuit c1,c2,and2b ) +* (1GateCircuit c2,c3,and2b )) +* (1GateCircuit c3,c1,and2b ) is strict gate`2=den Boolean Circuit of GFA3CarryIStr c1,c2,c3
;
end;

:: deftheorem Def42 defines GFA3CarryICirc GFACIRC1:def 42 :
for b1, b2, b3 being set holds GFA3CarryICirc b1,b2,b3 = ((1GateCircuit b1,b2,and2b ) +* (1GateCircuit b2,b3,and2b )) +* (1GateCircuit b3,b1,and2b );

definition
let c1, c2, c3 be set ;
func GFA3CarryStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 43
(GFA3CarryIStr a1,a2,a3) +* (1GateCircStr <*[<*a1,a2*>,and2b ],[<*a2,a3*>,and2b ],[<*a3,a1*>,and2b ]*>,nor3 );
coherence
(GFA3CarryIStr c1,c2,c3) +* (1GateCircStr <*[<*c1,c2*>,and2b ],[<*c2,c3*>,and2b ],[<*c3,c1*>,and2b ]*>,nor3 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def43 defines GFA3CarryStr GFACIRC1:def 43 :
for b1, b2, b3 being set holds GFA3CarryStr b1,b2,b3 = (GFA3CarryIStr b1,b2,b3) +* (1GateCircStr <*[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]*>,nor3 );

definition
let c1, c2, c3 be set ;
func GFA3CarryCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA3CarryStr a1,a2,a3 equals :: GFACIRC1:def 44
(GFA3CarryICirc a1,a2,a3) +* (1GateCircuit [<*a1,a2*>,and2b ],[<*a2,a3*>,and2b ],[<*a3,a1*>,and2b ],nor3 );
coherence
(GFA3CarryICirc c1,c2,c3) +* (1GateCircuit [<*c1,c2*>,and2b ],[<*c2,c3*>,and2b ],[<*c3,c1*>,and2b ],nor3 ) is strict gate`2=den Boolean Circuit of GFA3CarryStr c1,c2,c3
;
end;

:: deftheorem Def44 defines GFA3CarryCirc GFACIRC1:def 44 :
for b1, b2, b3 being set holds GFA3CarryCirc b1,b2,b3 = (GFA3CarryICirc b1,b2,b3) +* (1GateCircuit [<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ],nor3 );

definition
let c1, c2, c3 be set ;
func GFA3CarryOutput c1,c2,c3 -> Element of InnerVertices (GFA3CarryStr a1,a2,a3) equals :: GFACIRC1:def 45
[<*[<*a1,a2*>,and2b ],[<*a2,a3*>,and2b ],[<*a3,a1*>,and2b ]*>,nor3 ];
coherence
[<*[<*c1,c2*>,and2b ],[<*c2,c3*>,and2b ],[<*c3,c1*>,and2b ]*>,nor3 ] is Element of InnerVertices (GFA3CarryStr c1,c2,c3)
proof end;
end;

:: deftheorem Def45 defines GFA3CarryOutput GFACIRC1:def 45 :
for b1, b2, b3 being set holds GFA3CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]*>,nor3 ];

theorem Th123: :: GFACIRC1:123
for b1, b2, b3 being set holds InnerVertices (GFA3CarryIStr b1,b2,b3) = {[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]}
proof end;

theorem Th124: :: GFACIRC1:124
for b1, b2, b3 being set holds InnerVertices (GFA3CarryStr b1,b2,b3) = {[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]} \/ {(GFA3CarryOutput b1,b2,b3)}
proof end;

theorem Th125: :: GFACIRC1:125
for b1, b2, b3 being set holds InnerVertices (GFA3CarryStr b1,b2,b3) is Relation
proof end;

theorem Th126: :: GFACIRC1:126
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
InputVertices (GFA3CarryIStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th127: :: GFACIRC1:127
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
InputVertices (GFA3CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th128: :: GFACIRC1:128
for b1, b2, b3 being non pair set holds not InputVertices (GFA3CarryStr b1,b2,b3) is with_pair
proof end;

theorem Th129: :: GFACIRC1:129
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA3CarryStr b1,b2,b3) & b2 in the carrier of (GFA3CarryStr b1,b2,b3) & b3 in the carrier of (GFA3CarryStr b1,b2,b3) & [<*b1,b2*>,and2b ] in the carrier of (GFA3CarryStr b1,b2,b3) & [<*b2,b3*>,and2b ] in the carrier of (GFA3CarryStr b1,b2,b3) & [<*b3,b1*>,and2b ] in the carrier of (GFA3CarryStr b1,b2,b3) & [<*[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]*>,nor3 ] in the carrier of (GFA3CarryStr b1,b2,b3) )
proof end;

theorem Th130: :: GFACIRC1:130
for b1, b2, b3 being set holds
( [<*b1,b2*>,and2b ] in InnerVertices (GFA3CarryStr b1,b2,b3) & [<*b2,b3*>,and2b ] in InnerVertices (GFA3CarryStr b1,b2,b3) & [<*b3,b1*>,and2b ] in InnerVertices (GFA3CarryStr b1,b2,b3) & GFA3CarryOutput b1,b2,b3 in InnerVertices (GFA3CarryStr b1,b2,b3) )
proof end;

theorem Th131: :: GFACIRC1:131
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
( b1 in InputVertices (GFA3CarryStr b1,b2,b3) & b2 in InputVertices (GFA3CarryStr b1,b2,b3) & b3 in InputVertices (GFA3CarryStr b1,b2,b3) )
proof end;

theorem Th132: :: GFACIRC1:132
for b1, b2, b3 being non pair set holds InputVertices (GFA3CarryStr b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th133: :: GFACIRC1:133
for b1, b2, b3 being set
for b4 being State of (GFA3CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,and2b ] = ('not' b5) '&' ('not' b6) & (Following b4) . [<*b2,b3*>,and2b ] = ('not' b6) '&' ('not' b7) & (Following b4) . [<*b3,b1*>,and2b ] = ('not' b7) '&' ('not' b5) )
proof end;

theorem Th134: :: GFACIRC1:134
for b1, b2, b3 being set
for b4 being State of (GFA3CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,and2b ] & b6 = b4 . [<*b2,b3*>,and2b ] & b7 = b4 . [<*b3,b1*>,and2b ] holds
(Following b4) . (GFA3CarryOutput b1,b2,b3) = 'not' ((b5 'or' b6) 'or' b7)
proof end;

theorem Th135: :: GFACIRC1:135
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
for b4 being State of (GFA3CarryCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA3CarryOutput b1,b2,b3) = 'not' (((('not' b5) '&' ('not' b6)) 'or' (('not' b6) '&' ('not' b7))) 'or' (('not' b7) '&' ('not' b5))) & (Following b4,2) . [<*b1,b2*>,and2b ] = ('not' b5) '&' ('not' b6) & (Following b4,2) . [<*b2,b3*>,and2b ] = ('not' b6) '&' ('not' b7) & (Following b4,2) . [<*b3,b1*>,and2b ] = ('not' b7) '&' ('not' b5) )
proof end;

theorem Th136: :: GFACIRC1:136
for b1, b2, b3 being set st b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
for b4 being State of (GFA3CarryCirc b1,b2,b3) holds Following b4,2 is stable
proof end;

definition
let c1, c2, c3 be set ;
func GFA3AdderStr c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 46
2GatesCircStr a1,a2,a3,xor2 ;
coherence
2GatesCircStr c1,c2,c3,xor2 is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def46 defines GFA3AdderStr GFACIRC1:def 46 :
for b1, b2, b3 being set holds GFA3AdderStr b1,b2,b3 = 2GatesCircStr b1,b2,b3,xor2 ;

definition
let c1, c2, c3 be set ;
func GFA3AdderCirc c1,c2,c3 -> strict gate`2=den Boolean Circuit of GFA3AdderStr a1,a2,a3 equals :: GFACIRC1:def 47
2GatesCircuit a1,a2,a3,xor2 ;
coherence
2GatesCircuit c1,c2,c3,xor2 is strict gate`2=den Boolean Circuit of GFA3AdderStr c1,c2,c3
;
end;

:: deftheorem Def47 defines GFA3AdderCirc GFACIRC1:def 47 :
for b1, b2, b3 being set holds GFA3AdderCirc b1,b2,b3 = 2GatesCircuit b1,b2,b3,xor2 ;

definition
let c1, c2, c3 be set ;
func GFA3AdderOutput c1,c2,c3 -> Element of InnerVertices (GFA3AdderStr a1,a2,a3) equals :: GFACIRC1:def 48
2GatesCircOutput a1,a2,a3,xor2 ;
coherence
2GatesCircOutput c1,c2,c3,xor2 is Element of InnerVertices (GFA3AdderStr c1,c2,c3)
;
end;

:: deftheorem Def48 defines GFA3AdderOutput GFACIRC1:def 48 :
for b1, b2, b3 being set holds GFA3AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2 ;

theorem Th137: :: GFACIRC1:137
for b1, b2, b3 being set holds InnerVertices (GFA3AdderStr b1,b2,b3) = {[<*b1,b2*>,xor2 ]} \/ {(GFA3AdderOutput b1,b2,b3)}
proof end;

theorem Th138: :: GFACIRC1:138
for b1, b2, b3 being set holds InnerVertices (GFA3AdderStr b1,b2,b3) is Relation by FACIRC_1:58;

theorem Th139: :: GFACIRC1:139
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
InputVertices (GFA3AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th140: :: GFACIRC1:140
for b1, b2, b3 being non pair set holds not InputVertices (GFA3AdderStr b1,b2,b3) is with_pair by FACIRC_1:59;

theorem Th141: :: GFACIRC1:141
for b1, b2, b3 being set holds
( b1 in the carrier of (GFA3AdderStr b1,b2,b3) & b2 in the carrier of (GFA3AdderStr b1,b2,b3) & b3 in the carrier of (GFA3AdderStr b1,b2,b3) & [<*b1,b2*>,xor2 ] in the carrier of (GFA3AdderStr b1,b2,b3) & [<*[<*b1,b2*>,xor2 ],b3*>,xor2 ] in the carrier of (GFA3AdderStr b1,b2,b3) ) by FACIRC_1:60, FACIRC_1:61;

theorem Th142: :: GFACIRC1:142
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2 ] in InnerVertices (GFA3AdderStr b1,b2,b3) & GFA3AdderOutput b1,b2,b3 in InnerVertices (GFA3AdderStr b1,b2,b3) )
proof end;

theorem Th143: :: GFACIRC1:143
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
( b1 in InputVertices (GFA3AdderStr b1,b2,b3) & b2 in InputVertices (GFA3AdderStr b1,b2,b3) & b3 in InputVertices (GFA3AdderStr b1,b2,b3) )
proof end;

theorem Th144: :: GFACIRC1:144
for b1, b2, b3 being non pair set holds InputVertices (GFA3AdderStr b1,b2,b3) = {b1,b2,b3} by FACIRC_1:57;

theorem Th145: :: GFACIRC1:145
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA3AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4) . [<*b1,b2*>,xor2 ] = b5 'xor' b6 & (Following b4) . b1 = b5 & (Following b4) . b2 = b6 & (Following b4) . b3 = b7 )
proof end;

theorem Th146: :: GFACIRC1:146
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA3AdderCirc b1,b2,b3)
for b5, b6, b7, b8 being Element of BOOLEAN st b5 = b4 . [<*b1,b2*>,xor2 ] & b6 = b4 . b1 & b7 = b4 . b2 & b8 = b4 . b3 holds
(Following b4) . (GFA3AdderOutput b1,b2,b3) = b5 'xor' b8
proof end;

theorem Th147: :: GFACIRC1:147
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA3AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA3AdderOutput b1,b2,b3) = (b5 'xor' b6) 'xor' b7 & (Following b4,2) . [<*b1,b2*>,xor2 ] = b5 'xor' b6 & (Following b4,2) . b1 = b5 & (Following b4,2) . b2 = b6 & (Following b4,2) . b3 = b7 )
proof end;

theorem Th148: :: GFACIRC1:148
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA3AdderCirc b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
(Following b4,2) . (GFA3AdderOutput b1,b2,b3) = 'not' ((('not' b5) 'xor' ('not' b6)) 'xor' ('not' b7))
proof end;

theorem Th149: :: GFACIRC1:149
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] holds
for b4 being State of (GFA3AdderCirc b1,b2,b3) holds Following b4,2 is stable by FACIRC_1:63;

definition
let c1, c2, c3 be set ;
func BitGFA3Str c1,c2,c3 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: GFACIRC1:def 49
(GFA3AdderStr a1,a2,a3) +* (GFA3CarryStr a1,a2,a3);
coherence
(GFA3AdderStr c1,c2,c3) +* (GFA3CarryStr c1,c2,c3) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;

:: deftheorem Def49 defines BitGFA3Str GFACIRC1:def 49 :
for b1, b2, b3 being set holds BitGFA3Str b1,b2,b3 = (GFA3AdderStr b1,b2,b3) +* (GFA3CarryStr b1,b2,b3);

definition
let c1, c2, c3 be set ;
func BitGFA3Circ c1,c2,c3 -> strict gate`2=den Boolean Circuit of BitGFA3Str a1,a2,a3 equals :: GFACIRC1:def 50
(GFA3AdderCirc a1,a2,a3) +* (GFA3CarryCirc a1,a2,a3);
coherence
(GFA3AdderCirc c1,c2,c3) +* (GFA3CarryCirc c1,c2,c3) is strict gate`2=den Boolean Circuit of BitGFA3Str c1,c2,c3
;
end;

:: deftheorem Def50 defines BitGFA3Circ GFACIRC1:def 50 :
for b1, b2, b3 being set holds BitGFA3Circ b1,b2,b3 = (GFA3AdderCirc b1,b2,b3) +* (GFA3CarryCirc b1,b2,b3);

theorem Th150: :: GFACIRC1:150
for b1, b2, b3 being set holds InnerVertices (BitGFA3Str b1,b2,b3) = (({[<*b1,b2*>,xor2 ]} \/ {(GFA3AdderOutput b1,b2,b3)}) \/ {[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]}) \/ {(GFA3CarryOutput b1,b2,b3)}
proof end;

theorem Th151: :: GFACIRC1:151
for b1, b2, b3 being set holds InnerVertices (BitGFA3Str b1,b2,b3) is Relation
proof end;

theorem Th152: :: GFACIRC1:152
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
InputVertices (BitGFA3Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th153: :: GFACIRC1:153
for b1, b2, b3 being non pair set holds InputVertices (BitGFA3Str b1,b2,b3) = {b1,b2,b3}
proof end;

theorem Th154: :: GFACIRC1:154
for b1, b2, b3 being non pair set holds not InputVertices (BitGFA3Str b1,b2,b3) is with_pair
proof end;

theorem Th155: :: GFACIRC1:155
for b1, b2, b3 being set holds
( b1 in the carrier of (BitGFA3Str b1,b2,b3) & b2 in the carrier of (BitGFA3Str b1,b2,b3) & b3 in the carrier of (BitGFA3Str b1,b2,b3) & [<*b1,b2*>,xor2 ] in the carrier of (BitGFA3Str b1,b2,b3) & [<*[<*b1,b2*>,xor2 ],b3*>,xor2 ] in the carrier of (BitGFA3Str b1,b2,b3) & [<*b1,b2*>,and2b ] in the carrier of (BitGFA3Str b1,b2,b3) & [<*b2,b3*>,and2b ] in the carrier of (BitGFA3Str b1,b2,b3) & [<*b3,b1*>,and2b ] in the carrier of (BitGFA3Str b1,b2,b3) & [<*[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]*>,nor3 ] in the carrier of (BitGFA3Str b1,b2,b3) )
proof end;

theorem Th156: :: GFACIRC1:156
for b1, b2, b3 being set holds
( [<*b1,b2*>,xor2 ] in InnerVertices (BitGFA3Str b1,b2,b3) & GFA3AdderOutput b1,b2,b3 in InnerVertices (BitGFA3Str b1,b2,b3) & [<*b1,b2*>,and2b ] in InnerVertices (BitGFA3Str b1,b2,b3) & [<*b2,b3*>,and2b ] in InnerVertices (BitGFA3Str b1,b2,b3) & [<*b3,b1*>,and2b ] in InnerVertices (BitGFA3Str b1,b2,b3) & GFA3CarryOutput b1,b2,b3 in InnerVertices (BitGFA3Str b1,b2,b3) )
proof end;

theorem Th157: :: GFACIRC1:157
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
( b1 in InputVertices (BitGFA3Str b1,b2,b3) & b2 in InputVertices (BitGFA3Str b1,b2,b3) & b3 in InputVertices (BitGFA3Str b1,b2,b3) )
proof end;

definition
let c1, c2, c3 be set ;
func BitGFA3CarryOutput c1,c2,c3 -> Element of InnerVertices (BitGFA3Str a1,a2,a3) equals :: GFACIRC1:def 51
[<*[<*a1,a2*>,and2b ],[<*a2,a3*>,and2b ],[<*a3,a1*>,and2b ]*>,nor3 ];
coherence
[<*[<*c1,c2*>,and2b ],[<*c2,c3*>,and2b ],[<*c3,c1*>,and2b ]*>,nor3 ] is Element of InnerVertices (BitGFA3Str c1,c2,c3)
proof end;
end;

:: deftheorem Def51 defines BitGFA3CarryOutput GFACIRC1:def 51 :
for b1, b2, b3 being set holds BitGFA3CarryOutput b1,b2,b3 = [<*[<*b1,b2*>,and2b ],[<*b2,b3*>,and2b ],[<*b3,b1*>,and2b ]*>,nor3 ];

definition
let c1, c2, c3 be set ;
func BitGFA3AdderOutput c1,c2,c3 -> Element of InnerVertices (BitGFA3Str a1,a2,a3) equals :: GFACIRC1:def 52
2GatesCircOutput a1,a2,a3,xor2 ;
coherence
2GatesCircOutput c1,c2,c3,xor2 is Element of InnerVertices (BitGFA3Str c1,c2,c3)
proof end;
end;

:: deftheorem Def52 defines BitGFA3AdderOutput GFACIRC1:def 52 :
for b1, b2, b3 being set holds BitGFA3AdderOutput b1,b2,b3 = 2GatesCircOutput b1,b2,b3,xor2 ;

theorem Th158: :: GFACIRC1:158
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
for b4 being State of (BitGFA3Circ b1,b2,b3)
for b5, b6, b7 being Element of BOOLEAN st b5 = b4 . b1 & b6 = b4 . b2 & b7 = b4 . b3 holds
( (Following b4,2) . (GFA3AdderOutput b1,b2,b3) = 'not' ((('not' b5) 'xor' ('not' b6)) 'xor' ('not' b7)) & (Following b4,2) . (GFA3CarryOutput b1,b2,b3) = 'not' (((('not' b5) '&' ('not' b6)) 'or' (('not' b6) '&' ('not' b7))) 'or' (('not' b7) '&' ('not' b5))) )
proof end;

theorem Th159: :: GFACIRC1:159
for b1, b2, b3 being set st b3 <> [<*b1,b2*>,xor2 ] & b1 <> [<*b2,b3*>,and2b ] & b2 <> [<*b3,b1*>,and2b ] & b3 <> [<*b1,b2*>,and2b ] holds
for b4 being State of (BitGFA3Circ b1,b2,b3) holds Following b4,2 is stable
proof end;