:: Binary Operations on Numbers
:: by Library Committee
::
:: Copyright (c) 2004-2012 Association of Mizar Users

begin

scheme :: BINOP_2:sch 1
FuncDefUniq{ F1() -> non empty set , F2() -> non empty set , F3( Element of F1()) -> set } :
for f1, f2 being Function of F1(),F2() st ( for x being Element of F1() holds f1 . x = F3(x) ) & ( for x being Element of F1() holds f2 . x = F3(x) ) holds
f1 = f2
proof end;

scheme :: BINOP_2:sch 2
BinOpDefuniq{ F1() -> non empty set , F2( Element of F1(), Element of F1()) -> set } :
for o1, o2 being BinOp of F1() st ( for a, b being Element of F1() holds o1 . (a,b) = F2(a,b) ) & ( for a, b being Element of F1() holds o2 . (a,b) = F2(a,b) ) holds
o1 = o2
proof end;

scheme :: BINOP_2:sch 3
CFuncDefUniq{ F1( complex number ) -> set } :
for f1, f2 being Function of COMPLEX,COMPLEX st ( for x being complex number holds f1 . x = F1(x) ) & ( for x being complex number holds f2 . x = F1(x) ) holds
f1 = f2
proof end;

scheme :: BINOP_2:sch 4
RFuncDefUniq{ F1( real number ) -> set } :
for f1, f2 being Function of REAL,REAL st ( for x being real number holds f1 . x = F1(x) ) & ( for x being real number holds f2 . x = F1(x) ) holds
f1 = f2
proof end;

registration
cluster -> rational for Element of RAT ;
coherence
for b1 being Element of RAT holds b1 is rational
by RAT_1:def 2;
end;

scheme :: BINOP_2:sch 5
WFuncDefUniq{ F1( rational number ) -> set } :
for f1, f2 being Function of RAT,RAT st ( for x being rational number holds f1 . x = F1(x) ) & ( for x being rational number holds f2 . x = F1(x) ) holds
f1 = f2
proof end;

scheme :: BINOP_2:sch 6
IFuncDefUniq{ F1( integer number ) -> set } :
for f1, f2 being Function of INT,INT st ( for x being integer number holds f1 . x = F1(x) ) & ( for x being integer number holds f2 . x = F1(x) ) holds
f1 = f2
proof end;

scheme :: BINOP_2:sch 7
NFuncDefUniq{ F1( Nat) -> set } :
for f1, f2 being Function of NAT,NAT st ( for x being Nat holds f1 . x = F1(x) ) & ( for x being Nat holds f2 . x = F1(x) ) holds
f1 = f2
proof end;

scheme :: BINOP_2:sch 8
CBinOpDefuniq{ F1( complex number , complex number ) -> set } :
for o1, o2 being BinOp of COMPLEX st ( for a, b being complex number holds o1 . (a,b) = F1(a,b) ) & ( for a, b being complex number holds o2 . (a,b) = F1(a,b) ) holds
o1 = o2
proof end;

scheme :: BINOP_2:sch 9
RBinOpDefuniq{ F1( real number , real number ) -> set } :
for o1, o2 being BinOp of REAL st ( for a, b being real number holds o1 . (a,b) = F1(a,b) ) & ( for a, b being real number holds o2 . (a,b) = F1(a,b) ) holds
o1 = o2
proof end;

scheme :: BINOP_2:sch 10
WBinOpDefuniq{ F1( rational number , rational number ) -> set } :
for o1, o2 being BinOp of RAT st ( for a, b being rational number holds o1 . (a,b) = F1(a,b) ) & ( for a, b being rational number holds o2 . (a,b) = F1(a,b) ) holds
o1 = o2
proof end;

scheme :: BINOP_2:sch 11
IBinOpDefuniq{ F1( integer number , integer number ) -> set } :
for o1, o2 being BinOp of INT st ( for a, b being integer number holds o1 . (a,b) = F1(a,b) ) & ( for a, b being integer number holds o2 . (a,b) = F1(a,b) ) holds
o1 = o2
proof end;

