mathlib documentation

data.int.cast

@[simp]
theorem int.nat_cast_eq_coe_nat (n : ℕ) :

Coercion ℕ → ℤ as a ring_hom.

Equations
def int.cast {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] (a : ℤ) :
α

Canonical homomorphism from the integers to any ring(-like) structure α

Equations
@[instance]
def int.cast_coe {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] :

Equations
@[simp]
theorem int.cast_zero {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] :
↑0 = 0

theorem int.cast_of_nat {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] (n : ℕ) :

@[simp]
theorem int.cast_coe_nat {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] (n : ℕ) :

theorem int.cast_coe_nat' {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] (n : ℕ) :

@[simp]
theorem int.cast_neg_succ_of_nat {α : Type u_1} [has_zero α] [has_one α] [has_add α] [has_neg α] (n : ℕ) :
↑-[1+ n] = -(↑n + 1)

@[simp]
theorem int.cast_one {α : Type u_1} [add_monoid α] [has_one α] [has_neg α] :
↑1 = 1

@[simp]
theorem int.cast_sub_nat_nat {α : Type u_1} [add_group α] [has_one α] (m n : ℕ) :

@[simp]
theorem int.cast_neg_of_nat {α : Type u_1} [add_group α] [has_one α] (n : ℕ) :

@[simp]
theorem int.cast_add {α : Type u_1} [add_group α] [has_one α] (m n : ℤ) :
↑(m + n) = ↑m + ↑n

@[simp]
theorem int.cast_neg {α : Type u_1} [add_group α] [has_one α] (n : ℤ) :

@[simp]
theorem int.cast_sub {α : Type u_1} [add_group α] [has_one α] (m n : ℤ) :
↑(m - n) = ↑m - ↑n

@[simp]
theorem int.cast_mul {α : Type u_1} [ring α] (m n : ℤ) :
↑m * n = (↑m) * ↑n

def int.cast_add_hom (α : Type u_1) [add_group α] [has_one α] :

coe : ℤ → α as an add_monoid_hom.

Equations
@[simp]
theorem int.coe_cast_add_hom {α : Type u_1} [add_group α] [has_one α] :

def int.cast_ring_hom (α : Type u_1) [ring α] :

coe : ℤ → α as a ring_hom.

Equations
@[simp]
theorem int.coe_cast_ring_hom {α : Type u_1} [ring α] :

theorem int.cast_commute {α : Type u_1} [ring α] (m : ℤ) (x : α) :

theorem int.commute_cast {α : Type u_1} [ring α] (x : α) (m : ℤ) :

@[simp]
theorem int.coe_nat_bit0 (n : ℕ) :

@[simp]
theorem int.coe_nat_bit1 (n : ℕ) :

@[simp]
theorem int.cast_bit0 {α : Type u_1} [ring α] (n : ℤ) :

@[simp]
theorem int.cast_bit1 {α : Type u_1} [ring α] (n : ℤ) :

theorem int.cast_two {α : Type u_1} [ring α] :
↑2 = 2

theorem int.cast_nonneg {α : Type u_1} [linear_ordered_ring α] {n : ℤ} :
0 ≤ ↑n ↔ 0 ≤ n

@[simp]
theorem int.cast_le {α : Type u_1} [linear_ordered_ring α] {m n : ℤ} :
↑m ≤ ↑n ↔ m ≤ n

@[simp]
theorem int.cast_lt {α : Type u_1} [linear_ordered_ring α] {m n : ℤ} :
↑m < ↑n ↔ m < n

@[simp]
theorem int.cast_nonpos {α : Type u_1} [linear_ordered_ring α] {n : ℤ} :
↑n ≤ 0 ↔ n ≤ 0

@[simp]
theorem int.cast_pos {α : Type u_1} [linear_ordered_ring α] {n : ℤ} :
0 < ↑n ↔ 0 < n

@[simp]
theorem int.cast_lt_zero {α : Type u_1} [linear_ordered_ring α] {n : ℤ} :
↑n < 0 ↔ n < 0

@[simp]
theorem int.cast_min {α : Type u_1} [decidable_linear_ordered_comm_ring α] {a b : ℤ} :
↑(min a b) = min ↑a ↑b

@[simp]
theorem int.cast_max {α : Type u_1} [decidable_linear_ordered_comm_ring α] {a b : ℤ} :
↑(max a b) = max ↑a ↑b

@[simp]
theorem int.cast_abs {α : Type u_1} [decidable_linear_ordered_comm_ring α] {q : ℤ} :

theorem int.coe_int_dvd {α : Type u_1} [comm_ring α] (m n : ℤ) (h : m ∣ n) :

@[ext]
theorem add_monoid_hom.ext_int {A : Type u_1} [add_monoid A] {f g : ℤ →+ A} (h1 : ⇑f 1 = ⇑g 1) :
f = g

Two additive monoid homomorphisms f, g from ℤ to an additive monoid are equal if f 1 = g 1.

theorem add_monoid_hom.eq_int_cast_hom {A : Type u_1} [add_group A] [has_one A] (f : ℤ →+ A) (h1 : ⇑f 1 = 1) :

theorem add_monoid_hom.eq_int_cast {A : Type u_1} [add_group A] [has_one A] (f : ℤ →+ A) (h1 : ⇑f 1 = 1) (n : ℤ) :
⇑f n = ↑n

theorem monoid_hom.ext_int {M : Type u_1} [monoid M] {f g : multiplicative ℤ →* M} (h1 : ⇑f (multiplicative.of_add 1) = ⇑g (multiplicative.of_add 1)) :
f = g

@[simp]
theorem ring_hom.eq_int_cast {α : Type u_1} [ring α] (f : ℤ →+* α) (n : ℤ) :
⇑f n = ↑n

theorem ring_hom.eq_int_cast' {α : Type u_1} [ring α] (f : ℤ →+* α) :

@[simp]
theorem ring_hom.map_int_cast {α : Type u_1} {β : Type u_2} [ring α] [ring β] (f : α →+* β) (n : ℤ) :

theorem ring_hom.ext_int {R : Type u_1} [semiring R] (f g : ℤ →+* R) :
f = g

@[instance]

@[simp]
theorem int.cast_id (n : ℤ) :
↑n = n