Semirings and rings #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines semirings, rings and domains. This is analogous to algebra.group.defs
and
algebra.group.basic
, the difference being that the former is about +
and *
separately, while
the present file is about their interaction.
Main definitions #
distrib
: Typeclass for distributivity of multiplication over addition.has_distrib_neg
: Typeclass for commutativity of negation and multiplication. This is useful when dealing with multiplicative submonoids which are closed under negation without being closed under addition, for exampleunits
.(non_unital_)(non_assoc_)(semi)ring
: Typeclasses for possibly non-unital or non-associative rings and semirings. Some combinations are not defined yet because they haven't found use.
Tags #
semiring
, comm_semiring
, ring
, comm_ring
, domain
, is_domain
, nonzero
, units
- mul : R → R → R
- add : R → R → R
- left_distrib : ∀ (a b c : R), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : R), (a + b) * c = a * c + b * c
A typeclass stating that multiplication is left and right distributive over addition.
Instances of this typeclass
Instances of other typeclasses for distrib
- distrib.has_sizeof_inst
A typeclass stating that multiplication is left distributive over addition.
Instances of this typeclass
Instances of other typeclasses for left_distrib_class
- left_distrib_class.has_sizeof_inst
A typeclass stating that multiplication is right distributive over addition.
Instances of this typeclass
Instances of other typeclasses for right_distrib_class
- right_distrib_class.has_sizeof_inst
Equations
- distrib.left_distrib_class R = {left_distrib := _}
Equations
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 of this typeclass
- 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
- mul_opposite.non_unital_non_assoc_semiring
- add_opposite.non_unital_non_assoc_semiring
- ulift.non_unital_non_assoc_semiring
- pi.non_unital_non_assoc_semiring
- prod.non_unital_non_assoc_semiring
- set_semiring.non_unital_non_assoc_semiring
- matrix.non_unital_non_assoc_semiring
- ring_con.quotient.non_unital_non_assoc_semiring
- monoid_algebra.non_unital_non_assoc_semiring
- add_monoid_algebra.non_unital_non_assoc_semiring
Instances of other typeclasses for non_unital_non_assoc_semiring
- non_unital_non_assoc_semiring.has_sizeof_inst
- 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 of this typeclass
- semiring.to_non_unital_semiring
- non_unital_comm_semiring.to_non_unital_semiring
- non_unital_ring.to_non_unital_semiring
- mul_opposite.non_unital_semiring
- add_opposite.non_unital_semiring
- ulift.non_unital_semiring
- pi.non_unital_semiring
- prod.non_unital_semiring
- set_semiring.non_unital_semiring
- matrix.non_unital_semiring
- ring_con.quotient.non_unital_semiring
- monoid_algebra.non_unital_semiring
- add_monoid_algebra.non_unital_semiring
Instances of other typeclasses for non_unital_semiring
- non_unital_semiring.has_sizeof_inst
- 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
- nat_cast : ℕ → α
- nat_cast_zero : non_assoc_semiring.nat_cast 0 = 0 . "control_laws_tac"
- nat_cast_succ : (∀ (n : ℕ), non_assoc_semiring.nat_cast (n + 1) = non_assoc_semiring.nat_cast n + 1) . "control_laws_tac"
A unital but not-necessarily-associative semiring.
Instances of this typeclass
- subsemiring_class.to_non_assoc_semiring
- semiring.to_non_assoc_semiring
- non_assoc_ring.to_non_assoc_semiring
- mul_opposite.non_assoc_semiring
- add_opposite.non_assoc_semiring
- ulift.non_assoc_semiring
- pi.non_assoc_semiring
- prod.non_assoc_semiring
- subsemiring.to_non_assoc_semiring
- set_semiring.non_assoc_semiring
- matrix.non_assoc_semiring
- ring_con.quotient.non_assoc_semiring
- monoid_algebra.non_assoc_semiring
- add_monoid_algebra.non_assoc_semiring
Instances of other typeclasses for non_assoc_semiring
- non_assoc_semiring.has_sizeof_inst
- 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
- nat_cast : ℕ → α
- nat_cast_zero : semiring.nat_cast 0 = 0 . "control_laws_tac"
- nat_cast_succ : (∀ (n : ℕ), semiring.nat_cast (n + 1) = semiring.nat_cast n + 1) . "control_laws_tac"
- 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 of this typeclass
- subsemiring_class.to_semiring
- comm_semiring.to_semiring
- division_semiring.to_semiring
- ordered_semiring.to_semiring
- strict_ordered_semiring.to_semiring
- idem_semiring.to_semiring
- ring.to_semiring
- add_monoid.End.semiring
- with_zero.semiring
- nat.semiring
- int.semiring
- rat.semiring
- mul_opposite.semiring
- add_opposite.semiring
- ulift.semiring
- pi.semiring
- module.End.semiring
- prod.semiring
- subsemiring.to_semiring
- subalgebra.to_semiring
- restrict_scalars.semiring
- matrix.semiring
- ring_con.quotient.semiring
- nonneg.semiring
- real.semiring
- nnreal.semiring
- continuous_linear_map.semiring
- monoid_algebra.semiring
- add_monoid_algebra.semiring
- polynomial.semiring
- algebra.tensor_product.tensor_product.semiring
- matrix.is_block_diagonal.semiring
- _private.1762755263.pi_matrix_tensor_is_semiring
Instances of other typeclasses for semiring
- semiring.has_sizeof_inst
- 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_comm_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_unital_comm_semiring.nsmul n.succ x = x + non_unital_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)
- mul_comm : ∀ (a b : α), a * b = b * a
A non-unital commutative semiring is a non_unital_semiring
with commutative multiplication.
In other words, it is a type with the following structures: additive commutative monoid
(add_comm_monoid
), commutative semigroup (comm_semigroup
), distributive laws (distrib
), and
multiplication by zero law (mul_zero_class
).
Instances of this typeclass
- comm_semiring.to_non_unital_comm_semiring
- non_unital_comm_ring.to_non_unital_comm_semiring
- mul_opposite.non_unital_comm_semiring
- add_opposite.non_unital_comm_semiring
- ulift.non_unital_comm_semiring
- pi.non_unital_comm_semiring
- prod.non_unital_comm_semiring
- set_semiring.non_unital_comm_semiring
- monoid_algebra.non_unital_comm_semiring
- add_monoid_algebra.non_unital_comm_semiring
Instances of other typeclasses for non_unital_comm_semiring
- non_unital_comm_semiring.has_sizeof_inst
- 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
- nat_cast : ℕ → α
- nat_cast_zero : comm_semiring.nat_cast 0 = 0 . "control_laws_tac"
- nat_cast_succ : (∀ (n : ℕ), comm_semiring.nat_cast (n + 1) = comm_semiring.nat_cast n + 1) . "control_laws_tac"
- 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 of this typeclass
- comm_ring.to_comm_semiring
- semifield.to_comm_semiring
- ordered_comm_semiring.to_comm_semiring
- strict_ordered_comm_semiring.to_comm_semiring
- canonically_ordered_comm_semiring.to_comm_semiring
- idem_comm_semiring.to_comm_semiring
- nat.comm_semiring
- int.comm_semiring
- rat.comm_semiring
- mul_opposite.comm_semiring
- add_opposite.comm_semiring
- ulift.comm_semiring
- pi.comm_semiring
- with_top.comm_semiring
- with_bot.comm_semiring
- prod.comm_semiring
- subsemiring_class.to_comm_semiring
- subsemiring.to_comm_semiring
- subsemiring.center.comm_semiring
- cardinal.comm_semiring
- subalgebra.to_comm_semiring
- subalgebra.center.comm_semiring
- star_subalgebra.adjoin_comm_semiring_of_is_star_normal
- restrict_scalars.comm_semiring
- ring_con.quotient.comm_semiring
- nonneg.comm_semiring
- real.comm_semiring
- nnreal.comm_semiring
- complex.comm_semiring
- elemental_star_algebra.comm_semiring
- monoid_algebra.comm_semiring
- add_monoid_algebra.comm_semiring
- mv_polynomial.comm_semiring
- polynomial.comm_semiring
- localization.comm_semiring
Instances of other typeclasses for comm_semiring
- comm_semiring.has_sizeof_inst
Equations
- comm_semiring.to_non_unital_comm_semiring = {add := semiring.add (comm_semiring.to_semiring α), add_assoc := _, zero := semiring.zero (comm_semiring.to_semiring α), zero_add := _, add_zero := _, nsmul := semiring.nsmul (comm_semiring.to_semiring α), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := comm_monoid.mul (comm_semiring.to_comm_monoid α), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, mul_comm := _}
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 := _}
- 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.
Instances of this typeclass
Instances of other typeclasses for has_distrib_neg
- has_distrib_neg.has_sizeof_inst
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.
Equations
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 of this typeclass
- non_unital_ring.to_non_unital_non_assoc_ring
- non_assoc_ring.to_non_unital_non_assoc_ring
- mul_opposite.non_unital_non_assoc_ring
- add_opposite.non_unital_non_assoc_ring
- ulift.non_unital_non_assoc_ring
- pi.non_unital_non_assoc_ring
- prod.non_unital_non_assoc_ring
- matrix.non_unital_non_assoc_ring
- ring_con.quotient.non_unital_non_assoc_ring
- monoid_algebra.non_unital_non_assoc_ring
- add_monoid_algebra.non_unital_non_assoc_ring
Instances of other typeclasses for non_unital_non_assoc_ring
- non_unital_non_assoc_ring.has_sizeof_inst
- 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.
Instances of this typeclass
- ring.to_non_unital_ring
- non_unital_comm_ring.to_non_unital_ring
- non_unital_semi_normed_ring.to_non_unital_ring
- non_unital_normed_ring.to_non_unital_ring
- mul_opposite.non_unital_ring
- add_opposite.non_unital_ring
- ulift.non_unital_ring
- pi.non_unital_ring
- prod.non_unital_ring
- matrix.non_unital_ring
- ring_con.quotient.non_unital_ring
- monoid_algebra.non_unital_ring
- add_monoid_algebra.non_unital_ring
Instances of other typeclasses for non_unital_ring
- non_unital_ring.has_sizeof_inst
- 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
- nat_cast : ℕ → α
- nat_cast_zero : non_assoc_ring.nat_cast 0 = 0 . "control_laws_tac"
- nat_cast_succ : (∀ (n : ℕ), non_assoc_ring.nat_cast (n + 1) = non_assoc_ring.nat_cast n + 1) . "control_laws_tac"
- int_cast : ℤ → α
- int_cast_of_nat : (∀ (n : ℕ), non_assoc_ring.int_cast ↑n = ↑n) . "control_laws_tac"
- int_cast_neg_succ_of_nat : (∀ (n : ℕ), non_assoc_ring.int_cast (-↑(n + 1)) = -↑(n + 1)) . "control_laws_tac"
A unital but not-necessarily-associative ring.
Instances of this typeclass
Instances of other typeclasses for non_assoc_ring
- non_assoc_ring.has_sizeof_inst
- 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
- int_cast : ℤ → α
- nat_cast : ℕ → α
- one : α
- nat_cast_zero : ring.nat_cast 0 = 0 . "control_laws_tac"
- nat_cast_succ : (∀ (n : ℕ), ring.nat_cast (n + 1) = ring.nat_cast n + 1) . "control_laws_tac"
- int_cast_of_nat : (∀ (n : ℕ), ring.int_cast ↑n = ↑n) . "control_laws_tac"
- int_cast_neg_succ_of_nat : (∀ (n : ℕ), ring.int_cast (-↑(n + 1)) = -↑(n + 1)) . "control_laws_tac"
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), a * b * c = a * (b * c)
- 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 of this typeclass
- subring_class.to_ring
- comm_ring.to_ring
- division_ring.to_ring
- ordered_ring.to_ring
- strict_ordered_ring.to_ring
- semi_normed_ring.to_ring
- normed_ring.to_ring
- add_monoid.End.ring
- int.ring
- mul_opposite.ring
- add_opposite.ring
- ulift.ring
- pi.ring
- module.End.ring
- prod.ring
- subring.to_ring
- subalgebra.to_ring
- restrict_scalars.ring
- matrix.ring
- ring_con.quotient.ring
- subfield.ring
- cau_seq.ring
- cau_seq.completion.Cauchy.ring
- real.ring
- complex.ring
- continuous_linear_map.ring
- uniform_space.completion.ring
- monoid_algebra.ring
- add_monoid_algebra.ring
- polynomial.ring
- local_ring.residue_field.ring
- algebra.tensor_product.tensor_product.ring
- normed_add_comm_group_of_ring.to_ring
Instances of other typeclasses for ring
- ring.has_sizeof_inst
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 := _}
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 := _, nat_cast := ring.nat_cast _inst_1, nat_cast_zero := _, nat_cast_succ := _, int_cast := ring.int_cast _inst_1, int_cast_of_nat := _, int_cast_neg_succ_of_nat := _}
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 := _, nat_cast := ring.nat_cast _inst_1, nat_cast_zero := _, nat_cast_succ := _, npow := ring.npow _inst_1, 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 : α), non_unital_comm_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), non_unital_comm_ring.nsmul n.succ x = x + non_unital_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 : α), non_unital_comm_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), non_unital_comm_ring.zsmul (int.of_nat n.succ) a = a + non_unital_comm_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), non_unital_comm_ring.zsmul -[1+ n] a = -non_unital_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 : α → α → α
- 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)
- mul_comm : ∀ (a b : α), a * b = b * a
A non-unital commutative ring is a non_unital_ring
with commutative multiplication.
Instances of this typeclass
Instances of other typeclasses for non_unital_comm_ring
- non_unital_comm_ring.has_sizeof_inst
Equations
- non_unital_comm_ring.to_non_unital_comm_semiring = {add := non_unital_comm_ring.add s, add_assoc := _, zero := non_unital_comm_ring.zero s, zero_add := _, add_zero := _, nsmul := non_unital_comm_ring.nsmul s, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := non_unital_comm_ring.mul s, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, mul_comm := _}
- 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
- int_cast : ℤ → α
- nat_cast : ℕ → α
- one : α
- nat_cast_zero : comm_ring.nat_cast 0 = 0 . "control_laws_tac"
- nat_cast_succ : (∀ (n : ℕ), comm_ring.nat_cast (n + 1) = comm_ring.nat_cast n + 1) . "control_laws_tac"
- int_cast_of_nat : (∀ (n : ℕ), comm_ring.int_cast ↑n = ↑n) . "control_laws_tac"
- int_cast_neg_succ_of_nat : (∀ (n : ℕ), comm_ring.int_cast (-↑(n + 1)) = -↑(n + 1)) . "control_laws_tac"
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), a * b * c = a * (b * c)
- 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 of this typeclass
- subring_class.to_comm_ring
- field.to_comm_ring
- ordered_comm_ring.to_comm_ring
- strict_ordered_comm_ring.to_comm_ring
- euclidean_domain.to_comm_ring
- semi_normed_comm_ring.to_comm_ring
- int.comm_ring
- rat.comm_ring
- mul_opposite.comm_ring
- add_opposite.comm_ring
- ulift.comm_ring
- pi.comm_ring
- punit.comm_ring
- prod.comm_ring
- subring.to_comm_ring
- subring.center.comm_ring
- subalgebra.to_comm_ring
- subalgebra.center.comm_ring
- self_adjoint.comm_ring
- star_subalgebra.adjoin_comm_ring_of_is_star_normal
- restrict_scalars.comm_ring
- fin.comm_ring
- zmod.comm_ring
- ring_con.quotient.comm_ring
- ideal.quotient.comm_ring
- cau_seq.comm_ring
- cau_seq.completion.Cauchy.comm_ring
- real.comm_ring
- complex.comm_ring
- algebra.elemental_algebra.comm_ring
- elemental_star_algebra.comm_ring
- uniform_space.completion.comm_ring
- uniform_space.comm_ring
- monoid_algebra.comm_ring
- add_monoid_algebra.comm_ring
- mv_polynomial.comm_ring
- polynomial.comm_ring
- localization.comm_ring
- local_ring.residue_field.comm_ring
- algebra.tensor_product.tensor_product.comm_ring
Instances of other typeclasses for comm_ring
- comm_ring.has_sizeof_inst
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 := _, nat_cast := comm_ring.nat_cast s, nat_cast_zero := _, nat_cast_succ := _, npow := comm_ring.npow s, npow_zero' := _, npow_succ' := _, mul_comm := _}
Equations
- comm_ring.to_non_unital_comm_ring = {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' := _, neg := comm_ring.neg s, sub := comm_ring.sub s, sub_eq_add_neg := _, zsmul := comm_ring.zsmul s, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := comm_ring.mul s, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, mul_comm := _}
- mul_left_cancel_of_ne_zero : ∀ {a b c : α}, a ≠ 0 → a * b = a * c → b = c
- mul_right_cancel_of_ne_zero : ∀ {a b c : α}, b ≠ 0 → a * b = c * b → a = c
- exists_pair_ne : ∃ (x y : α), x ≠ y
A domain is a nontrivial semiring such multiplication by a non zero element is cancellative,
on both sides. In other words, a nontrivial semiring R
satisfying
∀ {a b c : R}, a ≠ 0 → a * b = a * c → b = c
and
∀ {a b c : R}, b ≠ 0 → a * b = c * b → a = c
.
This is implemented as a mixin for semiring α
.
To obtain an integral domain use [comm_ring α] [is_domain α]
.
Instances of this typeclass
- euclidean_domain.is_domain
- subring_class.is_domain
- linear_ordered_ring.is_domain
- division_ring.is_domain
- field.is_domain
- rat.is_domain
- mul_opposite.is_domain
- add_opposite.is_domain
- subring.is_domain
- subalgebra.is_domain
- ideal.quotient.is_domain
- real.is_domain
- polynomial.is_domain
- mv_polynomial.is_domain
- zmod.is_domain
- integral_closure.is_domain