# RCLike: a typeclass for ℝ or ℂ #

This file defines the typeclass RCLike 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 Mathlib/Analysis/Complex/Basic.lean.

## Implementation notes #

The coercion from reals into an RCLike field is done by registering RCLike.ofReal as a CoeTC. 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 Coe and must set priorities carefully. This problem was already solved for ℕ, and we copy the solution detailed in Mathlib/Data/Nat/Cast/Defs.lean. 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 Mathlib/Analysis/Complex/Basic.lean (which causes linter errors).

A few lemmas requiring heavier imports are in Mathlib/Data/RCLike/Lemmas.lean.

class RCLike (K : ) extends , , , :
Type u_1

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

• norm : K
• add_assoc : ∀ (a b c : K), a + b + c = a + (b + c)
• zero : K
• zero_add : ∀ (a : K), 0 + a = a
• add_zero : ∀ (a : K), a + 0 = a
• nsmul : KK
• nsmul_zero : ∀ (x : K), = 0
• nsmul_succ : ∀ (n : ) (x : K), AddMonoid.nsmul (n + 1) x = + x
• add_comm : ∀ (a b : K), a + b = b + a
• mul : KKK
• left_distrib : ∀ (a b c : K), a * (b + c) = a * b + a * c
• right_distrib : ∀ (a b c : K), (a + b) * c = a * c + b * c
• zero_mul : ∀ (a : K), 0 * a = 0
• mul_zero : ∀ (a : K), a * 0 = 0
• mul_assoc : ∀ (a b c : K), a * b * c = a * (b * c)
• one : K
• one_mul : ∀ (a : K), 1 * a = a
• mul_one : ∀ (a : K), a * 1 = a
• natCast : K
• natCast_zero :
• natCast_succ : ∀ (n : ), NatCast.natCast (n + 1) =
• npow : KK
• npow_zero : ∀ (x : K), = 1
• npow_succ : ∀ (n : ) (x : K), Semiring.npow (n + 1) x = * x
• neg : KK
• sub : KKK
• sub_eq_add_neg : ∀ (a b : K), a - b = a + -b
• zsmul : KK
• zsmul_zero' : ∀ (a : K), = 0
• zsmul_succ' : ∀ (n : ) (a : K), Ring.zsmul (Int.ofNat n.succ) a = Ring.zsmul (Int.ofNat n) a + a
• zsmul_neg' : ∀ (n : ) (a : K), = -Ring.zsmul (↑n.succ) a
• neg_add_cancel : ∀ (a : K), -a + a = 0
• intCast : K
• intCast_ofNat : ∀ (n : ), = n
• intCast_negSucc : ∀ (n : ), = -(n + 1)
• mul_comm : ∀ (a b : K), a * b = b * a
• inv : KK
• div : KKK
• div_eq_mul_inv : ∀ (a b : K), a / b = a * b⁻¹
• zpow : KK
• zpow_zero' : ∀ (a : K), = 1
• zpow_succ' : ∀ (n : ) (a : K), Field.zpow (Int.ofNat n.succ) a = Field.zpow (Int.ofNat n) a * a
• zpow_neg' : ∀ (n : ) (a : K), = (Field.zpow (↑n.succ) a)⁻¹
• exists_pair_ne : ∃ (x : K) (y : K), x y
• nnratCast : ℚ≥0K
• ratCast : K
• mul_inv_cancel : ∀ (a : K), a 0a * a⁻¹ = 1
• inv_zero : 0⁻¹ = 0
• nnratCast_def : ∀ (q : ℚ≥0), q = q.num / q.den
• nnqsmul : ℚ≥0KK
• nnqsmul_def : ∀ (q : ℚ≥0) (a : K), = q * a
• ratCast_def : ∀ (q : ), q = q.num / q.den
• qsmul : KK
• qsmul_def : ∀ (a : ) (x : K), = a * x
• dist : KK
• dist_self : ∀ (x : K), dist x x = 0
• dist_comm : ∀ (x y : K), dist x y = dist y x
• dist_triangle : ∀ (x y z : K), dist x z dist x y + dist y z
• edist : KKENNReal
• edist_dist : ∀ (x y : K), = ENNReal.ofReal (dist x y)
• toUniformSpace :
• uniformity_dist : = ⨅ (ε : ), ⨅ (_ : ε > 0), Filter.principal {p : K × K | dist p.1 p.2 < ε}
• toBornology :
• cobounded_sets : .sets = {s : Set K | ∃ (C : ), xs, ys, dist x y C}
• eq_of_dist_eq_zero : ∀ {x y : K}, dist x y = 0x = y
• dist_eq : ∀ (x y : K), dist x y = x - y
• norm_mul' : ∀ (a b : K), a * b = a * b
• lt_norm_lt : ∀ (x y : ), 0 xx < y∃ (a : K), x < a a < y
• star : KK
• star_involutive :
• star_mul : ∀ (r s : K), star (r * s) = star s * star r
• star_add : ∀ (r s : K), star (r + s) = star r + star s
• smul : KK
• toFun : K
• map_one' : (↑Algebra.toRingHom).toFun 1 = 1
• map_mul' : ∀ (x y : ), (↑Algebra.toRingHom).toFun (x * y) = (↑Algebra.toRingHom).toFun x * (↑Algebra.toRingHom).toFun y
• map_zero' : (↑Algebra.toRingHom).toFun 0 = 0
• map_add' : ∀ (x y : ), (↑Algebra.toRingHom).toFun (x + y) = (↑Algebra.toRingHom).toFun x + (↑Algebra.toRingHom).toFun y
• commutes' : ∀ (r : ) (x : K), Algebra.toRingHom r * x = x * Algebra.toRingHom r
• smul_def' : ∀ (r : ) (x : K), r x = Algebra.toRingHom r * x
• norm_smul_le : ∀ (r : ) (x : K), r x r * x
• complete : ∀ {f : }, ∃ (x : K), f nhds x
• re : K →+
• im : K →+
• I : K

