:: QUATERNI semantic presentation

definition
func QUATERNION -> set equals :: QUATERNI:def 1
((Funcs 4,REAL ) \ { x where x is Element of Funcs 4,REAL : ( x . 2 = 0 & x . 3 = 0 ) } ) \/ COMPLEX ;
coherence
((Funcs 4,REAL ) \ { x where x is Element of Funcs 4,REAL : ( x . 2 = 0 & x . 3 = 0 ) } ) \/ COMPLEX is set
;
end;

:: deftheorem Def1 defines QUATERNION QUATERNI:def 1 :
QUATERNION = ((Funcs 4,REAL ) \ { x where x is Element of Funcs 4,REAL : ( x . 2 = 0 & x . 3 = 0 ) } ) \/ COMPLEX ;

definition
let x be number ;
attr a1 is quaternion means :Def2: :: QUATERNI:def 2
x in QUATERNION ;
end;

:: deftheorem Def2 defines quaternion QUATERNI:def 2 :
for x being number holds
( x is quaternion iff x in QUATERNION );

registration
cluster QUATERNION -> non empty ;
coherence
not QUATERNION is empty
;
end;

definition
let x be set ;
let y be set ;
let w be set ;
let z be set ;
let a be set ;
let b be set ;
let c be set ;
let d be set ;
func c1,c2,c3,c4 --> c5,c6,c7,c8 -> set equals :: QUATERNI:def 3
(x,y --> a,b) +* (w,z --> c,d);
coherence
(x,y --> a,b) +* (w,z --> c,d) is set
;
end;

:: deftheorem Def3 defines --> QUATERNI:def 3 :
for x, y, w, z, a, b, c, d being set holds x,y,w,z --> a,b,c,d = (x,y --> a,b) +* (w,z --> c,d);

registration
let x be set ;
let y be set ;
let w be set ;
let z be set ;
let a be set ;
let b be set ;
let c be set ;
let d be set ;
cluster a1,a2,a3,a4 --> a5,a6,a7,a8 -> Relation-like Function-like ;
coherence
( x,y,w,z --> a,b,c,d is Function-like & x,y,w,z --> a,b,c,d is Relation-like )
;
end;

theorem Th1: :: QUATERNI:1
for x, y, w, z, a, b, c, d being set holds dom (x,y,w,z --> a,b,c,d) = {x,y,w,z}
proof end;

theorem Th2: :: QUATERNI:2
for x, y, w, z, a, b, c, d being set holds rng (x,y,w,z --> a,b,c,d) c= {a,b,c,d}
proof end;

Lemma38: 0,1,2,3 are_mutually_different
by INCPROJ:def 6;

theorem Th3: :: QUATERNI:3
for x, y, w, z, a, b, c, d being set st x,y,w,z are_mutually_different holds
( (x,y,w,z --> a,b,c,d) . x = a & (x,y,w,z --> a,b,c,d) . y = b & (x,y,w,z --> a,b,c,d) . w = c & (x,y,w,z --> a,b,c,d) . z = d )
proof end;

Lemma45: for x, y, w, z, a, b, c, d being set st x,y,w,z are_mutually_different holds
{a,b,c,d} c= rng (x,y,w,z --> a,b,c,d)
proof end;

theorem Th4: :: QUATERNI:4
for x, y, w, z, a, b, c, d being set st x,y,w,z are_mutually_different holds
rng (x,y,w,z --> a,b,c,d) = {a,b,c,d}
proof end;

theorem Th5: :: QUATERNI:5
for x1, x2, x3, x4, X being set holds
( {x1,x2,x3,x4} c= X iff ( x1 in X & x2 in X & x3 in X & x4 in X ) )
proof end;

definition
let A be non empty set ;
let x be set ;
let y be set ;
let w be set ;
let z be set ;
let a be Element of A, b be Element of A, c be Element of A, d be Element of A;
redefine func --> as c2,c3,c4,c5 --> c6,c7,c8,c9 -> Function of {a2,a3,a4,a5},a1;
coherence
x,y,w,z --> a,b,c,d is Function of {x,y,w,z},A
proof end;
end;

definition
func <j> -> set equals :: QUATERNI:def 4
0,1,2,3 --> 0,0,1,0;
coherence
0,1,2,3 --> 0,0,1,0 is set
;
func <k> -> set equals :: QUATERNI:def 5
0,1,2,3 --> 0,0,0,1;
coherence
0,1,2,3 --> 0,0,0,1 is set
;
end;

:: deftheorem Def4 defines <j> QUATERNI:def 4 :
<j> = 0,1,2,3 --> 0,0,1,0;

:: deftheorem Def5 defines <k> QUATERNI:def 5 :
<k> = 0,1,2,3 --> 0,0,0,1;

registration
cluster <i> -> quaternion ;
coherence
<i> is quaternion
proof end;
cluster <j> -> quaternion ;
coherence
<j> is quaternion
proof end;
cluster <k> -> quaternion ;
coherence
<k> is quaternion
proof end;
end;

registration
cluster quaternion set ;
existence
ex b1 being number st b1 is quaternion
proof end;
end;

registration
cluster -> quaternion Element of QUATERNION ;
coherence
for b1 being Element of QUATERNION holds b1 is quaternion
by ;
end;

definition
let x be Element of REAL , y be Element of REAL , w be Element of REAL , z be Element of REAL ;
func [*c1,c2,c3,c4*] -> Element of QUATERNION equals :Def6: :: QUATERNI:def 6
[*x,y*] if ( w = 0 & z = 0 )
otherwise 0,1,2,3 --> x,y,w,z;
consistency
for b1 being Element of QUATERNION holds verum
;
coherence
( ( w = 0 & z = 0 implies [*x,y*] is Element of QUATERNION ) & ( ( not w = 0 or not z = 0 ) implies 0,1,2,3 --> x,y,w,z is Element of QUATERNION ) )
proof end;
end;

