mathlib documentation

data.​complex.​basic

data.​complex.​basic

The complex numbers

The complex numbers are modelled as ℝ^2 in the obvious way.

Definition and basic arithmmetic

structure complex  :
Type

Complex numbers consist of two reals: a real part re and an imaginary part im.

The equivalence between the complex numbers and ℝ × ℝ.

Equations
@[simp]
theorem complex.​eta (z : ℂ) :
{re := z.re, im := z.im} = z

@[ext]
theorem complex.​ext {z w : ℂ} :
z.re = w.re → z.im = w.im → z = w

theorem complex.​ext_iff {z w : ℂ} :
z = w ↔ z.re = w.re ∧ z.im = w.im

@[instance]

Equations
@[simp]
theorem complex.​of_real_re (r : ℝ) :
↑r.re = r

@[simp]
theorem complex.​of_real_im (r : ℝ) :
↑r.im = 0

@[simp]
theorem complex.​of_real_inj {z w : ℝ} :
↑z = ↑w ↔ z = w

@[instance]

Equations
@[instance]

Equations
@[simp]
theorem complex.​zero_re  :
0.re = 0

@[simp]
theorem complex.​zero_im  :
0.im = 0

@[simp]
theorem complex.​of_real_zero  :
↑0 = 0

@[simp]
theorem complex.​of_real_eq_zero {z : ℝ} :
↑z = 0 ↔ z = 0

theorem complex.​of_real_ne_zero {z : ℝ} :
↑z ≠ 0 ↔ z ≠ 0

@[instance]

Equations
@[simp]
theorem complex.​one_re  :
1.re = 1

@[simp]
theorem complex.​one_im  :
1.im = 0

@[simp]
theorem complex.​of_real_one  :
↑1 = 1

@[instance]

Equations
@[simp]
theorem complex.​add_re (z w : ℂ) :
(z + w).re = z.re + w.re

@[simp]
theorem complex.​add_im (z w : ℂ) :
(z + w).im = z.im + w.im

@[simp]
theorem complex.​bit0_re (z : ℂ) :
(bit0 z).re = bit0 z.re

@[simp]
theorem complex.​bit1_re (z : ℂ) :
(bit1 z).re = bit1 z.re

@[simp]
theorem complex.​bit0_im (z : ℂ) :
(bit0 z).im = bit0 z.im

@[simp]
theorem complex.​bit1_im (z : ℂ) :
(bit1 z).im = bit0 z.im

@[simp]
theorem complex.​of_real_add (r s : ℝ) :
↑(r + s) = ↑r + ↑s

@[simp]
theorem complex.​of_real_bit0 (r : ℝ) :

@[simp]
theorem complex.​of_real_bit1 (r : ℝ) :

@[instance]

Equations
@[simp]
theorem complex.​neg_re (z : ℂ) :
(-z).re = -z.re

@[simp]
theorem complex.​neg_im (z : ℂ) :
(-z).im = -z.im

@[simp]
theorem complex.​of_real_neg (r : ℝ) :

@[instance]

Equations
@[simp]
theorem complex.​mul_re (z w : ℂ) :
(z * w).re = z.re * w.re - z.im * w.im

@[simp]
theorem complex.​mul_im (z w : ℂ) :
(z * w).im = z.re * w.im + z.im * w.re

@[simp]
theorem complex.​of_real_mul (r s : ℝ) :
↑(r * s) = ↑r * ↑s

theorem complex.​smul_re (r : ℝ) (z : ℂ) :
(↑r * z).re = r * z.re

theorem complex.​smul_im (r : ℝ) (z : ℂ) :
(↑r * z).im = r * z.im

theorem complex.​of_real_smul (r : ℝ) (z : ℂ) :
↑r * z = {re := r * z.re, im := r * z.im}

The imaginary unit, I

def complex.​I  :

The imaginary unit.

Equations
@[simp]
theorem complex.​I_re  :

@[simp]
theorem complex.​I_im  :

@[simp]

theorem complex.​I_mul (z : ℂ) :
complex.I * z = {re := -z.im, im := z.re}

theorem complex.​mk_eq_add_mul_I (a b : ℝ) :
{re := a, im := b} = ↑a + ↑b * complex.I