Imaginary unit in K. Meant to be set to 0 for K = ℝ.

• I_re_ax : RCLike.re RCLike.I = 0
• I_mul_I_ax : RCLike.I = 0 RCLike.I * RCLike.I = -1
• re_add_im_ax : ∀ (z : K), (algebraMap K) (RCLike.re z) + (algebraMap K) (RCLike.im z) * RCLike.I = z
• ofReal_re_ax : ∀ (r : ), RCLike.re ((algebraMap K) r) = r
• ofReal_im_ax : ∀ (r : ), RCLike.im ((algebraMap K) r) = 0
• mul_re_ax : ∀ (z w : K), RCLike.re (z * w) = RCLike.re z * RCLike.re w - RCLike.im z * RCLike.im w
• mul_im_ax : ∀ (z w : K), RCLike.im (z * w) = RCLike.re z * RCLike.im w + RCLike.im z * RCLike.re w
• conj_re_ax : ∀ (z : K), RCLike.re ((starRingEnd K) z) = RCLike.re z
• conj_im_ax : ∀ (z : K), RCLike.im ((starRingEnd K) z) = -RCLike.im z
• conj_I_ax : (starRingEnd K) RCLike.I = -RCLike.I
• norm_sq_eq_def_ax : ∀ (z : K), z ^ 2 = RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z
• mul_im_I_ax : ∀ (z : K), RCLike.im z * RCLike.im RCLike.I = RCLike.im z
• toPartialOrder :

only an instance in the ComplexOrder locale

• le_iff_re_im : ∀ {z w : K}, z w RCLike.re z RCLike.re w RCLike.im z = RCLike.im w
• toDecidableEq :
Instances
theorem RCLike.I_re_ax {K : } [self : ] :
RCLike.re RCLike.I = 0
theorem RCLike.I_mul_I_ax {K : } [self : ] :
RCLike.I = 0 RCLike.I * RCLike.I = -1
theorem RCLike.re_add_im_ax {K : } [self : ] (z : K) :
(algebraMap K) (RCLike.re z) + (algebraMap K) (RCLike.im z) * RCLike.I = z
theorem RCLike.ofReal_re_ax {K : } [self : ] (r : ) :
RCLike.re ((algebraMap K) r) = r
theorem RCLike.ofReal_im_ax {K : } [self : ] (r : ) :
RCLike.im ((algebraMap K) r) = 0
theorem RCLike.mul_re_ax {K : } [self : ] (z : K) (w : K) :
RCLike.re (z * w) = RCLike.re z * RCLike.re w - RCLike.im z * RCLike.im w
theorem RCLike.mul_im_ax {K : } [self : ] (z : K) (w : K) :
RCLike.im (z * w) = RCLike.re z * RCLike.im w + RCLike.im z * RCLike.re w
theorem RCLike.conj_re_ax {K : } [self : ] (z : K) :
RCLike.re ((starRingEnd K) z) = RCLike.re z
theorem RCLike.conj_im_ax {K : } [self : ] (z : K) :
RCLike.im ((starRingEnd K) z) = -RCLike.im z
theorem RCLike.conj_I_ax {K : } [self : ] :
(starRingEnd K) RCLike.I = -RCLike.I
theorem RCLike.norm_sq_eq_def_ax {K : } [self : ] (z : K) :
z ^ 2 = RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z
theorem RCLike.mul_im_I_ax {K : } [self : ] (z : K) :
RCLike.im z * RCLike.im RCLike.I = RCLike.im z
theorem RCLike.le_iff_re_im {K : } [self : ] {z : K} {w : K} :
z w RCLike.re z RCLike.re w RCLike.im z = RCLike.im w
@[reducible, inline]
abbrev RCLike.ofReal {K : Type u_1} [] :
K

Coercion from ℝ to an RCLike field.