:: deftheorem Def6 defines [* QUATERNI:def 6 :
for x, y, w, z being Element of REAL holds
( ( w = 0 & z = 0 implies [*x,y,w,z*] = [*x,y*] ) & ( ( not w = 0 or not z = 0 ) implies [*x,y,w,z*] = 0,1,2,3 --> x,y,w,z ) );

theorem Th6: :: QUATERNI:6
for a, b, c, d, e, i, j, k being set
for g being Function st a <> b & c <> d & dom g = {a,b,c,d} & g . a = e & g . b = i & g . c = j & g . d = k holds
g = a,b,c,d --> e,i,j,k
proof end;

theorem Th7: :: QUATERNI:7
for g being Element of QUATERNION ex r, s, t, u being Element of REAL st g = [*r,s,t,u*]
proof end;

theorem Th8: :: QUATERNI:8
for a, c, x, w, b, d, y, z being set st a,c,x,w are_mutually_different holds
a,c,x,w --> b,d,y,z = {[a,b],[c,d],[x,y],[w,z]}
proof end;

Lemma61: for x, y, z being set st [x,y] = {z} holds
( z = {x} & x = y )
proof end;

theorem Th9: :: QUATERNI:9
for A being Subset of RAT+ st ex t being Element of RAT+ st
( t in A & t <> {} ) & ( for r, s being Element of RAT+ st r in A & s <=' r holds
s in A ) holds
ex r1, r2, r3, r4, r5 being Element of RAT+ st
( r1 in A & r2 in A & r3 in A & r4 in A & r5 in A & r1 <> r2 & r1 <> r3 & r1 <> r4 & r1 <> r5 & r2 <> r3 & r2 <> r4 & r2 <> r5 & r3 <> r4 & r3 <> r5 & r4 <> r5 )
proof end;

Lemma75: for a, b, c, d being Element of REAL holds not 0,1,2,3 --> a,b,c,d in REAL
proof end;

theorem Th10: :: QUATERNI:10
for a, b, c, d being Element of REAL holds not 0,1,2,3 --> a,b,c,d in COMPLEX
proof end;

theorem Th11: :: QUATERNI:11
for a, b, c, d, x, y, z, w, x', y', z', w' being set st a,b,c,d are_mutually_different & a,b,c,d --> x,y,z,w = a,b,c,d --> x',y',z',w' holds
( x = x' & y = y' & z = z' & w = w' )
proof end;

theorem Th12: :: QUATERNI:12
for x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st [*x1,x2,x3,x4*] = [*y1,y2,y3,y4*] holds
( x1 = y1 & x2 = y2 & x3 = y3 & x4 = y4 )
proof end;

definition
let x be quaternion number , y be quaternion number ;
x in QUATERNION by ;
then consider x1 being Element of REAL , x2 being Element of REAL , x3 being Element of REAL , x4 being Element of REAL such that
E37: x = [*x1,x2,x3,x4*] by ;
y in QUATERNION by ;
then consider y1 being Element of REAL , y2 being Element of REAL , y3 being Element of REAL , y4 being Element of REAL such that
E40: y = [*y1,y2,y3,y4*] by ;
func c1 + c2 -> set means :Def7: :: QUATERNI:def 7
ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & it = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] );
existence
ex b1 being set ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b1 = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] )
proof end;
uniqueness
for b1, b2 being set st ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b1 = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] ) & ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b2 = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] ) holds
b1 = b2
proof end;
commutativity
for b1 being set
for x, y being quaternion number st ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b1 = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] ) holds
ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( y = [*x1,x2,x3,x4*] & x = [*y1,y2,y3,y4*] & b1 = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] )
;
end;

:: deftheorem Def7 defines + QUATERNI:def 7 :
for x, y being quaternion number
for b3 being set holds
( b3 = x + y iff ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b3 = [*(x1 + y1),(x2 + y2),(x3 + y3),(x4 + y4)*] ) );

Lemma139: 0 = [*0,0,0,0*]
proof end;

definition
let z be quaternion number ;
z in QUATERNION by ;
then consider v being Element of REAL , w being Element of REAL , x being Element of REAL , y being Element of REAL such that
E37: z = [*v,w,x,y*] by ;
func - c1 -> quaternion number means :Def8: :: QUATERNI:def 8
z + it = 0;
existence
ex b1 being quaternion number st z + b1 = 0
proof end;
uniqueness
for b1, b2 being quaternion number st z + b1 = 0 & z + b2 = 0 holds
b1 = b2
proof end;
involutiveness
for b1, b2 being quaternion number st b2 + b1 = 0 holds
b1 + b2 = 0
;
end;

:: deftheorem Def8 defines - QUATERNI:def 8 :
for z, b2 being quaternion number holds
( b2 = - z iff z + b2 = 0 );

definition
let x be quaternion number , y be quaternion number ;
func c1 - c2 -> set equals :: QUATERNI:def 9
x + (- y);
coherence
x + (- y) is set
;
end;

:: deftheorem Def9 defines - QUATERNI:def 9 :
for x, y being quaternion number holds x - y = x + (- y);

definition
let x be quaternion number , y be quaternion number ;
x in QUATERNION by ;
then consider x1 being Element of REAL , x2 being Element of REAL , x3 being Element of REAL , x4 being Element of REAL such that
E37: x = [*x1,x2,x3,x4*] by ;
y in QUATERNION by ;
then consider y1 being Element of REAL , y2 being Element of REAL , y3 being Element of REAL , y4 being Element of REAL such that
E40: y = [*y1,y2,y3,y4*] by ;
func c1 * c2 -> set means :Def10: :: QUATERNI:def 10
ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & it = [*((((x1 * y1) - (x2 * y2)) - (x3 * y3)) - (x4 * y4)),((((x1 * y2) + (x2 * y1)) + (x3 * y4)) - (x4 * y3)),((((x1 * y3) + (y1 * x3)) + (y2 * x4)) - (y4 * x2)),((((x1 * y4) + (x4 * y1)) + (x2 * y3)) - (x3 * y2))*] );
existence
ex b1 being set ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b1 = [*((((x1 * y1) - (x2 * y2)) - (x3 * y3)) - (x4 * y4)),((((x1 * y2) + (x2 * y1)) + (x3 * y4)) - (x4 * y3)),((((x1 * y3) + (y1 * x3)) + (y2 * x4)) - (y4 * x2)),((((x1 * y4) + (x4 * y1)) + (x2 * y3)) - (x3 * y2))*] )
proof end;
uniqueness
for b1, b2 being set st ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b1 = [*((((x1 * y1) - (x2 * y2)) - (x3 * y3)) - (x4 * y4)),((((x1 * y2) + (x2 * y1)) + (x3 * y4)) - (x4 * y3)),((((x1 * y3) + (y1 * x3)) + (y2 * x4)) - (y4 * x2)),((((x1 * y4) + (x4 * y1)) + (x2 * y3)) - (x3 * y2))*] ) & ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b2 = [*((((x1 * y1) - (x2 * y2)) - (x3 * y3)) - (x4 * y4)),((((x1 * y2) + (x2 * y1)) + (x3 * y4)) - (x4 * y3)),((((x1 * y3) + (y1 * x3)) + (y2 * x4)) - (y4 * x2)),((((x1 * y4) + (x4 * y1)) + (x2 * y3)) - (x3 * y2))*] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def10 defines * QUATERNI:def 10 :
for x, y being quaternion number
for b3 being set holds
( b3 = x * y iff ex x1, x2, x3, x4, y1, y2, y3, y4 being Element of REAL st
( x = [*x1,x2,x3,x4*] & y = [*y1,y2,y3,y4*] & b3 = [*((((x1 * y1) - (x2 * y2)) - (x3 * y3)) - (x4 * y4)),((((x1 * y2) + (x2 * y1)) + (x3 * y4)) - (x4 * y3)),((((x1 * y3) + (y1 * x3)) + (y2 * x4)) - (y4 * x2)),((((x1 * y4) + (x4 * y1)) + (x2 * y3)) - (x3 * y2))*] ) );

registration
let z be quaternion number , z' be quaternion number ;
cluster a1 + a2 -> quaternion ;
coherence
z + z' is quaternion
proof end;
cluster a1 * a2 -> quaternion ;
coherence
z * z' is quaternion
proof end;
cluster a1 - a2 -> quaternion ;
coherence
z - z' is quaternion
;
end;

