:: A Theory of Boolean Valued Functions and Partitions
:: by Shunichi Kobayashi and Kui Jia
::
:: Received October 22, 1998
:: Copyright (c) 1998 Association of Mizar Users

:: BVFUNC_1 semantic presentation

definition
let k, l be boolean set ;
canceled;
canceled;
redefine pred k <= l means :Def3: :: BVFUNC_1:def 3
k => l = TRUE ;
compatibility
( k <= l iff k => l = TRUE )
proof end;
end;

:: deftheorem BVFUNC_1:def 1 :
canceled;

:: deftheorem BVFUNC_1:def 2 :
canceled;

:: deftheorem Def3 defines <= BVFUNC_1:def 3 :
for k, l being boolean set holds
( k <= l iff k => l = TRUE );

definition
let Y be set ;
func BVF Y -> set equals :: BVFUNC_1:def 4
Funcs Y,BOOLEAN ;
correctness
coherence
Funcs Y,BOOLEAN is set
;
;
end;

:: deftheorem defines BVF BVFUNC_1:def 4 :
for Y being set holds BVF Y = Funcs Y,BOOLEAN ;

registration
let Y be set ;
cluster BVF Y -> non empty functional ;
coherence
( BVF Y is functional & not BVF Y is empty )
;
end;

registration
let Y be set ;
cluster -> boolean-valued Element of BVF Y;
coherence
for b1 being Element of BVF Y holds b1 is boolean-valued
;
end;

scheme :: BVFUNC_1:sch 1
BVFUniq1{ F1() -> non empty set , F2( set ) -> set } :
for f1, f2 being Element of Funcs F1(),BOOLEAN st ( for x being Element of F1() holds f1 . x = F2(x) ) & ( for x being Element of F1() holds f2 . x = F2(x) ) holds
f1 = f2
proof end;

definition
let Y be non empty set ;
let a be Element of BVF Y;
:: original: 'not'
redefine func 'not' a -> Element of BVF Y;
coherence
'not' a is Element of BVF Y
proof end;
let b be Element of BVF Y;
:: original: '&'
redefine func a '&' b -> Element of BVF Y;
coherence
a '&' b is Element of BVF Y
proof end;
end;

definition
let p, q be boolean-valued Function;
func p 'or' q -> boolean-valued Function means :Def5: :: BVFUNC_1:def 5
( dom it = (dom p) /\ (dom q) & ( for x being set st x in dom it holds
it . x = (p . x) 'or' (q . x) ) );
existence
ex b1 being boolean-valued Function st
( dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) 'or' (q . x) ) )
proof end;
uniqueness
for b1, b2 being boolean-valued Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) 'or' (q . x) ) & dom b2 = (dom p) /\ (dom q) & ( for x being set st x in dom b2 holds
b2 . x = (p . x) 'or' (q . x) ) holds
b1 = b2
proof end;
commutativity
for b1, p, q being boolean-valued Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) 'or' (q . x) ) holds
( dom b1 = (dom q) /\ (dom p) & ( for x being set st x in dom b1 holds
b1 . x = (q . x) 'or' (p . x) ) )
;
idempotence
for p being boolean-valued Function holds
( dom p = (dom p) /\ (dom p) & ( for x being set st x in dom p holds
p . x = (p . x) 'or' (p . x) ) )
;
func p 'xor' q -> Function means :Def6: :: BVFUNC_1:def 6
( dom it = (dom p) /\ (dom q) & ( for x being set st x in dom it holds
it . x = (p . x) 'xor' (q . x) ) );
existence
ex b1 being Function st
( dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) 'xor' (q . x) ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) 'xor' (q . x) ) & dom b2 = (dom p) /\ (dom q) & ( for x being set st x in dom b2 holds
b2 . x = (p . x) 'xor' (q . x) ) holds
b1 = b2
proof end;
commutativity
for b1 being Function
for p, q being boolean-valued Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) 'xor' (q . x) ) holds
( dom b1 = (dom q) /\ (dom p) & ( for x being set st x in dom b1 holds
b1 . x = (q . x) 'xor' (p . x) ) )
;
end;

