Definition
An ordered tuple is a finite sequence of elements where each position may have a distinct type. In type theory, an -tuple is an element of a product type.
For types , an ordered tuple has type , where each .
Two ordered tuples and are equal if and only if and for all .
Type-Theoretic Perspective
In type theory, tuples are built from the product type constructor. The product type has:
- Introduction rule: Given and , we can form
- Elimination rules: Projection functions and where and
For -tuples, this generalizes to projection functions for .
Special Cases
- A 2-tuple is called an ordered pair
- A 3-tuple is called an ordered triple
- The unit type can be viewed as a 0-tuple
Properties
- Components may have different types:
- Tuples can be nested: is distinct from
Related Concepts
- Product Type: The type-theoretic generalization of tuples
- Cartesian Product: The set-theoretic construction
- Dependent Pair: A generalization where the second type may depend on the first value
- Record Type: Tuples with named fields
- Function Type: The dual to product types in type theory