The areas / V06. Rings, fields and ordered algebra
Mathlib.Algebra.Ring.Defs
237 declarations. Mathlib docs · Source
Semirings and rings
This file defines semirings, rings and domains. This is analogous to
Mathlib/Algebra/Group/Defs.lean and Mathlib/Algebra/Group/Basic.lean, the difference being that
those are about + and * separately, while the present file is about their interaction.
Main definitions
Distrib: Typeclass for distributivity of multiplication over addition.HasDistribNeg: 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.(NonUnital)(NonAssoc)(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. For Lie Rings, there is a type synonymCommutatorRingdefined inMathlib/Algebra/Algebra/NonUnitalHom.leanturning the bracket into a multiplication so that the instanceinstNonUnitalNonAssocSemiringCommutatorRingcan be defined.
Tags
Semiring, CommSemiring, Ring, CommRing, domain, IsDomain, nonzero, units
Previously an import dependency on Mathlib/Algebra/Group/Basic.lean had crept in.
In general, the .Defs files in the basic algebraic hierarchy should only depend on earlier .Defs
files, without importing .Basic theory development.
These assert_not_exists statements guard against this returning.
Distrib class
Classes of semirings and rings
We make sure that the canonical path from NonAssocSemiring to Ring passes through Semiring,
as this is a path which is followed all the time in linear algebra where the defining semilinear map
σ : R →+* S depends on the NonAssocSemiring structure of R and S while the module
definition depends on the Semiring structure.
It is not currently possible to adjust priorities by hand (see https://github.com/leanprover/lean4/issues/2115). Instead, the last
declared instance is used, so we make sure that Semiring is declared after NonAssocRing, so
that Semiring -> NonAssocSemiring is tried before NonAssocRing -> NonAssocSemiring.
TODO: clean this once https://github.com/leanprover/lean4/issues/2115 is fixed
Semirings
Rings
def NonUnitalRing.ctorIdx E1 #
{α : Type u_1} → NonUnitalRing α → ℕ
def NonAssocSemiring.ctorIdx E1 #
{α : Type u} → NonAssocSemiring α → ℕ
def NonAssocRing.ctorIdx E1 #
{α : Type u_1} → NonAssocRing α → ℕ
def NonUnitalCommSemiring.ctorIdx E1 #
{α : Type u} → NonUnitalCommSemiring α → ℕ
def NonUnitalSemiring.ctorIdx E1 #
{α : Type u} → NonUnitalSemiring α → ℕ
def Distrib.ctorIdx E1 #
{R : Type u_1} → Distrib R → ℕ
def NonUnitalCommRing.ctorIdx E1 #
{α : Type u} → NonUnitalCommRing α → ℕ
def NonUnitalNonAssocCommSemiring.ctorIdx E1 #
{α : Type u} → NonUnitalNonAssocCommSemiring α → ℕ
def NonUnitalNonAssocSemiring.ctorIdx E1 #
{α : Type u} → NonUnitalNonAssocSemiring α → ℕ
def HasDistribNeg.ctorIdx E1 #
{α : Type u_1} → {inst : Mul α} → HasDistribNeg α → ℕ
def NonAssocCommRing.ctorIdx E1 #
{α : Type u} → NonAssocCommRing α → ℕ
def CommSemiring.ctorIdx E1 #
{R : Type u} → CommSemiring R → ℕ
def NonAssocCommSemiring.ctorIdx E1 #
{α : Type u} → NonAssocCommSemiring α → ℕ
def NonUnitalNonAssocCommRing.ctorIdx E1 #
{α : Type u} → NonUnitalNonAssocCommRing α → ℕ
def Ring.ctorIdx E1 #
{R : Type u} → Ring R → ℕ
def Semiring.ctorIdx E1 #
{α : Type u} → Semiring α → ℕ
def NonUnitalNonAssocRing.ctorIdx E1 #
{α : Type u} → NonUnitalNonAssocRing α → ℕ
def CommRing.ctorIdx E1 #
{α : Type u} → CommRing α → ℕ
class Distrib E3 #
Type u_1 → Type u_1
A typeclass stating that multiplication is left and right distributive over addition.
instance Distrib.toAdd E0 #
{R : Type u_1} → [self : Distrib R] → Add R
instance Distrib.toMul E0 #
{R : Type u_1} → [self : Distrib R] → Mul R
ctor Distrib.mk E0 #
{R : Type u_1} →
[toMul : Mul R] →
[toAdd : Add R] →
(∀ (a b c : R), a * (b + c) = a * b + a * c) → (∀ (a b c : R), (a + b) * c = a * c + b * c) → Distrib R
theorem Distrib.left_distrib E1 #
∀ {R : Type u_1} [self : Distrib R] (a b c : R), a * (b + c) = a * b + a * c
Multiplication is left distributive over addition
theorem Distrib.right_distrib E1 #
∀ {R : Type u_1} [self : Distrib R] (a b c : R), (a + b) * c = a * c + b * c
Multiplication is right distributive over addition
class LeftDistribClass E1 #
(R : Type u_1) → [Mul R] → [Add R] → Prop
A typeclass stating that multiplication is left distributive over addition.
ctor LeftDistribClass.mk E0 #
∀ {R : Type u_1} [inst : Mul R] [inst_1 : Add R], (∀ (a b c : R), a * (b + c) = a * b + a * c) → LeftDistribClass R
theorem LeftDistribClass.left_distrib E1 #
∀ {R : Type u_1} {inst : Mul R} {inst_1 : Add R} [self : LeftDistribClass R] (a b c : R), a * (b + c) = a * b + a * c
Multiplication is left distributive over addition
class RightDistribClass E1 #
(R : Type u_1) → [Mul R] → [Add R] → Prop
A typeclass stating that multiplication is right distributive over addition.
ctor RightDistribClass.mk E0 #
∀ {R : Type u_1} [inst : Mul R] [inst_1 : Add R], (∀ (a b c : R), (a + b) * c = a * c + b * c) → RightDistribClass R
theorem RightDistribClass.right_distrib E1 #
∀ {R : Type u_1} {inst : Mul R} {inst_1 : Add R} [self : RightDistribClass R] (a b c : R), (a + b) * c = a * c + b * c
Multiplication is right distributive over addition
instance Distrib.leftDistribClass E0 #
∀ (R : Type u_1) [inst : Distrib R], LeftDistribClass R
instance Distrib.rightDistribClass E0 #
∀ (R : Type u_1) [inst : Distrib R], RightDistribClass R
theorem left_distrib E1 #
∀ {R : Type v} [inst : Mul R] [inst_1 : Add R] [LeftDistribClass R] (a b c : R), a * (b + c) = a * b + a * c
theorem mul_add E1 #
∀ {R : Type v} [inst : Mul R] [inst_1 : Add R] [LeftDistribClass R] (a b c : R), a * (b + c) = a * b + a * c
Alias of left_distrib.
theorem right_distrib E1 #
∀ {R : Type v} [inst : Mul R] [inst_1 : Add R] [RightDistribClass R] (a b c : R), (a + b) * c = a * c + b * c
theorem add_mul E1 #
∀ {R : Type v} [inst : Mul R] [inst_1 : Add R] [RightDistribClass R] (a b c : R), (a + b) * c = a * c + b * c
Alias of right_distrib.
theorem distrib_three_right E1 #
∀ {R : Type v} [inst : Mul R] [inst_1 : Add R] [RightDistribClass R] (a b c d : R),
(a + b + c) * d = a * d + b * d + c * d
class NonUnitalNonAssocSemiring E1 #
Type u → Type u
A not-necessarily-unital, not-necessarily-associative semiring. See CommutatorRing and the
documentation thereof in case you need a NonUnitalNonAssocSemiring instance on a Lie ring
or a Lie algebra.
instance NonUnitalNonAssocSemiring.toMulZeroClass E0 #
{α : Type u} → [self : NonUnitalNonAssocSemiring α] → MulZeroClass α
abbrev NonUnitalNonAssocSemiring.toMul E1 #
{α : Type u} → [self : NonUnitalNonAssocSemiring α] → Mul α
theorem NonUnitalNonAssocSemiring.mul_zero E1 #
∀ {α : Type u} [self : NonUnitalNonAssocSemiring α] (a : α), a * 0 = 0
Zero is a right absorbing element for multiplication
ctor NonUnitalNonAssocSemiring.mk E0 #
{α : Type u} →
[toAddCommMonoid : AddCommMonoid α] →
[toMul : Mul α] →
(∀ (a b c : α), a * (b + c) = a * b + a * c) →
(∀ (a b c : α), (a + b) * c = a * c + b * c) →
(∀ (a : α), 0 * a = 0) → (∀ (a : α), a * 0 = 0) → NonUnitalNonAssocSemiring α
theorem NonUnitalNonAssocSemiring.left_distrib E1 #
∀ {α : Type u} [self : NonUnitalNonAssocSemiring α] (a b c : α), a * (b + c) = a * b + a * c
Multiplication is left distributive over addition
instance NonUnitalNonAssocSemiring.toAddCommMonoid E0 #
{α : Type u} → [self : NonUnitalNonAssocSemiring α] → AddCommMonoid α
theorem NonUnitalNonAssocSemiring.right_distrib E1 #
∀ {α : Type u} [self : NonUnitalNonAssocSemiring α] (a b c : α), (a + b) * c = a * c + b * c
Multiplication is right distributive over addition
theorem NonUnitalNonAssocSemiring.zero_mul E1 #
∀ {α : Type u} [self : NonUnitalNonAssocSemiring α] (a : α), 0 * a = 0
Zero is a left absorbing element for multiplication
instance NonUnitalNonAssocSemiring.toDistrib E0 #
{α : Type u} → [self : NonUnitalNonAssocSemiring α] → Distrib α
class NonUnitalSemiring E1 #
Type u → Type u
An associative but not-necessarily unital semiring.
theorem NonUnitalSemiring.mul_assoc E1 #
∀ {α : Type u} [self : NonUnitalSemiring α] (a b c : α), a * b * c = a * (b * c)
Multiplication is associative
instance NonUnitalSemiring.toNonUnitalNonAssocSemiring E0 #
{α : Type u} → [self : NonUnitalSemiring α] → NonUnitalNonAssocSemiring α
instance NonUnitalSemiring.toSemigroupWithZero E0 #
{α : Type u} → [self : NonUnitalSemiring α] → SemigroupWithZero α
ctor NonUnitalSemiring.mk E0 #
{α : Type u} →
[toNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring α] →
(∀ (a b c : α), a * b * c = a * (b * c)) → NonUnitalSemiring α
class NonAssocSemiring E1 #
Type u → Type u
A unital but not-necessarily-associative semiring.
ctor NonAssocSemiring.mk E0 #
{α : Type u} →
[toNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring α] →
[toOne : One α] →
(∀ (a : α), 1 * a = a) →
(∀ (a : α), a * 1 = a) →
[toNatCast : NatCast α] →
autoParam (↑0 = 0) AddMonoidWithOne.natCast_zero._autoParam →
autoParam (∀ (n : ℕ), ↑(n + 1) = ↑n + 1) AddMonoidWithOne.natCast_succ._autoParam → NonAssocSemiring α
instance NonAssocSemiring.toAddCommMonoidWithOne E0 #
{α : Type u} → [self : NonAssocSemiring α] → AddCommMonoidWithOne α
theorem NonAssocSemiring.one_mul E2 #
∀ {α : Type u} [self : NonAssocSemiring α] (a : α), 1 * a = a
One is a left neutral element for multiplication
abbrev NonAssocSemiring.toOne E1 #
{α : Type u} → [self : NonAssocSemiring α] → One α
instance NonAssocSemiring.toMulZeroOneClass E0 #
{α : Type u} → [self : NonAssocSemiring α] → MulZeroOneClass α
instance NonAssocSemiring.toNonUnitalNonAssocSemiring E0 #
{α : Type u} → [self : NonAssocSemiring α] → NonUnitalNonAssocSemiring α
theorem NonAssocSemiring.mul_one E2 #
∀ {α : Type u} [self : NonAssocSemiring α] (a : α), a * 1 = a
One is a right neutral element for multiplication
abbrev NonAssocSemiring.toNatCast E1 #
{α : Type u} → [self : NonAssocSemiring α] → NatCast α
theorem NonAssocSemiring.natCast_zero E2 #
∀ {α : Type u} [self : NonAssocSemiring α], ↑0 = 0
The canonical map ℕ → R sends 0 : ℕ to 0 : R.
theorem NonAssocSemiring.natCast_succ E2 #
∀ {α : Type u} [self : NonAssocSemiring α] (n : ℕ), ↑(n + 1) = ↑n + 1
The canonical map ℕ → R is a homomorphism.
class NonUnitalNonAssocRing E3 #
Type u → Type u
A not-necessarily-unital, not-necessarily-associative ring.
abbrev NonUnitalNonAssocRing.toMul E1 #
{α : Type u} → [self : NonUnitalNonAssocRing α] → Mul α
instance NonUnitalNonAssocRing.toAddCommGroup E0 #
{α : Type u} → [self : NonUnitalNonAssocRing α] → AddCommGroup α
instance NonUnitalNonAssocRing.toNonUnitalNonAssocSemiring E0 #
{α : Type u} → [self : NonUnitalNonAssocRing α] → NonUnitalNonAssocSemiring α
theorem NonUnitalNonAssocRing.zero_mul E2 #
∀ {α : Type u} [self : NonUnitalNonAssocRing α] (a : α), 0 * a = 0
Zero is a left absorbing element for multiplication
theorem NonUnitalNonAssocRing.mul_zero E2 #
∀ {α : Type u} [self : NonUnitalNonAssocRing α] (a : α), a * 0 = 0
Zero is a right absorbing element for multiplication
theorem NonUnitalNonAssocRing.left_distrib E2 #
∀ {α : Type u} [self : NonUnitalNonAssocRing α] (a b c : α), a * (b + c) = a * b + a * c
Multiplication is left distributive over addition
theorem NonUnitalNonAssocRing.right_distrib E2 #
∀ {α : Type u} [self : NonUnitalNonAssocRing α] (a b c : α), (a + b) * c = a * c + b * c
Multiplication is right distributive over addition
ctor NonUnitalNonAssocRing.mk E0 #
{α : Type u} →
[toAddCommGroup : AddCommGroup α] →
[toMul : Mul α] →
(∀ (a b c : α), a * (b + c) = a * b + a * c) →
(∀ (a b c : α), (a + b) * c = a * c + b * c) →
(∀ (a : α), 0 * a = 0) → (∀ (a : α), a * 0 = 0) → NonUnitalNonAssocRing α
class NonUnitalRing E1 #
Type u_1 → Type u_1
An associative but not-necessarily unital ring.
instance NonUnitalRing.toNonUnitalNonAssocRing E0 #
{α : Type u_1} → [self : NonUnitalRing α] → NonUnitalNonAssocRing α
theorem NonUnitalRing.mul_assoc E1 #
∀ {α : Type u_1} [self : NonUnitalRing α] (a b c : α), a * b * c = a * (b * c)
Multiplication is associative
ctor NonUnitalRing.mk E0 #
{α : Type u_1} →
[toNonUnitalNonAssocRing : NonUnitalNonAssocRing α] → (∀ (a b c : α), a * b * c = a * (b * c)) → NonUnitalRing α
instance NonUnitalRing.toNonUnitalSemiring E0 #
{α : Type u_1} → [self : NonUnitalRing α] → NonUnitalSemiring α
class NonAssocRing E1 #
Type u_1 → Type u_1
A unital but not-necessarily-associative ring.
ctor NonAssocRing.mk E0 #
{α : Type u_1} →
[toNonUnitalNonAssocRing : NonUnitalNonAssocRing α] →
[toOne : One α] →
(∀ (a : α), 1 * a = a) →
(∀ (a : α), a * 1 = a) →
[toNatCast : NatCast α] →
autoParam (↑0 = 0) AddMonoidWithOne.natCast_zero._autoParam →
autoParam (∀ (n : ℕ), ↑(n + 1) = ↑n + 1) AddMonoidWithOne.natCast_succ._autoParam →
[toIntCast : IntCast α] →
autoParam (∀ (n : ℕ), IntCast.intCast ↑n = ↑n) AddGroupWithOne.intCast_ofNat._autoParam →
autoParam (∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1))
AddGroupWithOne.intCast_negSucc._autoParam →
NonAssocRing α
theorem NonAssocRing.natCast_succ E1 #
∀ {α : Type u_1} [self : NonAssocRing α] (n : ℕ), ↑(n + 1) = ↑n + 1
The canonical map ℕ → R is a homomorphism.
instance NonAssocRing.toNonUnitalNonAssocRing E0 #
{α : Type u_1} → [self : NonAssocRing α] → NonUnitalNonAssocRing α
instance NonAssocRing.toAddCommGroupWithOne E0 #
{α : Type u_1} → [self : NonAssocRing α] → AddCommGroupWithOne α
abbrev NonAssocRing.toIntCast E1 #
{α : Type u_1} → [self : NonAssocRing α] → IntCast α
theorem NonAssocRing.natCast_zero E1 #
∀ {α : Type u_1} [self : NonAssocRing α], ↑0 = 0
The canonical map ℕ → R sends 0 : ℕ to 0 : R.
abbrev NonAssocRing.toNatCast E1 #
{α : Type u_1} → [self : NonAssocRing α] → NatCast α
theorem NonAssocRing.mul_one E1 #
∀ {α : Type u_1} [self : NonAssocRing α] (a : α), a * 1 = a
One is a right neutral element for multiplication
abbrev NonAssocRing.toOne E1 #
{α : Type u_1} → [self : NonAssocRing α] → One α
theorem NonAssocRing.one_mul E1 #
∀ {α : Type u_1} [self : NonAssocRing α] (a : α), 1 * a = a
One is a left neutral element for multiplication
instance NonAssocRing.toNonAssocSemiring E0 #
{α : Type u_1} → [self : NonAssocRing α] → NonAssocSemiring α
theorem NonAssocRing.intCast_negSucc E1 #
∀ {α : Type u_1} [self : NonAssocRing α] (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
The canonical homomorphism ℤ → R for negative values is just the negation of the values
of the canonical homomorphism ℕ → R.
theorem NonAssocRing.intCast_ofNat E1 #
∀ {α : Type u_1} [self : NonAssocRing α] (n : ℕ), IntCast.intCast ↑n = ↑n
The canonical homomorphism ℤ → R agrees with the one from ℕ → R on ℕ.
class Semiring E3 #
Type u → Type u
A Semiring is a type with addition, multiplication, a 0 and a 1 where addition is
commutative and associative, multiplication is associative and left and right distributive over
addition, and 0 and 1 are additive and multiplicative identities.
abbrev Semiring.toNatCast E1 #
{α : Type u} → [self : Semiring α] → NatCast α
theorem Semiring.zero_mul E2 #
∀ {α : Type u} [self : Semiring α] (a : α), 0 * a = 0
Zero is a left absorbing element for multiplication
theorem Semiring.left_distrib E2 #
∀ {α : Type u} [self : Semiring α] (a b c : α), a * (b + c) = a * b + a * c
Multiplication is left distributive over addition
theorem Semiring.right_distrib E2 #
∀ {α : Type u} [self : Semiring α] (a b c : α), (a + b) * c = a * c + b * c
Multiplication is right distributive over addition
instance Semiring.toMonoid E0 #
{α : Type u} → [self : Semiring α] → Monoid α
instance Semiring.toNonUnitalSemiring E0 #
{α : Type u} → [self : Semiring α] → NonUnitalSemiring α
ctor Semiring.mk E0 #
{α : Type u} →
[toAddCommMonoid : AddCommMonoid α] →
[toMonoid : Monoid α] →
(∀ (a : α), 0 * a = 0) →
(∀ (a : α), a * 0 = 0) →
(∀ (a b c : α), a * (b + c) = a * b + a * c) →
(∀ (a b c : α), (a + b) * c = a * c + b * c) →
[toNatCast : NatCast α] →
autoParam (↑0 = 0) AddMonoidWithOne.natCast_zero._autoParam →
autoParam (∀ (n : ℕ), ↑(n + 1) = ↑n + 1) AddMonoidWithOne.natCast_succ._autoParam → Semiring α
theorem Semiring.mul_zero E2 #
∀ {α : Type u} [self : Semiring α] (a : α), a * 0 = 0
Zero is a right absorbing element for multiplication
instance Semiring.toNonAssocSemiring E0 #
{α : Type u} → [self : Semiring α] → NonAssocSemiring α
instance Semiring.toAddCommMonoid E0 #
{α : Type u} → [self : Semiring α] → AddCommMonoid α
instance Semiring.toMonoidWithZero E0 #
{α : Type u} → [self : Semiring α] → MonoidWithZero α
theorem Semiring.natCast_succ E1 #
∀ {α : Type u} [self : Semiring α] (n : ℕ), ↑(n + 1) = ↑n + 1
The canonical map ℕ → R is a homomorphism.
theorem Semiring.natCast_zero E1 #
∀ {α : Type u} [self : Semiring α], ↑0 = 0
The canonical map ℕ → R sends 0 : ℕ to 0 : R.
class Ring E3 #
Type u → Type u
A Ring is a Semiring with negation making it an additive group.
ctor Ring.mk E0 #
{R : Type u} →
[toSemiring : Semiring R] →
[toNeg : Neg R] →
[toSub : Sub R] →
[toZSMul : ZSMul R] →
autoParam (∀ (a b : R), a - b = a + -b) SubNegMonoid.sub_eq_add_neg._autoParam →
autoParam (∀ (a : R), 0 • a = 0) SubNegMonoid.zsmul_zero'._autoParam →
autoParam (∀ (n : ℕ) (a : R), ↑n.succ • a = ↑n • a + a) SubNegMonoid.zsmul_succ'._autoParam →
autoParam (∀ (n : ℕ) (a : R), Int.negSucc n • a = -(↑n.succ • a)) SubNegMonoid.zsmul_neg'._autoParam →
(∀ (a : R), -a + a = 0) →
[toIntCast : IntCast R] →
autoParam (∀ (n : ℕ), IntCast.intCast ↑n = ↑n) AddGroupWithOne.intCast_ofNat._autoParam →
autoParam (∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1))
AddGroupWithOne.intCast_negSucc._autoParam →
Ring R
abbrev Ring.toSub E1 #
{R : Type u} → [self : Ring R] → Sub R
abbrev Ring.toNeg E1 #
{R : Type u} → [self : Ring R] → Neg R
theorem Ring.zsmul_neg' E1 #
∀ {R : Type u} [self : Ring R] (n : ℕ) (a : R), Int.negSucc n • a = -(↑n.succ • a)
theorem Ring.neg_add_cancel E1 #
∀ {R : Type u} [self : Ring R] (a : R), -a + a = 0
abbrev Ring.toZSMul E1 #
{R : Type u} → [self : Ring R] → ZSMul R
theorem Ring.sub_eq_add_neg E1 #
∀ {R : Type u} [self : Ring R] (a b : R), a - b = a + -b
theorem Ring.intCast_ofNat E1 #
∀ {R : Type u} [self : Ring R] (n : ℕ), IntCast.intCast ↑n = ↑n
The canonical homomorphism ℤ → R agrees with the one from ℕ → R on ℕ.
instance Ring.toAddCommGroup E0 #
{R : Type u} → [self : Ring R] → AddCommGroup R
theorem Ring.intCast_negSucc E1 #
∀ {R : Type u} [self : Ring R] (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
The canonical homomorphism ℤ → R for negative values is just the negation of the values
of the canonical homomorphism ℕ → R.
theorem Ring.zsmul_zero' E1 #
∀ {R : Type u} [self : Ring R] (a : R), 0 • a = 0
theorem Ring.zsmul_succ' E1 #
∀ {R : Type u} [self : Ring R] (n : ℕ) (a : R), ↑n.succ • a = ↑n • a + a
abbrev Ring.toIntCast E1 #
{R : Type u} → [self : Ring R] → IntCast R
instance Ring.toSemiring E0 #
{R : Type u} → [self : Ring R] → Semiring R
instance Ring.toAddGroupWithOne E0 #
{R : Type u} → [self : Ring R] → AddGroupWithOne R
instance instDistribOfSemiring E0 #
{α : Type u} → [Semiring α] → Distrib α
instance instMulZeroClassOfSemiring E0 #
{α : Type u} → [Semiring α] → MulZeroClass α
instance instMulZeroOneClassOfSemiring E0 #
{α : Type u} → [Semiring α] → MulZeroOneClass α
theorem add_one_mul E1 #
∀ {α : Type u} [inst : Add α] [inst_1 : MulOneClass α] [RightDistribClass α] (a b : α), (a + 1) * b = a * b + b
theorem mul_add_one E1 #
∀ {α : Type u} [inst : Add α] [inst_1 : MulOneClass α] [LeftDistribClass α] (a b : α), a * (b + 1) = a * b + a
theorem one_add_mul E1 #
∀ {α : Type u} [inst : Add α] [inst_1 : MulOneClass α] [RightDistribClass α] (a b : α), (1 + a) * b = b + a * b
theorem mul_one_add E1 #
∀ {α : Type u} [inst : Add α] [inst_1 : MulOneClass α] [LeftDistribClass α] (a b : α), a * (1 + b) = a + a * b
theorem two_mul E1 #
∀ {α : Type u} [inst : NonAssocSemiring α] (n : α), 2 * n = n + n
theorem mul_two E1 #
∀ {α : Type u} [inst : NonAssocSemiring α] (n : α), n * 2 = n + n
theorem nsmul_eq_mul E0 #
∀ {α : Type u} [inst : NonAssocSemiring α] (n : ℕ) (a : α), n • a = ↑n * a
theorem ite_zero_mul E1 #
∀ {α : Type u} [inst : MulZeroClass α] (P : Prop) [inst_1 : Decidable P] (a b : α),
(if P then a else 0) * b = if P then a * b else 0
theorem mul_ite_zero E1 #
∀ {α : Type u} [inst : MulZeroClass α] (P : Prop) [inst_1 : Decidable P] (a b : α),
(a * if P then b else 0) = if P then a * b else 0
theorem ite_zero_mul_ite_zero E1 #
∀ {α : Type u} [inst : MulZeroClass α] (P Q : Prop) [inst_1 : Decidable P] [inst_2 : Decidable Q] (a b : α),
((if P then a else 0) * if Q then b else 0) = if P ∧ Q then a * b else 0
theorem mul_boole E1 #
∀ {α : Type u_1} [inst : MulZeroOneClass α] (P : Prop) [inst_1 : Decidable P] (a : α),
(a * if P then 1 else 0) = if P then a else 0
theorem boole_mul E1 #
∀ {α : Type u_1} [inst : MulZeroOneClass α] (P : Prop) [inst_1 : Decidable P] (a : α),
(if P then 1 else 0) * a = if P then a else 0
class NonUnitalNonAssocCommSemiring E1 #
Type u → Type u
A not-necessarily-unital, not-necessarily-associative, but commutative semiring.
ctor NonUnitalNonAssocCommSemiring.mk E0 #
{α : Type u} →
[toNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring α] →
(∀ (a b : α), a * b = b * a) → NonUnitalNonAssocCommSemiring α
theorem NonUnitalNonAssocCommSemiring.mul_comm E1 #
∀ {α : Type u} [self : NonUnitalNonAssocCommSemiring α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
instance NonUnitalNonAssocCommSemiring.toCommMagma E0 #
{α : Type u} → [self : NonUnitalNonAssocCommSemiring α] → CommMagma α
instance NonUnitalNonAssocCommSemiring.toNonUnitalNonAssocSemiring E0 #
{α : Type u} → [self : NonUnitalNonAssocCommSemiring α] → NonUnitalNonAssocSemiring α
class NonUnitalCommSemiring E1 #
Type u → Type u
A non-unital commutative semiring is a NonUnitalSemiring with commutative multiplication.
In other words, it is a type with the following structures: additive commutative monoid
(AddCommMonoid), commutative semigroup (CommSemigroup), distributive laws (Distrib), and
multiplication by zero law (MulZeroClass).
instance NonUnitalCommSemiring.toCommSemigroup E0 #
{α : Type u} → [self : NonUnitalCommSemiring α] → CommSemigroup α
theorem NonUnitalCommSemiring.mul_comm E1 #
∀ {α : Type u} [self : NonUnitalCommSemiring α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
ctor NonUnitalCommSemiring.mk E0 #
{α : Type u} → [toNonUnitalSemiring : NonUnitalSemiring α] → (∀ (a b : α), a * b = b * a) → NonUnitalCommSemiring α
instance NonUnitalCommSemiring.toNonUnitalSemiring E0 #
{α : Type u} → [self : NonUnitalCommSemiring α] → NonUnitalSemiring α
class NonAssocCommSemiring E1 #
Type u → Type u
A non-associative commutative semiring is a NonAssocSemiring with commutative
multiplication.
ctor NonAssocCommSemiring.mk E0 #
{α : Type u} → [toNonAssocSemiring : NonAssocSemiring α] → (∀ (a b : α), a * b = b * a) → NonAssocCommSemiring α
instance NonAssocCommSemiring.toNonAssocSemiring E0 #
{α : Type u} → [self : NonAssocCommSemiring α] → NonAssocSemiring α
instance NonAssocCommSemiring.toNonUnitalNonAssocCommSemiring E0 #
{α : Type u} → [self : NonAssocCommSemiring α] → NonUnitalNonAssocCommSemiring α
theorem NonAssocCommSemiring.mul_comm E1 #
∀ {α : Type u} [self : NonAssocCommSemiring α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
class CommSemiring E3 #
Type u → Type u
A commutative semiring is a semiring with commutative multiplication.
theorem CommSemiring.mul_comm E1 #
∀ {R : Type u} [self : CommSemiring R] (a b : R), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
instance CommSemiring.toSemiring E0 #
{R : Type u} → [self : CommSemiring R] → Semiring R
instance CommSemiring.toCommMonoid E0 #
{R : Type u} → [self : CommSemiring R] → CommMonoid R
ctor CommSemiring.mk E0 #
{R : Type u} → [toSemiring : Semiring R] → (∀ (a b : R), a * b = b * a) → CommSemiring R
instance NonUnitalCommSemiring.toNonUnitalNonAssocCommSemiring E0 #
{α : Type u} → [NonUnitalCommSemiring α] → NonUnitalNonAssocCommSemiring α
instance CommSemiring.toNonAssocCommSemiring E0 #
{α : Type u} → [CommSemiring α] → NonAssocCommSemiring α
instance CommSemiring.toNonUnitalCommSemiring E0 #
{α : Type u} → [CommSemiring α] → NonUnitalCommSemiring α
instance CommSemiring.toCommMonoidWithZero E0 #
{α : Type u} → [CommSemiring α] → CommMonoidWithZero α
theorem add_mul_self_eq E0 #
∀ {α : Type u} [inst : CommSemiring α] (a b : α), (a + b) * (a + b) = a * a + 2 * a * b + b * b
theorem add_sq E1 #
∀ {α : Type u} [inst : CommSemiring α] (a b : α), (a + b) ^ 2 = a ^ 2 + 2 * a * b + b ^ 2
theorem add_sq' E1 #
∀ {α : Type u} [inst : CommSemiring α] (a b : α), (a + b) ^ 2 = a ^ 2 + b ^ 2 + 2 * a * b
theorem add_pow_two E1 #
∀ {α : Type u} [inst : CommSemiring α] (a b : α), (a + b) ^ 2 = a ^ 2 + 2 * a * b + b ^ 2
Alias of add_sq.
class HasDistribNeg E3 #
(α : Type u_1) → [Mul α] → Type u_1
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.
ctor HasDistribNeg.mk E0 #
{α : Type u_1} →
[inst : Mul α] →
[toInvolutiveNeg : InvolutiveNeg α] →
(∀ (x y : α), -x * y = -(x * y)) → (∀ (x y : α), x * -y = -(x * y)) → HasDistribNeg α
instance HasDistribNeg.toInvolutiveNeg E0 #
{α : Type u_1} → {inst : Mul α} → [self : HasDistribNeg α] → InvolutiveNeg α
theorem HasDistribNeg.neg_mul E1 #
∀ {α : Type u_1} {inst : Mul α} [self : HasDistribNeg α] (x y : α), -x * y = -(x * y)
Negation is left distributive over multiplication
theorem HasDistribNeg.mul_neg E1 #
∀ {α : Type u_1} {inst : Mul α} [self : HasDistribNeg α] (x y : α), x * -y = -(x * y)
Negation is right distributive over multiplication
theorem neg_mul E0 #
∀ {α : Type u} [inst : Mul α] [inst_1 : HasDistribNeg α] (a b : α), -a * b = -(a * b)
theorem mul_neg E0 #
∀ {α : Type u} [inst : Mul α] [inst_1 : HasDistribNeg α] (a b : α), a * -b = -(a * b)
theorem neg_mul_neg E1 #
∀ {α : Type u} [inst : Mul α] [inst_1 : HasDistribNeg α] (a b : α), -a * -b = a * b
theorem neg_mul_eq_neg_mul E1 #
∀ {α : Type u} [inst : Mul α] [inst_1 : HasDistribNeg α] (a b : α), -(a * b) = -a * b
theorem neg_mul_eq_mul_neg E1 #
∀ {α : Type u} [inst : Mul α] [inst_1 : HasDistribNeg α] (a b : α), -(a * b) = a * -b
theorem neg_mul_comm E1 #
∀ {α : Type u} [inst : Mul α] [inst_1 : HasDistribNeg α] (a b : α), -a * b = a * -b
theorem neg_eq_neg_one_mul E1 #
∀ {α : Type u} [inst : MulOneClass α] [inst_1 : HasDistribNeg α] (a : α), -a = -1 * a
theorem mul_neg_one E1 #
∀ {α : Type u} [inst : MulOneClass α] [inst_1 : HasDistribNeg α] (a : α), a * -1 = -a
An element of a ring multiplied by the additive inverse of one is the element's additive inverse.
theorem neg_one_mul E1 #
∀ {α : Type u} [inst : MulOneClass α] [inst_1 : HasDistribNeg α] (a : α), -1 * a = -a
The additive inverse of one multiplied by an element of a ring is the element's additive inverse.
instance MulZeroClass.negZeroClass E0 #
{α : Type u} → [inst : MulZeroClass α] → [HasDistribNeg α] → NegZeroClass α
instance NonUnitalNonAssocRing.toHasDistribNeg E0 #
{α : Type u} → [inst : NonUnitalNonAssocRing α] → HasDistribNeg α
theorem mul_sub_left_distrib E1 #
∀ {α : Type u} [inst : NonUnitalNonAssocRing α] (a b c : α), a * (b - c) = a * b - a * c
theorem mul_sub E1 #
∀ {α : Type u} [inst : NonUnitalNonAssocRing α] (a b c : α), a * (b - c) = a * b - a * c
Alias of mul_sub_left_distrib.
theorem mul_sub_right_distrib E1 #
∀ {α : Type u} [inst : NonUnitalNonAssocRing α] (a b c : α), (a - b) * c = a * c - b * c
theorem sub_mul E1 #
∀ {α : Type u} [inst : NonUnitalNonAssocRing α] (a b c : α), (a - b) * c = a * c - b * c
Alias of mul_sub_right_distrib.
theorem sub_one_mul E1 #
∀ {α : Type u} [inst : NonAssocRing α] (a b : α), (a - 1) * b = a * b - b
theorem mul_sub_one E1 #
∀ {α : Type u} [inst : NonAssocRing α] (a b : α), a * (b - 1) = a * b - a
theorem one_sub_mul E1 #
∀ {α : Type u} [inst : NonAssocRing α] (a b : α), (1 - a) * b = b - a * b
theorem mul_one_sub E1 #
∀ {α : Type u} [inst : NonAssocRing α] (a b : α), a * (1 - b) = a - a * b
theorem mul_one_sub_mul E1 #
∀ {α : Type u} [inst : NonAssocRing α] (a b c : α), a * (1 - b) * c = a * c - a * b * c
instance Ring.toNonUnitalRing E0 #
{α : Type u} → [Ring α] → NonUnitalRing α
instance Ring.toNonAssocRing E0 #
{α : Type u} → [Ring α] → NonAssocRing α
class NonUnitalNonAssocCommRing E1 #
Type u → Type u
A non-unital non-associative commutative ring is a NonUnitalNonAssocRing with commutative
multiplication.
instance NonUnitalNonAssocCommRing.toNonUnitalNonAssocCommSemiring E0 #
{α : Type u} → [self : NonUnitalNonAssocCommRing α] → NonUnitalNonAssocCommSemiring α
instance NonUnitalNonAssocCommRing.toNonUnitalNonAssocRing E0 #
{α : Type u} → [self : NonUnitalNonAssocCommRing α] → NonUnitalNonAssocRing α
ctor NonUnitalNonAssocCommRing.mk E0 #
{α : Type u} →
[toNonUnitalNonAssocRing : NonUnitalNonAssocRing α] → (∀ (a b : α), a * b = b * a) → NonUnitalNonAssocCommRing α
theorem NonUnitalNonAssocCommRing.mul_comm E1 #
∀ {α : Type u} [self : NonUnitalNonAssocCommRing α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
class NonUnitalCommRing E1 #
Type u → Type u
A non-unital commutative ring is a NonUnitalRing with commutative multiplication.
instance NonUnitalCommRing.toNonUnitalNonAssocCommRing E0 #
{α : Type u} → [self : NonUnitalCommRing α] → NonUnitalNonAssocCommRing α
ctor NonUnitalCommRing.mk E0 #
{α : Type u} → [toNonUnitalRing : NonUnitalRing α] → (∀ (a b : α), a * b = b * a) → NonUnitalCommRing α
instance NonUnitalCommRing.toNonUnitalRing E0 #
{α : Type u} → [self : NonUnitalCommRing α] → NonUnitalRing α
theorem NonUnitalCommRing.mul_comm E1 #
∀ {α : Type u} [self : NonUnitalCommRing α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
class NonAssocCommRing E1 #
Type u → Type u
A non-associative commutative ring is a NonAssocRing with commutative multiplication.
instance NonAssocCommRing.toNonAssocCommSemiring E0 #
{α : Type u} → [self : NonAssocCommRing α] → NonAssocCommSemiring α
instance NonAssocCommRing.toNonUnitalNonAssocCommRing E0 #
{α : Type u} → [self : NonAssocCommRing α] → NonUnitalNonAssocCommRing α
ctor NonAssocCommRing.mk E0 #
{α : Type u} → [toNonAssocRing : NonAssocRing α] → (∀ (a b : α), a * b = b * a) → NonAssocCommRing α
instance NonAssocCommRing.toNonAssocRing E0 #
{α : Type u} → [self : NonAssocCommRing α] → NonAssocRing α
theorem NonAssocCommRing.mul_comm E1 #
∀ {α : Type u} [self : NonAssocCommRing α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
instance NonUnitalCommRing.toNonUnitalCommSemiring E0 #
{α : Type u} → [s : NonUnitalCommRing α] → NonUnitalCommSemiring α
class CommRing E3 #
Type u → Type u
A commutative ring is a ring with commutative multiplication.
instance CommRing.toRing E0 #
{α : Type u} → [self : CommRing α] → Ring α
instance CommRing.toCommMonoid E0 #
{α : Type u} → [self : CommRing α] → CommMonoid α
theorem CommRing.mul_comm E2 #
∀ {α : Type u} [self : CommRing α] (a b : α), a * b = b * a
Multiplication is commutative in a commutative multiplicative magma.
ctor CommRing.mk E0 #
{α : Type u} → [toRing : Ring α] → (∀ (a b : α), a * b = b * a) → CommRing α
instance CommRing.toNonAssocCommRing E0 #
{α : Type u} → [CommRing α] → NonAssocCommRing α
instance CommRing.toCommSemiring E0 #
{α : Type u} → [s : CommRing α] → CommSemiring α
instance CommRing.toNonUnitalCommRing E0 #
{α : Type u} → [s : CommRing α] → NonUnitalCommRing α
instance CommRing.toAddCommGroupWithOne E0 #
{α : Type u} → [s : CommRing α] → AddCommGroupWithOne α
class IsDomain E3 #
(α : Type u) → [Semiring α] → Prop
A domain is a nontrivial semiring such that multiplication by a nonzero 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 [CommRing α] [IsDomain α].
ctor IsDomain.mk E0 #
∀ {α : Type u} [inst : Semiring α] [toIsCancelMulZero : IsCancelMulZero α] [toNontrivial : Nontrivial α], IsDomain α
instance IsDomain.toIsCancelMulZero E0 #
∀ {α : Type u} {inst : Semiring α} [self : IsDomain α], IsCancelMulZero α
instance IsDomain.toNontrivial E0 #
∀ {α : Type u} {inst : Semiring α} [self : IsDomain α], Nontrivial α
def IsMulCommutative.instNonUnitalNonAssocCommSemiring E1 #
{R : Type v} → [inst : NonUnitalNonAssocSemiring R] → [IsMulCommutative R] → NonUnitalNonAssocCommSemiring R
A NonUnitalNonAssocSemiring which IsMulCommutative is a NonUnitalNonAssocCommSemiring.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instNonUnitalCommSemiring E1 #
{R : Type v} → [inst : NonUnitalSemiring R] → [IsMulCommutative R] → NonUnitalCommSemiring R
A NonUnitalSemiring which IsMulCommutative is a NonUnitalCommSemiring.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instNonUnitalNonAssocCommRing E1 #
{R : Type v} → [inst : NonUnitalNonAssocRing R] → [IsMulCommutative R] → NonUnitalNonAssocCommRing R
A NonUnitalNonAssocRing which IsMulCommutative is a NonUnitalNonAssocCommRing.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instNonUnitalCommRing E1 #
{R : Type v} → [inst : NonUnitalRing R] → [IsMulCommutative R] → NonUnitalCommRing R
A NonUnitalRing which IsMulCommutative is a NonUnitalCommRing.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instNonAssocCommSemiring E1 #
{R : Type v} → [inst : NonAssocSemiring R] → [IsMulCommutative R] → NonAssocCommSemiring R
A NonAssocSemiring which IsMulCommutative is a NonAssocCommSemiring.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instCommSemiring E1 #
{R : Type v} → [inst : Semiring R] → [IsMulCommutative R] → CommSemiring R
A Semiring which IsMulCommutative is a CommSemiring.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instNonAssocCommRing E1 #
{R : Type v} → [inst : NonAssocRing R] → [IsMulCommutative R] → NonAssocCommRing R
A NonAssocRing which IsMulCommutative is a NonAssocCommRing.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
def IsMulCommutative.instCommRing E1 #
{R : Type v} → [inst : Ring R] → [IsMulCommutative R] → CommRing R
A Ring which IsMulCommutative is a CommRing.
This is primarily used to deduce the bundled version from the unbundled one for commutative
subobjects in a noncommutative ambient type. As such this is only available inside the
IsMulCommutative scope so as to avoid deleterious effects to type class synthesis for bundled
commutativity.
See note [commutative subobjects].
abbrev IsUnital.toNonAssocSemiring E1 #
{A : Type u_1} → [inst : NonUnitalNonAssocSemiring A] → [IsUnital A] → NonAssocSemiring A
A unital non-associative semiring is a non-associative semiring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toNonAssocCommSemiring E1 #
{A : Type u_1} → [inst : NonUnitalNonAssocCommSemiring A] → [IsUnital A] → NonAssocCommSemiring A
A unital non-unital non-associative commutative semiring is a non-associative commutative semiring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toSemiring E1 #
{A : Type u_1} → [inst : NonUnitalSemiring A] → [IsUnital A] → Semiring A
A unital non-unital semiring is a semiring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toCommSemiring E1 #
{A : Type u_1} → [inst : NonUnitalCommSemiring A] → [IsUnital A] → CommSemiring A
A unital non-unital commutative semiring is a commutative semiring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toNonAssocRing E1 #
{A : Type u_1} → [inst : NonUnitalNonAssocRing A] → [IsUnital A] → NonAssocRing A
A unital non-unital non-associative ring is a non-associative ring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toNonAssocCommRing E1 #
{A : Type u_1} → [inst : NonUnitalNonAssocCommRing A] → [IsUnital A] → NonAssocCommRing A
A unital non-unital non-associative commutative ring is a non-associative commutative ring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toRing E1 #
{A : Type u_1} → [inst : NonUnitalRing A] → [IsUnital A] → Ring A
A unital non-unital ring is a ring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.
abbrev IsUnital.toCommRing E1 #
{A : Type u_1} → [inst : NonUnitalCommRing A] → [IsUnital A] → CommRing A
A unital non-unital commutative ring is a commutative ring.
This constructor is primarily intended to be used within proofs since it creates bad definitional equalities.