Module docstring
{"# Semirings and rings
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.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 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
"}