Date: 2013-07-22 09:43 pm (UTC)From: [personal profile] winterkoninkje
winterkoninkje: shadowcrane (clean) (0)

That works fairly well— But, in general, the left argument can be far simpler. All of the power operations only assume, on the left, the existence of a single binary operator (semigroup, monoid, group,...); they don't require two (semiring, ring, field,...). This means the Haskell types are far too stringent in requiring Num (~= ring) or Fractional (~= field). Mathematically, these operators should have the types (equivalent to):

(^) :: (Monoid m, Semiring s) => m -> s -> m
(^^) :: (Group m, Ring s) => m -> s -> m

Where the natural numbers with addition and multiplication are the most salient commutative semiring, and the integers with addition/subtraction and multiplication are the most salient commutative ring. The presumed Ring and Semiring classes need not be commutative, though commutativity is required to validate the (a^x)^y = (a^y)^x law.

The reason I think it's important to really drive this point home is because the whole idea of powers extends to other monoids besides just multiplication. For instance, consider Presberger arithmetic: the natural numbers with addition only. In PA we get a weak notion of "multiplication", which is specifically the one that arises from addition-powers. The fact that it's an addition-power rather than true multiplication captures much about its weakness. For another example, we often talk about tensor-powers: the notion of powers that arise from the tensor product. For yet another, we often use notation like f^n(x) to mean that we should iterate the function some number of times. Naturally, endomorphisms should use (^) whereas automorphisms can use (^^).

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

April 2019

S M T W T F S
 123456
78910111213
14151617181920
212223242526 27
282930    

Tags

Page generated 17 Jul 2025 03:45 pm
Powered by Dreamwidth Studios