:: BINOP_1 semantic presentation

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

:: deftheorem Def1 defines . BINOP_1:def 1 :
for b1 being Function
for b2, b3 being set holds b1 . b2,b3 = b1 . [b2,b3];

definition
let c1, c2 be non empty set ;
let c3 be set ;
let c4 be Function of [:c1,c2:],c3;
let c5 be Element of c1;
let c6 be Element of c2;
redefine func . as c4 . c5,c6 -> Element of a3;
coherence
c4 . c5,c6 is Element of c3
proof
reconsider c7 = [c5,c6] as Element of [:c1,c2:] by ZFMISC_1:def 2;
c4 . c7 is Element of c3 ;
hence c4 . c5,c6 is Element of c3 ;
end;
end;

theorem Th1: :: BINOP_1:1
for b1, b2, b3 being set
for b4, b5 being Function of [:b1,b2:],b3 holds
( ( for b6, b7 being set holds
( b6 in b1 & b7 in b2 implies b4 . b6,b7 = b5 . b6,b7 ) ) implies b4 = b5 )
proof
let c1, c2, c3 be set ;
let c4, c5 be Function of [:c1,c2:],c3;
assume E2: for b1, b2 being set holds
( b1 in c1 & b2 in c2 implies c4 . b1,b2 = c5 . b1,b2 ) ;
for b1 being set holds
( b1 in [:c1,c2:] implies c4 . b1 = c5 . b1 )
proof
let c6 be set ;
assume c6 in [:c1,c2:] ;
then consider c7, c8 being set such that
E3: ( c7 in c1 & c8 in c2 ) and
E4: c6 = [c7,c8] by ZFMISC_1:def 2;
( c4 . c7,c8 = c4 . c6 & c5 . c7,c8 = c5 . c6 ) by E4;
hence c4 . c6 = c5 . c6 by E2, E3;
end;
hence c4 = c5 by FUNCT_2:18;
end;

theorem Th2: :: BINOP_1:2
for b1, b2, b3 being set
for b4, b5 being Function of [:b1,b2:],b3 holds
( ( for b6 being Element of b1
for b7 being Element of b2 holds b4 . b6,b7 = b5 . b6,b7 ) implies b4 = b5 )
proof
let c1, c2, c3 be set ;
let c4, c5 be Function of [:c1,c2:],c3;
assume for b1 being Element of c1
for b2 being Element of c2 holds c4 . b1,b2 = c5 . b1,b2 ;
then for b1, b2 being set holds
( b1 in c1 & b2 in c2 implies c4 . b1,b2 = c5 . b1,b2 ) ;
hence c4 = c5 by Th1;
end;

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

scheme :: BINOP_1:sch 1
s1{ F1() -> set , F2() -> set , F3() -> set , P1[ set , set , set ] } :
ex b1 being Function of [:F1(),F2():],F3() st
for b2, b3 being set holds
( b2 in F1() & b3 in F2() implies P1[b2,b3,b1 . b2,b3] )
provided
E2: for b1, b2 being set holds
not ( b1 in F1() & b2 in F2() & ( for b3 being set holds
not ( b3 in F3() & P1[b1,b2,b3] ) ) )
proof
defpred S1[ set , set ] means for b1, b2 being set holds
( a1 = [b1,b2] implies P1[b1,b2,a2] );
E3: for b1 being set holds
not ( b1 in [:F1(),F2():] & ( for b2 being set holds
not ( b2 in F3() & S1[b1,b2] ) ) )
proof
let c1 be set ;
assume c1 in [:F1(),F2():] ;
then consider c2, c3 being set such that
E4: ( c2 in F1() & c3 in F2() ) and
E5: c1 = [c2,c3] by ZFMISC_1:def 2;
consider c4 being set such that
E6: c4 in F3() and
E7: P1[c2,c3,c4] by E2, E4;
take c4 ;
thus c4 in F3() by E6;
let c5, c6 be set ;
assume c1 = [c5,c6] ;
then ( c2 = c5 & c3 = c6 ) by E5, ZFMISC_1:33;
hence P1[c5,c6,c4] by E7;
end;
consider c1 being Function of [:F1(),F2():],F3() such that
E4: for b1 being set holds
( b1 in [:F1(),F2():] implies S1[b1,c1 . b1] ) from FUNCT_2:sch 1(E3);
take c1 ;
let c2, c3 be set ;
assume ( c2 in F1() & c3 in F2() ) ;
then [c2,c3] in [:F1(),F2():] by ZFMISC_1:def 2;
hence P1[c2,c3,c1 . c2,c3] by E4;
end;

