:: by Czes{\l}aw Byli\'nski

::

:: Received March 1, 1990

:: Copyright (c) 1990-2019 Association of Mizar Users

:: Auxiliary theorems

Lm1: for a, b being Real holds 0 <= (a ^2) + (b ^2)

proof end;

:: Complex Numbers

definition

let z be Complex;

( ( z is real implies ex b_{1} being number st b_{1} = z ) & ( not z is real implies ex b_{1} being number ex f being Function of 2,REAL st

( z = f & b_{1} = f . 0 ) ) )

for b_{1}, b_{2} being number holds

( ( z is real & b_{1} = z & b_{2} = z implies b_{1} = b_{2} ) & ( not z is real & ex f being Function of 2,REAL st

( z = f & b_{1} = f . 0 ) & ex f being Function of 2,REAL st

( z = f & b_{2} = f . 0 ) implies b_{1} = b_{2} ) )
;

consistency

for b_{1} being number holds verum
;

( ( z is real implies ex b_{1} being number st b_{1} = 0 ) & ( not z is real implies ex b_{1} being number ex f being Function of 2,REAL st

( z = f & b_{1} = f . 1 ) ) )

for b_{1}, b_{2} being number holds

( ( z is real & b_{1} = 0 & b_{2} = 0 implies b_{1} = b_{2} ) & ( not z is real & ex f being Function of 2,REAL st

( z = f & b_{1} = f . 1 ) & ex f being Function of 2,REAL st

( z = f & b_{2} = f . 1 ) implies b_{1} = b_{2} ) )
;

consistency

for b_{1} being number holds verum
;

end;
func Re z -> number means :Def1: :: COMPLEX1:def 1

it = z if z is real

otherwise ex f being Function of 2,REAL st

( z = f & it = f . 0 );

existence it = z if z is real

otherwise ex f being Function of 2,REAL st

( z = f & it = f . 0 );