definition
redefine func <j> as <j> -> Element of QUATERNION equals :: QUATERNI:def 11
[*0,0,1,0*];
coherence
<j> is Element of QUATERNION
by ;
compatibility
for b1 being Element of QUATERNION holds
( b1 = <j> iff b1 = [*0,0,1,0*] )
by ;
redefine func <k> as <k> -> Element of QUATERNION equals :: QUATERNI:def 12
[*0,0,0,1*];
coherence
<k> is Element of QUATERNION
by ;
compatibility
for b1 being Element of QUATERNION holds
( b1 = <k> iff b1 = [*0,0,0,1*] )
by ;
end;

:: deftheorem Def11 defines <j> QUATERNI:def 11 :
<j> = [*0,0,1,0*];

:: deftheorem Def12 defines <k> QUATERNI:def 12 :
<k> = [*0,0,0,1*];

theorem Th13: :: QUATERNI:13
<i> * <i> = - 1
proof end;

theorem Th14: :: QUATERNI:14
<j> * <j> = - 1
proof end;

theorem Th15: :: QUATERNI:15
<k> * <k> = - 1
proof end;

theorem Th16: :: QUATERNI:16
<i> * <j> = <k>
proof end;

theorem Th17: :: QUATERNI:17
<j> * <k> = <i>
proof end;

theorem Th18: :: QUATERNI:18
<k> * <i> = <j>
proof end;

theorem Th19: :: QUATERNI:19
<i> * <j> = - (<j> * <i> )
proof end;

theorem Th20: :: QUATERNI:20
<j> * <k> = - (<k> * <j> )
proof end;

theorem Th21: :: QUATERNI:21
<k> * <i> = - (<i> * <k> )
proof end;