scheme :: BINOP_1:sch 2
s2{ F1() -> set , F2() -> set , F3() -> set , F4( set , set ) -> set } :
ex b1 being Function of [:F1(),F2():],F3() st
for b2, b3 being set holds
( b2 in F1() & b3 in F2() implies b1 . b2,b3 = F4(b2,b3) )
provided
E2: for b1, b2 being set holds
( b1 in F1() & b2 in F2() implies F4(b1,b2) in F3() )
proof
defpred S1[ set , set , set ] means a3 = F4(a1,a2);
E3: for b1, b2 being set holds
not ( b1 in F1() & b2 in F2() & ( for b3 being set holds
not ( b3 in F3() & S1[b1,b2,b3] ) ) )
proof
let c1, c2 be set ;
assume E4: ( c1 in F1() & c2 in F2() ) ;
take F4(c1,c2) ;
thus ( F4(c1,c2) in F3() & S1[c1,c2,F4(c1,c2)] ) by E2, E4;
end;
thus ex b1 being Function of [:F1(),F2():],F3() st
for b2, b3 being set holds
( b2 in F1() & b3 in F2() implies S1[b2,b3,b1 . b2,b3] ) from BINOP_1:sch 1(E3);
end;

scheme :: BINOP_1:sch 3
s3{ F1() -> non empty set , F2() -> non empty set , F3() -> non empty set , P1[ set , set , set ] } :
ex b1 being Function of [:F1(),F2():],F3() st
for b2 being Element of F1()
for b3 being Element of F2() holds P1[b2,b3,b1 . b2,b3]
provided
E2: for b1 being Element of F1()
for b2 being Element of F2() holds
ex b3 being Element of F3() st P1[b1,b2,b3]
proof
defpred S1[ set , set ] means for b1 being Element of F1()
for b2 being Element of F2() holds
( a1 = [b1,b2] implies P1[b1,b2,a2] );
E3: for b1 being Element of [:F1(),F2():] holds
ex b2 being Element of F3() st
S1[b1,b2]
proof
let c1 be Element of [:F1(),F2():];
consider c2, c3 being set such that
E4: c2 in F1() and
E5: c3 in F2() and
E6: c1 = [c2,c3] by ZFMISC_1:def 2;
reconsider c4 = c2 as Element of F1() by E4;
reconsider c5 = c3 as Element of F2() by E5;
consider c6 being Element of F3() such that
E7: P1[c4,c5,c6] by E2;
take c6 ;
let c7 be Element of F1();
let c8 be Element of F2();
assume c1 = [c7,c8] ;
then ( c4 = c7 & c5 = c8 ) by E6, ZFMISC_1:33;
hence P1[c7,c8,c6] by E7;
end;
consider c1 being Function of [:F1(),F2():],F3() such that
E4: for b1 being Element of [:F1(),F2():] holds
S1[b1,c1 . b1] from FUNCT_2:sch 3(E3);
take c1 ;
let c2 be Element of F1();
let c3 be Element of F2();
reconsider c4 = [c2,c3] as Element of [:F1(),F2():] by ZFMISC_1:def 2;
P1[c2,c3,c1 . c4] by E4;
hence P1[c2,c3,c1 . c2,c3] ;
end;

scheme :: BINOP_1:sch 4
s4{ F1() -> non empty set , F2() -> non empty set , F3() -> non empty set , F4( Element of F1(), Element of F2()) -> Element of F3() } :
ex b1 being Function of [:F1(),F2():],F3() st
for b2 being Element of F1()
for b3 being Element of F2() holds b1 . b2,b3 = F4(b2,b3)
proof
defpred S1[ Element of F1(), Element of F2(), set ] means a3 = F4(a1,a2);
E2: for b1 being Element of F1()
for b2 being Element of F2() holds
ex b3 being Element of F3() st
S1[b1,b2,b3] ;
thus ex b1 being Function of [:F1(),F2():],F3() st
for b2 being Element of F1()
for b3 being Element of F2() holds
S1[b2,b3,b1 . b2,b3] from BINOP_1:sch 3(E2);
end;

