:: TWOSCOMP semantic presentation

definition
let c1 be non empty non void unsplit ManySortedSign ;
let c2 be Boolean Circuit of c1;
let c3 be State of c2;
let c4 be Vertex of c1;
redefine func . as c3 . c4 -> Element of BOOLEAN ;
coherence
c3 . c4 is Element of BOOLEAN
proof end;
end;

deffunc H1( Element of BOOLEAN , Element of BOOLEAN ) -> Element of BOOLEAN = a1 '&' a2;

definition
func and2 -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def1: :: TWOSCOMP:def 1
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = b1 '&' 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 '&' 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 '&' b4 ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = b3 '&' b4 ) holds
b1 = b2
proof end;
func and2a -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def2: :: TWOSCOMP:def 2
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = ('not' b1) '&' b2;
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) '&' 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*> = ('not' b3) '&' b4 ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = ('not' b3) '&' b4 ) holds
b1 = b2
proof end;
func and2b -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def3: :: TWOSCOMP:def 3
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = ('not' 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*> = ('not' 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*> = ('not' b3) '&' ('not' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = ('not' b3) '&' ('not' b4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines and2 TWOSCOMP:def 1 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = and2 iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 '&' b3 );

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

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

definition
func nand2 -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def4: :: TWOSCOMP:def 4
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = 'not' (b1 '&' b2);
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (b2 '&' 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*> = 'not' (b3 '&' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = 'not' (b3 '&' b4) ) holds
b1 = b2
proof end;
func nand2a -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def5: :: TWOSCOMP:def 5
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = 'not' (('not' b1) '&' b2);
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (('not' b2) '&' 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*> = 'not' (('not' b3) '&' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = 'not' (('not' b3) '&' b4) ) holds
b1 = b2
proof end;
func nand2b -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def6: :: TWOSCOMP:def 6
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = 'not' (('not' 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*> = 'not' (('not' 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*> = 'not' (('not' b3) '&' ('not' b4)) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = 'not' (('not' b3) '&' ('not' b4)) ) holds
b1 = b2
proof end;
end;

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

:: deftheorem Def5 defines nand2a TWOSCOMP:def 5 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nand2a iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (('not' b2) '&' b3) );

:: deftheorem Def6 defines nand2b TWOSCOMP:def 6 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nand2b iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (('not' b2) '&' ('not' b3)) );

definition
func or2 -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def7: :: TWOSCOMP:def 7
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = b1 'or' 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 'or' 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 'or' b4 ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = b3 'or' b4 ) holds
b1 = b2
proof end;
func or2a -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def8: :: TWOSCOMP:def 8
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = ('not' b1) 'or' b2;
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) 'or' 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*> = ('not' b3) 'or' b4 ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = ('not' b3) 'or' b4 ) holds
b1 = b2
proof end;
func or2b -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def9: :: TWOSCOMP:def 9
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = ('not' b1) 'or' ('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*> = ('not' b2) 'or' ('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*> = ('not' b3) 'or' ('not' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = ('not' b3) 'or' ('not' b4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines or2 TWOSCOMP:def 7 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or2 iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 'or' b3 );

:: deftheorem Def8 defines or2a TWOSCOMP:def 8 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or2a iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) 'or' b3 );

:: deftheorem Def9 defines or2b TWOSCOMP:def 9 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or2b iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) 'or' ('not' b3) );

definition
func nor2 -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def10: :: TWOSCOMP:def 10
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = 'not' (b1 'or' b2);
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (b2 'or' 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*> = 'not' (b3 'or' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = 'not' (b3 'or' b4) ) holds
b1 = b2
proof end;
func nor2a -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def11: :: TWOSCOMP:def 11
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = 'not' (('not' b1) 'or' b2);
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (('not' b2) 'or' 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*> = 'not' (('not' b3) 'or' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = 'not' (('not' b3) 'or' b4) ) holds
b1 = b2
proof end;
func nor2b -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def12: :: TWOSCOMP:def 12
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = 'not' (('not' b1) 'or' ('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*> = 'not' (('not' b2) 'or' ('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*> = 'not' (('not' b3) 'or' ('not' b4)) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = 'not' (('not' b3) 'or' ('not' b4)) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def10 defines nor2 TWOSCOMP:def 10 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor2 iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (b2 'or' b3) );

:: deftheorem Def11 defines nor2a TWOSCOMP:def 11 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor2a iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (('not' b2) 'or' b3) );

:: deftheorem Def12 defines nor2b TWOSCOMP:def 12 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor2b iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = 'not' (('not' b2) 'or' ('not' b3)) );

definition
func xor2 -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def13: :: TWOSCOMP:def 13
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = b1 'xor' 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' 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' b4 ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = b3 'xor' b4 ) holds
b1 = b2
proof end;
func xor2a -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def14: :: TWOSCOMP:def 14
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = ('not' b1) 'xor' b2;
existence
ex b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) 'xor' 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*> = ('not' b3) 'xor' b4 ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = ('not' b3) 'xor' b4 ) holds
b1 = b2
proof end;
func xor2b -> Function of 2 -tuples_on BOOLEAN , BOOLEAN means :Def15: :: TWOSCOMP:def 15
for b1, b2 being Element of BOOLEAN holds a1 . <*b1,b2*> = ('not' 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*> = ('not' 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*> = ('not' b3) 'xor' ('not' b4) ) & ( for b3, b4 being Element of BOOLEAN holds b2 . <*b3,b4*> = ('not' b3) 'xor' ('not' b4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines xor2 TWOSCOMP:def 13 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = xor2 iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = b2 'xor' b3 );

:: deftheorem Def14 defines xor2a TWOSCOMP:def 14 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = xor2a iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) 'xor' b3 );

