The power operator on ℤˣ by ZMod 2, ℕ, and ℤ #
See also the related negOnePow.
TODO #
- Generalize this to
Pow G (Zmod n)whereorderOf g = n.
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 = ℤ.
@[implicit_reducible]
@[implicit_reducible]
This is an indirect way of saying that ℤˣ has a power operation by ZMod 2.
@[simp]
theorem
ofMul_uzpow
{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(u : ℤˣ)
(r : R)
:
Additive.ofMul (u ^ r) = r • Additive.ofMul u
@[simp]
theorem
toMul_uzpow
{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(u : Additive ℤˣ)
(r : R)
:
Additive.toMul (r • u) = Additive.toMul u ^ r
theorem
uzpow_natCast
{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(u : ℤˣ)
(n : ℕ)
:
u ^ ↑n = u ^ n
theorem
uzpow_coe_nat
{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(s : ℤˣ)
(n : ℕ)
[n.AtLeastTwo]
:
s ^ OfNat.ofNat n = s ^ OfNat.ofNat n
@[simp]
@[simp]
@[simp]