definition
let c1 be set ;
let c2 be BinOp of c1;
attr a2 is commutative means :Def2: :: BINOP_1:def 2
for b1, b2 being Element of a1 holds a2 . b1,b2 = a2 . b2,b1;
attr a2 is associative means :Def3: :: BINOP_1:def 3
for b1, b2, b3 being Element of a1 holds a2 . b1,(a2 . b2,b3) = a2 . (a2 . b1,b2),b3;
attr a2 is idempotent means :Def4: :: BINOP_1:def 4
for b1 being Element of a1 holds a2 . b1,b1 = b1;
end;

:: deftheorem Def2 defines commutative BINOP_1:def 2 :
for b1 being set
for b2 being BinOp of b1 holds
( b2 is commutative iff for b3, b4 being Element of b1 holds b2 . b3,b4 = b2 . b4,b3 );

:: deftheorem Def3 defines associative BINOP_1:def 3 :
for b1 being set
for b2 being BinOp of b1 holds
( b2 is associative iff for b3, b4, b5 being Element of b1 holds b2 . b3,(b2 . b4,b5) = b2 . (b2 . b3,b4),b5 );

:: deftheorem Def4 defines idempotent BINOP_1:def 4 :
for b1 being set
for b2 being BinOp of b1 holds
( b2 is idempotent iff for b3 being Element of b1 holds b2 . b3,b3 = b3 );

registration
cluster -> empty commutative associative M4([:{} ,{} :], {} );
coherence
for b1 being BinOp of {} holds
( b1 is empty & b1 is associative & b1 is commutative )
proof
let c1 be BinOp of {} ;
E5: [:{} ,{} :] = {} by ZFMISC_1:113;
then E6: ( c1 c= [:(dom c1),(rng c1):] & dom c1 = {} & rng c1 c= {} ) by FUNCT_2:def 1, RELAT_1:21, RELSET_1:12;
thus c1 is empty by E5, XBOOLE_1:3;
hereby :: according to BINOP_1:def 3
let c2, c3, c4 be Element of {} ;
thus c1 . c2,(c1 . c3,c4) = {} by E6, FUNCT_1:def 4
.= c1 . (c1 . c2,c3),c4 by E6, FUNCT_1:def 4 ;
end;
let c2, c3 be Element of {} ; :: according to BINOP_1:def 2
thus c1 . c2,c3 = {} by E6, FUNCT_1:def 4
.= c1 . c3,c2 by E6, FUNCT_1:def 4 ;
end;
end;

definition
let c1 be set ;
let c2 be Element of c1;
let c3 be BinOp of c1;
pred c2 is_a_left_unity_wrt c3 means :Def5: :: BINOP_1:def 5
for b1 being Element of a1 holds a3 . a2,b1 = b1;
pred c2 is_a_right_unity_wrt c3 means :Def6: :: BINOP_1:def 6
for b1 being Element of a1 holds a3 . b1,a2 = b1;
end;

:: deftheorem Def5 defines is_a_left_unity_wrt BINOP_1:def 5 :
for b1 being set
for b2 being Element of b1
for b3 being BinOp of b1 holds
( b2 is_a_left_unity_wrt b3 iff for b4 being Element of b1 holds b3 . b2,b4 = b4 );

:: deftheorem Def6 defines is_a_right_unity_wrt BINOP_1:def 6 :
for b1 being set
for b2 being Element of b1
for b3 being BinOp of b1 holds
( b2 is_a_right_unity_wrt b3 iff for b4 being Element of b1 holds b3 . b4,b2 = b4 );

definition
let c1 be set ;
let c2 be Element of c1;
let c3 be BinOp of c1;
pred c2 is_a_unity_wrt c3 means :: BINOP_1:def 7
( a2 is_a_left_unity_wrt a3 & a2 is_a_right_unity_wrt a3 );
end;

