# 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 on Additive α;
• Multiplicative α: turns any additive structure on α into the corresponding multiplicative structure on Multiplicative α.

We also define instances Additive.* and Multiplicative.* that actually transfer the structures.

This file is similar to Order.Synonym.

## Porting notes #

def Additive (α : Type u_1) :
Type u_1

If α carries some multiplicative structure, then Additive α carries the corresponding additive structure.

Equations
• = α
Instances For
def Multiplicative (α : Type u_1) :
Type u_1

If α carries some additive structure, then Multiplicative α carries the corresponding multiplicative structure.

Equations
Instances For
def Additive.ofMul {α : Type u} :
α

Reinterpret x : α as an element of Additive α.

Equations
• Additive.ofMul = { toFun := fun (x : α) => x, invFun := fun (x : ) => x, left_inv := , right_inv := }
Instances For
def Additive.toMul {α : Type u} :
α

Reinterpret x : Additive α as an element of α.

Equations
Instances For
@[simp]
theorem Additive.ofMul_symm_eq {α : Type u} :
@[simp]
theorem Additive.toMul_symm_eq {α : Type u} :
@[simp]
theorem Additive.forall {α : Type u} {p : Prop} :
(∀ (a : ), p a) ∀ (a : α), p (Additive.ofMul a)
@[simp]
theorem Additive.exists {α : Type u} {p : Prop} :
(∃ (a : ), p a) ∃ (a : α), p (Additive.ofMul a)
def Additive.rec {α : Type u} {motive : Sort u_1} (ofMul : (a : α) → motive (Additive.ofMul a)) (a : ) :
motive a

Recursion principle for Additive, supported by cases and induction.

Equations
Instances For
def Multiplicative.ofAdd {α : Type u} :

Reinterpret x : α as an element of Multiplicative α.

Equations
• Multiplicative.ofAdd = { toFun := fun (x : α) => x, invFun := fun (x : ) => x, left_inv := , right_inv := }
Instances For
def Multiplicative.toAdd {α : Type u} :

Reinterpret x : Multiplicative α as an element of α.

Equations
Instances For
@[simp]
theorem Multiplicative.ofAdd_symm_eq {α : Type u} :
@[simp]
theorem Multiplicative.toAdd_symm_eq {α : Type u} :
@[simp]
theorem Multiplicative.forall {α : Type u} {p : } :
(∀ (a : ), p a) ∀ (a : α), p (Multiplicative.ofAdd a)
@[simp]
theorem Multiplicative.exists {α : Type u} {p : } :
(∃ (a : ), p a) ∃ (a : α), p (Multiplicative.ofAdd a)
def Multiplicative.rec {α : Type u} {motive : Sort u_1} (ofAdd : (a : α) → motive (Multiplicative.ofAdd a)) (a : ) :
motive a

Recursion principle for Multiplicative, supported by cases and induction.

