Article TWOSCOMP, MML version 4.99.1005

:: TWOSCOMP:funcnot 1 => TWOSCOMP:func 1
definition
  let a1 be non empty non void unsplit ManySortedSign;
  let a2 be locally-finite Boolean MSAlgebra over a1;
  let a3 be Element of product the Sorts of a2;
  let a4 be Element of the carrier of a1;
  redefine func a3 . a4 -> Element of BOOLEAN;
end;

:: TWOSCOMP:funcnot 2 => TWOSCOMP:func 2
definition
  func and2 -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = b1 '&' b2;
end;

:: TWOSCOMP:def 1
theorem
for b1 being Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN holds
      b1 = and2
   iff
      for b2, b3 being Element of BOOLEAN holds
      b1 . <*b2,b3*> = b2 '&' b3;

:: TWOSCOMP:funcnot 3 => TWOSCOMP:func 3
definition
  func and2a -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = ('not' b1) '&' b2;
end;

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

:: TWOSCOMP:funcnot 4 => TWOSCOMP:func 4
definition
  func and2b -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = ('not' b1) '&' 'not' b2;
end;

:: TWOSCOMP:def 3
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 5 => TWOSCOMP:func 5
definition
  func nand2 -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = 'not' (b1 '&' b2);
end;

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

:: TWOSCOMP:funcnot 6 => TWOSCOMP:func 6
definition
  func nand2a -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = 'not' (('not' b1) '&' b2);
end;

:: TWOSCOMP:def 5
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 7 => TWOSCOMP:func 7
definition
  func nand2b -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = 'not' (('not' b1) '&' 'not' b2);
end;

:: TWOSCOMP:def 6
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 8 => TWOSCOMP:func 8
definition
  func or2 -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = b1 'or' b2;
end;

:: TWOSCOMP:def 7
theorem
for b1 being Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN holds
      b1 = or2
   iff
      for b2, b3 being Element of BOOLEAN holds
      b1 . <*b2,b3*> = b2 'or' b3;

:: TWOSCOMP:funcnot 9 => TWOSCOMP:func 9
definition
  func or2a -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = ('not' b1) 'or' b2;
end;

:: TWOSCOMP:def 8
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 10 => TWOSCOMP:func 10
definition
  func or2b -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = ('not' b1) 'or' 'not' b2;
end;

:: TWOSCOMP:def 9
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 11 => TWOSCOMP:func 11
definition
  func nor2 -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = 'not' (b1 'or' b2);
end;

:: TWOSCOMP:def 10
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 12 => TWOSCOMP:func 12
definition
  func nor2a -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = 'not' (('not' b1) 'or' b2);
end;

:: TWOSCOMP:def 11
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 13 => TWOSCOMP:func 13
definition
  func nor2b -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = 'not' (('not' b1) 'or' 'not' b2);
end;

:: TWOSCOMP:def 12
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 14 => TWOSCOMP:func 14
definition
  func xor2 -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = b1 'xor' b2;
end;

:: TWOSCOMP:def 13
theorem
for b1 being Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN holds
      b1 = xor2
   iff
      for b2, b3 being Element of BOOLEAN holds
      b1 . <*b2,b3*> = b2 'xor' b3;

:: TWOSCOMP:funcnot 15 => TWOSCOMP:func 15
definition
  func xor2a -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = ('not' b1) 'xor' b2;
end;

:: TWOSCOMP:def 14
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 16 => TWOSCOMP:func 16
definition
  func xor2b -> Function-like quasi_total Relation of 2 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2 being Element of BOOLEAN holds
    it . <*b1,b2*> = ('not' b1) 'xor' 'not' b2;
end;

:: TWOSCOMP:def 15
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:th 3
theorem
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;

:: TWOSCOMP:th 4
theorem
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);

:: TWOSCOMP:th 5
theorem
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;

:: TWOSCOMP:th 6
theorem
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);

:: TWOSCOMP:th 7
theorem
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;

:: TWOSCOMP:th 8
theorem
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*>;

:: TWOSCOMP:th 9
theorem
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*>;

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

:: TWOSCOMP:th 11
theorem
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;

:: TWOSCOMP:th 12
theorem
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;

:: TWOSCOMP:th 13
theorem
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;