:: deftheorem Def7 defines is_a_unity_wrt BINOP_1:def 7 :
for b1 being set
for b2 being Element of b1
for b3 being BinOp of b1 holds
( b2 is_a_unity_wrt b3 iff ( b2 is_a_left_unity_wrt b3 & b2 is_a_right_unity_wrt b3 ) );

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 b1 being set
for b2 being BinOp of b1
for b3 being Element of b1 holds
( b3 is_a_unity_wrt b2 iff for b4 being Element of b1 holds
( b2 . b3,b4 = b4 & b2 . b4,b3 = b4 ) )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3 be Element of c1;
thus ( c3 is_a_unity_wrt c2 implies for b1 being Element of c1 holds
( c2 . c3,b1 = b1 & c2 . b1,c3 = b1 ) )
proof
assume ( c3 is_a_left_unity_wrt c2 & c3 is_a_right_unity_wrt c2 ) ; :: according to BINOP_1:def 7
hence for b1 being Element of c1 holds
( c2 . c3,b1 = b1 & c2 . b1,c3 = b1 ) by Def5, Def6;
end;
assume for b1 being Element of c1 holds
( c2 . c3,b1 = b1 & c2 . b1,c3 = b1 ) ;
hence ( ( for b1 being Element of c1 holds c2 . c3,b1 = b1 ) & ( for b1 being Element of c1 holds c2 . b1,c3 = b1 ) ) ; :: according to BINOP_1:def 5,BINOP_1:def 6,BINOP_1:def 7
end;

theorem Th12: :: BINOP_1:12
for b1 being set
for b2 being BinOp of b1
for b3 being Element of b1 holds
( b2 is commutative implies ( b3 is_a_unity_wrt b2 iff for b4 being Element of b1 holds b2 . b3,b4 = b4 ) )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3 be Element of c1;
assume E9: c2 is commutative ;
now
thus ( ( for b1 being Element of c1 holds
( c2 . c3,b1 = b1 & c2 . b1,c3 = b1 ) ) implies for b1 being Element of c1 holds c2 . c3,b1 = b1 ) ;
assume E10: for b1 being Element of c1 holds c2 . c3,b1 = b1 ;
let c4 be Element of c1;
thus c2 . c3,c4 = c4 by E10;
thus c2 . c4,c3 = c2 . c3,c4 by E9, Def2
.= c4 by E10 ;
end;
hence ( c3 is_a_unity_wrt c2 iff for b1 being Element of c1 holds c2 . c3,b1 = b1 ) by Th11;
end;

theorem Th13: :: BINOP_1:13
for b1 being set
for b2 being BinOp of b1
for b3 being Element of b1 holds
( b2 is commutative implies ( b3 is_a_unity_wrt b2 iff for b4 being Element of b1 holds b2 . b4,b3 = b4 ) )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3 be Element of c1;
assume E10: c2 is commutative ;
now
thus ( ( for b1 being Element of c1 holds
( c2 . c3,b1 = b1 & c2 . b1,c3 = b1 ) ) implies for b1 being Element of c1 holds c2 . b1,c3 = b1 ) ;
assume E11: for b1 being Element of c1 holds c2 . b1,c3 = b1 ;
let c4 be Element of c1;
thus c2 . c3,c4 = c2 . c4,c3 by E10, Def2
.= c4 by E11 ;
thus c2 . c4,c3 = c4 by E11;
end;
hence ( c3 is_a_unity_wrt c2 iff for b1 being Element of c1 holds c2 . b1,c3 = b1 ) by Th11;
end;

theorem Th14: :: BINOP_1:14
for b1 being set
for b2 being BinOp of b1
for b3 being Element of b1 holds
( b2 is commutative implies ( b3 is_a_unity_wrt b2 iff b3 is_a_left_unity_wrt b2 ) )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3 be Element of c1;
( c3 is_a_left_unity_wrt c2 iff for b1 being Element of c1 holds c2 . c3,b1 = b1 ) by Def5;
hence ( c2 is commutative implies ( c3 is_a_unity_wrt c2 iff c3 is_a_left_unity_wrt c2 ) ) by Th12;
end;