:: deftheorem Def5 defines 'or' BVFUNC_1:def 5 :
for p, q, b3 being boolean-valued Function holds
( b3 = p 'or' q iff ( dom b3 = (dom p) /\ (dom q) & ( for x being set st x in dom b3 holds
b3 . x = (p . x) 'or' (q . x) ) ) );

:: deftheorem Def6 defines 'xor' BVFUNC_1:def 6 :
for p, q being boolean-valued Function
for b3 being Function holds
( b3 = p 'xor' q iff ( dom b3 = (dom p) /\ (dom q) & ( for x being set st x in dom b3 holds
b3 . x = (p . x) 'xor' (q . x) ) ) );

registration
let p, q be boolean-valued Function;
cluster p 'xor' q -> boolean-valued ;
coherence
p 'xor' q is boolean-valued
proof end;
end;

definition
let A be non empty set ;
let p, q be Element of Funcs A,BOOLEAN ;
:: original: 'or'
redefine func p 'or' q -> Element of Funcs A,BOOLEAN means :Def7: :: BVFUNC_1:def 7
for x being Element of A holds it . x = (p . x) 'or' (q . x);
coherence
p 'or' q is Element of Funcs A,BOOLEAN
proof end;
compatibility
for b1 being Element of Funcs A,BOOLEAN holds
( b1 = p 'or' q iff for x being Element of A holds b1 . x = (p . x) 'or' (q . x) )
proof end;
:: original: 'xor'
redefine func p 'xor' q -> Element of Funcs A,BOOLEAN means :: BVFUNC_1:def 8
for x being Element of A holds it . x = (p . x) 'xor' (q . x);
coherence
p 'xor' q is Element of Funcs A,BOOLEAN
proof end;
compatibility
for b1 being Element of Funcs A,BOOLEAN holds
( b1 = p 'xor' q iff for x being Element of A holds b1 . x = (p . x) 'xor' (q . x) )
proof end;
end;

:: deftheorem Def7 defines 'or' BVFUNC_1:def 7 :
for A being non empty set
for p, q, b4 being Element of Funcs A,BOOLEAN holds
( b4 = p 'or' q iff for x being Element of A holds b4 . x = (p . x) 'or' (q . x) );

:: deftheorem defines 'xor' BVFUNC_1:def 8 :
for A being non empty set
for p, q, b4 being Element of Funcs A,BOOLEAN holds
( b4 = p 'xor' q iff for x being Element of A holds b4 . x = (p . x) 'xor' (q . x) );

definition
let Y be non empty set ;
let a, b be Element of BVF Y;
:: original: 'or'
redefine func a 'or' b -> Element of BVF Y;
coherence
a 'or' b is Element of BVF Y
proof end;
:: original: 'xor'
redefine func a 'xor' b -> Element of BVF Y;
coherence
a 'xor' b is Element of BVF Y
proof end;
end;

definition
let p, q be boolean-valued Function;
func p 'imp' q -> Function means :Def9: :: BVFUNC_1:def 9
( dom it = (dom p) /\ (dom q) & ( for x being set st x in dom it holds
it . x = (p . x) => (q . x) ) );
existence
ex b1 being Function st
( dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) => (q . x) ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) => (q . x) ) & dom b2 = (dom p) /\ (dom q) & ( for x being set st x in dom b2 holds
b2 . x = (p . x) => (q . x) ) holds
b1 = b2
proof end;
func p 'eqv' q -> Function means :Def10: :: BVFUNC_1:def 10
( dom it = (dom p) /\ (dom q) & ( for x being set st x in dom it holds
it . x = (p . x) <=> (q . x) ) );
existence
ex b1 being Function st
( dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) <=> (q . x) ) )
proof end;
uniqueness
for b1, b2 being Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) <=> (q . x) ) & dom b2 = (dom p) /\ (dom q) & ( for x being set st x in dom b2 holds
b2 . x = (p . x) <=> (q . x) ) holds
b1 = b2
proof end;
commutativity
for b1 being Function
for p, q being boolean-valued Function st dom b1 = (dom p) /\ (dom q) & ( for x being set st x in dom b1 holds
b1 . x = (p . x) <=> (q . x) ) holds
( dom b1 = (dom q) /\ (dom p) & ( for x being set st x in dom b1 holds
b1 . x = (q . x) <=> (p . x) ) )
;
end;

