dependent pullback type

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Homotopy theory
+--{: .hide}
[[!include homotopy - contents]]
=--
=--
=--

\tableofcontents

## Idea

In [[dependent type theory]], the binary pullback type of functions $f:A \to C$ and $g:B \to C$ is given by the type

$$\sum_{x:A} \sum_{y:B} f(x) = g(y)$$

However, by using large elimination of the [[boolean domain]] $\mathrm{bool}$ on the codomain of the functions and by using the induction principle for the boolean domain on the functions themselves, one has a family of functions

$$\mathrm{ind}_\mathrm{bool}(f, g):\prod_{b:\mathrm{bool}} \mathrm{rec}_\mathrm{bool}(A, B, b) \to C$$

and the resulting binary pullback is the type

$$\sum_{x:\mathrm{rec}_\mathrm{bool}(A, B, 0)} \sum_{y:\mathrm{rec}_\mathrm{bool}(A, B, 1)} \mathrm{ind}_\mathrm{bool}(f, g, 0, x) = \mathrm{ind}_\mathrm{bool}(f, g, 1, y)$$

Thus, it suffices to define the binary pushout of a boolean-indexed family of functions $f:\prod_{x:\mathrm{bool}} A(x) \to C$, which is the type

$$\sum_{x:A(0)} \sum_{y:A(1)} f(0, x) = f(1, y)$$

For any elements $x:A$ and $y:A$, the [[identity type]] $x = y$ is equivalent to the dependent sum type $\sum_{z:A} (x = z) \times (y = z)$, and so the pullback is equivalently the type

$$\sum_{x:A(0)} \sum_{y:A(1)} \sum_{z:C} (f(0, x) = z) \times (f(1, y) = z)$$

and since [[dependent sum types]] and [[product types]] commute, this is equivalently the type

$$\sum_{z:C} \left(\sum_{x:A(0)} (f(0, x) = z)\right) \times \left(\sum_{y:A(1)} (f(1, y) = z)\right)$$

By induction on the booleans, this is equivalently

$$\sum_{z:C} \prod_{b:\mathrm{bool}} \sum_{x:A(b)} f(b, x) = z$$

By generalizing this definition of binary pullbacks from the boolean domain to any arbitrary type, one gets general dependent pullbacks of an arbitrary family of functions with [[codomain]] $C$, which are also known as *[[wide pullbacks]]* in [[category theory]].

## Definition

Given a type $C$, an index type $I$, a family of [[domains]] $A(i)$ indexed by $i:I$, and a family of functions $f:\prod_{i:I} A(i) \to C$, the **dependent pullback type** or **wide pullback type** of $(C, I, A, f)$ is the [[dependent sum type]]

$$\sum_{y:C} \prod_{i:I} \sum_{x:A(i)} f(i, x) =_C y$$

The type $\sum_{x:A(i)} f(i, x) =_C y$ is the [[fiber type]] of the function $f(i):A(i) \to C$ at the element $y:C$, so this type is also the [[dependent product type|dependent product]] of [[fiber types]], or the **dependent fiber product type** or **dependent fibre product type**.

In addition, there is a dependent function
$$\lambda j.\lambda p.\pi_1(\pi_2(p)(j)):\prod_{j:I} \left(\sum_{y:C} \prod_{i:I} \sum_{x:A(i)} f(i, x) =_C y\right) \to A(j)$$

which shows that the dependent pullback type is a [[wide span]].

## Examples

* The [[dependent product type]] of a family of types $B(x)$ indexed by $x:A$ is the dependent pullback of the family of unique functions from each $B(x)$ to the [[unit type]].

* The [[intersection]] of a family of [[subtypes]] of a type $A$ is given by the dependent pullback of the [[embedding of types|embeddings]] into $A$.

* Binary [[pullback types]] are boolean-indexed dependent pullbacks types.

* When the family of domains $A(x)$ indexed by $x:I$ is a constant family of types, then the dependent pullback type are called **dependent equalizer types** or **wide equalizer types**.

## Related concepts

* [[dependent product type]]
* [[dependent pushout type]]
* [[pullback type]], [[homotopy pullback]]
* [[wide pullback]]

[[!redirects dependent pullback]]
[[!redirects dependent pullbacks]]

[[!redirects dependent fiber product]]
[[!redirects dependent fiber products]]

[[!redirects dependent fibre product]]
[[!redirects dependent fibre products]]

[[!redirects dependent pullback type]]
[[!redirects dependent pullback types]]

[[!redirects dependent fiber product type]]
[[!redirects dependent fiber product types]]

[[!redirects dependent fibre product type]]
[[!redirects dependent fibre product types]]

[[!redirects wide pullback type]]
[[!redirects wide pullback types]]

[[!redirects wide fiber product type]]
[[!redirects wide fiber product types]]

[[!redirects wide fiber product type]]
[[!redirects wide fiber product types]]


dependent pushout type

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Homotopy theory
+--{: .hide}
[[!include homotopy - contents]]
=--
=--
=--

\tableofcontents

## Idea

In [[dependent type theory]], the binary [[pushout type]] of [[functions]] $f:A \to B$ and $g:A \to C$ is the [[higher inductive type]] $B \sqcup_{A}^{f, g} C$ generated by functions

$$\mathrm{in}_B:B \to B \sqcup_{A}^{f, g} C$$
$$\mathrm{in}_C:C \to B \sqcup_{A}^{f, g} C$$
$$\mathrm{glue}:\prod_{x:A} \mathrm{in}(f(x)) = \mathrm{in}(g(x))$$

However, by using large elimination for the [[boolean domain]] $\mathrm{bool}$ on the codomain of the functions and by using the induction principle for the boolean domain on the functions themselves, one has a family of functions

$$\mathrm{ind}_\mathrm{bool}(f, g):\prod_{b:\mathrm{bool}} A \to \mathrm{rec}_\mathrm{bool}(B, C, b)$$

and the resulting binary pushout is the type

$$\mathrm{rec}_\mathrm{bool}(B, C, 0) \sqcup_{A}^{\mathrm{ind}_\mathrm{bool}(f, g, 0), \mathrm{ind}_\mathrm{bool}(f, g, 1)} \mathrm{rec}_\mathrm{bool}(B, C, 1)$$

generated by functions

$$\mathrm{in}:\prod_{b:B} \mathrm{rec}_\mathrm{bool}(B, C, b) \to (\mathrm{rec}_\mathrm{bool}(B, C, 0) \sqcup_{A}^{\mathrm{ind}_\mathrm{bool}(f, g, 0), \mathrm{ind}_\mathrm{bool}(f, g, 1)} \mathrm{rec}_\mathrm{bool}(B, C, 1))$$
$$\mathrm{glue}:\prod_{x:A} \mathrm{in}(\mathrm{ind}_\mathrm{bool}(f, g, 0, x)) = \mathrm{in}(\mathrm{ind}_\mathrm{bool}(f, g, 1, x))$$

Thus, it suffices to define the binary pushout of a boolean-indexed family of functions
$f:\prod_{x:\mathrm{bool}} A \to B(x)$, which is the [[higher inductive type]] generated by the constructors

$$\mathrm{in}:\prod_{b:\mathrm{bool}} B(b) \to (B(0) \sqcup_A^{f(0), f(1)} B(1))$$
$$\mathrm{glue}:\prod_{x:A} \mathrm{in}(0, f(0, x)) = \mathrm{in}(1, f(1, x))$$

For any elements $x:A$ and $y:A$, the [[identity type]] $x = y$ is equivalent to the dependent sum type $\sum_{z:A} (x = z) \times (y = z)$, and so the glue constructor can equivalently be expressed as
$$\mathrm{glue}:\prod_{x:A} \sum_{z:B(0) \sqcup_A^{f(0), f(1)} B(1)} (\mathrm{in}(0, f(0, x)) = z) \times (\mathrm{in}(1, f(1, x) = z))$$

By induction on the booleans, this is equivalently

$$\mathrm{glue}:\prod_{x:A} \sum_{z:B(0) \sqcup_A^{f(0), f(1)} B(1)} \prod_{b:\mathrm{bool}} \mathrm{in}(b, f(b, x)) = z$$

which by the [[type theoretic axiom of choice]] is equivalently

$$\mathrm{glue}:\sum_{C:A \to (B(0) \sqcup_A^{f(0), f(1)} B(1))} \prod_{x:A} \prod_{b:\mathrm{bool}} \mathrm{in}(b, f(b, x)) = C(x)$$

Unwrapping the dependent sum type, there are now three constructors for the binary pushout of a boolean-indexed family of functions
$f:\prod_{x:\mathrm{bool}} A \to B(x)$:

$$\mathrm{in}:\prod_{b:\mathrm{bool}} B(b) \to (B(0) \sqcup_A^{f(0), f(1)} B(1))$$
$$\mathrm{gluehubs}:A \to (B(0) \sqcup_A^{f(0), f(1)} B(1))$$
$$\mathrm{gluespokes}:\prod_{x:A} \prod_{b:\mathrm{bool}} \mathrm{in}(b, f(b, x)) = \mathrm{gluehubs}(x)$$

By generalizing this definition of binary pushouts from the boolean domain to any arbitrary type, one gets general dependent pushouts of an arbitrary family of functions with [[domain]] $A$, which are also known as *[[wide pushouts]]* in [[category theory]].

## Definition

### As a higher inductive type

Given a type $A$, an index type $I$, a family of [[codomains]] $B(i)$ indexed by $i:I$, and a family of functions $f:\prod_{i:I} A \to B(i)$, the **dependent pushout type** or **wide pushout type** of $(A, I, B, f)$ is the [[higher inductive type]] $\bigsqcup_{x:I}^{A, f} B(x)$ generated by the constructors

$$\mathrm{in}:\prod_{i:I} B(i) \to \bigsqcup_{x:I}^{A, f} B(x)$$
$$\mathrm{gluehubs}:A \to \bigsqcup_{x:I}^{A, f} B(x)$$
$$\mathrm{gluespokes}:\prod_{x:A} \prod_{i:I} \mathrm{in}(i, f(i, x)) = \mathrm{gluehubs}(x)$$

This is an example of the hubs-and-spokes construction of [[higher inductive types]] discussed in the [[HoTT book]], and is an non-recursive higher inductive type.

### Inference rules

Explicitly, this means that the inference rules for dependent pushout types are as follows:

**[[type formation rule]]**:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x)}{\Gamma \vdash \mathrm{pushout}(A, I, x.B, x z.f) \; \mathrm{type}}$$

**[[term introduction rules]]**:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x)}{\Gamma, x:I, y:B(x) \vdash \mathrm{in}(x, y):\mathrm{pushout}(A, I, x.B, x z.f) \; \mathrm{type}}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x)}{\Gamma, z:A \vdash \mathrm{gluehubs}(z):\mathrm{pushout}(A, I, x.B, x z.f) \; \mathrm{type}}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x)}{\Gamma, z:A, x:I \vdash \mathrm{gluespokes}(z, x):\mathrm{in}(x, f(x, z)) =_{\mathrm{pushout}(A, I, x.B, x z.f)} \mathrm{gluehubs}(z) \; \mathrm{type}}$$

**[[term elimination rule]]**:

$$\frac{
\begin{array}{c}
\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x) \\
\Gamma, w:\mathrm{pushout}(A, I, x.B, x z.f) \vdash C(w) \; \mathrm{type} \\
\Gamma, x:I, y:B(x) \vdash g(x, y):C(\mathrm{in}(x, y)) \quad \Gamma, z:A \vdash h(z):C(\mathrm{gluehubs}(z)) \\
\Gamma, z:A, x:I \vdash s(z, x):g(x, f(x, z)) =_{C}^{\mathrm{gluespokes}(z, x)} h(z)
\end{array}
}{\Gamma, w:\mathrm{pushout}(A, I, x.B, x z.f) \vdash \mathrm{ind}_{(A, I, x.B, x z.f)}^{w.C}(x y.g, z.h, z x.s, w):C(w)}$$

**[[computation rules]]**:

$$\frac{
\begin{array}{c}
\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x) \\
\Gamma, w:\mathrm{pushout}(A, I, x.B, x z.f) \vdash C(w) \; \mathrm{type} \\
\Gamma, x:I, y:B(x) \vdash g(x, y):C(\mathrm{in}(x, y)) \quad \Gamma, z:A \vdash h(z):C(\mathrm{gluehubs}(z)) \\
\Gamma, z:A, x:I \vdash s(z, x):g(x, f(x, z)) =_{C}^{\mathrm{gluespokes}(z, x)} h(z)
\end{array}
}{\Gamma, x:I, y:B(x) \vdash \mathrm{ind}_{(A, I, x.B, x z.f)}^{w.C}(x y.g, z.h, z x.s, \mathrm{in}(x, y)) \equiv g(x, y):C(\mathrm{in}(x, y))}$$

$$\frac{
\begin{array}{c}
\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x) \\
\Gamma, w:\mathrm{pushout}(A, I, x.B, x z.f) \vdash C(w) \; \mathrm{type} \\
\Gamma, x:I, y:B(x) \vdash g(x, y):C(\mathrm{in}(x, y)) \quad \Gamma, z:A \vdash h(z):C(\mathrm{gluehubs}(z)) \\
\Gamma, z:A, x:I \vdash s(z, x):g(x, f(x, z)) =_{C}^{\mathrm{gluespokes}(z, x)} h(z)
\end{array}
}{\Gamma, z:A \vdash \mathrm{ind}_{(A, I, x.B, x z.f)}^{w.C}(x y.g, z.h, z x.s, \mathrm{gluehubs}(z)) \equiv h(z):C(\mathrm{gluehubs}(z))}$$

