Characteristic of semirings #

theorem charP_iff (R : Type u_1) [] (p : ) :
CharP R p ∀ (x : ), x = 0 p x
class CharP (R : Type u_1) [] (p : ) :

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.

• cast_eq_zero_iff' : ∀ (x : ), x = 0 p x
Instances
theorem CharP.cast_eq_zero_iff' {R : Type u_1} [] {p : } [self : CharP R p] (x : ) :
x = 0 p x
theorem CharP.cast_eq_zero_iff (R : Type u_1) [] (p : ) [CharP R p] (a : ) :
a = 0 p a
theorem CharP.congr {R : Type u_1} [] (p : ) [CharP R p] {q : } (h : p = q) :
CharP R q
theorem CharP.natCast_eq_natCast' (R : Type u_1) [] (p : ) [CharP R p] {a : } {b : } (h : a b [MOD p]) :
a = b
@[simp]
theorem CharP.cast_eq_zero (R : Type u_1) [] (p : ) [CharP R p] :
p = 0
theorem CharP.ofNat_eq_zero (R : Type u_1) [] (p : ) [CharP R p] [p.AtLeastTwo] :
= 0
theorem CharP.natCast_eq_natCast_mod (R : Type u_1) [] (p : ) [CharP R p] (a : ) :
a = (a % p)
theorem CharP.eq (R : Type u_1) [] {p : } {q : } (_hp : CharP R p) (_hq : CharP R q) :
p = q
instance CharP.ofCharZero (R : Type u_1) [] [] :
CharP R 0
Equations
• =
theorem CharP.natCast_eq_natCast (R : Type u_1) [] (p : ) [CharP R p] {a : } {b : } [] :
a = b a b [MOD p]
theorem CharP.natCast_injOn_Iio (R : Type u_1) [] (p : ) [CharP R p] [] :
Set.InjOn Nat.cast (Set.Iio p)
theorem CharP.intCast_eq_zero_iff (R : Type u_1) [] (p : ) [CharP R p] (a : ) :
a = 0 p a
theorem CharP.intCast_eq_intCast (R : Type u_1) [] (p : ) [CharP R p] {a : } {b : } :
a = b a b [ZMOD p]
theorem CharP.intCast_eq_intCast_mod (R : Type u_1) [] (p : ) [CharP R p] {a : } :
a = (a % p)
theorem CharP.charP_to_charZero (R : Type u_1) [] [CharP R 0] :
theorem CharP.exists (R : Type u_1) [] :
∃ (p : ), CharP R p
theorem CharP.exists_unique (R : Type u_1) [] :
∃! p : , CharP R p
noncomputable def ringChar (R : Type u_1) [] :

Noncomputable function that outputs the unique characteristic of a semiring.

Equations
Instances For
theorem ringChar.spec (R : Type u_1) [] (x : ) :
x = 0 x
theorem ringChar.eq (R : Type u_1) [] (p : ) [C : CharP R p] :
= p
instance ringChar.charP (R : Type u_1) [] :
Equations
• =
theorem ringChar.of_eq {R : Type u_1} [] {p : } (h : = p) :
CharP R p
theorem ringChar.eq_iff {R : Type u_1} [] {p : } :
= p CharP R p
theorem ringChar.dvd {R : Type u_1} [] {x : } (hx : x = 0) :
x
@[simp]
theorem ringChar.eq_zero {R : Type u_1} [] [] :
= 0
theorem ringChar.Nat.cast_ringChar {R : Type u_1} [] :
(ringChar R) = 0
theorem CharP.neg_one_ne_one (R : Type u_1) [Ring R] (p : ) [CharP R p] [Fact (2 < p)] :
-1 1
theorem RingHom.charP_iff_charP {K : Type u_2} {L : Type u_3} [] [] [] (f : K →+* L) (p : ) :
CharP K p CharP L p
theorem CharP.cast_eq_mod (R : Type u_1) [] (p : ) [CharP R p] (k : ) :
k = (k % p)
theorem CharP.char_ne_one (R : Type u_1) [] [] (p : ) [hc : CharP R p] :
p 1
theorem CharP.char_is_prime_of_two_le (R : Type u_1) [] [] (p : ) [hc : CharP R p] (hp : 2 p) :
theorem CharP.char_is_prime_or_zero (R : Type u_1) [] [] [] (p : ) [hc : CharP R p] :
p = 0
theorem CharP.exists' (R : Type u_2) [] [] [] :
∃ (p : ), Fact (Nat.Prime p) CharP R p
theorem CharP.char_is_prime_of_pos (R : Type u_1) [] [] [] (p : ) [] [CharP R p] :
theorem CharP.CharOne.subsingleton {R : Type u_1} [] [CharP R 1] :
theorem CharP.ringChar_ne_one {R : Type u_1} [] [] :
1
theorem CharP.nontrivial_of_char_ne_one {R : Type u_1} [] {v : } (hv : v 1) [hr : CharP R v] :
theorem CharP.ringChar_of_prime_eq_zero {R : Type u_1} [] [] {p : } (hprime : ) (hp0 : p = 0) :
= p
theorem CharP.charP_iff_prime_eq_zero {R : Type u_1} [] [] {p : } (hp : ) :
CharP R p p = 0
theorem Ring.two_ne_zero {R : Type u_2} [] [] (hR : 2) :
2 0

We have 2 ≠ 0 in a nontrivial ring whose characteristic is not 2.

theorem Ring.neg_one_ne_one_of_char_ne_two {R : Type u_2} [] [] (hR : 2) :
-1 1

Characteristic ≠ 2 and nontrivial implies that -1 ≠ 1.

theorem Ring.eq_self_iff_eq_zero_of_char_ne_two {R : Type u_2} [] [] [] (hR : 2) {a : R} :
-a = a a = 0

Characteristic ≠ 2 in a domain implies that -a = a iff a = 0.

instance Nat.lcm.charP (R : Type u_1) (S : Type u_2) [] [] (p : ) (q : ) [CharP R p] [CharP S q] :
CharP (R × S) (p.lcm q)

The characteristic of the product of rings is the least common multiple of the characteristics of the two rings.

Equations
• =
instance Prod.charP (R : Type u_1) (S : Type u_2) [] [] (p : ) [CharP R p] [CharP S p] :
CharP (R × S) p

The characteristic of the product of two rings of the same characteristic is the same as the characteristic of the rings

Equations
• =
instance Prod.charZero_of_left (R : Type u_1) (S : Type u_2) [] [] [] :
CharZero (R × S)
Equations
• =
instance Prod.charZero_of_right (R : Type u_1) (S : Type u_2) [] [] [] :
CharZero (R × S)
Equations
• =
instance ULift.charP (R : Type u_1) [] (p : ) [CharP R p] :
Equations
• =
instance MulOpposite.charP (R : Type u_1) [] (p : ) [CharP R p] :
Equations
• =
theorem Int.cast_injOn_of_ringChar_ne_two {R : Type u_2} [] [] (hR : 2) :
Set.InjOn Int.cast {0, 1, -1}

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.

theorem NeZero.of_not_dvd (R : Type u_1) [] {n : } {p : } [CharP R p] (h : ¬p n) :
NeZero n
theorem NeZero.not_char_dvd (R : Type u_1) [] (p : ) [CharP R p] (k : ) [h : NeZero k] :
¬p k
theorem CharZero.charZero_iff_forall_prime_ne_zero (R : Type u_1) [] [] [] :
∀ (p : ), p 0
instance Fin.charP (n : ) :
CharP (Fin (n + 1)) (n + 1)
Equations
• =