scheme :: BINOP_2:sch 12
NBinOpDefuniq{ F1( Nat, Nat) -> set } :
for o1, o2 being BinOp of NAT st ( for a, b being Nat holds o1 . (a,b) = F1(a,b) ) & ( for a, b being Nat holds o2 . (a,b) = F1(a,b) ) holds
o1 = o2
proof end;

scheme :: BINOP_2:sch 13
CLambda2D{ F1( complex number , complex number ) -> complex number } :
ex f being Function of ,COMPLEX st
for x, y being complex number holds f . (x,y) = F1(x,y)
proof end;

scheme :: BINOP_2:sch 14
RLambda2D{ F1( real number , real number ) -> real number } :
ex f being Function of ,REAL st
for x, y being real number holds f . (x,y) = F1(x,y)
proof end;

scheme :: BINOP_2:sch 15
WLambda2D{ F1( rational number , rational number ) -> rational number } :
ex f being Function of ,RAT st
for x, y being rational number holds f . (x,y) = F1(x,y)
proof end;

scheme :: BINOP_2:sch 16
ILambda2D{ F1( integer number , integer number ) -> integer number } :
ex f being Function of ,INT st
for x, y being integer number holds f . (x,y) = F1(x,y)
proof end;

scheme :: BINOP_2:sch 17
NLambda2D{ F1( Nat, Nat) -> Nat } :
ex f being Function of ,NAT st
for x, y being Nat holds f . (x,y) = F1(x,y)
proof end;

scheme :: BINOP_2:sch 18
CLambdaD{ F1( complex number ) -> complex number } :
ex f being Function of COMPLEX,COMPLEX st
for x being complex number holds f . x = F1(x)
proof end;

scheme :: BINOP_2:sch 19
RLambdaD{ F1( real number ) -> real number } :
ex f being Function of REAL,REAL st
for x being real number holds f . x = F1(x)
proof end;

scheme :: BINOP_2:sch 20
WLambdaD{ F1( rational number ) -> rational number } :
ex f being Function of RAT,RAT st
for x being rational number holds f . x = F1(x)
proof end;

scheme :: BINOP_2:sch 21
ILambdaD{ F1( integer number ) -> integer number } :
ex f being Function of INT,INT st
for x being integer number holds f . x = F1(x)
proof end;

scheme :: BINOP_2:sch 22
NLambdaD{ F1( Nat) -> Nat } :
ex f being Function of NAT,NAT st
for x being Nat holds f . x = F1(x)
proof end;

definition
let c1 be complex number ;
:: original: -
redefine func - c1 -> Element of COMPLEX ;
coherence
- c1 is Element of COMPLEX
by XCMPLX_0:def 2;
:: original: "
redefine func c1 " -> Element of COMPLEX ;
coherence
c1 " is Element of COMPLEX
by XCMPLX_0:def 2;
let c2 be complex number ;
:: original: +
redefine func c1 + c2 -> Element of COMPLEX ;
coherence
c1 + c2 is Element of COMPLEX
by XCMPLX_0:def 2;
:: original: -
redefine func c1 - c2 -> Element of COMPLEX ;
coherence
c1 - c2 is Element of COMPLEX
by XCMPLX_0:def 2;
:: original: *
redefine func c1 * c2 -> Element of COMPLEX ;
coherence
c1 * c2 is Element of COMPLEX
by XCMPLX_0:def 2;
:: original: /
redefine func c1 / c2 -> Element of COMPLEX ;
coherence
c1 / c2 is Element of COMPLEX
by XCMPLX_0:def 2;
end;

definition
let r1 be real number ;
:: original: -
redefine func - r1 -> Element of REAL ;
coherence
- r1 is Element of REAL
by XREAL_0:def 1;
:: original: "
redefine func r1 " -> Element of REAL ;
coherence
r1 " is Element of REAL
by XREAL_0:def 1;
let r2 be real number ;
:: original: +
redefine func r1 + r2 -> Element of REAL ;
coherence
r1 + r2 is Element of REAL
by XREAL_0:def 1;
:: original: -
redefine func r1 - r2 -> Element of REAL ;
coherence
r1 - r2 is Element of REAL
by XREAL_0:def 1;
:: original: *
redefine func r1 * r2 -> Element of REAL ;
coherence
r1 * r2 is Element of REAL
by XREAL_0:def 1;
:: original: /
redefine func r1 / r2 -> Element of REAL ;
coherence
r1 / r2 is Element of REAL
by XREAL_0:def 1;
end;