theorem Th15: :: BINOP_1:15
for b1 being set
for b2 being BinOp of b1
for b3 being Element of b1 holds
( b2 is commutative implies ( b3 is_a_unity_wrt b2 iff b3 is_a_right_unity_wrt b2 ) )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3 be Element of c1;
( c3 is_a_right_unity_wrt c2 iff for b1 being Element of c1 holds c2 . b1,c3 = b1 ) by Def6;
hence ( c2 is commutative implies ( c3 is_a_unity_wrt c2 iff c3 is_a_right_unity_wrt c2 ) ) by Th13;
end;

theorem Th16: :: BINOP_1:16
for b1 being set
for b2 being BinOp of b1
for b3 being Element of b1 holds
( b2 is commutative implies ( b3 is_a_left_unity_wrt b2 iff b3 is_a_right_unity_wrt b2 ) )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3 be Element of c1;
assume E12: c2 is commutative ;
then ( c3 is_a_unity_wrt c2 iff c3 is_a_left_unity_wrt c2 ) by Th14;
hence ( c3 is_a_left_unity_wrt c2 iff c3 is_a_right_unity_wrt c2 ) by E12, Th15;
end;

theorem Th17: :: BINOP_1:17
for b1 being set
for b2 being BinOp of b1
for b3, b4 being Element of b1 holds
( b3 is_a_left_unity_wrt b2 & b4 is_a_right_unity_wrt b2 implies b3 = b4 )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3, c4 be Element of c1;
assume that
E13: c3 is_a_left_unity_wrt c2 and
E14: c4 is_a_right_unity_wrt c2 ;
thus c3 = c2 . c3,c4 by E14, Def6
.= c4 by E13, Def5 ;
end;

theorem Th18: :: BINOP_1:18
for b1 being set
for b2 being BinOp of b1
for b3, b4 being Element of b1 holds
( b3 is_a_unity_wrt b2 & b4 is_a_unity_wrt b2 implies b3 = b4 )
proof
let c1 be set ;
let c2 be BinOp of c1;
let c3, c4 be Element of c1;
assume ( c3 is_a_left_unity_wrt c2 & c3 is_a_right_unity_wrt c2 & c4 is_a_left_unity_wrt c2 & c4 is_a_right_unity_wrt c2 ) ; :: according to BINOP_1:def 7
hence c3 = c4 by Th17;
end;

definition
let c1 be set ;
let c2 be BinOp of c1;
assume E14: ex b1 being Element of c1 st b1 is_a_unity_wrt c2 ;
func the_unity_wrt c2 -> Element of a1 means :: BINOP_1:def 8
a3 is_a_unity_wrt a2;
existence
ex b1 being Element of c1 st b1 is_a_unity_wrt c2
by E14;
uniqueness
for b1, b2 being Element of c1 holds
( b1 is_a_unity_wrt c2 & b2 is_a_unity_wrt c2 implies b1 = b2 )
by Th18;
end;

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

definition
let c1 be set ;
let c2, c3 be BinOp of c1;
pred c2 is_left_distributive_wrt c3 means :Def9: :: BINOP_1:def 9
for b1, b2, b3 being Element of a1 holds a2 . b1,(a3 . b2,b3) = a3 . (a2 . b1,b2),(a2 . b1,b3);
pred c2 is_right_distributive_wrt c3 means :Def10: :: BINOP_1:def 10
for b1, b2, b3 being Element of a1 holds a2 . (a3 . b1,b2),b3 = a3 . (a2 . b1,b3),(a2 . b2,b3);
end;

:: deftheorem Def9 defines is_left_distributive_wrt BINOP_1:def 9 :
for b1 being set
for b2, b3 being BinOp of b1 holds
( b2 is_left_distributive_wrt b3 iff for b4, b5, b6 being Element of b1 holds b2 . b4,(b3 . b5,b6) = b3 . (b2 . b4,b5),(b2 . b4,b6) );