:: deftheorem Def15 defines xor2b TWOSCOMP:def 15 :
for b1 being Function of 2 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = xor2b iff for b2, b3 being Element of BOOLEAN holds b1 . <*b2,b3*> = ('not' b2) 'xor' ('not' b3) );

theorem Th1: :: TWOSCOMP:1
canceled;

theorem Th2: :: TWOSCOMP:2
canceled;

theorem Th3: :: TWOSCOMP:3
for b1, b2 being Element of BOOLEAN holds
( and2 . <*b1,b2*> = b1 '&' b2 & and2a . <*b1,b2*> = ('not' b1) '&' b2 & and2b . <*b1,b2*> = ('not' b1) '&' ('not' b2) ) by Def1, Def2, Def3;

theorem Th4: :: TWOSCOMP:4
for b1, b2 being Element of BOOLEAN holds
( nand2 . <*b1,b2*> = 'not' (b1 '&' b2) & nand2a . <*b1,b2*> = 'not' (('not' b1) '&' b2) & nand2b . <*b1,b2*> = 'not' (('not' b1) '&' ('not' b2)) ) by Def4, Def5, Def6;

theorem Th5: :: TWOSCOMP:5
for b1, b2 being Element of BOOLEAN holds
( or2 . <*b1,b2*> = b1 'or' b2 & or2a . <*b1,b2*> = ('not' b1) 'or' b2 & or2b . <*b1,b2*> = ('not' b1) 'or' ('not' b2) ) by Def7, Def8, Def9;

theorem Th6: :: TWOSCOMP:6
for b1, b2 being Element of BOOLEAN holds
( nor2 . <*b1,b2*> = 'not' (b1 'or' b2) & nor2a . <*b1,b2*> = 'not' (('not' b1) 'or' b2) & nor2b . <*b1,b2*> = 'not' (('not' b1) 'or' ('not' b2)) ) by Def10, Def11, Def12;

theorem Th7: :: TWOSCOMP:7
for b1, b2 being Element of BOOLEAN holds
( xor2 . <*b1,b2*> = b1 'xor' b2 & xor2a . <*b1,b2*> = ('not' b1) 'xor' b2 & xor2b . <*b1,b2*> = ('not' b1) 'xor' ('not' b2) ) by Def13, Def14, Def15;

theorem Th8: :: TWOSCOMP:8
for b1, b2 being Element of BOOLEAN holds
( and2 . <*b1,b2*> = nor2b . <*b1,b2*> & and2a . <*b1,b2*> = nor2a . <*b2,b1*> & and2b . <*b1,b2*> = nor2 . <*b1,b2*> )
proof end;

theorem Th9: :: TWOSCOMP:9
for b1, b2 being Element of BOOLEAN holds
( or2 . <*b1,b2*> = nand2b . <*b1,b2*> & or2a . <*b1,b2*> = nand2a . <*b2,b1*> & or2b . <*b1,b2*> = nand2 . <*b1,b2*> )
proof end;

theorem Th10: :: TWOSCOMP:10
for b1, b2 being Element of BOOLEAN holds xor2b . <*b1,b2*> = xor2 . <*b1,b2*>
proof end;

theorem Th11: :: TWOSCOMP:11
( and2 . <*0,0*> = 0 & and2 . <*0,1*> = 0 & and2 . <*1,0*> = 0 & and2 . <*1,1*> = 1 & and2a . <*0,0*> = 0 & and2a . <*0,1*> = 1 & and2a . <*1,0*> = 0 & and2a . <*1,1*> = 0 & and2b . <*0,0*> = 1 & and2b . <*0,1*> = 0 & and2b . <*1,0*> = 0 & and2b . <*1,1*> = 0 )
proof end;

theorem Th12: :: TWOSCOMP:12
( or2 . <*0,0*> = 0 & or2 . <*0,1*> = 1 & or2 . <*1,0*> = 1 & or2 . <*1,1*> = 1 & or2a . <*0,0*> = 1 & or2a . <*0,1*> = 1 & or2a . <*1,0*> = 0 & or2a . <*1,1*> = 1 & or2b . <*0,0*> = 1 & or2b . <*0,1*> = 1 & or2b . <*1,0*> = 1 & or2b . <*1,1*> = 0 )
proof end;

