# Documentation

Mathlib.Data.IsROrC.Basic

# IsROrC: a typeclass for ℝ or ℂ #

This file defines the typeclass IsROrC 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 IsROrC field is done by registering IsROrC.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/IsROrC/Lemmas.lean.

class IsROrC (K : semiOutParam (Type u_1)) extends , , , :
Type u_1
• 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 () a = a + Ring.zsmul () a
• zsmul_neg' : ∀ (n : ) (a : K), = -Ring.zsmul (↑()) a
• add_left_neg : ∀ (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 () a = a * Field.zpow () a
• zpow_neg' : ∀ (n : ) (a : K), = (Field.zpow (↑()) a)⁻¹
• exists_pair_ne : x y, x y
• ratCast : K
• mul_inv_cancel : ∀ (a : K), a 0a * a⁻¹ = 1
• inv_zero : 0⁻¹ = 0
• ratCast_mk : ∀ (a : ) (b : ) (h1 : b 0) (h2 : ), ↑(Rat.mk' a b) = a * (b)⁻¹
• qsmul : KK
• qsmul_eq_mul' : ∀ (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 | dist p.fst p.snd < ε}
• toBornology :
• cobounded_sets : ().sets = {s_1 | C, ∀ (x : K), x s_1∀ (y : K), y s_1dist 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 < ya, x < a a < y
• star : KK
• star_involutive :
• star_mul : ∀ (r s_1 : K), star (r * s_1) = star s_1 * star r
• star_add : ∀ (r s_1 : K), star (r + s_1) = star r + star s_1
• smul : KK
• toFun : K
• map_one' : OneHom.toFun (Algebra.toRingHom) 1 = 1
• map_mul' : ∀ (x y : ), OneHom.toFun (Algebra.toRingHom) (x * y) = OneHom.toFun (Algebra.toRingHom) x * OneHom.toFun (Algebra.toRingHom) y
• map_zero' : OneHom.toFun (Algebra.toRingHom) 0 = 0
• map_add' : ∀ (x y : ), OneHom.toFun (Algebra.toRingHom) (x + y) = OneHom.toFun (Algebra.toRingHom) x + OneHom.toFun (Algebra.toRingHom) y
• commutes' : ∀ (r : ) (x : (fun x => K) r), Algebra.toRingHom r * x = x * Algebra.toRingHom r
• smul_def' : ∀ (r : ) (x : (fun x => K) r), r x = Algebra.toRingHom r * x
• norm_smul_le : ∀ (r : ) (x : K), r x r * x
• complete : ∀ {f : }, x, f nhds x
• re : K →+
• im : K →+
• I : K

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

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

only an instance in the ComplexOrder locale

• le_iff_re_im : ∀ {z w : K}, z w IsROrC.re z IsROrC.re w IsROrC.im z = IsROrC.im w
• toDecidableEq :

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

Instances
@[inline, reducible]
abbrev IsROrC.ofReal {K : Type u_1} [] :
K

Coercion from ℝ to an IsROrC field.

Instances For
noncomputable instance IsROrC.algebraMapCoe {K : Type u_1} [] :
theorem IsROrC.ofReal_alg {K : Type u_1} [] (x : ) :
x = x 1
theorem IsROrC.real_smul_eq_coe_mul {K : Type u_1} [] (r : ) (z : K) :
r z = r * z
theorem IsROrC.real_smul_eq_coe_smul {K : Type u_1} {E : Type u_2} [] [] [Module K E] [] [] (r : ) (x : E) :
r x = r x
theorem IsROrC.algebraMap_eq_ofReal {K : Type u_1} [] :
↑() = IsROrC.ofReal
@[simp]
theorem IsROrC.re_add_im {K : Type u_1} [] (z : K) :
↑(IsROrC.re z) + ↑(IsROrC.im z) * IsROrC.I = z
@[simp]
theorem IsROrC.ofReal_re {K : Type u_1} [] (r : ) :
IsROrC.re r = r
@[simp]
theorem IsROrC.ofReal_im {K : Type u_1} [] (r : ) :
IsROrC.im r = 0
@[simp]
theorem IsROrC.mul_re {K : Type u_1} [] (z : K) (w : K) :
IsROrC.re (z * w) = IsROrC.re z * IsROrC.re w - IsROrC.im z * IsROrC.im w
@[simp]
theorem IsROrC.mul_im {K : Type u_1} [] (z : K) (w : K) :
IsROrC.im (z * w) = IsROrC.re z * IsROrC.im w + IsROrC.im z * IsROrC.re w
theorem IsROrC.ext_iff {K : Type u_1} [] {z : K} {w : K} :
z = w IsROrC.re z = IsROrC.re w IsROrC.im z = IsROrC.im w
theorem IsROrC.ext {K : Type u_1} [] {z : K} {w : K} (hre : IsROrC.re z = IsROrC.re w) (him : IsROrC.im z = IsROrC.im w) :
z = w
theorem IsROrC.ofReal_zero {K : Type u_1} [] :
0 = 0
theorem IsROrC.zero_re' {K : Type u_1} [] :
IsROrC.re 0 = 0
theorem IsROrC.ofReal_one {K : Type u_1} [] :
1 = 1
@[simp]
theorem IsROrC.one_re {K : Type u_1} [] :
IsROrC.re 1 = 1
@[simp]
theorem IsROrC.one_im {K : Type u_1} [] :
IsROrC.im 1 = 0
theorem IsROrC.ofReal_injective {K : Type u_1} [] :
Function.Injective IsROrC.ofReal
theorem IsROrC.ofReal_inj {K : Type u_1} [] {z : } {w : } :
z = w z = w
@[deprecated]
theorem IsROrC.bit0_re {K : Type u_1} [] (z : K) :
IsROrC.re (bit0 z) = bit0 (IsROrC.re z)
@[simp, deprecated]
theorem IsROrC.bit1_re {K : Type u_1} [] (z : K) :
IsROrC.re (bit1 z) = bit1 (IsROrC.re z)
@[deprecated]
theorem IsROrC.bit0_im {K : Type u_1} [] (z : K) :
IsROrC.im (bit0 z) = bit0 (IsROrC.im z)
@[simp, deprecated]
theorem IsROrC.bit1_im {K : Type u_1} [] (z : K) :
IsROrC.im (bit1 z) = bit0 (IsROrC.im z)
theorem IsROrC.ofReal_eq_zero {K : Type u_1} [] {x : } :
x = 0 x = 0
theorem IsROrC.ofReal_ne_zero {K : Type u_1} [] {x : } :
x 0 x 0
@[simp]
theorem IsROrC.ofReal_add {K : Type u_1} [] (r : ) (s : ) :
↑(r + s) = r + s
@[simp, deprecated]
theorem IsROrC.ofReal_bit0 {K : Type u_1} [] (r : ) :
↑(bit0 r) = bit0 r
@[simp, deprecated]
theorem IsROrC.ofReal_bit1 {K : Type u_1} [] (r : ) :
↑(bit1 r) = bit1 r
@[simp]
theorem IsROrC.ofReal_neg {K : Type u_1} [] (r : ) :
↑(-r) = -r
@[simp]
theorem IsROrC.ofReal_sub {K : Type u_1} [] (r : ) (s : ) :
↑(r - s) = r - s
@[simp]
theorem IsROrC.ofReal_sum {K : Type u_1} [] {α : Type u_3} (s : ) (f : α) :
↑(Finset.sum s fun i => f i) = Finset.sum s fun i => ↑(f i)
@[simp]
theorem IsROrC.ofReal_finsupp_sum {K : Type u_1} [] {α : Type u_3} {M : Type u_4} [Zero M] (f : α →₀ M) (g : αM) :
↑(Finsupp.sum f fun a b => g a b) = Finsupp.sum f fun a b => ↑(g a b)
@[simp]
theorem IsROrC.ofReal_mul {K : Type u_1} [] (r : ) (s : ) :
↑(r * s) = r * s
@[simp]
theorem IsROrC.ofReal_pow {K : Type u_1} [] (r : ) (n : ) :
↑(r ^ n) = r ^ n
@[simp]
theorem IsROrC.ofReal_prod {K : Type u_1} [] {α : Type u_3} (s : ) (f : α) :
↑(Finset.prod s fun i => f i) = Finset.prod s fun i => ↑(f i)
@[simp]
theorem IsROrC.ofReal_finsupp_prod {K : Type u_1} [] {α : Type u_3} {M : Type u_4} [Zero M] (f : α →₀ M) (g : αM) :
↑(Finsupp.prod f fun a b => g a b) = Finsupp.prod f fun a b => ↑(g a b)
@[simp]
theorem IsROrC.real_smul_ofReal {K : Type u_1} [] (r : ) (x : ) :
r x = r * x
theorem IsROrC.ofReal_mul_re {K : Type u_1} [] (r : ) (z : K) :
IsROrC.re (r * z) = r * IsROrC.re z
theorem IsROrC.ofReal_mul_im {K : Type u_1} [] (r : ) (z : K) :
IsROrC.im (r * z) = r * IsROrC.im z
theorem IsROrC.smul_re {K : Type u_1} [] (r : ) (z : K) :
IsROrC.re (r z) = r * IsROrC.re z
theorem IsROrC.smul_im {K : Type u_1} [] (r : ) (z : K) :
IsROrC.im (r z) = r * IsROrC.im z
@[simp]
theorem IsROrC.norm_ofReal {K : Type u_1} [] (r : ) :
r = |r|

### Characteristic zero #

instance IsROrC.charZero_isROrC {K : Type u_1} [] :

ℝ and ℂ are both of characteristic zero.

### The imaginary unit, I#

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

The imaginary unit.

@[simp]
theorem IsROrC.I_im {K : Type u_1} [] (z : K) :
IsROrC.im z * IsROrC.im IsROrC.I = IsROrC.im z
@[simp]
theorem IsROrC.I_im' {K : Type u_1} [] (z : K) :
IsROrC.im IsROrC.I * IsROrC.im z = IsROrC.im z
theorem IsROrC.I_mul_re {K : Type u_1} [] (z : K) :
IsROrC.re (IsROrC.I * z) = -IsROrC.im z
theorem IsROrC.I_mul_I {K : Type u_1} [] :
IsROrC.I = 0 IsROrC.I * IsROrC.I = -1
@[simp]
theorem IsROrC.conj_re {K : Type u_1} [] (z : K) :
IsROrC.re (↑() z) = IsROrC.re z
@[simp]
theorem IsROrC.conj_im {K : Type u_1} [] (z : K) :
IsROrC.im (↑() z) = -IsROrC.im z
@[simp]
theorem IsROrC.conj_I {K : Type u_1} [] :
↑() IsROrC.I = -IsROrC.I
@[simp]
theorem IsROrC.conj_ofReal {K : Type u_1} [] (r : ) :
↑() r = r
@[deprecated]
theorem IsROrC.conj_bit0 {K : Type u_1} [] (z : K) :
↑() (bit0 z) = bit0 (↑() z)
@[deprecated]
theorem IsROrC.conj_bit1 {K : Type u_1} [] (z : K) :
↑() (bit1 z) = bit1 (↑() z)
theorem IsROrC.conj_neg_I {K : Type u_1} [] :
↑() (-IsROrC.I) = IsROrC.I
theorem IsROrC.conj_eq_re_sub_im {K : Type u_1} [] (z : K) :
↑() z = ↑(IsROrC.re z) - ↑(IsROrC.im z) * IsROrC.I
theorem IsROrC.sub_conj {K : Type u_1} [] (z : K) :
z - ↑() z = 2 * ↑(IsROrC.im z) * IsROrC.I
theorem IsROrC.conj_smul {K : Type u_1} [] (r : ) (z : K) :
↑() (r z) = r ↑() z
theorem IsROrC.add_conj {K : Type u_1} [] (z : K) :
z + ↑() z = 2 * ↑(IsROrC.re z)
theorem IsROrC.re_eq_add_conj {K : Type u_1} [] (z : K) :
↑(IsROrC.re z) = (z + ↑() z) / 2
theorem IsROrC.im_eq_conj_sub {K : Type u_1} [] (z : K) :
↑(IsROrC.im z) = IsROrC.I * (↑() z - z) / 2
theorem IsROrC.is_real_TFAE {K : Type u_1} [] (z : K) :
List.TFAE [↑() z = z, r, r = z, ↑(IsROrC.re z) = z, IsROrC.im z = 0]

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

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

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

Instances For
def IsROrC.normSq {K : Type u_1} [] :

The norm squared function.

Instances For
theorem IsROrC.normSq_apply {K : Type u_1} [] (z : K) :
IsROrC.normSq z = IsROrC.re z * IsROrC.re z + IsROrC.im z * IsROrC.im z
theorem IsROrC.norm_sq_eq_def {K : Type u_1} [] {z : K} :
z ^ 2 = IsROrC.re z * IsROrC.re z + IsROrC.im z * IsROrC.im z
theorem IsROrC.normSq_eq_def' {K : Type u_1} [] (z : K) :
IsROrC.normSq z = z ^ 2
theorem IsROrC.normSq_zero {K : Type u_1} [] :
IsROrC.normSq 0 = 0
theorem IsROrC.normSq_one {K : Type u_1} [] :
IsROrC.normSq 1 = 1
theorem IsROrC.normSq_nonneg {K : Type u_1} [] (z : K) :
0 IsROrC.normSq z
theorem IsROrC.normSq_eq_zero {K : Type u_1} [] {z : K} :
IsROrC.normSq z = 0 z = 0
@[simp]
theorem IsROrC.normSq_pos {K : Type u_1} [] {z : K} :
0 < IsROrC.normSq z z 0
@[simp]
theorem IsROrC.normSq_neg {K : Type u_1} [] (z : K) :
IsROrC.normSq (-z) = IsROrC.normSq z
@[simp]
theorem IsROrC.normSq_conj {K : Type u_1} [] (z : K) :
IsROrC.normSq (↑() z) = IsROrC.normSq z
theorem IsROrC.normSq_mul {K : Type u_1} [] (z : K) (w : K) :
IsROrC.normSq (z * w) = IsROrC.normSq z * IsROrC.normSq w
theorem IsROrC.normSq_add {K : Type u_1} [] (z : K) (w : K) :
IsROrC.normSq (z + w) = IsROrC.normSq z + IsROrC.normSq w + 2 * IsROrC.re (z * ↑() w)
theorem IsROrC.re_sq_le_normSq {K : Type u_1} [] (z : K) :
IsROrC.re z * IsROrC.re z IsROrC.normSq z
theorem IsROrC.im_sq_le_normSq {K : Type u_1} [] (z : K) :
IsROrC.im z * IsROrC.im z IsROrC.normSq z
theorem IsROrC.mul_conj {K : Type u_1} [] (z : K) :
z * ↑() z = ↑(IsROrC.normSq z)
theorem IsROrC.conj_mul {K : Type u_1} [] (x : K) :
↑() x * x = ↑(IsROrC.normSq x)
theorem IsROrC.normSq_sub {K : Type u_1} [] (z : K) (w : K) :
IsROrC.normSq (z - w) = IsROrC.normSq z + IsROrC.normSq w - 2 * IsROrC.re (z * ↑() w)
theorem IsROrC.sqrt_normSq_eq_norm {K : Type u_1} [] {z : K} :
Real.sqrt (IsROrC.normSq z) = z

### Inversion #

@[simp]
theorem IsROrC.ofReal_inv {K : Type u_1} [] (r : ) :
r⁻¹ = (r)⁻¹
theorem IsROrC.inv_def {K : Type u_1} [] (z : K) :
z⁻¹ = ↑() z * (z ^ 2)⁻¹
@[simp]
theorem IsROrC.inv_re {K : Type u_1} [] (z : K) :
IsROrC.re z⁻¹ = IsROrC.re z / IsROrC.normSq z
@[simp]
theorem IsROrC.inv_im {K : Type u_1} [] (z : K) :
IsROrC.im z⁻¹ = -IsROrC.im z / IsROrC.normSq z
theorem IsROrC.div_re {K : Type u_1} [] (z : K) (w : K) :
IsROrC.re (z / w) = IsROrC.re z * IsROrC.re w / IsROrC.normSq w + IsROrC.im z * IsROrC.im w / IsROrC.normSq w
theorem IsROrC.div_im {K : Type u_1} [] (z : K) (w : K) :
IsROrC.im (z / w) = IsROrC.im z * IsROrC.re w / IsROrC.normSq w - IsROrC.re z * IsROrC.im w / IsROrC.normSq w
theorem IsROrC.conj_inv {K : Type u_1} [] (x : K) :
↑() x⁻¹ = (↑() x)⁻¹
@[simp]
theorem IsROrC.ofReal_div {K : Type u_1} [] (r : ) (s : ) :
↑(r / s) = r / s
theorem IsROrC.div_re_ofReal {K : Type u_1} [] {z : K} {r : } :
IsROrC.re (z / r) = IsROrC.re z / r
@[simp]
theorem IsROrC.ofReal_zpow {K : Type u_1} [] (r : ) (n : ) :
↑(r ^ n) = r ^ n
theorem IsROrC.I_mul_I_of_nonzero {K : Type u_1} [] :
IsROrC.I 0IsROrC.I * IsROrC.I = -1
@[simp]
theorem IsROrC.inv_I {K : Type u_1} [] :
IsROrC.I⁻¹ = -IsROrC.I
@[simp]
theorem IsROrC.div_I {K : Type u_1} [] (z : K) :
z / IsROrC.I = -(z * IsROrC.I)
theorem IsROrC.normSq_inv {K : Type u_1} [] (z : K) :
IsROrC.normSq z⁻¹ = (IsROrC.normSq z)⁻¹
theorem IsROrC.normSq_div {K : Type u_1} [] (z : K) (w : K) :
IsROrC.normSq (z / w) = IsROrC.normSq z / IsROrC.normSq w
theorem IsROrC.norm_conj {K : Type u_1} [] {z : K} :
↑() z = z

### Cast lemmas #

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

### Norm #

theorem IsROrC.norm_of_nonneg {K : Type u_1} [] {r : } (h : 0 r) :
r = r
@[simp]
theorem IsROrC.norm_natCast {K : Type u_1} [] (n : ) :
n = n
@[simp]
theorem IsROrC.norm_ofNat {K : Type u_1} [] (n : ) [] :
theorem IsROrC.mul_self_norm {K : Type u_1} [] (z : K) :
z * z = IsROrC.normSq z
theorem IsROrC.norm_two {K : Type u_1} [] :
theorem IsROrC.abs_re_le_norm {K : Type u_1} [] (z : K) :
|IsROrC.re z| z
theorem IsROrC.abs_im_le_norm {K : Type u_1} [] (z : K) :
|IsROrC.im z| z
theorem IsROrC.norm_re_le_norm {K : Type u_1} [] (z : K) :
IsROrC.re z z
theorem IsROrC.norm_im_le_norm {K : Type u_1} [] (z : K) :
IsROrC.im z z
theorem IsROrC.re_le_norm {K : Type u_1} [] (z : K) :
IsROrC.re z z
theorem IsROrC.im_le_norm {K : Type u_1} [] (z : K) :
IsROrC.im z z
theorem IsROrC.im_eq_zero_of_le {K : Type u_1} [] {a : K} (h : a IsROrC.re a) :
IsROrC.im a = 0
theorem IsROrC.re_eq_self_of_le {K : Type u_1} [] {a : K} (h : a IsROrC.re a) :
↑(IsROrC.re a) = a
theorem IsROrC.abs_re_div_norm_le_one {K : Type u_1} [] (z : K) :
|IsROrC.re z / z| 1
theorem IsROrC.abs_im_div_norm_le_one {K : Type u_1} [] (z : K) :
|IsROrC.im z / z| 1
theorem IsROrC.norm_I_of_ne_zero {K : Type u_1} [] (hI : IsROrC.I 0) :
IsROrC.I = 1
theorem IsROrC.re_eq_norm_of_mul_conj {K : Type u_1} [] (x : K) :
IsROrC.re (x * ↑() x) = x * ↑() x
theorem IsROrC.norm_sq_re_add_conj {K : Type u_1} [] (x : K) :
x + ↑() x ^ 2 = IsROrC.re (x + ↑() x) ^ 2
theorem IsROrC.norm_sq_re_conj_add {K : Type u_1} [] (x : K) :
↑() x + x ^ 2 = IsROrC.re (↑() x + x) ^ 2

### Cauchy sequences #

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

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

Instances For
noncomputable def IsROrC.cauSeqIm {K : Type u_1} [] (f : CauSeq K norm) :

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

Instances For
theorem IsROrC.isCauSeq_norm {K : Type u_1} [] {f : K} (hf : IsCauSeq norm f) :
IsCauSeq abs (norm f)
noncomputable instance Real.isROrC :
theorem IsROrC.lt_iff_re_im {K : Type u_1} [] {z : K} {w : K} :
z < w IsROrC.re z < IsROrC.re w IsROrC.im z = IsROrC.im w
theorem IsROrC.nonneg_iff {K : Type u_1} [] {z : K} :
0 z 0 IsROrC.re z IsROrC.im z = 0
theorem IsROrC.pos_iff {K : Type u_1} [] {z : K} :
0 < z 0 < IsROrC.re z IsROrC.im z = 0
theorem IsROrC.nonpos_iff {K : Type u_1} [] {z : K} :
z 0 IsROrC.re z 0 IsROrC.im z = 0
theorem IsROrC.neg_iff {K : Type u_1} [] {z : K} :
z < 0 IsROrC.re z < 0 IsROrC.im z = 0
def IsROrC.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.

Instances For

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.

Instances For
theorem IsROrC.toOrderedSMul {K : Type u_1} [] :
@[simp]
theorem IsROrC.re_to_real {x : } :
IsROrC.re x = x
@[simp]
theorem IsROrC.im_to_real {x : } :
IsROrC.im x = 0
@[simp]
theorem IsROrC.conj_to_real {x : } :
↑() x = x
@[simp]
theorem IsROrC.I_to_real :
IsROrC.I = 0
@[simp]
theorem IsROrC.normSq_to_real {x : } :
IsROrC.normSq x = x * x
@[simp]
theorem IsROrC.ofReal_real_eq_id :
IsROrC.ofReal = id
def IsROrC.reLm {K : Type u_1} [] :

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

Instances For
@[simp]
theorem IsROrC.reLm_coe {K : Type u_1} [] :
IsROrC.reLm = IsROrC.re
noncomputable def IsROrC.reClm {K : Type u_1} [] :

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

Instances For
@[simp]
theorem IsROrC.reClm_coe {K : Type u_1} [] :
IsROrC.reClm = IsROrC.reLm
@[simp]
theorem IsROrC.reClm_apply {K : Type u_1} [] :
IsROrC.reClm = IsROrC.re
theorem IsROrC.continuous_re {K : Type u_1} [] :
Continuous IsROrC.re
def IsROrC.imLm {K : Type u_1} [] :

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

Instances For
@[simp]
theorem IsROrC.imLm_coe {K : Type u_1} [] :
IsROrC.imLm = IsROrC.im
noncomputable def IsROrC.imClm {K : Type u_1} [] :

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

Instances For
@[simp]
theorem IsROrC.imClm_coe {K : Type u_1} [] :
IsROrC.imClm = IsROrC.imLm
@[simp]
theorem IsROrC.imClm_apply {K : Type u_1} [] :
IsROrC.imClm = IsROrC.im
theorem IsROrC.continuous_im {K : Type u_1} [] :
Continuous IsROrC.im
def IsROrC.conjAe {K : Type u_1} [] :

Conjugate as an ℝ-algebra equivalence

Instances For
@[simp]
theorem IsROrC.conjAe_coe {K : Type u_1} [] :
IsROrC.conjAe = ↑()
noncomputable def IsROrC.conjLie {K : Type u_1} [] :

Conjugate as a linear isometry

Instances For
@[simp]
theorem IsROrC.conjLie_apply {K : Type u_1} [] :
IsROrC.conjLie = ↑()
noncomputable def IsROrC.conjCle {K : Type u_1} [] :

Conjugate as a continuous linear equivalence

Instances For
@[simp]
theorem IsROrC.conjCle_coe {K : Type u_1} [] :
IsROrC.conjCle.toLinearEquiv = AlgEquiv.toLinearEquiv IsROrC.conjAe
@[simp]
theorem IsROrC.conjCle_apply {K : Type u_1} [] :
IsROrC.conjCle = ↑()
theorem IsROrC.continuous_conj {K : Type u_1} [] :
noncomputable def IsROrC.ofRealAm {K : Type u_1} [] :

The ℝ → K coercion, as a linear map

Instances For
@[simp]
theorem IsROrC.ofRealAm_coe {K : Type u_1} [] :
IsROrC.ofRealAm = IsROrC.ofReal
noncomputable def IsROrC.ofRealLi {K : Type u_1} [] :

The ℝ → K coercion, as a linear isometry

Instances For
@[simp]
theorem IsROrC.ofRealLi_apply {K : Type u_1} [] :
IsROrC.ofRealLi = IsROrC.ofReal
noncomputable def IsROrC.ofRealClm {K : Type u_1} [] :

The ℝ → K coercion, as a continuous linear map

Instances For
@[simp]
theorem IsROrC.ofRealClm_coe {K : Type u_1} [] :
IsROrC.ofRealClm = AlgHom.toLinearMap IsROrC.ofRealAm
@[simp]
theorem IsROrC.ofRealClm_apply {K : Type u_1} [] :
IsROrC.ofRealClm = IsROrC.ofReal
theorem IsROrC.continuous_ofReal {K : Type u_1} [] :
Continuous IsROrC.ofReal
theorem IsROrC.continuous_normSq {K : Type u_1} [] :
Continuous IsROrC.normSq