:: deftheorem Def10 defines is_right_distributive_wrt BINOP_1:def 10 :
for b1 being set
for b2, b3 being BinOp of b1 holds
( b2 is_right_distributive_wrt b3 iff for b4, b5, b6 being Element of b1 holds b2 . (b3 . b4,b5),b6 = b3 . (b2 . b4,b6),(b2 . b5,b6) );

definition
let c1 be set ;
let c2, c3 be BinOp of c1;
pred c2 is_distributive_wrt c3 means :: BINOP_1:def 11
( a2 is_left_distributive_wrt a3 & a2 is_right_distributive_wrt a3 );
end;

:: deftheorem Def11 defines is_distributive_wrt BINOP_1:def 11 :
for b1 being set
for b2, b3 being BinOp of b1 holds
( b2 is_distributive_wrt b3 iff ( b2 is_left_distributive_wrt b3 & b2 is_right_distributive_wrt b3 ) );

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 b1 being set
for b2, b3 being BinOp of b1 holds
( b2 is_distributive_wrt b3 iff for b4, b5, b6 being Element of b1 holds
( b2 . b4,(b3 . b5,b6) = b3 . (b2 . b4,b5),(b2 . b4,b6) & b2 . (b3 . b4,b5),b6 = b3 . (b2 . b4,b6),(b2 . b5,b6) ) )
proof
let c1 be set ;
let c2, c3 be BinOp of c1;
thus ( c2 is_distributive_wrt c3 implies for b1, b2, b3 being Element of c1 holds
( c2 . b1,(c3 . b2,b3) = c3 . (c2 . b1,b2),(c2 . b1,b3) & c2 . (c3 . b1,b2),b3 = c3 . (c2 . b1,b3),(c2 . b2,b3) ) )
proof
assume ( c2 is_left_distributive_wrt c3 & c2 is_right_distributive_wrt c3 ) ; :: according to BINOP_1:def 11
hence for b1, b2, b3 being Element of c1 holds
( c2 . b1,(c3 . b2,b3) = c3 . (c2 . b1,b2),(c2 . b1,b3) & c2 . (c3 . b1,b2),b3 = c3 . (c2 . b1,b3),(c2 . b2,b3) ) by Def9, Def10;
end;
assume for b1, b2, b3 being Element of c1 holds
( c2 . b1,(c3 . b2,b3) = c3 . (c2 . b1,b2),(c2 . b1,b3) & c2 . (c3 . b1,b2),b3 = c3 . (c2 . b1,b3),(c2 . b2,b3) ) ;
hence ( ( for b1, b2, b3 being Element of c1 holds c2 . b1,(c3 . b2,b3) = c3 . (c2 . b1,b2),(c2 . b1,b3) ) & ( for b1, b2, b3 being Element of c1 holds c2 . (c3 . b1,b2),b3 = c3 . (c2 . b1,b3),(c2 . b2,b3) ) ) ; :: according to BINOP_1:def 9,BINOP_1:def 10,BINOP_1:def 11
end;

theorem Th24: :: BINOP_1:24
for b1 being non empty set
for b2, b3 being BinOp of b1 holds
( b3 is commutative implies ( b3 is_distributive_wrt b2 iff for b4, b5, b6 being Element of b1 holds b3 . b4,(b2 . b5,b6) = b2 . (b3 . b4,b5),(b3 . b4,b6) ) )
proof
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
assume E18: c3 is commutative ;
( ( for b1, b2, b3 being Element of c1 holds
( c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) & c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) ) iff for b1, b2, b3 being Element of c1 holds c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) )
proof
thus ( ( for b1, b2, b3 being Element of c1 holds
( c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) & c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) ) implies for b1, b2, b3 being Element of c1 holds c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) ) ;
assume E19: for b1, b2, b3 being Element of c1 holds c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) ;
let c4, c5, c6 be Element of c1;
thus c3 . c4,(c2 . c5,c6) = c2 . (c3 . c4,c5),(c3 . c4,c6) by E19;
thus c3 . (c2 . c4,c5),c6 = c3 . c6,(c2 . c4,c5) by E18, Def2
.= c2 . (c3 . c6,c4),(c3 . c6,c5) by E19
.= c2 . (c3 . c4,c6),(c3 . c6,c5) by E18, Def2
.= c2 . (c3 . c4,c6),(c3 . c5,c6) by E18, Def2 ;
end;
hence ( c3 is_distributive_wrt c2 iff for b1, b2, b3 being Element of c1 holds c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) ) by Th23;
end;

