The power operator on ℤˣ
by ZMod 2
, ℕ
, and ℤ
#
See also the related negOnePow
.
TODO #
Implementation notes #
In future, we could consider a LawfulPower M R
typeclass; but we can save ourselves a lot of work
by using Module R (Additive M)
in its place, especially since this already has instances for
R = ℕ
and R = ℤ
.
Equations
- instSMulZModOfNatNatAdditiveUnitsInt = { smul := fun (z : ZMod 2) (au : Additive ℤˣ) => Additive.ofMul (Additive.toMul au ^ z.val) }
This is an indirect way of saying that ℤˣ
has a power operation by ZMod 2
.
There is a canonical power operation on ℤˣ
by R
if Additive ℤˣ
is an R
-module.
In lemma names, this operations is called uzpow
to match zpow
.
Notably this is satisfied by R ∈ {ℕ, ℤ, ZMod 2}
.
Equations
- Int.instUnitsPow = { pow := fun (u : ℤˣ) (r : R) => Additive.toMul (r • Additive.ofMul u) }
@[simp]
@[simp]
theorem
toMul_uzpow
{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(u : Additive ℤˣ)
(r : R)
:
theorem
uzpow_coe_nat
{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(s : ℤˣ)
(n : ℕ)
[n.AtLeastTwo]
: