File: Mathlib/Algebra/CharZero/Defs.lean

full_name: CharZero.cast_injective
code: /-- Typeclass for monoids with characteristic zero.
  (This is usually stated on fields but it makes sense for any additive monoid with 1.)

*Warning*: for a semiring `R`, `CharZero R` and `CharP R 0` need not coincide.
* `CharZero R` requires an injection `ℕ ↪ R`;
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`.
For instance, endowing `{0, 1}` with addition given by `max` (i.e. `1` is absorbing), shows that
`CharZero {0, 1}` does not hold and yet `CharP {0, 1} 0` does.
This example is formalized in `Counterexamples/CharPZeroNeCharZero.lean`.
-/
class CharZero (R) [AddMonoidWithOne R] : Prop where
  /-- An additive monoid with one has characteristic zero if the canonical map `ℕ → R` is
  injective. -/
  cast_injective : Function.Injective (Nat.cast : ℕ → R)
goal: Function.Injective Nat.cast

full_name: CharZero
code: /-- Typeclass for monoids with characteristic zero.
  (This is usually stated on fields but it makes sense for any additive monoid with 1.)

*Warning*: for a semiring `R`, `CharZero R` and `CharP R 0` need not coincide.
* `CharZero R` requires an injection `ℕ ↪ R`;
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`.
For instance, endowing `{0, 1}` with addition given by `max` (i.e. `1` is absorbing), shows that
`CharZero {0, 1}` does not hold and yet `CharP {0, 1} 0` does.
This example is formalized in `Counterexamples/CharPZeroNeCharZero.lean`.
-/
class CharZero (R) [AddMonoidWithOne R] : Prop where
  /-- An additive monoid with one has characteristic zero if the canonical map `ℕ → R` is
  injective. -/
  cast_injective : Function.Injective (Nat.cast : ℕ → R)
goal: Prop

full_name: charZero_of_inj_zero
code: theorem charZero_of_inj_zero [AddGroupWithOne R] (H : ∀ n : ℕ, (n : R) = 0 → n = 0) :
    CharZero R 
goal: CharZero R

full_name: Nat.cast_injective
code: theorem cast_injective : Function.Injective (Nat.cast : ℕ → R) 
goal: Function.Injective Nat.cast

full_name: Nat.cast_inj
code: @[simp, norm_cast]
theorem cast_inj {m n : ℕ} : (m : R) = n ↔ m = n 
goal: ↑m = ↑n ↔ m = n

full_name: Nat.cast_eq_zero
code: @[simp, norm_cast]
theorem cast_eq_zero {n : ℕ} : (n : R) = 0 ↔ n = 0 
goal: ↑n = 0 ↔ n = 0

full_name: Nat.cast_ne_zero
code: @[norm_cast]
theorem cast_ne_zero {n : ℕ} : (n : R) ≠ 0 ↔ n ≠ 0 
goal: ↑n ≠ 0 ↔ n ≠ 0

full_name: Nat.cast_add_one_ne_zero
code: theorem cast_add_one_ne_zero (n : ℕ) : (n + 1 : R) ≠ 0 
goal: ↑n + 1 ≠ 0

full_name: Nat.cast_eq_one
code: @[simp, norm_cast]
theorem cast_eq_one {n : ℕ} : (n : R) = 1 ↔ n = 1 
goal: ↑n = 1 ↔ n = 1

full_name: Nat.cast_ne_one
code: @[norm_cast]
theorem cast_ne_one {n : ℕ} : (n : R) ≠ 1 ↔ n ≠ 1 
goal: ↑n ≠ 1 ↔ n ≠ 1

full_name: Nat.AtLeastTwo.toNeZero
code: instance (priority := 100) AtLeastTwo.toNeZero (n : ℕ) [n.AtLeastTwo] : NeZero n 
goal: NeZero n

full_name: OfNat.ofNat_ne_zero
code: @[simp] lemma ofNat_ne_zero (n : ℕ) [n.AtLeastTwo] : (no_index (ofNat n) : R) ≠ 0 
goal: OfNat.ofNat n ≠ 0

full_name: OfNat.zero_ne_ofNat
code: @[simp] lemma zero_ne_ofNat (n : ℕ) [n.AtLeastTwo] : 0 ≠ (no_index (ofNat n) : R) 
goal: 0 ≠ OfNat.ofNat n

full_name: OfNat.ofNat_ne_one
code: @[simp] lemma ofNat_ne_one (n : ℕ) [n.AtLeastTwo] : (no_index (ofNat n) : R) ≠ 1 
goal: OfNat.ofNat n ≠ 1

full_name: OfNat.one_ne_ofNat
code: @[simp] lemma one_ne_ofNat (n : ℕ) [n.AtLeastTwo] : (1 : R) ≠ no_index (ofNat n) 
goal: 1 ≠ OfNat.ofNat n

full_name: OfNat.ofNat_eq_ofNat
code: @[simp] lemma ofNat_eq_ofNat {m n : ℕ} [m.AtLeastTwo] [n.AtLeastTwo] :
    (no_index (ofNat m) : R) = no_index (ofNat n) ↔ (ofNat m : ℕ) = ofNat n 
goal: OfNat.ofNat m = OfNat.ofNat n ↔ OfNat.ofNat m = OfNat.ofNat n

full_name: NeZero.charZero
code: instance charZero {M} {n : ℕ} [NeZero n] [AddMonoidWithOne M] [CharZero M] : NeZero (n : M) 
goal: NeZero ↑n

full_name: NeZero.charZero_one
code: instance charZero_one {M} [AddMonoidWithOne M] [CharZero M] : NeZero (1 : M) 
goal: NeZero 1

full_name: NeZero.charZero_ofNat
code: instance charZero_ofNat {M} {n : ℕ} [n.AtLeastTwo] [AddMonoidWithOne M] [CharZero M] :
    NeZero (OfNat.ofNat n : M) 
goal: NeZero (OfNat.ofNat n)