theorem Th25: :: BINOP_1:25
for b1 being non empty set
for b2, b3 being BinOp of b1 holds
( b3 is commutative implies ( b3 is_distributive_wrt b2 iff for b4, b5, b6 being Element of b1 holds b3 . (b2 . b4,b5),b6 = b2 . (b3 . b4,b6),(b3 . b5,b6) ) )
proof
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
assume E19: c3 is commutative ;
( ( for b1, b2, b3 being Element of c1 holds
( c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) & c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) ) iff for b1, b2, b3 being Element of c1 holds c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) )
proof
thus ( ( for b1, b2, b3 being Element of c1 holds
( c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) & c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) ) implies for b1, b2, b3 being Element of c1 holds c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) ;
assume E20: for b1, b2, b3 being Element of c1 holds c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ;
let c4, c5, c6 be Element of c1;
thus c3 . c4,(c2 . c5,c6) = c3 . (c2 . c5,c6),c4 by E19, Def2
.= c2 . (c3 . c5,c4),(c3 . c6,c4) by E20
.= c2 . (c3 . c4,c5),(c3 . c6,c4) by E19, Def2
.= c2 . (c3 . c4,c5),(c3 . c4,c6) by E19, Def2 ;
thus c3 . (c2 . c4,c5),c6 = c2 . (c3 . c4,c6),(c3 . c5,c6) by E20;
end;
hence ( c3 is_distributive_wrt c2 iff for b1, b2, b3 being Element of c1 holds c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) by Th23;
end;

theorem Th26: :: BINOP_1:26
for b1 being non empty set
for b2, b3 being BinOp of b1 holds
( b3 is commutative implies ( b3 is_distributive_wrt b2 iff b3 is_left_distributive_wrt b2 ) )
proof
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
( c3 is_left_distributive_wrt c2 iff for b1, b2, b3 being Element of c1 holds c3 . b1,(c2 . b2,b3) = c2 . (c3 . b1,b2),(c3 . b1,b3) ) by Def9;
hence ( c3 is commutative implies ( c3 is_distributive_wrt c2 iff c3 is_left_distributive_wrt c2 ) ) by Th24;
end;

theorem Th27: :: BINOP_1:27
for b1 being non empty set
for b2, b3 being BinOp of b1 holds
( b3 is commutative implies ( b3 is_distributive_wrt b2 iff b3 is_right_distributive_wrt b2 ) )
proof
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
( c3 is_right_distributive_wrt c2 iff for b1, b2, b3 being Element of c1 holds c3 . (c2 . b1,b2),b3 = c2 . (c3 . b1,b3),(c3 . b2,b3) ) by Def10;
hence ( c3 is commutative implies ( c3 is_distributive_wrt c2 iff c3 is_right_distributive_wrt c2 ) ) by Th25;
end;

theorem Th28: :: BINOP_1:28
for b1 being non empty set
for b2, b3 being BinOp of b1 holds
( b3 is commutative implies ( b3 is_right_distributive_wrt b2 iff b3 is_left_distributive_wrt b2 ) )
proof
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
assume E21: c3 is commutative ;
then ( c3 is_distributive_wrt c2 iff c3 is_left_distributive_wrt c2 ) by Th26;
hence ( c3 is_right_distributive_wrt c2 iff c3 is_left_distributive_wrt c2 ) by E21, Th27;
end;

definition
let c1 be set ;
let c2 be UnOp of c1;
let c3 be BinOp of c1;
pred c2 is_distributive_wrt c3 means :Def12: :: BINOP_1:def 12
for b1, b2 being Element of a1 holds a2 . (a3 . b1,b2) = a3 . (a2 . b1),(a2 . b2);
end;