definition
let z be quaternion number ;
func Rea c1 -> set means :Def13: :: QUATERNI:def 13
ex z' being complex number st
( z = z' & it = Re z' ) if z in COMPLEX
otherwise ex f being Function of 4, REAL st
( z = f & it = f . 0 );
existence
( ( z in COMPLEX implies ex b1 being set ex z' being complex number st
( z = z' & b1 = Re z' ) ) & ( not z in COMPLEX implies ex b1 being set ex f being Function of 4, REAL st
( z = f & b1 = f . 0 ) ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( z in COMPLEX & ex z' being complex number st
( z = z' & b1 = Re z' ) & ex z' being complex number st
( z = z' & b2 = Re z' ) implies b1 = b2 ) & ( not z in COMPLEX & ex f being Function of 4, REAL st
( z = f & b1 = f . 0 ) & ex f being Function of 4, REAL st
( z = f & b2 = f . 0 ) implies b1 = b2 ) )
;
consistency
for b1 being set holds verum
;
func Im1 c1 -> set means :Def14: :: QUATERNI:def 14
ex z' being complex number st
( z = z' & it = Im z' ) if z in COMPLEX
otherwise ex f being Function of 4, REAL st
( z = f & it = f . 1 );
existence
( ( z in COMPLEX implies ex b1 being set ex z' being complex number st
( z = z' & b1 = Im z' ) ) & ( not z in COMPLEX implies ex b1 being set ex f being Function of 4, REAL st
( z = f & b1 = f . 1 ) ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( z in COMPLEX & ex z' being complex number st
( z = z' & b1 = Im z' ) & ex z' being complex number st
( z = z' & b2 = Im z' ) implies b1 = b2 ) & ( not z in COMPLEX & ex f being Function of 4, REAL st
( z = f & b1 = f . 1 ) & ex f being Function of 4, REAL st
( z = f & b2 = f . 1 ) implies b1 = b2 ) )
;
consistency
for b1 being set holds verum
;
func Im2 c1 -> set means :Def15: :: QUATERNI:def 15
it = 0 if z in COMPLEX
otherwise ex f being Function of 4, REAL st
( z = f & it = f . 2 );
existence
( ( z in COMPLEX implies ex b1 being set st b1 = 0 ) & ( not z in COMPLEX implies ex b1 being set ex f being Function of 4, REAL st
( z = f & b1 = f . 2 ) ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( z in COMPLEX & b1 = 0 & b2 = 0 implies b1 = b2 ) & ( not z in COMPLEX & ex f being Function of 4, REAL st
( z = f & b1 = f . 2 ) & ex f being Function of 4, REAL st
( z = f & b2 = f . 2 ) implies b1 = b2 ) )
;
consistency
for b1 being set holds verum
;
func Im3 c1 -> set means :Def16: :: QUATERNI:def 16
it = 0 if z in COMPLEX
otherwise ex f being Function of 4, REAL st
( z = f & it = f . 3 );
existence
( ( z in COMPLEX implies ex b1 being set st b1 = 0 ) & ( not z in COMPLEX implies ex b1 being set ex f being Function of 4, REAL st
( z = f & b1 = f . 3 ) ) )
proof end;
uniqueness
for b1, b2 being set holds
( ( z in COMPLEX & b1 = 0 & b2 = 0 implies b1 = b2 ) & ( not z in COMPLEX & ex f being Function of 4, REAL st
( z = f & b1 = f . 3 ) & ex f being Function of 4, REAL st
( z = f & b2 = f . 3 ) implies b1 = b2 ) )
;
consistency
for b1 being set holds verum
;
end;

:: deftheorem Def13 defines Rea QUATERNI:def 13 :
for z being quaternion number
for b2 being set holds
( ( z in COMPLEX implies ( b2 = Rea z iff ex z' being complex number st
( z = z' & b2 = Re z' ) ) ) & ( not z in COMPLEX implies ( b2 = Rea z iff ex f being Function of 4, REAL st
( z = f & b2 = f . 0 ) ) ) );

:: deftheorem Def14 defines Im1 QUATERNI:def 14 :
for z being quaternion number
for b2 being set holds
( ( z in COMPLEX implies ( b2 = Im1 z iff ex z' being complex number st
( z = z' & b2 = Im z' ) ) ) & ( not z in COMPLEX implies ( b2 = Im1 z iff ex f being Function of 4, REAL st
( z = f & b2 = f . 1 ) ) ) );

:: deftheorem Def15 defines Im2 QUATERNI:def 15 :
for z being quaternion number
for b2 being set holds
( ( z in COMPLEX implies ( b2 = Im2 z iff b2 = 0 ) ) & ( not z in COMPLEX implies ( b2 = Im2 z iff ex f being Function of 4, REAL st
( z = f & b2 = f . 2 ) ) ) );

:: deftheorem Def16 defines Im3 QUATERNI:def 16 :
for z being quaternion number
for b2 being set holds
( ( z in COMPLEX implies ( b2 = Im3 z iff b2 = 0 ) ) & ( not z in COMPLEX implies ( b2 = Im3 z iff ex f being Function of 4, REAL st
( z = f & b2 = f . 3 ) ) ) );

registration
let z be quaternion number ;
cluster Rea a1 -> real ;
coherence
Rea z is real
proof end;
cluster Im1 a1 -> real ;
coherence
Im1 z is real
proof end;
cluster Im2 a1 -> real ;
coherence
Im2 z is real
proof end;
cluster Im3 a1 -> real ;
coherence
Im3 z is real
proof end;
end;

definition
let z be quaternion number ;
redefine func Rea as Rea c1 -> Real;
coherence
Rea z is Real
by XREAL_0:def 1;
redefine func Im1 as Im1 c1 -> Real;
coherence
Im1 z is Real
by XREAL_0:def 1;
redefine func Im2 as Im2 c1 -> Real;
coherence
Im2 z is Real
by XREAL_0:def 1;
redefine func Im3 as Im3 c1 -> Real;
coherence
Im3 z is Real
by XREAL_0:def 1;
end;

theorem Th22: :: QUATERNI:22
for f being Function of 4, REAL ex a, b, c, d being Element of REAL st f = 0,1,2,3 --> a,b,c,d
proof end;

Lemma149: for a, b being Element of REAL holds
( Re [*a,b*] = a & Im [*a,b*] = b )
proof end;

Lemma152: for z being complex number holds [*(Re z),(Im z)*] = z
proof end;

theorem Th23: :: QUATERNI:23
for a, b, c, d being Element of REAL holds
( Rea [*a,b,c,d*] = a & Im1 [*a,b,c,d*] = b & Im2 [*a,b,c,d*] = c & Im3 [*a,b,c,d*] = d )
proof end;

theorem Th24: :: QUATERNI:24
for z being quaternion number holds z = [*(Rea z),(Im1 z),(Im2 z),(Im3 z)*]
proof end;

theorem Th25: :: QUATERNI:25
for z1, z2 being quaternion number st Rea z1 = Rea z2 & Im1 z1 = Im1 z2 & Im2 z1 = Im2 z2 & Im3 z1 = Im3 z2 holds
z1 = z2
proof end;

definition
func 0q -> quaternion number equals :: QUATERNI:def 17
0;
coherence
0 is quaternion number
by ;
func 1q -> quaternion number equals :: QUATERNI:def 18
1;
coherence
1 is quaternion number
proof end;
end;

:: deftheorem Def17 defines 0q QUATERNI:def 17 :
0q = 0;

:: deftheorem Def18 defines 1q QUATERNI:def 18 :
1q = 1;

Lemma162: for a, b, c, d being real number st (((a ^2 ) + (b ^2 )) + (c ^2 )) + (d ^2 ) = 0 holds
( a = 0 & b = 0 & c = 0 & d = 0 )
proof end;

theorem Th26: :: QUATERNI:26
for z being quaternion number st Rea z = 0 & Im1 z = 0 & Im2 z = 0 & Im3 z = 0 holds
z = 0q
proof end;

theorem Th27: :: QUATERNI:27
for z being quaternion number st z = 0 holds
((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 ) = 0
proof end;

theorem Th28: :: QUATERNI:28
for z being quaternion number st ((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 ) = 0 holds
z = 0q
proof end;

Lemma164: [*1,0,0,0*] = 1
proof end;

theorem Th29: :: QUATERNI:29
( Rea 1q = 1 & Im1 1q = 0 & Im2 1q = 0 & Im3 1q = 0 ) by , ;

theorem Th30: :: QUATERNI:30
( Rea <i> = 0 & Im1 <i> = 1 & Im2 <i> = 0 & Im3 <i> = 0 )
proof end;

theorem Th31: :: QUATERNI:31
( Rea <j> = 0 & Im1 <j> = 0 & Im2 <j> = 1 & Im3 <j> = 0 & Rea <k> = 0 & Im1 <k> = 0 & Im2 <k> = 0 & Im3 <k> = 1 ) by ;

Lemma167: for m, n, x, y, z being quaternion number st z = ((m + n) + x) + y holds
( Rea z = (((Rea m) + (Rea n)) + (Rea x)) + (Rea y) & Im1 z = (((Im1 m) + (Im1 n)) + (Im1 x)) + (Im1 y) & Im2 z = (((Im2 m) + (Im2 n)) + (Im2 x)) + (Im2 y) & Im3 z = (((Im3 m) + (Im3 n)) + (Im3 x)) + (Im3 y) )
proof end;

Lemma176: for x, y, z being quaternion number st z = x + y holds
( Rea z = (Rea x) + (Rea y) & Im1 z = (Im1 x) + (Im1 y) & Im2 z = (Im2 x) + (Im2 y) & Im3 z = (Im3 x) + (Im3 y) )
proof end;

Lemma177: for z1, z2 being quaternion number holds z1 + z2 = [*((Rea z1) + (Rea z2)),((Im1 z1) + (Im1 z2)),((Im2 z1) + (Im2 z2)),((Im3 z1) + (Im3 z2))*]
proof end;

Lemma178: for x, y, z being quaternion number st z = x * y holds
( Rea z = ((((Rea x) * (Rea y)) - ((Im1 x) * (Im1 y))) - ((Im2 x) * (Im2 y))) - ((Im3 x) * (Im3 y)) & Im1 z = ((((Rea x) * (Im1 y)) + ((Im1 x) * (Rea y))) + ((Im2 x) * (Im3 y))) - ((Im3 x) * (Im2 y)) & Im2 z = ((((Rea x) * (Im2 y)) + ((Im2 x) * (Rea y))) + ((Im3 x) * (Im1 y))) - ((Im1 x) * (Im3 y)) & Im3 z = ((((Rea x) * (Im3 y)) + ((Im3 x) * (Rea y))) + ((Im1 x) * (Im2 y))) - ((Im2 x) * (Im1 y)) )
proof end;

Lemma179: for z1, z2, z3, z4 being quaternion number holds ((z1 + z2) + z3) + z4 = [*((((Rea z1) + (Rea z2)) + (Rea z3)) + (Rea z4)),((((Im1 z1) + (Im1 z2)) + (Im1 z3)) + (Im1 z4)),((((Im2 z1) + (Im2 z2)) + (Im2 z3)) + (Im2 z4)),((((Im3 z1) + (Im3 z2)) + (Im3 z3)) + (Im3 z4))*]
proof end;

Lemma180: for z1, z2 being quaternion number holds z1 * z2 = [*(((((Rea z1) * (Rea z2)) - ((Im1 z1) * (Im1 z2))) - ((Im2 z1) * (Im2 z2))) - ((Im3 z1) * (Im3 z2))),(((((Rea z1) * (Im1 z2)) + ((Im1 z1) * (Rea z2))) + ((Im2 z1) * (Im3 z2))) - ((Im3 z1) * (Im2 z2))),(((((Rea z1) * (Im2 z2)) + ((Im2 z1) * (Rea z2))) + ((Im3 z1) * (Im1 z2))) - ((Im1 z1) * (Im3 z2))),(((((Rea z1) * (Im3 z2)) + ((Im3 z1) * (Rea z2))) + ((Im1 z1) * (Im2 z2))) - ((Im2 z1) * (Im1 z2)))*]
proof end;

Lemma181: for z1, z2 being quaternion number holds
( Rea (z1 * z2) = ((((Rea z1) * (Rea z2)) - ((Im1 z1) * (Im1 z2))) - ((Im2 z1) * (Im2 z2))) - ((Im3 z1) * (Im3 z2)) & Im1 (z1 * z2) = ((((Rea z1) * (Im1 z2)) + ((Im1 z1) * (Rea z2))) + ((Im2 z1) * (Im3 z2))) - ((Im3 z1) * (Im2 z2)) & Im2 (z1 * z2) = ((((Rea z1) * (Im2 z2)) + ((Im2 z1) * (Rea z2))) + ((Im3 z1) * (Im1 z2))) - ((Im1 z1) * (Im3 z2)) & Im3 (z1 * z2) = ((((Rea z1) * (Im3 z2)) + ((Im3 z1) * (Rea z2))) + ((Im1 z1) * (Im2 z2))) - ((Im2 z1) * (Im1 z2)) )
proof end;

theorem Th32: :: QUATERNI:32
for z1, z2, z3, z4 being quaternion number holds
( Rea (((z1 + z2) + z3) + z4) = (((Rea z1) + (Rea z2)) + (Rea z3)) + (Rea z4) & Im1 (((z1 + z2) + z3) + z4) = (((Im1 z1) + (Im1 z2)) + (Im1 z3)) + (Im1 z4) & Im2 (((z1 + z2) + z3) + z4) = (((Im2 z1) + (Im2 z2)) + (Im2 z3)) + (Im2 z4) & Im3 (((z1 + z2) + z3) + z4) = (((Im3 z1) + (Im3 z2)) + (Im3 z3)) + (Im3 z4) )
proof end;

Lemma182: for z being quaternion number
for x being Real st z = x holds
( Rea z = x & Im1 z = 0 & Im2 z = 0 & Im3 z = 0 )
proof end;

theorem Th33: :: QUATERNI:33
for z1 being quaternion number
for x being Real st z1 = x holds
( Rea (z1 * <i> ) = 0 & Im1 (z1 * <i> ) = x & Im2 (z1 * <i> ) = 0 & Im3 (z1 * <i> ) = 0 )
proof end;

theorem Th34: :: QUATERNI:34
for z1 being quaternion number
for x being Real st z1 = x holds
( Rea (z1 * <j> ) = 0 & Im1 (z1 * <j> ) = 0 & Im2 (z1 * <j> ) = x & Im3 (z1 * <j> ) = 0 )
proof end;

theorem Th35: :: QUATERNI:35
for z1 being quaternion number
for x being Real st z1 = x holds
( Rea (z1 * <k> ) = 0 & Im1 (z1 * <k> ) = 0 & Im2 (z1 * <k> ) = 0 & Im3 (z1 * <k> ) = x )
proof end;

definition
let x be Real;
let y be quaternion number ;
y in QUATERNION by ;
then consider y1 being Element of REAL , y2 being Element of REAL , y3 being Element of REAL , y4 being Element of REAL such that
E37: y = [*y1,y2,y3,y4*] by ;
func c1 + c2 -> set means :Def19: :: QUATERNI:def 19
ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & it = [*(x + y1),y2,y3,y4*] );
existence
ex b1 being set ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b1 = [*(x + y1),y2,y3,y4*] )
proof end;
uniqueness
for b1, b2 being set st ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b1 = [*(x + y1),y2,y3,y4*] ) & ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b2 = [*(x + y1),y2,y3,y4*] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def19 defines + QUATERNI:def 19 :
for x being Real
for y being quaternion number
for b3 being set holds
( b3 = x + y iff ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b3 = [*(x + y1),y2,y3,y4*] ) );

definition
let x be Real;
let y be quaternion number ;
func c1 - c2 -> set equals :: QUATERNI:def 20
x + (- y);
coherence
x + (- y) is set
;
end;

:: deftheorem Def20 defines - QUATERNI:def 20 :
for x being Real
for y being quaternion number holds x - y = x + (- y);

definition
let x be Real;
let y be quaternion number ;
y in QUATERNION by ;
then consider y1 being Element of REAL , y2 being Element of REAL , y3 being Element of REAL , y4 being Element of REAL such that
E37: y = [*y1,y2,y3,y4*] by ;
func c1 * c2 -> set means :Def21: :: QUATERNI:def 21
ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & it = [*(x * y1),(x * y2),(x * y3),(x * y4)*] );
existence
ex b1 being set ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b1 = [*(x * y1),(x * y2),(x * y3),(x * y4)*] )
proof end;
uniqueness
for b1, b2 being set st ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b1 = [*(x * y1),(x * y2),(x * y3),(x * y4)*] ) & ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b2 = [*(x * y1),(x * y2),(x * y3),(x * y4)*] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def21 defines * QUATERNI:def 21 :
for x being Real
for y being quaternion number
for b3 being set holds
( b3 = x * y iff ex y1, y2, y3, y4 being Element of REAL st
( y = [*y1,y2,y3,y4*] & b3 = [*(x * y1),(x * y2),(x * y3),(x * y4)*] ) );