definition
let w1 be rational number ;
:: original: -
redefine func - w1 -> Element of RAT ;
coherence
- w1 is Element of RAT
by RAT_1:def 2;
:: original: "
redefine func w1 " -> Element of RAT ;
coherence
w1 " is Element of RAT
by RAT_1:def 2;
let w2 be rational number ;
:: original: +
redefine func w1 + w2 -> Element of RAT ;
coherence
w1 + w2 is Element of RAT
by RAT_1:def 2;
:: original: -
redefine func w1 - w2 -> Element of RAT ;
coherence
w1 - w2 is Element of RAT
by RAT_1:def 2;
:: original: *
redefine func w1 * w2 -> Element of RAT ;
coherence
w1 * w2 is Element of RAT
by RAT_1:def 2;
:: original: /
redefine func w1 / w2 -> Element of RAT ;
coherence
w1 / w2 is Element of RAT
by RAT_1:def 2;
end;

definition
let i1 be integer number ;
:: original: -
redefine func - i1 -> Element of INT ;
coherence
- i1 is Element of INT
by INT_1:def 2;
let i2 be integer number ;
:: original: +
redefine func i1 + i2 -> Element of INT ;
coherence
i1 + i2 is Element of INT
by INT_1:def 2;
:: original: -
redefine func i1 - i2 -> Element of INT ;
coherence
i1 - i2 is Element of INT
by INT_1:def 2;
:: original: *
redefine func i1 * i2 -> Element of INT ;
coherence
i1 * i2 is Element of INT
by INT_1:def 2;
end;

definition
let n1, n2 be Nat;
:: original: +
redefine func n1 + n2 -> Element of NAT ;
coherence
n1 + n2 is Element of NAT
by ORDINAL1:def 12;
:: original: *
redefine func n1 * n2 -> Element of NAT ;
coherence
n1 * n2 is Element of NAT
by ORDINAL1:def 12;
end;

definition
func compcomplex -> UnOp of COMPLEX means :: BINOP_2:def 1
for c being complex number holds it . c = - c;
existence
ex b1 being UnOp of COMPLEX st
for c being complex number holds b1 . c = - c
from uniqueness
for b1, b2 being UnOp of COMPLEX st ( for c being complex number holds b1 . c = - c ) & ( for c being complex number holds b2 . c = - c ) holds
b1 = b2
from
func invcomplex -> UnOp of COMPLEX means :: BINOP_2:def 2
for c being complex number holds it . c = c " ;
existence
ex b1 being UnOp of COMPLEX st
for c being complex number holds b1 . c = c "
from uniqueness
for b1, b2 being UnOp of COMPLEX st ( for c being complex number holds b1 . c = c " ) & ( for c being complex number holds b2 . c = c " ) holds
b1 = b2
from
func addcomplex -> BinOp of COMPLEX means :Def3: :: BINOP_2:def 3
for c1, c2 being complex number holds it . (c1,c2) = c1 + c2;
existence
ex b1 being BinOp of COMPLEX st
for c1, c2 being complex number holds b1 . (c1,c2) = c1 + c2
from uniqueness
for b1, b2 being BinOp of COMPLEX st ( for c1, c2 being complex number holds b1 . (c1,c2) = c1 + c2 ) & ( for c1, c2 being complex number holds b2 . (c1,c2) = c1 + c2 ) holds
b1 = b2
from
func diffcomplex -> BinOp of COMPLEX means :: BINOP_2:def 4
for c1, c2 being complex number holds it . (c1,c2) = c1 - c2;
existence
ex b1 being BinOp of COMPLEX st
for c1, c2 being complex number holds b1 . (c1,c2) = c1 - c2
from uniqueness
for b1, b2 being BinOp of COMPLEX st ( for c1, c2 being complex number holds b1 . (c1,c2) = c1 - c2 ) & ( for c1, c2 being complex number holds b2 . (c1,c2) = c1 - c2 ) holds
b1 = b2
from
func multcomplex -> BinOp of COMPLEX means :Def5: :: BINOP_2:def 5
for c1, c2 being complex number holds it . (c1,c2) = c1 * c2;
existence
ex b1 being BinOp of COMPLEX st
for c1, c2 being complex number holds b1 . (c1,c2) = c1 * c2
from uniqueness
for b1, b2 being BinOp of COMPLEX st ( for c1, c2 being complex number holds b1 . (c1,c2) = c1 * c2 ) & ( for c1, c2 being complex number holds b2 . (c1,c2) = c1 * c2 ) holds
b1 = b2
from
func divcomplex -> BinOp of COMPLEX means :: BINOP_2:def 6
for c1, c2 being complex number holds it . (c1,c2) = c1 / c2;
existence
ex b1 being BinOp of COMPLEX st
for c1, c2 being complex number holds b1 . (c1,c2) = c1 / c2
from uniqueness
for b1, b2 being BinOp of COMPLEX st ( for c1, c2 being complex number holds b1 . (c1,c2) = c1 / c2 ) & ( for c1, c2 being complex number holds b2 . (c1,c2) = c1 / c2 ) holds
b1 = b2
from
end;

