mathlib documentation

data.int.cast

Cast of integers (additional theorems) #

This file proves additional properties about the canonical homomorphism from the integers into an additive group with a one (int.cast).

Main declarations #

Coercion ℕ → ℤ as a ring_hom.

Equations
@[simp, norm_cast]
theorem int.cast_mul {α : Type u_3} [non_assoc_ring α] (m n : ) :
(m * n) = m * n
@[simp, norm_cast]
theorem int.cast_ite {α : Type u_3} [add_group_with_one α] (P : Prop) [decidable P] (m n : ) :
(ite P m n) = ite P m n
def int.cast_add_hom (α : Type u_1) [add_group_with_one α] :

coe : ℤ → α as an add_monoid_hom.

Equations
@[simp]
theorem int.coe_cast_add_hom {α : Type u_3} [add_group_with_one α] :
def int.cast_ring_hom (α : Type u_1) [non_assoc_ring α] :

coe : ℤ → α as a ring_hom.

Equations
@[simp]
theorem int.coe_cast_ring_hom {α : Type u_3} [non_assoc_ring α] :
theorem int.cast_commute {α : Type u_3} [non_assoc_ring α] (m : ) (x : α) :
theorem int.cast_comm {α : Type u_3} [non_assoc_ring α] (m : ) (x : α) :
m * x = x * m
theorem int.commute_cast {α : Type u_3} [non_assoc_ring α] (x : α) (m : ) :
theorem int.cast_mono {α : Type u_3} [ordered_ring α] :
@[simp]
theorem int.cast_nonneg {α : Type u_3} [ordered_ring α] [nontrivial α] {n : } :
0 n 0 n
@[simp, norm_cast]
theorem int.cast_le {α : Type u_3} [ordered_ring α] [nontrivial α] {m n : } :
m n m n
theorem int.cast_strict_mono {α : Type u_3} [ordered_ring α] [nontrivial α] :
@[simp, norm_cast]
theorem int.cast_lt {α : Type u_3} [ordered_ring α] [nontrivial α] {m n : } :
m < n m < n
@[simp]
theorem int.cast_nonpos {α : Type u_3} [ordered_ring α] [nontrivial α] {n : } :
n 0 n 0
@[simp]
theorem int.cast_pos {α : Type u_3} [ordered_ring α] [nontrivial α] {n : } :
0 < n 0 < n
@[simp]
theorem int.cast_lt_zero {α : Type u_3} [ordered_ring α] [nontrivial α] {n : } :
n < 0 n < 0
@[simp, norm_cast]
theorem int.cast_min {α : Type u_3} [linear_ordered_ring α] {a b : } :
@[simp, norm_cast]
theorem int.cast_max {α : Type u_3} [linear_ordered_ring α] {a b : } :
@[simp, norm_cast]
theorem int.cast_abs {α : Type u_3} [linear_ordered_ring α] {a : } :
theorem int.cast_one_le_of_pos {α : Type u_3} [linear_ordered_ring α] {a : } (h : 0 < a) :
1 a
theorem int.cast_le_neg_one_of_neg {α : Type u_3} [linear_ordered_ring α] {a : } (h : a < 0) :
a -1
theorem int.nneg_mul_add_sq_of_abs_le_one {α : Type u_3} [linear_ordered_ring α] (n : ) {x : α} (hx : |x| 1) :
0 n * x + n * n
theorem int.cast_nat_abs {α : Type u_3} [linear_ordered_ring α] (n : ) :
theorem int.coe_int_dvd {α : Type u_3} [comm_ring α] (m n : ) (h : m n) :
@[simp]
theorem prod.fst_int_cast {α : Type u_3} {β : Type u_4} [add_group_with_one α] [add_group_with_one β] (n : ) :
@[simp]
theorem prod.snd_int_cast {α : Type u_3} {β : Type u_4} [add_group_with_one α] [add_group_with_one β] (n : ) :
@[ext]
theorem add_monoid_hom.ext_int {A : Type u_5} [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_5} [add_group_with_one A] (f : →+ A) (h1 : f 1 = 1) :
theorem eq_int_cast' {F : Type u_1} {α : Type u_3} [add_group_with_one α] [add_monoid_hom_class F α] (f : F) (h₁ : f 1 = 1) (n : ) :
f n = n
@[ext]
theorem monoid_hom.ext_mint {M : Type u_5} [monoid M] {f g : multiplicative →* M} (h1 : f (multiplicative.of_add 1) = g (multiplicative.of_add 1)) :
f = g
@[ext]
theorem monoid_hom.ext_int {M : Type u_5} [monoid M] {f g : →* M} (h_neg_one : f (-1) = g (-1)) (h_nat : f.comp int.of_nat_hom.to_monoid_hom = g.comp int.of_nat_hom.to_monoid_hom) :
f = g

