mathlib documentation

data.complex.is_R_or_C

is_R_or_C: a typeclass for ℝ or ℂ

This file defines the typeclass is_R_or_C intended to have only two instances: ℝ and ℂ. It is meant for definitions and theorems which hold for both the real and the complex case, and in particular when the real case follows directly from the complex case by setting re to id, im to zero and so on. Its API follows closely that of ℂ.

Possible applications include defining inner products and Hilbert spaces for both the real and complex case. One would produce the definitions and proof for an arbitrary field of this typeclass, which basically amounts to doing the complex case, and the two cases then fall out immediately from the two instances of the class.

Implementation notes

The coercion from reals into an is_R_or_C field is done by registering algebra_map ℝ K as a has_coe_t. For this to work, we must proceed carefully to avoid problems involving circular coercions in the case K=ℝ; in particular, we cannot use the plain has_coe and must set priorities carefully. This problem was already solved for , and we copy the solution detailed in data/nat/cast. See also Note [coercion into rings] for more details.

In addition, several lemmas need to be set at priority 900 to make sure that they do not override their counterparts in complex.lean (which causes linter errors).

@[class]
structure is_R_or_C (K : Type u_1) :
Type u_1

This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.

Instances
@[instance]
def is_R_or_C.algebra_map_coe {K : Type u_1} [is_R_or_C K] :

Equations
theorem is_R_or_C.of_real_alg {K : Type u_1} [is_R_or_C K] (x : ) :
x = x 1