theorem Th13: :: TWOSCOMP:13
( xor2 . <*0,0*> = 0 & xor2 . <*0,1*> = 1 & xor2 . <*1,0*> = 1 & xor2 . <*1,1*> = 0 & xor2a . <*0,0*> = 1 & xor2a . <*0,1*> = 0 & xor2a . <*1,0*> = 0 & xor2a . <*1,1*> = 1 )
proof end;

definition
func and3 -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def16: :: TWOSCOMP:def 16
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (b1 '&' b2) '&' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (b2 '&' b3) '&' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (b3 '&' b4) '&' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (b3 '&' b4) '&' b5 ) holds
b1 = b2
proof end;
func and3a -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def17: :: TWOSCOMP:def 17
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (('not' b1) '&' b2) '&' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) '&' b3) '&' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (('not' b3) '&' b4) '&' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (('not' b3) '&' b4) '&' b5 ) holds
b1 = b2
proof end;
func and3b -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def18: :: TWOSCOMP:def 18
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (('not' b1) '&' ('not' b2)) '&' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) '&' ('not' b3)) '&' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (('not' b3) '&' ('not' b4)) '&' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (('not' b3) '&' ('not' b4)) '&' b5 ) holds
b1 = b2
proof end;
func and3c -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def19: :: TWOSCOMP:def 19
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (('not' b1) '&' ('not' b2)) '&' ('not' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) '&' ('not' b3)) '&' ('not' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (('not' b3) '&' ('not' b4)) '&' ('not' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (('not' b3) '&' ('not' b4)) '&' ('not' b5) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def16 defines and3 TWOSCOMP:def 16 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = and3 iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (b2 '&' b3) '&' b4 );

:: deftheorem Def17 defines and3a TWOSCOMP:def 17 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = and3a iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) '&' b3) '&' b4 );

:: deftheorem Def18 defines and3b TWOSCOMP:def 18 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = and3b iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) '&' ('not' b3)) '&' b4 );

:: deftheorem Def19 defines and3c TWOSCOMP:def 19 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = and3c iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) '&' ('not' b3)) '&' ('not' b4) );

definition
func nand3 -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def20: :: TWOSCOMP:def 20
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((b1 '&' b2) '&' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((b2 '&' b3) '&' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((b3 '&' b4) '&' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((b3 '&' b4) '&' b5) ) holds
b1 = b2
proof end;
func nand3a -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def21: :: TWOSCOMP:def 21
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((('not' b1) '&' b2) '&' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) '&' b3) '&' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((('not' b3) '&' b4) '&' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((('not' b3) '&' b4) '&' b5) ) holds
b1 = b2
proof end;
func nand3b -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def22: :: TWOSCOMP:def 22
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((('not' b1) '&' ('not' b2)) '&' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) '&' ('not' b3)) '&' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((('not' b3) '&' ('not' b4)) '&' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((('not' b3) '&' ('not' b4)) '&' b5) ) holds
b1 = b2
proof end;
func nand3c -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def23: :: TWOSCOMP:def 23
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((('not' b1) '&' ('not' b2)) '&' ('not' b3));
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) '&' ('not' b3)) '&' ('not' b4))
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((('not' b3) '&' ('not' b4)) '&' ('not' b5)) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((('not' b3) '&' ('not' b4)) '&' ('not' b5)) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 defines nand3 TWOSCOMP:def 20 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nand3 iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((b2 '&' b3) '&' b4) );

:: deftheorem Def21 defines nand3a TWOSCOMP:def 21 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nand3a iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) '&' b3) '&' b4) );

:: deftheorem Def22 defines nand3b TWOSCOMP:def 22 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nand3b iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) '&' ('not' b3)) '&' b4) );

:: deftheorem Def23 defines nand3c TWOSCOMP:def 23 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nand3c iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) '&' ('not' b3)) '&' ('not' b4)) );

definition
func or3 -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def24: :: TWOSCOMP:def 24
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (b1 'or' b2) 'or' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (b2 'or' b3) 'or' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (b3 'or' b4) 'or' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (b3 'or' b4) 'or' b5 ) holds
b1 = b2
proof end;
func or3a -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def25: :: TWOSCOMP:def 25
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (('not' b1) 'or' b2) 'or' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) 'or' b3) 'or' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (('not' b3) 'or' b4) 'or' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (('not' b3) 'or' b4) 'or' b5 ) holds
b1 = b2
proof end;
func or3b -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def26: :: TWOSCOMP:def 26
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (('not' b1) 'or' ('not' b2)) 'or' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) 'or' ('not' b3)) 'or' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (('not' b3) 'or' ('not' b4)) 'or' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (('not' b3) 'or' ('not' b4)) 'or' b5 ) holds
b1 = b2
proof end;
func or3c -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def27: :: TWOSCOMP:def 27
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (('not' b1) 'or' ('not' b2)) 'or' ('not' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) 'or' ('not' b3)) 'or' ('not' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (('not' b3) 'or' ('not' b4)) 'or' ('not' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (('not' b3) 'or' ('not' b4)) 'or' ('not' b5) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def24 defines or3 TWOSCOMP:def 24 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or3 iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (b2 'or' b3) 'or' b4 );

:: deftheorem Def25 defines or3a TWOSCOMP:def 25 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or3a iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) 'or' b3) 'or' b4 );