If two monoid_homs agree on -1 and the naturals then they are equal.

@[ext]
theorem monoid_with_zero_hom.ext_int {M : Type u_5} [monoid_with_zero M] {f g : →*₀ M} (h_neg_one : f (-1) = g (-1)) (h_nat : f.comp int.of_nat_hom.to_monoid_with_zero_hom = g.comp int.of_nat_hom.to_monoid_with_zero_hom) :
f = g

If two monoid_with_zero_homs agree on -1 and the naturals then they are equal.

theorem ext_int' {F : Type u_1} {α : Type u_3} [monoid_with_zero α] [monoid_with_zero_hom_class F α] {f g : F} (h_neg_one : f (-1) = g (-1)) (h_pos : ∀ (n : ), 0 < nf n = g n) :
f = g

If two monoid_with_zero_homs agree on -1 and the positive naturals then they are equal.

@[simp]
theorem eq_int_cast {F : Type u_1} {α : Type u_3} [non_assoc_ring α] [ring_hom_class F α] (f : F) (n : ) :
f n = n
@[simp]
theorem map_int_cast {F : Type u_1} {α : Type u_3} {β : Type u_4} [non_assoc_ring α] [non_assoc_ring β] [ring_hom_class F α β] (f : F) (n : ) :
theorem ring_hom.eq_int_cast' {α : Type u_3} [non_assoc_ring α] (f : →+* α) :
theorem ring_hom.ext_int {R : Type u_1} [non_assoc_semiring R] (f g : →+* R) :
f = g
@[protected, instance]
@[simp, norm_cast]
theorem int.cast_id (n : ) :
n = n
@[protected, instance]
def pi.has_int_cast {ι : Type u_2} {π : ι → Type u_5} [Π (i : ι), has_int_cast (π i)] :
has_int_cast (Π (i : ι), π i)
Equations
theorem pi.int_apply {ι : Type u_2} {π : ι → Type u_5} [Π (i : ι), has_int_cast (π i)] (n : ) (i : ι) :
n i = n
@[simp]
theorem pi.coe_int {ι : Type u_2} {π : ι → Type u_5} [Π (i : ι), has_int_cast (π i)] (n : ) :
n = λ (_x : ι), n
theorem sum.elim_int_cast_int_cast {α : Type u_1} {β : Type u_2} {γ : Type u_3} [has_int_cast γ] (n : ) :
@[protected, instance]
def pi.add_group_with_one {ι : Type u_2} {π : ι → Type u_5} [Π (i : ι), add_group_with_one (π i)] :
add_group_with_one (Π (i : ι), π i)
Equations
@[simp, norm_cast]
theorem mul_opposite.op_int_cast {α : Type u_3} [add_group_with_one α] (z : ) :
@[simp, norm_cast]
theorem mul_opposite.unop_int_cast {α : Type u_3} [add_group_with_one α] (n : ) :

Order dual #

@[protected, instance]
def order_dual.has_int_cast {α : Type u_3} [h : has_int_cast α] :
Equations
@[protected, instance]
Equations
@[simp]
theorem to_dual_int_cast {α : Type u_3} [has_int_cast α] (n : ) :
@[simp]
theorem of_dual_int_cast {α : Type u_3} [has_int_cast α] (n : ) :

Lexicographic order #

@[protected, instance]
def lex.has_int_cast {α : Type u_3} [h : has_int_cast α] :
Equations
@[protected, instance]
def lex.add_group_with_one {α : Type u_3} [h : add_group_with_one α] :
Equations
@[protected, instance]
Equations
@[simp]
theorem to_lex_int_cast {α : Type u_3} [has_int_cast α] (n : ) :
@[simp]
theorem of_lex_int_cast {α : Type u_3} [has_int_cast α] (n : ) :