:: deftheorem Def12 defines is_distributive_wrt BINOP_1:def 12 :
for b1 being set
for b2 being UnOp of b1
for b3 being BinOp of b1 holds
( b2 is_distributive_wrt b3 iff for b4, b5 being Element of b1 holds b2 . (b3 . b4,b5) = b3 . (b2 . b4),(b2 . b5) );

definition
let c1 be non empty set ;
let c2 be BinOp of c1;
redefine attr a2 is commutative means :: BINOP_1:def 13
for b1, b2 being Element of a1 holds a2 . b1,b2 = a2 . b2,b1;
correctness
compatibility
( c2 is commutative iff for b1, b2 being Element of c1 holds c2 . b1,b2 = c2 . b2,b1 )
;
by Def2;
redefine attr a2 is associative means :: BINOP_1:def 14
for b1, b2, b3 being Element of a1 holds a2 . b1,(a2 . b2,b3) = a2 . (a2 . b1,b2),b3;
correctness
compatibility
( c2 is associative iff for b1, b2, b3 being Element of c1 holds c2 . b1,(c2 . b2,b3) = c2 . (c2 . b1,b2),b3 )
;
by Def3;
redefine attr a2 is idempotent means :: BINOP_1:def 15
for b1 being Element of a1 holds a2 . b1,b1 = b1;
correctness
compatibility
( c2 is idempotent iff for b1 being Element of c1 holds c2 . b1,b1 = b1 )
;
by Def4;
end;

:: deftheorem Def13 defines commutative BINOP_1:def 13 :
for b1 being non empty set
for b2 being BinOp of b1 holds
( b2 is commutative iff for b3, b4 being Element of b1 holds b2 . b3,b4 = b2 . b4,b3 );

:: deftheorem Def14 defines associative BINOP_1:def 14 :
for b1 being non empty set
for b2 being BinOp of b1 holds
( b2 is associative iff for b3, b4, b5 being Element of b1 holds b2 . b3,(b2 . b4,b5) = b2 . (b2 . b3,b4),b5 );

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

definition
let c1 be non empty set ;
let c2 be Element of c1;
let c3 be BinOp of c1;
redefine pred c2 is_a_left_unity_wrt c3 means :: BINOP_1:def 16
for b1 being Element of a1 holds a3 . a2,b1 = b1;
correctness
compatibility
( c2 is_a_left_unity_wrt c3 iff for b1 being Element of c1 holds c3 . c2,b1 = b1 )
;
by Def5;
redefine pred c2 is_a_right_unity_wrt c3 means :: BINOP_1:def 17
for b1 being Element of a1 holds a3 . b1,a2 = b1;
correctness
compatibility
( c2 is_a_right_unity_wrt c3 iff for b1 being Element of c1 holds c3 . b1,c2 = b1 )
;
by Def6;
end;

:: deftheorem Def16 defines is_a_left_unity_wrt BINOP_1:def 16 :
for b1 being non empty set
for b2 being Element of b1
for b3 being BinOp of b1 holds
( b2 is_a_left_unity_wrt b3 iff for b4 being Element of b1 holds b3 . b2,b4 = b4 );

:: deftheorem Def17 defines is_a_right_unity_wrt BINOP_1:def 17 :
for b1 being non empty set
for b2 being Element of b1
for b3 being BinOp of b1 holds
( b2 is_a_right_unity_wrt b3 iff for b4 being Element of b1 holds b3 . b4,b2 = b4 );

definition
let c1 be non empty set ;
let c2, c3 be BinOp of c1;
redefine pred c2 is_left_distributive_wrt c3 means :: BINOP_1:def 18
for b1, b2, b3 being Element of a1 holds a2 . b1,(a3 . b2,b3) = a3 . (a2 . b1,b2),(a2 . b1,b3);
correctness
compatibility
( c2 is_left_distributive_wrt c3 iff for b1, b2, b3 being Element of c1 holds c2 . b1,(c3 . b2,b3) = c3 . (c2 . b1,b2),(c2 . b1,b3) )
;
by Def9;
redefine pred c2 is_right_distributive_wrt c3 means :: BINOP_1:def 19
for b1, b2, b3 being Element of a1 holds a2 . (a3 . b1,b2),b3 = a3 . (a2 . b1,b3),(a2 . b2,b3);