A sequence is a function whose domain is a subset of the set of natural numbers (or more generally a subset of the set of integers; cf. subsequences introduced below). Often one means an infinite sequence, which is a sequence whose domain is infinite. Sequences (especially finite ones) are often called lists in computer science. (In constructive mathematics, the domain of a sequence must be a decidable subset of .)
Sequences may also be indicated by functions where is the first countably infinite ordinal: the key piece of structure on relevant for the study of sequences, particularly in analysis, is the order structure.
Up to bijection, the only possible sources are those of the form
for ; other domains are used for notational convenience.
An alternative generalisation takes the domain to be a set of ordinal numbers, without loss of generality the set
for some specific ordinal number (or the proper class of all ordinal numbers, if one wishes to allow for a proper class).
A subsequence of a sequence is a composition
where is an order-preserving monomorphism. The salient point is that be cofinal as an embedding.
One normally writes the value of the sequence at the argument as rather than . Similarly, given a term with the free variable , one often defines a sequence whose values equal those terms as , , or the like. In fact, one even often says literally ‘Let be a sequence.’ even though ‘Let be a sequence.’ would be less of an abuse of notation. This is all because notation for sequences arose before functions were considered in their full generality, and one distinguished a ‘sequence’ (whose domain was a set of integers) from a ‘function’ (whose domain was an interval in the real line or a region in the complex plane). Early mathematicians also often conflated the sequence (the function itself) with its range (a subset of the function's target); hence the use of curly braces. All of this applies in greater generality to families with index sets other than .
Infinite sequences are often used in topology, but for topology in general, one needs to generalise to nets, also called Moore–Smith sequences. Here one replaces the domain by any arbitrary directed set.
Recall that weak countable choice is a rather weak version of the axiom of choice that is accepted even in most schools of constructive mathematics; it follows separately from both excluded middle and countable choice. However, when it fails (as it does in the internal language of some widely studied toposes, such as the topos of sheaves over the real line), then some important results about sequences fail, including many standard results in topology. In this case, we may want a slight generalisation that we call sequential nets.
A sequential net is a multi-valued from (or a decidable subset thereof) to , that is a span where the map is a surjection (or has a decidable range). Note that inherits the structure of a directed set via , so that is a net. As a net, every sequential net is equivalent (in the sense of corresponding to the same filter) to some sequence, if you assume WCC. Without WCC, however, this equivalence fails.
(Using a multi-valued function here is a special case of an alternative definition of net that uses only partially ordered directed sets; see net. In some foundations of mathematics, we can get the same result by defining a sequential net to be a presequence: a prefunction, which is like a function but need not preserve equality, from a decidable subset of .)
Without WCC, many of the usual properties of metric spaces and other sequential spaces fail, but they continue to hold using sequential nets in the place of sequences. For example, every (located Dedekind) real number may be represented as a sequential Cauchy net, even when they might not all be represented as Cauchy sequences; see Cauchy real number.