8
$\begingroup$

What is the most basic set-based interpretation of dependent types that one can use as a basic model when learning dependent type theory? Indeed, one is easily unmotivated to read formal rules before understanding even one basic interpretation that would help make sense of the theory, yet I literally cannot find such for dependent types. In fact, some of the descriptions of an interpretation literally seem contradictory. It for example seems to me nlab here claims interpretation of $(x \colon A) \vdash B(x) \colon Type$ would be morphism $I(B) \to I(A)$, whereas nlab here claims interpretation of $\Gamma \vdash B \colon Type$ would be morphism $I(\Gamma,y \colon B) \to I(\Gamma)$. Thus even though I kind of assume that dependent sums could be disjoint unions and dependent products Cartesian products, I actually literally have no idea how the actual dependent types should be interpreted even as the most basic easy example.

For simply typed theory a basic interpretation for sets is highly easy: basic types are sets, contexts are Cartesian products, product types are Cartesian products, function types are Cartesian exponentials, term is function from its context to its type and defined inductively so that notably variables are projections and e.g. evaluation is given by evaluation of the Cartesian exponential and so on. Does there not exist easy extension of this to dependent types that would concretize things analogously?

$\endgroup$
10
  • 2
    $\begingroup$ I don't see why "one" becomes "unmotivated" if they are not first provided a bulky interpretation of quite self-explanatory DTT in some category, especially sets. $\endgroup$ Commented yesterday
  • 1
    $\begingroup$ You might be interested in a geometric interpretation, where $B : A \to \mathrm{Type}$ is a bundle, $f : \Pi_{x:A} B(x)$ is a section and $y : \Sigma_{x : A} B(x)$ is an element of the bundle. $\endgroup$
    – Keplerto
    Commented yesterday
  • 6
    $\begingroup$ @АрсенийКряжев Is it so strange to find syntactic rules unmotivated when you don't have any semantics in mind? The OP is not asking for a complete specification of set-theoretic semantics for a particular dependent type theory, they're just asking for a "basic model" of the primitive notion of dependent type, which has an entirely straightforward set-theoretic interpretation. $\endgroup$ Commented yesterday
  • 5
    $\begingroup$ @АрсенийКряжев No, one doesn't need to construct the reals to understand Euclidean geometry, but the axioms of geometry would seem bizarre if one didn't have a prior mental model of geometry, at least an informal one coming from experience drawing figures on paper. It's certainly possible to do type theory purely syntactically, but the formal rules will be easier to understand and work with if one has a mental model of the concepts. A textbook does not need to start with formal semantics, but a good textbook will give the reader some intuition for how to think about the primitive notions. $\endgroup$ Commented yesterday
  • 2
    $\begingroup$ If I was learning Euclidean geometry for the first time while already being familiar with Dedekind cuts and so on, I'd find it pretty reassuring to know that a line can be defined as a subset of $\mathbb{R}^2$. $\endgroup$
    – N. Virgo
    Commented 16 hours ago

1 Answer 1

9
$\begingroup$

The set-theoretic analogue of dependent types is indexed families of sets. If you think of types as being sets, then $(x:A)\vdash B(x):\text{Type}$ corresponds to the indexed family $(B_x)_{x\in A}$, where $A$ is a set and for each $x\in A$, $B_x$ is a set. Then the dependent product and sum correspond to the familiar operations of cartesian product and disjoint union of the indexed family.

The apparent contradictions in the interpretations you read probably come from two (superficially) different ways of formalizing the notion of indexed family of sets.

First, we could have a function $f\colon A\to V$, where $V$ is a class of sets, and define $B_x = f(x)$ for all $x\in A$.

Second, we could have a set $B$ and a function $g\colon B\to A$, and define $B_x = g^{-1}(\{x\})$ for all $x\in A$.

The first interpretation is more general than the second from the material set theory point of view, because in the second interpretation, the sets $B_x$ and $B_y$ are always disjoint when $x\neq y$. But from an isomorphism-invariant point of view, this is not a real restriction: any family of sets is isomorphic to one in which the sets are pairwise disjoint. And it turns out that the second interpretation often generalizes better to other settings.

$\endgroup$
5
  • 2
    $\begingroup$ I actually think the contradiction comes from a misreading of the first nLab page: it says $B \to A$, not $A \to B$. The difference is then only in notation: writing either $\Gamma, x:B$ or $B$ for the total space of the family. But the point is worth mentioning anyway. $\endgroup$ Commented yesterday
  • $\begingroup$ @NaïmCamilleFavier Oh, fair enough, I didn't actually follow the links to the nLab pages. $\endgroup$ Commented yesterday
  • $\begingroup$ Yes I meant $I(B) \to I(A)$ and have hopefully managed to edit to what I interpreted the pages to say. My confusion is that if I choose the context $\Gamma$ to be $x \colon A$, I do not understand what the domain of the interpretation is supposed to be i.e. whether it is $I(A) \times I(B)$ or $I(B)$ or what. $\endgroup$
    – PPP
    Commented yesterday
  • $\begingroup$ The domain of the interpretation of $\Gamma \vdash B\text{ type}$ is the total space of the family, written $B$ or $\Gamma, B$ or $\Gamma, x : B$ or $\sum_{\Gamma} B$ or... It is only of the form $\Gamma \times B$ when the family is trivial, i.e. non-dependent on $\Gamma$; in that case the map $\Gamma \times B \to \Gamma$ is just the first projection (and all the fibres are isomorphic to $B$). Perhaps looking at the canonical example of lists and vectors might help. $\endgroup$ Commented 23 hours ago
  • $\begingroup$ If you take the context as $x:A$ you'll want to write the right side of the turnstile as $B(x).$ That is, in the interpretation, the types $B(x)$ are different for different $x.$ So it doesn't really make sense to write $I(A)\times I(B)$, because there are many different values of $B$ to consider. Rather, the domain of interpretation of $x:A\vdash B(x)$ is $\sum_{x\in A} I(B(x)),$ the disjoint union of the "fibers" of the dependent type. $\endgroup$ Commented 7 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.