:: TWOSCOMP:funcnot 17 => TWOSCOMP:func 17
definition
  func and3 -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (b1 '&' b2) '&' b3;
end;

:: TWOSCOMP:def 16
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 18 => TWOSCOMP:func 18
definition
  func and3a -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (('not' b1) '&' b2) '&' b3;
end;

:: TWOSCOMP:def 17
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 19 => TWOSCOMP:func 19
definition
  func and3b -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (('not' b1) '&' 'not' b2) '&' b3;
end;

:: TWOSCOMP:def 18
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 20 => TWOSCOMP:func 20
definition
  func and3c -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (('not' b1) '&' 'not' b2) '&' 'not' b3;
end;

:: TWOSCOMP:def 19
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 21 => TWOSCOMP:func 21
definition
  func nand3 -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((b1 '&' b2) '&' b3);
end;

:: TWOSCOMP:def 20
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 22 => TWOSCOMP:func 22
definition
  func nand3a -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((('not' b1) '&' b2) '&' b3);
end;

:: TWOSCOMP:def 21
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 23 => TWOSCOMP:func 23
definition
  func nand3b -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((('not' b1) '&' 'not' b2) '&' b3);
end;

:: TWOSCOMP:def 22
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 24 => TWOSCOMP:func 24
definition
  func nand3c -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((('not' b1) '&' 'not' b2) '&' 'not' b3);
end;

:: TWOSCOMP:def 23
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 25 => TWOSCOMP:func 25
definition
  func or3 -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (b1 'or' b2) 'or' b3;
end;

:: TWOSCOMP:def 24
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 26 => TWOSCOMP:func 26
definition
  func or3a -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (('not' b1) 'or' b2) 'or' b3;
end;

:: TWOSCOMP:def 25
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 27 => TWOSCOMP:func 27
definition
  func or3b -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (('not' b1) 'or' 'not' b2) 'or' b3;
end;

:: TWOSCOMP:def 26
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 28 => TWOSCOMP:func 28
definition
  func or3c -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (('not' b1) 'or' 'not' b2) 'or' 'not' b3;
end;

:: TWOSCOMP:def 27
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:funcnot 29 => TWOSCOMP:func 29
definition
  func nor3 -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((b1 'or' b2) 'or' b3);
end;

:: TWOSCOMP:def 28
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 30 => TWOSCOMP:func 30
definition
  func nor3a -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' b2) 'or' b3);
end;

:: TWOSCOMP:def 29
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 31 => TWOSCOMP:func 31
definition
  func nor3b -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' 'not' b2) 'or' b3);
end;

:: TWOSCOMP:def 30
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 32 => TWOSCOMP:func 32
definition
  func nor3c -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = 'not' ((('not' b1) 'or' 'not' b2) 'or' 'not' b3);
end;

:: TWOSCOMP:def 31
theorem
for b1 being Function-like quasi_total Relation 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);

:: TWOSCOMP:funcnot 33 => TWOSCOMP:func 33
definition
  func xor3 -> Function-like quasi_total Relation of 3 -tuples_on BOOLEAN,BOOLEAN means
    for b1, b2, b3 being Element of BOOLEAN holds
    it . <*b1,b2,b3*> = (b1 'xor' b2) 'xor' b3;
end;

:: TWOSCOMP:def 32
theorem
for b1 being Function-like quasi_total Relation 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;

:: TWOSCOMP:th 14
theorem
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;

:: TWOSCOMP:th 15
theorem
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);

:: TWOSCOMP:th 16
theorem
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;

:: TWOSCOMP:th 17
theorem
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);

:: TWOSCOMP:th 19
theorem
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*>;

:: TWOSCOMP:th 20
theorem
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*>;

:: TWOSCOMP:th 21
theorem
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;

:: TWOSCOMP:th 22
theorem
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;

:: TWOSCOMP:th 23
theorem
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;

:: TWOSCOMP:th 24
theorem
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;

:: TWOSCOMP:th 25
theorem
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;

:: TWOSCOMP:th 26
theorem
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;

:: TWOSCOMP:th 27
theorem
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;

:: TWOSCOMP:th 28
theorem
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;

:: TWOSCOMP:th 29
theorem
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;

:: TWOSCOMP:funcnot 34 => TWOSCOMP:func 34
definition
  let a1, a2 be set;
  func CompStr(A1,A2) -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals
    1GateCircStr(<*a1,a2*>,xor2a);