registration
let x be Real;
let z' be quaternion number ;
cluster a1 + a2 -> quaternion ;
coherence
x + z' is quaternion
proof end;
cluster a1 * a2 -> quaternion ;
coherence
x * z' is quaternion
proof end;
cluster a1 - a2 -> quaternion ;
coherence
x - z' is quaternion
;
end;

Lemma185: for x, y, z, w being Real holds [*x,y,z,w*] = ((x + (y * <i> )) + (z * <j> )) + (w * <k> )
proof end;

definition
let z1 be quaternion number , z2 be quaternion number ;
redefine func + as c1 + c2 -> Element of QUATERNION equals :Def22: :: QUATERNI:def 22
((((Rea z1) + (Rea z2)) + (((Im1 z1) + (Im1 z2)) * <i> )) + (((Im2 z1) + (Im2 z2)) * <j> )) + (((Im3 z1) + (Im3 z2)) * <k> );
coherence
z1 + z2 is Element of QUATERNION
by ;
compatibility
for b1 being Element of QUATERNION holds
( b1 = z1 + z2 iff b1 = ((((Rea z1) + (Rea z2)) + (((Im1 z1) + (Im1 z2)) * <i> )) + (((Im2 z1) + (Im2 z2)) * <j> )) + (((Im3 z1) + (Im3 z2)) * <k> ) )
proof end;
end;

:: deftheorem Def22 defines + QUATERNI:def 22 :
for z1, z2 being quaternion number holds z1 + z2 = ((((Rea z1) + (Rea z2)) + (((Im1 z1) + (Im1 z2)) * <i> )) + (((Im2 z1) + (Im2 z2)) * <j> )) + (((Im3 z1) + (Im3 z2)) * <k> );

theorem Th36: :: QUATERNI:36
for z1, z2 being quaternion number holds
( Rea (z1 + z2) = (Rea z1) + (Rea z2) & Im1 (z1 + z2) = (Im1 z1) + (Im1 z2) & Im2 (z1 + z2) = (Im2 z1) + (Im2 z2) & Im3 (z1 + z2) = (Im3 z1) + (Im3 z2) )
proof end;

