Dependent types I › The sum of a family of types [01E0]
- August 11, 2025
- Jon Sterling
Rule Formation [01E1]
- August 11, 2025
- Jon Sterling
The formation rule states that given A~\mathit {type} and a family x:A\vdash B[x]~\mathit {type}, we may form {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]}~\mathit {type}.
\frac { A~\mathit {type}\quad x:A\vdash B[x]~\mathit {type} }{{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]}~\mathit {type}}Rule Introduction [01E2]
- August 11, 2025
- Jon Sterling
The introduction rule states that given A and B as above and u:A and v:B[u] we may form \left \langle u,v\right \rangle :{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]}.
\frac { u:A \quad v:B[u] }{ \left \langle u,v\right \rangle :{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }Rule Elimination [01E3]
- August 11, 2025
- Jon Sterling
Given A and B as above, there two elimination rules for {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} corresponding to the two components of a pair.
- Given u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]}, we may form u.1:A. \frac { u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }{ u.1:A }
- Given u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]}, we may form u.2:B[u.1]. \frac { u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }{ u.2:B[u.1] }
Rule Computation [01E4]
- August 11, 2025
- Jon Sterling
The computation rules express what happens when you project the first and second components of a pair.
\frac { u:A\quad v:B[u] }{ \left \langle u,v\right \rangle .1 \equiv u:A } \qquad \frac { u:A\quad v:B[u] }{ \left \langle u,v\right \rangle .2 \equiv v:B[u] }Rule Uniqueness [01E5]
- August 11, 2025
- Jon Sterling
The uniqueness rule states that any element of the sum {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} is equal to a dependent pair whose components are obtained by projection.
\frac { u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }{ u\equiv \left \langle u.1,u.2\right \rangle :{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }Exercise Extensionality [01E6]
- August 11, 2025
- Jon Sterling
Show that the uniqueness rule for the sum {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} is equivalent to the following extensionality rule:
\frac { u,v:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} \quad u.1\equiv v.1:A \quad u.2\equiv v.2:B[u.1] }{ u\equiv v:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{B[x]} }