@[simp]
theorem is_R_or_C.re_add_im {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.of_real_re {K : Type u_1} [is_R_or_C K] (r : ) :

@[simp]
theorem is_R_or_C.of_real_im {K : Type u_1} [is_R_or_C K] (r : ) :

@[simp]
theorem is_R_or_C.mul_re {K : Type u_1} [is_R_or_C K] (z w : K) :

@[simp]
theorem is_R_or_C.mul_im {K : Type u_1} [is_R_or_C K] (z w : K) :

theorem is_R_or_C.inv_def {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.ext {K : Type u_1} [is_R_or_C K] {z w : K} :

@[simp]
theorem is_R_or_C.of_real_zero {K : Type u_1} [is_R_or_C K] :
0 = 0

@[simp]
theorem is_R_or_C.zero_re' {K : Type u_1} [is_R_or_C K] :

@[simp]
theorem is_R_or_C.of_real_one {K : Type u_1} [is_R_or_C K] :
1 = 1

@[simp]
theorem is_R_or_C.one_re {K : Type u_1} [is_R_or_C K] :

@[simp]
theorem is_R_or_C.one_im {K : Type u_1} [is_R_or_C K] :

@[simp]
theorem is_R_or_C.of_real_inj {K : Type u_1} [is_R_or_C K] {z w : } :
z = w z = w

@[simp]
theorem is_R_or_C.bit0_re {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.bit1_re {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.bit0_im {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.bit1_im {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.of_real_eq_zero {K : Type u_1} [is_R_or_C K] {z : } :
z = 0 z = 0

@[simp]
theorem is_R_or_C.of_real_add {K : Type u_1} [is_R_or_C K] ⦃r s :  :
(r + s) = r + s

@[simp]
theorem is_R_or_C.of_real_bit0 {K : Type u_1} [is_R_or_C K] (r : ) :

@[simp]
theorem is_R_or_C.of_real_bit1 {K : Type u_1} [is_R_or_C K] (r : ) :

theorem is_R_or_C.two_ne_zero {K : Type u_1} [is_R_or_C K] :
2 0

@[simp]
theorem is_R_or_C.of_real_neg {K : Type u_1} [is_R_or_C K] (r : ) :

@[simp]
theorem is_R_or_C.of_real_mul {K : Type u_1} [is_R_or_C K] (r s : ) :
r * s = (r) * s

theorem is_R_or_C.of_real_mul_re {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :

theorem is_R_or_C.smul_re {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :

theorem is_R_or_C.smul_im {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :

theorem is_R_or_C.smul_re' {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :

theorem is_R_or_C.smul_im' {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :

def is_R_or_C.re_lm {K : Type u_1} [is_R_or_C K] :

The real part in a is_R_or_C field, as a linear map.

Equations

The imaginary unit, I

@[simp]
theorem is_R_or_C.I_re {K : Type u_1} [is_R_or_C K] :

The imaginary unit.

@[simp]

@[simp]

@[simp]
theorem is_R_or_C.conj_re {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.conj_im {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.conj_of_real {K : Type u_1} [is_R_or_C K] (r : ) :

@[simp]
theorem is_R_or_C.conj_bit0 {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.conj_bit1 {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.conj_conj {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.conj_inj {K : Type u_1} [is_R_or_C K] (z w : K) :

theorem is_R_or_C.conj_eq_zero {K : Type u_1} [is_R_or_C K] {z : K} :

theorem is_R_or_C.eq_conj_iff_real {K : Type u_1} [is_R_or_C K] {z : K} :
is_R_or_C.conj z = z ∃ (r : ), z = r

def is_R_or_C.conj_to_ring_equiv (K : Type u_1) [is_R_or_C K] :

Conjugation as a ring equivalence. This is used to convert the inner product into a sesquilinear product.

Equations
theorem is_R_or_C.eq_conj_iff_re {K : Type u_1} [is_R_or_C K] {z : K} :

def is_R_or_C.norm_sq {K : Type u_1} [is_R_or_C K] :

The norm squared function.

Equations
theorem is_R_or_C.norm_sq_eq_def' {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.norm_sq_of_real {K : Type u_1} [is_R_or_C K] (r : ) :
r ^ 2 = r * r

theorem is_R_or_C.norm_sq_zero {K : Type u_1} [is_R_or_C K] :

theorem is_R_or_C.norm_sq_one {K : Type u_1} [is_R_or_C K] :

theorem is_R_or_C.norm_sq_nonneg {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.norm_sq_eq_zero {K : Type u_1} [is_R_or_C K] {z : K} :

@[simp]
theorem is_R_or_C.norm_sq_pos {K : Type u_1} [is_R_or_C K] {z : K} :

@[simp]
theorem is_R_or_C.norm_sq_neg {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]

theorem is_R_or_C.mul_conj {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.add_conj {K : Type u_1} [is_R_or_C K] (z : K) :

def is_R_or_C.of_real_hom {K : Type u_1} [is_R_or_C K] :

The pseudo-coercion of_real as a ring_hom.

Equations
def is_R_or_C.coe_hom {K : Type u_1} [is_R_or_C K] :

The coercion from reals as a ring_hom.

Equations
@[simp]
theorem is_R_or_C.of_real_sub {K : Type u_1} [is_R_or_C K] (r s : ) :
(r - s) = r - s

@[simp]
theorem is_R_or_C.of_real_pow {K : Type u_1} [is_R_or_C K] (r : ) (n : ) :
(r ^ n) = r ^ n

theorem is_R_or_C.sub_conj {K : Type u_1} [is_R_or_C K] (z : K) :

Inversion

@[simp]

@[simp]

@[simp]
theorem is_R_or_C.of_real_inv {K : Type u_1} [is_R_or_C K] (r : ) :

theorem is_R_or_C.inv_zero {K : Type u_1} [is_R_or_C K] :
0⁻¹ = 0

theorem is_R_or_C.mul_inv_cancel {K : Type u_1} [is_R_or_C K] {z : K} (h : z 0) :
z * z⁻¹ = 1

@[simp]
theorem is_R_or_C.of_real_div {K : Type u_1} [is_R_or_C K] (r s : ) :
(r / s) = r / s

theorem is_R_or_C.div_re_of_real {K : Type u_1} [is_R_or_C K] {z : K} {r : } :

@[simp]
theorem is_R_or_C.of_real_fpow {K : Type u_1} [is_R_or_C K] (r : ) (n : ) :
(r ^ n) = r ^ n

@[simp]
theorem is_R_or_C.div_I {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.inv_I {K : Type u_1} [is_R_or_C K] :

@[simp]

@[simp]

theorem is_R_or_C.norm_conj {K : Type u_1} [is_R_or_C K] {z : K} :

theorem is_R_or_C.conj_div {K : Type u_1} [is_R_or_C K] {z w : K} :

Cast lemmas

@[simp]
theorem is_R_or_C.of_real_nat_cast {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.nat_cast_re {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.nat_cast_im {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.of_real_int_cast {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.int_cast_re {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.int_cast_im {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.of_real_rat_cast {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.rat_cast_re {K : Type u_1} [is_R_or_C K] (q : ) :

@[simp]
theorem is_R_or_C.rat_cast_im {K : Type u_1} [is_R_or_C K] (q : ) :

Characteristic zero

theorem is_R_or_C.char_zero_R_or_C {K : Type u_1} [is_R_or_C K] :

ℝ and ℂ are both of characteristic zero.

Note: This is not registered as an instance to avoid having multiple instances on ℝ and ℂ.

theorem is_R_or_C.re_eq_add_conj {K : Type u_1} [is_R_or_C K] (z : K) :

Absolute value

def is_R_or_C.abs {K : Type u_1} [is_R_or_C K] (z : K) :

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

Equations
@[simp]
theorem is_R_or_C.abs_of_real {K : Type u_1} [is_R_or_C K] (r : ) :

theorem is_R_or_C.norm_eq_abs {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.abs_of_nonneg {K : Type u_1} [is_R_or_C K] {r : } (h : 0 r) :

theorem is_R_or_C.abs_of_nat {K : Type u_1} [is_R_or_C K] (n : ) :

@[simp]
theorem is_R_or_C.abs_zero {K : Type u_1} [is_R_or_C K] :

@[simp]
theorem is_R_or_C.abs_one {K : Type u_1} [is_R_or_C K] :

@[simp]
theorem is_R_or_C.abs_two {K : Type u_1} [is_R_or_C K] :

theorem is_R_or_C.abs_nonneg {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.abs_eq_zero {K : Type u_1} [is_R_or_C K] {z : K} :

theorem is_R_or_C.abs_ne_zero {K : Type u_1} [is_R_or_C K] {z : K} :

@[simp]
theorem is_R_or_C.abs_conj {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.abs_mul {K : Type u_1} [is_R_or_C K] (z w : K) :

theorem is_R_or_C.abs_re_le_abs {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.abs_im_le_abs {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.re_le_abs {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.im_le_abs {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.im_eq_zero_of_le {K : Type u_1} [is_R_or_C K] {a : K} (h : is_R_or_C.abs a is_R_or_C.re a) :

theorem is_R_or_C.re_eq_self_of_le {K : Type u_1} [is_R_or_C K] {a : K} (h : is_R_or_C.abs a is_R_or_C.re a) :

theorem is_R_or_C.abs_add {K : Type u_1} [is_R_or_C K] (z w : K) :

@[simp]
theorem is_R_or_C.abs_abs {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.abs_pos {K : Type u_1} [is_R_or_C K] {z : K} :

@[simp]
theorem is_R_or_C.abs_neg {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.abs_sub {K : Type u_1} [is_R_or_C K] (z w : K) :

theorem is_R_or_C.abs_sub_le {K : Type u_1} [is_R_or_C K] (a b c : K) :

@[simp]
theorem is_R_or_C.abs_inv {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.abs_div {K : Type u_1} [is_R_or_C K] (z w : K) :

theorem is_R_or_C.abs_abs_sub_le_abs_sub {K : Type u_1} [is_R_or_C K] (z w : K) :

theorem is_R_or_C.abs_re_div_abs_le_one {K : Type u_1} [is_R_or_C K] (z : K) :

theorem is_R_or_C.abs_im_div_abs_le_one {K : Type u_1} [is_R_or_C K] (z : K) :

@[simp]
theorem is_R_or_C.abs_cast_nat {K : Type u_1} [is_R_or_C K] (n : ) :

theorem is_R_or_C.norm_sq_eq_abs {K : Type u_1} [is_R_or_C K] (x : K) :

def is_R_or_C.re_clm {K : Type u_1} [is_R_or_C K] :

The real part in a is_R_or_C field, as a continuous linear map.

Equations
@[simp]
theorem is_R_or_C.norm_re_clm {K : Type u_1} [is_R_or_C K] :

Cauchy sequences

theorem is_R_or_C.is_cau_seq_re {K : Type u_1} [is_R_or_C K] (f : cau_seq K is_R_or_C.abs) :

theorem is_R_or_C.is_cau_seq_im {K : Type u_1} [is_R_or_C K] (f : cau_seq K is_R_or_C.abs) :

def is_R_or_C.cau_seq_re {K : Type u_1} [is_R_or_C K] (f : cau_seq K is_R_or_C.abs) :

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

Equations
def is_R_or_C.cau_seq_im {K : Type u_1} [is_R_or_C K] (f : cau_seq K is_R_or_C.abs) :

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

Equations
theorem is_R_or_C.is_cau_seq_abs {K : Type u_1} [is_R_or_C K] {f : → K} (hf : is_cau_seq is_R_or_C.abs f) :

@[simp]
theorem is_R_or_C.of_real_prod {K : Type u_1} [is_R_or_C K] {α : Type u_2} (s : finset α) (f : α → ) :
∏ (i : α) in s, f i = ∏ (i : α) in s, (f i)

@[simp]
theorem is_R_or_C.of_real_sum {K : Type u_1} [is_R_or_C K] {α : Type u_2} (s : finset α) (f : α → ) :
∑ (i : α) in s, f i = ∑ (i : α) in s, (f i)

@[simp]
theorem is_R_or_C.of_real_finsupp_sum {K : Type u_1} [is_R_or_C K] {α : Type u_2} {M : Type u_3} [has_zero M] (f : α →₀ M) (g : α → M → ) :
(f.sum (λ (a : α) (b : M), g a b)) = f.sum (λ (a : α) (b : M), (g a b))

@[simp]
theorem is_R_or_C.of_real_finsupp_prod {K : Type u_1} [is_R_or_C K] {α : Type u_2} {M : Type u_3} [has_zero M] (f : α →₀ M) (g : α → M → ) :
(f.prod (λ (a : α) (b : M), g a b)) = f.prod (λ (a : α) (b : M), (g a b))

@[nolint, instance]

An is_R_or_C field is finite-dimensional over , since it is spanned by {1, I}.

@[nolint, instance]
def finite_dimensional.proper_is_R_or_C {K : Type u_1} [is_R_or_C K] {E : Type u_2} [normed_group E] [normed_space K E] [finite_dimensional K E] :

Over an is_R_or_C field, we can register the properness of finite-dimensional normed spaces as an instance.

@[instance]

Equations
@[instance]

Equations
@[simp]
theorem is_R_or_C.re_to_real {x : } :

@[simp]
theorem is_R_or_C.im_to_real {x : } :

@[simp]

@[simp]

@[simp]

@[simp]

@[simp]

@[simp]

@[simp]