definition
let z1 be Element of QUATERNION , z2 be Element of QUATERNION ;
redefine func * as c1 * c2 -> Element of QUATERNION equals :: QUATERNI:def 23
(((((((Rea z1) * (Rea z2)) - ((Im1 z1) * (Im1 z2))) - ((Im2 z1) * (Im2 z2))) - ((Im3 z1) * (Im3 z2))) + ((((((Rea z1) * (Im1 z2)) + ((Im1 z1) * (Rea z2))) + ((Im2 z1) * (Im3 z2))) - ((Im3 z1) * (Im2 z2))) * <i> )) + ((((((Rea z1) * (Im2 z2)) + ((Im2 z1) * (Rea z2))) + ((Im3 z1) * (Im1 z2))) - ((Im1 z1) * (Im3 z2))) * <j> )) + ((((((Rea z1) * (Im3 z2)) + ((Im3 z1) * (Rea z2))) + ((Im1 z1) * (Im2 z2))) - ((Im2 z1) * (Im1 z2))) * <k> );
coherence
z1 * z2 is Element of QUATERNION
by ;
compatibility
for b1 being Element of QUATERNION holds
( b1 = z1 * z2 iff b1 = (((((((Rea z1) * (Rea z2)) - ((Im1 z1) * (Im1 z2))) - ((Im2 z1) * (Im2 z2))) - ((Im3 z1) * (Im3 z2))) + ((((((Rea z1) * (Im1 z2)) + ((Im1 z1) * (Rea z2))) + ((Im2 z1) * (Im3 z2))) - ((Im3 z1) * (Im2 z2))) * <i> )) + ((((((Rea z1) * (Im2 z2)) + ((Im2 z1) * (Rea z2))) + ((Im3 z1) * (Im1 z2))) - ((Im1 z1) * (Im3 z2))) * <j> )) + ((((((Rea z1) * (Im3 z2)) + ((Im3 z1) * (Rea z2))) + ((Im1 z1) * (Im2 z2))) - ((Im2 z1) * (Im1 z2))) * <k> ) )
proof end;
end;

:: deftheorem Def23 defines * QUATERNI:def 23 :
for z1, z2 being Element of QUATERNION holds z1 * z2 = (((((((Rea z1) * (Rea z2)) - ((Im1 z1) * (Im1 z2))) - ((Im2 z1) * (Im2 z2))) - ((Im3 z1) * (Im3 z2))) + ((((((Rea z1) * (Im1 z2)) + ((Im1 z1) * (Rea z2))) + ((Im2 z1) * (Im3 z2))) - ((Im3 z1) * (Im2 z2))) * <i> )) + ((((((Rea z1) * (Im2 z2)) + ((Im2 z1) * (Rea z2))) + ((Im3 z1) * (Im1 z2))) - ((Im1 z1) * (Im3 z2))) * <j> )) + ((((((Rea z1) * (Im3 z2)) + ((Im3 z1) * (Rea z2))) + ((Im1 z1) * (Im2 z2))) - ((Im2 z1) * (Im1 z2))) * <k> );

theorem Th37: :: QUATERNI:37
for z being quaternion number holds z = (((Rea z) + ((Im1 z) * <i> )) + ((Im2 z) * <j> )) + ((Im3 z) * <k> )
proof end;

theorem Th38: :: QUATERNI:38
for z1, z2 being quaternion number st Im1 z1 = 0 & Im1 z2 = 0 & Im2 z1 = 0 & Im2 z2 = 0 & Im3 z1 = 0 & Im3 z2 = 0 holds
( Rea (z1 * z2) = (Rea z1) * (Rea z2) & Im1 (z1 * z2) = ((Im2 z1) * (Im3 z2)) - ((Im3 z1) * (Im2 z2)) & Im2 (z1 * z2) = ((Im3 z1) * (Im1 z2)) - ((Im1 z1) * (Im3 z2)) & Im3 (z1 * z2) = ((Im1 z1) * (Im2 z2)) - ((Im2 z1) * (Im1 z2)) )
proof end;

theorem Th39: :: QUATERNI:39
for z1, z2 being quaternion number st Rea z1 = 0 & Rea z2 = 0 holds
( Rea (z1 * z2) = ((- ((Im1 z1) * (Im1 z2))) - ((Im2 z1) * (Im2 z2))) - ((Im3 z1) * (Im3 z2)) & Im1 (z1 * z2) = ((Im2 z1) * (Im3 z2)) - ((Im3 z1) * (Im2 z2)) & Im2 (z1 * z2) = ((Im3 z1) * (Im1 z2)) - ((Im1 z1) * (Im3 z2)) & Im3 (z1 * z2) = ((Im1 z1) * (Im2 z2)) - ((Im2 z1) * (Im1 z2)) )
proof end;

theorem Th40: :: QUATERNI:40
for z being quaternion number holds
( Rea (z * z) = ((((Rea z) ^2 ) - ((Im1 z) ^2 )) - ((Im2 z) ^2 )) - ((Im3 z) ^2 ) & Im1 (z * z) = 2 * ((Rea z) * (Im1 z)) & Im2 (z * z) = 2 * ((Rea z) * (Im2 z)) & Im3 (z * z) = 2 * ((Rea z) * (Im3 z)) )
proof end;

definition
let z be quaternion number ;
redefine func - as - c1 -> Element of QUATERNION equals :: QUATERNI:def 24
(((- (Rea z)) + ((- (Im1 z)) * <i> )) + ((- (Im2 z)) * <j> )) + ((- (Im3 z)) * <k> );
coherence
- z is Element of QUATERNION
by ;
compatibility
for b1 being Element of QUATERNION holds
( b1 = - z iff b1 = (((- (Rea z)) + ((- (Im1 z)) * <i> )) + ((- (Im2 z)) * <j> )) + ((- (Im3 z)) * <k> ) )
proof end;
end;

:: deftheorem Def24 defines - QUATERNI:def 24 :
for z being quaternion number holds - z = (((- (Rea z)) + ((- (Im1 z)) * <i> )) + ((- (Im2 z)) * <j> )) + ((- (Im3 z)) * <k> );

theorem Th41: :: QUATERNI:41
for z being quaternion number holds
( Rea (- z) = - (Rea z) & Im1 (- z) = - (Im1 z) & Im2 (- z) = - (Im2 z) & Im3 (- z) = - (Im3 z) )
proof end;

definition
let z1 be quaternion number , z2 be quaternion number ;
redefine func - as c1 - c2 -> Element of QUATERNION equals :: QUATERNI:def 25
((((Rea z1) - (Rea z2)) + (((Im1 z1) - (Im1 z2)) * <i> )) + (((Im2 z1) - (Im2 z2)) * <j> )) + (((Im3 z1) - (Im3 z2)) * <k> );
coherence
z1 - z2 is Element of QUATERNION
by ;
compatibility
for b1 being Element of QUATERNION holds
( b1 = z1 - z2 iff b1 = ((((Rea z1) - (Rea z2)) + (((Im1 z1) - (Im1 z2)) * <i> )) + (((Im2 z1) - (Im2 z2)) * <j> )) + (((Im3 z1) - (Im3 z2)) * <k> ) )
proof end;
end;

