:: FACIRC_1 semantic presentation
:: deftheorem Def1 defines pair FACIRC_1:def 1 :
for
b1 being
set holds
(
b1 is
pair iff ex
b2,
b3 being
set st
b1 = [b2,b3] );
:: deftheorem Def2 defines with_pair FACIRC_1:def 2 :
:: deftheorem Def3 defines nonpair-yielding FACIRC_1:def 3 :
theorem Th1: :: FACIRC_1:1
theorem Th2: :: FACIRC_1:2
theorem Th3: :: FACIRC_1:3
theorem Th4: :: FACIRC_1:4
theorem Th5: :: FACIRC_1:5
theorem Th6: :: FACIRC_1:6
theorem Th7: :: FACIRC_1:7
theorem Th8: :: FACIRC_1:8
theorem Th9: :: FACIRC_1:9
scheme :: FACIRC_1:sch 3
s3{
F1(
set ,
set )
-> Element of
BOOLEAN } :
( ex
b1 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN st
for
b2,
b3 being
Element of
BOOLEAN holds
b1 . <*b2,b3*> = F1(
b2,
b3) & ( for
b1,
b2 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN st ( for
b3,
b4 being
Element of
BOOLEAN holds
b1 . <*b3,b4*> = F1(
b3,
b4) ) & ( for
b3,
b4 being
Element of
BOOLEAN holds
b2 . <*b3,b4*> = F1(
b3,
b4) ) holds
b1 = b2 ) )
scheme :: FACIRC_1:sch 5
s5{
F1(
set ,
set ,
set )
-> Element of
BOOLEAN } :
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*> = F1(
b3,
b4,
b5) ) & ( for
b3,
b4,
b5 being
Element of
BOOLEAN holds
b2 . <*b3,b4,b5*> = F1(
b3,
b4,
b5) ) holds
b1 = b2
scheme :: FACIRC_1:sch 6
s6{
F1(
set ,
set ,
set )
-> Element of
BOOLEAN } :
( ex
b1 being
Function of 3
-tuples_on BOOLEAN ,
BOOLEAN st
for
b2,
b3,
b4 being
Element of
BOOLEAN holds
b1 . <*b2,b3,b4*> = F1(
b2,
b3,
b4) & ( 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*> = F1(
b3,
b4,
b5) ) & ( for
b3,
b4,
b5 being
Element of
BOOLEAN holds
b2 . <*b3,b4,b5*> = F1(
b3,
b4,
b5) ) holds
b1 = b2 ) )
definition
func 'xor' -> Function of 2
-tuples_on BOOLEAN ,
BOOLEAN means :
Def4:
:: FACIRC_1:def 4
for
b1,
b2 being
Element of
BOOLEAN holds
a1 . <*b1,b2*> = b1 'xor' b2;
correctness
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;
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;
func 'or' -> Function of 2
-tuples_on BOOLEAN ,
BOOLEAN means :
Def5:
:: FACIRC_1:def 5
for
b1,
b2 being
Element of
BOOLEAN holds
a1 . <*b1,b2*> = b1 'or' b2;
correctness
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;
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;
func '&' -> Function of 2
-tuples_on BOOLEAN ,
BOOLEAN means :
Def6:
:: FACIRC_1:def 6
for
b1,
b2 being
Element of
BOOLEAN holds
a1 . <*b1,b2*> = b1 '&' b2;
correctness
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;
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;
end;
:: deftheorem Def4 defines 'xor' FACIRC_1:def 4 :
:: deftheorem Def5 defines 'or' FACIRC_1:def 5 :
:: deftheorem Def6 defines '&' FACIRC_1:def 6 :
definition
func or3 -> Function of 3
-tuples_on BOOLEAN ,
BOOLEAN means :
Def7:
:: FACIRC_1:def 7
for
b1,
b2,
b3 being
Element of
BOOLEAN holds
a1 . <*b1,b2,b3*> = (b1 'or' b2) 'or' b3;
correctness
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;
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;
end;
:: deftheorem Def7 defines or3 FACIRC_1:def 7 :
theorem Th10: :: FACIRC_1:10
:: deftheorem Def8 defines Following FACIRC_1:def 8 :
theorem Th11: :: FACIRC_1:11
theorem Th12: :: FACIRC_1:12
theorem Th13: :: FACIRC_1:13
theorem Th14: :: FACIRC_1:14
theorem Th15: :: FACIRC_1:15
theorem Th16: :: FACIRC_1:16
:: deftheorem Def9 defines is_stable_at FACIRC_1:def 9 :
theorem Th17: :: FACIRC_1:17
theorem Th18: :: FACIRC_1:18
theorem Th19: :: FACIRC_1:19
theorem Th20: :: FACIRC_1:20
theorem Th21: :: FACIRC_1:21
theorem Th22: :: FACIRC_1:22
theorem Th23: :: FACIRC_1:23
theorem Th24: :: FACIRC_1:24
theorem Th25: :: FACIRC_1:25
theorem Th26: :: FACIRC_1:26
theorem Th27: :: FACIRC_1:27
theorem Th28: :: FACIRC_1:28
theorem Th29: :: FACIRC_1:29
theorem Th30: :: FACIRC_1:30
theorem Th31: :: FACIRC_1:31
theorem Th32: :: FACIRC_1:32
theorem Th33: :: FACIRC_1:33
theorem Th34: :: FACIRC_1:34
theorem Th35: :: FACIRC_1:35
theorem Th36: :: FACIRC_1:36
theorem Th37: :: FACIRC_1:37
theorem Th38: :: FACIRC_1:38
theorem Th39: :: FACIRC_1:39
theorem Th40: :: FACIRC_1:40
theorem Th41: :: FACIRC_1:41
theorem Th42: :: FACIRC_1:42
theorem Th43: :: FACIRC_1:43
for
b1,
b2,
b3 being
set holds
(
b1 in the
carrier of
(1GateCircStr <*b1,b2*>,b3) &
b2 in the
carrier of
(1GateCircStr <*b1,b2*>,b3) &
[<*b1,b2*>,b3] in the
carrier of
(1GateCircStr <*b1,b2*>,b3) )
theorem Th44: :: FACIRC_1:44
for
b1,
b2,
b3,
b4 being
set holds
(
b1 in the
carrier of
(1GateCircStr <*b1,b2,b3*>,b4) &
b2 in the
carrier of
(1GateCircStr <*b1,b2,b3*>,b4) &
b3 in the
carrier of
(1GateCircStr <*b1,b2,b3*>,b4) )
theorem Th45: :: FACIRC_1:45
theorem Th46: :: FACIRC_1:46
theorem Th47: :: FACIRC_1:47
definition
let c1,
c2 be
set ;
let c3 be
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN ;
func 1GateCircuit c1,
c2,
c3 -> strict gate`2=den Boolean Circuit of
1GateCircStr <*a1,a2*>,
a3 equals :: FACIRC_1:def 10
1GateCircuit <*a1,a2*>,
a3;
coherence
1GateCircuit <*c1,c2*>,c3 is strict gate`2=den Boolean Circuit of 1GateCircStr <*c1,c2*>,c3
by CIRCCOMB:69;
end;
:: deftheorem Def10 defines 1GateCircuit FACIRC_1:def 10 :
theorem Th48: :: FACIRC_1:48
theorem Th49: :: FACIRC_1:49
theorem Th50: :: FACIRC_1:50
theorem Th51: :: FACIRC_1:51
definition
let c1,
c2,
c3 be
set ;
let c4 be
Function of 3
-tuples_on BOOLEAN ,
BOOLEAN ;
func 1GateCircuit c1,
c2,
c3,
c4 -> strict gate`2=den Boolean Circuit of
1GateCircStr <*a1,a2,a3*>,
a4 equals :: FACIRC_1:def 11
1GateCircuit <*a1,a2,a3*>,
a4;
coherence
1GateCircuit <*c1,c2,c3*>,c4 is strict gate`2=den Boolean Circuit of 1GateCircStr <*c1,c2,c3*>,c4
by CIRCCOMB:69;
end;
:: deftheorem Def11 defines 1GateCircuit FACIRC_1:def 11 :
theorem Th52: :: FACIRC_1:52
for
b1,
b2,
b3 being
set for
b4 being non
empty finite set for
b5 being
Function of 3
-tuples_on b4,
b4 for
b6 being
State of
(1GateCircuit <*b1,b2,b3*>,b5) holds
(
(Following b6) . [<*b1,b2,b3*>,b5] = b5 . <*(b6 . b1),(b6 . b2),(b6 . b3)*> &
(Following b6) . b1 = b6 . b1 &
(Following b6) . b2 = b6 . b2 &
(Following b6) . b3 = b6 . b3 )
theorem Th53: :: FACIRC_1:53
theorem Th54: :: FACIRC_1:54
for
b1,
b2,
b3 being
set for
b4 being
Function of 3
-tuples_on BOOLEAN ,
BOOLEAN for
b5 being
State of
(1GateCircuit b1,b2,b3,b4) holds
(
(Following b5) . [<*b1,b2,b3*>,b4] = b4 . <*(b5 . b1),(b5 . b2),(b5 . b3)*> &
(Following b5) . b1 = b5 . b1 &
(Following b5) . b2 = b5 . b2 &
(Following b5) . b3 = b5 . b3 )
by Th52;
theorem Th55: :: FACIRC_1:55
definition
let c1,
c2,
c3 be
set ;
let c4 be
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN ;
func 2GatesCircStr c1,
c2,
c3,
c4 -> non
empty strict non
void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: FACIRC_1:def 12
(1GateCircStr <*a1,a2*>,a4) +* (1GateCircStr <*[<*a1,a2*>,a4],a3*>,a4);
correctness
coherence
(1GateCircStr <*c1,c2*>,c4) +* (1GateCircStr <*[<*c1,c2*>,c4],c3*>,c4) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign ;
;
end;
:: deftheorem Def12 defines 2GatesCircStr FACIRC_1:def 12 :
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN holds
2GatesCircStr b1,
b2,
b3,
b4 = (1GateCircStr <*b1,b2*>,b4) +* (1GateCircStr <*[<*b1,b2*>,b4],b3*>,b4);
definition
let c1,
c2,
c3 be
set ;
let c4 be
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN ;
func 2GatesCircOutput c1,
c2,
c3,
c4 -> Element of
InnerVertices (2GatesCircStr a1,a2,a3,a4) equals :: FACIRC_1:def 13
[<*[<*a1,a2*>,a4],a3*>,a4];
coherence
[<*[<*c1,c2*>,c4],c3*>,c4] is Element of InnerVertices (2GatesCircStr c1,c2,c3,c4)
correctness
;
end;
:: deftheorem Def13 defines 2GatesCircOutput FACIRC_1:def 13 :
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN holds
2GatesCircOutput b1,
b2,
b3,
b4 = [<*[<*b1,b2*>,b4],b3*>,b4];
theorem Th56: :: FACIRC_1:56
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN holds
InnerVertices (2GatesCircStr b1,b2,b3,b4) = {[<*b1,b2*>,b4],(2GatesCircOutput b1,b2,b3,b4)}
theorem Th57: :: FACIRC_1:57
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN st
b1 <> [<*b2,b3*>,b4] holds
InputVertices (2GatesCircStr b2,b3,b1,b4) = {b2,b3,b1}
definition
let c1,
c2,
c3 be
set ;
let c4 be
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN ;
func 2GatesCircuit c1,
c2,
c3,
c4 -> strict gate`2=den Boolean Circuit of
2GatesCircStr a1,
a2,
a3,
a4 equals :: FACIRC_1:def 14
(1GateCircuit a1,a2,a4) +* (1GateCircuit [<*a1,a2*>,a4],a3,a4);
coherence
(1GateCircuit c1,c2,c4) +* (1GateCircuit [<*c1,c2*>,c4],c3,c4) is strict gate`2=den Boolean Circuit of 2GatesCircStr c1,c2,c3,c4
;
end;
:: deftheorem Def14 defines 2GatesCircuit FACIRC_1:def 14 :
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN holds
2GatesCircuit b1,
b2,
b3,
b4 = (1GateCircuit b1,b2,b4) +* (1GateCircuit [<*b1,b2*>,b4],b3,b4);
theorem Th58: :: FACIRC_1:58
theorem Th59: :: FACIRC_1:59
theorem Th60: :: FACIRC_1:60
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN holds
(
b1 in the
carrier of
(2GatesCircStr b1,b2,b3,b4) &
b2 in the
carrier of
(2GatesCircStr b1,b2,b3,b4) &
b3 in the
carrier of
(2GatesCircStr b1,b2,b3,b4) )
theorem Th61: :: FACIRC_1:61
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN holds
(
[<*b1,b2*>,b4] in the
carrier of
(2GatesCircStr b1,b2,b3,b4) &
[<*[<*b1,b2*>,b4],b3*>,b4] in the
carrier of
(2GatesCircStr b1,b2,b3,b4) )
Lemma60:
for b1, b2, b3 being set
for b4 being Function of 2 -tuples_on BOOLEAN , BOOLEAN
for b5 being State of (2GatesCircuit b2,b3,b1,b4) st b1 <> [<*b2,b3*>,b4] holds
( (Following b5) . (2GatesCircOutput b2,b3,b1,b4) = b4 . <*(b5 . [<*b2,b3*>,b4]),(b5 . b1)*> & (Following b5) . [<*b2,b3*>,b4] = b4 . <*(b5 . b2),(b5 . b3)*> & (Following b5) . b2 = b5 . b2 & (Following b5) . b3 = b5 . b3 & (Following b5) . b1 = b5 . b1 )
theorem Th62: :: FACIRC_1:62
for
b1,
b2,
b3 being
set for
b4 being
Function of 2
-tuples_on BOOLEAN ,
BOOLEAN for
b5 being
State of
(2GatesCircuit b2,b3,b1,b4) st
b1 <> [<*b2,b3*>,b4] holds
(
(Following b5,2) . (2GatesCircOutput b2,b3,b1,b4) = b4 . <*(b4 . <*(b5 . b2),(b5 . b3)*>),(b5 . b1)*> &
(Following b5,2) . [<*b2,b3*>,b4] = b4 . <*(b5 . b2),(b5 . b3)*> &
(Following b5,2) . b2 = b5 . b2 &
(Following b5,2) . b3 = b5 . b3 &
(Following b5,2) . b1 = b5 . b1 )
theorem Th63: :: FACIRC_1:63
theorem Th64: :: FACIRC_1:64
for
b1,
b2,
b3 being
set st
b1 <> [<*b2,b3*>,'xor' ] holds
for
b4 being
State of
(2GatesCircuit b2,b3,b1,'xor' ) for
b5,
b6,
b7 being
Element of
BOOLEAN st
b5 = b4 . b2 &
b6 = b4 . b3 &
b7 = b4 . b1 holds
(Following b4,2) . (2GatesCircOutput b2,b3,b1,'xor' ) = (b5 'xor' b6) 'xor' b7
theorem Th65: :: FACIRC_1:65
for
b1,
b2,
b3 being
set st
b1 <> [<*b2,b3*>,'or' ] holds
for
b4 being
State of
(2GatesCircuit b2,b3,b1,'or' ) for
b5,
b6,
b7 being
Element of
BOOLEAN st
b5 = b4 . b2 &
b6 = b4 . b3 &
b7 = b4 . b1 holds
(Following b4,2) . (2GatesCircOutput b2,b3,b1,'or' ) = (b5 'or' b6) 'or' b7
theorem Th66: :: FACIRC_1:66
for
b1,
b2,
b3 being
set st
b1 <> [<*b2,b3*>,'&' ] holds
for
b4 being
State of
(2GatesCircuit b2,b3,b1,'&' ) for
b5,
b6,
b7 being
Element of
BOOLEAN st
b5 = b4 . b2 &
b6 = b4 . b3 &
b7 = b4 . b1 holds
(Following b4,2) . (2GatesCircOutput b2,b3,b1,'&' ) = (b5 '&' b6) '&' b7
definition
let c1,
c2,
c3 be
set ;
func BitAdderOutput c1,
c2,
c3 -> Element of
InnerVertices (2GatesCircStr a1,a2,a3,'xor' ) equals :: FACIRC_1:def 15
2GatesCircOutput a1,
a2,
a3,
'xor' ;
coherence
2GatesCircOutput c1,c2,c3,'xor' is Element of InnerVertices (2GatesCircStr c1,c2,c3,'xor' )
;
end;
:: deftheorem Def15 defines BitAdderOutput FACIRC_1:def 15 :
definition
let c1,
c2,
c3 be
set ;
func BitAdderCirc c1,
c2,
c3 -> strict gate`2=den Boolean Circuit of
2GatesCircStr a1,
a2,
a3,
'xor' equals :: FACIRC_1:def 16
2GatesCircuit a1,
a2,
a3,
'xor' ;
coherence
2GatesCircuit c1,c2,c3,'xor' is strict gate`2=den Boolean Circuit of 2GatesCircStr c1,c2,c3,'xor'
;
end;
:: deftheorem Def16 defines BitAdderCirc FACIRC_1:def 16 :
definition
let c1,
c2,
c3 be
set ;
func MajorityIStr c1,
c2,
c3 -> non
empty strict non
void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: FACIRC_1:def 17
((1GateCircStr <*a1,a2*>,'&' ) +* (1GateCircStr <*a2,a3*>,'&' )) +* (1GateCircStr <*a3,a1*>,'&' );
correctness
coherence
((1GateCircStr <*c1,c2*>,'&' ) +* (1GateCircStr <*c2,c3*>,'&' )) +* (1GateCircStr <*c3,c1*>,'&' ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign ;
;
end;
:: deftheorem Def17 defines MajorityIStr FACIRC_1:def 17 :
for
b1,
b2,
b3 being
set holds
MajorityIStr b1,
b2,
b3 = ((1GateCircStr <*b1,b2*>,'&' ) +* (1GateCircStr <*b2,b3*>,'&' )) +* (1GateCircStr <*b3,b1*>,'&' );
definition
let c1,
c2,
c3 be
set ;
func MajorityStr c1,
c2,
c3 -> non
empty strict non
void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: FACIRC_1:def 18
(MajorityIStr a1,a2,a3) +* (1GateCircStr <*[<*a1,a2*>,'&' ],[<*a2,a3*>,'&' ],[<*a3,a1*>,'&' ]*>,or3 );
correctness
coherence
(MajorityIStr c1,c2,c3) +* (1GateCircStr <*[<*c1,c2*>,'&' ],[<*c2,c3*>,'&' ],[<*c3,c1*>,'&' ]*>,or3 ) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign ;
;
end;
:: deftheorem Def18 defines MajorityStr FACIRC_1:def 18 :
for
b1,
b2,
b3 being
set holds
MajorityStr b1,
b2,
b3 = (MajorityIStr b1,b2,b3) +* (1GateCircStr <*[<*b1,b2*>,'&' ],[<*b2,b3*>,'&' ],[<*b3,b1*>,'&' ]*>,or3 );
definition
let c1,
c2,
c3 be
set ;
func MajorityICirc c1,
c2,
c3 -> strict gate`2=den Boolean Circuit of
MajorityIStr a1,
a2,
a3 equals :: FACIRC_1:def 19
((1GateCircuit a1,a2,'&' ) +* (1GateCircuit a2,a3,'&' )) +* (1GateCircuit a3,a1,'&' );
coherence
((1GateCircuit c1,c2,'&' ) +* (1GateCircuit c2,c3,'&' )) +* (1GateCircuit c3,c1,'&' ) is strict gate`2=den Boolean Circuit of MajorityIStr c1,c2,c3
;
end;
:: deftheorem Def19 defines MajorityICirc FACIRC_1:def 19 :
for
b1,
b2,
b3 being
set holds
MajorityICirc b1,
b2,
b3 = ((1GateCircuit b1,b2,'&' ) +* (1GateCircuit b2,b3,'&' )) +* (1GateCircuit b3,b1,'&' );
theorem Th67: :: FACIRC_1:67
theorem Th68: :: FACIRC_1:68
theorem Th69: :: FACIRC_1:69
theorem Th70: :: FACIRC_1:70
theorem Th71: :: FACIRC_1:71
definition
let c1,
c2,
c3 be
set ;
func MajorityOutput c1,
c2,
c3 -> Element of
InnerVertices (MajorityStr a1,a2,a3) equals :: FACIRC_1:def 20
[<*[<*a1,a2*>,'&' ],[<*a2,a3*>,'&' ],[<*a3,a1*>,'&' ]*>,or3 ];
coherence
[<*[<*c1,c2*>,'&' ],[<*c2,c3*>,'&' ],[<*c3,c1*>,'&' ]*>,or3 ] is Element of InnerVertices (MajorityStr c1,c2,c3)
correctness
;
end;
:: deftheorem Def20 defines MajorityOutput FACIRC_1:def 20 :
for
b1,
b2,
b3 being
set holds
MajorityOutput b1,
b2,
b3 = [<*[<*b1,b2*>,'&' ],[<*b2,b3*>,'&' ],[<*b3,b1*>,'&' ]*>,or3 ];
definition
let c1,
c2,
c3 be
set ;
func MajorityCirc c1,
c2,
c3 -> strict gate`2=den Boolean Circuit of
MajorityStr a1,
a2,
a3 equals :: FACIRC_1:def 21
(MajorityICirc a1,a2,a3) +* (1GateCircuit [<*a1,a2*>,'&' ],[<*a2,a3*>,'&' ],[<*a3,a1*>,'&' ],or3 );
coherence
(MajorityICirc c1,c2,c3) +* (1GateCircuit [<*c1,c2*>,'&' ],[<*c2,c3*>,'&' ],[<*c3,c1*>,'&' ],or3 ) is strict gate`2=den Boolean Circuit of MajorityStr c1,c2,c3
;
end;
:: deftheorem Def21 defines MajorityCirc FACIRC_1:def 21 :
for
b1,
b2,
b3 being
set holds
MajorityCirc b1,
b2,
b3 = (MajorityICirc b1,b2,b3) +* (1GateCircuit [<*b1,b2*>,'&' ],[<*b2,b3*>,'&' ],[<*b3,b1*>,'&' ],or3 );
theorem Th72: :: FACIRC_1:72
theorem Th73: :: FACIRC_1:73
for
b1,
b2,
b3 being
set holds
(
[<*b1,b2*>,'&' ] in InnerVertices (MajorityStr b1,b2,b3) &
[<*b2,b3*>,'&' ] in InnerVertices (MajorityStr b1,b2,b3) &
[<*b3,b1*>,'&' ] in InnerVertices (MajorityStr b1,b2,b3) )
theorem Th74: :: FACIRC_1:74
theorem Th75: :: FACIRC_1:75
for
b1,
b2,
b3 being non
pair set holds
(
InputVertices (MajorityStr b1,b2,b3) = {b1,b2,b3} &
InnerVertices (MajorityStr b1,b2,b3) = {[<*b1,b2*>,'&' ],[<*b2,b3*>,'&' ],[<*b3,b1*>,'&' ]} \/ {(MajorityOutput b1,b2,b3)} )
Lemma70:
for b1, b2, b3 being non pair set
for b4 being State of (MajorityCirc 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*>,'&' ] = b5 '&' b6 & (Following b4) . [<*b2,b3*>,'&' ] = b6 '&' b7 & (Following b4) . [<*b3,b1*>,'&' ] = b7 '&' b5 )
theorem Th76: :: FACIRC_1:76
theorem Th77: :: FACIRC_1:77
theorem Th78: :: FACIRC_1:78
theorem Th79: :: FACIRC_1:79
for
b1,
b2,
b3 being non
pair set for
b4 being
State of
(MajorityCirc b1,b2,b3) for
b5,
b6,
b7 being
Element of
BOOLEAN st
b5 = b4 . [<*b1,b2*>,'&' ] &
b6 = b4 . [<*b2,b3*>,'&' ] &
b7 = b4 . [<*b3,b1*>,'&' ] holds
(Following b4) . (MajorityOutput b1,b2,b3) = (b5 'or' b6) 'or' b7
Lemma72:
for b1, b2, b3 being non pair set
for b4 being State of (MajorityCirc 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) . (MajorityOutput b1,b2,b3) = ((b5 '&' b6) 'or' (b6 '&' b7)) 'or' (b7 '&' b5) & (Following b4,2) . [<*b1,b2*>,'&' ] = b5 '&' b6 & (Following b4,2) . [<*b2,b3*>,'&' ] = b6 '&' b7 & (Following b4,2) . [<*b3,b1*>,'&' ] = b7 '&' b5 )
theorem Th80: :: FACIRC_1:80
theorem Th81: :: FACIRC_1:81
theorem Th82: :: FACIRC_1:82
theorem Th83: :: FACIRC_1:83
theorem Th84: :: FACIRC_1:84
definition
let c1,
c2,
c3 be
set ;
func BitAdderWithOverflowStr c1,
c2,
c3 -> non
empty strict non
void unsplit gate`1=arity gate`2isBoolean ManySortedSign equals :: FACIRC_1:def 22
(2GatesCircStr a1,a2,a3,'xor' ) +* (MajorityStr a1,a2,a3);
coherence
(2GatesCircStr c1,c2,c3,'xor' ) +* (MajorityStr c1,c2,c3) is non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign
;
end;
:: deftheorem Def22 defines BitAdderWithOverflowStr FACIRC_1:def 22 :
theorem Th85: :: FACIRC_1:85
theorem Th86: :: FACIRC_1:86
for
b1,
b2,
b3 being non
pair set holds
InnerVertices (BitAdderWithOverflowStr b1,b2,b3) = ({[<*b1,b2*>,'xor' ],(2GatesCircOutput b1,b2,b3,'xor' )} \/ {[<*b1,b2*>,'&' ],[<*b2,b3*>,'&' ],[<*b3,b1*>,'&' ]}) \/ {(MajorityOutput b1,b2,b3)}
theorem Th87: :: FACIRC_1:87
definition
let c1,
c2,
c3 be
set ;
func BitAdderWithOverflowCirc c1,
c2,
c3 -> strict gate`2=den Boolean Circuit of
BitAdderWithOverflowStr a1,
a2,
a3 equals :: FACIRC_1:def 23
(BitAdderCirc a1,a2,a3) +* (MajorityCirc a1,a2,a3);
coherence
(BitAdderCirc c1,c2,c3) +* (MajorityCirc c1,c2,c3) is strict gate`2=den Boolean Circuit of BitAdderWithOverflowStr c1,c2,c3
;
end;
:: deftheorem Def23 defines BitAdderWithOverflowCirc FACIRC_1:def 23 :
theorem Th88: :: FACIRC_1:88
theorem Th89: :: FACIRC_1:89
theorem Th90: :: FACIRC_1:90
for
b1,
b2,
b3 being
set holds
(
BitAdderOutput b1,
b2,
b3 in InnerVertices (BitAdderWithOverflowStr b1,b2,b3) &
MajorityOutput b1,
b2,
b3 in InnerVertices (BitAdderWithOverflowStr b1,b2,b3) )
by Th21;
theorem Th91: :: FACIRC_1:91
for
b1,
b2,
b3 being non
pair set for
b4 being
State of
(BitAdderWithOverflowCirc 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) . (BitAdderOutput b1,b2,b3) = (b5 'xor' b6) 'xor' b7 &
(Following b4,2) . (MajorityOutput b1,b2,b3) = ((b5 '&' b6) 'or' (b6 '&' b7)) 'or' (b7 '&' b5) )
theorem Th92: :: FACIRC_1:92