Definition

A dependent pair (or dependent sum type) is a generalization of Product Type where the type of the second component may depend on the value of the first component.

The dependent pair type is written or , where is a type and is a type family indexed by .

An element of is a pair where and .

Type Rules

Introduction rule: Given and , we can form .

Elimination rule: Given , we have projections:

Examples

  • A vector with length: pairs a natural number with a vector of that length
  • Subtypes: represents elements of satisfying predicate
  • Existential quantification: The proposition corresponds to

Special Cases

When is a constant type family (does not depend on ), the dependent pair reduces to the ordinary Product Type: .