Equations
• RCLike.ofReal = Algebra.cast
Instances For
@[instance 900]
noncomputable instance RCLike.algebraMapCoe {K : Type u_1} [] :
Equations
• RCLike.algebraMapCoe = { coe := RCLike.ofReal }
theorem RCLike.ofReal_alg {K : Type u_1} [] (x : ) :
x = x 1
theorem RCLike.real_smul_eq_coe_mul {K : Type u_1} [] (r : ) (z : K) :
r z = r * z
theorem RCLike.real_smul_eq_coe_smul {K : Type u_1} {E : Type u_2} [] [] [Module K E] [] [] (r : ) (x : E) :
r x = r x
theorem RCLike.algebraMap_eq_ofReal {K : Type u_1} [] :
(algebraMap K) = RCLike.ofReal
@[simp]
theorem RCLike.re_add_im {K : Type u_1} [] (z : K) :
(RCLike.re z) + (RCLike.im z) * RCLike.I = z
@[simp]
theorem RCLike.ofReal_re {K : Type u_1} [] (r : ) :
RCLike.re r = r
@[simp]
theorem RCLike.ofReal_im {K : Type u_1} [] (r : ) :
RCLike.im r = 0
@[simp]
theorem RCLike.mul_re {K : Type u_1} [] (z : K) (w : K) :
RCLike.re (z * w) = RCLike.re z * RCLike.re w - RCLike.im z * RCLike.im w
@[simp]
theorem RCLike.mul_im {K : Type u_1} [] (z : K) (w : K) :
RCLike.im (z * w) = RCLike.re z * RCLike.im w + RCLike.im z * RCLike.re w
theorem RCLike.ext_iff {K : Type u_1} [] {z : K} {w : K} :
z = w RCLike.re z = RCLike.re w RCLike.im z = RCLike.im w
theorem RCLike.ext {K : Type u_1} [] {z : K} {w : K} (hre : RCLike.re z = RCLike.re w) (him : RCLike.im z = RCLike.im w) :
z = w
theorem RCLike.ofReal_zero {K : Type u_1} [] :
0 = 0
theorem RCLike.zero_re' {K : Type u_1} [] :
RCLike.re 0 = 0
theorem RCLike.ofReal_one {K : Type u_1} [] :
1 = 1
@[simp]
theorem RCLike.one_re {K : Type u_1} [] :
RCLike.re 1 = 1
@[simp]
theorem RCLike.one_im {K : Type u_1} [] :
RCLike.im 1 = 0
theorem RCLike.ofReal_injective {K : Type u_1} [] :
Function.Injective RCLike.ofReal
theorem RCLike.ofReal_inj {K : Type u_1} [] {z : } {w : } :
z = w z = w
theorem RCLike.ofReal_eq_zero {K : Type u_1} [] {x : } :
x = 0 x = 0
theorem RCLike.ofReal_ne_zero {K : Type u_1} [] {x : } :
x 0 x 0
theorem RCLike.ofReal_add {K : Type u_1} [] (r : ) (s : ) :
(r + s) = r + s
theorem RCLike.ofReal_neg {K : Type u_1} [] (r : ) :
(-r) = -r
theorem RCLike.ofReal_sub {K : Type u_1} [] (r : ) (s : ) :
(r - s) = r - s
theorem RCLike.ofReal_sum {K : Type u_1} [] {α : Type u_3} (s : ) (f : α) :
(∑ is, f i) = is, (f i)
@[simp]
theorem RCLike.ofReal_finsupp_sum {K : Type u_1} [] {α : Type u_3} {M : Type u_4} [Zero M] (f : α →₀ M) (g : αM) :
(f.sum fun (a : α) (b : M) => g a b) = f.sum fun (a : α) (b : M) => (g a b)
theorem RCLike.ofReal_mul {K : Type u_1} [] (r : ) (s : ) :
(r * s) = r * s
theorem RCLike.ofReal_pow {K : Type u_1} [] (r : ) (n : ) :
(r ^ n) = r ^ n
theorem RCLike.ofReal_prod {K : Type u_1} [] {α : Type u_3} (s : ) (f : α) :
(∏ is, f i) = is, (f i)
@[simp]
theorem RCLike.ofReal_finsupp_prod {K : Type u_1} [] {α : Type u_3} {M : Type u_4} [Zero M] (f : α →₀ M) (g : αM) :
(f.prod fun (a : α) (b : M) => g a b) = f.prod fun (a : α) (b : M) => (g a b)
@[simp]
theorem RCLike.real_smul_ofReal {K : Type u_1} [] (r : ) (x : ) :
r x = r * x
theorem RCLike.re_ofReal_mul {K : Type u_1} [] (r : ) (z : K) :
RCLike.re (r * z) = r * RCLike.re z
theorem RCLike.im_ofReal_mul {K : Type u_1} [] (r : ) (z : K) :
RCLike.im (r * z) = r * RCLike.im z
theorem RCLike.smul_re {K : Type u_1} [] (r : ) (z : K) :
RCLike.re (r z) = r * RCLike.re z
theorem RCLike.smul_im {K : Type u_1} [] (r : ) (z : K) :
RCLike.im (r z) = r * RCLike.im z
theorem RCLike.norm_ofReal {K : Type u_1} [] (r : ) :
r = |r|

### Characteristic zero #

@[instance 100]
instance RCLike.charZero_rclike {K : Type u_1} [] :

ℝ and ℂ are both of characteristic zero.

Equations
• =

### The imaginary unit, I#

@[simp]
theorem RCLike.I_re {K : Type u_1} [] :
RCLike.re RCLike.I = 0

The imaginary unit.