:: deftheorem Def26 defines or3b TWOSCOMP:def 26 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or3b iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) 'or' ('not' b3)) 'or' b4 );

:: deftheorem Def27 defines or3c TWOSCOMP:def 27 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = or3c iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (('not' b2) 'or' ('not' b3)) 'or' ('not' b4) );

definition
func nor3 -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def28: :: TWOSCOMP:def 28
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((b1 'or' b2) 'or' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((b2 'or' b3) 'or' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((b3 'or' b4) 'or' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((b3 'or' b4) 'or' b5) ) holds
b1 = b2
proof end;
func nor3a -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def29: :: TWOSCOMP:def 29
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' b2) 'or' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) 'or' b3) 'or' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((('not' b3) 'or' b4) 'or' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((('not' b3) 'or' b4) 'or' b5) ) holds
b1 = b2
proof end;
func nor3b -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def30: :: TWOSCOMP:def 30
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' ('not' b2)) 'or' b3);
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) 'or' ('not' b3)) 'or' b4)
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((('not' b3) 'or' ('not' b4)) 'or' b5) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((('not' b3) 'or' ('not' b4)) 'or' b5) ) holds
b1 = b2
proof end;
func nor3c -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def31: :: TWOSCOMP:def 31
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' ('not' b2)) 'or' ('not' b3));
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) 'or' ('not' b3)) 'or' ('not' b4))
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = 'not' ((('not' b3) 'or' ('not' b4)) 'or' ('not' b5)) ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = 'not' ((('not' b3) 'or' ('not' b4)) 'or' ('not' b5)) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def28 defines nor3 TWOSCOMP:def 28 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor3 iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((b2 'or' b3) 'or' b4) );

:: deftheorem Def29 defines nor3a TWOSCOMP:def 29 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor3a iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) 'or' b3) 'or' b4) );

:: deftheorem Def30 defines nor3b TWOSCOMP:def 30 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor3b iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) 'or' ('not' b3)) 'or' b4) );

:: deftheorem Def31 defines nor3c TWOSCOMP:def 31 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = nor3c iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = 'not' ((('not' b2) 'or' ('not' b3)) 'or' ('not' b4)) );

definition
func xor3 -> Function of 3 -tuples_on BOOLEAN , BOOLEAN means :Def32: :: TWOSCOMP:def 32
for b1, b2, b3 being Element of BOOLEAN holds a1 . <*b1,b2,b3*> = (b1 'xor' b2) 'xor' b3;
existence
ex b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st
for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (b2 'xor' b3) 'xor' b4
proof end;
uniqueness
for b1, b2 being Function of 3 -tuples_on BOOLEAN , BOOLEAN st ( for b3, b4, b5 being Element of BOOLEAN holds b1 . <*b3,b4,b5*> = (b3 'xor' b4) 'xor' b5 ) & ( for b3, b4, b5 being Element of BOOLEAN holds b2 . <*b3,b4,b5*> = (b3 'xor' b4) 'xor' b5 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def32 defines xor3 TWOSCOMP:def 32 :
for b1 being Function of 3 -tuples_on BOOLEAN , BOOLEAN holds
( b1 = xor3 iff for b2, b3, b4 being Element of BOOLEAN holds b1 . <*b2,b3,b4*> = (b2 'xor' b3) 'xor' b4 );

theorem Th14: :: TWOSCOMP:14
for b1, b2, b3 being Element of BOOLEAN holds
( and3 . <*b1,b2,b3*> = (b1 '&' b2) '&' b3 & and3a . <*b1,b2,b3*> = (('not' b1) '&' b2) '&' b3 & and3b . <*b1,b2,b3*> = (('not' b1) '&' ('not' b2)) '&' b3 & and3c . <*b1,b2,b3*> = (('not' b1) '&' ('not' b2)) '&' ('not' b3) ) by Def16, Def17, Def18, Def19;

theorem Th15: :: TWOSCOMP:15
for b1, b2, b3 being Element of BOOLEAN holds
( nand3 . <*b1,b2,b3*> = 'not' ((b1 '&' b2) '&' b3) & nand3a . <*b1,b2,b3*> = 'not' ((('not' b1) '&' b2) '&' b3) & nand3b . <*b1,b2,b3*> = 'not' ((('not' b1) '&' ('not' b2)) '&' b3) & nand3c . <*b1,b2,b3*> = 'not' ((('not' b1) '&' ('not' b2)) '&' ('not' b3)) ) by Def20, Def21, Def22, Def23;

theorem Th16: :: TWOSCOMP:16
for b1, b2, b3 being Element of BOOLEAN holds
( or3 . <*b1,b2,b3*> = (b1 'or' b2) 'or' b3 & or3a . <*b1,b2,b3*> = (('not' b1) 'or' b2) 'or' b3 & or3b . <*b1,b2,b3*> = (('not' b1) 'or' ('not' b2)) 'or' b3 & or3c . <*b1,b2,b3*> = (('not' b1) 'or' ('not' b2)) 'or' ('not' b3) ) by Def24, Def25, Def26, Def27;

theorem Th17: :: TWOSCOMP:17
for b1, b2, b3 being Element of BOOLEAN holds
( nor3 . <*b1,b2,b3*> = 'not' ((b1 'or' b2) 'or' b3) & nor3a . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' b2) 'or' b3) & nor3b . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' ('not' b2)) 'or' b3) & nor3c . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' ('not' b2)) 'or' ('not' b3)) ) by Def28, Def29, Def30, Def31;

