[Haskell-cafe] [Ann] group-theory

Emily Pillmore emilypi at cohomolo.gy
Wed Dec 9 19:05:59 UTC 2020


Okay, I'm fully caffeinated and out of bed.

Correct me if I'm wrong here, because I've never seen anyone describe maps like this, but it seems to me that for an algebraic constraint `c`, `c g ⇒ Map k g` would be a `k`-graded c-structure, and we can think of algebraic operations applied to those `g` meaningfully in that sense. For example, an indexed-list where `Group a ⇒ [(Int, a)]` can be seen as a ℤ-graded group.

In your example, Jack, inversion is defined on a map by `fmap inverse ≣ inverse_k0 + inverse_k1 + … + inverse k_n`, componentwise for each key. So perhaps your problem here for maps, is equivalent to finding a nice indexed-group for structure for the types:

```

— | A functor indexed by a discrete category. Not to be confused with

-- indexed as in higher functor on functor ala Atkey's Outrageous Fortune.

— This is not the most general encoding.

—

class GradedFunctor f where

imap :: (i → a → b) → f i a → f i b

— Being a graded group requires that the "overall" structure be both an indexed functor,

— as well as a group, so that `t i g = g_i0 + … + giN` forms a group as well.

—
class (GradedFunctor t, Group (t i g), Group g)  ⇒ GradedGroup t i g where

ixinvert :: i→ t i g → t i g

```

Something along those lines.

Thoughts? I'm spitballing here.

Cheers,

Emily

On Wed, Dec 09, 2020 at 5:43 AM, < jack at jackkelly.name > wrote:

> 
> 
> 
> December 9, 2020 4:16 AM, "Mario" < blamario@ rogers. com (
> blamario at rogers.com ) > wrote:
> 
> 
>> 
>> 
>> On 2020-12-05 7:04 p.m., Jack Kelly via Haskell-Cafe wrote:
>> 
>> 
>>> 
>>> 
>>> Dunno what the answer is, but I wanted to flag it while your package is
>>> young and breaking changes are easy. I've been meaning to have a crack at
>>> moving the reflex patch-verse over to monoid-subclasses ( https:/ / hackage.
>>> haskell. org/ package/ monoid-subclasses (
>>> https://hackage.haskell.org/package/monoid-subclasses ) ), which I provides
>>> some the necessary tools with different names (patch reinvents MonoidNull,
>>> and I'm hoping that a subtraction-that-removes keys could be lawful for
>>> one of the Reductive/Cancellative classes).
>>> 
>>> 
>> 
>> 
>> 
>> I'm the author and maintainer of monoid-subclasses, and I'd accept a PR
>> that adds InverseSemigroup without overly disturbing the existing classes.
>> The whole purpose of the package, after all, is to support mathematical
>> abstractions that are richer than semigroups but are not proper groups.
>> 
>> 
> 
> 
> 
> Thanks for the offer. There are two things I want to sort out first:
> 
> 
> 
> 1. I may have erred when suggesting InverseSemigroup; "inverting" a `Group
> g => Map k g` via `fmap invert` might admit nonunique inverses, which
> gives you an even weaker structure called a Regular Semigroup.
> 
> 
> 
> 2. I want to see if I can make the behaviour I want fit the existing
> classes provided by `monoid-subclasses` (specifically `Cancellative` and
> maybe `Reductive` instances for types provided by `monoidal-containers`).
> It might be something like `instance (MonoidNull g, Group g, Commutative
> g, Ord k) => Reductive (MonoidalMap k g)`, where the reduction operation
> subtracts values at matching keys, pruning nulls. I need to at least write
> out the property tests to see if it might be sound.
> 
> 
> 
> Best,
> 
> 
> 
> -- Jack
> 
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201209/ee9da17d/attachment.html>


More information about the Haskell-Cafe mailing list