mathlib3 documentation

data.is_R_or_C.basic

is_R_or_C: a typeclass for ℝ or ℂ #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

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 ℂ.

Applications include defining inner products and Hilbert spaces for both the real and complex case. One typically produces 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.

The instance for is registered in this file. The instance for is declared in analysis.complex.basic.

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).

A few lemmas requiring heavier imports are in data.is_R_or_C.lemmas.

@[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 of this typeclass
Instances of other typeclasses for is_R_or_C
  • is_R_or_C.has_sizeof_inst
@[protected, instance]
noncomputable 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
theorem is_R_or_C.real_smul_eq_coe_mul {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :
r z = r * z
theorem is_R_or_C.real_smul_eq_coe_smul {K : Type u_1} {E : Type u_2} [is_R_or_C K] [add_comm_group E] [module K E] [module E] [is_scalar_tower K E] (r : ) (x : E) :
r x = r x
@[simp]
@[simp, norm_cast]
theorem is_R_or_C.of_real_re {K : Type u_1} [is_R_or_C K] (r : ) :
@[simp, norm_cast]
theorem is_R_or_C.of_real_im {K : Type u_1} [is_R_or_C K] (r : ) :
theorem is_R_or_C.ext {K : Type u_1} [is_R_or_C K] {z w : K} (hre : is_R_or_C.re z = is_R_or_C.re w) (him : is_R_or_C.im z = is_R_or_C.im w) :
z = w
@[norm_cast]
theorem is_R_or_C.of_real_zero {K : Type u_1} [is_R_or_C K] :
0 = 0
theorem is_R_or_C.zero_re' {K : Type u_1} [is_R_or_C K] :
@[norm_cast]
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] :
@[norm_cast]
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) :
theorem is_R_or_C.of_real_eq_zero {K : Type u_1} [is_R_or_C K] {x : } :
x = 0 x = 0
theorem is_R_or_C.of_real_ne_zero {K : Type u_1} [is_R_or_C K] {x : } :
x 0 x 0
@[simp, norm_cast]
theorem is_R_or_C.of_real_add {K : Type u_1} [is_R_or_C K] (r s : ) :
(r + s) = r + s
@[simp, norm_cast]
theorem is_R_or_C.of_real_bit0 {K : Type u_1} [is_R_or_C K] (r : ) :
@[simp, norm_cast]
theorem is_R_or_C.of_real_bit1 {K : Type u_1} [is_R_or_C K] (r : ) :
@[simp, norm_cast]
theorem is_R_or_C.of_real_neg {K : Type u_1} [is_R_or_C K] (r : ) :
@[simp, norm_cast]
theorem is_R_or_C.of_real_sub {K : Type u_1} [is_R_or_C K] (r s : ) :
(r - s) = r - s
@[simp, norm_cast]
theorem is_R_or_C.of_real_sum {K : Type u_1} [is_R_or_C K] {α : Type u_2} (s : finset α) (f : α ) :
(s.sum (λ (i : α), f i)) = s.sum (λ (i : α), (f i))
@[simp, norm_cast]
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, norm_cast]
theorem is_R_or_C.of_real_mul {K : Type u_1} [is_R_or_C K] (r s : ) :
(r * s) = r * s
@[simp, norm_cast]
theorem is_R_or_C.of_real_pow {K : Type u_1} [is_R_or_C K] (r : ) (n : ) :
(r ^ n) = r ^ n
@[simp, norm_cast]
theorem is_R_or_C.of_real_prod {K : Type u_1} [is_R_or_C K] {α : Type u_2} (s : finset α) (f : α ) :
(s.prod (λ (i : α), f i)) = s.prod (λ (i : α), (f i))
@[simp, norm_cast]
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))
@[simp, norm_cast]
theorem is_R_or_C.real_smul_of_real {K : Type u_1} [is_R_or_C K] (r x : ) :
r x = r * x
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.of_real_mul_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) :
@[simp, norm_cast]
theorem is_R_or_C.norm_of_real {K : Type u_1} [is_R_or_C K] (r : ) :

Characteristic zero #

