Notation for sequences

Solution 1:

I write my sequences as $\langle x_n \mid n \in \mathbb{N} \rangle$. Looks pretty cool I think. So you could say let $\langle x_n \mid n \in \mathbb{N} \rangle$ be a sequence in $\mathbb{R}$.

Solution 2:

The best notation for functions that I have encountered so far is by Leslie Lamport, described in his book on the temporal logic of actions, TLA+ (see Sec.5.2 on p.48, and Sec.6.4 on p.69).

In axiomatic set theory as formalized in TLA+, a function is a set that satisfies certain axioms about relevant syntactic constructs. I have found the syntax exceptionally practical and precise:

  • $f \triangleq [x \in S \mapsto e(x)]$ defines a function that maps elements of the set $S$ to the expression $e(x)$. Example of function constructor syntax: $f \triangleq [x \in \{3, 4\} \mapsto x - 1]$

  • $\mathrm{DOMAIN}\ f$ is the domain of function $f$. If $f$ is defined as above, then $\mathrm{DOMAIN}\ f = \{3, 4\}$

  • $f[x]$ function application, is a known value only if $f$ is a function (an axiom schema tells us that whatever is defined using the function constructor syntax from above is a function). Otherwise, it is some unspecified value (value is synonym for set in the set theory underlying TLA+).

  • $g(x)$ is operator application syntax, not function application. Read Sec.6.4. A function is a set, so we can write $\exists\ f$. An operator $g$ is syntax. Only the value $g(x)$ that results from applying the operator $g$ to the argument $x$ is a set.

    This is the only approach that I have found across the mathematics, computer science, and engineering literature that addresses the question of what "f[x]" means when $x \notin \mathrm{DOMAIN}\ f$. To see what the problem is with traditional notation and education, see this discussion.

  • $f \in [S \rightarrow T]$ says that $f$ is an element of the set of functions with $\mathrm{DOMAIN}$ the set $S$ that take values in the set $T$. Note that "codomain" is not part of the notion of function. Only the range of a particular function makes sense, and the $T$ used to define some specific set of functions.

Using the above notation for the case of functions from the natural numbers (OP), a sequence of real numbers is a function

$f \in [\mathbb{N} \rightarrow \mathbb{R}]$


OLD ANSWER:

The notation $\{x_n\}_{n\in\mathbb{N} }$ is appropriate because a sequence is formally a function $x: \mathbb{N}\rightarrow S$ that maps natural numbers to elements of the set $S$ (codomain). The index $n$ denotes the argument of function $x$. The first notation corresponds to a set of numbers $\{x_n\}$ (the curly brackets do denote a set) indexed by the natural numbers.

Note also that the space of all real-valued sequences can be denoted as $\mathbb{R}^\mathbb{N}$, i.e., the set of all functions from the natural numbers $\mathbb{N}$ to the real numbers $\mathbb{R}$. See also this discussion: What does it mean when a set is the exponent?