Documentation

Mathlib.Data.Int.Cast.Lemmas

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), particularly results involving algebraic homomorphisms or the order structure on ℤ which were not available in the import dependencies of Data.Int.Cast.Basic.

Main declarations #

Coercion ℕ → ℤ as a RingHom.

Equations
Instances For
    theorem Int.coe_nat_pos {n : ℕ} :
    0 < ↑n ↔ 0 < n
    theorem Int.coe_nat_succ_pos (n : ℕ) :
    0 < ↑(Nat.succ n)
    theorem Int.toNat_lt' {a : ℤ} {b : ℕ} (hb : b ≠ 0) :
    Int.toNat a < b ↔ a < ↑b
    theorem Int.natMod_lt {a : ℤ} {b : ℕ} (hb : b ≠ 0) :
    Int.natMod a ↑b < b
    @[simp]
    theorem Int.cast_ite {α : Type u_3} [AddGroupWithOne α] (P : Prop) [Decidable P] (m : ℤ) (n : ℤ) :
    ↑(if P then m else n) = if P then ↑m else ↑n
    def Int.castAddHom (α : Type u_5) [AddGroupWithOne α] :

    coe : ℤ → α as an AddMonoidHom.

    Equations
    • Int.castAddHom α = { toZeroHom := { toFun := Int.cast, map_zero' := (_ : ↑0 = 0) }, map_add' := (_ : ∀ (m n : ℤ), ↑(m + n) = ↑m + ↑n) }
    Instances For
      @[simp]
      theorem Int.coe_castAddHom {α : Type u_3} [AddGroupWithOne α] :
      ↑(Int.castAddHom α) = fun x => ↑x
      def Int.castRingHom (α : Type u_5) [NonAssocRing α] :

      coe : ℤ → α as a RingHom.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem Int.coe_castRingHom {α : Type u_3} [NonAssocRing α] :
        ↑(Int.castRingHom α) = fun x => ↑x
        theorem Int.cast_commute {α : Type u_3} [NonAssocRing α] (m : ℤ) (x : α) :
        Commute (↑m) x
        theorem Int.cast_comm {α : Type u_3} [NonAssocRing α] (m : ℤ) (x : α) :
        ↑m * x = x * ↑m
        theorem Int.commute_cast {α : Type u_3} [NonAssocRing α] (x : α) (m : ℤ) :
        Commute x ↑m
        theorem Int.cast_mono {α : Type u_3} [OrderedRing α] :
        Monotone fun x => ↑x
        @[simp]
        theorem Int.cast_nonneg {α : Type u_3} [OrderedRing α] [Nontrivial α] {n : ℤ} :
        0 ≤ ↑n ↔ 0 ≤ n
        @[simp]
        theorem Int.cast_le {α : Type u_3} [OrderedRing α] [Nontrivial α] {m : ℤ} {n : ℤ} :
        ↑m ≤ ↑n ↔ m ≤ n
        theorem Int.cast_strictMono {α : Type u_3} [OrderedRing α] [Nontrivial α] :
        StrictMono fun x => ↑x
        @[simp]
        theorem Int.cast_lt {α : Type u_3} [OrderedRing α] [Nontrivial α] {m : ℤ} {n : ℤ} :
        ↑m < ↑n ↔ m < n
        @[simp]
        theorem Int.cast_nonpos {α : Type u_3} [OrderedRing α] [Nontrivial α] {n : ℤ} :
        ↑n ≤ 0 ↔ n ≤ 0
        @[simp]
        theorem Int.cast_pos {α : Type u_3} [OrderedRing α] [Nontrivial α] {n : ℤ} :
        0 < ↑n ↔ 0 < n
        @[simp]
        theorem Int.cast_lt_zero {α : Type u_3} [OrderedRing α] [Nontrivial α] {n : ℤ} :
        ↑n < 0 ↔ n < 0
        @[simp]
        theorem Int.cast_min {α : Type u_3} [LinearOrderedRing α] {a : ℤ} {b : ℤ} :
        ↑(min a b) = min ↑a ↑b
        @[simp]
        theorem Int.cast_max {α : Type u_3} [LinearOrderedRing α] {a : ℤ} {b : ℤ} :
        ↑(max a b) = max ↑a ↑b
        @[simp]
        theorem Int.cast_abs {α : Type u_3} [LinearOrderedRing α] {a : ℤ} :
        ↑|a| = |↑a|
        theorem Int.cast_one_le_of_pos {α : Type u_3} [LinearOrderedRing α] {a : ℤ} (h : 0 < a) :
        1 ≤ ↑a
        theorem Int.cast_le_neg_one_of_neg {α : Type u_3} [LinearOrderedRing α] {a : ℤ} (h : a < 0) :
        ↑a ≤ -1
        theorem Int.cast_le_neg_one_or_one_le_cast_of_ne_zero (α : Type u_3) [LinearOrderedRing α] {n : ℤ} (hn : n ≠ 0) :
        ↑n ≤ -1 ∨ 1 ≤ ↑n
        theorem Int.nneg_mul_add_sq_of_abs_le_one {α : Type u_3} [LinearOrderedRing α] (n : ℤ) {x : α} (hx : |x| ≤ 1) :
        0 ≤ ↑n * x + ↑n * ↑n
        theorem Int.cast_natAbs {α : Type u_3} [LinearOrderedRing α] (n : ℤ) :
        ↑(Int.natAbs n) = ↑|n|
        theorem Int.coe_int_dvd {α : Type u_3} [CommRing α] (m : ℤ) (n : ℤ) (h : m ∣ n) :
        ↑m ∣ ↑n
        theorem AddMonoidHom.ext_int {A : Type u_5} [AddMonoid A] {f : ℤ →+ A} {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 AddMonoidHom.eq_int_castAddHom {A : Type u_5} [AddGroupWithOne A] (f : ℤ →+ A) (h1 : ↑f 1 = 1) :
        theorem eq_intCast' {F : Type u_1} {α : Type u_3} [AddGroupWithOne α] [AddMonoidHomClass F ℤ α] (f : F) (h₁ : ↑f 1 = 1) (n : ℤ) :
        ↑f n = ↑n
        theorem MonoidHom.ext_mint {M : Type u_5} [Monoid M] {f : Multiplicative ℤ →* M} {g : Multiplicative ℤ →* M} (h1 : ↑f (↑Multiplicative.ofAdd 1) = ↑g (↑Multiplicative.ofAdd 1)) :
        f = g
        theorem MonoidHom.ext_int {M : Type u_5} [Monoid M] {f : ℤ →* M} {g : ℤ →* M} (h_neg_one : ↑f (-1) = ↑g (-1)) (h_nat : MonoidHom.comp f ↑Int.ofNatHom = MonoidHom.comp g ↑Int.ofNatHom) :
        f = g

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

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

        theorem ext_int' {F : Type u_1} {α : Type u_3} [MonoidWithZero α] [MonoidWithZeroHomClass F ℤ α] {f : F} {g : F} (h_neg_one : ↑f (-1) = ↑g (-1)) (h_pos : ∀ (n : ℕ), 0 < n → ↑f ↑n = ↑g ↑n) :
        f = g

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

        @[simp]
        theorem eq_intCast {F : Type u_1} {α : Type u_3} [NonAssocRing α] [RingHomClass F ℤ α] (f : F) (n : ℤ) :
        ↑f n = ↑n
        @[simp]
        theorem map_intCast {F : Type u_1} {α : Type u_3} {β : Type u_4} [NonAssocRing α] [NonAssocRing β] [RingHomClass F α β] (f : F) (n : ℤ) :
        ↑f ↑n = ↑n
        theorem RingHom.eq_intCast' {α : Type u_3} [NonAssocRing α] (f : ℤ →+* α) :
        theorem RingHom.ext_int {R : Type u_5} [NonAssocSemiring R] (f : ℤ →+* R) (g : ℤ →+* R) :
        f = g
        instance Pi.intCast {ι : Type u_2} {π : ι → Type u_5} [(i : ι) → IntCast (π i)] :
        IntCast ((i : ι) → π i)
        Equations
        • Pi.intCast = { intCast := fun n x => ↑n }
        theorem Pi.int_apply {ι : Type u_2} {π : ι → Type u_5} [(i : ι) → IntCast (π i)] (n : ℤ) (i : ι) :
        ↑n i = ↑n
        @[simp]
        theorem Pi.coe_int {ι : Type u_2} {π : ι → Type u_5} [(i : ι) → IntCast (π i)] (n : ℤ) :
        ↑n = fun x => ↑n
        theorem Sum.elim_intCast_intCast {α : Type u_5} {β : Type u_6} {γ : Type u_7} [IntCast γ] (n : ℤ) :
        Sum.elim ↑n ↑n = ↑n

        Order dual #

        instance instIntCastOrderDual {α : Type u_3} [h : IntCast α] :
        Equations
        • instIntCastOrderDual = h
        Equations
        • instAddGroupWithOneOrderDual = h
        Equations
        • instAddCommGroupWithOneOrderDual = h
        @[simp]
        theorem toDual_intCast {α : Type u_3} [IntCast α] (n : ℤ) :
        ↑OrderDual.toDual ↑n = ↑n
        @[simp]
        theorem ofDual_intCast {α : Type u_3} [IntCast α] (n : ℤ) :
        ↑(↑OrderDual.ofDual n) = ↑n

        Lexicographic order #

        instance instIntCastLex {α : Type u_3} [h : IntCast α] :
        Equations
        • instIntCastLex = h
        Equations
        • instAddGroupWithOneLex = h
        Equations
        • instAddCommGroupWithOneLex = h
        @[simp]
        theorem toLex_intCast {α : Type u_3} [IntCast α] (n : ℤ) :
        ↑toLex ↑n = ↑n
        @[simp]
        theorem ofLex_intCast {α : Type u_3} [IntCast α] (n : ℤ) :
        ↑(↑ofLex n) = ↑n