:: FSCIRC_2 semantic presentation :: Showing IDV graph ... (Click the Palm Trees again to close it)
definition
let n be
Nat;
let x,
y be
FinSequence;
A1:
(
1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) is
unsplit &
1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) is
gate`1=arity &
1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) is
gate`2isBoolean & not
1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) is
void & not
1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) is
empty &
1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) is
strict )
;
func n -BitSubtracterStr x,
y -> non
empty strict non
void unsplit gate`1=arity gate`2isBoolean ManySortedSign means :
Def1:
:: FSCIRC_2:def 1
ex
f,
g being
ManySortedSet of
NAT st
(
it = f . n &
f . 0
= 1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
g . 0
= [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for
n being
Nat for
S being non
empty ManySortedSign for
z being
set st
S = f . n &
z = g . n holds
(
f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) &
g . (n + 1) = BorrowOutput (x . (n + 1)),
(y . (n + 1)),
z ) ) );
uniqueness
for b1, b2 being non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign st ex f, g being ManySortedSet of NAT st
( b1 = f . n & f . 0 = 1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & g . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat
for S being non empty ManySortedSign
for z being set st S = f . n & z = g . n holds
( f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) & g . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),z ) ) ) & ex f, g being ManySortedSet of NAT st
( b2 = f . n & f . 0 = 1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & g . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat
for S being non empty ManySortedSign
for z being set st S = f . n & z = g . n holds
( f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) & g . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),z ) ) ) holds
b1 = b2
existence
ex b1 being non empty strict non void unsplit gate`1=arity gate`2isBoolean ManySortedSign ex f, g being ManySortedSet of NAT st
( b1 = f . n & f . 0 = 1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & g . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat
for S being non empty ManySortedSign
for z being set st S = f . n & z = g . n holds
( f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) & g . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),z ) ) )
end;
:: deftheorem Def1 defines -BitSubtracterStr FSCIRC_2:def 1 :
definition
let n be
Nat;
let x,
y be
FinSequence;
func n -BitSubtracterCirc x,
y -> strict gate`2=den Boolean Circuit of
n -BitSubtracterStr x,
y means :
Def2:
:: FSCIRC_2:def 2
ex
f,
g,
h being
ManySortedSet of
NAT st
(
n -BitSubtracterStr x,
y = f . n &
it = g . n &
f . 0
= 1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
g . 0
= 1GateCircuit <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
h . 0
= [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for
n being
Nat for
S being non
empty ManySortedSign for
A being
non-empty MSAlgebra of
S for
z being
set st
S = f . n &
A = g . n &
z = h . n holds
(
f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) &
g . (n + 1) = A +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),z) &
h . (n + 1) = BorrowOutput (x . (n + 1)),
(y . (n + 1)),
z ) ) );
uniqueness
for b1, b2 being strict gate`2=den Boolean Circuit of n -BitSubtracterStr x,y st ex f, g, h being ManySortedSet of NAT st
( n -BitSubtracterStr x,y = f . n & b1 = g . n & f . 0 = 1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & g . 0 = 1GateCircuit <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & h . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat
for S being non empty ManySortedSign
for A being non-empty MSAlgebra of S
for z being set st S = f . n & A = g . n & z = h . n holds
( f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) & g . (n + 1) = A +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),z) & h . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),z ) ) ) & ex f, g, h being ManySortedSet of NAT st
( n -BitSubtracterStr x,y = f . n & b2 = g . n & f . 0 = 1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & g . 0 = 1GateCircuit <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & h . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat
for S being non empty ManySortedSign
for A being non-empty MSAlgebra of S
for z being set st S = f . n & A = g . n & z = h . n holds
( f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) & g . (n + 1) = A +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),z) & h . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),z ) ) ) holds
b1 = b2
existence
ex b1 being strict gate`2=den Boolean Circuit of n -BitSubtracterStr x,y ex f, g, h being ManySortedSet of NAT st
( n -BitSubtracterStr x,y = f . n & b1 = g . n & f . 0 = 1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & g . 0 = 1GateCircuit <*> ,((0 -tuples_on BOOLEAN ) --> TRUE ) & h . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat
for S being non empty ManySortedSign
for A being non-empty MSAlgebra of S
for z being set st S = f . n & A = g . n & z = h . n holds
( f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) & g . (n + 1) = A +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),z) & h . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),z ) ) )
end;
:: deftheorem Def2 defines -BitSubtracterCirc FSCIRC_2:def 2 :
for
n being
Nat for
x,
y being
FinSequence for
b4 being
strict gate`2=den Boolean Circuit of
n -BitSubtracterStr x,
y holds
(
b4 = n -BitSubtracterCirc x,
y iff ex
f,
g,
h being
ManySortedSet of
NAT st
(
n -BitSubtracterStr x,
y = f . n &
b4 = g . n &
f . 0
= 1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
g . 0
= 1GateCircuit <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
h . 0
= [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for
n being
Nat for
S being non
empty ManySortedSign for
A being
non-empty MSAlgebra of
S for
z being
set st
S = f . n &
A = g . n &
z = h . n holds
(
f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) &
g . (n + 1) = A +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),z) &
h . (n + 1) = BorrowOutput (x . (n + 1)),
(y . (n + 1)),
z ) ) ) );
definition
let n be
Nat;
let x,
y be
FinSequence;
set c =
[<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )];
func n -BitBorrowOutput x,
y -> Element of
InnerVertices (n -BitSubtracterStr x,y) means :
Def3:
:: FSCIRC_2:def 3
ex
h being
ManySortedSet of
NAT st
(
it = h . n &
h . 0
= [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for
n being
Nat holds
h . (n + 1) = BorrowOutput (x . (n + 1)),
(y . (n + 1)),
(h . n) ) );
uniqueness
for b1, b2 being Element of InnerVertices (n -BitSubtracterStr x,y) st ex h being ManySortedSet of NAT st
( b1 = h . n & h . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat holds h . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),(h . n) ) ) & ex h being ManySortedSet of NAT st
( b2 = h . n & h . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat holds h . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),(h . n) ) ) holds
b1 = b2
existence
ex b1 being Element of InnerVertices (n -BitSubtracterStr x,y) ex h being ManySortedSet of NAT st
( b1 = h . n & h . 0 = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for n being Nat holds h . (n + 1) = BorrowOutput (x . (n + 1)),(y . (n + 1)),(h . n) ) )
end;
:: deftheorem Def3 defines -BitBorrowOutput FSCIRC_2:def 3 :
theorem Th1: :: FSCIRC_2:1 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y being
FinSequence for
f,
g,
h being
ManySortedSet of
NAT st
f . 0
= 1GateCircStr <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
g . 0
= 1GateCircuit <*> ,
((0 -tuples_on BOOLEAN ) --> TRUE ) &
h . 0
= [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] & ( for
n being
Nat for
S being non
empty ManySortedSign for
A being
non-empty MSAlgebra of
S for
z being
set st
S = f . n &
A = g . n &
z = h . n holds
(
f . (n + 1) = S +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),z) &
g . (n + 1) = A +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),z) &
h . (n + 1) = BorrowOutput (x . (n + 1)),
(y . (n + 1)),
z ) ) holds
for
n being
Nat holds
(
n -BitSubtracterStr x,
y = f . n &
n -BitSubtracterCirc x,
y = g . n &
n -BitBorrowOutput x,
y = h . n )
theorem Th2: :: FSCIRC_2:2 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th3: :: FSCIRC_2:3 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
a,
b being
FinSequence for
c being
set st
c = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] holds
( 1
-BitSubtracterStr a,
b = (1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE )) +* (BitSubtracterWithBorrowStr (a . 1),(b . 1),c) & 1
-BitSubtracterCirc a,
b = (1GateCircuit <*> ,((0 -tuples_on BOOLEAN ) --> TRUE )) +* (BitSubtracterWithBorrowCirc (a . 1),(b . 1),c) & 1
-BitBorrowOutput a,
b = BorrowOutput (a . 1),
(b . 1),
c )
theorem :: FSCIRC_2:4 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
a,
b,
c being
set st
c = [<*> ,((0 -tuples_on BOOLEAN ) --> TRUE )] holds
( 1
-BitSubtracterStr <*a*>,
<*b*> = (1GateCircStr <*> ,((0 -tuples_on BOOLEAN ) --> TRUE )) +* (BitSubtracterWithBorrowStr a,b,c) & 1
-BitSubtracterCirc <*a*>,
<*b*> = (1GateCircuit <*> ,((0 -tuples_on BOOLEAN ) --> TRUE )) +* (BitSubtracterWithBorrowCirc a,b,c) & 1
-BitBorrowOutput <*a*>,
<*b*> = BorrowOutput a,
b,
c )
theorem Th5: :: FSCIRC_2:5 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
n being
Nat for
p,
q being
FinSeqLen of
n for
p1,
p2,
q1,
q2 being
FinSequence holds
(
n -BitSubtracterStr (p ^ p1),
(q ^ q1) = n -BitSubtracterStr (p ^ p2),
(q ^ q2) &
n -BitSubtracterCirc (p ^ p1),
(q ^ q1) = n -BitSubtracterCirc (p ^ p2),
(q ^ q2) &
n -BitBorrowOutput (p ^ p1),
(q ^ q1) = n -BitBorrowOutput (p ^ p2),
(q ^ q2) )
theorem :: FSCIRC_2:6 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
n being
Nat for
x,
y being
FinSeqLen of
n for
a,
b being
set holds
(
(n + 1) -BitSubtracterStr (x ^ <*a*>),
(y ^ <*b*>) = (n -BitSubtracterStr x,y) +* (BitSubtracterWithBorrowStr a,b,(n -BitBorrowOutput x,y)) &
(n + 1) -BitSubtracterCirc (x ^ <*a*>),
(y ^ <*b*>) = (n -BitSubtracterCirc x,y) +* (BitSubtracterWithBorrowCirc a,b,(n -BitBorrowOutput x,y)) &
(n + 1) -BitBorrowOutput (x ^ <*a*>),
(y ^ <*b*>) = BorrowOutput a,
b,
(n -BitBorrowOutput x,y) )
theorem Th7: :: FSCIRC_2:7 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
n being
Nat for
x,
y being
FinSequence holds
(
(n + 1) -BitSubtracterStr x,
y = (n -BitSubtracterStr x,y) +* (BitSubtracterWithBorrowStr (x . (n + 1)),(y . (n + 1)),(n -BitBorrowOutput x,y)) &
(n + 1) -BitSubtracterCirc x,
y = (n -BitSubtracterCirc x,y) +* (BitSubtracterWithBorrowCirc (x . (n + 1)),(y . (n + 1)),(n -BitBorrowOutput x,y)) &
(n + 1) -BitBorrowOutput x,
y = BorrowOutput (x . (n + 1)),
(y . (n + 1)),
(n -BitBorrowOutput x,y) )
theorem Th8: :: FSCIRC_2:8 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: FSCIRC_2:9 :: Showing IDV graph ... (Click the Palm Tree again to close it)
definition
let k,
n be
Nat;
assume A1:
(
k >= 1 &
k <= n )
;
let x,
y be
FinSequence;
func k,
n -BitSubtracterOutput x,
y -> Element of
InnerVertices (n -BitSubtracterStr x,y) means :
Def4:
:: FSCIRC_2:def 4
ex
i being
Nat st
(
k = i + 1 &
it = BitSubtracterOutput (x . k),
(y . k),
(i -BitBorrowOutput x,y) );
uniqueness
for b1, b2 being Element of InnerVertices (n -BitSubtracterStr x,y) st ex i being Nat st
( k = i + 1 & b1 = BitSubtracterOutput (x . k),(y . k),(i -BitBorrowOutput x,y) ) & ex i being Nat st
( k = i + 1 & b2 = BitSubtracterOutput (x . k),(y . k),(i -BitBorrowOutput x,y) ) holds
b1 = b2
;
existence
ex b1 being Element of InnerVertices (n -BitSubtracterStr x,y) ex i being Nat st
( k = i + 1 & b1 = BitSubtracterOutput (x . k),(y . k),(i -BitBorrowOutput x,y) )
end;
:: deftheorem Def4 defines -BitSubtracterOutput FSCIRC_2:def 4 :
theorem :: FSCIRC_2:10 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: FSCIRC_2:11 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th12: :: FSCIRC_2:12 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set holds
InnerVertices (BorrowIStr x,y,c) = {[<*x,y*>,and2a ],[<*y,c*>,and2 ],[<*x,c*>,and2a ]}
theorem Th13: :: FSCIRC_2:13 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set st
x <> [<*y,c*>,and2 ] &
y <> [<*x,c*>,and2a ] &
c <> [<*x,y*>,and2a ] holds
InputVertices (BorrowIStr x,y,c) = {x,y,c}
theorem Th14: :: FSCIRC_2:14 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set holds
InnerVertices (BorrowStr x,y,c) = {[<*x,y*>,and2a ],[<*y,c*>,and2 ],[<*x,c*>,and2a ]} \/ {(BorrowOutput x,y,c)}
theorem Th15: :: FSCIRC_2:15 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set st
x <> [<*y,c*>,and2 ] &
y <> [<*x,c*>,and2a ] &
c <> [<*x,y*>,and2a ] holds
InputVertices (BorrowStr x,y,c) = {x,y,c}
theorem Th16: :: FSCIRC_2:16 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set st
x <> [<*y,c*>,and2 ] &
y <> [<*x,c*>,and2a ] &
c <> [<*x,y*>,and2a ] &
c <> [<*x,y*>,'xor' ] holds
InputVertices (BitSubtracterWithBorrowStr x,y,c) = {x,y,c}
theorem Th17: :: FSCIRC_2:17 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set holds
InnerVertices (BitSubtracterWithBorrowStr x,y,c) = ({[<*x,y*>,'xor' ],(2GatesCircOutput x,y,c,'xor' )} \/ {[<*x,y*>,and2a ],[<*y,c*>,and2 ],[<*x,c*>,and2a ]}) \/ {(BorrowOutput x,y,c)}
theorem Th18: :: FSCIRC_2:18 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th19: :: FSCIRC_2:19 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem Th20: :: FSCIRC_2:20 :: Showing IDV graph ... (Click the Palm Tree again to close it)
theorem :: FSCIRC_2:21 :: Showing IDV graph ... (Click the Palm Tree again to close it)
Lm1:
for x, y, c being set
for s being State of (BorrowCirc x,y,c)
for a1, a2, a3 being Element of BOOLEAN st a1 = s . x & a2 = s . y & a3 = s . c holds
( (Following s) . [<*x,y*>,and2a ] = ('not' a1) '&' a2 & (Following s) . [<*y,c*>,and2 ] = a2 '&' a3 & (Following s) . [<*x,c*>,and2a ] = ('not' a1) '&' a3 )
theorem Th22: :: FSCIRC_2:22 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set for
s being
State of
(BorrowCirc x,y,c) for
a1,
a2,
a3 being
Element of
BOOLEAN st
a1 = s . [<*x,y*>,and2a ] &
a2 = s . [<*y,c*>,and2 ] &
a3 = s . [<*x,c*>,and2a ] holds
(Following s) . (BorrowOutput x,y,c) = (a1 'or' a2) 'or' a3
Lm2:
for x, y, c being set st x <> [<*y,c*>,and2 ] & y <> [<*x,c*>,and2a ] & c <> [<*x,y*>,and2a ] holds
for s being State of (BorrowCirc x,y,c)
for a1, a2, a3 being Element of BOOLEAN st a1 = s . x & a2 = s . y & a3 = s . c holds
( (Following s,2) . (BorrowOutput x,y,c) = ((('not' a1) '&' a2) 'or' (a2 '&' a3)) 'or' (('not' a1) '&' a3) & (Following s,2) . [<*x,y*>,and2a ] = ('not' a1) '&' a2 & (Following s,2) . [<*y,c*>,and2 ] = a2 '&' a3 & (Following s,2) . [<*x,c*>,and2a ] = ('not' a1) '&' a3 )
theorem Th23: :: FSCIRC_2:23 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set st
x <> [<*y,c*>,and2 ] &
y <> [<*x,c*>,and2a ] &
c <> [<*x,y*>,and2a ] &
c <> [<*x,y*>,'xor' ] holds
for
s being
State of
(BorrowCirc x,y,c) holds
Following s,2 is
stable
theorem :: FSCIRC_2:24 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set st
x <> [<*y,c*>,and2 ] &
y <> [<*x,c*>,and2a ] &
c <> [<*x,y*>,and2a ] &
c <> [<*x,y*>,'xor' ] holds
for
s being
State of
(BitSubtracterWithBorrowCirc x,y,c) for
a1,
a2,
a3 being
Element of
BOOLEAN st
a1 = s . x &
a2 = s . y &
a3 = s . c holds
(
(Following s,2) . (BitSubtracterOutput x,y,c) = (a1 'xor' a2) 'xor' a3 &
(Following s,2) . (BorrowOutput x,y,c) = ((('not' a1) '&' a2) 'or' (a2 '&' a3)) 'or' (('not' a1) '&' a3) )
theorem Th25: :: FSCIRC_2:25 :: Showing IDV graph ... (Click the Palm Tree again to close it)
for
x,
y,
c being
set st
x <> [<*y,c*>,and2 ] &
y <> [<*x,c*>,and2a ] &
c <> [<*x,y*>,and2a ] &
c <> [<*x,y*>,'xor' ] holds
for
s being
State of
(BitSubtracterWithBorrowCirc x,y,c) holds
Following s,2 is
stable
theorem :: FSCIRC_2:26 :: Showing IDV graph ... (Click the Palm Tree again to close it)