Documentation

Mathlib.Data.Nat.Cast.Basic

Cast of natural numbers (additional theorems) #

This file proves additional properties about the canonical homomorphism from the natural numbers into an additive monoid with a one (Nat.cast).

Main declarations #

Nat.cast : ℕ → α as an AddMonoidHom.

Equations
  • Nat.castAddMonoidHom α = { toZeroHom := { toFun := Nat.cast, map_zero' := (_ : 0 = 0) }, map_add' := (_ : ∀ (m n : ), ↑(m + n) = m + n) }
Instances For
    @[simp]
    theorem Nat.coe_castAddMonoidHom {α : Type u_1} [AddMonoidWithOne α] :
    ↑(Nat.castAddMonoidHom α) = Nat.cast
    @[simp]
    theorem Nat.cast_mul {α : Type u_1} [NonAssocSemiring α] (m : ) (n : ) :
    ↑(m * n) = m * n

    Nat.cast : ℕ → α as a RingHom

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]
      theorem Nat.coe_castRingHom {α : Type u_1} [NonAssocSemiring α] :
      ↑(Nat.castRingHom α) = Nat.cast
      theorem Nat.coe_nat_dvd {α : Type u_1} [Semiring α] {m : } {n : } (h : m n) :
      m n
      theorem Dvd.dvd.natCast {α : Type u_1} [Semiring α] {m : } {n : } (h : m n) :
      m n

      Alias of Nat.coe_nat_dvd.

      theorem ext_nat' {A : Type u_3} {F : Type u_5} [AddMonoid A] [AddMonoidHomClass F A] (f : F) (g : F) (h : f 1 = g 1) :
      f = g
      theorem AddMonoidHom.ext_nat {A : Type u_3} [AddMonoid A] {f : →+ A} {g : →+ A} :
      f 1 = g 1f = g
      theorem eq_natCast' {A : Type u_3} {F : Type u_5} [AddMonoidWithOne A] [AddMonoidHomClass F A] (f : F) (h1 : f 1 = 1) (n : ) :
      f n = n
      theorem map_natCast' {B : Type u_4} {F : Type u_5} [AddMonoidWithOne B] {A : Type u_6} [AddMonoidWithOne A] [AddMonoidHomClass F A B] (f : F) (h : f 1 = 1) (n : ) :
      f n = n
      theorem ext_nat'' {A : Type u_3} {F : Type u_4} [MulZeroOneClass A] [MonoidWithZeroHomClass F A] (f : F) (g : F) (h_pos : ∀ {n : }, 0 < nf n = g n) :
      f = g

      If two MonoidWithZeroHoms agree on the positive naturals they are equal.

      theorem MonoidWithZeroHom.ext_nat {A : Type u_3} [MulZeroOneClass A] {f : →*₀ A} {g : →*₀ A} :
      (∀ {n : }, 0 < nf n = g n) → f = g
      @[simp]
      theorem eq_natCast {R : Type u_3} {F : Type u_5} [NonAssocSemiring R] [RingHomClass F R] (f : F) (n : ) :
      f n = n
      @[simp]
      theorem map_natCast {R : Type u_3} {S : Type u_4} {F : Type u_5} [NonAssocSemiring R] [NonAssocSemiring S] [RingHomClass F R S] (f : F) (n : ) :
      f n = n
      @[simp]
      theorem map_ofNat {R : Type u_3} {S : Type u_4} {F : Type u_5} [NonAssocSemiring R] [NonAssocSemiring S] [RingHomClass F R S] (f : F) (n : ) [Nat.AtLeastTwo n] :
      theorem ext_nat {R : Type u_3} {F : Type u_5} [NonAssocSemiring R] [RingHomClass F R] (f : F) (g : F) :
      f = g
      theorem NeZero.nat_of_neZero {R : Type u_6} {S : Type u_7} [Semiring R] [Semiring S] {F : Type u_8} [RingHomClass F R S] (f : F) {n : } [hn : NeZero n] :
      NeZero n

      This is primed to match eq_intCast'.

      @[simp]
      theorem Nat.cast_id (n : ) :
      n = n

      We don't use RingHomClass here, since that might cause type-class slowdown for Subsingleton

      Equations
      instance Pi.natCast {α : Type u_1} {π : αType u_3} [(a : α) → NatCast (π a)] :
      NatCast ((a : α) → π a)
      Equations
      • Pi.natCast = { natCast := fun n x => n }
      theorem Pi.nat_apply {α : Type u_1} {π : αType u_3} [(a : α) → NatCast (π a)] (n : ) (a : α) :
      n a = n
      @[simp]
      theorem Pi.coe_nat {α : Type u_1} {π : αType u_3} [(a : α) → NatCast (π a)] (n : ) :
      n = fun x => n
      @[simp]
      theorem Pi.ofNat_apply {α : Type u_1} {π : αType u_3} [(a : α) → NatCast (π a)] (n : ) [Nat.AtLeastTwo n] (a : α) :
      OfNat.ofNat ((a : α) → π a) n instOfNat a = n
      theorem Sum.elim_natCast_natCast {α : Type u_3} {β : Type u_4} {γ : Type u_5} [NatCast γ] (n : ) :
      Sum.elim n n = n