:: deftheorem Def9 defines 'imp' BVFUNC_1:def 9 :
for p, q being boolean-valued Function
for b3 being Function holds
( b3 = p 'imp' q iff ( dom b3 = (dom p) /\ (dom q) & ( for x being set st x in dom b3 holds
b3 . x = (p . x) => (q . x) ) ) );

:: deftheorem Def10 defines 'eqv' BVFUNC_1:def 10 :
for p, q being boolean-valued Function
for b3 being Function holds
( b3 = p 'eqv' q iff ( dom b3 = (dom p) /\ (dom q) & ( for x being set st x in dom b3 holds
b3 . x = (p . x) <=> (q . x) ) ) );

registration
let p, q be boolean-valued Function;
cluster p 'imp' q -> boolean-valued ;
coherence
p 'imp' q is boolean-valued
proof end;
cluster p 'eqv' q -> boolean-valued ;
coherence
p 'eqv' q is boolean-valued
proof end;
end;

definition
let A be non empty set ;
let p, q be Element of Funcs A,BOOLEAN ;
:: original: 'imp'
redefine func p 'imp' q -> Element of Funcs A,BOOLEAN means :Def11: :: BVFUNC_1:def 11
for x being Element of A holds it . x = ('not' (p . x)) 'or' (q . x);
coherence
p 'imp' q is Element of Funcs A,BOOLEAN
proof end;
compatibility
for b1 being Element of Funcs A,BOOLEAN holds
( b1 = p 'imp' q iff for x being Element of A holds b1 . x = ('not' (p . x)) 'or' (q . x) )
proof end;
:: original: 'eqv'
redefine func p 'eqv' q -> Element of Funcs A,BOOLEAN means :Def12: :: BVFUNC_1:def 12
for x being Element of A holds it . x = 'not' ((p . x) 'xor' (q . x));
coherence
p 'eqv' q is Element of Funcs A,BOOLEAN
proof end;
compatibility
for b1 being Element of Funcs A,BOOLEAN holds
( b1 = p 'eqv' q iff for x being Element of A holds b1 . x = 'not' ((p . x) 'xor' (q . x)) )
proof end;
end;

:: deftheorem Def11 defines 'imp' BVFUNC_1:def 11 :
for A being non empty set
for p, q, b4 being Element of Funcs A,BOOLEAN holds
( b4 = p 'imp' q iff for x being Element of A holds b4 . x = ('not' (p . x)) 'or' (q . x) );

:: deftheorem Def12 defines 'eqv' BVFUNC_1:def 12 :
for A being non empty set
for p, q, b4 being Element of Funcs A,BOOLEAN holds
( b4 = p 'eqv' q iff for x being Element of A holds b4 . x = 'not' ((p . x) 'xor' (q . x)) );

definition
let Y be non empty set ;
let a, b be Element of BVF Y;
:: original: 'imp'
redefine func a 'imp' b -> Element of BVF Y;
coherence
a 'imp' b is Element of BVF Y
proof end;
:: original: 'eqv'
redefine func a 'eqv' b -> Element of BVF Y;
coherence
a 'eqv' b is Element of BVF Y
proof end;
end;

