Documentation

Mathlib.Algebra.Group.TypeTags.Basic

Type tags that turn additive structures into multiplicative, and vice versa #

We define two type tags:

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

See also #

This file is similar to Order.Synonym.

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 : Additive α) => 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.forall {α : Type u} {p : Additive αProp} :
          (∀ (a : Additive α), p a) ∀ (a : α), p (Additive.ofMul a)
          @[simp]
          theorem Additive.exists {α : Type u} {p : Additive αProp} :
          (∃ (a : Additive α), p a) ∃ (a : α), p (Additive.ofMul a)
          def Additive.rec {α : Type u} {motive : Additive αSort u_1} (ofMul : (a : α) → motive (Additive.ofMul a)) (a : Additive α) :
          motive a

          Recursion principle for Additive, supported by cases and induction.

          Equations
          Instances For

            Reinterpret x : α as an element of Multiplicative α.

            Equations
            Instances For

              Reinterpret x : Multiplicative α as an element of α.

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

                Recursion principle for Multiplicative, supported by cases and induction.

                Equations
                Instances For
                  @[simp]
                  theorem toAdd_ofAdd {α : Type u} (x : α) :
                  Multiplicative.toAdd (Multiplicative.ofAdd x) = x
                  @[simp]
                  theorem ofAdd_toAdd {α : Type u} (x : Multiplicative α) :
                  Multiplicative.ofAdd (Multiplicative.toAdd x) = x
                  @[simp]
                  theorem toMul_ofMul {α : Type u} (x : α) :
                  Additive.toMul (Additive.ofMul x) = x
                  @[simp]
                  theorem ofMul_toMul {α : Type u} (x : Additive α) :
                  Additive.ofMul (Additive.toMul x) = x
                  Equations
                  Equations
                  instance Additive.add {α : Type u} [Mul α] :
                  Equations
                  instance Multiplicative.mul {α : Type u} [Add α] :
                  Equations
                  @[simp]
                  theorem ofAdd_add {α : Type u} [Add α] (x y : α) :
                  Multiplicative.ofAdd (x + y) = Multiplicative.ofAdd x * Multiplicative.ofAdd y
                  @[simp]
                  theorem toAdd_mul {α : Type u} [Add α] (x y : Multiplicative α) :
                  Multiplicative.toAdd (x * y) = Multiplicative.toAdd x + Multiplicative.toAdd y
                  @[simp]
                  theorem ofMul_mul {α : Type u} [Mul α] (x y : α) :
                  Additive.ofMul (x * y) = Additive.ofMul x + Additive.ofMul y
                  @[simp]
                  theorem toMul_add {α : Type u} [Mul α] (x y : Additive α) :
                  Additive.toMul (x + y) = Additive.toMul x * Additive.toMul y
                  instance instZeroAdditiveOfOne {α : Type u} [One α] :
                  Equations
                  @[simp]
                  theorem ofMul_one {α : Type u} [One α] :
                  Additive.ofMul 1 = 0
                  @[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 α] :
                  Additive.toMul 0 = 1
                  @[simp]
                  theorem toMul_eq_one {α : Type u_1} [One α] {x : Additive α} :
                  Additive.toMul x = 1 x = 0
                  Equations
                  @[simp]
                  theorem ofAdd_zero {α : Type u} [Zero α] :
                  Multiplicative.ofAdd 0 = 1
                  @[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 α] :
                  Multiplicative.toAdd 1 = 0
                  @[simp]
                  theorem toAdd_eq_zero {α : Type u_1} [Zero α] {x : Multiplicative α} :
                  Multiplicative.toAdd x = 0 x = 1
                  instance Additive.addMonoid {α : Type u} [h : Monoid α] :
                  Equations
                  @[simp]
                  theorem ofMul_pow {α : Type u} [Monoid α] (n : ) (a : α) :
                  Additive.ofMul (a ^ n) = n Additive.ofMul a
                  @[simp]
                  theorem toMul_nsmul {α : Type u} [Monoid α] (n : ) (a : Additive α) :
                  Additive.toMul (n a) = Additive.toMul a ^ n
                  @[simp]
                  theorem ofAdd_nsmul {α : Type u} [AddMonoid α] (n : ) (a : α) :
                  Multiplicative.ofAdd (n a) = Multiplicative.ofAdd a ^ n
                  @[simp]
                  theorem toAdd_pow {α : Type u} [AddMonoid α] (a : Multiplicative α) (n : ) :
                  Multiplicative.toAdd (a ^ n) = n Multiplicative.toAdd a
                  instance Additive.neg {α : Type u} [Inv α] :
                  Equations
                  @[simp]
                  theorem ofMul_inv {α : Type u} [Inv α] (x : α) :
                  Additive.ofMul x⁻¹ = -Additive.ofMul x
                  @[simp]
                  theorem toMul_neg {α : Type u} [Inv α] (x : Additive α) :
                  Additive.toMul (-x) = (Additive.toMul x)⁻¹
                  instance Multiplicative.inv {α : Type u} [Neg α] :
                  Equations
                  @[simp]
                  theorem ofAdd_neg {α : Type u} [Neg α] (x : α) :
                  Multiplicative.ofAdd (-x) = (Multiplicative.ofAdd x)⁻¹
                  @[simp]
                  theorem toAdd_inv {α : Type u} [Neg α] (x : Multiplicative α) :
                  Multiplicative.toAdd x⁻¹ = -Multiplicative.toAdd x
                  instance Additive.sub {α : Type u} [Div α] :
                  Equations
                  instance Multiplicative.div {α : Type u} [Sub α] :
                  Equations
                  @[simp]
                  theorem ofAdd_sub {α : Type u} [Sub α] (x y : α) :
                  Multiplicative.ofAdd (x - y) = Multiplicative.ofAdd x / Multiplicative.ofAdd y
                  @[simp]
                  theorem toAdd_div {α : Type u} [Sub α] (x y : Multiplicative α) :
                  Multiplicative.toAdd (x / y) = Multiplicative.toAdd x - Multiplicative.toAdd y
                  @[simp]
                  theorem ofMul_div {α : Type u} [Div α] (x y : α) :
                  Additive.ofMul (x / y) = Additive.ofMul x - Additive.ofMul y
                  @[simp]
                  theorem toMul_sub {α : Type u} [Div α] (x y : Additive α) :
                  Additive.toMul (x - y) = Additive.toMul x / Additive.toMul y
                  @[simp]
                  theorem ofMul_zpow {α : Type u} [DivInvMonoid α] (z : ) (a : α) :
                  Additive.ofMul (a ^ z) = z Additive.ofMul a
                  @[simp]
                  theorem toMul_zsmul {α : Type u} [DivInvMonoid α] (z : ) (a : Additive α) :
                  Additive.toMul (z a) = Additive.toMul a ^ z
                  @[simp]
                  theorem ofAdd_zsmul {α : Type u} [SubNegMonoid α] (z : ) (a : α) :
                  Multiplicative.ofAdd (z a) = Multiplicative.ofAdd a ^ z
                  @[simp]
                  theorem toAdd_zpow {α : Type u} [SubNegMonoid α] (a : Multiplicative α) (z : ) :
                  Multiplicative.toAdd (a ^ z) = z Multiplicative.toAdd a
                  instance Additive.coeToFun {α : Type u_1} {β : αSort u_2} [CoeFun α β] :
                  CoeFun (Additive α) fun (a : Additive α) => β (Additive.toMul a)

                  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
                  instance Multiplicative.coeToFun {α : Type u_1} {β : αSort u_2} [CoeFun α β] :
                  CoeFun (Multiplicative α) fun (a : Multiplicative α) => β (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
                  theorem Pi.mulSingle_multiplicativeOfAdd_eq {ι : Type u_1} [DecidableEq ι] {M : ιType u_2} [(i : ι) → AddMonoid (M i)] (i : ι) (a : M i) (j : ι) :
                  Pi.mulSingle i (Multiplicative.ofAdd a) j = Multiplicative.ofAdd (Pi.single i a j)
                  theorem Pi.single_additiveOfMul_eq {ι : Type u_1} [DecidableEq ι] {M : ιType u_2} [(i : ι) → Monoid (M i)] (i : ι) (a : M i) (j : ι) :
                  Pi.single i (Additive.ofMul a) j = Additive.ofMul (Pi.mulSingle i a j)