:: BINOP_1 semantic presentation

definition
let f be Function;
let a be set , b be set ;
func c1 . c2,c3 -> set equals :: BINOP_1:def 1
f . [a,b];
correctness
coherence
f . [a,b] is set
;
;
end;

:: deftheorem Def1 defines . BINOP_1:def 1 :
for f being Function
for a, b being set holds f . a,b = f . [a,b];

definition
let A be non empty set , B be non empty set ;
let C be set ;
let f be Function of [:A,B:],C;
let a be Element of A;
let b be Element of B;
redefine func . as c4 . c5,c6 -> Element of a3;
coherence
f . a,b is Element of C
proof end;
end;

theorem Th1: :: BINOP_1:1
for X, Y, Z being set
for f1, f2 being Function of [:X,Y:],Z st ( for x, y being set st x in X & y in Y holds
f1 . x,y = f2 . x,y ) holds
f1 = f2
proof end;

theorem Th2: :: BINOP_1:2
for X, Y, Z being set
for f1, f2 being Function of [:X,Y:],Z st ( for a being Element of X
for b being Element of Y holds f1 . a,b = f2 . a,b ) holds
f1 = f2
proof end;

definition
let A be set ;
mode UnOp of a1 is Function of a1,a1;
mode BinOp of a1 is Function of [:a1,a1:],a1;
end;

scheme :: BINOP_1:sch 37
s37{ F1() -> set , F2() -> set , F3() -> set , P1[ set , set , set ] } :
ex f being Function of [:F1(),F2():],F3() st
for x, y being set st x in F1() & y in F2() holds
P1[x,y,f . x,y]
provided
E27: for x, y being set st x in F1() & y in F2() holds
ex z being set st
( z in F3() & P1[x,y,z] )
proof end;

scheme :: BINOP_1:sch 44
s44{ F1() -> set , F2() -> set , F3() -> set , F4( set , set ) -> set } :
ex f being Function of [:F1(),F2():],F3() st
for x, y being set st x in F1() & y in F2() holds
f . x,y = F4(x,y)
provided
E27: for x, y being set st x in F1() & y in F2() holds
F4(x,y) in F3()
proof end;

scheme :: BINOP_1:sch 46
s46{ F1() -> non empty set , F2() -> non empty set , F3() -> non empty set , P1[ set , set , set ] } :
ex f being Function of [:F1(),F2():],F3() st
for x being Element of F1()
for y being Element of F2() holds P1[x,y,f . x,y]
provided
E27: for x being Element of F1()
for y being Element of F2() ex z being Element of F3() st P1[x,y,z]
proof end;

scheme :: BINOP_1:sch 49
s49{ F1() -> non empty set , F2() -> non empty set , F3() -> non empty set , F4( Element of F1(), Element of F2()) -> Element of F3() } :
ex f being Function of [:F1(),F2():],F3() st
for x being Element of F1()
for y being Element of F2() holds f . x,y = F4(x,y)
proof end;

definition
let A be set ;
let o be BinOp of A;
attr a2 is commutative means :Def2: :: BINOP_1:def 2
for a, b being Element of A holds o . a,b = o . b,a;
attr a2 is associative means :Def3: :: BINOP_1:def 3
for a, b, c being Element of A holds o . a,(o . b,c) = o . (o . a,b),c;
attr a2 is idempotent means :Def4: :: BINOP_1:def 4
for a being Element of A holds o . a,a = a;
end;

:: deftheorem Def2 defines commutative BINOP_1:def 2 :
for A being set
for o being BinOp of A holds
( o is commutative iff for a, b being Element of A holds o . a,b = o . b,a );

:: deftheorem Def3 defines associative BINOP_1:def 3 :
for A being set
for o being BinOp of A holds
( o is associative iff for a, b, c being Element of A holds o . a,(o . b,c) = o . (o . a,b),c );

:: deftheorem Def4 defines idempotent BINOP_1:def 4 :
for A being set
for o being BinOp of A holds
( o is idempotent iff for a being Element of A holds o . a,a = a );

registration
cluster -> empty commutative associative M4([:{} ,{} :], {} );
coherence
for b1 being BinOp of {} holds
( b1 is empty & b1 is associative & b1 is commutative )
proof end;
end;

definition
let A be set ;
let e be Element of A;
let o be BinOp of A;
pred c2 is_a_left_unity_wrt c3 means :Def5: :: BINOP_1:def 5
for a being Element of A holds o . e,a = a;
pred c2 is_a_right_unity_wrt c3 means :Def6: :: BINOP_1:def 6
for a being Element of A holds o . a,e = a;
end;

