Constructively, can we define the sum of a finitely supported map into a commuta...

@rntz@recurse.social

Constructively, can we define the sum of a finitely supported map into a commutative monoid?

Let (M,+,0) be a commutative monoid. The support of some f: A → M is {a ∈ A : f(a) ≠ 0}. The conceptually infinite sum ∑(a : A) f(a) is plainly computable from any finite list that includes all of f's support. But how do I show I get the same answer for every such list? It's not obvious to me how to show this constructively and without assuming decidability of equality on A (or M).