theorem Th18: :: TWOSCOMP:18
canceled;

theorem Th19: :: TWOSCOMP:19
for b1, b2, b3 being Element of BOOLEAN holds
( and3 . <*b1,b2,b3*> = nor3c . <*b1,b2,b3*> & and3a . <*b1,b2,b3*> = nor3b . <*b3,b2,b1*> & and3b . <*b1,b2,b3*> = nor3a . <*b3,b2,b1*> & and3c . <*b1,b2,b3*> = nor3 . <*b1,b2,b3*> )
proof end;

theorem Th20: :: TWOSCOMP:20
for b1, b2, b3 being Element of BOOLEAN holds
( or3 . <*b1,b2,b3*> = nand3c . <*b1,b2,b3*> & or3a . <*b1,b2,b3*> = nand3b . <*b3,b2,b1*> & or3b . <*b1,b2,b3*> = nand3a . <*b3,b2,b1*> & or3c . <*b1,b2,b3*> = nand3 . <*b1,b2,b3*> )
proof end;

theorem Th21: :: TWOSCOMP:21
( and3 . <*0,0,0*> = 0 & and3 . <*0,0,1*> = 0 & and3 . <*0,1,0*> = 0 & and3 . <*0,1,1*> = 0 & and3 . <*1,0,0*> = 0 & and3 . <*1,0,1*> = 0 & and3 . <*1,1,0*> = 0 & and3 . <*1,1,1*> = 1 )
proof end;

theorem Th22: :: TWOSCOMP:22
( and3a . <*0,0,0*> = 0 & and3a . <*0,0,1*> = 0 & and3a . <*0,1,0*> = 0 & and3a . <*0,1,1*> = 1 & and3a . <*1,0,0*> = 0 & and3a . <*1,0,1*> = 0 & and3a . <*1,1,0*> = 0 & and3a . <*1,1,1*> = 0 )
proof end;

theorem Th23: :: TWOSCOMP:23
( and3b . <*0,0,0*> = 0 & and3b . <*0,0,1*> = 1 & and3b . <*0,1,0*> = 0 & and3b . <*0,1,1*> = 0 & and3b . <*1,0,0*> = 0 & and3b . <*1,0,1*> = 0 & and3b . <*1,1,0*> = 0 & and3b . <*1,1,1*> = 0 )
proof end;

theorem Th24: :: TWOSCOMP:24
( and3c . <*0,0,0*> = 1 & and3c . <*0,0,1*> = 0 & and3c . <*0,1,0*> = 0 & and3c . <*0,1,1*> = 0 & and3c . <*1,0,0*> = 0 & and3c . <*1,0,1*> = 0 & and3c . <*1,1,0*> = 0 & and3c . <*1,1,1*> = 0 )
proof end;

theorem Th25: :: TWOSCOMP:25
( or3 . <*0,0,0*> = 0 & or3 . <*0,0,1*> = 1 & or3 . <*0,1,0*> = 1 & or3 . <*0,1,1*> = 1 & or3 . <*1,0,0*> = 1 & or3 . <*1,0,1*> = 1 & or3 . <*1,1,0*> = 1 & or3 . <*1,1,1*> = 1 )
proof end;

theorem Th26: :: TWOSCOMP:26
( or3a . <*0,0,0*> = 1 & or3a . <*0,0,1*> = 1 & or3a . <*0,1,0*> = 1 & or3a . <*0,1,1*> = 1 & or3a . <*1,0,0*> = 0 & or3a . <*1,0,1*> = 1 & or3a . <*1,1,0*> = 1 & or3a . <*1,1,1*> = 1 )
proof end;