@[simp]
theorem complex.​re_add_im (z : ℂ) :
↑(z.re) + ↑(z.im) * complex.I = z

Commutative ring instance and lemmas

@[instance]

Equations

Complex conjugation

The complex conjugate.

Equations
@[simp]
theorem complex.​conj_re (z : ℂ) :

@[simp]
theorem complex.​conj_im (z : ℂ) :

@[simp]
theorem complex.​conj_eq_zero {z : ℂ} :

theorem complex.​eq_conj_iff_real {z : ℂ} :
⇑complex.conj z = z ↔ ∃ (r : ℝ), z = ↑r

Norm squared

def complex.​norm_sq  :
ℂ → ℝ

The norm squared function.

Equations
@[simp]

@[simp]

@[simp]
theorem complex.​norm_sq_pos {z : ℂ} :

theorem complex.​add_conj (z : ℂ) :

@[simp]
theorem complex.​I_sq  :

@[simp]
theorem complex.​sub_re (z w : ℂ) :
(z - w).re = z.re - w.re

@[simp]
theorem complex.​sub_im (z w : ℂ) :
(z - w).im = z.im - w.im

@[simp]
theorem complex.​of_real_sub (r s : ℝ) :
↑(r - s) = ↑r - ↑s

@[simp]
theorem complex.​of_real_pow (r : ℝ) (n : ℕ) :
↑(r ^ n) = ↑r ^ n

Inversion

@[simp]
theorem complex.​inv_re (z : ℂ) :

@[simp]

@[simp]

theorem complex.​mul_inv_cancel {z : ℂ} :
z ≠ 0 → z * z⁻¹ = 1

Field instance and lemmas

theorem complex.​div_re (z w : ℂ) :

theorem complex.​div_im (z w : ℂ) :

@[simp]
theorem complex.​of_real_div (r s : ℝ) :
↑(r / s) = ↑r / ↑s

@[simp]
theorem complex.​of_real_fpow (r : ℝ) (n : ℤ) :
↑(r ^ n) = ↑r ^ n

@[simp]
theorem complex.​div_I (z : ℂ) :

Cast lemmas

@[simp]

@[simp]
theorem complex.​nat_cast_re (n : ℕ) :

@[simp]
theorem complex.​nat_cast_im (n : ℕ) :
↑n.im = 0

@[simp]

@[simp]
theorem complex.​int_cast_re (n : ℤ) :

@[simp]
theorem complex.​int_cast_im (n : ℤ) :
↑n.im = 0

@[simp]

@[simp]
theorem complex.​rat_cast_re (q : ℚ) :

@[simp]
theorem complex.​rat_cast_im (q : ℚ) :
↑q.im = 0

Characteristic zero

theorem complex.​re_eq_add_conj (z : ℂ) :
↑(z.re) = (z + ⇑complex.conj z) / 2

Absolute value

def complex.​abs  :
ℂ → ℝ

The complex absolute value function, defined as the square root of the norm squared.

Equations
@[simp]

theorem complex.​abs_of_nonneg {r : ℝ} :
0 ≤ r → complex.abs ↑r = r

@[simp]

@[simp]
theorem complex.​abs_one  :

@[simp]
theorem complex.​abs_two  :

@[simp]
theorem complex.​abs_eq_zero {z : ℂ} :
complex.abs z = 0 ↔ z = 0

@[simp]
theorem complex.​abs_mul (z w : ℂ) :

@[simp]

@[simp]
theorem complex.​abs_pos {z : ℂ} :

@[simp]

theorem complex.​abs_sub (z w : ℂ) :

theorem complex.​abs_sub_le (a b c : ℂ) :

@[simp]
theorem complex.​abs_div (z w : ℂ) :

@[simp]

Cauchy sequences

The real part of a complex Cauchy sequence, as a real Cauchy sequence.

Equations

The imaginary part of a complex Cauchy sequence, as a real Cauchy sequence.

Equations

The limit of a Cauchy sequence of complex numbers.

Equations
@[instance]

Equations

The complex conjugate of a complex Cauchy sequence, as a complex Cauchy sequence.

Equations

The absolute value of a complex Cauchy sequence, as a real Cauchy sequence.

Equations