@[simp]
theorem RCLike.I_im {K : Type u_1} [] (z : K) :
RCLike.im z * RCLike.im RCLike.I = RCLike.im z
@[simp]
theorem RCLike.I_im' {K : Type u_1} [] (z : K) :
RCLike.im RCLike.I * RCLike.im z = RCLike.im z
theorem RCLike.I_mul_re {K : Type u_1} [] (z : K) :
RCLike.re (RCLike.I * z) = -RCLike.im z
theorem RCLike.I_mul_I {K : Type u_1} [] :
RCLike.I = 0 RCLike.I * RCLike.I = -1
theorem RCLike.I_eq_zero_or_im_I_eq_one {K : Type u_1} [] :
RCLike.I = 0 RCLike.im RCLike.I = 1
@[simp]
theorem RCLike.conj_re {K : Type u_1} [] (z : K) :
RCLike.re ((starRingEnd K) z) = RCLike.re z
@[simp]
theorem RCLike.conj_im {K : Type u_1} [] (z : K) :
RCLike.im ((starRingEnd K) z) = -RCLike.im z
@[simp]
theorem RCLike.conj_I {K : Type u_1} [] :
(starRingEnd K) RCLike.I = -RCLike.I
@[simp]
theorem RCLike.conj_ofReal {K : Type u_1} [] (r : ) :
(starRingEnd K) r = r
theorem RCLike.conj_nat_cast {K : Type u_1} [] (n : ) :
(starRingEnd K) n = n
theorem RCLike.conj_ofNat {K : Type u_1} [] (n : ) [n.AtLeastTwo] :
theorem RCLike.conj_neg_I {K : Type u_1} [] :
(starRingEnd K) (-RCLike.I) = RCLike.I
theorem RCLike.conj_eq_re_sub_im {K : Type u_1} [] (z : K) :
(starRingEnd K) z = (RCLike.re z) - (RCLike.im z) * RCLike.I
theorem RCLike.sub_conj {K : Type u_1} [] (z : K) :
z - (starRingEnd K) z = 2 * (RCLike.im z) * RCLike.I
theorem RCLike.conj_smul {K : Type u_1} [] (r : ) (z : K) :
(starRingEnd K) (r z) = r (starRingEnd K) z
theorem RCLike.add_conj {K : Type u_1} [] (z : K) :
z + (starRingEnd K) z = 2 * (RCLike.re z)
theorem RCLike.re_eq_add_conj {K : Type u_1} [] (z : K) :
(RCLike.re z) = (z + (starRingEnd K) z) / 2
theorem RCLike.im_eq_conj_sub {K : Type u_1} [] (z : K) :
(RCLike.im z) = RCLike.I * ((starRingEnd K) z - z) / 2
theorem RCLike.is_real_TFAE {K : Type u_1} [] (z : K) :
[(starRingEnd K) z = z, ∃ (r : ), r = z, (RCLike.re z) = z, RCLike.im z = 0].TFAE

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

theorem RCLike.conj_eq_iff_real {K : Type u_1} [] {z : K} :
(starRingEnd K) z = z ∃ (r : ), z = r
theorem RCLike.conj_eq_iff_re {K : Type u_1} [] {z : K} :
(starRingEnd K) z = z (RCLike.re z) = z
theorem RCLike.conj_eq_iff_im {K : Type u_1} [] {z : K} :
(starRingEnd K) z = z RCLike.im z = 0
@[simp]
theorem RCLike.star_def {K : Type u_1} [] :
star = (starRingEnd K)
@[reducible, inline]
abbrev RCLike.conjToRingEquiv (K : Type u_1) [] :

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

Equations
• = starRingEquiv
Instances For
def RCLike.normSq {K : Type u_1} [] :

The norm squared function.