( ( z is real implies ex b

( z = f & b

proof end;

uniqueness for b

( ( z is real & b

( z = f & b

( z = f & b

consistency

for b

func Im z -> number means :Def2: :: COMPLEX1:def 2

it = 0 if z is real

otherwise ex f being Function of 2,REAL st

( z = f & it = f . 1 );

existence it = 0 if z is real

otherwise ex f being Function of 2,REAL st

( z = f & it = f . 1 );

( ( z is real implies ex b

( z = f & b

proof end;

uniqueness for b

( ( z is real & b

( z = f & b

( z = f & b

consistency

for b

:: deftheorem Def1 defines Re COMPLEX1:def 1 :

for z being Complex

for b_{2} being number holds

( ( z is real implies ( b_{2} = Re z iff b_{2} = z ) ) & ( not z is real implies ( b_{2} = Re z iff ex f being Function of 2,REAL st

( z = f & b_{2} = f . 0 ) ) ) );

for z being Complex

for b

( ( z is real implies ( b

( z = f & b

:: deftheorem Def2 defines Im COMPLEX1:def 2 :

for z being Complex

for b_{2} being number holds

( ( z is real implies ( b_{2} = Im z iff b_{2} = 0 ) ) & ( not z is real implies ( b_{2} = Im z iff ex f being Function of 2,REAL st

( z = f & b_{2} = f . 1 ) ) ) );

for z being Complex

for b

( ( z is real implies ( b

( z = f & b

registration
end;

definition

let z be Complex;

:: original: Re

redefine func Re z -> Element of REAL ;

coherence

Re z is Element of REAL by XREAL_0:def 1;

:: original: Im

redefine func Im z -> Element of REAL ;

coherence

Im z is Element of REAL by XREAL_0:def 1;

end;
:: original: Re

redefine func Re z -> Element of REAL ;

coherence

Re z is Element of REAL by XREAL_0:def 1;

:: original: Im

redefine func Im z -> Element of REAL ;

coherence

Im z is Element of REAL by XREAL_0:def 1;

Lm2: for a, b being Element of REAL holds

( Re [*a,b*] = a & Im [*a,b*] = b )

proof end;

Lm3: for z being Complex holds [*(Re z),(Im z)*] = z

proof end;

definition
end;

:: deftheorem defines = COMPLEX1:def 3 :

for z1, z2 being Complex holds

( z1 = z2 iff ( Re z1 = Re z2 & Im z1 = Im z2 ) );

for z1, z2 being Complex holds

( z1 = z2 iff ( Re z1 = Re z2 & Im z1 = Im z2 ) );

definition

:: original: 0c

redefine func 0c -> Element of COMPLEX ;

correctness

coherence

0c is Element of COMPLEX ;

by XCMPLX_0:def 2;

end;
redefine func 0c -> Element of COMPLEX ;

correctness

coherence

0c is Element of COMPLEX ;

by XCMPLX_0:def 2;

definition

correctness

coherence

1 is Element of COMPLEX ;

by XCMPLX_0:def 2;

:: original: <i>

redefine func <i> -> Element of COMPLEX ;

coherence

<i> is Element of COMPLEX by XCMPLX_0:def 2;

end;
coherence

1 is Element of COMPLEX ;

by XCMPLX_0:def 2;

:: original: <i>

redefine func <i> -> Element of COMPLEX ;

coherence

<i> is Element of COMPLEX by XCMPLX_0:def 2;

Lm7: for x being Real

for x1, x2 being Element of REAL st x = [*x1,x2*] holds

( x2 = 0 & x = x1 )

proof end;

Lm8: for x9, y9 being Element of REAL

for x, y being Real st x9 = x & y9 = y holds

+ (x9,y9) = x + y

proof end;

Lm9: for x being Element of REAL holds opp x = - x

proof end;

Lm10: for x9, y9 being Element of REAL

for x, y being Real st x9 = x & y9 = y holds

* (x9,y9) = x * y

proof end;

Lm11: for x, y, z being Complex st z = x + y holds

Re z = (Re x) + (Re y)

proof end;

Lm12: for x, y, z being Complex st z = x + y holds

Im z = (Im x) + (Im y)

proof end;

Lm13: for x, y, z being Complex st z = x * y holds

Re z = ((Re x) * (Re y)) - ((Im x) * (Im y))

proof end;

Lm14: for x, y, z being Complex st z = x * y holds

Im z = ((Re x) * (Im y)) + ((Im x) * (Re y))

proof end;

Lm15: for z1, z2 being Complex holds z1 + z2 = [*((Re z1) + (Re z2)),((Im z1) + (Im z2))*]

proof end;

Lm16: for z1, z2 being Complex holds z1 * z2 = [*(((Re z1) * (Re z2)) - ((Im z1) * (Im z2))),(((Re z1) * (Im z2)) + ((Re z2) * (Im z1)))*]

proof end;

Lm17: for z1, z2 being Complex holds

( Re (z1 * z2) = ((Re z1) * (Re z2)) - ((Im z1) * (Im z2)) & Im (z1 * z2) = ((Re z1) * (Im z2)) + ((Re z2) * (Im z1)) )

proof end;

Lm18: for z1, z2 being Complex holds

( Re (z1 + z2) = (Re z1) + (Re z2) & Im (z1 + z2) = (Im z1) + (Im z2) )

proof end;

Lm19: for x being Element of REAL holds Re (x * <i>) = 0

proof end;

Lm20: for x being Element of REAL holds Im (x * <i>) = x

proof end;

Lm21: for x, y being Element of REAL holds [*x,y*] = x + (y * <i>)

proof end;

definition
end;

theorem Th8: :: COMPLEX1:8

for z1, z2 being Complex holds

( Re (z1 + z2) = (Re z1) + (Re z2) & Im (z1 + z2) = (Im z1) + (Im z2) )

( Re (z1 + z2) = (Re z1) + (Re z2) & Im (z1 + z2) = (Im z1) + (Im z2) )

proof end;

definition
end;

theorem Th9: :: COMPLEX1:9

for z1, z2 being Complex holds

( Re (z1 * z2) = ((Re z1) * (Re z2)) - ((Im z1) * (Im z2)) & Im (z1 * z2) = ((Re z1) * (Im z2)) + ((Re z2) * (Im z1)) )

( Re (z1 * z2) = ((Re z1) * (Re z2)) - ((Im z1) * (Im z2)) & Im (z1 * z2) = ((Re z1) * (Im z2)) + ((Re z2) * (Im z1)) )

proof end;

theorem Th14: :: COMPLEX1:14

for z1, z2 being Complex st Im z1 = 0 & Im z2 = 0 holds

( Re (z1 * z2) = (Re z1) * (Re z2) & Im (z1 * z2) = 0 )

( Re (z1 * z2) = (Re z1) * (Re z2) & Im (z1 * z2) = 0 )

proof end;

theorem Th15: :: COMPLEX1:15

for z1, z2 being Complex st Re z1 = 0 & Re z2 = 0 holds

( Re (z1 * z2) = - ((Im z1) * (Im z2)) & Im (z1 * z2) = 0 )

( Re (z1 * z2) = - ((Im z1) * (Im z2)) & Im (z1 * z2) = 0 )

proof end;

theorem :: COMPLEX1:16

for z being Complex holds

( Re (z * z) = ((Re z) ^2) - ((Im z) ^2) & Im (z * z) = 2 * ((Re z) * (Im z)) )

( Re (z * z) = ((Re z) ^2) - ((Im z) ^2) & Im (z * z) = 2 * ((Re z) * (Im z)) )

proof end;

definition
end;

Lm22: for z being Complex holds - z = (- (Re z)) + ((- (Im z)) * <i>)

proof end;

definition
end;

Lm23: for z1, z2 being Complex holds z1 - z2 = ((Re z1) - (Re z2)) + (((Im z1) - (Im z2)) * <i>)

proof end;

theorem Th19: :: COMPLEX1:19

for z1, z2 being Complex holds

( Re (z1 - z2) = (Re z1) - (Re z2) & Im (z1 - z2) = (Im z1) - (Im z2) )

( Re (z1 - z2) = (Re z1) - (Re z2) & Im (z1 - z2) = (Im z1) - (Im z2) )

proof end;

definition
end;

Lm24: for z being Complex holds z " = ((Re z) / (((Re z) ^2) + ((Im z) ^2))) + (((- (Im z)) / (((Re z) ^2) + ((Im z) ^2))) * <i>)

proof end;

theorem Th20: :: COMPLEX1:20

for z being Complex holds

( Re (z ") = (Re z) / (((Re z) ^2) + ((Im z) ^2)) & Im (z ") = (- (Im z)) / (((Re z) ^2) + ((Im z) ^2)) )

( Re (z ") = (Re z) / (((Re z) ^2) + ((Im z) ^2)) & Im (z ") = (- (Im z)) / (((Re z) ^2) + ((Im z) ^2)) )

proof end;

definition
end;

Lm25: for z1, z2 being Complex holds z1 / z2 = ((((Re z1) * (Re z2)) + ((Im z1) * (Im z2))) / (((Re z2) ^2) + ((Im z2) ^2))) + (((((Re z2) * (Im z1)) - ((Re z1) * (Im z2))) / (((Re z2) ^2) + ((Im z2) ^2))) * <i>)

proof end;

theorem :: COMPLEX1:24

for z1, z2 being Complex holds

( Re (z1 / z2) = (((Re z1) * (Re z2)) + ((Im z1) * (Im z2))) / (((Re z2) ^2) + ((Im z2) ^2)) & Im (z1 / z2) = (((Re z2) * (Im z1)) - ((Re z1) * (Im z2))) / (((Re z2) ^2) + ((Im z2) ^2)) )

( Re (z1 / z2) = (((Re z1) * (Re z2)) + ((Im z1) * (Im z2))) / (((Re z2) ^2) + ((Im z2) ^2)) & Im (z1 / z2) = (((Re z2) * (Im z1)) - ((Re z1) * (Im z2))) / (((Re z2) ^2) + ((Im z2) ^2)) )

proof end;

theorem :: COMPLEX1:25

for z1, z2 being Complex st Im z1 = 0 & Im z2 = 0 & Re z2 <> 0 holds

( Re (z1 / z2) = (Re z1) / (Re z2) & Im (z1 / z2) = 0 )

( Re (z1 / z2) = (Re z1) / (Re z2) & Im (z1 / z2) = 0 )

proof end;

theorem :: COMPLEX1:26

for z1, z2 being Complex st Re z1 = 0 & Re z2 = 0 & Im z2 <> 0 holds

( Re (z1 / z2) = (Im z1) / (Im z2) & Im (z1 / z2) = 0 )

( Re (z1 / z2) = (Im z1) / (Im z2) & Im (z1 / z2) = 0 )

proof end;

definition

let z be Complex;

correctness

coherence

(Re z) - ((Im z) * <i>) is Complex;

;

involutiveness

for b_{1}, b_{2} being Complex st b_{1} = (Re b_{2}) - ((Im b_{2}) * <i>) holds

b_{2} = (Re b_{1}) - ((Im b_{1}) * <i>)

end;
correctness

coherence

(Re z) - ((Im z) * <i>) is Complex;

;

involutiveness

for b

b

proof end;

:: deftheorem defines *' COMPLEX1:def 11 :

for z being Complex holds z *' = (Re z) - ((Im z) * <i>);

for z being Complex holds z *' = (Re z) - ((Im z) * <i>);

definition

let z be Complex;

coherence

sqrt (((Re z) ^2) + ((Im z) ^2)) is Real ;

projectivity

for b_{1} being Real

for b_{2} being Complex st b_{1} = sqrt (((Re b_{2}) ^2) + ((Im b_{2}) ^2)) holds

b_{1} = sqrt (((Re b_{1}) ^2) + ((Im b_{1}) ^2))

end;
coherence

sqrt (((Re z) ^2) + ((Im z) ^2)) is Real ;

projectivity

for b

for b

b

proof end;

:: deftheorem defines |. COMPLEX1:def 12 :

for z being Complex holds |.z.| = sqrt (((Re z) ^2) + ((Im z) ^2));

for z being Complex holds |.z.| = sqrt (((Re z) ^2) + ((Im z) ^2));

registration
end;

registration
end;

registration
end;

Lm26: for z being Complex holds |.(- z).| = |.z.|

proof end;

Lm27: for a being Real st a <= 0 holds

|.a.| = - a

proof end;

Lm28: for a being Real holds sqrt (a ^2) = |.a.|

proof end;

Lm29: for a being Real holds

( - |.a.| <= a & a <= |.a.| )

proof end;

Lm30: for a, b being Real holds

( ( - b <= a & a <= b ) iff |.a.| <= b )

proof end;

:: Originally from SQUARE_1

:: from JGRAPH_1, 29.12.2006, AK

theorem :: COMPLEX1:82

for z1, z2 being Complex holds z1 * z2 = (((Re z1) * (Re z2)) - ((Im z1) * (Im z2))) + ((((Re z1) * (Im z2)) + ((Re z2) * (Im z1))) * <i>)

proof end;

theorem :: COMPLEX1:84

theorem :: COMPLEX1:85

theorem :: COMPLEX1:86