Formal definition of summation over a sequence is very clear. Suppose we have a sequence $\left\{a_{i}\right\}_{0}^{\infty}$. Then the summation of this sequence can be defined as a new sequence $\left\{ b_i \right\}_0^\infty$ in a recursive way:
$$b_0 = a_0,\ b_{i+1} = b_{i} + a_{i+1},\ i \geq 0.$$
Then we may write $$\sum_{i=0}^n a_i = b_n,$$
and
$$\sum_{i=0}^\infty a_i = \lim_{i\to\infty} b_i.$$
However, sometimes we see summation over a set. For example, in defining the determinant, we use the following notation:
$$\det(A) = \sum_{\sigma\in S_n} \left(\operatorname{sgn}(\sigma)\prod_{i=1}^n a_{i,\sigma_i}\right),$$
where $S_n$ is the set of all permutations of the sequence $\left\{1,2,\dots,n\right\}$. How are summation symbols over sets like $\sum_{\sigma\in S_n}$ formally defined?