Equations
Instances For
@[simp]
@[simp]
@[simp]
theorem toMul_ofMul {α : Type u} (x : α) :
@[simp]
theorem ofMul_toMul {α : Type u} (x : ) :
instance instSubsingletonAdditive {α : Type u} [] :
Equations
• =
instance instSubsingletonMultiplicative {α : Type u} [] :
Equations
• =
instance instInhabitedAdditive {α : Type u} [] :
Equations
instance instInhabitedMultiplicative {α : Type u} [] :
Equations
• instInhabitedMultiplicative = { default := Multiplicative.ofAdd default }
instance instUniqueAdditive {α : Type u} [] :
Equations
instance instUniqueMultiplicative {α : Type u} [] :
Equations
instance instFiniteAdditive {α : Type u} [] :
Equations
• =
instance instFiniteMultiplicative {α : Type u} [] :
Equations
• =
instance instInfiniteAdditive {α : Type u} [h : ] :
Equations
• = h
instance instInfiniteMultiplicative {α : Type u} [h : ] :
Equations
• = h
instance instDecidableEqMultiplicative {α : Type u} [h : ] :
Equations
• instDecidableEqMultiplicative = h
instance instDecidableEqAdditive {α : Type u} [h : ] :
Equations
instance Additive.instNontrivial {α : Type u} [] :
Equations
• =
instance Multiplicative.instNontrivial {α : Type u} [] :
Equations
• =
Equations
instance Multiplicative.mul {α : Type u} [Add α] :
Equations
• Multiplicative.mul = { mul := fun (x y : ) => Multiplicative.ofAdd (Multiplicative.toAdd x + Multiplicative.toAdd y) }
@[simp]
@[simp]
theorem toAdd_mul {α : Type u} [Add α] (x : ) (y : ) :
@[simp]
theorem ofMul_mul {α : Type u} [Mul α] (x : α) (y : α) :
@[simp]
theorem toMul_add {α : Type u} [Mul α] (x : ) (y : ) :
Equations
instance Multiplicative.semigroup {α : Type u} [] :
Equations
• Multiplicative.semigroup =
Equations
instance Multiplicative.commSemigroup {α : Type u} [] :
Equations
• Multiplicative.commSemigroup =
Equations
• =
instance Multiplicative.isLeftCancelMul {α : Type u} [Add α] [] :
Equations
• =
Equations
• =
instance Multiplicative.isRightCancelMul {α : Type u} [Add α] [] :
Equations
• =
Equations
• =
instance Multiplicative.isCancelMul {α : Type u} [Add α] [] :
Equations
• =
Equations
Equations
• Multiplicative.leftCancelSemigroup =
Equations
Equations
• Multiplicative.rightCancelSemigroup =
instance instZeroAdditiveOfOne {α : Type u} [One α] :
Equations
@[simp]
theorem ofMul_one {α : Type u} [One α] :
@[simp]
theorem ofMul_eq_zero {A : Type u_1} [One A] {x : A} :
Additive.ofMul x = 0 x = 1
@[simp]
theorem toMul_zero {α : Type u} [One α] :
@[simp]
theorem toMul_eq_one {α : Type u_1} [One α] {x : } :
Additive.toMul x = 1 x = 0
instance instOneMultiplicativeOfZero {α : Type u} [Zero α] :
Equations
• instOneMultiplicativeOfZero = { one := Multiplicative.ofAdd 0 }
@[simp]
theorem ofAdd_zero {α : Type u} [Zero α] :
@[simp]
theorem ofAdd_eq_one {A : Type u_1} [Zero A] {x : A} :
Multiplicative.ofAdd x = 1 x = 0
@[simp]
theorem toAdd_one {α : Type u} [Zero α] :
@[simp]
theorem toAdd_eq_zero {α : Type u_1} [Zero α] {x : } :
Multiplicative.toAdd x = 0 x = 1
Equations
instance Multiplicative.mulOneClass {α : Type u} [] :
Equations
• Multiplicative.mulOneClass =
Equations
instance Multiplicative.monoid {α : Type u} [h : ] :
Equations
@[simp]
theorem ofMul_pow {α : Type u} [] (n : ) (a : α) :
@[simp]
theorem toMul_nsmul {α : Type u} [] (n : ) (a : ) :
@[simp]
theorem ofAdd_nsmul {α : Type u} [] (n : ) (a : α) :
@[simp]
theorem toAdd_pow {α : Type u} [] (a : ) (n : ) :
Equations
Equations
• Multiplicative.leftCancelMonoid =
Equations
Equations
• Multiplicative.rightCancelMonoid =
Equations
instance Multiplicative.commMonoid {α : Type u} [] :
Equations
• Multiplicative.commMonoid =
instance Additive.neg {α : Type u} [Inv α] :
Equations
@[simp]
theorem ofMul_inv {α : Type u} [Inv α] (x : α) :
@[simp]
theorem toMul_neg {α : Type u} [Inv α] (x : ) :
instance Multiplicative.inv {α : Type u} [Neg α] :
Equations
• Multiplicative.inv = { inv := fun (x : ) => Additive.ofMul (-Multiplicative.toAdd x) }
@[simp]
theorem ofAdd_neg {α : Type u} [Neg α] (x : α) :
@[simp]
theorem toAdd_inv {α : Type u} [Neg α] (x : ) :
instance Additive.sub {α : Type u} [Div α] :
Equations
instance Multiplicative.div {α : Type u} [Sub α] :
Equations
• Multiplicative.div = { div := fun (x y : ) => Multiplicative.ofAdd (Multiplicative.toAdd x - Multiplicative.toAdd y) }
@[simp]
theorem ofAdd_sub {α : Type u} [Sub α] (x : α) (y : α) :
@[simp]
theorem toAdd_div {α : Type u} [Sub α] (x : ) (y : ) :
@[simp]
theorem ofMul_div {α : Type u} [Div α] (x : α) (y : α) :
@[simp]
theorem toMul_sub {α : Type u} [Div α] (x : ) (y : ) :
instance Additive.involutiveNeg {α : Type u} [] :
Equations
instance Multiplicative.involutiveInv {α : Type u} [] :
Equations
• Multiplicative.involutiveInv =
instance Additive.subNegMonoid {α : Type u} [] :
Equations
instance Multiplicative.divInvMonoid {α : Type u} [] :
Equations
• Multiplicative.divInvMonoid = DivInvMonoid.mk SubNegMonoid.zsmul
@[simp]
theorem ofMul_zpow {α : Type u} [] (z : ) (a : α) :
@[simp]
theorem toMul_zsmul {α : Type u} [] (z : ) (a : ) :
@[simp]
theorem ofAdd_zsmul {α : Type u} [] (z : ) (a : α) :
@[simp]
theorem toAdd_zpow {α : Type u} [] (a : ) (z : ) :
instance Additive.subtractionMonoid {α : Type u} [] :
Equations
Equations
• Multiplicative.divisionMonoid =
Equations
Equations
• Multiplicative.divisionCommMonoid =
Equations
instance Multiplicative.group {α : Type u} [] :
Equations
• Multiplicative.group =
Equations
instance Multiplicative.commGroup {α : Type u} [] :
Equations
• Multiplicative.commGroup =
@[simp]
theorem AddMonoidHom.toMultiplicative_apply_apply {α : Type u} {β : Type v} [] [] (f : α →+ β) (a : ) :
@[simp]
theorem AddMonoidHom.toMultiplicative_symm_apply_apply {α : Type u} {β : Type v} [] [] (f : ) (a : α) :
def AddMonoidHom.toMultiplicative {α : Type u} {β : Type v} [] [] :
(α →+ β)