theorem Th27: :: TWOSCOMP:27
( or3b . <*0,0,0*> = 1 & or3b . <*0,0,1*> = 1 & or3b . <*0,1,0*> = 1 & or3b . <*0,1,1*> = 1 & or3b . <*1,0,0*> = 1 & or3b . <*1,0,1*> = 1 & or3b . <*1,1,0*> = 0 & or3b . <*1,1,1*> = 1 )
proof end;

theorem Th28: :: TWOSCOMP:28
( or3c . <*0,0,0*> = 1 & or3c . <*0,0,1*> = 1 & or3c . <*0,1,0*> = 1 & or3c . <*0,1,1*> = 1 & or3c . <*1,0,0*> = 1 & or3c . <*1,0,1*> = 1 & or3c . <*1,1,0*> = 1 & or3c . <*1,1,1*> = 0 )
proof end;

theorem Th29: :: TWOSCOMP:29
( xor3 . <*0,0,0*> = 0 & xor3 . <*0,0,1*> = 1 & xor3 . <*0,1,0*> = 1 & xor3 . <*0,1,1*> = 0 & xor3 . <*1,0,0*> = 1 & xor3 . <*1,0,1*> = 0 & xor3 . <*1,1,0*> = 0 & xor3 . <*1,1,1*> = 1 )
proof end;

definition
let c1, c2 be set ;
func CompStr c1,c2 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: TWOSCOMP:def 33
1GateCircStr <*a1,a2*>,xor2a ;
correctness
coherence
1GateCircStr <*c1,c2*>,xor2a is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
;
end;

:: deftheorem Def33 defines CompStr TWOSCOMP:def 33 :
for b1, b2 being set holds CompStr b1,b2 = 1GateCircStr <*b1,b2*>,xor2a ;

definition
let c1, c2 be set ;
func CompCirc c1,c2 -> strict gate`2=den Boolean Circuit of CompStr a1,a2 equals :: TWOSCOMP:def 34
1GateCircuit a1,a2,xor2a ;
coherence
1GateCircuit c1,c2,xor2a is strict gate`2=den Boolean Circuit of CompStr c1,c2
;
end;

:: deftheorem Def34 defines CompCirc TWOSCOMP:def 34 :
for b1, b2 being set holds CompCirc b1,b2 = 1GateCircuit b1,b2,xor2a ;

definition
let c1, c2 be set ;
func CompOutput c1,c2 -> Element of InnerVertices (CompStr a1,a2) equals :: TWOSCOMP:def 35
[<*a1,a2*>,xor2a ];
coherence
[<*c1,c2*>,xor2a ] is Element of InnerVertices (CompStr c1,c2)
by FACIRC_1:47;
end;

:: deftheorem Def35 defines CompOutput TWOSCOMP:def 35 :
for b1, b2 being set holds CompOutput b1,b2 = [<*b1,b2*>,xor2a ];

definition
let c1, c2 be set ;
func IncrementStr c1,c2 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: TWOSCOMP:def 36
1GateCircStr <*a1,a2*>,and2a ;
correctness
coherence
1GateCircStr <*c1,c2*>,and2a is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
;
end;

:: deftheorem Def36 defines IncrementStr TWOSCOMP:def 36 :
for b1, b2 being set holds IncrementStr b1,b2 = 1GateCircStr <*b1,b2*>,and2a ;

definition
let c1, c2 be set ;
func IncrementCirc c1,c2 -> strict gate`2=den Boolean Circuit of IncrementStr a1,a2 equals :: TWOSCOMP:def 37
1GateCircuit a1,a2,and2a ;
coherence
1GateCircuit c1,c2,and2a is strict gate`2=den Boolean Circuit of IncrementStr c1,c2
;
end;

:: deftheorem Def37 defines IncrementCirc TWOSCOMP:def 37 :
for b1, b2 being set holds IncrementCirc b1,b2 = 1GateCircuit b1,b2,and2a ;

definition
let c1, c2 be set ;
func IncrementOutput c1,c2 -> Element of InnerVertices (IncrementStr a1,a2) equals :: TWOSCOMP:def 38
[<*a1,a2*>,and2a ];
coherence
[<*c1,c2*>,and2a ] is Element of InnerVertices (IncrementStr c1,c2)
by FACIRC_1:47;
end;

:: deftheorem Def38 defines IncrementOutput TWOSCOMP:def 38 :
for b1, b2 being set holds IncrementOutput b1,b2 = [<*b1,b2*>,and2a ];

definition
let c1, c2 be set ;
func BitCompStr c1,c2 -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: TWOSCOMP:def 39
(CompStr a1,a2) +* (IncrementStr a1,a2);
correctness
coherence
(CompStr c1,c2) +* (IncrementStr c1,c2) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
;
end;

:: deftheorem Def39 defines BitCompStr TWOSCOMP:def 39 :
for b1, b2 being set holds BitCompStr b1,b2 = (CompStr b1,b2) +* (IncrementStr b1,b2);