@[protected, instance]

ℝ and ℂ are both of characteristic zero.

The imaginary unit, I #

@[simp]

The imaginary unit.

@[simp]
@[simp]
@[simp]
@[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) :
theorem is_R_or_C.sub_conj {K : Type u_1} [is_R_or_C K] (z : K) :
theorem is_R_or_C.conj_smul {K : Type u_1} [is_R_or_C K] (r : ) (z : K) :
theorem is_R_or_C.add_conj {K : Type u_1} [is_R_or_C K] (z : K) :
theorem is_R_or_C.re_eq_add_conj {K : Type u_1} [is_R_or_C K] (z : K) :
theorem is_R_or_C.is_real_tfae {K : Type u_1} [is_R_or_C K] (z : K) :

There are several equivalent ways to say that a number z is in fact a real number.

theorem is_R_or_C.conj_eq_iff_real {K : Type u_1} [is_R_or_C K] {z : K} :
(star_ring_end K) z = z (r : ), z = r
theorem is_R_or_C.conj_eq_iff_re {K : Type u_1} [is_R_or_C K] {z : K} :
theorem is_R_or_C.conj_eq_iff_im {K : Type u_1} [is_R_or_C K] {z : K} :
@[simp]
@[reducible]

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

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_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.mul_conj {K : Type u_1} [is_R_or_C K] (z : K) :
theorem is_R_or_C.conj_mul {K : Type u_1} [is_R_or_C K] (x : K) :

Inversion #

@[simp, norm_cast]
theorem is_R_or_C.of_real_inv {K : Type u_1} [is_R_or_C K] (r : ) :
theorem is_R_or_C.inv_def {K : Type u_1} [is_R_or_C K] (z : K) :
@[simp]
theorem is_R_or_C.conj_inv {K : Type u_1} [is_R_or_C K] (x : K) :
@[simp, norm_cast]
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, norm_cast]
theorem is_R_or_C.of_real_zpow {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.norm_conj {K : Type u_1} [is_R_or_C K] {z : K} :
@[protected, instance]

Cast lemmas #

@[simp, norm_cast]
theorem is_R_or_C.of_real_nat_cast {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.nat_cast_re {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.nat_cast_im {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.of_real_int_cast {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.int_cast_re {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.int_cast_im {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.of_real_rat_cast {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp, norm_cast]
theorem is_R_or_C.rat_cast_re {K : Type u_1} [is_R_or_C K] (q : ) :
@[simp, norm_cast]
theorem is_R_or_C.rat_cast_im {K : Type u_1} [is_R_or_C K] (q : ) :

Norm #

theorem is_R_or_C.norm_of_nonneg {K : Type u_1} [is_R_or_C K] {r : } (h : 0 r) :
@[simp, norm_cast]
theorem is_R_or_C.norm_nat_cast {K : Type u_1} [is_R_or_C K] (n : ) :
@[simp]
theorem is_R_or_C.norm_two {K : Type u_1} [is_R_or_C K] :
theorem is_R_or_C.re_le_norm {K : Type u_1} [is_R_or_C K] (z : K) :
theorem is_R_or_C.im_le_norm {K : Type u_1} [is_R_or_C K] (z : K) :

Cauchy sequences #

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

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

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

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

Equations
@[protected, instance]
noncomputable def real.is_R_or_C  :
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]
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
noncomputable 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, norm_cast]
@[continuity]
def is_R_or_C.im_lm {K : Type u_1} [is_R_or_C K] :

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

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

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

Equations
@[simp, norm_cast]
@[continuity]
def is_R_or_C.conj_ae {K : Type u_1} [is_R_or_C K] :

Conjugate as an -algebra equivalence

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

Conjugate as a linear isometry

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

Conjugate as a continuous linear equivalence

Equations
@[protected, instance]
@[continuity]
noncomputable def is_R_or_C.of_real_am {K : Type u_1} [is_R_or_C K] :

The ℝ → K coercion, as a linear map

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

The ℝ → K coercion, as a linear isometry

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

The ℝ → K coercion, as a continuous linear map

Equations
@[continuity]