end;

:: TWOSCOMP:def 33
theorem
for b1, b2 being set holds
CompStr(b1,b2) = 1GateCircStr(<*b1,b2*>,xor2a);

:: TWOSCOMP:funcnot 35 => TWOSCOMP:func 35
definition
  let a1, a2 be set;
  func CompCirc(A1,A2) -> strict locally-finite gate`2=den Boolean MSAlgebra over CompStr(a1,a2) equals
    1GateCircuit(a1,a2,xor2a);
end;

:: TWOSCOMP:def 34
theorem
for b1, b2 being set holds
CompCirc(b1,b2) = 1GateCircuit(b1,b2,xor2a);

:: TWOSCOMP:funcnot 36 => TWOSCOMP:func 36
definition
  let a1, a2 be set;
  func CompOutput(A1,A2) -> Element of InnerVertices CompStr(a1,a2) equals
    [<*a1,a2*>,xor2a];
end;

:: TWOSCOMP:def 35
theorem
for b1, b2 being set holds
CompOutput(b1,b2) = [<*b1,b2*>,xor2a];

:: TWOSCOMP:funcnot 37 => TWOSCOMP:func 37
definition
  let a1, a2 be set;
  func IncrementStr(A1,A2) -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals
    1GateCircStr(<*a1,a2*>,and2a);
end;

:: TWOSCOMP:def 36
theorem
for b1, b2 being set holds
IncrementStr(b1,b2) = 1GateCircStr(<*b1,b2*>,and2a);

:: TWOSCOMP:funcnot 38 => TWOSCOMP:func 38
definition
  let a1, a2 be set;
  func IncrementCirc(A1,A2) -> strict locally-finite gate`2=den Boolean MSAlgebra over IncrementStr(a1,a2) equals
    1GateCircuit(a1,a2,and2a);
end;

:: TWOSCOMP:def 37
theorem
for b1, b2 being set holds
IncrementCirc(b1,b2) = 1GateCircuit(b1,b2,and2a);

:: TWOSCOMP:funcnot 39 => TWOSCOMP:func 39
definition
  let a1, a2 be set;
  func IncrementOutput(A1,A2) -> Element of InnerVertices IncrementStr(a1,a2) equals
    [<*a1,a2*>,and2a];
end;

:: TWOSCOMP:def 38
theorem
for b1, b2 being set holds
IncrementOutput(b1,b2) = [<*b1,b2*>,and2a];

:: TWOSCOMP:funcnot 40 => TWOSCOMP:func 40
definition
  let a1, a2 be set;
  func BitCompStr(A1,A2) -> non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals
    (CompStr(a1,a2)) +* IncrementStr(a1,a2);
end;

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

:: TWOSCOMP:funcnot 41 => TWOSCOMP:func 41
definition
  let a1, a2 be set;
  func BitCompCirc(A1,A2) -> strict locally-finite gate`2=den Boolean MSAlgebra over BitCompStr(a1,a2) equals
    (CompCirc(a1,a2)) +* IncrementCirc(a1,a2);
end;

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

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

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

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

:: TWOSCOMP:th 37
theorem
for b1, b2 being non pair set holds
InputVertices CompStr(b1,b2) is without_pairs;

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

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

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

:: TWOSCOMP:th 45
theorem
for b1, b2 being non pair set holds
InputVertices IncrementStr(b1,b2) is without_pairs;

:: TWOSCOMP:th 46
theorem
for b1, b2 being non pair set holds
InnerVertices BitCompStr(b1,b2) is Relation-like set;

:: TWOSCOMP:th 47
theorem
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);

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

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

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

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

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

:: TWOSCOMP:th 53
theorem
for b1, b2 being non pair set holds
InputVertices BitCompStr(b1,b2) is without_pairs;

:: TWOSCOMP:th 54
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 55
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 56
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 57
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 58
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 59
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 60
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 61
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 62
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 63
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts 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;

:: TWOSCOMP:th 64
theorem
for b1, b2 being non pair set
for b3 being Element of product the Sorts of BitCompCirc(b1,b2) holds
   Following b3 is stable(BitCompStr(b1,b2), BitCompCirc(b1,b2));