Skip to the content.
← CommGroup Index Next: Integers example →

Recall

Formal definitions cited in this section, gathered here for quick reference (full citations in the Bibliography):

structure Ring (R : Type) where
  addGrp : CommGroup R
  mul : R  R  R
  one : R
  mul_assoc :  a b c : R, mul (mul a b) c = mul a (mul b c)
  one_mul :  a : R, mul one a = a
  mul_one :  a : R, mul a one = a
  left_distrib :  a b c : R, mul a (addGrp.op b c) = addGrp.op (mul a b) (mul a c)
  right_distrib :  a b c : R, mul (addGrp.op a b) c = addGrp.op (mul a c) (mul b c)

Consider each field in turn:

addGrp.op will be written constantly below; notation-free helper abbreviations could be defined later. For now everything is spelled out so each usage is traceable to the definition above.

Mathematical reading. Ring R is exactly the textbook definition of a (unital, not-necessarily-commutative) ring, presented as a tuple \(\Big(\,(R,+,0,-)\in\mathbf{Ab},\ \cdot : R\times R\to R,\ 1\in R,\ \text{proofs of }(\mathrm{R2}),(\mathrm{R3}),(\mathrm{R4})\,\Big).\) The field addGrp is the underlying additive abelian group, so a ring is “an abelian group $(R,+)$ carrying a compatible monoid structure $(R,\cdot,1)$” — a monoid (a set with an associative operation and identity element, i.e. a group without inverses). The remaining fields say $(R,\cdot,1)$ is a monoid (mul_assoc, one_mul, mul_one) and that the two operations interact through the two-sided distributive laws — that is, multiplication is compatible with addition on both sides. Nesting addGrp as a whole substructure mirrors the forgetful functor $\mathbf{Ring}\to\mathbf{Ab}$ sending a ring to its additive group.

Read more: Mathlib’s Ring (Mathlib.Algebra.Ring.Defs) sits inside a much larger hierarchy — Semiring, NonUnitalRing, CommRing, DivisionRing, Field — each adding or dropping exactly one axiom compared to its neighbors; see Chapter 13. For the classical (non-Lean) statement of these axioms and their standard consequences, Dummit & Foote’s Abstract Algebra or Aluffi’s Algebra: Chapter 0 (the latter using the same categorical framing this book uses) are standard references.

References

Full citations in the Bibliography. Formal definitions are gathered in Recall, above.


← CommGroup Index Next: Integers example →
Try Lean
Lean playground · v1.4.18