$$\frac{
\begin{array}{c}
\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash I \; \mathrm{type} \quad \Gamma, x:I \vdash B(x) \; \mathrm{type} \quad \Gamma, x:I, z:A \vdash f(x, z):B(x) \\
\Gamma, w:\mathrm{pushout}(A, I, x.B, x z.f) \vdash C(w) \; \mathrm{type} \\
\Gamma, x:I, y:B(x) \vdash g(x, y):C(\mathrm{in}(x, y)) \quad \Gamma, z:A \vdash h(z):C(\mathrm{gluehubs}(z)) \\
\Gamma, z:A, x:I \vdash s(z, x):g(x, f(x, z)) =_{C}^{\mathrm{gluespokes}(z, x)} h(z)
\end{array}
}{\Gamma, z:A, x:I \vdash \mathrm{apd}_{\mathrm{ind}_{(A, I, x.B, x z.f)}^{w.C}(x y.g, z.h, z x.s)}(\mathrm{gluespokes}(z, x)) \equiv s(z, x):g(x, f(x, z)) =_{C}^{\mathrm{gluespokes}(z, x)} h(z)}$$

Here:

* "$x =_A y$" denotes the [[identity type]] of elements $x:A$ and $y:A$

* "$x \equiv y:A$ denotes [[judgmental equality]] of $x:A$ and $y:A$

* "$\mathrm{apd}_{f}$" denotes [[dependent function application to identifications]].

## Examples

* The [[positive type|positive]] [[dependent sum type]] of a family of types $B(x)$ indexed by $x:A$ is the dependent pushout type of the family of unique functions from the [[empty type]] to each $B(x)$.

* The [[union]] of a family of [[subtypes]] of a type $A$ is given by the dependent pushout of the [[dependent pullback]] of the [[embedding of types|embeddings]] into $A$.

* Binary [[pushout types]] are boolean-indexed dependent pushout types.

* When the family of [[codomains]] $B(x)$ indexed by $x:I$ is a constant family of types, then the dependent pushout type are called **dependent coequalizer types** or **wide coequalizer types**.

## Related concepts

* [[dependent sum type]]
* [[dependent pullback type]]
* [[pushout type]]
* [[wide pushout]]

[[!redirects dependent pushout]]
[[!redirects dependent pushouts]]

[[!redirects dependent cofiber coproduct]]
[[!redirects dependent cofiber coproducts]]

[[!redirects dependent cofibre coproduct]]
[[!redirects dependent cofibre coproducts]]

[[!redirects dependent pushout type]]
[[!redirects dependent pushout types]]

[[!redirects dependent cofiber coproduct type]]
[[!redirects dependent cofiber coproduct types]]

[[!redirects dependent cofibre coproduct type]]
[[!redirects dependent cofibre coproduct types]]

[[!redirects wide pushout type]]
[[!redirects wide pushout types]]

[[!redirects wide cofiber coproduct type]]
[[!redirects wide cofiber coproduct types]]

[[!redirects wide cofibre coproduct type]]
[[!redirects wide cofibre coproduct types]]


dependent sequence

\tableofcontents

## Idea

In [[dependent type theory]], a [[sequence]] in a type $A$ is a family of elements $n:\mathbb{N} \vdash x(n):A$, or equivalently, a function $x:\mathbb{N} \to A$ with domain of the natural numbers. A dependent sequence is like a sequence but in which we allow $A$ to depend on the natural numbers.

## Definition

Given a family of types indexed by the natural numbers $n:\mathbb{N} \vdash A(n)$, a **dependent sequence** can be defined as

* a family of elements $n:\mathbb{N} \vdash x(n):A(n)$

* a [[dependent sequential net]] $(x:\mathbb{N} \vdash P(x); x:\mathbb{N}, p:P(x) \vdash f(x, p):B(x), x:\mathbb{N} \vdash \mathrm{isInhab}(x):\left[P(x)\right])$ for which the dependent type $P(x)$ is a [[contractible type]] for all natural numbers $x:\mathbb{N}$

* a [[dependent correspondence]] $x:\mathbb{N}, y:B(x) \vdash R(x, y)$ for which the dependent type $\sum_{y:B(x)} R(x, y)$ is a [[contractible type]] for all natural numbers $x:\mathbb{N}$.

* an element of the [[dependent function type]] $x:(n:\mathbb{N}) \to A(n)$

## Dependent sequence types

A dependent sequence type is simply the [[dependent function type]] $(n:\mathbb{N}) \to A(n)$, and thus comes with the following rules:

Formation rules for dependent sequence types:
$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type}}{\Gamma \vdash (n:\mathbb{N}) \to A(n) \; \mathrm{type}}$$

Introduction rules for dependent sequence types:
$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type} \quad \Gamma, n:\mathbb{N} \vdash a(n):A(n)}{\Gamma \vdash \lambda(n:\mathbb{N}).a(n):(n:\mathbb{N}) \to A(n)}$$

Elimination rules for dependent sequence types:
$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type}}{\Gamma, a:(n:\mathbb{N}) \to A(n), n:\mathbb{N} \vdash \mathrm{ev}(a, n):A(n)}$$

Computation rules for dependent sequence types:
$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type} \quad \Gamma, n:\mathbb{N} \vdash a(n):A(n)}{\Gamma, m:\mathbb{N} \vdash \beta_\Pi(m):\mathrm{ev}(\lambda(n:\mathbb{N}).a(n), m) =_{A(m)} a(m)}$$

Uniqueness rules for dependent sequence types:
$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type}}{\Gamma, a:(n:\mathbb{N}) \to A(n) \vdash \eta_\Pi(a):a =_{(n:\mathbb{N}) \to A(n)} \lambda(n:\mathbb{N}).a(n)}$$

Dependent sequence types also have their own extensionality principle, called [[dependent sequence extensionality]]. This states that given two dependent sequences $a:(n:\mathbb{N}) \to A(n)$ and $b:(n:\mathbb{N}) \to A(n)$ there is an [[equivalence of types]] between the [[identity type]] $a =_{(n:\mathbb{N}) \to A(n)} b$ and the dependent sequence type $(n:\mathbb{N}) \to (a(n) =_{A(n)} b(n))$:
$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type}}{\Gamma,a:(n:\mathbb{N}) \to A(n), b:(n:\mathbb{N}) \to A(n) \vdash \mathrm{dseqext}(a, b):(a =_{(n:\mathbb{N}) \to A(n)} b) \simeq (n:\mathbb{N}) \to (a(n) =_{A(n)} b(n))}$$

Dependent sequence types are used in [[strongly predicative mathematics]], where one does not have [[dependent function types]], to construct the [[natural numbers type]], as dependent sequence types are used in the [[elimination rules]], [[computation rules]], and [[uniqueness rules]] of the natural numbers type:

Elimination rules for the natural numbers type:

$$\frac{\Gamma, x:\mathbb{N} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_s:\prod_{x:\mathbb{N}} C(x) \to C(s(x)) \quad \Gamma \vdash n:\mathbb{N}}{\Gamma \vdash \mathrm{ind}_\mathbb{N}^C(c_0, c_s, n):C(n)}$$

Computation rules for the natural numbers type:

$$\frac{\Gamma, x:\mathbb{N} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_s:\prod_{x:\mathbb{N}} C(x) \to C(s(x))}{\Gamma \vdash \beta_\mathbb{N}^0(c_0, c_s):\mathrm{Id}_{C(0)}\mathrm{ind}_\mathbb{N}^C(c_0, c_s, 0), c_0)}$$

$$\frac{\Gamma, x:\mathbb{N} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_s:\prod_{x:\mathbb{N}} C(x) \to C(s(x)) \quad \Gamma \vdash n:\mathbb{N}}{\Gamma \vdash \beta_\mathbb{N}^s(c_0, c_s, n):\mathrm{Id}_{C(s(n))}(\mathrm{ind}_\mathbb{N}^C(c_0, c_s, s(n)), c_s(n)(\mathrm{ind}_\mathbb{N}^C(c_0, c_s, n)))}$$

Uniqueness rules for the natural numbers type:

$$\frac{\Gamma, x:\mathbb{N} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c:\prod_{x:\mathbb{N}} C(x) \quad \Gamma \vdash n:\mathbb{N}}{\Gamma \vdash \eta_\mathbb{N}(c, n):\mathrm{Id}_{C(n)}(\mathrm{ind}_\mathbb{N}^C(c(0), \lambda x:\mathbb{N}.c(s(x)), n), c(n))}$$

It is also used in defining the [[axiom of countable choice]] in [[dependent type theory]]:

$$\frac{\Gamma, n:\mathbb{N} \vdash A(n) \; \mathrm{type}}{\Gamma, a:(n:\mathbb{N}) \to \left[A(n)\right] \vdash \mathrm{countablechoice}(a):\left[(n:\mathbb{N}) \to A(n)\right]}$$

## See also

* [[tuple]], [[sequence]], [[function]]

* [[dependent tuple]], **dependent sequence**, [[dependent function]]

* [[countable choice]]

* [[ascending chain condition]], [[Noetherian ring]], [[Noetherian module]], [[Noetherian bimodule]]

* [[descending chain condition]], [[Artinian ring]], [[Artinian module]], [[Artinian bimodule]]

* [[sequential spectrum]], [[sequential spectrum type]]

[[!redirects dependent sequence]]
[[!redirects dependent sequences]]

[[!redirects dependent sequence type]]
[[!redirects dependent sequence types]]


dependent sum

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Category theory
+-- {: .hide}
[[!include category theory - contents]]
=--
#### Limits and colimits
+--{: .hide}
[[!include infinity-limits - contents]]bec
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

The _dependent sum_ is a [[universal construction]] in [[category theory]]. It generalizes the [[Cartesian product]] to the situation where one factor may _depend_ on the other. It is the [[left adjoint]] to the [[base change]] functor between [[slice categories]].

The [[duality|dual]] notion is that of _[[dependent product]]_.

## Definition

Let $\mathcal{C}$ be a [[category]] and $f \colon A \to I$ a [[morphism]] in $\mathcal{C}$ such that [[pullbacks]] along $f$ exist in $\mathcal{C}$. These then constitute a [[base change]] [[functor]]

$$
  f^* \colon \mathcal{C}_{/I} \to \mathcal{C}_{/A}
$$

between the corresponding [[slice categories]].

+-- {: .num_defn}
###### Definition

The **dependent sum** or **dependent coproduct** along the morphism $f$ is the [[left adjoint]] $\sum_f \colon \mathcal{C}_{/A} \to \mathcal{C}_{/I}$ of the base change functor

$$
  (\sum_f \dashv f^* )
  \colon
  \mathcal{C}_{/A}
   \stackrel{\overset{\sum_f}{\to}}{\underset{f^*}{\leftarrow}}
  \mathcal{C}_{/I}
  \qquad.
$$

=--

This is directly seen to be equivalent to the following.

+-- {: .num_defn}
###### Definition

The **dependent sum** along $f \colon A \to I$ is the [[functor]]

$$
  \sum_f \coloneqq f\circ (-) \colon \mathcal{C}_{/A} \to \mathcal{C}_{/I}
$$

given by [[composition]] with $f$.

=--

## Properties

### Relation to the product

Assume that the [[category]] $\mathcal{C}$ has a [[terminal object]] $* \in \mathcal{C}$. Let $X \in \mathcal{C}$ be any [[object]] and assume that the terminal morphism $f \colon X \to *$ admits all [[pullbacks]] along it.