Reinterpret α →+ β as Multiplicative α →* Multiplicative β.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AddMonoidHom.coe_toMultiplicative {α : Type u} {β : Type v} [] [] (f : α →+ β) :
@[simp]
theorem MonoidHom.toAdditive_apply_apply {α : Type u} {β : Type v} [] [] (f : α →* β) (a : ) :
@[simp]
theorem MonoidHom.toAdditive_symm_apply_apply {α : Type u} {β : Type v} [] [] (f : ) (a : α) :
def MonoidHom.toAdditive {α : Type u} {β : Type v} [] [] :
(α →* β) ( →+ )

Reinterpret α →* β as Additive α →+ Additive β.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem MonoidHom.coe_toMultiplicative {α : Type u} {β : Type v} [] [] (f : α →* β) :
@[simp]
theorem AddMonoidHom.toMultiplicative'_apply_apply {α : Type u} {β : Type v} [] [] (f : →+ β) (a : α) :
@[simp]
theorem AddMonoidHom.toMultiplicative'_symm_apply_apply {α : Type u} {β : Type v} [] [] (f : ) (a : ) :
def AddMonoidHom.toMultiplicative' {α : Type u} {β : Type v} [] [] :
( →+ β) (α →* )

Reinterpret Additive α →+ β as α →* Multiplicative β.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AddMonoidHom.coe_toMultiplicative' {α : Type u} {β : Type v} [] [] (f : →+ β) :
@[simp]
theorem MonoidHom.toAdditive'_symm_apply_apply {α : Type u} {β : Type v} [] [] :
@[simp]
theorem MonoidHom.toAdditive'_apply_apply {α : Type u} {β : Type v} [] [] :
def MonoidHom.toAdditive' {α : Type u} {β : Type v} [] [] :
(α →* ) ( →+ β)

Reinterpret α →* Multiplicative β as Additive α →+ β.

Equations
Instances For
@[simp]
theorem MonoidHom.coe_toAdditive' {α : Type u} {β : Type v} [] [] (f : ) :
@[simp]
theorem AddMonoidHom.toMultiplicative''_apply_apply {α : Type u} {β : Type v} [] [] (f : α →+ ) (a : ) :
@[simp]
theorem AddMonoidHom.toMultiplicative''_symm_apply_apply {α : Type u} {β : Type v} [] [] (f : ) (a : α) :
def AddMonoidHom.toMultiplicative'' {α : Type u} {β : Type v} [] [] :
(α →+ ) ( →* β)

Reinterpret α →+ Additive β as Multiplicative α →* β.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AddMonoidHom.coe_toMultiplicative'' {α : Type u} {β : Type v} [] [] (f : α →+ ) :
@[simp]
theorem MonoidHom.toAdditive''_apply_apply {α : Type u} {β : Type v} [] [] :
@[simp]
theorem MonoidHom.toAdditive''_symm_apply_apply {α : Type u} {β : Type v} [] [] :
∀ (a : α →+ ) (a_1 : ), (MonoidHom.toAdditive''.symm a) a_1 = Additive.toMul (a (Multiplicative.toAdd a_1))
def MonoidHom.toAdditive'' {α : Type u} {β : Type v} [] [] :
( →* β) (α →+ )

Reinterpret Multiplicative α →* β as α →+ Additive β.

Equations
Instances For
@[simp]
theorem MonoidHom.coe_toAdditive'' {α : Type u} {β : Type v} [] [] (f : ) :
instance Additive.coeToFun {α : Type u_1} {β : αSort u_2} [CoeFun α β] :

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 : ) => CoeFun.coe (Additive.toMul a) }
instance Multiplicative.coeToFun {α : Type u_1} {β : αSort u_2} [CoeFun α β] :
CoeFun fun (a : ) => β (Multiplicative.toAdd 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 : ) => CoeFun.coe (Multiplicative.toAdd a) }