Equations
• RCLike.normSq = { toFun := fun (z : K) => RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z, map_zero' := , map_one' := , map_mul' := }
Instances For
theorem RCLike.normSq_apply {K : Type u_1} [] (z : K) :
RCLike.normSq z = RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z
theorem RCLike.norm_sq_eq_def {K : Type u_1} [] {z : K} :
z ^ 2 = RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z
theorem RCLike.normSq_eq_def' {K : Type u_1} [] (z : K) :
RCLike.normSq z = z ^ 2
theorem RCLike.normSq_zero {K : Type u_1} [] :
RCLike.normSq 0 = 0
theorem RCLike.normSq_one {K : Type u_1} [] :
RCLike.normSq 1 = 1
theorem RCLike.normSq_nonneg {K : Type u_1} [] (z : K) :
0 RCLike.normSq z
theorem RCLike.normSq_eq_zero {K : Type u_1} [] {z : K} :
RCLike.normSq z = 0 z = 0
@[simp]
theorem RCLike.normSq_pos {K : Type u_1} [] {z : K} :
0 < RCLike.normSq z z 0
@[simp]
theorem RCLike.normSq_neg {K : Type u_1} [] (z : K) :
RCLike.normSq (-z) = RCLike.normSq z
@[simp]
theorem RCLike.normSq_conj {K : Type u_1} [] (z : K) :
RCLike.normSq ((starRingEnd K) z) = RCLike.normSq z
theorem RCLike.normSq_mul {K : Type u_1} [] (z : K) (w : K) :
RCLike.normSq (z * w) = RCLike.normSq z * RCLike.normSq w
theorem RCLike.normSq_add {K : Type u_1} [] (z : K) (w : K) :
RCLike.normSq (z + w) = RCLike.normSq z + RCLike.normSq w + 2 * RCLike.re (z * (starRingEnd K) w)
theorem RCLike.re_sq_le_normSq {K : Type u_1} [] (z : K) :
RCLike.re z * RCLike.re z RCLike.normSq z
theorem RCLike.im_sq_le_normSq {K : Type u_1} [] (z : K) :
RCLike.im z * RCLike.im z RCLike.normSq z
theorem RCLike.mul_conj {K : Type u_1} [] (z : K) :
z * (starRingEnd K) z = z ^ 2
theorem RCLike.conj_mul {K : Type u_1} [] (z : K) :
(starRingEnd K) z * z = z ^ 2
theorem RCLike.inv_eq_conj {K : Type u_1} [] {z : K} (hz : z = 1) :
theorem RCLike.normSq_sub {K : Type u_1} [] (z : K) (w : K) :
RCLike.normSq (z - w) = RCLike.normSq z + RCLike.normSq w - 2 * RCLike.re (z * (starRingEnd K) w)
theorem RCLike.sqrt_normSq_eq_norm {K : Type u_1} [] {z : K} :
(RCLike.normSq z) = z

### Inversion #

theorem RCLike.ofReal_inv {K : Type u_1} [] (r : ) :
r⁻¹ = (↑r)⁻¹
theorem RCLike.inv_def {K : Type u_1} [] (z : K) :
z⁻¹ = (starRingEnd K) z * (z ^ 2)⁻¹
@[simp]
theorem RCLike.inv_re {K : Type u_1} [] (z : K) :
RCLike.re z⁻¹ = RCLike.re z / RCLike.normSq z
@[simp]
theorem RCLike.inv_im {K : Type u_1} [] (z : K) :
RCLike.im z⁻¹ = -RCLike.im z / RCLike.normSq z
theorem RCLike.div_re {K : Type u_1} [] (z : K) (w : K) :
RCLike.re (z / w) = RCLike.re z * RCLike.re w / RCLike.normSq w + RCLike.im z * RCLike.im w / RCLike.normSq w
theorem RCLike.div_im {K : Type u_1} [] (z : K) (w : K) :
RCLike.im (z / w) = RCLike.im z * RCLike.re w / RCLike.normSq w - RCLike.re z * RCLike.im w / RCLike.normSq w
theorem RCLike.conj_inv {K : Type u_1} [] (x : K) :
theorem RCLike.conj_div {K : Type u_1} [] (x : K) (y : K) :
(starRingEnd K) (x / y) = (starRingEnd K) x / (starRingEnd K) y
theorem RCLike.exists_norm_eq_mul_self {K : Type u_1} [] (x : K) :
∃ (c : K), c = 1 x = c * x
theorem RCLike.exists_norm_mul_eq_self {K : Type u_1} [] (x : K) :
∃ (c : K), c = 1 c * x = x
theorem RCLike.ofReal_div {K : Type u_1} [] (r : ) (s : ) :
(r / s) = r / s
theorem RCLike.div_re_ofReal {K : Type u_1} [] {z : K} {r : } :
RCLike.re (z / r) = RCLike.re z / r
theorem RCLike.ofReal_zpow {K : Type u_1} [] (r : ) (n : ) :
(r ^ n) = r ^ n
theorem RCLike.I_mul_I_of_nonzero {K : Type u_1} [] :
RCLike.I 0RCLike.I * RCLike.I = -1
@[simp]
theorem RCLike.inv_I {K : Type u_1} [] :
RCLike.I⁻¹ = -RCLike.I
@[simp]
theorem RCLike.div_I {K : Type u_1} [] (z : K) :
z / RCLike.I = -(z * RCLike.I)
theorem RCLike.normSq_inv {K : Type u_1} [] (z : K) :
RCLike.normSq z⁻¹ = (RCLike.normSq z)⁻¹
theorem RCLike.normSq_div {K : Type u_1} [] (z : K) (w : K) :
RCLike.normSq (z / w) = RCLike.normSq z / RCLike.normSq w
@[simp]
theorem RCLike.norm_conj {K : Type u_1} [] (z : K) :
@[simp]
theorem RCLike.nnnorm_conj {K : Type u_1} [] (z : K) :
@[instance 100]
instance RCLike.instCStarRing {K : Type u_1} [] :
Equations
• =

### Cast lemmas #

theorem RCLike.ofReal_natCast {K : Type u_1} [] (n : ) :
n = n
theorem RCLike.ofReal_nnratCast {K : Type u_1} [] (q : ℚ≥0) :
q = q
@[simp]
theorem RCLike.natCast_re {K : Type u_1} [] (n : ) :
RCLike.re n = n
@[simp]
theorem RCLike.natCast_im {K : Type u_1} [] (n : ) :
RCLike.im n = 0
@[simp]
theorem RCLike.ofNat_re {K : Type u_1} [] (n : ) [n.AtLeastTwo] :
RCLike.re (OfNat.ofNat n) =
@[simp]
theorem RCLike.ofNat_im {K : Type u_1} [] (n : ) [n.AtLeastTwo] :
RCLike.im (OfNat.ofNat n) = 0
theorem RCLike.ofReal_ofNat {K : Type u_1} [] (n : ) [n.AtLeastTwo] :
(OfNat.ofNat n) =
theorem RCLike.ofNat_mul_re {K : Type u_1} [] (n : ) [n.AtLeastTwo] (z : K) :
RCLike.re ( * z) = * RCLike.re z
theorem RCLike.ofNat_mul_im {K : Type u_1} [] (n : ) [n.AtLeastTwo] (z : K) :
RCLike.im ( * z) = * RCLike.im z
theorem RCLike.ofReal_intCast {K : Type u_1} [] (n : ) :
n = n
@[simp]
theorem RCLike.intCast_re {K : Type u_1} [] (n : ) :
RCLike.re n = n
@[simp]
theorem RCLike.intCast_im {K : Type u_1} [] (n : ) :
RCLike.im n = 0
theorem RCLike.ofReal_ratCast {K : Type u_1} [] (n : ) :
n = n
@[simp]
theorem RCLike.ratCast_re {K : Type u_1} [] (q : ) :
RCLike.re q = q
@[simp]
theorem RCLike.ratCast_im {K : Type u_1} [] (q : ) :
RCLike.im q = 0

### Norm #

theorem RCLike.norm_of_nonneg {K : Type u_1} [] {r : } (h : 0 r) :
r = r
@[simp]
theorem RCLike.norm_natCast {K : Type u_1} [] (n : ) :
n = n
@[simp]
theorem RCLike.nnnorm_natCast {K : Type u_1} [] (n : ) :
n‖₊ = n
@[simp]
theorem RCLike.norm_ofNat {K : Type u_1} [] (n : ) [n.AtLeastTwo] :
@[simp]
theorem RCLike.nnnorm_ofNat {K : Type u_1} [] (n : ) [n.AtLeastTwo] :
theorem RCLike.norm_two {K : Type u_1} [] :
theorem RCLike.nnnorm_two {K : Type u_1} [] :
@[simp]
theorem RCLike.norm_nnratCast {K : Type u_1} [] (q : ℚ≥0) :
q = q
@[simp]
theorem RCLike.nnnorm_nnratCast {K : Type u_1} [] (q : ℚ≥0) :
q‖₊ = q
theorem RCLike.norm_nsmul (K : Type u_1) {E : Type u_2} [] [] (n : ) (x : E) :
theorem RCLike.nnnorm_nsmul (K : Type u_1) {E : Type u_2} [] [] (n : ) (x : E) :
theorem RCLike.norm_nnqsmul (K : Type u_1) {E : Type u_2} [] [] [] [] (q : ℚ≥0) (x : E) :
theorem RCLike.nnnorm_nnqsmul (K : Type u_1) {E : Type u_2} [] [] [] [] (q : ℚ≥0) (x : E) :
theorem RCLike.mul_self_norm {K : Type u_1} [] (z : K) :
z * z = RCLike.normSq z
theorem RCLike.abs_re_le_norm {K : Type u_1} [] (z : K) :
|RCLike.re z| z
theorem RCLike.abs_im_le_norm {K : Type u_1} [] (z : K) :
|RCLike.im z| z
theorem RCLike.norm_re_le_norm {K : Type u_1} [] (z : K) :
RCLike.re z z
theorem RCLike.norm_im_le_norm {K : Type u_1} [] (z : K) :
RCLike.im z z
theorem RCLike.re_le_norm {K : Type u_1} [] (z : K) :
RCLike.re z z
theorem RCLike.im_le_norm {K : Type u_1} [] (z : K) :
RCLike.im z z
theorem RCLike.im_eq_zero_of_le {K : Type u_1} [] {a : K} (h : a RCLike.re a) :
RCLike.im a = 0
theorem RCLike.re_eq_self_of_le {K : Type u_1} [] {a : K} (h : a RCLike.re a) :
(RCLike.re a) = a
theorem RCLike.abs_re_div_norm_le_one {K : Type u_1} [] (z : K) :
|RCLike.re z / z| 1
theorem RCLike.abs_im_div_norm_le_one {K : Type u_1} [] (z : K) :
|RCLike.im z / z| 1
theorem RCLike.norm_I_of_ne_zero {K : Type u_1} [] (hI : RCLike.I 0) :
RCLike.I = 1
theorem RCLike.re_eq_norm_of_mul_conj {K : Type u_1} [] (x : K) :
RCLike.re (x * (starRingEnd K) x) = x * (starRingEnd K) x
theorem RCLike.norm_sq_re_add_conj {K : Type u_1} [] (x : K) :
x + (starRingEnd K) x ^ 2 = RCLike.re (x + (starRingEnd K) x) ^ 2
theorem RCLike.norm_sq_re_conj_add {K : Type u_1} [] (x : K) :
(starRingEnd K) x + x ^ 2 = RCLike.re ((starRingEnd K) x + x) ^ 2

### Cauchy sequences #

theorem RCLike.isCauSeq_re {K : Type u_1} [] (f : CauSeq K norm) :
IsCauSeq abs fun (n : ) => RCLike.re (f n)
theorem RCLike.isCauSeq_im {K : Type u_1} [] (f : CauSeq K norm) :
IsCauSeq abs fun (n : ) => RCLike.im (f n)
noncomputable def RCLike.cauSeqRe {K : Type u_1} [] (f : CauSeq K norm) :

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

Equations
• = fun (n : ) => RCLike.re (f n),
Instances For
noncomputable def RCLike.cauSeqIm {K : Type u_1} [] (f : CauSeq K norm) :

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

Equations
• = fun (n : ) => RCLike.im (f n),
Instances For
theorem RCLike.isCauSeq_norm {K : Type u_1} [] {f : K} (hf : IsCauSeq norm f) :
IsCauSeq abs (norm f)
noncomputable instance Real.instRCLike :
Equations
• One or more equations did not get rendered due to their size.
theorem RCLike.lt_iff_re_im {K : Type u_1} [] {z : K} {w : K} :
z < w RCLike.re z < RCLike.re w RCLike.im z = RCLike.im w
theorem RCLike.nonneg_iff {K : Type u_1} [] {z : K} :
0 z 0 RCLike.re z RCLike.im z = 0
theorem RCLike.pos_iff {K : Type u_1} [] {z : K} :
0 < z 0 < RCLike.re z RCLike.im z = 0
theorem RCLike.nonpos_iff {K : Type u_1} [] {z : K} :
z 0 RCLike.re z 0 RCLike.im z = 0
theorem RCLike.neg_iff {K : Type u_1} [] {z : K} :
z < 0 RCLike.re z < 0 RCLike.im z = 0
theorem RCLike.nonneg_iff_exists_ofReal {K : Type u_1} [] {z : K} :
0 z x0, x = z
theorem RCLike.pos_iff_exists_ofReal {K : Type u_1} [] {z : K} :
0 < z x > 0, x = z
theorem RCLike.nonpos_iff_exists_ofReal {K : Type u_1} [] {z : K} :
z 0 x0, x = z
theorem RCLike.neg_iff_exists_ofReal {K : Type u_1} [] {z : K} :
z < 0 x < 0, x = z
@[simp]
theorem RCLike.ofReal_le_ofReal {K : Type u_1} [] {x : } {y : } :
x y x y
@[simp]
theorem RCLike.ofReal_lt_ofReal {K : Type u_1} [] {x : } {y : } :
x < y x < y
@[simp]
theorem RCLike.ofReal_nonneg {K : Type u_1} [] {x : } :
0 x 0 x
@[simp]
theorem RCLike.ofReal_nonpos {K : Type u_1} [] {x : } :
x 0 x 0
@[simp]
theorem RCLike.ofReal_pos {K : Type u_1} [] {x : } :
0 < x 0 < x
@[simp]
theorem RCLike.ofReal_lt_zero {K : Type u_1} [] {x : } :
x < 0 x < 0
theorem RCLike.inv_pos_of_pos {K : Type u_1} [] {z : K} (hz : 0 < z) :
0 < z⁻¹
theorem RCLike.inv_pos {K : Type u_1} [] {z : K} :
0 < z⁻¹ 0 < z
theorem RCLike.toStarOrderedRing {K : Type u_1} [] :

With z ≤ w iff w - z is real and nonnegative, ℝ and ℂ are star ordered rings. (That is, a star ring in which the nonnegative elements are those of the form star z * z.)

Note this is only an instance with open scoped ComplexOrder.

With z ≤ w iff w - z is real and nonnegative, ℝ and ℂ are strictly ordered rings.

Note this is only an instance with open scoped ComplexOrder.

Equations
• RCLike.toStrictOrderedCommRing =
Instances For
theorem RCLike.toOrderedSMul {K : Type u_1} [] :
theorem StarModule.instOrderedSMul {K : Type u_1} [] {A : Type u_3} [] [] [] [] [Module K A] [] [] [] :

A star algebra over K has a scalar multiplication that respects the order.

Equations
• =
@[simp]
theorem RCLike.re_to_real {x : } :
RCLike.re x = x
@[simp]
theorem RCLike.im_to_real {x : } :
RCLike.im x = 0
theorem RCLike.conj_to_real {x : } :
x = x
@[simp]
theorem RCLike.I_to_real :
RCLike.I = 0
@[simp]
theorem RCLike.normSq_to_real {x : } :
RCLike.normSq x = x * x
@[simp]
theorem RCLike.ofReal_real_eq_id :
RCLike.ofReal = id
def RCLike.reLm {K : Type u_1} [] :

The real part in an RCLike field, as a linear map.

Equations
• RCLike.reLm = { toFun := (↑RCLike.re).toFun, map_add' := , map_smul' := }
Instances For
@[simp]
theorem RCLike.reLm_coe {K : Type u_1} [] :
RCLike.reLm = RCLike.re
noncomputable def RCLike.reCLM {K : Type u_1} [] :

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

Equations
• RCLike.reCLM = RCLike.reLm.mkContinuous 1
Instances For
@[simp]
theorem RCLike.reCLM_coe {K : Type u_1} [] :
RCLike.reCLM = RCLike.reLm
@[simp]
theorem RCLike.reCLM_apply {K : Type u_1} [] :
RCLike.reCLM = RCLike.re
theorem RCLike.continuous_re {K : Type u_1} [] :
Continuous RCLike.re
def RCLike.imLm {K : Type u_1} [] :

The imaginary part in an RCLike field, as a linear map.

Equations
• RCLike.imLm = { toFun := (↑RCLike.im).toFun, map_add' := , map_smul' := }
Instances For
@[simp]
theorem RCLike.imLm_coe {K : Type u_1} [] :
RCLike.imLm = RCLike.im
noncomputable def RCLike.imCLM {K : Type u_1} [] :

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

Equations
• RCLike.imCLM = RCLike.imLm.mkContinuous 1
Instances For
@[simp]
theorem RCLike.imCLM_coe {K : Type u_1} [] :
RCLike.imCLM = RCLike.imLm
@[simp]
theorem RCLike.imCLM_apply {K : Type u_1} [] :
RCLike.imCLM = RCLike.im
theorem RCLike.continuous_im {K : Type u_1} [] :
Continuous RCLike.im
def RCLike.conjAe {K : Type u_1} [] :

Conjugate as an ℝ-algebra equivalence

Equations
• RCLike.conjAe = { toFun := (↑(starRingEnd K)).toFun, invFun := (starRingEnd K), left_inv := , right_inv := , map_mul' := , map_add' := , commutes' := }
Instances For
@[simp]
theorem RCLike.conjAe_coe {K : Type u_1} [] :
RCLike.conjAe = (starRingEnd K)
noncomputable def RCLike.conjLIE {K : Type u_1} [] :

Conjugate as a linear isometry

Equations
• RCLike.conjLIE = { toLinearEquiv := RCLike.conjAe.toLinearEquiv, norm_map' := }
Instances For
@[simp]
theorem RCLike.conjLIE_apply {K : Type u_1} [] :
RCLike.conjLIE = (starRingEnd K)
noncomputable def RCLike.conjCLE {K : Type u_1} [] :

Conjugate as a continuous linear equivalence

Equations
• RCLike.conjCLE = { toLinearEquiv := RCLike.conjLIE.toLinearEquiv, continuous_toFun := , continuous_invFun := }
Instances For
@[simp]
theorem RCLike.conjCLE_coe {K : Type u_1} [] :
RCLike.conjCLE.toLinearEquiv = RCLike.conjAe.toLinearEquiv
@[simp]
theorem RCLike.conjCLE_apply {K : Type u_1} [] :
RCLike.conjCLE = (starRingEnd K)
@[instance 100]
instance RCLike.instContinuousStar {K : Type u_1} [] :
Equations
• =
theorem RCLike.continuous_conj {K : Type u_1} [] :
noncomputable def RCLike.ofRealAm {K : Type u_1} [] :

The ℝ → K coercion, as a linear map

Equations
• RCLike.ofRealAm =
Instances For
@[simp]
theorem RCLike.ofRealAm_coe {K : Type u_1} [] :
RCLike.ofRealAm = RCLike.ofReal
noncomputable def RCLike.ofRealLI {K : Type u_1} [] :

The ℝ → K coercion, as a linear isometry

Equations
• RCLike.ofRealLI = { toLinearMap := RCLike.ofRealAm.toLinearMap, norm_map' := }
Instances For
@[simp]
theorem RCLike.ofRealLI_apply {K : Type u_1} [] :
RCLike.ofRealLI = RCLike.ofReal
noncomputable def RCLike.ofRealCLM {K : Type u_1} [] :

The ℝ → K coercion, as a continuous linear map

Equations
• RCLike.ofRealCLM = RCLike.ofRealLI.toContinuousLinearMap
Instances For
@[simp]
theorem RCLike.ofRealCLM_coe {K : Type u_1} [] :
RCLike.ofRealCLM = RCLike.ofRealAm.toLinearMap
@[simp]
theorem RCLike.ofRealCLM_apply {K : Type u_1} [] :
RCLike.ofRealCLM = RCLike.ofReal
theorem RCLike.continuous_ofReal {K : Type u_1} [] :
Continuous RCLike.ofReal
theorem RCLike.continuous_normSq {K : Type u_1} [] :
Continuous RCLike.normSq

### ℝ-dependent results #

Here we gather results that depend on whether K is ℝ.

theorem RCLike.im_eq_zero {K : Type u_1} [] (h : RCLike.I = 0) (z : K) :
RCLike.im z = 0
@[simp]
theorem RCLike.realRingEquiv_apply {K : Type u_1} [] (h : RCLike.I = 0) (a : K) :
a = RCLike.re a
@[simp]
theorem RCLike.realRingEquiv_symm_apply {K : Type u_1} [] (h : RCLike.I = 0) :
∀ (a : ), .symm a = a
def RCLike.realRingEquiv {K : Type u_1} [] (h : RCLike.I = 0) :

The natural isomorphism between 𝕜 satisfying RCLike 𝕜 and ℝ when RCLike.I = 0.

Equations
• = { toFun := RCLike.re, invFun := RCLike.ofReal, left_inv := , right_inv := , map_mul' := , map_add' := }
Instances For
@[simp]
theorem RCLike.realLinearIsometryEquiv_symm_apply {K : Type u_1} [] (h : RCLike.I = 0) :
∀ (a : ), .symm a = .invFun a
@[simp]
theorem RCLike.realLinearIsometryEquiv_toFun {K : Type u_1} [] (h : RCLike.I = 0) :
∀ (a : K), = .toFun a
@[simp]
theorem RCLike.realLinearIsometryEquiv_invFun {K : Type u_1} [] (h : RCLike.I = 0) :
∀ (a : ), .invFun a = .invFun a
@[simp]
theorem RCLike.realLinearIsometryEquiv_apply {K : Type u_1} [] (h : RCLike.I = 0) :
∀ (a : K), = .toFun a
noncomputable def RCLike.realLinearIsometryEquiv {K : Type u_1} [] (h : RCLike.I = 0) :

The natural ℝ-linear isometry equivalence between 𝕜 satisfying RCLike 𝕜 and ℝ when RCLike.I = 0.

Equations
• One or more equations did not get rendered due to their size.
Instances For
theorem AddChar.inv_apply_eq_conj {K : Type u_1} [] {G : Type u_3} [] (ψ : AddChar G K) (x : G) :
(ψ x)⁻¹ = (starRingEnd K) (ψ x)
theorem AddChar.map_neg_eq_conj {K : Type u_1} [] {G : Type u_3} [] [] (ψ : AddChar G K) (x : G) :
ψ (-x) = (starRingEnd K) (ψ x)
class IsRCLikeNormedField (𝕜 : Type u_3) [hk : ] :

A mixin over a normed field, saying that the norm field structure is the same as ℝ or ℂ. To endow such a field with a compatible RCLike structure in a proof, use letI := IsRCLikeNormedField.rclike 𝕜.

• out : ∃ (h : ), hk = DenselyNormedField.toNormedField
Instances
theorem IsRCLikeNormedField.out {𝕜 : Type u_3} [hk : ] [self : ] :
∃ (h : ), hk = DenselyNormedField.toNormedField
@[instance 100]
instance instIsRCLikeNormedField (𝕜 : Type u_3) [h : ] :
Equations
• =
noncomputable def RCLike.copy_of_normedField {𝕜 : Type u_3} (h : ) (hk : ) (h'' : hk = DenselyNormedField.toNormedField) :

A copy of an RCLike field in which the NormedField field is adjusted to be become defeq to a propeq one.

Equations
• One or more equations did not get rendered due to their size.
Instances For
noncomputable def IsRCLikeNormedField.rclike (𝕜 : Type u_3) [hk : ] [h : ] :

Given a normed field 𝕜 satisfying IsRCLikeNormedField 𝕜, build an associated RCLike 𝕜 structure on 𝕜 which is definitionally compatible with the given normed field structure.

Equations
• = (fun (p : ) (hp : hk = DenselyNormedField.toNormedField) => p.copy_of_normedField hk hp)
Instances For