definition
let Y be non empty set ;
func O_el Y -> Element of Funcs Y,BOOLEAN means :Def13: :: BVFUNC_1:def 13
for x being Element of Y holds it . x = FALSE ;
existence
ex b1 being Element of Funcs Y,BOOLEAN st
for x being Element of Y holds b1 . x = FALSE
proof end;
uniqueness
for b1, b2 being Element of Funcs Y,BOOLEAN st ( for x being Element of Y holds b1 . x = FALSE ) & ( for x being Element of Y holds b2 . x = FALSE ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines O_el BVFUNC_1:def 13 :
for Y being non empty set
for b2 being Element of Funcs Y,BOOLEAN holds
( b2 = O_el Y iff for x being Element of Y holds b2 . x = FALSE );

definition
let Y be non empty set ;
func I_el Y -> Element of Funcs Y,BOOLEAN means :Def14: :: BVFUNC_1:def 14
for x being Element of Y holds it . x = TRUE ;
existence
ex b1 being Element of Funcs Y,BOOLEAN st
for x being Element of Y holds b1 . x = TRUE
proof end;
uniqueness
for b1, b2 being Element of Funcs Y,BOOLEAN st ( for x being Element of Y holds b1 . x = TRUE ) & ( for x being Element of Y holds b2 . x = TRUE ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines I_el BVFUNC_1:def 14 :
for Y being non empty set
for b2 being Element of Funcs Y,BOOLEAN holds
( b2 = I_el Y iff for x being Element of Y holds b2 . x = TRUE );

theorem :: BVFUNC_1:1
canceled;

theorem :: BVFUNC_1:2
canceled;

theorem :: BVFUNC_1:3
canceled;

theorem :: BVFUNC_1:4
for a being boolean-valued Function holds 'not' ('not' a) = a ;

theorem Th5: :: BVFUNC_1:5
for Y being non empty set holds
( 'not' (I_el Y) = O_el Y & 'not' (O_el Y) = I_el Y )
proof end;

theorem :: BVFUNC_1:6
for Y being non empty set
for a, b being Element of Funcs Y,BOOLEAN holds a '&' a = a ;

theorem :: BVFUNC_1:7
for Y being non empty set
for a, b, c being Element of Funcs Y,BOOLEAN holds (a '&' b) '&' c = a '&' (b '&' c)
proof end;

theorem Th8: :: BVFUNC_1:8
for Y being non empty set
for a being Element of Funcs Y,BOOLEAN holds a '&' (O_el Y) = O_el Y
proof end;

theorem Th9: :: BVFUNC_1:9
for Y being non empty set
for a being Element of Funcs Y,BOOLEAN holds a '&' (I_el Y) = a
proof end;

theorem :: BVFUNC_1:10
for Y being non empty set
for a being Element of Funcs Y,BOOLEAN holds a 'or' a = a ;

theorem :: BVFUNC_1:11
for Y being non empty set
for a, b, c being Element of Funcs Y,BOOLEAN holds (a 'or' b) 'or' c = a 'or' (b 'or' c)
proof end;

theorem Th12: :: BVFUNC_1:12
for Y being non empty set
for a being Element of Funcs Y,BOOLEAN holds a 'or' (O_el Y) = a
proof end;

theorem Th13: :: BVFUNC_1:13
for Y being non empty set
for a being Element of Funcs Y,BOOLEAN holds a 'or' (I_el Y) = I_el Y
proof end;

theorem :: BVFUNC_1:14
for Y being non empty set
for a, b, c being Element of Funcs Y,BOOLEAN holds (a '&' b) 'or' c = (a 'or' c) '&' (b 'or' c)
proof end;

theorem :: BVFUNC_1:15
for Y being non empty set
for a, b, c being Element of Funcs Y,BOOLEAN holds (a 'or' b) '&' c = (a '&' c) 'or' (b '&' c)
proof end;

theorem :: BVFUNC_1:16
for Y being non empty set
for a, b being Element of Funcs Y,BOOLEAN holds 'not' (a 'or' b) = ('not' a) '&' ('not' b)
proof end;

theorem :: BVFUNC_1:17
for Y being non empty set
for a, b being Element of Funcs Y,BOOLEAN holds 'not' (a '&' b) = ('not' a) 'or' ('not' b)
proof end;

definition
let Y be non empty set ;
let a, b be Element of Funcs Y,BOOLEAN ;
pred a '<' b means :Def15: :: BVFUNC_1:def 15
for x being Element of Y st a . x = TRUE holds
b . x = TRUE ;
reflexivity
for a being Element of Funcs Y,BOOLEAN
for x being Element of Y st a . x = TRUE holds
a . x = TRUE
;
end;

:: deftheorem Def15 defines '<' BVFUNC_1:def 15 :
for Y being non empty set
for a, b being Element of Funcs Y,BOOLEAN holds
( a '<' b iff for x being Element of Y st a . x = TRUE holds
b