File: Mathlib/Algebra/CharP/Defs.lean

full_name: charP_iff
code: /-- The generator of the kernel of the unique homomorphism ℕ → R for a semiring R.

*Warning*: for a semiring `R`, `CharP R 0` and `CharZero R` need not coincide.
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`;
* `CharZero R` requires an injection `ℕ ↪ 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`.
-/
@[mk_iff]
class _root_.CharP : Prop where
  cast_eq_zero_iff' : ∀ x : ℕ, (x : R) = 0 ↔ p ∣ x
goal: CharP R p ↔ ∀ (x : ℕ), ↑x = 0 ↔ p ∣ x

full_name: CharP
code: /-- The generator of the kernel of the unique homomorphism ℕ → R for a semiring R.

*Warning*: for a semiring `R`, `CharP R 0` and `CharZero R` need not coincide.
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`;
* `CharZero R` requires an injection `ℕ ↪ 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`.
-/
@[mk_iff]
class _root_.CharP : Prop where
  cast_eq_zero_iff' : ∀ x : ℕ, (x : R) = 0 ↔ p ∣ x
goal: Prop

full_name: CharP.cast_eq_zero_iff'
code: /-- The generator of the kernel of the unique homomorphism ℕ → R for a semiring R.

*Warning*: for a semiring `R`, `CharP R 0` and `CharZero R` need not coincide.
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`;
* `CharZero R` requires an injection `ℕ ↪ 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`.
-/
@[mk_iff]
class _root_.CharP : Prop where
  cast_eq_zero_iff' : ∀ x : ℕ, (x : R) = 0 ↔ p ∣ x
goal: ↑x = 0 ↔ p ∣ x

full_name: CharP.cast_eq_zero_iff
code: lemma cast_eq_zero_iff (a : ℕ) : (a : R) = 0 ↔ p ∣ a 
goal: ↑a = 0 ↔ p ∣ a

full_name: CharP.congr
code: lemma congr {q : ℕ} (h : p = q) : CharP R q 
goal: CharP R q

full_name: CharP.natCast_eq_natCast'
code: lemma natCast_eq_natCast' (h : a ≡ b [MOD p]) : (a : R) = b 
goal: ↑a = ↑b

full_name: CharP.cast_eq_zero
code: @[simp] lemma cast_eq_zero : (p : R) = 0 
goal: ↑p = 0

full_name: CharP.ofNat_eq_zero
code: lemma ofNat_eq_zero [p.AtLeastTwo] : no_index (OfNat.ofNat p : R) = 0 
goal: OfNat.ofNat p = 0

full_name: CharP.natCast_eq_natCast_mod
code: lemma natCast_eq_natCast_mod (a : ℕ) : (a : R) = a % p 
goal: ↑a = ↑(a % p)

full_name: CharP.eq
code: lemma eq {p q : ℕ} (_hp : CharP R p) (_hq : CharP R q) : p = q 
goal: p = q

full_name: CharP.ofCharZero
code: instance ofCharZero [CharZero R] : CharP R 0 
goal: CharP R 0

full_name: CharP.natCast_eq_natCast
code: lemma natCast_eq_natCast : (a : R) = b ↔ a ≡ b [MOD p] 
goal: ↑a = ↑b ↔ a ≡ b [MOD p]

full_name: CharP.natCast_injOn_Iio
code: lemma natCast_injOn_Iio : (Set.Iio p).InjOn ((↑) : ℕ → R) 
goal: Set.InjOn Nat.cast (Set.Iio p)

full_name: CharP.intCast_eq_zero_iff
code: lemma intCast_eq_zero_iff (a : ℤ) : (a : R) = 0 ↔ (p : ℤ) ∣ a 
goal: ↑a = 0 ↔ ↑p ∣ a

full_name: CharP.intCast_eq_intCast
code: lemma intCast_eq_intCast : (a : R) = b ↔ a ≡ b [ZMOD p] 
goal: ↑a = ↑b ↔ a ≡ b [ZMOD ↑p]

full_name: CharP.intCast_eq_intCast_mod
code: lemma intCast_eq_intCast_mod : (a : R) = a % (p : ℤ) 
goal: ↑a = ↑(a % ↑p)

full_name: CharP.charP_to_charZero
code: lemma charP_to_charZero [CharP R 0] : CharZero R 
goal: CharZero R

full_name: CharP.charP_zero_iff_charZero
code: lemma charP_zero_iff_charZero : CharP R 0 ↔ CharZero R 
goal: CharP R 0 ↔ CharZero R

full_name: CharP.exists
code: lemma «exists» : ∃ p, CharP R p 
goal: ∃ p, CharP R p

full_name: CharP.exists_unique
code: lemma exists_unique : ∃! p, CharP R p 
goal: ∃! p, CharP R p

full_name: ringChar
code: /-- Noncomputable function that outputs the unique characteristic of a semiring. -/
noncomputable def ringChar [NonAssocSemiring R] : ℕ 
goal: ℕ

full_name: ringChar.spec
code: lemma spec : ∀ x : ℕ, (x : R) = 0 ↔ ringChar R ∣ x 
goal: ↑x = 0 ↔ ringChar R ∣ x

full_name: ringChar.eq
code: lemma eq (p : ℕ) [C : CharP R p] : ringChar R = p 
goal: ringChar R = p

full_name: ringChar.charP
code: instance charP : CharP R (ringChar R) 
goal: CharP R (ringChar R)

full_name: ringChar.of_eq
code: lemma of_eq {p : ℕ} (h : ringChar R = p) : CharP R p 
goal: CharP R p

full_name: ringChar.eq_iff
code: lemma eq_iff {p : ℕ} : ringChar R = p ↔ CharP R p 
goal: ringChar R = p ↔ CharP R p

full_name: ringChar.dvd
code: lemma dvd {x : ℕ} (hx : (x : R) = 0) : ringChar R ∣ x 
goal: ringChar R ∣ x

full_name: ringChar.eq_zero
code: @[simp]
lemma eq_zero [CharZero R] : ringChar R = 0 
goal: ringChar R = 0

full_name: ringChar.Nat.cast_ringChar
code: lemma Nat.cast_ringChar : (ringChar R : R) = 0 
goal: ↑(ringChar R) = 0

full_name: CharP.neg_one_ne_one
code: lemma CharP.neg_one_ne_one [Ring R] (p : ℕ) [CharP R p] [Fact (2 < p)] : (-1 : R) ≠ (1 : R) 
goal: -1 ≠ 1

full_name: RingHom.charP_iff_charP
code: lemma RingHom.charP_iff_charP {K L : Type*} [DivisionRing K] [Semiring L] [Nontrivial L]
    (f : K →+* L) (p : ℕ) : CharP K p ↔ CharP L p 
goal: CharP K p ↔ CharP L p

full_name: CharP.cast_eq_mod
code: lemma cast_eq_mod (p : ℕ) [CharP R p] (k : ℕ) : (k : R) = (k % p : ℕ) 
goal: ↑k = ↑(k % p)

full_name: CharP.ringChar_zero_iff_CharZero
code: lemma ringChar_zero_iff_CharZero : ringChar R = 0 ↔ CharZero R 
goal: ringChar R = 0 ↔ CharZero R

full_name: CharP.char_ne_one
code: lemma char_ne_one [Nontrivial R] (p : ℕ) [hc : CharP R p] : p ≠ 1 
goal: p ≠ 1

full_name: CharP.char_is_prime_of_two_le
code: lemma char_is_prime_of_two_le (p : ℕ) [hc : CharP R p] (hp : 2 ≤ p) : Nat.Prime p 
goal: Nat.Prime p

full_name: CharP.char_is_prime_or_zero
code: lemma char_is_prime_or_zero (p : ℕ) [hc : CharP R p] : Nat.Prime p ∨ p = 0 
goal: Nat.Prime p ∨ p = 0

full_name: CharP.exists'
code: lemma exists' (R : Type*) [NonAssocRing R] [NoZeroDivisors R] [Nontrivial R] :
    CharZero R ∨ ∃ p : ℕ, Fact p.Prime ∧ CharP R p 
goal: CharZero R ∨ ∃ p, Fact (Nat.Prime p) ∧ CharP R p

full_name: CharP.char_is_prime_of_pos
code: lemma char_is_prime_of_pos (p : ℕ) [NeZero p] [CharP R p] : Fact p.Prime 
goal: Fact (Nat.Prime p)

full_name: CharP.CharOne.subsingleton
code: lemma CharOne.subsingleton [CharP R 1] : Subsingleton R 
goal: Subsingleton R

full_name: CharP.false_of_nontrivial_of_char_one
code: lemma false_of_nontrivial_of_char_one [Nontrivial R] [CharP R 1] : False 
goal: False

full_name: CharP.ringChar_ne_one
code: lemma ringChar_ne_one [Nontrivial R] : ringChar R ≠ 1 
goal: ringChar R ≠ 1

full_name: CharP.nontrivial_of_char_ne_one
code: lemma nontrivial_of_char_ne_one {v : ℕ} (hv : v ≠ 1) [hr : CharP R v] : Nontrivial R 
goal: Nontrivial R

full_name: CharP.ringChar_of_prime_eq_zero
code: lemma ringChar_of_prime_eq_zero [Nontrivial R] {p : ℕ} (hprime : Nat.Prime p)
    (hp0 : (p : R) = 0) : ringChar R = p 
goal: ringChar R = p

full_name: CharP.charP_iff_prime_eq_zero
code: lemma charP_iff_prime_eq_zero [Nontrivial R] {p : ℕ} (hp : p.Prime) :
    CharP R p ↔ (p : R) = 0 
goal: CharP R p ↔ ↑p = 0

full_name: Ring.two_ne_zero
code: /-- We have `2 ≠ 0` in a nontrivial ring whose characteristic is not `2`. -/
protected lemma Ring.two_ne_zero {R : Type*} [NonAssocSemiring R] [Nontrivial R]
    (hR : ringChar R ≠ 2) : (2 : R) ≠ 0 
goal: 2 ≠ 0

full_name: Ring.neg_one_ne_one_of_char_ne_two
code: /-- Characteristic `≠ 2` and nontrivial implies that `-1 ≠ 1`. -/
lemma Ring.neg_one_ne_one_of_char_ne_two {R : Type*} [NonAssocRing R] [Nontrivial R]
    (hR : ringChar R ≠ 2) : (-1 : R) ≠ 1 
goal: -1 ≠ 1

full_name: Ring.eq_self_iff_eq_zero_of_char_ne_two
code: /-- Characteristic `≠ 2` in a domain implies that `-a = a` iff `a = 0`. -/
lemma Ring.eq_self_iff_eq_zero_of_char_ne_two {R : Type*} [NonAssocRing R] [Nontrivial R]
    [NoZeroDivisors R] (hR : ringChar R ≠ 2) {a : R} : -a = a ↔ a = 0 
goal: -a = a ↔ a = 0

full_name: Nat.lcm.charP
code: /-- The characteristic of the product of rings is the least common multiple of the
characteristics of the two rings. -/
instance Nat.lcm.charP [CharP S q] : CharP (R × S) (Nat.lcm p q) 
goal: CharP (R × S) (p.lcm q)

full_name: Prod.charP
code: /-- The characteristic of the product of two rings of the same characteristic
  is the same as the characteristic of the rings -/
instance Prod.charP [CharP S p] : CharP (R × S) p 
goal: CharP (R × S) p

full_name: Prod.charZero_of_left
code: instance Prod.charZero_of_left [CharZero R] : CharZero (R × S) 
goal: CharZero (R × S)

full_name: Prod.charZero_of_right
code: instance Prod.charZero_of_right [CharZero S] : CharZero (R × S) 
goal: CharZero (R × S)

full_name: ULift.charP
code: instance ULift.charP [AddMonoidWithOne R] (p : ℕ) [CharP R p] : CharP (ULift R) p 
goal: CharP (ULift.{u_2, u_1} R) p

full_name: MulOpposite.charP
code: instance MulOpposite.charP [AddMonoidWithOne R] (p : ℕ) [CharP R p] : CharP Rᵐᵒᵖ p 
goal: CharP Rᵐᵒᵖ p

full_name: Int.cast_injOn_of_ringChar_ne_two
code: /-- If two integers from `{0, 1, -1}` result in equal elements in a ring `R`
that is nontrivial and of characteristic not `2`, then they are equal. -/
lemma Int.cast_injOn_of_ringChar_ne_two {R : Type*} [NonAssocRing R] [Nontrivial R]
    (hR : ringChar R ≠ 2) : ({0, 1, -1} : Set ℤ).InjOn ((↑) : ℤ → R) 
goal: Set.InjOn Int.cast {0, 1, -1}

full_name: NeZero.of_not_dvd
code: lemma of_not_dvd [CharP R p] (h : ¬p ∣ n) : NeZero (n : R) 
goal: NeZero ↑n

full_name: NeZero.not_char_dvd
code: lemma not_char_dvd (p : ℕ) [CharP R p] (k : ℕ) [h : NeZero (k : R)] : ¬p ∣ k 
goal: ¬p ∣ k

full_name: CharZero.charZero_iff_forall_prime_ne_zero
code: lemma charZero_iff_forall_prime_ne_zero [NonAssocRing R] [NoZeroDivisors R] [Nontrivial R] :
    CharZero R ↔ ∀ p : ℕ, p.Prime → (p : R) ≠ 0 
goal: CharZero R ↔ ∀ (p : ℕ), Nat.Prime p → ↑p ≠ 0

full_name: Fin.charP
code: instance charP (n : ℕ) : CharP (Fin (n + 1)) (n + 1) 
goal: CharP (Fin (n + 1)) (n + 1)