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. -
To avoid repeating lemmas for
units
, this introduces ahas_distrib_neg
typeclass which bothR
andunits R
satisfy.
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.
Instances
- non_unital_semiring.to_non_unital_non_assoc_semiring
- non_assoc_semiring.to_non_unital_non_assoc_semiring
- non_unital_non_assoc_ring.to_non_unital_non_assoc_semiring
- order_dual.non_unital_non_assoc_semiring
- mul_opposite.non_unital_non_assoc_semiring
- add_opposite.non_unital_non_assoc_semiring
- set.set_semiring.non_unital_non_assoc_semiring
- prod.non_unital_non_assoc_semiring
- pi.non_unital_non_assoc_semiring
- monoid_algebra.non_unital_non_assoc_semiring
- add_monoid_algebra.non_unital_non_assoc_semiring
- matrix.non_unital_non_assoc_semiring
- hahn_series.non_unital_non_assoc_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.
Instances
- semiring.to_non_unital_semiring
- non_unital_ring.to_non_unital_semiring
- order_dual.non_unital_semiring
- mul_opposite.non_unital_semiring
- add_opposite.non_unital_semiring
- set.set_semiring.non_unital_semiring
- prod.non_unital_semiring
- pi.non_unital_semiring
- monoid_algebra.non_unital_semiring
- add_monoid_algebra.non_unital_semiring
- matrix.non_unital_semiring
- hahn_series.non_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.
Instances
- subsemiring_class.to_non_assoc_semiring
- semiring.to_non_assoc_semiring
- non_assoc_ring.to_non_assoc_semiring
- order_dual.non_assoc_semiring
- mul_opposite.non_assoc_semiring
- add_opposite.non_assoc_semiring
- set.set_semiring.non_assoc_semiring
- prod.non_assoc_semiring
- subsemiring.to_non_assoc_semiring
- pi.non_assoc_semiring
- monoid_algebra.non_assoc_semiring
- add_monoid_algebra.non_assoc_semiring
- matrix.non_assoc_semiring
- hahn_series.non_assoc_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
.
Instances
- subsemiring_class.to_semiring
- comm_semiring.to_semiring
- ordered_semiring.to_semiring
- ring.to_semiring
- with_zero.semiring
- order_dual.semiring
- nat.semiring
- add_monoid.End.semiring
- mul_opposite.semiring
- add_opposite.semiring
- int.semiring
- rat.semiring
- set.set_semiring.semiring
- prod.semiring
- subsemiring.to_semiring
- pi.semiring
- module.End.semiring
- submodule.semiring
- subalgebra.to_semiring
- monoid_algebra.semiring
- add_monoid_algebra.semiring
- polynomial.semiring
- restrict_scalars.semiring
- matrix.semiring
- SemiRing.semiring
- real.semiring
- mv_power_series.semiring
- power_series.semiring
- hahn_series.semiring
- algebra.tensor_product.tensor_product.semiring
- zsqrtd.semiring
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 nsmul = {add := add_comm_monoid.add (function.injective.add_comm_monoid f hf zero add nsmul), 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), 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 nsmul = {add := non_unital_non_assoc_semiring.add (function.injective.non_unital_non_assoc_semiring f hf zero add mul nsmul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.injective.non_unital_non_assoc_semiring f hf zero add mul nsmul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.injective.non_unital_non_assoc_semiring f hf zero add mul nsmul), 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 nsmul), 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 nsmul = {add := non_unital_non_assoc_semiring.add (function.injective.non_unital_non_assoc_semiring f hf zero add mul nsmul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.injective.non_unital_non_assoc_semiring f hf zero add mul nsmul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.injective.non_unital_non_assoc_semiring f hf zero add mul nsmul), 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 nsmul), 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 nsmul npow = {add := add_comm_monoid.add (function.injective.add_comm_monoid f hf zero add nsmul), add_assoc := _, zero := monoid_with_zero.zero (function.injective.monoid_with_zero f hf zero one mul npow), zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul (function.injective.add_comm_monoid f hf zero add nsmul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := monoid_with_zero.mul (function.injective.monoid_with_zero f hf zero one mul npow), 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 npow), one_mul := _, mul_one := _, npow := monoid_with_zero.npow (function.injective.monoid_with_zero f hf zero one mul npow), 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 nsmul = {add := add_comm_monoid.add (function.surjective.add_comm_monoid f hf zero add nsmul), 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), 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 nsmul = {add := non_unital_non_assoc_semiring.add (function.surjective.non_unital_non_assoc_semiring f hf zero add mul nsmul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.surjective.non_unital_non_assoc_semiring f hf zero add mul nsmul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.surjective.non_unital_non_assoc_semiring f hf zero add mul nsmul), 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 nsmul), 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 nsmul = {add := non_unital_non_assoc_semiring.add (function.surjective.non_unital_non_assoc_semiring f hf zero add mul nsmul), add_assoc := _, zero := non_unital_non_assoc_semiring.zero (function.surjective.non_unital_non_assoc_semiring f hf zero add mul nsmul), zero_add := _, add_zero := _, nsmul := non_unital_non_assoc_semiring.nsmul (function.surjective.non_unital_non_assoc_semiring f hf zero add mul nsmul), 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 nsmul), 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 nsmul npow = {add := add_comm_monoid.add (function.surjective.add_comm_monoid f hf zero add nsmul), add_assoc := _, zero := monoid_with_zero.zero (function.surjective.monoid_with_zero f hf zero one mul npow), zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul (function.surjective.add_comm_monoid f hf zero add nsmul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := monoid_with_zero.mul (function.surjective.monoid_with_zero f hf zero one mul npow), 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 npow), one_mul := _, mul_one := _, npow := monoid_with_zero.npow (function.surjective.monoid_with_zero f hf zero one mul npow), 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 homomorphism R →*₀ S
.
The simp
-normal form is (f : 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 fun_like.has_coe_to_fun
directly.
Equations
Equations
Copy of a ring_hom
with a new to_fun
equal to the old one. Useful to fix definitional
equalities.
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
- order_dual.comm_semiring
- with_top.comm_semiring
- with_bot.comm_semiring
- nat.comm_semiring
- mul_opposite.comm_semiring
- add_opposite.comm_semiring
- int.comm_semiring
- rat.comm_semiring
- set.set_semiring.comm_semiring
- prod.comm_semiring
- subsemiring_class.to_comm_semiring
- subsemiring.to_comm_semiring
- subsemiring.center.comm_semiring
- pi.comm_semiring
- cardinal.comm_semiring
- submodule.comm_semiring
- ideal.comm_semiring
- subalgebra.to_comm_semiring
- subalgebra.center.comm_semiring
- monoid_algebra.comm_semiring
- add_monoid_algebra.comm_semiring
- mv_polynomial.comm_semiring
- polynomial.comm_semiring
- restrict_scalars.comm_semiring
- CommSemiRing.comm_semiring
- fractional_ideal.comm_semiring
- real.comm_semiring
- mv_power_series.comm_semiring
- power_series.comm_semiring
- hahn_series.comm_semiring
- zsqrtd.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 nsmul npow = {add := semiring.add (function.injective.semiring f hf zero one add mul nsmul npow), add_assoc := _, zero := semiring.zero (function.injective.semiring f hf zero one add mul nsmul npow), zero_add := _, add_zero := _, nsmul := semiring.nsmul (function.injective.semiring f hf zero one add mul nsmul npow), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := semiring.mul (function.injective.semiring f hf zero one add mul nsmul npow), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := semiring.one (function.injective.semiring f hf zero one add mul nsmul npow), one_mul := _, mul_one := _, npow := semiring.npow (function.injective.semiring f hf zero one add mul nsmul npow), 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 nsmul npow = {add := semiring.add (function.surjective.semiring f hf zero one add mul nsmul npow), add_assoc := _, zero := semiring.zero (function.surjective.semiring f hf zero one add mul nsmul npow), zero_add := _, add_zero := _, nsmul := semiring.nsmul (function.surjective.semiring f hf zero one add mul nsmul npow), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := semiring.mul (function.surjective.semiring f hf zero one add mul nsmul npow), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := semiring.one (function.surjective.semiring f hf zero one add mul nsmul npow), one_mul := _, mul_one := _, npow := semiring.npow (function.surjective.semiring f hf zero one add mul nsmul npow), npow_zero' := _, npow_succ' := _, mul_comm := _}
- neg : α → α
- neg_neg : ∀ (x : α), --x = x
- neg_mul : ∀ (x y : α), (-x) * y = -x * y
- mul_neg : ∀ (x y : α), x * -y = -x * y
Typeclass for a negation operator that distributes across multiplication.
This is useful for dealing with submonoids of a ring that contain -1
without having to duplicate
lemmas.
An element of a ring multiplied by the additive inverse of one is the element's additive inverse.
The additive inverse of one multiplied by an element of a ring is the element's additive inverse.
Prefer neg_zero
if add_comm_group
is available.
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 : α), non_unital_non_assoc_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_unital_non_assoc_ring.nsmul n.succ x = x + non_unital_non_assoc_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 : α), non_unital_non_assoc_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), non_unital_non_assoc_ring.zsmul (int.of_nat n.succ) a = a + non_unital_non_assoc_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), non_unital_non_assoc_ring.zsmul -[1+ n] a = -non_unital_non_assoc_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- 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 ring.
Instances
- non_unital_ring.to_non_unital_non_assoc_ring
- non_assoc_ring.to_non_unital_non_assoc_ring
- order_dual.non_unital_non_assoc_ring
- mul_opposite.non_unital_non_assoc_ring
- add_opposite.non_unital_non_assoc_ring
- prod.non_unital_non_assoc_ring
- pi.non_unital_non_assoc_ring
- monoid_algebra.non_unital_non_assoc_ring
- add_monoid_algebra.non_unital_non_assoc_ring
- matrix.non_unital_non_assoc_ring
- hahn_series.non_unital_non_assoc_ring
Pullback a non_unital_non_assoc_ring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.non_unital_non_assoc_ring f hf zero add mul neg sub nsmul zsmul = {add := add_comm_group.add (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), add_assoc := _, zero := add_comm_group.zero (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), sub := add_comm_group.sub (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := mul_zero_class.mul (function.injective.mul_zero_class f hf zero mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _}
Pushforward a non_unital_non_assoc_ring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.non_unital_non_assoc_ring f hf zero add mul neg sub nsmul zsmul = {add := add_comm_group.add (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), add_assoc := _, zero := add_comm_group.zero (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), sub := add_comm_group.sub (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := mul_zero_class.mul (function.surjective.mul_zero_class f hf zero mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _}
Equations
- non_unital_non_assoc_ring.to_has_distrib_neg = {neg := has_neg.neg (sub_neg_monoid.to_has_neg α), neg_neg := _, neg_mul := _, mul_neg := _}
Alias of mul_sub_left_distrib
.
Alias of mul_sub_right_distrib
.
- 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_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_unital_ring.nsmul n.succ x = x + non_unital_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 : α), non_unital_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), non_unital_ring.zsmul (int.of_nat n.succ) a = a + non_unital_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), non_unital_ring.zsmul -[1+ n] a = -non_unital_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- 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 ring.
Pullback a non_unital_ring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.non_unital_ring f hf zero add mul neg sub nsmul gsmul = {add := add_comm_group.add (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), add_assoc := _, zero := add_comm_group.zero (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), sub := add_comm_group.sub (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := mul_zero_class.mul (function.injective.mul_zero_class f hf zero mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _}
Pushforward a non_unital_ring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.non_unital_ring f hf zero add mul neg sub nsmul gsmul = {add := add_comm_group.add (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), add_assoc := _, zero := add_comm_group.zero (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), sub := add_comm_group.sub (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := mul_zero_class.mul (function.surjective.mul_zero_class f hf zero mul), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _}
- 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_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_assoc_ring.nsmul n.succ x = x + non_assoc_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 : α), non_assoc_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), non_assoc_ring.zsmul (int.of_nat n.succ) a = a + non_assoc_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), non_assoc_ring.zsmul -[1+ n] a = -non_assoc_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- 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 ring.
Pullback a non_assoc_ring
instance along an injective function.
See note [reducible non-instances].
Equations
- function.injective.non_assoc_ring f hf zero one add mul neg sub nsmul gsmul = {add := add_comm_group.add (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), add_assoc := _, zero := add_comm_group.zero (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), sub := add_comm_group.sub (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.injective.add_comm_group f hf zero add neg sub nsmul gsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := mul_zero_class.mul (function.injective.mul_zero_class f hf zero 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 := _}
Pushforward a non_unital_ring
instance along a surjective function.
See note [reducible non-instances].
Equations
- function.surjective.non_assoc_ring f hf zero one add mul neg sub nsmul gsmul = {add := add_comm_group.add (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), add_assoc := _, zero := add_comm_group.zero (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), sub := add_comm_group.sub (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul gsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := mul_zero_class.mul (function.surjective.mul_zero_class f hf zero 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 := _}
- 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.
Instances
- subring_class.to_ring
- comm_ring.to_ring
- ordered_ring.to_ring
- division_ring.to_ring
- order_dual.ring
- add_monoid.End.ring
- mul_opposite.ring
- add_opposite.ring
- int.ring
- prod.ring
- subring.to_ring
- pi.ring
- module.End.ring
- subalgebra.to_ring
- monoid_algebra.ring
- add_monoid_algebra.ring
- polynomial.ring
- restrict_scalars.ring
- matrix.ring
- Ring.ring
- continuous_linear_map.ring
- uniform_space.completion.ring
- K_hat.ring
- cau_seq.ring
- real.ring
- mv_power_series.ring
- power_series.ring
- hahn_series.ring
- algebra.tensor_product.tensor_product.ring
- free_abelian_group.ring
- free_ring.ring
- ring.direct_limit.ring
- subfield.ring
- number_field.pi.ring
- zsqrtd.ring
- complex.ring
Equations
- ring.to_non_unital_ring = {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' := _, neg := ring.neg _inst_1, sub := ring.sub _inst_1, sub_eq_add_neg := _, zsmul := ring.zsmul _inst_1, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul _inst_1, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _}
Equations
- ring.to_non_assoc_ring = {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' := _, neg := ring.neg _inst_1, sub := ring.sub _inst_1, sub_eq_add_neg := _, zsmul := ring.zsmul _inst_1, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul _inst_1, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, one := ring.one _inst_1, one_mul := _, mul_one := _}
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 nsmul zsmul npow = {add := add_comm_group.add (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), add_assoc := _, zero := add_comm_group.zero (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), sub := add_comm_group.sub (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.injective.add_comm_group f hf zero add neg sub nsmul zsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := monoid.mul (function.injective.monoid f hf one mul npow), mul_assoc := _, one := monoid.one (function.injective.monoid f hf one mul npow), one_mul := _, mul_one := _, npow := monoid.npow (function.injective.monoid f hf one mul npow), 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 nsmul zsmul npow = {add := add_comm_group.add (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), add_assoc := _, zero := add_comm_group.zero (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), zero_add := _, add_zero := _, nsmul := add_comm_group.nsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), nsmul_zero' := _, nsmul_succ' := _, neg := add_comm_group.neg (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), sub := add_comm_group.sub (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), sub_eq_add_neg := _, zsmul := add_comm_group.zsmul (function.surjective.add_comm_group f hf zero add neg sub nsmul zsmul), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := monoid.mul (function.surjective.monoid f hf one mul npow), mul_assoc := _, one := monoid.one (function.surjective.monoid f hf one mul npow), one_mul := _, mul_one := _, npow := monoid.npow (function.surjective.monoid f hf one mul npow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _}
Equations
- units.has_distrib_neg = {neg := has_neg.neg units.has_neg, neg_neg := _, neg_mul := _, mul_neg := _}
Ring homomorphisms preserve additive inverse.
Ring homomorphisms preserve subtraction.
Makes a ring homomorphism from a monoid homomorphism of rings which preserves addition.
- 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
- subring_class.to_comm_ring
- ordered_comm_ring.to_comm_ring
- field.to_comm_ring
- euclidean_domain.to_comm_ring
- order_dual.comm_ring
- mul_opposite.comm_ring
- add_opposite.comm_ring
- int.comm_ring
- rat.comm_ring
- prod.comm_ring
- subring.to_comm_ring
- subring.center.comm_ring
- punit.comm_ring
- pi.comm_ring
- ideal.quotient.comm_ring
- localization.comm_ring
- subalgebra.to_comm_ring
- subalgebra.center.comm_ring
- monoid_algebra.comm_ring
- add_monoid_algebra.comm_ring
- mv_polynomial.comm_ring
- polynomial.comm_ring
- restrict_scalars.comm_ring
- CommRing.comm_ring
- uniform_space.completion.comm_ring
- uniform_space.comm_ring
- R_hat.comm_ring
- K_hat.comm_ring
- finite_adele_ring'.comm_ring
- subtype.comm_ring
- finite_adele_ring.comm_ring
- cau_seq.comm_ring
- cau_seq.completion.Cauchy.comm_ring
- real.comm_ring
- mv_power_series.comm_ring
- power_series.comm_ring
- hahn_series.comm_ring
- ratfunc.comm_ring
- fin.comm_ring
- zmod.comm_ring
- adjoin_root.comm_ring
- algebra.tensor_product.tensor_product.comm_ring
- free_abelian_group.comm_ring
- free_comm_ring.comm_ring
- free_ring.comm_ring
- ring.direct_limit.comm_ring
- perfect_closure.comm_ring
- function_field.A_F_f.comm_ring
- function_field.A_F.comm_ring
- number_field.A_K_f.comm_ring
- number_field.A_K.comm_ring
- zsqrtd.comm_ring
- complex.comm_ring
- gaussian_int.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 nsmul zsmul npow = {add := ring.add (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := ring.zero (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), zero_add := _, add_zero := _, nsmul := ring.nsmul (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ring.sub (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ring.zsmul (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), 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 nsmul zsmul npow), mul_assoc := _, one := ring.one (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), one_mul := _, mul_one := _, npow := ring.npow (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), 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 nsmul zsmul npow = {add := ring.add (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := ring.zero (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), zero_add := _, add_zero := _, nsmul := ring.nsmul (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ring.sub (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ring.zsmul (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), 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 nsmul zsmul npow), mul_assoc := _, one := ring.one (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), one_mul := _, mul_one := _, npow := ring.npow (function.surjective.ring f hf zero one add mul neg sub nsmul zsmul npow), 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
.
A ring with no zero divisors is a cancel_monoid_with_zero.
Note this is not an instance as it forms a typeclass loop.
Equations
- no_zero_divisors.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 := _}
- 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 α]
.
Instances
- euclidean_domain.is_domain
- subring_class.is_domain
- linear_ordered_ring.is_domain
- division_ring.is_domain
- field.is_domain
- mul_opposite.is_domain
- add_opposite.is_domain
- rat.is_domain
- subring.is_domain
- ideal.quotient.is_domain
- subalgebra.is_domain
- polynomial.is_domain
- mv_polynomial.is_domain
- integral_closure.is_domain
- is_localization.is_domain_of_local_at_prime
- real.is_domain
- power_series.is_domain
- hahn_series.is_domain
- zmod.is_domain
- function_field.ring_of_integers.is_domain
- zsqrtd.is_domain
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.