4
$\begingroup$

The immediate impetus for this is watching this video by Mario Carneiro; around the 8:05 mark he mentions dependent type theory. That reminded me of a question I first had years ago about why dependent products and sums are named the way they are.

A dependent product is a type of the following form $\Pi x : A \mathop. B(x) $. Its terms are functions that convert an $A$ called $x$ into a $B(x)$. If $B$ does not depend on $x$ then you get an ordinary function type.

A dependent sum is a type of the following form $\Sigma x : A \mathop. B(x)$. I do not have any practical experience with these types besides using poking existentials in Rocq with tactics, but I think its terms are basically pairs $(x, y)$ where $x$ is of type $A$ and $y$ is of type $B(x)$. If $B$ does not depend on $x$, then you get a non-dependent product type.

Naively, it seems to make more sense to call $\Pi$-types "dependent exponential types" and $\Sigma$-types "dependent product types" since their degenerate forms appear to be exponentials and products.

The standard terminology must have been chosen for a reason, though. What is it?

$\endgroup$
4
  • 1
    $\begingroup$ Your line of thought is exactly why the name "dependent product" is so confusing and ambiguous. I would prefer using Sigma/Pi types to disambiguate. $\endgroup$
    – Trebor
    Commented 10 hours ago
  • 2
    $\begingroup$ See this answer of mine to a similar question. It explains how binary sums and products generalize in two ways. Thus $A \times B$ is both a special case of a dependent sum and a special case of a dependent product. $\endgroup$ Commented 4 hours ago
  • $\begingroup$ To repeat here an intuition from that post which I find very useful to understand the issue: we learn in kindergarten that the product of two numbers is an iterated sum. The same pattern also applies for types, and is part of what causes this confusion. $\endgroup$ Commented 1 hour ago
  • $\begingroup$ Also note that more and more people seem to be adopting the notation $(x : A) \to B$ instead of $\prod_{x : A} B$ and $(x : A) \times B$ instead of $\sum_{x : A} B$. This makes it a bit clearer what each one generalises. Although this does not solve the ambiguity of "dependent product type"… $\endgroup$ Commented 1 hour ago

1 Answer 1

5
$\begingroup$

We don't call $$\sum_{n=1}^k 3$$ a "product" but rather a "sum", even though it is the same as $k \times 3$, a product. So it shares a name with the operation $+$. In the same way, we call the $\Sigma$-type the sum type, so it shares a name with the type constructor $+$, even though the degenerate case of $\Sigma$ is isomorphic to $\times$, the product. To distinguish the two types, we call $+$ the binary sum, and $\Sigma$ the dependent sum. This is however pretty confusing, so in my opinion it's best to refer to them simply as $\Sigma$ and $\Pi$-types.

$\endgroup$
1
  • $\begingroup$ Oh, I get it. $\Sigma$ is like a bunch of constructive disjunctions distributed over a type, like literally. Thanks that clears it up. $\endgroup$ Commented 9 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.