definition
let c1, c2 be set ;
func BitCompCirc c1,c2 -> strict gate`2=den Boolean Circuit of BitCompStr a1,a2 equals :: TWOSCOMP:def 40
(CompCirc a1,a2) +* (IncrementCirc a1,a2);
coherence
(CompCirc c1,c2) +* (IncrementCirc c1,c2) is strict gate`2=den Boolean Circuit of BitCompStr c1,c2
;
end;

:: deftheorem Def40 defines BitCompCirc TWOSCOMP:def 40 :
for b1, b2 being set holds BitCompCirc b1,b2 = (CompCirc b1,b2) +* (IncrementCirc b1,b2);

theorem Th30: :: TWOSCOMP:30
for b1, b2 being non pair set holds InnerVertices (CompStr b1,b2) is Relation by FACIRC_1:38;

theorem Th31: :: TWOSCOMP:31
for b1, b2 being non pair set holds
( b1 in the carrier of (CompStr b1,b2) & b2 in the carrier of (CompStr b1,b2) & [<*b1,b2*>,xor2a ] in the carrier of (CompStr b1,b2) ) by FACIRC_1:43;

theorem Th32: :: TWOSCOMP:32
for b1, b2 being non pair set holds the carrier of (CompStr b1,b2) = {b1,b2} \/ {[<*b1,b2*>,xor2a ]}
proof end;

theorem Th33: :: TWOSCOMP:33
for b1, b2 being non pair set holds InnerVertices (CompStr b1,b2) = {[<*b1,b2*>,xor2a ]} by CIRCCOMB:49;

theorem Th34: :: TWOSCOMP:34
for b1, b2 being non pair set holds [<*b1,b2*>,xor2a ] in InnerVertices (CompStr b1,b2)
proof end;

theorem Th35: :: TWOSCOMP:35
for b1, b2 being non pair set holds InputVertices (CompStr b1,b2) = {b1,b2} by FACIRC_1:40;

theorem Th36: :: TWOSCOMP:36
for b1, b2 being non pair set holds
( b1 in InputVertices (CompStr b1,b2) & b2 in InputVertices (CompStr b1,b2) )
proof end;

theorem Th37: :: TWOSCOMP:37
for b1, b2 being non pair set holds not InputVertices (CompStr b1,b2) is with_pair
proof end;

theorem Th38: :: TWOSCOMP:38
for b1, b2 being non pair set holds InnerVertices (IncrementStr b1,b2) is Relation by FACIRC_1:38;

theorem Th39: :: TWOSCOMP:39
for b1, b2 being non pair set holds
( b1 in the carrier of (IncrementStr b1,b2) & b2 in the carrier of (IncrementStr b1,b2) & [<*b1,b2*>,and2a ] in the carrier of (IncrementStr b1,b2) ) by FACIRC_1:43;

theorem Th40: :: TWOSCOMP:40
for b1, b2 being non pair set holds the carrier of (IncrementStr b1,b2) = {b1,b2} \/ {[<*b1,b2*>,and2a ]}
proof end;

theorem Th41: :: TWOSCOMP:41
for b1, b2 being non pair set holds InnerVertices (IncrementStr b1,b2) = {[<*b1,b2*>,and2a ]} by CIRCCOMB:49;

theorem Th42: :: TWOSCOMP:42
for b1, b2 being non pair set holds [<*b1,b2*>,and2a ] in InnerVertices (IncrementStr b1,b2)
proof end;

theorem Th43: :: TWOSCOMP:43
for b1, b2 being non pair set holds InputVertices (IncrementStr b1,b2) = {b1,b2} by FACIRC_1:40;

theorem Th44: :: TWOSCOMP:44
for b1, b2 being non pair set holds
( b1 in InputVertices (IncrementStr b1,b2) & b2 in InputVertices (IncrementStr b1,b2) )
proof end;

theorem Th45: :: TWOSCOMP:45
for b1, b2 being non pair set holds not InputVertices (IncrementStr b1,b2) is with_pair
proof end;

theorem Th46: :: TWOSCOMP:46
for b1, b2 being non pair set holds InnerVertices (BitCompStr b1,b2) is Relation
proof end;

theorem Th47: :: TWOSCOMP:47
for b1, b2 being non pair set holds
( b1 in the carrier of (BitCompStr b1,b2) & b2 in the carrier of (BitCompStr b1,b2) & [<*b1,b2*>,xor2a ] in the carrier of (BitCompStr b1,b2) & [<*b1,b2*>,and2a ] in the carrier of (BitCompStr b1,b2) )
proof end;

theorem Th48: :: TWOSCOMP:48
for b1, b2 being non pair set holds the carrier of (BitCompStr b1,b2) = {b1,b2} \/ {[<*b1,b2*>,xor2a ],[<*b1,b2*>,and2a ]}
proof end;

theorem Th49: :: TWOSCOMP:49
for b1, b2 being non pair set holds InnerVertices (BitCompStr b1,b2) = {[<*b1,b2*>,xor2a ],[<*b1,b2*>,and2a ]}
proof end;

