Properties and homomorphisms of semirings and rings #
This file proves simple properties of semirings, rings and domains and their unit groups. It also
defines bundled homomorphisms of semirings and rings. As with monoid and groups, we use the same
structure ring_hom a β
, a.k.a. α →+* β
, for both homomorphism types.
The unbundled homomorphisms are defined in deprecated/ring
. They are deprecated and the plan is to
slowly remove them from mathlib.
Main definitions #
ring_hom, nonzero, domain, is_domain
Notations #
→+* for bundled ring homs (also use for semiring homs)
Implementation notes #
-
There's a coercion from bundled homs to fun, and the canonical notation is to use the bundled hom as a function via this coercion.
-
There is no
semiring_hom
-- the idea is thatring_hom
is used. The constructor for aring_hom
between semirings needs a proof ofmap_zero
,map_one
andmap_add
as well asmap_mul
; a separate constructorring_hom.mk'
will construct ring homs between rings from monoid homs given only a proof that addition is preserved.
Tags #
ring_hom
, semiring_hom
, semiring
, comm_semiring
, ring
, comm_ring
, domain
,
is_domain
, nonzero
, units
Pullback a distrib
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.distrib f hf add mul = {mul := has_mul.mul _inst_1, add := has_add.add _inst_2, left_distrib := _, right_distrib := _}
Pushforward a distrib
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.distrib f hf add mul = {mul := has_mul.mul _inst_3, add := has_add.add _inst_2, left_distrib := _, right_distrib := _}
Semirings #
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), non_unital_non_assoc_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_unital_non_assoc_semiring.nsmul n.succ x = x + non_unital_non_assoc_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
A not-necessarily-unital, not-necessarily-associative semiring.
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), non_unital_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_unital_semiring.nsmul n.succ x = x + non_unital_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
An associative but not-necessarily unital semiring.
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), non_assoc_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_assoc_semiring.nsmul n.succ x = x + non_assoc_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
A unital but not-necessarily-associative semiring.
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), semiring.nsmul n.succ x = x + semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), semiring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), semiring.npow n.succ x = x * semiring.npow n x) . "try_refl_tac"
A semiring is a type with the following structures: additive commutative monoid
(add_comm_monoid
), multiplicative monoid (monoid
), distributive laws (distrib
), and
multiplication by zero law (mul_zero_class
). The actual definition extends monoid_with_zero
instead of monoid
and mul_zero_class
.
Pullback a non_unital_non_assoc_semiring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.non_unital_non_assoc_semiring f hf zero add mul = {add := add_comm_monoid.add (function.injective.add_comm_monoid f hf zero add), add_assoc := _, zero := mul_zero_class.zero (function.injective.mul_zero_class f hf zero mul), zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul (function.injective.add_comm_monoid f hf zero add), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := mul_zero_class.mul (function.injective.mul_zero_class f hf zero mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _}
Pullback a non_unital_semiring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.non_unital_semiring f hf zero add mul = {add := non_unital_non_assoc_semiring.add (function.injective.non_unital_non_assoc_semiring f hf zero add mul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.injective.non_unital_non_assoc_semiring f hf zero add mul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.injective.non_unital_non_assoc_semiring f hf zero add mul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_non_assoc_semiring.mul (function.injective.non_unital_non_assoc_semiring f hf zero add mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _}
Pullback a non_assoc_semiring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.non_assoc_semiring f hf zero one add mul = {add := non_unital_non_assoc_semiring.add (function.injective.non_unital_non_assoc_semiring f hf zero add mul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.injective.non_unital_non_assoc_semiring f hf zero add mul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.injective.non_unital_non_assoc_semiring f hf zero add mul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_non_assoc_semiring.mul (function.injective.non_unital_non_assoc_semiring f hf zero add mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, one := mul_one_class.one (function.injective.mul_one_class f hf one mul), one_mul := _, mul_one := _}
Pullback a semiring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.semiring f hf zero one add mul = {add := add_comm_monoid.add (function.injective.add_comm_monoid f hf zero add), add_assoc := _, zero := monoid_with_zero.zero (function.injective.monoid_with_zero f hf zero one mul), zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul (function.injective.add_comm_monoid f hf zero add), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := monoid_with_zero.mul (function.injective.monoid_with_zero f hf zero one mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := monoid_with_zero.one (function.injective.monoid_with_zero f hf zero one mul), one_mul := _, mul_one := _, npow := monoid_with_zero.npow (function.injective.monoid_with_zero f hf zero one mul), npow_zero' := _, npow_succ' := _}
Pushforward a non_unital_non_assoc_semiring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.non_unital_non_assoc_semiring f hf zero add mul = {add := add_comm_monoid.add (function.surjective.add_comm_monoid f hf zero add), add_assoc := _, zero := mul_zero_class.zero (function.surjective.mul_zero_class f hf zero mul), zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul (function.surjective.add_comm_monoid f hf zero add), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := mul_zero_class.mul (function.surjective.mul_zero_class f hf zero mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _}
Pushforward a non_unital_semiring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.non_unital_semiring f hf zero add mul = {add := non_unital_non_assoc_semiring.add (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_non_assoc_semiring.mul (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _}
Pushforward a non_assoc_semiring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.non_assoc_semiring f hf zero one add mul = {add := non_unital_non_assoc_semiring.add (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_non_assoc_semiring.mul (function.surjective.non_unital_non_assoc_semiring f hf zero add mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, one := mul_one_class.one (function.surjective.mul_one_class f hf one mul), one_mul := _, mul_one := _}
Pushforward a semiring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.semiring f hf zero one add mul = {add := add_comm_monoid.add (function.surjective.add_comm_monoid f hf zero add), add_assoc := _, zero := monoid_with_zero.zero (function.surjective.monoid_with_zero f hf zero one mul), zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul (function.surjective.add_comm_monoid f hf zero add), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := monoid_with_zero.mul (function.surjective.monoid_with_zero f hf zero one mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := monoid_with_zero.one (function.surjective.monoid_with_zero f hf zero one mul), one_mul := _, mul_one := _, npow := monoid_with_zero.npow (function.surjective.monoid_with_zero f hf zero one mul), npow_zero' := _, npow_succ' := _}
Left multiplication by an element of a type with distributive multiplication is an add_hom
.
Equations
- add_hom.mul_left r = {to_fun := has_mul.mul r, map_add' := _}
Left multiplication by an element of a (semi)ring is an add_monoid_hom
Equations
- add_monoid_hom.mul_left r = {to_fun := has_mul.mul r, map_zero' := _, map_add' := _}
Right multiplication by an element of a (semi)ring is an add_monoid_hom
Reinterpret a ring homomorphism f : R →+* S
as an additive monoid homomorphism R →+ S
.
The simp
-normal form is (f : R →+ S)
.
Reinterpret a ring homomorphism f : R →+* S
as a monoid homomorphism R →* S
.
The simp
-normal form is (f : R →* S)
.
- to_fun : α → β
- map_one' : self.to_fun 1 = 1
- map_mul' : ∀ (x y : α), self.to_fun (x * y) = (self.to_fun x) * self.to_fun y
- map_zero' : self.to_fun 0 = 0
- map_add' : ∀ (x y : α), self.to_fun (x + y) = self.to_fun x + self.to_fun y
Bundled semiring homomorphisms; use this for bundled ring homomorphisms too.
This extends from both monoid_hom
and monoid_with_zero_hom
in order to put the fields in a
sensible order, even though monoid_with_zero_hom
already extends monoid_hom
.
Reinterpret a ring homomorphism f : R →+* S
as a monoid_with_zero_hom R S
.
The simp
-normal form is (f : monoid_with_zero_hom R S)
.
- coe : F → Π (a : R), (λ (_x : R), S) a
- coe_injective' : function.injective ring_hom_class.coe
- map_mul : ∀ (f : F) (x y : R), ⇑f (x * y) = (⇑f x) * ⇑f y
- map_one : ∀ (f : F), ⇑f 1 = 1
- map_add : ∀ (f : F) (x y : R), ⇑f (x + y) = ⇑f x + ⇑f y
- map_zero : ∀ (f : F), ⇑f 0 = 0
ring_hom_class F R S
states that F
is a type of (semi)ring homomorphisms.
You should extend this class when you extend ring_hom
.
This extends from both monoid_hom_class
and monoid_with_zero_hom_class
in
order to put the fields in a sensible order, even though
monoid_with_zero_hom_class
already extends monoid_hom_class
.
Ring homomorphisms preserve bit0
.
Ring homomorphisms preserve bit1
.
Throughout this section, some semiring
arguments are specified with {}
instead of []
.
See note [implicit instance arguments].
Equations
- ring_hom.ring_hom_class = {coe := ring_hom.to_fun rβ, coe_injective' := _, map_mul := _, map_one := _, map_add := _, map_zero := _}
Helper instance for when there's too many metavariables to apply to_fun.to_coe_fn
directly.
Equations
Equations
Equations
Ring homomorphisms map zero to zero.
Ring homomorphisms map one to one.
Ring homomorphisms preserve addition.
Ring homomorphisms preserve multiplication.
Ring homomorphisms preserve bit0
.
Ring homomorphisms preserve bit1
.
f : R →+* S
has a trivial codomain iff f 1 = 0
.
f : R →+* S
has a trivial codomain iff it has a trivial range.
f : R →+* S
has a trivial codomain iff its range is {0}
.
f : R →+* S
doesn't map 1
to 0
if S
is nontrivial
If there is a homomorphism f : R →+* S
and S
is nontrivial, then R
is nontrivial.
The identity ring homomorphism from a semiring to itself.
Equations
- ring_hom.inhabited = {default := ring_hom.id α rα}
Composition of ring homomorphisms is a ring homomorphism.
Composition of semiring homomorphisms is associative.
Equations
- ring_hom.monoid = {mul := ring_hom.comp rα, mul_assoc := _, one := ring_hom.id α rα, one_mul := _, mul_one := _, npow := npow_rec (mul_one_class.to_has_mul (α →+* α)), npow_zero' := _, npow_succ' := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), comm_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), comm_semiring.nsmul n.succ x = x + comm_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), comm_semiring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), comm_semiring.npow n.succ x = x * comm_semiring.npow n x) . "try_refl_tac"
- mul_comm : ∀ (a b : α), a * b = b * a
A commutative semiring is a semiring
with commutative multiplication. In other words, it is a
type with the following structures: additive commutative monoid (add_comm_monoid
), multiplicative
commutative monoid (comm_monoid
), distributive laws (distrib
), and multiplication by zero law
(mul_zero_class
).
Instances
- comm_ring.to_comm_semiring
- ordered_comm_semiring.to_comm_semiring
- canonically_ordered_comm_semiring.to_comm_semiring
- with_top.comm_semiring
- with_bot.comm_semiring
- nat.comm_semiring
- mul_opposite.comm_semiring
- int.comm_semiring
- rat.comm_semiring
- set.set_semiring.comm_semiring
- real.comm_semiring
- pi.comm_semiring
- prod.comm_semiring
- subsemiring.to_comm_semiring
- subsemiring.center.comm_semiring
Equations
- comm_semiring.to_comm_monoid_with_zero = {mul := comm_monoid.mul (comm_semiring.to_comm_monoid α), mul_assoc := _, one := comm_monoid.one (comm_semiring.to_comm_monoid α), one_mul := _, mul_one := _, npow := comm_monoid.npow (comm_semiring.to_comm_monoid α), npow_zero' := _, npow_succ' := _, mul_comm := _, zero := semiring.zero (comm_semiring.to_semiring α), zero_mul := _, mul_zero := _}
Pullback a semiring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.comm_semiring f hf zero one add mul = {add := semiring.add (function.injective.semiring f hf zero one add mul), add_assoc := _, zero := semiring.zero (function.injective.semiring f hf zero one add mul), zero_add := _, add_zero := _, nsmul := semiring.nsmul (function.injective.semiring f hf zero one add mul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := semiring.mul (function.injective.semiring f hf zero one add mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := semiring.one (function.injective.semiring f hf zero one add mul), one_mul := _, mul_one := _, npow := semiring.npow (function.injective.semiring f hf zero one add mul), npow_zero' := _, npow_succ' := _, mul_comm := _}
Pushforward a semiring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.comm_semiring f hf zero one add mul = {add := semiring.add (function.surjective.semiring f hf zero one add mul), add_assoc := _, zero := semiring.zero (function.surjective.semiring f hf zero one add mul), zero_add := _, add_zero := _, nsmul := semiring.nsmul (function.surjective.semiring f hf zero one add mul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := semiring.mul (function.surjective.semiring f hf zero one add mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := semiring.one (function.surjective.semiring f hf zero one add mul), one_mul := _, mul_one := _, npow := semiring.npow (function.surjective.semiring f hf zero one add mul), npow_zero' := _, npow_succ' := _, mul_comm := _}
Rings #
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), ring.nsmul n.succ x = x + ring.nsmul n x) . "try_refl_tac"
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : (∀ (a b : α), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → α → α
- zsmul_zero' : (∀ (a : α), ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), ring.zsmul (int.of_nat n.succ) a = a + ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), ring.zsmul -[1+ n] a = -ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), ring.npow n.succ x = x * ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
A ring is a type with the following structures: additive commutative group (add_comm_group
),
multiplicative monoid (monoid
), and distributive laws (distrib
). Equivalently, a ring is a
semiring
with a negation operation making it an additive group.
Equations
- ring.to_semiring = {add := ring.add _inst_1, add_assoc := _, zero := ring.zero _inst_1, zero_add := _, add_zero := _, nsmul := ring.nsmul _inst_1, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := ring.mul _inst_1, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := ring.one _inst_1, one_mul := _, mul_one := _, npow := ring.npow _inst_1, npow_zero' := _, npow_succ' := _}
Pullback a ring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.ring f hf zero one add mul neg sub = {add := add_comm_group.add (function.injective.add_comm_group f hf zero add neg sub), add_assoc := _, zero := add_comm_group.zero (function.injective.add_comm_group f hf zero add neg sub), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.injective.add_comm_group f hf zero add neg sub), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.injective.add_comm_group f hf zero add neg sub), sub := add_comm_group.sub (function.injective.add_comm_group f hf zero add neg sub), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.injective.add_comm_group f hf zero add neg sub), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := monoid.mul (function.injective.monoid f hf one mul), mul_assoc := _, one := monoid.one (function.injective.monoid f hf one mul), one_mul := _, mul_one := _, npow := monoid.npow (function.injective.monoid f hf one mul), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
Pushforward a ring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.ring f hf zero one add mul neg sub = {add := add_comm_group.add (function.surjective.add_comm_group f hf zero add neg sub), add_assoc := _, zero := add_comm_group.zero (function.surjective.add_comm_group f hf zero add neg sub), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.surjective.add_comm_group f hf zero add neg sub), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.surjective.add_comm_group f hf zero add neg sub), sub := add_comm_group.sub (function.surjective.add_comm_group f hf zero add neg sub), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.surjective.add_comm_group f hf zero add neg sub), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := monoid.mul (function.surjective.monoid f hf one mul), mul_assoc := _, one := monoid.one (function.surjective.monoid f hf one mul), one_mul := _, mul_one := _, npow := monoid.npow (function.surjective.monoid f hf one mul), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
A ring homomorphism is injective iff its kernel is trivial.
A ring homomorphism is injective iff its kernel is trivial.
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), comm_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), comm_ring.nsmul n.succ x = x + comm_ring.nsmul n x) . "try_refl_tac"
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : (∀ (a b : α), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → α → α
- zsmul_zero' : (∀ (a : α), comm_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), comm_ring.zsmul (int.of_nat n.succ) a = a + comm_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), comm_ring.zsmul -[1+ n] a = -comm_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), comm_ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), comm_ring.npow n.succ x = x * comm_ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- mul_comm : ∀ (a b : α), a * b = b * a
A commutative ring is a ring
with commutative multiplication.
Instances
- ordered_comm_ring.to_comm_ring
- field.to_comm_ring
- euclidean_domain.to_comm_ring
- mul_opposite.comm_ring
- int.comm_ring
- rat.comm_ring
- cau_seq.comm_ring
- cau_seq.completion.Cauchy.comm_ring
- real.comm_ring
- myint.comm_ring
- pi.comm_ring
- prod.comm_ring
- subring.to_comm_ring
- subring.center.comm_ring
- punit.comm_ring
Equations
- comm_ring.to_comm_semiring = {add := comm_ring.add s, add_assoc := _, zero := comm_ring.zero s, zero_add := _, add_zero := _, nsmul := comm_ring.nsmul s, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := comm_ring.mul s, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_ring.one s, one_mul := _, mul_one := _, npow := comm_ring.npow s, npow_zero' := _, npow_succ' := _, mul_comm := _}
Pullback a comm_ring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.comm_ring f hf zero one add mul neg sub = {add := ring.add (function.injective.ring f hf zero one add mul neg sub), add_assoc := _, zero := ring.zero (function.injective.ring f hf zero one add mul neg sub), zero_add := _, add_zero := _, nsmul := ring.nsmul (function.injective.ring f hf zero one add mul neg sub), nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (function.injective.ring f hf zero one add mul neg sub), sub := ring.sub (function.injective.ring f hf zero one add mul neg sub), sub_eq_add_neg := _, zsmul := ring.zsmul (function.injective.ring f hf zero one add mul neg sub), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul (function.injective.ring f hf zero one add mul neg sub), mul_assoc := _, one := ring.one (function.injective.ring f hf zero one add mul neg sub), one_mul := _, mul_one := _, npow := ring.npow (function.injective.ring f hf zero one add mul neg sub), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
Pushforward a comm_ring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.comm_ring f hf zero one add mul neg sub = {add := ring.add (function.surjective.ring f hf zero one add mul neg sub), add_assoc := _, zero := ring.zero (function.surjective.ring f hf zero one add mul neg sub), zero_add := _, add_zero := _, nsmul := ring.nsmul (function.surjective.ring f hf zero one add mul neg sub), nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (function.surjective.ring f hf zero one add mul neg sub), sub := ring.sub (function.surjective.ring f hf zero one add mul neg sub), sub_eq_add_neg := _, zsmul := ring.zsmul (function.surjective.ring f hf zero one add mul neg sub), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul (function.surjective.ring f hf zero one add mul neg sub), mul_assoc := _, one := ring.one (function.surjective.ring f hf zero one add mul neg sub), one_mul := _, mul_one := _, npow := ring.npow (function.surjective.ring f hf zero one add mul neg sub), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, mul_comm := _}
Vieta's formula for a quadratic equation, relating the coefficients of the polynomial with
its roots. This particular version states that if we have a root x
of a monic quadratic
polynomial, then there is another root y
such that x + y
is negative the a_1
coefficient
and x * y
is the a_0
coefficient.
Left mul
by a k : α
over [ring α]
is injective, if k
is not a zero divisor.
The typeclass that restricts all terms of α
to have this property is no_zero_divisors
.
Right mul
by a k : α
over [ring α]
is injective, if k
is not a zero divisor.
The typeclass that restricts all terms of α
to have this property is no_zero_divisors
.
- eq_zero_or_eq_zero_of_mul_eq_zero : ∀ {a b : α}, a * b = 0 → a = 0 ∨ b = 0
- exists_pair_ne : ∃ (x y : α), x ≠ y
A domain is a nontrivial ring with no zero divisors, i.e. satisfying
the condition a * b = 0 ↔ a = 0 ∨ b = 0
.
This is implemented as a mixin for ring α
.
To obtain an integral domain use [comm_ring α] [is_domain α]
.
Equations
- is_domain.to_cancel_monoid_with_zero = {mul := semiring.mul infer_instance, mul_assoc := _, one := semiring.one infer_instance, one_mul := _, mul_one := _, npow := semiring.npow infer_instance, npow_zero' := _, npow_succ' := _, zero := semiring.zero infer_instance, zero_mul := _, mul_zero := _, mul_left_cancel_of_ne_zero := _, mul_right_cancel_of_ne_zero := _}
Pullback an is_domain
instance along an injective function.
Equations
- is_domain.to_cancel_comm_monoid_with_zero = {mul := comm_monoid_with_zero.mul comm_semiring.to_comm_monoid_with_zero, mul_assoc := _, one := comm_monoid_with_zero.one comm_semiring.to_comm_monoid_with_zero, one_mul := _, mul_one := _, npow := comm_monoid_with_zero.npow comm_semiring.to_comm_monoid_with_zero, npow_zero' := _, npow_succ' := _, mul_comm := _, zero := comm_monoid_with_zero.zero comm_semiring.to_comm_monoid_with_zero, zero_mul := _, mul_zero := _, mul_left_cancel_of_ne_zero := _, mul_right_cancel_of_ne_zero := _}
Makes a ring homomorphism from an additive group homomorphism from a commutative ring to an integral domain that commutes with self multiplication, assumes that two is nonzero and one is sent to one.