:: deftheorem Def25 defines - QUATERNI:def 25 :
for z1, z2 being quaternion number holds z1 - z2 = ((((Rea z1) - (Rea z2)) + (((Im1 z1) - (Im1 z2)) * <i> )) + (((Im2 z1) - (Im2 z2)) * <j> )) + (((Im3 z1) - (Im3 z2)) * <k> );

theorem Th42: :: QUATERNI:42
for z1, z2 being quaternion number holds
( Rea (z1 - z2) = (Rea z1) - (Rea z2) & Im1 (z1 - z2) = (Im1 z1) - (Im1 z2) & Im2 (z1 - z2) = (Im2 z1) - (Im2 z2) & Im3 (z1 - z2) = (Im3 z1) - (Im3 z2) )
proof end;

definition
let z be quaternion number ;
func c1 *' -> quaternion number equals :: QUATERNI:def 26
(((Rea z) + ((- (Im1 z)) * <i> )) + ((- (Im2 z)) * <j> )) + ((- (Im3 z)) * <k> );
coherence
(((Rea z) + ((- (Im1 z)) * <i> )) + ((- (Im2 z)) * <j> )) + ((- (Im3 z)) * <k> ) is quaternion number
;
end;

:: deftheorem Def26 defines *' QUATERNI:def 26 :
for z being quaternion number holds z *' = (((Rea z) + ((- (Im1 z)) * <i> )) + ((- (Im2 z)) * <j> )) + ((- (Im3 z)) * <k> );

definition
let z be quaternion number ;
redefine func *' as c1 *' -> Element of QUATERNION ;
coherence
z *' is Element of QUATERNION
;
end;

theorem Th43: :: QUATERNI:43
for z being quaternion number holds z *' = [*(Rea z),(- (Im1 z)),(- (Im2 z)),(- (Im3 z))*]
proof end;

theorem Th44: :: QUATERNI:44
for z being quaternion number holds
( Rea (z *' ) = Rea z & Im1 (z *' ) = - (Im1 z) & Im2 (z *' ) = - (Im2 z) & Im3 (z *' ) = - (Im3 z) )
proof end;

theorem Th45: :: QUATERNI:45
for z being quaternion number st z = 0 holds
z *' = 0
proof end;

theorem Th46: :: QUATERNI:46
for z being quaternion number st z *' = 0 holds
z = 0
proof end;

theorem Th47: :: QUATERNI:47
1q *' = 1q
proof end;

theorem Th48: :: QUATERNI:48
( Rea (<i> *' ) = 0 & Im1 (<i> *' ) = - 1 & Im2 (<i> *' ) = 0 & Im3 (<i> *' ) = 0 )
proof end;

theorem Th49: :: QUATERNI:49
( Rea (<j> *' ) = 0 & Im1 (<j> *' ) = 0 & Im2 (<j> *' ) = - 1 & Im3 (<j> *' ) = 0 )
proof end;

theorem Th50: :: QUATERNI:50
( Rea (<k> *' ) = 0 & Im1 (<k> *' ) = 0 & Im2 (<k> *' ) = 0 & Im3 (<k> *' ) = - 1 )
proof end;

theorem Th51: :: QUATERNI:51
<i> *' = - <i> by ;

theorem Th52: :: QUATERNI:52
<j> *' = - <j> by Th2;

theorem Th53: :: QUATERNI:53
<k> *' = - <k> by Th2;

Lemma190: for z1, z2 being quaternion number holds
( Rea (z1 + z2) = (Rea z1) + (Rea z2) & Im1 (z1 + z2) = (Im1 z1) + (Im1 z2) & Im2 (z1 + z2) = (Im2 z1) + (Im2 z2) & Im3 (z1 + z2) = (Im3 z1) + (Im3 z2) )
proof end;

theorem Th54: :: QUATERNI:54
for z1, z2 being quaternion number holds (z1 + z2) *' = (z1 *' ) + (z2 *' )
proof end;

theorem Th55: :: QUATERNI:55
for z being quaternion number holds (- z) *' = - (z *' )
proof end;

Lemma192: for z1, z2 being quaternion number holds
( Rea (z1 - z2) = (Rea z1) - (Rea z2) & Im1 (z1 - z2) = (Im1 z1) - (Im1 z2) & Im2 (z1 - z2) = (Im2 z1) - (Im2 z2) & Im3 (z1 - z2) = (Im3 z1) - (Im3 z2) )
proof end;

