Adjoining a zero/one to semigroups and related algebraic structures #
This file contains different results about adjoining an element to an algebraic structure which then
behaves like a zero or a one. An example is adjoining a one to a semigroup to obtain a monoid. That
this provides an example of an adjunction is proved in
Mathlib.Algebra.Category.MonCat.Adjunctions
.
Another result says that adjoining to a group an element zero
gives a GroupWithZero
. For more
information about these structures (which are not that standard in informal mathematics, see
Mathlib.Algebra.GroupWithZero.Basic
)
TODO #
WithOne.coe_mul
and WithZero.coe_mul
have inconsistent use of implicit parameters
Add an extra element 1
to a type
Add an extra element 0
to a type
Instances For
- WithOne.instReprWithZero
- WithZero.add
- WithZero.addCommMonoid
- WithZero.addMonoid
- WithZero.addMonoidWithOne
- WithZero.addZeroClass
- WithZero.canLift
- WithZero.canonicallyOrderedAdd
- WithZero.coeTC
- WithZero.commGroupWithZero
- WithZero.commMonoidWithZero
- WithZero.commSemigroup
- WithZero.div
- WithZero.divInvMonoid
- WithZero.divInvOneMonoid
- WithZero.divisionCommMonoid
- WithZero.divisionMonoid
- WithZero.existsAddOfLE
- WithZero.groupWithZero
- WithZero.inhabited
- WithZero.instLinearOrderedCommGroupWithZero
- WithZero.instLinearOrderedCommMonoidWithZero
- WithZero.instPowInt
- WithZero.instRepr
- WithZero.inv
- WithZero.invOneClass
- WithZero.involutiveInv
- WithZero.lattice
- WithZero.linearOrder
- WithZero.monad
- WithZero.monoidWithZero
- WithZero.mulLeftMono
- WithZero.mulLeftReflectLT
- WithZero.mulZeroClass
- WithZero.mulZeroOneClass
- WithZero.neg
- WithZero.negZeroClass
- WithZero.noZeroDivisors
- WithZero.nontrivial
- WithZero.one
- WithZero.orderBot
- WithZero.orderedCommMonoid
- WithZero.partialOrder
- WithZero.pow
- WithZero.preorder
- WithZero.semigroupWithZero
- WithZero.zero
Equations
- WithOne.instReprWithZero = { reprPrec := fun (o : WithZero α) (x : ℕ) => match o with | none => Std.Format.text "0" | some a => Std.Format.text "↑" ++ repr a }
Equations
- WithOne.instRepr = { reprPrec := fun (o : WithOne α) (x : ℕ) => match o with | none => Std.Format.text "1" | some a => Std.Format.text "↑" ++ repr a }
Equations
- WithZero.instRepr = { reprPrec := fun (o : WithZero α) (x : ℕ) => match o with | none => Std.Format.text "1" | some a => Std.Format.text "↑" ++ repr a }
Equations
- WithZero.zero = { zero := none }
Equations
- WithOne.mul = { mul := Option.liftOrGet fun (x1 x2 : α) => x1 * x2 }
Equations
- WithZero.add = { add := Option.liftOrGet fun (x1 x2 : α) => x1 + x2 }
Equations
- WithOne.inv = { inv := fun (a : WithOne α) => Option.map Inv.inv a }
Equations
- WithZero.neg = { neg := fun (a : WithZero α) => Option.map Neg.neg a }
Equations
Equations
Equations
- WithOne.inhabited = { default := 1 }
Equations
- WithZero.inhabited = { default := 0 }
Equations
- WithOne.coeTC = { coe := WithOne.coe }
Equations
- WithZero.coeTC = { coe := WithZero.coe }
Recursor for WithOne
using the preferred forms 1
and ↑a
.
Equations
- WithOne.recOneCoe h₁ h₂ none = h₁
- WithOne.recOneCoe h₁ h₂ (some a) = h₂ a
Recursor for WithZero
using the preferred forms 0
and ↑a
.
Equations
- WithZero.recZeroCoe h₁ h₂ none = h₁
- WithZero.recZeroCoe h₁ h₂ (some a) = h₂ a
Deconstruct an x : WithOne α
to the underlying value in α
, given a proof that x ≠ 1
.
Equations
- WithOne.unone x_3 = x_2
Deconstruct an x : WithZero α
to the underlying value in α
, given a proof that x ≠ 0
.
Equations
- WithZero.unzero x_3 = x_2
Equations
Equations
Equations
- WithOne.monoid = Monoid.mk ⋯ ⋯ npowRecAuto ⋯ ⋯
Equations
- WithZero.addMonoid = AddMonoid.mk ⋯ ⋯ nsmulRecAuto ⋯ ⋯