Notice that a [[pullback]] of some $A \to *$ along $X \to *$ is simply the [[product]] $X \times A$, equipped with its [[projection]] morphism $X \times A \to X$. We may regard $X \times A \to X$ as the image of the [[base change]] functor $f^* \colon \mathcal{C}_{/*} \to \mathcal{C}_{/X}$, but this is not quite just the product in $\mathcal{C}$, which instead corresponds to the terminal morphisms $X \times A \to *$. But we have:

+-- {: .num_prop}
###### Proposition

The [[product]] $X \times A \in \mathcal{C}$ is, if it exists, equivalently the dependent sum of the base change of $A \to *$ along $X \to *$:

$$
  \sum_{X} X^* A \simeq X \times A \in \mathcal{C}
  \quad .
$$

=--

Here we write "$X$" also for the morphism $X \to *$.

### Relation to type theory

Under the [[relation between category theory and type theory]] the dependent sum is the [[categorical semantics]] of [[dependent sum types]] .

Notice that under the identification of [[propositions as types]],  [[dependent sum types]] (or rather their [[bracket types]]) correspond to  [[existential quantification]] $\exists x\colon X, P x$.

The following table shows how the [[natural deduction]] rules for dependent sum types correspond to their [[categorical semantics]] given by the dependent sum universal construction.

[[!include dependent sum natural deduction - table]]

### Relation to some limits
 {#RelationToSomeLimits}

+-- {: .num_prop #AbsoluteDependentSumPreservesFiberProducts}
###### Proposition

For $\mathcal{C}$ a category with [[finite limits]] and $X \in \mathcal{C}$ an object, then dependent sum

$$
  \underset{X}{\sum}: \mathcal{C}_{/X} \longrightarrow \mathcal{C}
$$

[[preserved limit|preserves]] and [[reflected limit|reflects]] [[fiber products]].

=--

+-- {: .proof}
###### Proof

By [this proposition](overcategory#LimitsInSliceViaLimitsOfCoconedDiagram) limits over a [[cospan]] [[diagram]] in the [[slice category]] are computed as limits over the [[cocone]] diagram under the cospan in the base category. By [this proposition](final+functor#CoconeUnderCospan) this inclusion is a [[final functor]], hence preserves limits. Since the dependent sum of the diagram is the restriction along this final functor, the result follows.

=--

+-- {: .num_prop #NaturalitySquareOfUnitIsPullback}
###### Proposition

For $\mathcal{C}$ a category with [[finite limits]] and $X\in \mathcal{C}$ any object, the [[naturality square]] of the [[unit of an adjunction|unit]] of the  $(\underset{X}{\sum} \dashv X^\ast)$-[[adjunction]] on any morphism $(f \colon A \to B)$ in $\mathcal{C}_{/X}$

$$
  \array{
    A  &\longrightarrow& X^\ast \underset{X}{\sum} A
    \\
    \downarrow^{\mathrlap{f}}  && \downarrow^{\mathrlap{X^\ast \underset{X}{\sum} f}}
    \\
    B &\longrightarrow& X^\ast \underset{X}{\sum} B
  }
$$

is a [[pullback]].

=--

+-- {: .proof}
###### Proof

By prop. \ref{AbsoluteDependentSumPreservesFiberProducts} it suffices to see that the diagram is a pullback in $\mathcal{C}$ under $\underset{X}{\sum}$, where, by [[Frobenius reciprocity]], it becomes

$$
  \array{
    \underset{X}{\sum} A  &\stackrel{(A,id)}{\longrightarrow}& X \times \underset{X}{\sum} A
    \\
    \downarrow^{\mathrlap{\underset{X}{\sum}f}}  && \downarrow^{\mathrlap{(id, \underset{X}{\sum} f)}}
    \\
    \underset{X}{\sum} B &\stackrel{(B,id)}{\longrightarrow}& X \times \underset{X}{\sum} B
  }
  \qquad .
$$

=--

+-- {: .num_prop #NaturalitySquareOfCounitIsPullback}
###### Proposition

For $\mathcal{C}$ a category with [[finite limits]] and $X\in \mathcal{C}$ any object, the [[naturality square]] of the [[counit of an adjunction|counit]] of the  $(\underset{X}{\sum} \dashv X^\ast)$-[[adjunction]] on any morphism $(f \colon A \to B)$ in $\mathcal{C}$

$$
  \array{
    \underset{X}{\sum} X^\ast A &\longrightarrow& A
    \\
    \downarrow^{\mathrlap{\underset{X}{\sum}X^\ast f}} && \downarrow^{\mathrlap{f}}
    \\
    \underset{X}{\sum} X^\ast B &\longrightarrow& B
  }
$$

is a [[pullback]].

=--

+-- {: .proof}
###### Proof

By [[Frobenius reciprocity]] the diagram is equivalent to

$$
  \array{
    X\times A & \longrightarrow& A
    \\
    \downarrow^{\mathrlap{(id,f)}} && \downarrow^{\mathrlap{f}}
    \\
    X \times B &\longrightarrow& B
  }
  \qquad.
$$

=--

## In higher category theory

Let $C$ be an (∞,1)-category. We still want to define the dependent sum as the functor $C_{/X} \to C_{/Y}$ given by composing with the functor $X \to Y$, but the details are more complex.

The [[codomain fibration]] $tgt : C^{[1]} \to C$ is a cocartesian fibration classified by a functor $L : C \to (\infty,1)Cat : X \mapsto C_{/X}$.

Then for any $f : X \to Y$, we can define $\Sigma_f = L(f)$ to be the dependent sum.

Since the morphisms $[z \to x] \to [z \to y]$ induced by composition are cocartesian morphisms, we see that $\Sigma_f$ is indeed given by composition with $f$.

By proposition 6.1.1.1 and the following remarks of [Lurie](#Lurie), if $C$ has pullbacks, then this is also a cartesian fibration, and is classified by a map $R : C^{op} \to (\infty,1)Cat$. Then $f^* = R(f) : C_{/Y} \to C_{/X}$ is the functor computing pullbacks along $f$, and we have the adjunction $\Sigma_f \dashv f^*$.

## Related concepts

* [[disjoint union]]

* [[dependent sum type]]

* [[product]], [[coproduct]]

* [[sink]], [[cosink]]

* [[Kan extension]]

* [[internal colimit]]

* [[base change]]

  * **dependent sum**, [[dependent product]]

  * [[dependent sum type]], [[dependent product type]]

  * [[necessity]], [[possibility]], [[reader monad]], [[writer comonad]]

## References

Standard textbook accounts include section A1.5.3 of

* {#Johnstone} [[Peter Johnstone]], _[[Sketches of an Elephant]]_

and section IV of

* {#MacLaneMoerdijk}
 [[Saunders MacLane]], [[Ieke Moerdijk]], _[[Sheaves in Geometry and Logic]]_

Other references:

* {#Lurie}[[Jacob Lurie]], _[[Higher Topos Theory]]_

[[!redirects dependent sum]]
[[!redirects dependent sums]]

[[!redirects dependent coproduct]]
[[!redirects dependent coproducts]]


dependent sum natural deduction - table

The [[inference rules]] for [[dependent pair types]] (aka "dependent sum types" or "$\Sigma$-types"):

\begin{imagefromfile}
    "file_name": "DependentPairTypeInference-230215.jpg",
    "width": 770,
    "unit": "px",
    "margin": {
        "top": -30,
        "bottom": 20,
        "right": 0,
        "left": 10
    }
\end{imagefromfile}


dependent sum type

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

# Dependent sum types
* table of contents
{: toc}

## Idea
 {#Idea}

In [[dependent type theory]], what is traditionally called the _dependent sum type_ (really: dependent [[coproduct]]) of a [[dependent type]]  $d \,\colon\, D \;\;\vdash\;\; C_d \,\colon\, Type$ is the type whose [[terms]] are [[ordered pairs]] $(d,c)$ with $d \,\colon\, D$ and $c \,\colon\, C_d$ --- whence also called the _dependent pair type_.

In the [[categorical semantics]] [[categorical model of dependent type theory|of dependent type theory]] in [[fibration categories]], the dependent sum corresponds to internal [[coproducts]] over an index type.

In the special case that $C_d \,=\, C$ is independent of $A$ this reduces to the [[product type]] $D \times C$, while in the special case that $D =$ [[boolean domain|Bool]] it reduces to a binary [[coproduct]].

This notion is dual (in fact: adjoint) to the corresponding notion of [[dependent product type]]:

[[!include dependent functions and dependent pairs -- table]]

## Overview

[[!include dependent sum natural deduction - table]]

## Definition

Like any [[type formation|type constructor]] in [[type theory]], the dependent sum type is specified by rules saying when we can [[type formation|introduce]] it as a type, how to [[term introduction|construct terms]] of that type, how to use or "[[term elimination|eliminate]]" terms of that type, and how to [[computation rule|compute]] when we combine the constructors with the eliminators.

### In natural deduction

We assume that our dependent sum types have typal [[conversion rules]], as those are the most general of the conversion rules. Both the propositional and judgmental conversion rules imply the typal conversion rules by the structural rules for propositional and judgmental equality respectively.

The formation and introduction rules are the same for both the positive and negative dependent sum types

Formation rules for dependent sum types:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma \vdash \sum_{x:A} B(x) \; \mathrm{type}}$$

Introduction rules for dependent sum types:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma, x:A, y:B \vdash \mathrm{in}(x, y):\sum_{x:A} B(x)}$$

#### As a positive type

* Elimination rules for dependent sum types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type} \quad \Gamma, z:\sum_{x:A} B(x) \vdash C \; \mathrm{type} \quad \Gamma, x:A, y:B \vdash c:C[\mathrm{in}(x, y)/z]}{\Gamma, z:\sum_{x:A} B(x) \vdash \mathrm{ind}_{\sum_{x:A} B(x)}^C(c):C}$$

* Computation rules for dependent sum types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type} \quad \Gamma, z:\sum_{x:A} B(x) \vdash C \; \mathrm{type} \quad \Gamma, x:A, y:B \vdash c:C[\mathrm{in}(x, y)/z]}{\Gamma, x:A, y:B \vdash \beta_{\sum_{x:A} B(x)}^C(c):\mathrm{ind}_{\sum_{x:A} B(x)}^C(c)[\mathrm{in}(x, y)/z] =_{C[\mathrm{in}(x, y)/z]} c}$$

* Uniqueness rules for dependent sum types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type} \quad \Gamma, z:\sum_{x:A} B(x) \vdash C \; \mathrm{type} \quad \Gamma, x:A, y:B \vdash c:C[\mathrm{in}(x, y)/z] \quad \Gamma, z:\sum_{x:A} B(x) \vdash u:C \quad \Gamma, x:A, y:B \vdash i_\mathrm{in}(u):u[\mathrm{in}(x, y)/z] =_{C[\mathrm{in}(x, y)/z]} c}{\Gamma, z:\sum_{x:A} B(x) \vdash \eta_{\sum_{x:A} B(x)}^C(c):u =_{C} \mathrm{ind}_{\sum_{x:A} B(x)}^C(c)}$$

Given a [[pointed type|pointed]] [[h-proposition]] $(A, a)$, the positive dependent sum type results in $\mathrm{in}(a,-)$ being an [[equivalence of types]].

#### As a negative type

* Elimination rules for dependent sum types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma, z:\sum_{x:A} B(x) \vdash \pi_1(z):A} \qquad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma, z:\sum_{x:A} B(x) \vdash \pi_2(z):B[\pi_1(z)/x]}$$

* Computation rules for dependent sum types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma, x:A, y:B \vdash \beta_{\Sigma 1}(x, y):\pi_1(\mathrm{in}(x, y)) =_A x} \qquad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma, x:A, y:B \vdash \beta_{\Sigma 2}(x, y):\pi_2(\mathrm{in}(x, y)) =_{B[\pi_1(\mathrm{in}(x, y))/x]} y}$$

* Uniqueness rules for dependent sum types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B \; \mathrm{type}}{\Gamma, z:\sum_{x:A} B(x) \vdash \eta_{\Sigma}(z):z =_{\sum_{x:A} B(x)} \mathrm{in}(\pi_1(z), \pi_2(z))}$$

Given a [[pointed type|pointed]] [[h-proposition]] $(A, a)$, the negative dependent sum type results in $\pi_2(a,-)$ being a [[quasi-inverse function]] of $\mathrm{in}(a,-)$, rather than an [[equivalence of types]]. Thus, the positive definition is preferred to the negative definition. Alternatively, the negative dependent sum type should be defined as a [[coinductive type]] rather than an [[inductive type]].

#### Extensionality principle
 {#ExtensionalityPrinciple}

The extensionality principle for the dependent sum type states that there is an [[equivalence of types]] between the [[identity type]] $(a, b) =_{\sum_{x:A} B(x)} (a', b')$ of a dependent sum type and the dependent sum $\sum_{p:a =_A a'} b =_B^p b'$ of its component's identity types:

$$
\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:B(a) \quad \Gamma \vdash a':A \quad \Gamma \vdash b':B(a')}{\Gamma \vdash \mathrm{ext}_{\Sigma}(a, b, a', b'):(a, b) =_{\sum_{x:A} B(x)} (a', b') \simeq \sum_{p:a =_A a'} b =_B^p b'}
$$

The comparison function itself is readily obtained by [[Id-induction]]. That this indeed constitutes an [[equivalence of types]] is shown in [UFP13, Thm. 2.7.2](#UFP13).

{#ExtensionalityForDependentPairs} In the notation of [[dependent pairs]] ([[dependent functions and dependent pairs -- table|here]]) this reads:

Compare to the analogous extensionality principle for [[dependent functions]] (see at *[[function extensionality]]*, [here](function+extensionality#StatementForDependentFunctions)):

(In this dependent generality this is a special case of [UFP13, Lem. 2.9.7](#UFP13).)

### In lambda-calculus

The presentation of dependent sum type is almost exactly the same as that of [[product types]], with the simple change that $B$ may depend on $A$.  In particular, they can be presented both as a [[negative type]] or as a [[positive type]].  In both cases, the rule for building the dependent sum type is the same:

$$ \frac{A\colon Type \qquad x\colon A\vdash B(x)\colon Type}{\sum_{x\colon A} B(x)\colon Type} $$

but the constructors and eliminators may be different.

#### As a negative type

When presented negatively, primacy is given to the eliminators.  We specify that there are two ways to eliminate a term of type $\sum_{x\colon A} B(x)$: by projecting out the first component, or by projecting out the second.

$$ \frac{p \colon \sum_{x\colon A} B(x)}{\pi_1 p\colon A} \qquad \frac{p\colon \sum_{x\colon A} B(x)}{\pi_2 p\colon B(\pi_1 p)}$$

This then determines the form of the constructors: in order to construct a term of type $\sum_{x\colon A} B(x)$, we have to specify what value that term should yield when all the eliminators are applied to it.  In other words, we have to specify a pair of elements, one $a\colon A$ (to be the value of $\pi_1 p$) and one $b\colon B(a)$ (to be the value of $\pi_2 p$).

$$ \frac{a\colon A \qquad b\colon B(a)}{(a,b)\colon \sum_{x\colon A} B(x)} $$

Finally, we have computation rules which say that the relationship between the constructors and the eliminators is as we hoped.  We always have [[beta reduction]] rules

$$ \pi_1(a,b) \to_\beta a \qquad \pi_2(a,b) \to_\beta b $$

and we may or may not choose to have an [[eta reduction]] rule

$$ (\pi_1 p, \pi_2 p) \to_\eta p $$

#### As a positive type

When presented positively, primacy is given to the constructors.  We specify that the way to construct something of type $\sum_{x\colon A} B(x)$ is to give a term $a\colon A$ and a term $b\colon B(a)$:

$$ \frac{a\colon A \qquad b\colon B(a)}{(a,b)\colon \sum_{x\colon A} B(x)} $$

Of course, this is the same as the constructor obtained from the negative presentation.  However, the eliminator is different.  Now, in order to say how to *use* something of type $\sum_{x\colon A} B(x)$, we have to specify how we should behave for all possible ways that it could have been constructed.  In other words, we have to say, *assuming* that $p$ were of the form $(a,b)$, what we want to do.  Thus we end up with the following rule:

$$ \frac{z\colon \sum_{x\colon A} B(x) \vdash C(z)\colon Type\qquad
p\colon \sum_{x\colon A} B(x) \qquad x\colon A, y\colon B(x) \vdash c\colon C((x,y))}{let (x,y) = p in c \;\colon C(p)} $$

We need a term $c$ in the context of two variables of types $A$ and $B$, and the destructor or match "binds those variables" to the two components of $p$.  Note that the "ordered pair" $(x,y)$ in the destructor is just a part of the syntax; it is not an instance of the *constructor* ordered pair.

Now we have the [[beta reduction]] rule:

$$ let (x,y) = (a,b) \,in c \;\to_\beta\; c[a/x, b/y] $$

In other words, if we build an ordered pair and then break it apart, what we get is just the things we put into it.  (The notation $c[a/x, b/y]$ means to substitute $a$ for $x$ and $b$ for $y$ in the term $c$).

And (if we wish) the [[eta reduction]] rule, which is a little more subtle:

$$ let (x,y) = p in c[(x,y)/z] \;\to_\eta\; c[p/z] $$

This says that if we break something of type $ \sum_{x\colon A} B(x)$ into its components, but then we only use those two components by way of putting them back together into an ordered pair, then we might as well just not have broken it down in the first place.

Positively defined dependent sum types are naturally expressed as [[inductive types]].  For instance, in [[Coq]] syntax we have

    Inductive sig (A:Type) (B:A->Type) : Type :=
    | exist : forall (x:A), B x -> sig A B.

(Coq then implements beta-reduction, but not eta-reduction.  However, eta-equivalence is provable with the internally defined [[identity type]], using the dependent eliminator mentioned above.)

Arguably, negatively defined products should be naturally expressed as [[coinductive type]]s, but this is not exactly the case for the presentation of coinductive types used in Coq.

#### Positive versus negative

In ordinary "nonlinear" [[type theory]], the positive and negative dependent sum types are equivalent, just as in the case of [[product types]].  They manifestly have the same constructor, while we can define the eliminators in terms of each other as follows:

$$
\begin{aligned}
  \pi_1 p &\;\coloneqq\; let (x,y) = p \,in\, x\\
  \pi_2 p &\;\coloneqq\; let (x,y) = p \,in\, y\\
  let (x,y) = p in c &\;\coloneqq\; c[\pi_1 p / x, \pi_2 p / y]
\end{aligned}
$$

The [[computation rules]] then also correspond, just as for [[product types]].

Also just as for [[product types]], in order to recover the important *dependent* eliminator for the positive product type from the eliminators for the negative product type, we need the latter to satisfy the $\eta$-conversion rule so as to make the above definition well-typed.  By inserting a transport, we can make do with a [propositional](/nlab/show/eta-conversion#Propositional) $\eta$-conversion, which is also provable from the dependent eliminator.

One might expect that in "[[dependent linear type theory]]" the positive and negative dependent sums would become different.  However, the meaning of the quoted phrase is unclear.

### Using universes and dependent product types

Dependent sum types could be defined directly from universes, dependent product types, and function types - the last of which are definable from dependent product types. Given a [[type universe]] $U$, the dependent sum type of the type family $x:A \vdash B(x)$ is defined as the dependent product type

$$\sum_{x:A} B(x) \coloneqq \prod_{P:U} \prod_{x:A} (B(x) \to P) \to P$$

This was the first definition of dependent sum types in dependent type theory, appearing in [[Per Martin-Löf]]'s [original 1971 paper](#ML71) on dependent type theory.

## Properties

### Typal congruence rules

These are called *typal congruence rules* because they are the analogue of the judgmental [[congruence rules]] which use [[identity types]] and [[equivalence types]] instead of [[judgmental equality]]:

\begin{theorem}
Given types $A$ and $A'$ and type families $x:A \vdash B(x)$ and $x:A \vdash B'(x)$ and equivalences $e_A:A \simeq A'$ and dependent function of equivalences $e_B:\prod_{x:A} B(x) \simeq B'(e_A(x))$, there is an equivalence
$$\mathrm{congform}_\Sigma(e_A, e_B):\left(\prod_{x:A} B(x)\right) \simeq \left(\prod_{x:A} B(x)\right)$$
\end{theorem}

\begin{proof}
This is theorem 11.1.6 of [Rijke 2022](#Rijke22), and a proof of this is given in that reference.
\end{proof}

The typal congruence rules for dependent sum types are very important for proving various other theorems in dependent type theory. For example,

\begin{theorem}
Given a [[univalent]] [[Tarski universe]] $(U, T)$ and a $U$-small type $A:U$, the dependent sum type $\sum_{B:U} T(B) \simeq T(A)$ is contractible.
\end{theorem}

\begin{proof}
By univalence, for all $A:U$ and $B:U$, transport across the universal type family $T$ is an equivalence of types
$$\mathrm{ua}(A, B):\mathrm{isEquiv}(\mathrm{transport}_{x:U.T(x)}(A, B))$$
and thus we have the equivalence
$$\mathrm{pair}(\mathrm{transport}_{x:U.T(x)}(A, B), \mathrm{ua}(A, B)):(A =_U B) \simeq (T(B) \simeq T(A))$$
and thus by the typal congruence rule of dependent sum types, we have
$$\mathrm{congform}_\Sigma(\mathrm{id}_U, \lambda B:U.\mathrm{pair}(\mathrm{transport}_{x:U.T(x)}(A, B), \mathrm{ua}(A, B))):\left(\sum_{B:U} (A =_U B)\right) \simeq \left(\sum_{B:U} (T(B) \simeq T(A))\right)$$
Since the type $\sum_{B:U} (A =_U B)$ is contractible for all $A:U$, the above equivalence implies that $\sum_{B:U} (T(B) \simeq T(A))$ is also contractible.
\end{proof}

### Quantification in dependent type theory

Given a family of types $x:A \vdash B(x)$, the [[existential quantifier]] is defined as the [[bracket type]] of the dependent sum type

$$\exists x:A.B(x) \coloneqq \left[\sum_{x:A} B(x)\right]$$

The [[uniqueness quantifier]] is defined as the [[isContr]] [[modality]] of the dependent sum type

$$\exists! x:A.B(x) \coloneqq \mathrm{isContr}\left(\sum_{x:A} B(x)\right)$$

There is also a quantifier which states that $B$ holds for at most one element $x:A$, defined by the [[isProp]] [[modality]] of the dependent sum type:
$$\mathrm{isProp}\left(\sum_{x:A} B(x)\right)$$
In each of the last two cases, one could prove that each dependent type $B(x)$ has to be a [[mere proposition]].

Given a natural number $n:\mathbb{N}$ and given a family of types $x:A \vdash B(x)$, we can similarly write down [[quantifiers]] to say that

* $B$ holds for exactly $n$ elements:
$$\left[\left(\sum_{x:A} \left[B(x)\right]\right) \simeq \mathrm{Fin}(n)\right]$$
* $B$ holds for at most $n$ elements:
$$\left[\left(\sum_{x:A} \left[B(x)\right]\right) \hookrightarrow \mathrm{Fin}(n)\right]$$
* $B$ holds for at least $n$ elements:
$$\left[\mathrm{Fin}(n) \hookrightarrow \left(\sum_{x:A} \left[B(x)\right]\right)\right]$$
where $A \simeq B$ is the [[equivalence type]] between $A$ and $B$, $A \hookrightarrow B$ is the type of [[embeddings]] between $A$ and $B$, and $\mathrm{Fin}(n)$ is the [[finite set]] with $n$ elements.

## Categorical interpretation

Under [[categorical semantics]], a dependent type $x\colon A \vdash B(x)\colon Type$ corresponds to a [[fibration]] or [[display map]] $B\to A$. In this case, the dependent sum is just the [[object]] $B$. This requires the dependent sum type to satisfy both $\beta$- and $\eta$-conversion.

There is also another interpretation in category theory of the dependent sum type over $x:A \vdash B(x) \; \mathrm{type}$ as the [[initial]] $A$-indexed [[wide cospan]] over $B(x)$, the object $\sum_{x:A} B(x)$ with a family of morphisms

$$\mathrm{in}_A(x):B(x) \to \sum_{x:A} B(x)$$

such that for any other object $C$ with a family of morphisms $f(x):B(x) \to C$, there exists a unique morphism $u_C:\sum_{x:A} B(x) \to C$ such that

$$u_C \circ \mathrm{in}_A(x) = f(x)$$

This corresponds to the positive dependent sum types.

## Related concepts

* [[dependent sum]], [[disjoint union]]

* [[telescope type]]

* [[product type]]

* [[dependent product type]]

* [[dependent pushout type]]

## References

A textbook account could be found in section 4.6 of:

* {#Rijke22} [[Egbert Rijke]], *[[Introduction to Homotopy Type Theory]]*, Cambridge Studies in Advanced Mathematics, Cambridge University Press ([arXiv:2212.11082](https://arxiv.org/abs/2212.11082))

Discussion in a context of [[homotopy type theory]]:

* {#UFP13} [[Univalent Foundations Project]], _[[Homotopy Type Theory -- Univalent Foundations of Mathematics]]_ (2013) [[web](http://homotopytypetheory.org/book/), [pdf](http://hottheory.files.wordpress.com/2013/03/hott-online-323-g28e4374.pdf)]

For the definition of dependent sum types in terms of universes, dependent product types, and function types, see:

* {#ML71} [[Per Martin-Löf]], *A Theory of Types*, unpublished note (1971) [[pdf](https://raw.githubusercontent.com/michaelt/martin-lof/master/pdfs/martin-loef1971%20-%20A%20Theory%20of%20Types.pdf), [[MartinLoef1971-ATheoryOfTypes.pdf:file]]]

See also most references at *[[dependent type theory]]*.

[[!redirects dependent sum type]]
[[!redirects dependent sum types]]
[[!redirects dependent pair type]]
[[!redirects dependent pair types]]

[[!redirects Σ type]]
[[!redirects Σ types]]
[[!redirects Σ-type]]
[[!redirects Σ-types]]

[[!redirects Sigma type]]
[[!redirects Sigma types]]
[[!redirects Sigma-type]]
[[!redirects Sigma-types]]

[[!redirects dependent pair]]
[[!redirects dependent pairs]]


dependent tuple

\tableofcontents

## Idea

In [[dependent type theory]], given a natural number $n:\mathbb{N}$, an $n$-[[tuple]] in a type $A$ is a family of elements $i:\mathrm{Fin}(n) \vdash x(i):A$, or equivalently, a function $x:\mathrm{Fin}(n) \to A$ with domain of the [[finite set]] with $n$ elements. A dependent sequence is like a sequence but in which we allow $A$ to depend on the finite set.

## Definition

Given a natural number $n:\mathbb{N}$ and a family of types indexed by the [[finite set]] with $n$ elements $i:\mathrm{Fin}(n) \vdash A(i)$, a **dependent $n$-tuple** can be defined as

* a family of elements $i:\mathrm{Fin}(n) \vdash x(i):A(i)$

* an element of the [[dependent function type]] $x:(i:\mathrm{Fin}(n)) \to A(i)$

## Dependent n-tuple types

A dependent $n$-tuple type is simply the [[dependent function type]] $(i:\mathrm{Fin}(n)) \to A(i)$, and thus comes with the following rules:

Formation rules for dependent tuple types:
$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type}}{\Gamma \vdash (i:\mathrm{Fin}(n)) \to A(i) \; \mathrm{type}}$$

Introduction rules for dependent tuple types:
$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type} \quad \Gamma, i:\mathrm{Fin}(n) \vdash a(i):A(i)}{\Gamma \vdash \lambda(n:\mathbb{N}).a(n):(i:\mathrm{Fin}(n)) \to A(i)}$$

Elimination rules for dependent tuple types:
$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type}}{\Gamma, a:(i:\mathrm{Fin}(n)) \to A(i), i:\mathrm{Fin}(n) \vdash \mathrm{ev}(a, j):A(j)}$$

Computation rules for dependent tuple types:
$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type} \quad \Gamma, i:\mathrm{Fin}(n) \vdash a(i):A(i)}{\Gamma, j:\mathrm{Fin}(n) \vdash \beta_\Pi(j):\mathrm{ev}(\lambda(i:\mathrm{Fin}(n)).a(i), j) =_{A(j)} a(j)}$$

Uniqueness rules for dependent tuple types:
$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type}}{\Gamma, a:(i:\mathrm{Fin}(n)) \to A(i) \vdash \eta_\Pi(a):a =_{(i:\mathrm{Fin}(n)) \to A(i)} \lambda(i:\mathrm{Fin}(n)).a(i)}$$

## Properties

Dependent $n$-tuple types also have their own extensionality principle, called **dependent $n$-tuple extensionality**. This states that given two dependent $n$-tuples $a:(i:\mathrm{Fin}(n)) \to A(i)$ and $b:(i:\mathrm{Fin}(n)) \to A(i)$ there is an [[equivalence of types]] between the [[identity type]] $a =_{(i:\mathrm{Fin}(n)) \to A(i)} b$ and the dependent tuple type $(i:\mathrm{Fin}(n)) \to (a(i) =_{A(i)} b(i))$:
$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type}}{\Gamma,a:(i:\mathrm{Fin}(n)) \to A(i), b:(i:\mathrm{Fin}(n)) \to A(i) \vdash \mathrm{dtupext}(a, b):(a =_{(i:\mathrm{Fin}(n)) \to A(i)} b) \simeq (i:\mathrm{Fin}(n)) \to (a(i) =_{A(i)} b(i))}$$

Dependent $n$-tuple extensionality is provable in any dependent type theory with [[dependent sum types]] and [[identity types]]; it follows from the same principles as [[product extensionality]] does.

Dependent tuple types are also used in defining [[finite choice]] in [[dependent type theory]]:

$$\frac{\Gamma \vdash n:\mathbb{N} \quad \Gamma, i:\mathrm{Fin}(n) \vdash A(i) \; \mathrm{type}}{\Gamma, a:(i:\mathrm{Fin}(n)) \to \left[A(i)\right] \vdash \mathrm{finitechoice}(a):\left[(i:\mathrm{Fin}(n)) \to A(i)\right]}$$

Similarly to dependent tuple extensionality, finite choice is provable in dependent type theory.

## See also

* [[tuple]], [[sequence]], [[function]]

* **dependent tuple**, [[dependent sequence]], [[dependent function]]

* [[finite choice]]

[[!redirects dependent tuple]]
[[!redirects dependent tuples]]
[[!redirects dependent n-tuple]]
[[!redirects dependent n-tuples]]

[[!redirects dependent tuple type]]
[[!redirects dependent tuple types]]
[[!redirects dependent n-tuple type]]
[[!redirects dependent n-tuple types]]


dependent type

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

In [[type theory]], a _dependent type_ or _[[type]] in [[context]]_ is a *[[family]]* or *[[bundle]]* of [[types]] which vary over the elements ([[terms]]) of some other type.  It can be regarded as a formalization of the notion of "indexed family," providing a [[structural set theory|structural]] account of families (in contrast to the [[material set theory|material]] approach which requires sets to be able to contain other sets as elements).

Type theory with the notion of dependent types is called _[[dependent type theory]]_.

In the [categorical semantics of type theory](http://ncatlab.org/nlab/show/type+theory#CategoricalSemantics), a dependent type

$$
  x:A \; \vdash \;B(x): \;\mathrm{type}
$$

is represented by a particular [[morphism]] $p\colon B\to A$, the intended meaning being that each type $B(x)$ is the [[fiber]] of $p$ over $x\in A$.  The morphism in a category that may represent dependent types in this way are sometimes called [[display morphisms]] (especially when not every morphism is a display morphism).

Dependent types can be thought of as [[fibrations]] ([[Serre fibrations]]) in classical homotopy theory. The base space is $X$, the total space is $\sum_{(x:X)}P(x)$ and the fiber $P(\star_X)$. This gives the fibration:

$$P(\star_X)\to \sum_{x:X}P(x) \to X$$

## Relation to families of elements.
 {#RelationToFamiliesOfElements}

One may understand $A$-dependent types $a \colon A \;\vdash\; B(a)$ equivalently as [[function types|functions]] $B \to A$ with [[codomain]] $A$, i.e. as "type-[[bundles]]" (in the general, *not* in locally trivial sense of [[fiber bundles]], though) or "type-[[fibrations]]" (in a rather accurate sense):

The [[domain]] $B$ --- i.e. the "total space" of these bundles --- is identified with the [[dependent sum]] of the "[[fibers]]" $B(a)$, and conversely these fibers are indeed recovered from any such bundle as the [[fiber types]].

Under the [[categorical semantics]] of [[dependent type theory]] (cf. [[categorical model of dependent types]] and [[relation between type theory and category theory]]) it is exactly these associated "type bundles" which are identified with actual [[fibrations]] ("[[display maps]]") in the given semantic [[category]].

We now say this in more detail, first

* [purely syntactically](#TypeBundlesSyntactically)

and then as

* [reflected in a type universe](#TypeBundlesReflectedInTypeUniverse).

### Syntactically
 {#TypeBundlesSyntactically}

Given a family of types, $x:A \vdash B(x)$, one can construct a family of elements $z:\sum_{x:A} B(x) \vdash \pi_1(z):A$ via the [[elimination rules]] for [[negative type|negative]] [[dependent sum types]]:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type}}{\Gamma, z:\sum_{x:A} B(x) \vdash \pi_1(z):A}$$

Conversely, given a family of elements $x:A \vdash f(x):B$ one can construct a family of types $y:B \vdash \sum_{x:A} f(x) =_B y$ as the family of [[fiber types]] of $x:A \vdash f(x):B$, via the [[formation rules]] for [[identity types]] and [[dependent sum types]]:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma, x:A \vdash f(x):B}{\Gamma, x:A, y:B \vdash f(x) =_B y \; \mathrm{type}}}{\Gamma, y:B \vdash \sum_{x:A} f(x) =_B y \; \mathrm{type}}$$

This corresponds to the [[relation between type theory and category theory]]: there are two ways to interpret a morphism $f:\mathrm{Hom}_C(A, B)$ in a [[category]] $C$

* as a family of elements $x:A \vdash f(x):B$
* as a family of types $y:B \vdash A(y)$

If the type theory has [[function types]], then the above notions are also interderivable with an element of a function type $f:A \to B$, which correspond to the [[internal hom]] of a category $C$.

{#OneCan} One can additionally derive the following [[equivalences of types]]:

$$
  p
  \;\;\;\;
  \colon
  \;\;\;\;
  A
  \;\;
  \simeq
  \;
  \sum_{y:B} \sum_{x:A}
  \big(
    f(x) =_B y
  \big)
$$

$$
  y \colon B
  \;\;\;\;
    \vdash
  \;\;\;\;
  q(y)
  \;\;\;
     \colon
  \;\;\;
  A(y)
  \;\simeq\;
  \sum_{
     \mathclap{
       z \colon \sum_{x:B} A(x)
     }
  }
  \big(
    \pi_1(z) =_A y
  \big)
$$

### Reflected in the type universe
 {#TypeBundlesReflectedInTypeUniverse}

Assuming the [[univalence]]-[[axiom]], the analogous statement holds reflected within a [[type universe]] $Type$: Given $X \,\colon\, Type$, the type $X \to Type$ of $X$-dependent types is [[equivalence of types|equivalent]] to the type $(X \colon Type) \times (Y \to X)$ of [[function type|functions]] with [[codomain]] $X$, via forming [[fiber types]] and [[dependent sum]]-types, respectively
 [[UFP13, Thm. 4.8.3](#UFP13)]

$$
  X \colon Type
  \;\;\;\;
  \vdash
  \;\;\;\;
  (Y \colon Type) \times (Y \to X)
  \;\;
  \simeq
  \;\;
  \big( X \to Type \big)
  \,.
$$

<img src="https://ncatlab.org/nlab/files/TypeTheoreticObjectClassification-210125.jpg" width="600">

Under the [[categorical semantics]] of [[homotopy type theory]] in [[(infinity,1)-topos|$\infty$-toposes]], this characterizes the [[type universe]] as (interpreted by) the (small) [[object classifier in an (infinity,1)-topos|object classifier in an $\infty$-topos]].

## Examples

When the [[theory]] of a [[category]] is phrased in dependent type theory then there is one type "$obj$" of [[objects]] and a type $hom$ of [[morphisms]], which is dependent on two terms of type $obj$, so that for any $x,y:obj$ there is a type $hom(x,y)$ of arrows from $x$ to $y$.  This dependency is usually written as $x,y:obj \vdash hom(x,y):Type$.  In some theories, it makes sense to say that the type of "$hom$" itself is $obj, obj\to Type$ (usually understood as $obj \to (obj \to Type)$ or $(\obj \times \obj) \to Type$), i.e. a function from pairs of elements of $A$ to the [[type of types|universe]] $Type$ of types.

## Related concepts

* [[Martin-Löf dependent type theory]]

* [[term in context]]

* [[telescope]]

* [[dependent sum]], [[dependent product]]

* [[indexed set]]

## References

See the references at *[[dependent type theory]]*.

Exposition:

* Blog post: [In praise of dependent types](http://golem.ph.utexas.edu/category/2010/03/in_praise_of_dependent_types.html)

In [[Coq]]:

* [[Yves Bertot]], _Introduction to dependent types in Coq_ [[pdf](http://www-sop.inria.fr/members/Yves.Bertot/tsinghua/tsinghua-1.pdf)]

The relation between dependent types and bundles (functions of given codomain)

* {#UFP13} [[Univalent Foundations Project]], §4.8 in: *[[Homotopy Type Theory -- Univalent Foundations of Mathematics]]* (2013) [[web](http://homotopytypetheory.org/book/), [pdf](http://hottheory.files.wordpress.com/2013/03/hott-online-323-g28e4374.pdf)]

[[!redirects dependent types]]

[[!redirects type family]]
[[!redirects type families]]

[[!redirects type in context]]
[[!redirects types in context]]
[[!redirects types in contexts]]


Dependent Type Semantics

**Dependent Type Semantics** is a framework of [[dependent type theoretic methods in natural language semantics|natural language semantics]] based on [[dependent type theory]]. It has been developed by [[Daisuke Bekki]] and his group.

## References

* Bekki, D.: Representing anaphora with dependent types. In: Asher, N., Soloviev, S. (eds.) Logical Aspects of Computational Linguistics, Lecture Notes in Computer Science, vol. 8535, pp. 14–29. Springer (2014)
* Bekki, D., Asher, N.: Logical polysemy and subtyping. In: Motomura, Y., Butler, A., Bekki, D. (eds.) New Frontiers in Artificial Intelligence, Lecture Notes in Computer Science, vol. 7856, pp. 17–24. Springer (2013)
* Tanaka, R., Mineshima, K., Bekki, D.: Resolving modal anaphora in Dependent Type Se-
mantics. In: Proceedings of LENLS11. pp. 43–56 (2014)


dependent type theoretic methods in natural language semantics

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Linguistics
+-- {: .hide}
[[!include linguistics - contents]]
=--
=--
=--

# Contents
* table of contents
{:toc}

##Idea
A number of researchers are using [[dependent type theory]] as a formal tool to understand [[natural language]]. Some are using in particular [[homotopy type theory]].

## History

In the _Preface_ to his book, _Type-theoretic Grammar_ ([Ranta 94](#Ranta94)), [[Aarne Ranta]] recounts how the idea of studying natural language in constructive type theory occurred to him in 1986:

> In Stockholm, when I first discussed the project with [[Per Martin-Löf]], he said that he had designed type theory for mathematics, and than natural language is something else. I said that similar work had been done within predicate calculus, which is just a part of type theory, to which he replied that he found it equally problematic. But his general attitude was far from discouraging: it was more that he was so serious about natural language and saw the problems of my enterprise more clearly than I, who had already assumed the point of view of logical semantics. His criticism was penetrating but patient, and he was generous in telling me about his own ideas. So we gradually developed a view that satisfied both of us, that formal grammar begins with what is well understood formally, and then tries to see how this formal structure is manifested in natural language, instead of starting with natural language in all it unlimitedness and trying to force it into some given formalism.

A noted early application of dependent type theory to natural language was [[Göran Sundholm|Göran Sundholm's]] treatment ([Sundholm 86](#Sundholm86)) of the _Donkey sentence_

> Any farmer who owns a donkey beats it,

which he rendered, using [[dependent product]] and [[dependent sum]], as

$$
\prod_{z: \sum_{x: Farmer} (\sum_{y: Donkey}Owns(x, y))}Beats(p(z), p(q(z))).
$$

This marks an improvement over first-order logic in which one has to rewrite the Donkey sentence as something like:

> For all farmers and for all donkeys, if the farmer owns the donkey then he beats it.

$$
\forall x \forall y (Farmer(x) \wedge Donkey(y) \wedge Own(x, y) \to Beat(x, y)).
$$

## Related entries

* [[monad (in linguistics)]]

## References

### Papers using dependent type theory

* René Ahn, _Agents, Objects and Events: A computational approach to knowledge, observation and communication_, Ph.D. dissertation, Eindhoven University, 2001.

* Asher, N.: Lexical Meaning in Context: A Web of Words. Cambridge University Press (2011)

* Asher, N., Luo, Z.: Formalisation of coercions in lexical semantics. In: Sinn und Bedeutung. vol. 17, pp. 63–80 (2012)

* [[Daisuke Bekki]]: Representing anaphora with dependent types. In: Asher, N., Soloviev, S. (eds.) Logical Aspects of Computational Linguistics, Lecture Notes in Computer Science, vol.8535, pp. 14–29 (2014), [Springer](http://link.springer.com/chapter/10.1007%2F978-3-662-43742-1_2).

* [[Daisuke Bekki]], Asher, N.: Logical polysemy and subtyping. In: Motomura, Y., Butler, A., Bekki, D. (eds.) New Frontiers in Artificial Intelligence, Lecture Notes in Computer Science, vol. 7856, pp. 17–24. Springer (2013)

* [[Daisuke Bekki]], Satoh, M.: Calculating projections via type checking. In: Proceedings of TYTLES (to appear)

* Robin Cooper, Austinian Truth, Attitudes and Type Theory, Research on Language and Computation. July 2005, Volume 3, Issue 2-3, pp 333-362 [Springer](http://link.springer.com/article/10.1007%2Fs11168-006-0002-z)

* Chatzikyriakidis, S., Luo, Z.: Natural language inference in Coq. Journal of Logic, Language and Information 23(4), 441–480 (2014)

* [[Zhaohui Luo]]: Type-theoretical semantics with coercive subtyping. In: Semantics and Linguistic Theory 20 (SALT 20). Vancouver (2010)

* [[Zhaohui Luo]]: Contextual analysis of word meanings in type-theoretical semantics. In: Pogodalla, S., Prost, J.-P. (eds.) LACL 2011. LNCS, vol. 6736, pp. 159–174. Springer, Heidelberg (2011)

* [[Zhaohui Luo]]: Common nouns as types. In: Béchet, D., Dikovsky, A. (eds.) LACL 2012. LNCS, vol. 7351, pp. 173–185. Springer, Heidelberg (2012), [pdf](http://www.cs.rhul.ac.uk/home/zhaohui/LACL12.pdf).

* [[Zhaohui Luo]]: Event Semantics with Dependent Types, [pdf](http://www.cs.rhul.ac.uk/home/zhaohui/Evt15.pdf)

* [[Zhaohui Luo]], Formal Semantics in Modern Type Theories: Is It Model-theoretic, Proof-theoretic, or Both?, [pdf](http://www.cs.rhul.ac.uk/home/zhaohui/LACL14FINAL.pdf).

* Koji Mineshima, A Presuppositional Analysis of Definite Descriptions in Proof Theory, New Frontiers in Artificial Intelligence Lecture Notes in Computer Science Volume 4914, 2008, pp 214-227 [Springer](http://link.springer.com/chapter/10.1007%2F978-3-540-78197-4_20)

* P.  Piwek  and  E.  Krahmer,  ‘Presuppositions  in  Context:  Constructing Bridges’, in Formal Aspects of Context, eds., P. Bonzon, M. Cavalcanti,and R. Nossum, volume 20 of Applied Logic Series, 85–106, Kluwer Academic Publishers, Dordrecht, (2000).

* {#Ranta94} [[Aarne Ranta]], Type-theoretical grammar. Oxford University Press (1994) [[ISBN:9780198538578](https://global.oup.com/academic/product/type-theoretical-grammar-9780198538578)]

* {#Sundholm86} [[Göran Sundholm]], _Proof theory and meaning_. In: Gabbay, D., Guenthner, F. (eds.) Handbook of Philosophical Logic, vol. 3, pp. 471–506. Springer (1986)

* Tanaka, R., Mineshima, K., Bekki, D.: Resolving modal anaphora in Dependent Type Semantics. In: Proceedings of LENLS11. pp. 43–56 (2014), [Springer](http://link.springer.com/chapter/10.1007%2F978-3-662-48119-6_7).

### Papers using homotopy type theory

* Bahramian, H., Nematollahi, N., Sabry, A.: Copredication in Homotopy Type Theory, [pdf](https://www.researchgate.net/publication/320704539_Copredication_in_homotopy_type_theory)
* [[David Corfield]], _Expressing 'the structure of' in homotopy type theory_, [webpage](https://ncatlab.org/davidcorfield/show/Expressing+%27The+Structure+of%27+in+Homotopy+Type+Theory)

A worked example, [[homotopy type theory]] in the [[Grammatical Framework]]

* [GF-HoTT](http://www.grammaticalframework.org/~aarne/gf-hott/).

###Talks

* [[Daisuke Bekki]], Anaphora and Presuppositions in [[Dependent Type Semantics]] (Theoretical side) [slides](http://www.u.tsukuba.ac.jp/~kubota.yusuke.fn/bekki1.pdf)
* [[Daisuke Bekki]], Anaphora and Presuppositions in Dependent Type Semantics (Empirical side) [slides](http://www.u.tsukuba.ac.jp/~kubota.yusuke.fn/bekki2.pdf)
* Ribeka Tanaka, Generalized Quantifiers in Dependent Type Semantics [slides](http://www.u.tsukuba.ac.jp/~kubota.yusuke.fn/tanaka.pdf)
* Yusuke Kubota and Robert Levine, Scope parallelism in coordination in
Dependent Type Semantics [slides](http://www.u.tsukuba.ac.jp/~kubota.yusuke.fn/kubota-levine.pdf)


dependent type theory

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

_Dependent type theory_ is the flavor of [[type theory]] that admits _[[dependent types]]_.

Its [[categorical semantics]] is in [[locally cartesian closed categories]] $C$, where a [[dependent type]]

$$
  x : X \vdash E(x) \; \mathrm{type}
$$

is interpreted as a [[morphism]]  $E \to X$, hence an [[object]] in the [[slice category]] $C_{/X}$.

Then change of [[context]] corresponds to [[base change]] in $C$. See also _[[dependent sum]]_ and _[[dependent product]]_.

Dependent type systems are heavily used for _[[certified programming|software certification]]_.

## In the foundations of mathematics

Dependent type theory itself support various [[foundations of mathematics]] via the [[propositions as some types]] interpretation of [[dependent type theory]], where propositions are the types where every two elements are equal

$$\mathrm{isProp}(A) \coloneqq \prod_{x:A} \prod_{y:A} x =_A y$$

Suppose that a dependent type theory has a separate [[type]] [[judgment]] as well as [[dependent product types]], [[dependent sum types]], [[identity types]], [[weak function extensionality]], [[propositional truncations]], [[empty type]], [[unit type]], [[sum types]]. All the operations in [[predicate logic]] are derivable from said type formers:

* [[universal quantification]] is the dependent product type of families of propositions due to weak function extensionality

* similarly, [[implication]] is the function type of two propositions due to weak function extensionality, and function types are just dependent product types of a constant family of types

* [[logical conjunction]] is the product type of two propositions, and product types are just dependent sum types of a constant family of types

* [[existential quantification]] is the propositional truncation of dependent sum types

* [[logical disjunction]] is the propositional truncation of sum types

* [[falsehood]] is the empty type

* [[truth]] is the unit type

* [[excluded middle]] and the [[law of double negation]] is stated as an [[inference rule]] about propositions

Then

* One can add a [[cumulative hierarchy]] to the dependent type theory and work entirely in the cumulative hierarchy for [[material set theory]]

* One can add a [[category of sets]] to the dependent type theory and work entirely in the category of sets for [[structural set theory]]

* One can add a [[type universe]] satisfying certain [[axioms]] and [[axiom schemata]], such as [[universe extensionality]], closure under identity types, closure under dependent sum types, closure under dependent product types, [[propositional resizing]], [[axiom of replacement|replacement]], [[axiom of infinity|infinity]], and [[axiom of choice|choice]], to the dependent type theory and work entirely in the universe for [[univalent type theory]] or [[univalent foundations]]. Adding internal universe types as [[small]] [[object classifiers]] as well as all [[higher inductive types|higher inductive]] and [[coinductive types]] to the universe results in [[homotopy type theory]].

* One can add a [[Russell type of all propositions]] and a [[natural numbers type]] and work in the dependent type theory itself for [[higher-order logic]].

## Description

### Judgments for types and terms

[[!include judgements for types and terms - table]]

## Properties

+-- {: .num_theorem}
###### Theorem

The [[functors]]

* $Cont$, that form a [[category of contexts]] of a [[dependent type theory]];

* $Lang$ that forms the [[internal language]] of a [[locally cartesian closed category]]

constitute an [[equivalence of categories]]

$$
  DependentTypeTheories
    \stackrel{\overset{Lang}{\leftarrow}}{\underset{Cont}{\to}}
  LocallyCartesianClosedCategories
  \,.
$$

=--

This ([Seely, theorem 6.3](#Seely)).  It is somewhat more complicated than this, because we need to strictify the category theory to match the category theory; see [[categorical model of dependent types]].  For a more detailed discussion see at
_[[relation between type theory and category theory]]_.

## Examples

* [[objective type theory]]
* [[weak type theory]]
* [[book HoTT]]
* [[Martin-Löf type theory]]
* [[cubical type theory]]
* [[higher observational type theory]]
* [[univalent type theory]]
* [[propositional logic as a dependent type theory]]

## Related concepts

* [[categorical semantics of dependent types]]

  [[relation between category theory and type theory]]

* [[linear dependent type theory]]

* [[set theory and dependent type theory]]

* [[dependent type theoretic methods in natural language semantics]]

* [[spartan type theory]]

## References

For original references see at *[[Martin-Löf dependent type theory]]*, such as:

* {#Hofmann95} [[Martin Hofmann]], *Syntax and semantics of dependent types*, Chapter 2 in: _Extensional concepts in intensional type theory_, Ph.D. thesis, University of Edinburgh (1995), Distinguished Dissertations, Springer (1997) [[ECS-LFCS-95-327](http://www.lfcs.inf.ed.ac.uk/reports/95/ECS-LFCS-95-327/), [[HofmannExtensionalIntensionalTypeTheory.pdf:file]], [doi:10.1007/978-1-4471-0963-1](https://doi.org/10.1007/978-1-4471-0963-1)]

also published as:

* [[Martin Hofmann]], *Syntax and semantics of dependent types*, in *Semantics and logics of computation*, Publ. Newton Inst. **14**, Cambridge Univ. Press (1997) 79-130 [[doi:10.1017/CBO9780511526619.004](https://doi.org/10.1017/CBO9780511526619.004)]

Gentle exposition of the basic principles:

* [[Thomas Kehrenberg]], *Introduction to dependent type theory* (2022-23) [[blog series](https://tm.kehrenberg.net/series/introduction-to-dependent-type-theory/)]

Introductory accounts:

* {#Thompson91} [[Simon Thompson]], §6.3 in: *[[Type Theory and Functional Programming]]*, Addison-Wesley (1991) [ISBN:0-201-41667-0, [webpage](http://www.cs.kent.ac.uk/people/staff/sjt/TTFP), [pdf](http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ttfp.pdf)]

* {#Jacobs98} [[Bart Jacobs]], Chapter 10 in: *Categorical Logic and Type Theory*, Studies in Logic and the Foundations of Mathematics **141**, Elsevier (1998)  [[ISBN:978-0-444-50170-7](https://www.sciencedirect.com/bookseries/studies-in-logic-and-the-foundations-of-mathematics/vol/141), [pdf](https://people.mpi-sws.org/~dreyer/courses/catlogic/jacobs.pdf), [webpage](http://www.cs.ru.nl/B.Jacobs/CLT/bookinfo.html)]

  > (emphasis on the [[categorical model of dependent types]])

Introduction with parallel details on using [[proof assistants]]:

for [[Coq]]:

* [[Adam Chlipala]], _Certified programming with dependent types_, MIT Press 2013 [[ISBN:9780262026659 ](https://mitpress.mit.edu/books/certified-programming-dependent-types), [pdf](http://adam.chlipala.net/cpdt/cpdt.pdf),  [book webpage](http://adam.chlipala.net/cpdt/)]

* [[Théo Winterhalter]], *Formalisation and Meta-Theory of Type Theory*, Nantes (2020) [[pdf](https://github.com/TheoWinterhalter/phd-thesis/releases/download/v1.2.1/TheoWinterhalter-PhD-v1.2.1.pdf), [github](https://github.com/TheoWinterhalter/phd-thesis)]

for [[Agda]]:

* {#Norell08} [[Ulf Norell]], *Dependently Typed Programming in Agda*, p. 230-266 in: *Advanced Functional Programming* AFP 2008. Lecture Notes in Computer Science **5832** (2009) [[doi:10.1007/978-3-642-04652-0_5](https://doi.org/10.1007/978-3-642-04652-0_5), [pdf](https://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf)]

* [[Agda]] Tutorial: _Introduction to dependent type theory_ ([webpage](http://ocvs.cfv.jp/Agda/tutorial/node128.html))

Original  discussion of dependent type theory as the [[internal language]] of [[locally cartesian closed categories]] is in

* {#Seely} [[R. A. G. Seely]], _Locally cartesian closed categories and type theory_, Math. Proc. Camb. Phil. Soc. (1984) 95 ([pdf](http://www.math.mcgill.ca/rags/LCCC/LCCC.pdf))

A formal definition of dependent type theories beyond [[Martin-Löf dependent type theory]]:

* {#BauerHaselwarterLumsdaine20} [[Andrej Bauer]], [[Philipp G. Haselwarter]], [[Peter LeFanu Lumsdaine]], *A general definition of dependent type theories* [[arXiv:2009.05539](https://arxiv.org/abs/2009.05539)]

{#CSystemsReferences} On ([[essentially algebraic theory|essentially algebraic]])  formulations of dependent type theory (see [here](categorical+model+of+dependent+types#ContextualCategoriesOrCSystems) at *[[categorical models of dependent type theory]]*):

* [[Egbert Rijke]], _An algebraic formulation of dependent type theory_, ([mailing list discussion](https://groups.google.com/forum/#!topic/homotopytypetheory/OraMqbnCYy8/discussion))
* Vladimir Voevodsky, _B-systems_, ([arXiv:1410.5389](http://arxiv.org/abs/1410.5389))
* Vladimir Voevodsky, _A C-system defined by a universe in a category_, ([arXiv:1406.7413](http://arxiv.org/abs/1409.7925))
* Vladimir Voevodsky, _C-system of a module over a monad on sets_, ([arXiv:1406.7413](http://arxiv.org/abs/1407.3394))
* Vladimir Voevodsky, _Subsystems and regular quotients of C-systems_, ([arXiv:1406.7413](http://arxiv.org/abs/1406.7413))

For more see the references at _[[Martin-Löf dependent type theory]]_.

[[!redirects dependent type theories]]
[[!redirects Dependent type theories]]
[[!redirects Dependent type theory]]


dependently sorted set theory

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Foundations
+-- {: .hide}
[[!include foundations - contents]]
=--
=--
=--

\tableofcontents

\section{Idea}

Dependently sorted set theory is a [[set theory]] which is a [[first order theory]] with [[dependent type|dependent]] [[sorts]]; i.e. written in [[first order logic]] and whose [[domains of discourse]] (called [[sorts]] here) depend on other domains of discourse. In addition, membership $a \in A$ is a [[judgment]], rather than a [[proposition]] as in [[simply sorted set theory]]. By and large, dependently sorted set theories are [[structural set theories]], and are [[structurally presented set theories]].

Examples of dependently sorted set theories include the usual presentations of [[ETCS]] and [[SEAR]].

Dependently sorted set theory is different from [[set-level type theory|set-level]] [[intensional type theories]]. Intensional type theories satisfy the [[propositions as some types]] principle, where every [[proposition]] is a [[set]] and the [[first order logic]] is built out of the type theory itself. On the other hand, dependently sorted set theories are [[first order logic]] over [[dependent type theory]] and keep [[sets]] and [[propositions]] separate.

\section{See also}

* [[unsorted set theory]]
* [[two-sorted set theory]]
* [[dependently sorted set theory]]
* [[material set theory]]
* [[structural set theory]]
* [[structurally presented set theory]]
* [[set-level type theory]]

[[!redirects dependently sorted set theory]]
[[!redirects dependently sorted set theories]]


depressed cubic function

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Algebra
+-- {: .hide}
[[!include higher algebra - contents]]
=--
=--
=--

# Contents
* table of contents
{: toc}

## Definition

### In commutative rings

For a [[commutative ring]] $R$, a **depressed cubic function** is a [[function]]  $f \colon R \to R$ with [[elements]] $p \in R$, $q \in R$ such that for all $x \in R$,

$$f(x) = x^3 + p \cdot x + q$$

where $x^3$ is the canonical [[cube function]] of the [[multiplication|multiplicative]] [[monoid]].

## See also

* [[cubic function]]

* [[real cubic function]]

## References

See also:

* Wikipedia, _[Cubic function](https://en.wikipedia.org/wiki/Cubic_function)_
* Wikipedia, _[Cubic equation](https://en.wikipedia.org/wiki/Cubic_equation)_

[[!redirects depressed cubic functions]]


Derek Harland

* [webpage](http://www1.maths.leeds.ac.uk/~pmtdgh/)

## Selected writings

On [[nucleon]]-[[interaction]] modeled via [[Skyrmions]]:

* [[Chris Halcrow]], [[Derek Harland]], _An attractive spin-orbit potential from the Skyrme model_ ([arXiv:2007.01304](https://arxiv.org/abs/2007.01304))

* [[Derek Harland]], [[Chris Halcrow]], _Nucleon-nucleon potential from skyrmion dipole interactions_ ([arXiv:2101.02633](https://arxiv.org/abs/2101.02633))

* [[Josh Cork]], [[Derek Harland]], [[Thomas Winyard]], *A model for gauged skyrmions with low binding energies* ([arXiv:2109.06886](https://arxiv.org/abs/2109.06886))

On gauged [[skyrmions]] with more realistic binding energies (via [[equivariant de Rham cohomology]] and maybe some kind of [[equivariant Hopf degree theorem]]):

* [[Josh Cork]], [[Derek Harland]], [[Thomas Winyard]], *A model for gauged skyrmions with low binding energies* ([arXiv:2109.06886](https://arxiv.org/abs/2109.06886))

* [[Josh Cork]], [[Derek Harland]], *Geometry of Gauged Skyrmions*, SIGMA **19** o71 (2023) [[doi:10.3842/SIGMA.2023.071](https://doi.org/10.3842/SIGMA.2023.071), [arXiv:2303.02623](https://arxiv.org/abs/2303.02623)]

On [[Skyrmions]] via [[rational maps]]:

* [[Derek Harland]], [[Paul Sutcliffe]], *Rational Skyrmions* [[arXiv:2307.09355](https://arxiv.org/abs/2307.09355)]

category: people


Derek Krepski

* [personal page](https://server.math.umanitoba.ca/~dkrepski/home.html)

## Selected writings

On [[equivariant bundle gerbe|equivariant]] [[bundle gerbes]] over [[Lie groups]]:

* {#Krepski17} [[Derek Krepski]], *Basic equivariant gerbes on non-simply connected compact simple Lie groups*, Journal of Geometry and Physics **133** (2018) 30-41 ([arXiv:1712.08294](https://arxiv.org/abs/1712.08294), [doi:10.1016/j.geomphys.2018.06.016](https://doi.org/10.1016/j.geomphys.2018.06.016))

category: people


Derek W. Robinson

* [Wikipedia entry](https://en.wikipedia.org/wiki/Derek_W._Robinson)

* [GoogleScholar page](https://scholar.google.com.au/citations?user=JzjAwQUAAAAJ&hl=en)

* [MathGenealogy page](https://www.genealogy.math.ndsu.nodak.edu/id.php?id=38451)

## Selected writings

On [[operator algebras]] and [[AQFT|algebraic]] [[quantum statistical mechanics]]  ([[C-star algebras|$C^\ast$-algebras]], [[W-star algebras|$W^\ast algebras$]]):

* {#BratteliRobinson79} [[Ola Bratteli]], [[Derek W. Robinson]], *Operator Algebras and Quantum Statistical Mechanics* -- vol 1: *$C^\ast$- and $W^\ast$-Algebras. Symmetry Groups. Decomposition of States.*, Springer (1979, 1987, 2002) [[doi:10.1007/978-3-662-02520-8](https://doi.org/10.1007/978-3-662-02520-8)]

category: people

[[!redirects Derek Robinson]]


Derek Wise

* [webpage](https://www.math.ucdavis.edu/~derek/)

category:people


derivable category

## References

* {#Shulman11} [[Mike Shulman]], _Comparing composites of left and right derived functors_, New York Journal of Mathematics Volume 17 (2011) 75-125 ([arXiv:0706.2868](http://arxiv.org/abs/0706.2868), [publisher](http://nyjm.albany.edu/j/2011/17-5.html))

[[!redirects derivable categories]]


derivation

> This is about derivations on [[algebras]]. For derivations in [[logic]], see [[deduction]].

----

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Higher algebra
+-- {: .hide}
[[!include higher algebra - contents]]
=--
=--
=--

\tableofcontents

## Definitions

### Derivations on an algebra

For $A$ an [[nonassociative algebra|algebra]] (over some [[ring]] $k$), a **derivation** on $A$ is a $k$-linear morphism

$$
  d : A \to A
$$

such that for all $a,b \in A$ we have

$$
  d(a b) = d(a) b + a d (b)
  \,,
$$

This identity is called the __[[Leibniz rule]]__; compare it to the product rule in ordinary calculus (first written down by [[Gottfried Leibniz]]).

#### In a cancellative algebra

For $A$ a cancellative algebra, where for all $c \neq 0$, $c a = c b$ implies $a = b$ and $a c = b c$ implies $a = b$, the derivation satisfies the following identity: for any scalar $c$ in $k$, $d(c) = 0$. This follows from $k$-linearity, which says that for any scalar $c$ in $k$ and for any non-zero element $f$ in $A$, $d(c f) = c d(f)$ and $d(f c) = d(f) c$. The Leibniz rule states that $d(c f) = c d(f) + d(c) f$ and $d(f c) = d(f) c + f d(c)$. It follows that $d(c) f = 0$ and $f d(c) = 0$, and due to the cancellative property and the fact that $f$ is non-zero, it follows that $d(c) = 0$.

#### In a division algebra

For $A$ a [[division algebra]], with left division $\backslash$ and right division $/$ the derivation satisfies the left and right quotient identities for $f$ in $A$ and non-zero $g$ in $A$:

$$
  D(g\backslash f) = g\backslash D(f) - g\backslash (D(g) (g\backslash f))
  \,,
$$

and

$$
  D(f/g) = D(f)/g - ((f/g) D(g))/g
  \,,
$$
which reduces to the regular __[[quotient rule]]__ if the division algebra is associative and commutative:

$$
  D\left(\frac{f}{g}\right) = \frac{D(f)}{g} - \frac{D(g) f}{g^2}
$$

### Derivations with values in a bimodule

For $A$ an [[nonassociative algebra|algebra]] (over some [[ring]] $k$) and $N$ a [[bimodule]] over $A$, a **derivation** of $A$ with values in $N$ is a $k$-linear morphism

$$
  d : A \to N
$$

such that for all $a,b \in A$ we have

$$
  d(a b) = d(a) \cdot b + a \cdot d (b)
  \,,
$$

where on the dot on the right-hand side denotes the right (first term) and left (second term) [[action]] of $A$ on the bimodule $N$.

The previous definition is a special case of this one, where the bimodule is $N = A$, the algebra itself with its canonical left and right action on itself.

A special case is where $A$ is a [[group algebra]] $k G$ of a [[group]] $G$, and $N$ is a left $G$-module, regarded as a bimodule where the right action is trivial. Here a derivation is also called a 1-[[cocycle]], as used in [[group cohomology]].

### Graded derivations

A __graded derivation__ of degree $p$ on a [[graded object|graded]] algebra $A$ is a degree-$p$ graded-module homomorphism $d: A \to A$ such that
$$ d(a b) = d(a) b + (-1)^{p q} a d(b) $$
whenever $a$ is homogeneous of degree $q$.  (By default, the grade is usually $1$, or sometimes $-1$.)

### Augmented derivations

An __augmented derivation__ on an algebra $A$, augmented by an algebra homomorphism $\epsilon: A \to B$, is a module homomorphism $d: A \to B$ such that
$$ d(a b) = d(a) \epsilon(b) + \epsilon(a) d(b) .$$

If you think about it, you should be able to figure out the definition of an __augmented graded derivation__.

+-- {: .num_prop}
###### Proposition
Let $k Alg$ denote the category of commutative $k$-algebras, and $k Alg/k$ the slice, i.e., the category of commutative $k$-algebras $A$ equipped with an augmentation $\epsilon: A \to k$. Then the functor

$$Der: (k Alg/k)^{op} \to k Mod$$

which takes an augmented algebra to the module of augmented derivations $d: A \to k$ is represented by the augmented algebra $eval_0: k[x]/(x^2) \to k$.
=--

+-- {: .proof}
###### Proof
Indeed, an algebra map $\delta: A \to k[x^2]/(x^2)$ which renders the triangle

$$\array{
A & \stackrel{\delta}{\to} & k[x]/(x^2) \\
 & \mathllap{\epsilon} \searrow & \downarrow \mathrlap{eval_0} \\
 & & k
}$$

commutative may be uniquely written in the form $\delta(a) = \epsilon(a) + d(a)x$ for some $k$-module map $d: A \to k$, and then we have

$$\array{
\epsilon(a b) + d(a b)x & = & \delta(a b) \\
 & = & \delta(a)\delta(b) \\
 & = & (\epsilon(a) + d(a)x)(\epsilon(b) + d(b)x) \\
 & = & \epsilon(a)\epsilon(b) + (\epsilon(a)d(b) + d(a)\epsilon(b))x + d(a)d(b) x^2 \\
 & = & \epsilon(a b) + (\epsilon(a)d(b) + d(a)\epsilon(b))x
}$$

and we conclude $d(a b) = \epsilon(a)d(b) + d(a)\epsilon(b)$, so that $d$ is an augmented derivation. Of course the calculation may be run in reverse, so that $\delta$ is an augmented algebra homomorphism precisely when $d$ is a derivation.
=--

### Further variations

There are many further extensions, for examples derivations with values in an $A$-[[bimodule]] $M$ forming $Der_k(A,M) \subset Hom_k(A,M)$ (see also [[double derivation]]), skew-derivations in ring theory (with a twist in the Leibniz rule given by an endomorphism of a ring) and the dual notion of a [[coderivation]] of a coalgebra.  The latter plays role in Koszul-dual definitions of $A_\infty$-[[A-infinity-algebra|algebras]] and $L_\infty$-[[L-infinity-algebra|algebras]].  See also [[derivation on a group]], which uses a modified Leibniz rule: $d(a b) = d(a) + a d(b)$.

### Derivations on algebras over a dg-operad
 {#OfAlgebrasOverADGOperad}

More generally, there is a notion of derivation for every kind of [[algebra over an operad]] over a [[dg-operad]] (at least).

+-- {: .num_defn}
###### Definition

Let $\mathcal{O}$ be a [[dg-operad]] (a [[chain complex]]-enriched [[operad]]). For $A$ an $\mathcal{O}$-[[algebra over an operad]] and $N$ a [[module over an algebra over an operad|module over that algebra]] a **derivation** on $A$ with values in $N$ is a morphism

$$
  v : A \to N
$$

in the underlying category of [[graded vector space]]s, such that for each $n \gt 0$ we have a [[commuting diagram]]

$$
  \array{
     \mathcal{O}(n) \otimes A^{\otimes n}
     &\stackrel{}{\to}&
     A
     \\
     {}^{\mathllap{\sum_{a+b=n-1} id \otimes id^{\otimes a} \otimes v  \otimes id^{\otimes b}}}\downarrow
     && \downarrow^{\mathrlap{v}}
     \\
     \oplus_{a+ b = n-1} \mathcal{O}(n) \otimes A^{\otimes a}
      \otimes N \otimes A^{\otimes b}
     &\to&
     N
  }
  \,,
$$

where the top horizontal morphism is that given by the $\mathcal{O}$-algebra structure of $A$ and the bottom that given by the $A$-module structure of $N$.

=--

This appears as ([Hinich, def. 7.2.1](#Hinich)).

The theory of [[tangent complex]]es, [[Kähler differential]]s, etc. exists in this generality for derivations on algebras over an operad.

### Generalization to arbitrary $(\infty,1)$-categories {#Infty1Version}

Another equivalent reformulation of the notion of derivations
turns out to be useful for the [[vertical categorification]] of the concept:

for $N$ an $R$-module, there is the **nilpotent extension** ring $G(N) := N \oplus R$, equipped with the product operation

$$
  (r_1, n_1) \cdot (r_2, n_2) := (r_1 r_2, n_1 r_2 + n_2 r_1)
  \,.
$$

This comes with a [[natural transformation|natural]] morphism of rings

$$
 G(N) \to R
$$

given by sending the elements of $N$ to 0. One sees that a derivation on $R$ with values in $N$ is precisely a ring homomorphism $R \to G(N)$ that is a [[section]] of this morphism.

In terms of the [[bifibration]] $p : Mod \to Ring$ of [[module]]s over [[ring]]s, this is the same as a morphism from the module of [[Kähler differential]]s $\Omega_K(R)$ to $N$ in the fiber of $p$ over $R$.

While this is a trivial restatement of the universal property of [[Kähler differential]]s, it is this perspective that vastly generalizes:

we may replace $Mod \to Ring$ by the [[tangent (∞,1)-category]] projection $p : T_C \to C$ of any [[(∞,1)-category]] $C$. The functor that assigns [[Kähler differential]]s is then replaced by a [[left adjoint]] [[section]] of this projection

$$
  \Omega : C \to T_C
  \,.
$$

An **$(\infty,1)$-derivation** on an object $R$ with coefficients in an object $N$ in the fiber of $T_C$ over $R$ is then defined to be morphism $\Omega(R) \to N$ in that fiber.

More discussion of this is at [[deformation theory]].

## Examples

### Derivations on an algebra

*  Let $A$ consist of the smooth real-valued functions on an [[interval]] in the [[real line]].  Then differentiation is a derivation; this is the motivating example.
*  Let $A$ consist of the [[holomorphic function|holomorphic functions]] on a region in the [[complex plane]].  Then differentiation is a derivation again.
*  Let $A$ consist of the [[meromorphic function|meromorphic functions]] on a region in the [[complex plane]].  Then differentiation is still a derivation.
*  Let $A$ consist of the smooth functions on a [[manifold]] (or [[generalized smooth space]]) $X$.  Then any [[tangent vector field]] on $X$ defines a derivation on $A$; indeed, this serves as one definition of tangent vector field.
*  Let $A$ consist of the [[germs]] of differentiable functions near a point $p$ in a smooth space $X$.  Then any [[tangent vector]] at $a$ on $X$ defines a derivation on $A$ augmented by evaluation at $a$; again, this serves to define tangent vectors.
*  Let $A$ consist of the smooth [[differential forms]] on a smooth space $X$.  Then [[exterior differentiation]] is a graded derivation (of degree $1$).
*  In any of the above examples containing the adjective 'smooth', replace it with $C^k$ and augment $A$ by the inclusion of $C^k$ into $C^{k-1}$.  Then we have an augmented derivation.

More algebraic examples:

* Let $A$ be any algebra over a ring. The constant function $D(a) = 0$ for all $a \in A$ is a derivation.

* Let $R[[x]]$ be a [[formal power series]] over a ring $R$. Then the [[formal derivative]] is a derivation.

* A less obvious one: Let $R[X_{1},...,X_{n}]$ be a [[symmetric algebra|polynomial algebra]] over a [[commutative rig]] $R$. Define $L(P)=\underset{1 \le k \le n}{\sum}\frac{\partial P}{\partial X_{i}}X_{i}$. Then $L:R[X_{1},...,X_{n}] \rightarrow R[X_{1},...,X_{n}]$ is a derivation. Moreover, if we suppose that $R$ is a [[multiplicatively cancellable rig]], then the homogeneous polynomials of degree $n$ are exactly the solutions of the differential equation $L(P)=n.P$ (see the page [[homogeneous polynomials]]).

### Derivations with values in a bimodule

The standard example of a derivation not on an algebra, but with values in a [[bimodule]] is a restriction of the above case of the exterior differential acting on the [[deRham complex|deRham algebra]] of differential forms. Restricting this to 0-forms yields a morphism

$$
  d : C^\infty(X) \to \Omega^1(X)
$$

where $\Omega^1(X)$ is the space of 1-forms on $X$, regarded as a bimodule over the algebra of functions in the obvious way.

A variation of this example is given by the [[Kähler differentials]]. These provide a **universal derivation** in some sense.

### Derivations of smooth functions

+-- {: .un_prop}
###### Proposition
Let $X$ be a [[smooth manifold]] and $C^\infty(X)$ its algebra of smooth functions. Then the morphism

$$
  Vect(X) \to Der(C^\infty(X))
$$

that sends a [[vector field]] $v$ to the derivation $v(-) : C^\infty(X) \to C^\infty(X)$ is a bijection.
=--

See also at _[[derivations of smooth functions are vector fields]]_.

+-- {: .proof}
###### Proof
This is true because $C^\infty(X)$ satisfies the [[Hadamard lemma]].

Since every smooth manifold is locally isomorphic to $\mathbb{R}^n$, it suffices to consider this case. By the [[Hadamard lemma]] every function $f \in C^\infty(\mathbb{R}^n)$ may be written as

$$
  f(x) = f(0) + \sum_i x_i g_i(x)
$$

for smooth $\{g_i \in C^\infty(X)\}$ with $g_i(0) = \frac{\partial f}{\partial x_i}(0)$. Since any derivation $\delta : C^\infty(X) \to C^\infty(X)$ satisfies the the Leibniz rule, it follows that

$$
  \delta(f)(0) = \sum_i \delta(x_i) \frac{\partial f}{\partial x_i}(0)
  \,.
$$

Similarly, by translation, at all other points. Therefore $\delta$ is already fixed by its action of the coordinate functions $\{x_i \in C^\infty(X)\}$. Let $v_\delta \in T \mathbb{R}^n$ be the [[vector field]]

$$
  v_\delta \coloneqq \sum_i \delta(x_i) \frac{\partial}{\partial x_i}
$$

then it follows that $\delta$ is the derivation coming from $v_\delta$ under $Vect(X) \to Der(C^\infty(X))$.
=--

### Derivations of continuous functions {#DerOfContFuncts}

Let now $X$ be a [[topological space|topological]] [[manifold]] and $C(X)$ the algebra of continuous real-valued functions on $X$.

+-- {: .un_prop}
###### Proposition
The derivations $\delta : C(X) \to C(X)$ are all trivial.
=--

+-- {: .proof}
###### Proof
Observe that generally every derivation vanishes on the function 1 that is constant on $1 \in \mathbb{R}$. Therefore it is sufficient to show that if $f \in C(X)$ vanishes at $x_0 \in X$ also $\delta(f)$ vanishes at $x_0$, because we may write every function $g$ as $(g  - g(x_0)) + g(x_0)$.

So let $f \in C(X)$ with $f(x_0) = 0$. Then we may write $f$ as a product

$$
  f = g_1 g_2
$$

with

$$
  g_1 = \sqrt{|f|}
$$

and

$$
  g_2 : x \mapsto
  \left\{
   \array{
      f(x)/\sqrt{|f(x)|} & | f(x) \neq 0
      \\
      0 & | f(x) = 0
   }
  \right.
  \,.
$$

Notice that indeed both functions are continuous. (But even if $X$ is a smooth manifold and $f$ a smooth function, $g_1$ will in general not be smooth.)

But also both functions vanish at $x_0$. This implies that

$$
  \delta(f)(x_0) = \delta(g_1)(x_0) g_2(x_0) +
    g_1(x_0) \delta(g_2(x_0)) = 0
  \,.
$$

=--

## Related concepts

* [[operational tangent space]]

* [[p-derivation]]

* [[derivation Lie algebra]]

* [[sequence algebra]]

* [[Hasse-Schmidt derivation]]

## References

Derivations on [[infinity-algebra over an (infinity,1)-operad|algebras]] over a [[dg-operad]] are discussed in section 7 of

* {#Hinich} [[Vladimir Hinich]],  _Homological algebra of homotopy algebras_ Communications in algebra, 25(10). 3291-3323 (1997)([arXiv:q-alg/9702015](http://arxiv.org/abs/q-alg/9702015), _Erratum_ ([arXiv:math/0309453](http://arxiv.org/abs/math/0309453)))

[[!redirects derivation]]
[[!redirects derivations]]


derivation Lie 2-algebra

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### $\infty$-Lie theory
+--{: .hide}
[[!include infinity-Lie theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Definition

For $\mathfrak{g}$ a [[Lie algebra]], its **derivation Lie 2-algebra** is the corresponding [[automorphism ∞-Lie algebra]]:

it is the [[strict Lie 2-algebra]] coming from the [[differential crossed module]] that is given by the [[chain complex]]

$$
  \partial
    :
  \mathfrak{g} \stackrel{Ad}{\to} Der(\mathfrak{g})
$$

equipped with the canonical [[Lie action]] of the [[derivation Lie algebra]] $Der(\mathfrak{g})$ on $\mathfrak{g}$.


derivation Lie algebra

#Contents#
* table of contents
{:toc}

## Definition

  For $\mathfrak{g}$ a [[Lie algebra]], then the  Lie algebra of its [[automorphism Lie group]]

  $$
    \mathfrak{aut}(\mathfrak{g})_{\mathrm{even}}
  $$

called the the _automorphism Lie algebra_ of $\mathfrak{g}$ (or _derivation Lie algebra_), is the Lie algebra whose underlying vector space is that of those linear maps $\Delta \colon \mathfrak{g} \to \mathfrak{g}$
which satisfy the [[derivation]] property:

$$
  \Delta([x,y]) = [\Delta(x), y] + [x, \Delta(y)]
$$

for all $x,y \in \mathfrak{g}$. The Lie bracket on $\mathfrak{aut}(\mathfrak{g})_{\mathrm{even}}$ is the [[commutator]] operation:

$$
  [\Delta_1, \Delta_2] := \Delta_1 \circ \Delta_2 - \Delta_2 \circ \Delta_1
  \,.
$$

## Related concepts

* [[endomorphism Lie algebra]]

* [[automorphism infinity-Lie algebra]]

[[!redirects derivation Lie algebras]]

[[!redirects automorphism Lie algebra]]
[[!redirects automorphism Lie algebras]]

[[!redirects Lie algebra derivation]]
[[!redirects Lie algebra derivations]]


derivation on a group

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### Group Theory
+-- {: .hide}
[[!include group theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Derivations:

For convenience we assume below that $M$ is a $G$-[[module]], it does not in general have to be abelian and it suffices to have it a $G$-[[group]].

Suppose $G$ is a [[group]] and $M$ a $G$-[[module]] and let $\delta : G \to M$ be a __derivation__ in the sense that $\delta(g_1g_2) = \delta(g_1) +g_1\delta(g_2)$ for all $g_1, g_2 \in G$
(a [[crossed homomorphism]] -- notice that it's *not* $\delta(g_1)g_2 + g_1\delta(g_2)$ as for the other notion of [[derivation]].)

For calculations, the following lemma is very valuable, although very simple to prove.

+-- {: .un_lemma}
###### Lemma

If  $\delta : G \to M$ is a derivation, then

1. $ \delta(1_G) = 0$;

2. $\delta(g^{-1}) = -g^{-1}\delta(g)$ for all $g \in G$;

3. for any $g \in G$ and $n\geq 1$,

   $$\delta(g^n) = (\sum^{n-1}_{k=0}g^k)\delta(g).$$
=--

+-- {: .proof}
###### Proof
As was said, these are easy to prove.

$\delta(g) = \delta(1) + 1\delta(g)$, so $\delta(1)= 0$, and hence (1); then

$$\delta(1) = \delta(g^{-1}g) = \delta(g^{-1}) + g^{-1}\delta(g)$$

to get (2), and finally induction to get (3).
=--

##Remarks and examples:

* There is a mapping from $G$ to its [[augmentation ideal]], $I(G)$, defined by $d_G(g)= g-e_G$.  This is the [[derived module|universal derivation]] towards $G$-modules.

* The [[Fox derivatives]] are examples of derivations.  It is worth noting that this lemma allows a simplification of the conditions given there (as noted there).

###Example calculation using the [[Fox derivative]] w.r.t a generator.

 Let $X = \{u,v\}$, with $r \equiv u v u v^{-1} u^{-1} v^{-1} \in F = F(u,v),$ then

$$ \frac{\partial r}{\partial u} = 1 + u v - u v u v^{-1} u^{-1},$$

$$ \frac{\partial r}{\partial v} = u - u v u v^{-1} -  u v u v^{-1} u^{-1} v^{-1}.$$
This relation, $r$, is the typical [[braid group]] relation, here in $Br_3$.

##Relative derivations

These are a useful relative form of derivation. The notion is often avoided as it can easily be reduced to the more standard form above by restricting the module structure along $\varphi$.

Let  $\varphi  : H \rightarrow  G$  be a   homomorphism of  groups.
 A  _$\varphi $-derivation_ from a group to a module,

$$\partial  : H \rightarrow  M,$$

from  $H$  to a left  $\mathbb{Z}[G]$-module,  $M$,  is a mapping from  $H$  to  $M$,  which satisfies the equation

$$\partial (h_1 h_2 ) = \partial (h_1 ) + \varphi (h_1)\partial (h_2 )$$

for all  $h_1$, $h_2  \in  H$.

There is a universal such $\varphi$-derivation, $d_\varphi:H\to D_\varphi$.  The codomain of this is variously called the [[derived module]] of $\varphi$ (e.g. by [[Crowell]]) or the $\varphi$-differential module by [[Masanori Morishita|Morishita]].

The set of  $\varphi$-derivations is often written $Der_\varphi(H,M)$, or simply $Der_\varphi(M)$.

## Related concepts

* [[crossed homomorphism]]

## References

For the original version of derived module, see

* [[R. H. Crowell]], _The derived module of a homomorphism_, Advances  in Math., 5, (1971), 210–238 (doi:10.1016/0001-8708(71)90016-8)

Textbook account:

* [[Kenneth Brown]],  p. 45 of: _Cohomology of Groups_, Graduate Texts in Mathematics, **87**, Springer 1982 ([doi:10.1007/978-1-4684-9327-6](https://link.springer.com/book/10.1007/978-1-4684-9327-6))

Application in [[arithmetic topology]]:

* {#Morishita12} [[Masanori Morishita]], _Knots and Primes: An Introduction to Arithmetic Topology_, 2012 ([web](https://books.google.co.uk/books?id=DOnkGOTnI78C&pg=PA156#v=onepage&q&f=false))

[[!redirects derivations on a group]]