A 'sum' is a sequence of terms joined by addition.
A 'product' is a sequence of terms joined by multiplication.
Is there a general term for terms joined by a general associative operation, that mathematicians would know? Is it 'sequence'?
In Haskell this would be implemented as a fold, but what do you call the thing it acts on? 'Iterable' and 'Enumerable' are too computer-sciencey.
It's possible this question has no good answer.

@christianp I'd probably argue that "product" has a more general meaning in mathematics, even at school level (A level anyway).

More abstractly, associativity holds for semigroups and people talk about products there, too.

@pkra yeah, that's unfortunate, because it's such an overloaded term. If I say 'products', then a large portion of my readers will assume it doesn't include sums

@christianp also, I vaguely recall from getting my maths A level that "doing sums" was often used generically for "solve the problem" in the UK. Arguably, a long long time ago...

@pkra I didn't know you had maths A level!
Yes, 'doing sums' is often used to mean any calculation.

@christianp indeed, I do. Good to know that my British English is not completely out of date (yet).

@loke in any other case, yes, but I'm talking about the form of the thing here, so you don't actually apply the operation

@amiloradovsky you're naming the process, and I want a name for the terms, considered together

@christianp Folding in ML is also an operation (process). I don't think there is a better name for it, or it wouldn't be called "folding".
"Combinator" is yet another possibly-related term.

@christianp Anyway, you can always speak about a sequence of elements in a magma…

@amiloradovsky yeah, I wanted to know: in something like `fold f x`, what kind of thing is x? The haskell wiki says "a data structure", which is far too broad. I'm thinking of an ordered set, so 'sequence' is the best I can come up with

@christianp Well, I could also imagine folding over trees, given by two binary operations — one for breadth and one for depth. There may be other generalizations.

@amiloradovsky yeah, I'm not interested in those generalisations for the thing I'm working on

@christianp P.S. The most general structure that may be folded with just a total binary operation is probably a well-ordered (sub)set.

@christianp wikipedia has a page called "iterated binary operation" which also includes taking the intersection or union over indexed sets, as well as sums and products

@ccppurcell and the intro para says 'sequences of elements', so I think I'll go with 'sequences'.
Thanks for the link!

@christianp @ccppurcell sequence woukd be accurate if implying ordered operation is suitable. If not, perhaps group? (In the algebraic sense)

@kimreece @christianp @ccppurcell having stewed on this question for a while, I think I've come to the conclusion that the way most people think about folds doesn't reflect the most natural way. For instance, Foldable in Haskell implies using a binary operation. This makes sense for lists but not for trees where you have two children rather than one, and in fact implementing fold for trees requires you to make some arbitrary decision about traversal order. (1/?)

@kimreece @christianp @ccppurcell Let's take a look at the type signatures. We'll look at what I'll call "bottom-up" folds. For lists we have fold : b -> (a -> b -> b) -> list a -> b. In fact, this is the same as the recursion operator for lists. So in fact I'd argue that "fold" is just another name for recursion. So for binary trees we have a recursor b -> (a -> b -> b -> b) -> tree a -> b. And I would actually argue that this is a natural sort of folding. (2/3)

@kimreece @christianp @ccppurcell This isn't very satisfying, but the point is that there's nothing special about folding; a fold is just a linearization to a list followed by the list recursor. All the important information is in how one linearizes the type in the first place, and even for simple objects such as binary trees there often isn't a single natural way to do that. (3/3)

@christianp annoyingly I most often find general group operations discussed as 'in additive notation, sum over' or 'in multiplicative notation, take the product of', regardless that choice of notation is at times arbitrary enough to change repeatedly within the span of a single chapter.

@christianp My gut says it might still be called a product, like maybe "a product under \(\star\)"? But I'd definitely want to hear if someone has references for/against my guess.

Sign in to participate in the conversation

A Mastodon instance for maths people. The kind of people who make \(\pi z^2 \times a\) jokes.

Use \( and \) for inline LaTeX, and \[ and \] for display mode.