Type tags that turn additive structures into multiplicative, and vice versa #
We define two type tags:
Additive α
: turns any multiplicative structure onα
into the corresponding additive structure onAdditive α
;Multiplicative α
: turns any additive structure onα
into the corresponding multiplicative structure onMultiplicative α
.
We also define instances Additive.*
and Multiplicative.*
that actually transfer the structures.
See also #
This file is similar to Order.Synonym
.
Porting notes #
- Since bundled morphism applications that rely on
CoeFun
currently don't work, they are ported astoFoo a
rather thana.toFoo
for now. (https://github.com/leanprover/lean4/issues/1910)
If α
carries some additive structure, then Multiplicative α
carries the corresponding
multiplicative structure.
Equations
- Multiplicative α = α
Instances For
Recursion principle for Additive
, supported by cases
and induction
.
Equations
- Additive.rec ofMul a = ofMul (Additive.toMul a)
Instances For
Reinterpret x : α
as an element of Multiplicative α
.
Equations
- Multiplicative.ofAdd = { toFun := fun (x : α) => x, invFun := fun (x : Multiplicative α) => x, left_inv := ⋯, right_inv := ⋯ }
Instances For
Reinterpret x : Multiplicative α
as an element of α
.
Equations
- Multiplicative.toAdd = Multiplicative.ofAdd.symm
Instances For
Recursion principle for Multiplicative
, supported by cases
and induction
.
Equations
- Multiplicative.rec ofAdd a = ofAdd (Multiplicative.toAdd a)
Instances For
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- instInhabitedMultiplicative = { default := Multiplicative.ofAdd default }
Equations
- instUniqueMultiplicative = Multiplicative.toAdd.unique
Equations
- ⋯ = ⋯
Equations
- ⋯ = h
Equations
- instDecidableEqMultiplicative = h
Equations
- instDecidableEqAdditive = h
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- Multiplicative.mul = { mul := fun (x y : Multiplicative α) => Multiplicative.ofAdd (Multiplicative.toAdd x + Multiplicative.toAdd y) }
Equations
- Additive.addSemigroup = AddSemigroup.mk ⋯
Equations
- Multiplicative.semigroup = Semigroup.mk ⋯
Equations
- Additive.addCommSemigroup = AddCommSemigroup.mk ⋯
Equations
- Multiplicative.commSemigroup = CommSemigroup.mk ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- Additive.addLeftCancelSemigroup = AddLeftCancelSemigroup.mk ⋯
Equations
- Multiplicative.leftCancelSemigroup = LeftCancelSemigroup.mk ⋯
Equations
- Additive.addRightCancelSemigroup = AddRightCancelSemigroup.mk ⋯
Equations
- Multiplicative.rightCancelSemigroup = RightCancelSemigroup.mk ⋯
Equations
- instOneMultiplicativeOfZero = { one := Multiplicative.ofAdd 0 }
Equations
- Additive.addZeroClass = AddZeroClass.mk ⋯ ⋯
Equations
- Multiplicative.mulOneClass = MulOneClass.mk ⋯ ⋯
Equations
- Additive.addMonoid = AddMonoid.mk ⋯ ⋯ Monoid.npow ⋯ ⋯
Equations
- Additive.addLeftCancelMonoid = AddLeftCancelMonoid.mk ⋯
Equations
- Multiplicative.leftCancelMonoid = LeftCancelMonoid.mk ⋯
Equations
- Additive.addRightCancelMonoid = AddRightCancelMonoid.mk ⋯
Equations
- Multiplicative.rightCancelMonoid = RightCancelMonoid.mk ⋯
Equations
- Additive.addCommMonoid = AddCommMonoid.mk ⋯
Equations
- Multiplicative.commMonoid = CommMonoid.mk ⋯
Equations
- Multiplicative.inv = { inv := fun (x : Multiplicative α) => Additive.ofMul (-Multiplicative.toAdd x) }
Equations
- Multiplicative.div = { div := fun (x y : Multiplicative α) => Multiplicative.ofAdd (Multiplicative.toAdd x - Multiplicative.toAdd y) }
Equations
- Additive.involutiveNeg = InvolutiveNeg.mk ⋯
Equations
- Multiplicative.involutiveInv = InvolutiveInv.mk ⋯
Equations
- Additive.subNegMonoid = SubNegMonoid.mk ⋯ DivInvMonoid.zpow ⋯ ⋯ ⋯
Equations
- Multiplicative.divInvMonoid = DivInvMonoid.mk ⋯ SubNegMonoid.zsmul ⋯ ⋯ ⋯
Equations
- Additive.subtractionMonoid = SubtractionMonoid.mk ⋯ ⋯ ⋯
Equations
- Multiplicative.divisionMonoid = DivisionMonoid.mk ⋯ ⋯ ⋯
Equations
- Additive.subtractionCommMonoid = SubtractionCommMonoid.mk ⋯
Equations
- Multiplicative.divisionCommMonoid = DivisionCommMonoid.mk ⋯
Equations
- Additive.addGroup = AddGroup.mk ⋯
Equations
- Additive.addCommGroup = AddCommGroup.mk ⋯
Equations
- Multiplicative.commGroup = CommGroup.mk ⋯
Reinterpret α →+ β
as Multiplicative α →* Multiplicative β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reinterpret α →* β
as Additive α →+ Additive β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reinterpret Additive α →+ β
as α →* Multiplicative β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reinterpret α →* Multiplicative β
as Additive α →+ β
.
Equations
- MonoidHom.toAdditive' = AddMonoidHom.toMultiplicative'.symm
Instances For
Reinterpret α →+ Additive β
as Multiplicative α →* β
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reinterpret Multiplicative α →* β
as α →+ Additive β
.
Equations
- MonoidHom.toAdditive'' = AddMonoidHom.toMultiplicative''.symm
Instances For
If α
has some multiplicative structure and coerces to a function,
then Additive α
should also coerce to the same function.
This allows Additive
to be used on bundled function types with a multiplicative structure, which
is often used for composition, without affecting the behavior of the function itself.
Equations
- Additive.coeToFun = { coe := fun (a : Additive α) => CoeFun.coe (Additive.toMul a) }
If α
has some additive structure and coerces to a function,
then Multiplicative α
should also coerce to the same function.
This allows Multiplicative
to be used on bundled function types with an additive structure, which
is often used for composition, without affecting the behavior of the function itself.
Equations
- Multiplicative.coeToFun = { coe := fun (a : Multiplicative α) => CoeFun.coe (Multiplicative.toAdd a) }