theorem Th56: :: QUATERNI:56
for z1, z2 being quaternion number holds (z1 - z2) *' = (z1 *' ) - (z2 *' )
proof end;

theorem Th57: :: QUATERNI:57
for z1, z2 being quaternion number st (Im2 z1) * (Im3 z2) <> (Im3 z1) * (Im2 z2) holds
(z1 * z2) *' <> (z1 *' ) * (z2 *' )
proof end;

theorem Th58: :: QUATERNI:58
for z being quaternion number st Im1 z = 0 & Im2 z = 0 & Im3 z = 0 holds
z *' = z
proof end;

theorem Th59: :: QUATERNI:59
for z being quaternion number st Rea z = 0 holds
z *' = - z ;

theorem Th60: :: QUATERNI:60
for z being quaternion number holds
( Rea (z * (z *' )) = ((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 ) & Im1 (z * (z *' )) = 0 & Im2 (z * (z *' )) = 0 & Im3 (z * (z *' )) = 0 )
proof end;

theorem Th61: :: QUATERNI:61
for z being quaternion number holds
( Rea (z + (z *' )) = 2 * (Rea z) & Im1 (z + (z *' )) = 0 & Im2 (z + (z *' )) = 0 & Im3 (z + (z *' )) = 0 )
proof end;

theorem Th62: :: QUATERNI:62
for z being quaternion number holds - z = [*(- (Rea z)),(- (Im1 z)),(- (Im2 z)),(- (Im3 z))*]
proof end;

theorem Th63: :: QUATERNI:63
for z1, z2 being quaternion number holds z1 - z2 = [*((Rea z1) - (Rea z2)),((Im1 z1) - (Im1 z2)),((Im2 z1) - (Im2 z2)),((Im3 z1) - (Im3 z2))*]
proof end;

theorem Th64: :: QUATERNI:64
for z being quaternion number holds
( Rea (z - (z *' )) = 0 & Im1 (z - (z *' )) = 2 * (Im1 z) & Im2 (z - (z *' )) = 2 * (Im2 z) & Im3 (z - (z *' )) = 2 * (Im3 z) )
proof end;

definition
let z be quaternion number ;
func |.c1.| -> real number equals :: QUATERNI:def 27
sqrt (((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 ));
coherence
sqrt (((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 )) is real number
;
end;

:: deftheorem Def27 defines |. QUATERNI:def 27 :
for z being quaternion number holds |.z.| = sqrt (((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 ));

theorem Th65: :: QUATERNI:65
|.0q .| = 0
proof end;

theorem Th66: :: QUATERNI:66
for z being quaternion number st |.z.| = 0 holds
z = 0
proof end;

theorem Th67: :: QUATERNI:67
for z being quaternion number holds 0 <= |.z.|
proof end;

theorem Th68: :: QUATERNI:68
|.1q .| = 1
proof end;

theorem Th69: :: QUATERNI:69
|.<i> .| = 1 by , SQUARE_1:83;

theorem Th70: :: QUATERNI:70
|.<j> .| = 1 by Th2, SQUARE_1:83;

theorem Th71: :: QUATERNI:71
|.<k> .| = 1 by Th2, SQUARE_1:83;

theorem Th72: :: QUATERNI:72
for z being quaternion number holds |.(- z).| = |.z.|
proof end;

theorem Th73: :: QUATERNI:73
for z being quaternion number holds |.(z *' ).| = |.z.|
proof end;

Lemma200: for a, b, c, d being real number holds (((a ^2 ) + (b ^2 )) + (c ^2 )) + (d ^2 ) >= 0
proof end;

theorem Th74: :: QUATERNI:74
for z being quaternion number holds 0 <= ((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 ) by ;

Lemma201: for a, b, c, d being Element of REAL holds a ^2 <= (((a ^2 ) + (b ^2 )) + (c ^2 )) + (d ^2 )
proof end;

Lemma202: for a, b, c, d being real number holds c ^2 <= (((a ^2 ) + (b ^2 )) + (c ^2 )) + (d ^2 )
proof end;

Lemma203: for d, a, b, c being Element of REAL holds d ^2 <= (((a ^2 ) + (b ^2 )) + (c ^2 )) + (d ^2 )
proof end;

theorem Th75: :: QUATERNI:75
for z being quaternion number holds Rea z <= |.z.|
proof end;

theorem Th76: :: QUATERNI:76
for z being quaternion number holds Im1 z <= |.z.|
proof end;

theorem Th77: :: QUATERNI:77
for z being quaternion number holds Im2 z <= |.z.|
proof end;

theorem Th78: :: QUATERNI:78
for z being quaternion number holds Im3 z <= |.z.|
proof end;

Lemma204: for z1, z2 being quaternion number holds
( Rea (z1 + z2) = (Rea z1) + (Rea z2) & Im1 (z1 + z2) = (Im1 z1) + (Im1 z2) & Im2 (z1 + z2) = (Im2 z1) + (Im2 z2) & Im3 (z1 + z2) = (Im3 z1) + (Im3 z2) )
proof end;

Lemma205: for a, b being Element of REAL st a >= b ^2 holds
sqrt a >= b
proof end;

Lemma206: for a1, a2, a3, a4, a5, a6, b1, b2, b3, b4, b5, b6 being real number st a1 >= b1 & a2 >= b2 & a3 >= b3 & a4 >= b4 & a5 >= b5 & a6 >= b6 holds
((((a1 + a2) + a3) + a4) + a5) + a6 >= ((((b1 + b2) + b3) + b4) + b5) + b6
proof end;

Lemma219: for a, b being Element of REAL st a >= 0 & b >= 0 & a ^2 >= b ^2 holds
a >= b
proof end;

Lemma220: for m1, m2, m4, m3, n1, n2, n3, n4 being real number holds ((sqrt ((((m1 ^2 ) + (m2 ^2 )) + (m3 ^2 )) + (m4 ^2 ))) + (sqrt ((((n1 ^2 ) + (n2 ^2 )) + (n3 ^2 )) + (n4 ^2 )))) ^2 = ((((((((m1 ^2 ) + (m2 ^2 )) + (m3 ^2 )) + (m4 ^2 )) + (n1 ^2 )) + (n2 ^2 )) + (n3 ^2 )) + (n4 ^2 )) + (2 * (sqrt (((((m1 ^2 ) + (m2 ^2 )) + (m3 ^2 )) + (m4 ^2 )) * ((((n1 ^2 ) + (n2 ^2 )) + (n3 ^2 )) + (n4 ^2 )))))
proof end;

Lemma221: for m1, m2, m3, m4, n1, n2, n3, n4 being real number holds (sqrt (((((m1 + n1) ^2 ) + ((m2 + n2) ^2 )) + ((m3 + n3) ^2 )) + ((m4 + n4) ^2 ))) ^2 = ((((m1 + n1) ^2 ) + ((m2 + n2) ^2 )) + ((m3 + n3) ^2 )) + ((m4 + n4) ^2 )
proof end;

theorem Th79: :: QUATERNI:79
for z1, z2 being quaternion number holds |.(z1 + z2).| <= |.z1.| + |.z2.|
proof end;

theorem Th80: :: QUATERNI:80
for z1, z2 being quaternion number holds |.(z1 - z2).| <= |.z1.| + |.z2.|
proof end;

Lemma230: for z1, z2 being quaternion number holds z1 = (z1 + z2) - z2
proof end;

Lemma231: for z1, z2 being quaternion number holds z1 = (z1 - z2) + z2
proof end;

Lemma232: for z1, z2 being quaternion number holds z1 - z2 = [*((Rea z1) - (Rea z2)),((Im1 z1) - (Im1 z2)),((Im2 z1) - (Im2 z2)),((Im3 z1) - (Im3 z2))*]
proof end;

Lemma233: for z1, z2 being quaternion number holds
( Rea (z1 - z2) = (Rea z1) - (Rea z2) & Im1 (z1 - z2) = (Im1 z1) - (Im1 z2) & Im2 (z1 - z2) = (Im2 z1) - (Im2 z2) & Im3 (z1 - z2) = (Im3 z1) - (Im3 z2) )
proof end;

Lemma234: for z1, z2 being quaternion number holds z1 - z2 = - (z2 - z1)
proof end;

Lemma235: for z1, z2 being quaternion number st z1 - z2 = 0 holds
z1 = z2
proof end;

theorem Th81: :: QUATERNI:81
for z1, z2 being quaternion number holds |.z1.| - |.z2.| <= |.(z1 + z2).|
proof end;

theorem Th82: :: QUATERNI:82
for z1, z2 being quaternion number holds |.z1.| - |.z2.| <= |.(z1 - z2).|
proof end;

theorem Th83: :: QUATERNI:83
for z1, z2 being quaternion number holds |.(z1 - z2).| = |.(z2 - z1).|
proof end;

theorem Th84: :: QUATERNI:84
for z1, z2 being quaternion number holds
( |.(z1 - z2).| = 0 iff z1 = z2 )
proof end;

Lemma238: for z, z1, z2 being quaternion number holds z1 - z2 = (z1 - z) + (z - z2)
proof end;

theorem Th85: :: QUATERNI:85
for z1, z2, z being quaternion number holds |.(z1 - z2).| <= |.(z1 - z).| + |.(z - z2).|
proof end;

theorem Th86: :: QUATERNI:86
for z1, z2 being quaternion number holds |.(|.z1.| - |.z2.|).| <= |.(z1 - z2).|
proof end;

theorem Th87: :: QUATERNI:87
for z1, z2 being quaternion number holds |.(z1 * z2).| = |.z1.| * |.z2.|
proof end;

theorem Th88: :: QUATERNI:88
for z being quaternion number holds |.(z * z).| = ((((Rea z) ^2 ) + ((Im1 z) ^2 )) + ((Im2 z) ^2 )) + ((Im3 z) ^2 )
proof end;

theorem Th89: :: QUATERNI:89
for z being quaternion number holds |.(z * z).| = |.(z * (z *' )).|
proof end;