:: deftheorem Def5 defines is_a_left_unity_wrt BINOP_1:def 5 :
for A being set
for e being Element of A
for o being BinOp of A holds
( e is_a_left_unity_wrt o iff for a being Element of A holds o . e,a = a );

:: deftheorem Def6 defines is_a_right_unity_wrt BINOP_1:def 6 :
for A being set
for e being Element of A
for o being BinOp of A holds
( e is_a_right_unity_wrt o iff for a being Element of A holds o . a,e = a );

definition
let A be set ;
let e be Element of A;
let o be BinOp of A;
pred c2 is_a_unity_wrt c3 means :: BINOP_1:def 7
( e is_a_left_unity_wrt o & e is_a_right_unity_wrt o );
end;

:: deftheorem Def7 defines is_a_unity_wrt BINOP_1:def 7 :
for A being set
for e being Element of A
for o being BinOp of A holds
( e is_a_unity_wrt o iff ( e is_a_left_unity_wrt o & e is_a_right_unity_wrt o ) );

theorem Th3: :: BINOP_1:3
canceled;

theorem Th4: :: BINOP_1:4
canceled;

theorem Th5: :: BINOP_1:5
canceled;

theorem Th6: :: BINOP_1:6
canceled;

theorem Th7: :: BINOP_1:7
canceled;

theorem Th8: :: BINOP_1:8
canceled;

theorem Th9: :: BINOP_1:9
canceled;

theorem Th10: :: BINOP_1:10
canceled;

theorem Th11: :: BINOP_1:11
for A being set
for o being BinOp of A
for e being Element of A holds
( e is_a_unity_wrt o iff for a being Element of A holds
( o . e,a = a & o . a,e = a ) )
proof end;

theorem Th12: :: BINOP_1:12
for A being set
for o being BinOp of A
for e being Element of A st o is commutative holds
( e is_a_unity_wrt o iff for a being Element of A holds o . e,a = a )
proof end;

theorem Th13: :: BINOP_1:13
for A being set
for o being BinOp of A
for e being Element of A st o is commutative holds
( e is_a_unity_wrt o iff for a being Element of A holds o . a,e = a )
proof end;

theorem Th14: :: BINOP_1:14
for A being set
for o being BinOp of A
for e being Element of A st o is commutative holds
( e is_a_unity_wrt o iff e is_a_left_unity_wrt o )
proof end;

theorem Th15: :: BINOP_1:15
for A being set
for o being BinOp of A
for e being Element of A st o is commutative holds
( e is_a_unity_wrt o iff e is_a_right_unity_wrt o )
proof end;

theorem Th16: :: BINOP_1:16
for A being set
for o being BinOp of A
for e being Element of A st o is commutative holds
( e is_a_left_unity_wrt o iff e is_a_right_unity_wrt o )
proof end;

theorem Th17: :: BINOP_1:17
for A being set
for o being BinOp of A
for e1, e2 being Element of A st e1 is_a_left_unity_wrt o & e2 is_a_right_unity_wrt o holds
e1 = e2
proof end;

theorem Th18: :: BINOP_1:18
for A being set
for o being BinOp of A
for e1, e2 being Element of A st e1 is_a_unity_wrt o & e2 is_a_unity_wrt o holds
e1 = e2
proof end;

definition
let A be set ;
let o be BinOp of A;
assume E27: ex e being Element of A st e is_a_unity_wrt o ;
func the_unity_wrt c2 -> Element of a1 means :: BINOP_1:def 8
it is_a_unity_wrt o;
existence
ex b1 being Element of A st b1 is_a_unity_wrt o
by ;
uniqueness
for b1, b2 being Element of A st b1 is_a_unity_wrt o & b2 is_a_unity_wrt o holds
b1 = b2
by ;
end;

:: deftheorem Def8 defines the_unity_wrt BINOP_1:def 8 :
for A being set
for o being BinOp of A st ex e being Element of A st e is_a_unity_wrt o holds
for b3 being Element of A holds
( b3 = the_unity_wrt o iff b3 is_a_unity_wrt o );

