Hi Andrew,
I'm afraid your example is more complicated than it looks at first sight. I would expect to be able to prove theorems about your function only when the argument set is finite, and in that sense your second definition may be easier to work with.
Most importantly, you want to prove the following theorem:
LEMMA SetSumDefined ==
ASSUME NEW S \in SUBSET Nat, IsFiniteSet(S)
PROVE SetSum(S) = [T \in SUBSET S |-> IF T = {} THEN 0 ELSE ...]
This is not obvious because a TLA+ function definition
f[x \in S] == exp
is really shorthand for
f == CHOOSE f : f = [x \in S |-> exp]
and as with any CHOOSE expression, you have to show that a suitable value (here, function) exists. There is some library support for carrying out the required proofs: you want to EXTEND module WellFoundedInduction and use lemma WFInductiveDefLemma, which requires proving several hypotheses. (The last hypothesis is trivial if you remember the expansion explained above.) Most importantly, you need to prove that the subset order is well-founded over subsets of the finite set S introduced in the hypothesis of lemma SetSumDefined. The necessary infrastructure ought to be in place, though I'd be interested in hearing if you run into problems.
I'd suggest that you start with a simpler recursive function definition over natural numbers as a warm-up exercise. Look at module NaturalsInduction, which has the required helper lemmas. At the bottom of the module you'll find an example of how these lemmas are applied for the definition of the factorial function.
Regards,
Stephan