theorem Th50: :: TWOSCOMP:50
for b1, b2 being non pair set holds
( [<*b1,b2*>,xor2a ] in InnerVertices (BitCompStr b1,b2) & [<*b1,b2*>,and2a ] in InnerVertices (BitCompStr b1,b2) )
proof end;

theorem Th51: :: TWOSCOMP:51
for b1, b2 being non pair set holds InputVertices (BitCompStr b1,b2) = {b1,b2}
proof end;

theorem Th52: :: TWOSCOMP:52
for b1, b2 being non pair set holds
( b1 in InputVertices (BitCompStr b1,b2) & b2 in InputVertices (BitCompStr b1,b2) )
proof end;

theorem Th53: :: TWOSCOMP:53
for b1, b2 being non pair set holds not InputVertices (BitCompStr b1,b2) is with_pair
proof end;

theorem Th54: :: TWOSCOMP:54
for b1, b2 being non pair set
for b3 being State of (CompCirc b1,b2) holds
( (Following b3) . (CompOutput b1,b2) = xor2a . <*(b3 . b1),(b3 . b2)*> & (Following b3) . b1 = b3 . b1 & (Following b3) . b2 = b3 . b2 )
proof end;

theorem Th55: :: TWOSCOMP:55
for b1, b2 being non pair set
for b3 being State of (CompCirc b1,b2)
for b4, b5 being Element of BOOLEAN st b4 = b3 . b1 & b5 = b3 . b2 holds
( (Following b3) . (CompOutput b1,b2) = ('not' b4) 'xor' b5 & (Following b3) . b1 = b4 & (Following b3) . b2 = b5 )
proof end;

theorem Th56: :: TWOSCOMP:56
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2) holds
( (Following b3) . (CompOutput b1,b2) = xor2a . <*(b3 . b1),(b3 . b2)*> & (Following b3) . b1 = b3 . b1 & (Following b3) . b2 = b3 . b2 )
proof end;

theorem Th57: :: TWOSCOMP:57
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2)
for b4, b5 being Element of BOOLEAN st b4 = b3 . b1 & b5 = b3 . b2 holds
( (Following b3) . (CompOutput b1,b2) = ('not' b4) 'xor' b5 & (Following b3) . b1 = b4 & (Following b3) . b2 = b5 )
proof end;

theorem Th58: :: TWOSCOMP:58
for b1, b2 being non pair set
for b3 being State of (IncrementCirc b1,b2) holds
( (Following b3) . (IncrementOutput b1,b2) = and2a . <*(b3 . b1),(b3 . b2)*> & (Following b3) . b1 = b3 . b1 & (Following b3) . b2 = b3 . b2 )
proof end;

theorem Th59: :: TWOSCOMP:59
for b1, b2 being non pair set
for b3 being State of (IncrementCirc b1,b2)
for b4, b5 being Element of BOOLEAN st b4 = b3 . b1 & b5 = b3 . b2 holds
( (Following b3) . (IncrementOutput b1,b2) = ('not' b4) '&' b5 & (Following b3) . b1 = b4 & (Following b3) . b2 = b5 )
proof end;

theorem Th60: :: TWOSCOMP:60
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2) holds
( (Following b3) . (IncrementOutput b1,b2) = and2a . <*(b3 . b1),(b3 . b2)*> & (Following b3) . b1 = b3 . b1 & (Following b3) . b2 = b3 . b2 )
proof end;

theorem Th61: :: TWOSCOMP:61
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2)
for b4, b5 being Element of BOOLEAN st b4 = b3 . b1 & b5 = b3 . b2 holds
( (Following b3) . (IncrementOutput b1,b2) = ('not' b4) '&' b5 & (Following b3) . b1 = b4 & (Following b3) . b2 = b5 )
proof end;

theorem Th62: :: TWOSCOMP:62
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2) holds
( (Following b3) . (CompOutput b1,b2) = xor2a . <*(b3 . b1),(b3 . b2)*> & (Following b3) . (IncrementOutput b1,b2) = and2a . <*(b3 . b1),(b3 . b2)*> & (Following b3) . b1 = b3 . b1 & (Following b3) . b2 = b3 . b2 ) by Th56, Th60;

theorem Th63: :: TWOSCOMP:63
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2)
for b4, b5 being Element of BOOLEAN st b4 = b3 . b1 & b5 = b3 . b2 holds
( (Following b3) . (CompOutput b1,b2) = ('not' b4) 'xor' b5 & (Following b3) . (IncrementOutput b1,b2) = ('not' b4) '&' b5 & (Following b3) . b1 = b4 & (Following b3) . b2 = b5 ) by Th57, Th61;

theorem Th64: :: TWOSCOMP:64
for b1, b2 being non pair set
for b3 being State of (BitCompCirc b1,b2) holds Following b3 is stable
proof end;