definition
let A be set ;
let o' be BinOp of A;
let o be BinOp of A;
pred c2 is_left_distributive_wrt c3 means :Def9: :: BINOP_1:def 9
for a, b, c being Element of A holds o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c);
pred c2 is_right_distributive_wrt c3 means :Def10: :: BINOP_1:def 10
for a, b, c being Element of A holds o' . (o . a,b),c = o . (o' . a,c),(o' . b,c);
end;

:: deftheorem Def9 defines is_left_distributive_wrt BINOP_1:def 9 :
for A being set
for o', o being BinOp of A holds
( o' is_left_distributive_wrt o iff for a, b, c being Element of A holds o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c) );

:: deftheorem Def10 defines is_right_distributive_wrt BINOP_1:def 10 :
for A being set
for o', o being BinOp of A holds
( o' is_right_distributive_wrt o iff for a, b, c being Element of A holds o' . (o . a,b),c = o . (o' . a,c),(o' . b,c) );

definition
let A be set ;
let o' be BinOp of A;
let o be BinOp of A;
pred c2 is_distributive_wrt c3 means :: BINOP_1:def 11
( o' is_left_distributive_wrt o & o' is_right_distributive_wrt o );
end;

:: deftheorem Def11 defines is_distributive_wrt BINOP_1:def 11 :
for A being set
for o', o being BinOp of A holds
( o' is_distributive_wrt o iff ( o' is_left_distributive_wrt o & o' is_right_distributive_wrt o ) );

theorem Th19: :: BINOP_1:19
canceled;

theorem Th20: :: BINOP_1:20
canceled;

theorem Th21: :: BINOP_1:21
canceled;

theorem Th22: :: BINOP_1:22
canceled;

theorem Th23: :: BINOP_1:23
for A being set
for o', o being BinOp of A holds
( o' is_distributive_wrt o iff for a, b, c being Element of A holds
( o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c) & o' . (o . a,b),c = o . (o' . a,c),(o' . b,c) ) )
proof end;

theorem Th24: :: BINOP_1:24
for A being non empty set
for o, o' being BinOp of A st o' is commutative holds
( o' is_distributive_wrt o iff for a, b, c being Element of A holds o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c) )
proof end;

theorem Th25: :: BINOP_1:25
for A being non empty set
for o, o' being BinOp of A st o' is commutative holds
( o' is_distributive_wrt o iff for a, b, c being Element of A holds o' . (o . a,b),c = o . (o' . a,c),(o' . b,c) )
proof end;

theorem Th26: :: BINOP_1:26
for A being non empty set
for o, o' being BinOp of A st o' is commutative holds
( o' is_distributive_wrt o iff o' is_left_distributive_wrt o )
proof end;

theorem Th27: :: BINOP_1:27
for A being non empty set
for o, o' being BinOp of A st o' is commutative holds
( o' is_distributive_wrt o iff o' is_right_distributive_wrt o )
proof end;

theorem Th28: :: BINOP_1:28
for A being non empty set
for o, o' being BinOp of A st o' is commutative holds
( o' is_right_distributive_wrt o iff o' is_left_distributive_wrt o )
proof end;

definition
let A be set ;
let u be UnOp of A;
let o be BinOp of A;
pred c2 is_distributive_wrt c3 means :Def12: :: BINOP_1:def 12
for a, b being Element of A holds u . (o . a,b) = o . (u . a),(u . b);
end;

:: deftheorem Def12 defines is_distributive_wrt BINOP_1:def 12 :
for A being set
for u being UnOp of A
for o being BinOp of A holds
( u is_distributive_wrt o iff for a, b being Element of A holds u . (o . a,b) = o . (u . a),(u . b) );

definition
let A be non empty set ;
let o be BinOp of A;
redefine attr a2 is commutative means :: BINOP_1:def 13
for a, b being Element of A holds o . a,b = o . b,a;
correctness
compatibility
( o is commutative iff for a, b being Element of A holds o . a,b = o . b,a )
;
by ;
redefine attr a2 is associative means :: BINOP_1:def 14
for a, b, c being Element of A holds o . a,(o . b,c) = o . (o . a,b),c;
correctness
compatibility
( o is associative iff for a, b, c being Element of A holds o . a,(o . b,c) = o . (o . a,b),c )
;
by ;
redefine attr a2 is idempotent means :: BINOP_1:def 15
for a being Element of A holds o . a,a = a;
correctness
compatibility
( o is idempotent iff for a being Element of A holds o . a,a = a )
;
by ;
end;

:: deftheorem Def13 defines commutative BINOP_1:def 13 :
for A being non empty set
for o being BinOp of A holds
( o is commutative iff for a, b being Element of A holds o . a,b = o . b,a );

:: deftheorem Def14 defines associative BINOP_1:def 14 :
for A being non empty set
for o being BinOp of A holds
( o is associative iff for a, b, c being Element of A holds o . a,(o . b,c) = o . (o . a,b),c );

:: deftheorem Def15 defines idempotent BINOP_1:def 15 :
for A being non empty set
for o being BinOp of A holds
( o is idempotent iff for a being Element of A holds o . a,a = a );

definition
let A be non empty set ;
let e be Element of A;
let o be BinOp of A;
redefine pred c2 is_a_left_unity_wrt c3 means :: BINOP_1:def 16
for a being Element of A holds o . e,a = a;
correctness
compatibility
( e is_a_left_unity_wrt o iff for a being Element of A holds o . e,a = a )
;
by ;
redefine pred c2 is_a_right_unity_wrt c3 means :: BINOP_1:def 17
for a being Element of A holds o . a,e = a;
correctness
compatibility
( e is_a_right_unity_wrt o iff for a being Element of A holds o . a,e = a )
;
by ;
end;

:: deftheorem Def16 defines is_a_left_unity_wrt BINOP_1:def 16 :
for A being non empty set
for e being Element of A
for o being BinOp of A holds
( e is_a_left_unity_wrt o iff for a being Element of A holds o . e,a = a );

:: deftheorem Def17 defines is_a_right_unity_wrt BINOP_1:def 17 :
for A being non empty set
for e being Element of A
for o being BinOp of A holds
( e is_a_right_unity_wrt o iff for a being Element of A holds o . a,e = a );

definition
let A be non empty set ;
let o' be BinOp of A, o be BinOp of A;
redefine pred c2 is_left_distributive_wrt c3 means :: BINOP_1:def 18
for a, b, c being Element of A holds o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c);
correctness
compatibility
( o' is_left_distributive_wrt o iff for a, b, c being Element of A holds o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c) )
;
by ;
redefine pred c2 is_right_distributive_wrt c3 means :: BINOP_1:def 19
for a, b, c being Element of A holds o' . (o . a,b),c = o . (o' . a,c),(o' . b,c);
correctness
compatibility
( o' is_right_distributive_wrt o iff for a, b, c being Element of A holds o' . (o . a,b),c = o . (o' . a,c),(o' . b,c) )
;
by ;
end;

:: deftheorem Def18 defines is_left_distributive_wrt BINOP_1:def 18 :
for A being non empty set
for o', o being BinOp of A holds
( o' is_left_distributive_wrt o iff for a, b, c being Element of A holds o' . a,(o . b,c) = o . (o' . a,b),(o' . a,c) );

:: deftheorem Def19 defines is_right_distributive_wrt BINOP_1:def 19 :
for A being non empty set
for o', o being BinOp of A holds
( o' is_right_distributive_wrt o iff for a, b, c being Element of A holds o' . (o . a,b),c = o . (o' . a,c),(o' . b,c) );

definition
let A be non empty set ;
let u be UnOp of A;
let o be BinOp of A;
redefine pred c2 is_distributive_wrt c3 means :: BINOP_1:def 20
for a, b being Element of A holds u . (o . a,b) = o . (u . a),(u . b);
correctness
compatibility
( u is_distributive_wrt o iff for a, b being Element of A holds u . (o . a,b) = o . (u . a),(u . b) )
;
by ;
end;

:: deftheorem Def20 defines is_distributive_wrt BINOP_1:def 20 :
for A being non empty set
for u being UnOp of A
for o being BinOp of A holds
( u is_distributive_wrt o iff for a, b being Element of A holds u . (o . a,b) = o . (u . a),(u . b) );

theorem Th29: :: BINOP_1:29
for X, Y, Z, x, y being set
for f being Function of [:X,Y:],Z st x in X & y in Y & Z <> {} holds
f . x,y in Z
proof end;

theorem Th30: :: BINOP_1:30
for x, y, X, Y, Z being set
for f being Function of [:X,Y:],Z
for g being Function st Z <> {} & x in X & y in Y holds
(g * f) . x,y = g . (f . x,y)
proof end;

theorem Th31: :: BINOP_1:31
for X, Y being set
for f being Function st dom f = [:X,Y:] holds
( f is constant iff for x1, x2, y1, y2 being set st x1 in X & x2 in X & y1 in Y & y2 in Y holds
f . x1,y1 = f . x2,y2 )
proof end;