:: deftheorem defines compcomplex BINOP_2:def 1 :
for b1 being UnOp of COMPLEX holds
( b1 = compcomplex iff for c being complex number holds b1 . c = - c );

:: deftheorem defines invcomplex BINOP_2:def 2 :
for b1 being UnOp of COMPLEX holds
( b1 = invcomplex iff for c being complex number holds b1 . c = c " );

:: deftheorem Def3 defines addcomplex BINOP_2:def 3 :
for b1 being BinOp of COMPLEX holds
( b1 = addcomplex iff for c1, c2 being complex number holds b1 . (c1,c2) = c1 + c2 );

:: deftheorem defines diffcomplex BINOP_2:def 4 :
for b1 being BinOp of COMPLEX holds
( b1 = diffcomplex iff for c1, c2 being complex number holds b1 . (c1,c2) = c1 - c2 );

:: deftheorem Def5 defines multcomplex BINOP_2:def 5 :
for b1 being BinOp of COMPLEX holds
( b1 = multcomplex iff for c1, c2 being complex number holds b1 . (c1,c2) = c1 * c2 );

:: deftheorem defines divcomplex BINOP_2:def 6 :
for b1 being BinOp of COMPLEX holds
( b1 = divcomplex iff for c1, c2 being complex number holds b1 . (c1,c2) = c1 / c2 );

definition
func compreal -> UnOp of REAL means :: BINOP_2:def 7
for r being real number holds it . r = - r;
existence
ex b1 being UnOp of REAL st
for r being real number holds b1 . r = - r
from uniqueness
for b1, b2 being UnOp of REAL st ( for r being real number holds b1 . r = - r ) & ( for r being real number holds b2 . r = - r ) holds
b1 = b2
from
func invreal -> UnOp of REAL means :: BINOP_2:def 8
for r being real number holds it . r = r " ;
existence
ex b1 being UnOp of REAL st
for r being real number holds b1 . r = r "
from uniqueness
for b1, b2 being UnOp of REAL st ( for r being real number holds b1 . r = r " ) & ( for r being real number holds b2 . r = r " ) holds
b1 = b2
from
func addreal -> BinOp of REAL means :Def9: :: BINOP_2:def 9
for r1, r2 being real number holds it . (r1,r2) = r1 + r2;
existence
ex b1 being BinOp of REAL st
for r1, r2 being real number holds b1 . (r1,r2) = r1 + r2
from uniqueness
for b1, b2 being BinOp of REAL st ( for r1, r2 being real number holds b1 . (r1,r2) = r1 + r2 ) & ( for r1, r2 being real number holds b2 . (r1,r2) = r1 + r2 ) holds
b1 = b2
from
func diffreal -> BinOp of REAL means :: BINOP_2:def 10
for r1, r2 being real number holds it . (r1,r2) = r1 - r2;
existence
ex b1 being BinOp of REAL st
for r1, r2 being real number holds b1 . (r1,r2) = r1 - r2
from uniqueness
for b1, b2 being BinOp of REAL st ( for r1, r2 being real number holds b1 . (r1,r2) = r1 - r2 ) & ( for r1, r2 being real number holds b2 . (r1,r2) = r1 - r2 ) holds
b1 = b2
from
func multreal -> BinOp of REAL means :Def11: :: BINOP_2:def 11
for r1, r2 being real number holds it . (r1,r2) = r1 * r2;
existence
ex b1 being BinOp of REAL st
for r1, r2 being real number holds b1 . (r1,r2) = r1 * r2
from uniqueness
for b1, b2 being BinOp of REAL st ( for r1, r2 being real number holds b1 . (r1,r2) = r1 * r2 ) & ( for r1, r2 being real number holds b2 . (r1,r2) = r1 * r2 ) holds
b1 = b2
from
func divreal -> BinOp of REAL means :: BINOP_2:def 12
for r1, r2 being real number holds it . (r1,r2) = r1 / r2;
existence
ex b1 being BinOp of REAL st
for r1, r2 being real number holds b1 . (r1,r2) = r1 / r2
from uniqueness
for b1, b2 being BinOp of REAL st ( for r1, r2 being real number holds b1 . (r1,r2) = r1 / r2 ) & ( for r1, r2 being real number holds b2 . (r1,r2) = r1 / r2 ) holds
b1 = b2
from
end;

:: deftheorem defines compreal BINOP_2:def 7 :
for b1 being UnOp of REAL holds
( b1 = compreal iff for r being real number holds b1 . r = - r );

:: deftheorem defines invreal BINOP_2:def 8 :
for b1 being UnOp of REAL holds
( b1 = invreal iff for r being real number holds b1 . r = r " );

:: deftheorem Def9 defines addreal BINOP_2:def 9 :
for b1 being BinOp of REAL holds
( b1 = addreal iff for r1, r2 being real number holds b1 . (r1,r2) = r1 + r2 );

:: deftheorem defines diffreal BINOP_2:def 10 :
for b1 being BinOp of REAL holds
( b1 = diffreal iff for r1, r2 being real number holds b1 . (r1,r2) = r1 - r2 );

:: deftheorem Def11 defines multreal BINOP_2:def 11 :
for b1 being BinOp of REAL holds
( b1 = multreal iff for r1, r2 being real number holds b1 . (r1,r2) = r1 * r2 );

:: deftheorem defines divreal BINOP_2:def 12 :
for b1 being BinOp of REAL holds
( b1 = divreal iff for r1, r2 being real number holds b1 . (r1,r2) = r1 / r2 );

definition
func comprat -> UnOp of RAT means :: BINOP_2:def 13
for w being rational number holds it . w = - w;
existence
ex b1 being UnOp of RAT st
for w being rational number holds b1 . w = - w
from uniqueness
for b1, b2 being UnOp of RAT st ( for w being rational number holds b1 . w = - w ) & ( for w being rational number holds b2 . w = - w ) holds
b1 = b2
from
func invrat -> UnOp of RAT means :: BINOP_2:def 14
for w being rational number holds it . w = w " ;
existence
ex b1 being UnOp of RAT st
for w being rational number holds b1 . w = w "
from uniqueness
for b1, b2 being UnOp of RAT st ( for w being rational number holds b1 . w = w " ) & ( for w being rational number holds b2 . w = w " ) holds
b1 = b2
from
func addrat -> BinOp of RAT means :Def15: :: BINOP_2:def 15
for w1, w2 being rational number holds it . (w1,w2) = w1 + w2;
existence
ex b1 being BinOp of RAT st
for w1, w2 being rational number holds b1 . (w1,w2) = w1 + w2
from uniqueness
for b1, b2 being BinOp of RAT st ( for w1, w2 being rational number holds b1 . (w1,w2) = w1 + w2 ) & ( for w1, w2 being rational number holds b2 . (w1,w2) = w1 + w2 ) holds
b1 = b2
from
func diffrat -> BinOp of RAT means :: BINOP_2:def 16
for w1, w2 being rational number holds it . (w1,w2) = w1 - w2;
existence
ex b1 being BinOp of RAT st
for w1, w2 being rational number holds b1 . (w1,w2) = w1 - w2
from uniqueness
for b1, b2 being BinOp of RAT st ( for w1, w2 being rational number holds b1 . (w1,w2) = w1 - w2 ) & ( for w1, w2 being rational number holds b2 . (w1,w2) = w1 - w2 ) holds
b1 = b2
from
func multrat -> BinOp of RAT means :Def17: :: BINOP_2:def 17
for w1, w2 being rational number holds it . (w1,w2) = w1 * w2;
existence
ex b1 being BinOp of RAT st
for w1, w2 being rational number holds b1 . (w1,w2) = w1 * w2
from uniqueness
for b1, b2 being BinOp of RAT st ( for w1, w2 being rational number holds b1 . (w1,w2) = w1 * w2 ) & ( for w1, w2 being rational number holds b2 . (w1,w2) = w1 * w2 ) holds
b1 = b2
from
func divrat -> BinOp of RAT means :: BINOP_2:def 18
for w1, w2 being rational number holds it . (w1,w2) = w1 / w2;
existence
ex b1 being BinOp of RAT st
for w1, w2 being rational number holds b1 . (w1,w2) = w1 / w2
from uniqueness
for b1, b2 being BinOp of RAT st ( for w1, w2 being rational number holds b1 . (w1,w2) = w1 / w2 ) & ( for w1, w2 being rational number holds b2 . (w1,w2) = w1 / w2 ) holds
b1 = b2
from
end;

:: deftheorem defines comprat BINOP_2:def 13 :
for b1 being UnOp of RAT holds
( b1 = comprat iff for w being rational number holds b1 . w = - w );

:: deftheorem defines invrat BINOP_2:def 14 :
for b1 being UnOp of RAT holds
( b1 = invrat iff for w being rational number holds b1 . w = w " );

:: deftheorem Def15 defines addrat BINOP_2:def 15 :
for b1 being BinOp of RAT holds
( b1 = addrat iff for w1, w2 being rational number holds b1 . (w1,w2) = w1 + w2 );

:: deftheorem defines diffrat BINOP_2:def 16 :
for b1 being BinOp of RAT holds
( b1 = diffrat iff for w1, w2 being rational number holds b1 . (w1,w2) = w1 - w2 );

:: deftheorem Def17 defines multrat BINOP_2:def 17 :
for b1 being BinOp of RAT holds
( b1 = multrat iff for w1, w2 being rational number holds b1 . (w1,w2) = w1 * w2 );

:: deftheorem defines divrat BINOP_2:def 18 :
for b1 being BinOp of RAT holds
( b1 = divrat iff for w1, w2 being rational number holds b1 . (w1,w2) = w1 / w2 );

definition
func compint -> UnOp of INT means :: BINOP_2:def 19
for i being integer number holds it . i = - i;
existence
ex b1 being UnOp of INT st
for i being integer number holds b1 . i = - i
from uniqueness
for b1, b2 being UnOp of INT st ( for i being integer number holds b1 . i = - i ) & ( for i being integer number holds b2 . i = - i ) holds
b1 = b2
from
func addint -> BinOp of INT means :Def20: :: BINOP_2:def 20
for i1, i2 being integer number holds it . (i1,i2) = i1 + i2;
existence
ex b1 being BinOp of INT st
for i1, i2 being integer number holds b1 . (i1,i2) = i1 + i2
from uniqueness
for b1, b2 being BinOp of INT st ( for i1, i2 being integer number holds b1 . (i1,i2) = i1 + i2 ) & ( for i1, i2 being integer number holds b2 . (i1,i2) = i1 + i2 ) holds
b1 = b2
from
func diffint -> BinOp of INT means :: BINOP_2:def 21
for i1, i2 being integer number holds it . (i1,i2) = i1 - i2;
existence
ex b1 being BinOp of INT st
for i1, i2 being integer number holds b1 . (i1,i2) = i1 - i2
from uniqueness
for b1, b2 being BinOp of INT st ( for i1, i2 being integer number holds b1 . (i1,i2) = i1 - i2 ) & ( for i1, i2 being integer number holds b2 . (i1,i2) = i1 - i2 ) holds
b1 = b2
from
func multint -> BinOp of INT means :Def22: :: BINOP_2:def 22
for i1, i2 being integer number holds it . (i1,i2) = i1 * i2;
existence
ex b1 being BinOp of INT st
for i1, i2 being integer number holds b1 . (i1,i2) = i1 * i2
from uniqueness
for b1, b2 being BinOp of INT st ( for i1, i2 being integer number holds b1 . (i1,i2) = i1 * i2 ) & ( for i1, i2 being integer number holds b2 . (i1,i2) = i1 * i2 ) holds
b1 = b2
from
end;

:: deftheorem defines compint BINOP_2:def 19 :
for b1 being UnOp of INT holds
( b1 = compint iff for i being integer number holds b1 . i = - i );

:: deftheorem Def20 defines addint BINOP_2:def 20 :
for b1 being BinOp of INT holds
( b1 = addint iff for i1, i2 being integer number holds b1 . (i1,i2) = i1 + i2 );

:: deftheorem defines diffint BINOP_2:def 21 :
for b1 being BinOp of INT holds
( b1 = diffint iff for i1, i2 being integer number holds b1 . (i1,i2) = i1 - i2 );

:: deftheorem Def22 defines multint BINOP_2:def 22 :
for b1 being BinOp of INT holds
( b1 = multint iff for i1, i2 being integer number holds b1 . (i1,i2) = i1 * i2 );

definition
func addnat -> BinOp of NAT means :Def23: :: BINOP_2:def 23
for n1, n2 being Nat holds it . (n1,n2) = n1 + n2;
existence
ex b1 being BinOp of NAT st
for n1, n2 being Nat holds b1 . (n1,n2) = n1 + n2
from uniqueness
for b1, b2 being BinOp of NAT st ( for n1, n2 being Nat holds b1 . (n1,n2) = n1 + n2 ) & ( for n1, n2 being Nat holds b2 . (n1,n2) = n1 + n2 ) holds
b1 = b2
from
func multnat -> BinOp of NAT means :Def24: :: BINOP_2:def 24
for n1, n2 being Nat holds it . (n1,n2) = n1 * n2;
existence
ex b1 being BinOp of NAT st
for n1, n2 being Nat holds b1 . (n1,n2) = n1 * n2
from uniqueness
for b1, b2 being BinOp of NAT st ( for n1, n2 being Nat holds b1 . (n1,n2) = n1 * n2 ) & ( for n1, n2 being Nat holds b2 . (n1,n2) = n1 * n2 ) holds
b1 = b2
from
end;

:: deftheorem Def23 defines addnat BINOP_2:def 23 :
for b1 being BinOp of NAT holds
( b1 = addnat iff for n1, n2 being Nat holds b1 . (n1,n2) = n1 + n2 );

:: deftheorem Def24 defines multnat BINOP_2:def 24 :
for b1 being BinOp of NAT holds
( b1 = multnat iff for n1, n2 being Nat holds b1 . (n1,n2) = n1 * n2 );

registration
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
end;

Lm1:
;

then reconsider z = 0 as Element of COMPLEX by NUMBERS:20;

Lm2:
proof end;

Lm3:
proof end;

reconsider z = 0 as Element of RAT by ;

Lm4:
proof end;

reconsider z = 0 as Element of INT by ;

Lm5:
proof end;

Lm6:
proof end;

Lm7:
;

then reconsider z = 1 as Element of COMPLEX by NUMBERS:20;

Lm8:
proof end;

Lm9:
proof end;

reconsider z = 1 as Element of RAT by ;

Lm10:
proof end;

reconsider z = 1 as Element of INT by ;

Lm11:
proof end;

Lm12:
proof end;

registration
coherence by ;
coherence by ;
coherence by ;
coherence by ;
coherence by ;
coherence by ;
coherence by ;
coherence by ;
coherence by ;
coherence by ;
end;

theorem :: BINOP_2:1

theorem :: BINOP_2:2

theorem :: BINOP_2:3

theorem :: BINOP_2:4

theorem :: BINOP_2:5

theorem :: BINOP_2:6

theorem :: BINOP_2:7

theorem :: BINOP_2:8

theorem :: BINOP_2:9

theorem :: BINOP_2:10