interval arithmetic

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

# Contents
* table of contents
{: toc}

## Idea

[[arithmetic|Arithmetic]] for [[closed interval]]s of an [[ordered field]].

## Definition

Let $F$ be an [[ordered field]]. The closed intervals of $F$ can be represented by a [[subset]] of the [[Cartesian product]] set $F \times F$:

$$\mathcal{I}(F) \coloneqq \{(a, b) \in F \times F \vert (a \leq b)\}$$

The elements $[a, b] \in \mathcal{I}(F)$ of the [[set]] are the endpoints of the closed intervals, which we shall call **intervals** for short.

There is an [[embedding]] $i:F \to \mathcal{I}(F)$ defined by

$$i(a) \coloneqq [a, a]$$

Equality of intervals is defined as

$$([a, b] = [c, d]) \coloneqq (a = c) \times (b = d)$$

If $R$ has [[decidable equality]], then $\mathcal{I}(R)$ has decidable equality as well.

### Relation to the zero interval ###

A positive interval is defined by

$$([0, 0] \lt [a, b]) \coloneqq (0 \lt a)$$

A negative interval is defined by

$$([0, 0] \gt [a, b]) \coloneqq (0 \gt b)$$

A indefinite interval is defined by

$$([0, 0] \sim [a, b]) \coloneqq \neg(0 \lt a) \wedge \neg(0 \gt b)$$

### Arithmetic of intervals ###

Zero is defined by

$$0 \coloneqq [0, 0]$$

Addition is defined by

$$[a, b] + [c, d] \coloneqq [a + c, b + d]$$

Negation is defined by

$$-[a, b] \coloneqq [-b, -a]$$

Subtraction is defined by

$$[a, b] - [c, d] \coloneqq [a, b] + (-[c, d]) = [a - d, b - c]$$

Intervals do not form an [[abelian group]] because $[a, b] - [a, b] = [a - b, b - a]$, and $[a - b, b - a] = 0$ if and only if $a = b$. However, they do form a [[commutative monoid]] under zero and addition.

One is defined by

$$1 \coloneqq [1, 1]$$

Multiplication is defined by

$$[a, b] \cdot [c, d] \coloneqq [\min(ac, ad, bc, bd), \max(ac, ad, bc, bd)]$$

Intervals form a [[commutative monoid]] under one and multiplication. Zero and multiplication also form an [[absorption monoid]]. Multiplication does not distribute over addition:

$$[1, 2] \cdot ([1, 3] + [-1, 3]) = [1, 2] \cdot [0, 6] = [\min(0, 6, 0, 12), \max(0, 6, 0, 12)] = [0, 12]$$

$$[1, 2] \cdot [1, 3] + [1, 2] \cdot [-1, 3] = [\min(1, 2, 3, 6), \max(1, 2, 3, 6)] + [\min(-1, -2, 3, 6), \max(-1, -2, 3, 6)] = [1, 6] + [-2, 6] = [-1, 12]$$

$$[0, 12] \neq [-1, 12]$$

The reciprocal is only defined for intervals that are positive or negative: $0 \lt [a, b]$ or $0 \gt [a, b]$, and is defined by

$$1/[a, b] \coloneqq [1/b, 1/a]$$

Division is only defined for intervals in the denominator that are positive or negative: $0 \lt [c, d]$ or $0 \gt [c, d]$, and is defined by

$$[a, b]/[c, d] \coloneqq [a, b] \cdot [1/d, 1/c] = [\min(a/c, a/d, b/c, b/d), \max(a/c, a/d, b/c, b/d)]$$

However, division of an interval by itself does not return the constant one: if $0 \lt [a, b]$ or $0 \gt [a, b]$, then

$$[a, b]/[a, b] = [\min(a/a, a/b, b/a, b/b), \max(a/a, a/b, b/a, b/b)] = [a/b, b/a]$$

and $[a/b, b/a] = 1$ if and only if $a = b$.

### Ordering of the intervals ###

The [[linear order]] of the rational intervals is defined as

$$([a, b] \lt [c, d]) \coloneqq (b \lt c)$$

The [[opposite]] linear order of the rational intervals is defined as

$$([a, b] \gt [c, d]) \coloneqq (a \gt d)$$

The [[subset|containment]] [[relation]] of the rational intervals is defined as

$$([a, b] \subseteq [c, d]) \coloneqq (a \geq c) \wedge (b \leq d)$$

The opposite containment relation of the rational intervals is defined as

$$([a, b] \supseteq [c, d]) \coloneqq (a \leq c) \wedge (b \geq d)$$

## See also ##

* [[arithmetic]]

* [[interval]]

* [[ordered field]]

* [[interval cut]]

* [[Dedekind cut]]


interval category

\tableofcontents

## Definition

### Interval category

The **interval category** -- often denoted $\mathbf{2}$ or $I$ or $\Delta[1]$ -- is the [[category]] with two [[object]]s and precisely one nontrivial [[morphism]] connecting them:

$$
  I =
  \left\{
    0 \to 1
  \right\}
  \,.
$$

It is also commonly called the **interval preorder** or the **interval poset** (since it is indeed a [[poset]]).

The interval category serves as a [[combinatorial]] model for the [[directed space|directed]] [[interval]]. It is the directed canonical [[interval object]] in [[Cat]].  It is also called the **[[walking structure|walking]] arrow**.  It might also be called the "arrow category" although that term is [[arrow category|also used]] for a category of functors out of $\mathbf{2}$.

The notation $\mathbf{2}$ comes from the fact that the interval category is also the [[ordinal number]] $2$ regarded as a [[poset]], regarded as a category.

It also appears as

* the 1-[[simplex]];

* the first [[oriental]];

* the [[1-globe]].

Since every [[category]] is also an [[(n,r)-category]] for $n,r \geq 1$, we may regard $I$ also as some $(n,r)$-category. For instance regarded as a [[(∞,1)-category]] and modeled as a [[quasi-category]], the interval category is the [[simplicial set]] $\Delta[1]$.

### In (homotopy) type theory

In [[type theory]], the type of objects of the interval category is the [[booleans type]] $\mathbb{2}$.  The relation on it $\leq_\mathbb{2}$ can be [[inductive type|inductively]] generated by

* a term $p:0 \leq_\mathbb{2} 1$

* a term $\mathrm{refl}_0:0 \leq_\mathbb{2} 0$

* a term $\mathrm{refl}_1:1 \leq_\mathbb{2} 1$

It can equivalently be defined [[recursion|recursively]] on $\mathbb{2}$ by

* $(0 \leq_\mathbb{2} 0) \equiv \top $
* $(0 \leq_\mathbb{2} 1) \equiv \top $
* $(1 \leq_\mathbb{2} 0) \equiv \bot $
* $(1 \leq_\mathbb{2} 1) \equiv \top $

Since the symbol $\mathbb{I}$ is sometimes used for the [[interval type]] in [[homotopy type theory]], which is [[contractible type|contractible]], it may be better to avoid it for the interval category unless the meaning is clear from context.

### Interval groupoid

Inverting the single non-identity arrow of the interval category, we obtain the [[interval groupoid]], which is an (undirected) [[interval object]] in [[Cat]] and [[Grpd]].

## Applications

The interval category is one of those [[diagram]] category that are not terribly interesting in themselves, but that serve an important role in [[category theory]] as a whole.

For instance a [[natural transformation]] $\eta : F \Rightarrow G$ between two [[functor]]s $F,G : C \to D$ is precisely the same as a strictly [[commuting diagram]]

$$
  \array{
    C \times \{0\}
    \\
    \downarrow & \searrow^{\mathrlap{F}}
    \\
    C \times I &\stackrel{\eta}{\to}& D
    \\
    \uparrow & \nearrow_{\mathrlap{G}}
    \\
    C \times \{1\}
  }
$$

in [[Cat]], where on the left we have the [[cartesian product]] of $C$ with $I$.

Accordingly, for $I_{iso}$ the interval groupoid, a [[natural isomorphism]] $\eta : F \Rightarrow G$ is the same as a diagram

$$
  \array{
    C \times \{0\}
    \\
    \downarrow & \searrow^{\mathrlap{F}}
    \\
    C \times I_{iso} &\stackrel{\eta}{\to}& D
    \\
    \uparrow & \nearrow_{\mathrlap{G}}
    \\
    C \times \{1\}
  }
 \,.
$$

This is a [[left homotopy]] in $Cat$.

Dually, forming the [[functor category]]

$$
  Arr(D) := [I,D]
$$

from the interval category produces the [[arrow category]] of $D$, and a natural transformation $\eta$ is also the same as a diagram

$$
  \array{
     && D \times \{0\}
     \\
     & {}^{\mathllap{F}}\nearrow & \uparrow
     \\
     C &\stackrel{\eta}{\to}& [I,D]
     \\
     & {}_{\mathllap{G}}\searrow & \downarrow
     \\
     && D \times \{1\}
  }
  \,.
$$

With $I$ replaced by $I_{iso}$ this is again a natural isomorphism, now represented as a [[right homotopy]] in [[Cat]].

The analogous statements are true in [[higher category theory]].

[[!redirects I]]
[[!redirects walking arrow]]
[[!redirects walking morphism]]

[[!redirects interval preorder]]
[[!redirects interval proset]]
[[!redirects interval poset]]


interval cut

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Arithmetic
+-- {: .hide}
[[!include arithmetic geometry - contents]]
=--
#### Analysis
+-- {: .hide}
[[!include analysis - contents]]
=--
=--
=--

# Contents
* table of contents
{: toc}

## Idea

A way of defining a [[dense linear order]] that behaves like the [[closed intervals]] in a dense linear order, which identifies each closed interval $[a,b]$ with the pair of [[open intervals]] $(-\infty, a), (b, \infty)$.

## Definition

Given a [[DLO]] $D$,  An __interval cut__ is a pair $(L,U)$ of [[subsets]] of elements in $D$ satisfying these conditions:

1.  $L$ is [[inhabited set|inhabited]]; that is, some element of $D$ belongs to $L$.
2.  Similarly, $U$ is inhabited.
3.  $L$ is a [[lower set]]; that is, if $a \lt b$ are elements of $D$ with $b \in L$, then $a \in L$.
4.  Similarly, $U$ is an [[upper set]]: if $a \lt b$ are elements of $D$ with $a \in U$, then $b \in U$.
5.  $L$ is an upwards [[open set]]; that is, if $a \in L$, then $a \lt b$ for some $b \in L$.
6.  Similarly, $U$ is a  downwards [[open set]]: if $b \in U$, then $a \lt b$ for some $a \in U$.
8.  If $a \in L$ and $b \in U$, then $a \lt b$.

The [[DLO]] of __closed intervals__ in $D$ is defined to be the [[set]] of all interval cuts in $D$.

## Properties

* The set of all [[located real number|located]] interval cuts in $\mathbb{Q}$ is the [[Dedekind real numbers]]

* The set of all interval cuts in $\mathbb{Q}$ with a [[locator]] is the [[modulated Cauchy real numbers]]

## See also

* [[interval arithmetic]]

* [[Dedekind cut]]

* [[locator]]

## References

* Auke Booij, *Extensional constructive real analysis via locators*, ([abs:1805.06781](https://arxiv.org/abs/1805.06781))

* Mark Bridger, [Real Analysis: A Constructive Approach Through Interval Arithmetic](https://bookstore.ams.org/amstext-38), Pure and Applied Undergraduate Texts 38, American Mathematical Society, 2019.

[[!redirects interval cuts]]


interval object

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

#Contents#
* table of contents
{:toc}

## Idea

An _interval object_ $I$ in a [[category]] $C$ is an [[object]] that behaves in $C$ roughly like the standard [[topological interval]] $I \coloneqq [0,1]$ with its two boundary point inclusions

$$
  {*}\amalg {*} \stackrel{[0, 1]}{\to}
  I
$$

in the category [[Top]] of [[topological spaces]], where $[0,1]$ is the [[copairing]] of the [[global elements]] $0\colon {*} \to I$ and $1\colon {*} \to I$.

A bare interval object may be nothing more than such a diagram. If $C$ admits sufficiently many [[limit]]s and [[colimit]]s, then from this alone a lot of structure derives. The precise definition of further structure and property imposed on an interval object varies with the intended context and applications.

Notably in a large class of applications the interval object in $C$ supposed to be the right structure to ensure

1. that there is an object $I$ in $C$ such that for every object $X$ of $C$ the [[internal hom|internal hom object]] $[I,X]$ exists and behaves like a [[path space object]] for $X$;

2. that there is a notion of composition on these path objects which induces on $[I,X]$ a structure of a (higher) category internal to $C$: the [[fundamental category]] or [[fundamental groupoid]] of the object $X$, or rather its [[fundamental infinity-groupoid]].

For instance the choice $C =$ [[Top]] and $I = [0,1]$
should be an instance of a category with interval object, and the fundamental [[algebraic definition of higher category|algebraic]] [[n-groupoid]] $\Pi_n(X)$ obtained for any topological space $X$ from this data should be the fundamental $n$-groupoid as a [[Trimble n-category]].

We give two very similar definitions that differ only in some extra assumptions.

* The first one was used by Berger and Moerdijk to generalize the Boardman–Vogt resolution of [[topological operad]]s to more general [[operad]]s.

* The second is motivated from constructions appearing in the definitions of [[Trimble n-category]] and of [[generalized universal bundle]]. It includes the possibility that the interval is _not_ weakly equivalent to the point, in which case it may be used nontrivially to test for [[undirected object]]s and probe [[directed object]]s.

## Definitions

### Plain definition

+-- {: .un_defn}
###### Definition (plain interval object)

A **plain interval object** in a category $C$ is just a [[cospan]] diagram with equal feet

$$
  pt \stackrel{0}{\to} I \stackrel{1}{\leftarrow} pt
$$

in $C$, with $I$ and $pt$ any two objects and $0$ and $1$ any two morphisms.

=--

In categories with finite limits it is often required that $pt=*$ is the terminal object and in this case the interval object is called *cartesian interval object*.

Examples for the use of this notion is at [[fundamental (infinity,1)-category]] in the section "fundamental geometric ∞-categories".

#### Contractible interval object

+-- {: .un_defn}
###### Definition (contractible interval object)

A *contractible interval object* in a category $C$ with a [[terminal object]] $*$ is an object $I$ with two [[global elements]] $0:* \to I$ and $1:* \to I$ such that

* $0 = 1$
* for any object $A$ in $C$ and global elements $0_A:* \to A$ and $1_A:* \to A$ such that $0_A = 1_A$, there exists a morphism $f:I \to A$ such that $f \circ 0 = 0_A$ and $f \circ 1 = 1_A$.

=--

+-- {: .un_defn}
###### Definition (contractible interval object in (n, 1)-categories)

A *contractible interval object* in an $(n, 1)$-category $C$ with a [[terminal object]] $*$ is an object $I$ with two [[global elements]] $0:* \to I$ and $1:* \to I$ and an [[equivalence]] $s:0 \cong 1$ such that

* for any object $A$ in $C$ and global elements $0_A:* \to A$ and $1_A:* \to A$ with an equivalence $s_A:0_A \cong 1_A$, there exists a morphism $f:I \to A$ with a morphism $f^{'}:(0 \cong 1) \to (0_A \cong 1_A)$ such that the [[equivalences]] $p:f \circ 0 \cong 0_A$, $q:f \circ 1 \cong 1_A$, and $r:f^{'}(s) \cong s_A$ satisfy the [[coherence laws]].
=--

The [[universal property]] of the contractible interval object means that the contractible interval object corresponds to the [[interval type]] in [[Martin-Löf type theory]]/[[homotopy type theory]], and is thus [[equivalent]] to the terminal object. If a [[cartesian closed category|cartesian closed]] $(n,1)$-category has an contractible interval type, the terminal object is a [[separator]] (see [Mike Shulman's blogpost](https://homotopytypetheory.org/2011/04/04/an-interval-type-implies-function-extensionality/)).

### In homotopical categories

If the ambient category $C$ is a [[homotopical category]],
such as a [[model category]], there are natural
further conditions to put on an interval object:

#### Trimble interval object
 {#IntervalForTrimbledOmegaeCategories}

The following definition is strongly related to the notion of [[Trimble omega-category]] where the interval object gives the internal hom $[I,X]$ the structure of an [[operad]] giving (by induction) the model of an $A_\infty$-[[A-infinity-category|category]] structure on

$$
  (X_0 := [pt,X])
  \stackrel{s := [\sigma,X]}{\leftarrow}
  [I,X]
  \stackrel{t := [\tau, X]}{\to} (X_0 := [pt,X])
  \,.
$$

This internal $A_\infty$-category is denoted

$$
  \Pi_1(X)
$$

This is in (a bit) more detail in [[Trimble omega-category]] and in [[fundamental (infinity,1)-category]] in the section "Fundamental algebraic $\infty$-categories".

+-- {: .un_defn}
###### Definition (Trimble interval object)

A **category with interval object** is

* a symmetric [[closed monoidal homotopical category]] $V$;

* with tensor unit being the [[terminal object]], which we write $pt$;

* equipped with a [[bi-pointed object]]
$$
  \array{
    && I
    \\
    & {}^\sigma \nearrow && \nwarrow^{\tau}
    \\
    pt &&&& pt
  }
$$

in $V$, with $I$ called the **interval object**;

such that

* the [[pushout]]
$$
  \array{
    && I^{\vee 2} := I \amalg_{pt} I
    \\
    & \nearrow && \nwarrow
    \\
    I &&&& I
    \\
    & {}_{\tau}\nwarrow
    && \nearrow_{\sigma}
    \\
    && pt
  }
$$
exists in $V$, so that all compositions
$$
  \array{
    && I^{\vee n}
    \\
    & {}^\sigma \nearrow && \nwarrow^{\tau}
    \\
    pt &&&& pt
  }
$$
of $n \in \mathbb{N}$ copies of the [[co-span]] $I$ with itself by pushout over adjacent legs exist in $V$;

* and for all $n$, the $V$-objects of morphisms ${}_{pt}[I, I^{\vee n}]_{pt}$ of cospans (as described at [[co-span]]) are weakly equivalent to the point
 $$
   {}_{pt}[I, I^{\vee n}]_{pt}
   \,.
 $$
=--

#### Berger--Moerdijk segment- and interval object

In [section 4](http://arxiv.org/PS_cache/math/pdf/0502/0502155v2.pdf#page=11)
of

* [[Clemens Berger]], [[Ieke Moerdijk]], _The Boardman-Vogt resolution of operads in monoidal model categories_ ([arXiv](http://arxiv.org/abs/math.AT/0502155))

the following definition is given:

Let $V$ be a [[monoidal model category]] and write $pt$ for the tensor unit in $V$ (not necessarily the terminal object).

A **[[segment object|segment (object)]]** $I$ in a [[monoidal model category]] $V$ is

* a factorization

  $$
    pt \amalg pt \stackrel{[0 , 1]}{\to}
    I \stackrel{\epsilon}{\to} pt
  $$

  of the [[codiagonal morphism]]

  $$
    pt \amalg pt \stackrel{[Id , Id]}{\to} pt
  $$

  from the [[coproduct]] of $pt$ with itself that
  sends each component identically to $pt$.

* together with an associative morphsim

  $$
    \vee : I \otimes I \to I
  $$

  which has 0 as its _neutral_ and 1 as
  its _absorbing_ element, and for which
  $\epsilon$ is a counit.

If $V$ is equipped with the structure of a [[model category]] then a segment object is an **interval** in $V$ if

$$
  [0, 1]\colon pt \amalg pt \to I
$$

is a cofibration and $\epsilon : I \to pt$ a weak equivalence.

### Interval type
  {#InHomotopyTypeTheory}

In [[homotopy type theory]] the cellular interval can be axiomatized as a [[higher inductive type]]. See _[[interval type]]_ for more.

## Examples

* In [[sSet]] the standard interval object is the 1-[[simplex]] $\Delta[1]$.

* In a [[category of chain complexes]] the standard interval is
  the [[chain on a simplicial set|simplicial chain complex]] $C_\bullet(\Delta[1])$ on the 1-simplex, see at [[interval object in chain complexes]].

* The [[cube category]] is generated from a single interval object.

* The **standard interval object** in [[Cat]] is the 1st [[oriental]] $\{0\to 1\}$ (see [[co-span co-trace]])

* For $V = C =$ [[Top]] equipped with with the [[classical model structure on topological spaces]], the topological [[closed interval]]  $I \colon [0,1]$ (with its [[Euclidean space|Euclidean]] [[metric topology]]) with $pt \stackrel{\sigma, \tau}{\to}I$ the maps to 0 and 1, respectively. This is the standard _[[topological interval]]_. This is the case described in detail at _[[Trimble n-category]]_.

* For $V = \omega Cat$ the category of [[strict omega-category|strict omega-categories]] the first [[oriental]], the 1-[[globe]] $I = \{a \to b\}$ is an interval object. In this strict case in fact all hom objects are already equal to the point ${}_{pt}[I, I^{\vee n}]_{pt} = pt$ and
$$
  (X = [pt,X])
  \stackrel{s := [\sigma,X]}{\leftarrow}
  [I,X]
  \stackrel{t := [\tau, X]}{\to} (X = [pt,X])
$$
is a strict co-category internal to $\omega$Cat.
In this case, for $X$ any $\omega$-category
the $A_\infty$-category $\Pi_1(X)$ is just an ordinary category, namely the 1-category obtained from truncation of $X$. Similarly, probably $\Pi_\omega(X) = X$ in this case.

### Standard intervals, cubes and simplices in $Top$ and $Diff$

Let $X = $ [[Top]] or $C = $ [[Diff]] be the category of [[topological space]]s
or of [[manifold]]s.

A standard choice of interval object in $C$ is $I = [0,1] \subset \mathbb{R}$
with the obvious two boundary inclusions $0,1 : {*} \to [0,1]$.

But another possible choice is to let $I = \mathbb{R}$ be the whole
real line, but still equipped with the two maps $0,1 : {*} \to \mathbb{R}$,
that hit the $0 \in \mathbb{R}$ and $1 \in \mathbb{R}$, respectively.

Either of these two examples will do in the following discussion.
The second choice is to be thought of as obtained from the first choice
by adding "infinitely wide [[collars]]" at both boundaries of $[0,1]$. While
${*} \stackrel{0}{\to}[0,1]
\stackrel{1}{\leftarrow} {*}$ may seem like a more natural choice for a representative of the
idea of the "standard interval", the choice ${*} \stackrel{0}{\to} \mathbb{R}
\stackrel{1}{\leftarrow} {*}$ is actually more useful for many
[[category theory|abstract nonsense]] constructions.

But since it is hard to draw the full real line, in the following we depict the situation for the choice $I = [0,1]$.

Then for low $n \in \mathbb{N}$ the above construction yields this

* $n=0$ -- here $\Delta_I^0 = I^{\times 0} = {*}$ is the [[point]].

* $n=1$ -- here $\Delta_I^1 = I^{\times 1} = I$ is just the interval itself

  $$
    \array{
      (0) \to (1)

    }
  $$

  The two face maps $\delta_1 {*} \to I$ and $\delta_0 : {*} \to I$ pick
  the boundary points in the obvious way. The unique degeneracy map
  $\sigma_0 : I \to {*}$ maps all points of the interval to the single point
  of the point.

* $n=2$ -- here $\Delta_i^2 = I^{\times 2} = I \times I$
  is the **standard square**

  $$
    \array{
      (0,1) &\to& (1,1)
      \\
      \uparrow && \uparrow
      \\
      (0,0) &\to& (1,0)
    }
  $$

  But the three face maps $\delta_i : I \to I\times I$ of the cosimplicial
  object $\Delta_I$ constructed above don't regard the full square here, but
  just a triangle sitting inside it, in that pictorially they
  identify $(\Delta_I^1 = I)$-shaped boundaries in $I \times I$ as follows:

  $$
    \array{
      (0,1) &\to& (1,1)
      \\
      \uparrow &^{= \delta_1(I)}\nearrow& \uparrow^{ = \delta_0(I)}
      \\
      (0,0) &\stackrel{= \delta_2(I)}{\to}& (1,0)
    }
  $$

  (here the arrows do not depict morphisms, but the standard topological interval,
  i don't know how to typeset just lines without arrow heads in this fashion!)

* $n=3$ -- here $\Delta_i^3 = I^{\times 3} = I \times I \times I$
  is the **standard cube**

  +-- {: .un_example}
  ###### Exercise
  Insert the analog of the above discussion here
  and upload a nice graphics that shows the standard cube and how the
  cosimplicial object $\Delta_I$ picks a solid tetrahedron inside it.
  =--

As a start, we can illustrate how there are 6 3-simplices sitting inside each 3-cube.

Once you see how the 3-simplices sit inside the 3-cube, the facemaps can be illustrated as follows:

Note that these face maps are to be thought of as maps into 3-simplices sitting inside a 3-cube.

### $\mathbb{A}^1$-homotopy theory

See [[A1-homotopy theory]].

## Fundamental $\infty$-categories induced from intervals

The interest in interval objects is that various further structures of interest may be built up from them. In particular, since picking an interval object $I$ is like picking a notion of _path_, in a category with interval object there is, under mild assumptions, for each object $X$ an [[infinity-category]] $\Pi_I(X)$ -- the fundamental $\infty$-category of $X$ with respect to $I$ -- whose [[k-morphism]]s are $k$-fold $I$-paths in $X$.

This is described for two models for $(\infty,1)$-categories at [[fundamental (infinity,1)-category]]

## Homotopy localization induced from an interval

Given a suitable interval obect in a [[site]] $C$, one may ask for [[∞-stack]]s on $C$ that are invariant under the notion of [[homotopy]] induced by $I$. These are obtained by [[homotopy localization]] of a full [[(∞,1)-category of (∞,1)-sheaves]] on $C$.

## Related concepts

* [[interval]], [[interval type]]

## References

* Clemens Berger, [[Ieke Moerdijk]], _The Boardman-Vogt resolution of operads in monoidal model categories_ ([arXiv](http://arxiv.org/abs/math.AT/0502155)), section 4, p.11

[[!redirects interval objects]]
[[!redirects simplex in a lined topos]]
[[!redirects contractible interval object]]


interval object in chain complexes

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

#Contents#
* table of contents
{:toc}

## Idea

The standard [[interval object]] in a [[category of chain complexes]] in $R$[[Mod]] is an "abelianization" of the standard simplicial interval, the 1-[[simplex]] and a model of the unit interval, $[0,1]$, with the evident cell decomposition.

## Definition

Let $R$ be some [[ring]] and let $\mathcal{A} = R$[[Mod]] be the [[abelian category]] of $R$-[[modules]]. Write $Ch_\bullet(\mathcal{A})$ for the corresponding [[category of chain complexes]].

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

The standard **interval object in chain complexes**

$$
  I_\bullet \in Ch_\bullet(\mathcal{A})
$$

is the [[normalized chain complex]] of the [[chain on a simplicial set|simplicial chains]] on the simplicial 1-[[simplex]]:

$$
  I_\bullet \coloneqq N_\bullet(C(\Delta[1]))
  \,.
$$

In components this means that

$$
  I_\bullet =
  [
    \cdots \to 0 \to 0 \to R \stackrel{(id,-id)}{\to}
   R \oplus R
  ]
  \,.
$$

=--

## Properties

### Homotopies

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

A [[homotopy]] with respect to $I_\bullet$ gives a
[[chain homotopy]] and conversely.

=--

See the entry on [[chain homotopy]]  for more details.

[[!redirects interval in chain complexes]]
[[!redirects intervals in chain complexes]]


interval type

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

#Contents#
* table of contents
{:toc}

## Idea

The _interval type_ is an [[axiom|axiomatization]] of the cellular [[interval object]] in the context of [[homotopy type theory]].

## Definition

As a [[higher inductive type]], the interval is given by

    Inductive Interval : Type
      | left : Interval
      | right : Interval
      | segment : Id Interval left right

This says that the type is inductive constructed from two [[terms]] in the interval, whose [[semantics|interpretation]] is as the endpoints of the interval, together with a term in the [[identity type]] of paths between these two terms, which interprets as the 1-cell of the interval

$$
  left \stackrel{segment}{\to} right
  \,.
$$

### Induction principle

The [[induction principle]] for the interval $I$ says that for any $P:I\to Type$ equipped with point $left' : P(left)$ and $right' : P(right)$ and a [[dependent identification]] $segment':left'=_P^{segment} right'$, there is $f:\prod_{(x:I)} P(x)$ such that:

$$f(left)=left' \qquad f(right)=right' \qquad apd_f(segment) = segment'$$

and for every $y:I \vdash g:\prod_{(x:I)} P(x)$ such that

$$y:I \vdash g(y)(left)=left' \qquad y:I \vdash g(y)(right)=right' \qquad y:I \vdash apd_{g(y)}(segment) = segment'$$

there is an identification $y:I \vdash f = g(y)$.

As a special case, its [[recursion principle]] says that given any type $I$ with points $x:X$ and $y:X$ and an identification $p:x=y$, there is $f:I \to X$ with

$$f(left)=x\qquad f(right)=y\qquad ap_f(segment)=p$$

### Syntax

The interval type is defined by the following rules:

Formation rules for the interval type:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathbb{I} \; \mathrm{type}}$$

Introduction rules for the interval type:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash 0:\mathbb{I}} \qquad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash 1:\mathbb{I}} \qquad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash p:0 =_\mathbb{I} 1}$$

Elimination rules for the interval type:
$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma, x:\mathbb{I} \vdash \mathrm{ind}_\mathbb{I}^C(c_0, c_1, c_p)(x):C(x)}$$

Computation rules for the interval type:

* judgmental computational rules
$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \mathrm{ind}_\mathbb{I}^{C}(c_0, c_1, c_p)(0) \equiv c_0:C(0)}$$

$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \mathrm{ind}_\mathbb{I}^{C}(c_0, c_1, c_p)(1) \equiv c_1:C(1)}$$

$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \mathrm{apd}_C(\mathrm{ind}_\mathbb{I}^{C}(c_0, c_1, c_p), 0, 1, p) \equiv c_p:c_0 =_C^p c_1}$$

* propositional computation rules
$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \beta_\mathbb{I}^{0}(c_0, c_1, c_p): \mathrm{ind}_\mathbb{I}^{C}(c_0, c_1, c_p)(0) =_{C(0)} c_0}$$

$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \beta_\mathbb{I}^{1}(c_0, c_1, c_p):\mathrm{ind}_\mathbb{I}^{C}(c_0, c_1, c_p)(1) =_{C(1)} c_1}$$

$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \beta_\mathbb{I}^{p}(c_0, c_1, c_p):\mathrm{apd}_C(\mathrm{ind}_\mathbb{I}^{C}(c_0, c_1, c_p), 0, 1, p) =_{c_0 =_C^p c_1} c_p}$$

Uniqueness rules for the interval type:
$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma, x:\mathbb{I} \vdash c:C(x)}{\Gamma, x:\mathbb{I} \vdash \eta_\mathbb{I}(c):c =_{C(x)} \mathrm{ind}_\mathbb{I}^{C}(c(0), c(1), \mathrm{apd}_C(p, c))}$$

The elimination rules and the propositional computation and uniqueness rules for the interval type state that the interval type satisfy the **dependent universal property of the interval type**. If the dependent type theory also has [[dependent sum types]] and [[product types]], allowing one to define the [[uniqueness quantifier]], the dependent universal property of the interval type could be simplified to the following rule:

$$\frac{\Gamma, x:\mathbb{I} \vdash C(x) \; \mathrm{type} \quad \Gamma \vdash c_0:C(0) \quad \Gamma \vdash c_1:C(1) \quad \Gamma \vdash c_p:c_0 =_C^p c_1}{\Gamma \vdash \mathrm{up}_\mathbb{I}^C(c_0, c_1, c_p):\exists!c:\prod_{x:\mathbb{I}} C(x).(c(0) =_{C(0)} c_0) \times (c(1) =_{C(1)} c_1) \times (\mathrm{apd}_{x:\mathbb{I}.C(x)}(c, c_0, c_1, c_p) =_{c_0 =_C^p c_1} c_p)}$$

In type theories with a separate type judgment where not all types are elements of universes, one has to additionally add the following elimination and computation rules:

Elimination rules:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma, x:\mathrm{I} \vdash \mathrm{typerec}_{\mathbb{I}}^{A, B}(e, i) \; \mathrm{type}}$$

Computation rules:

* judgmental computation rules
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{typerec}_{\mathbb{I}}^{A, B}(e, 0) \equiv A \; \mathrm{type}}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{typerec}_{\mathbb{I}}^{A, B}(e, 1) \equiv B \; \mathrm{type}}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \mathrm{transport}_{\mathrm{typerec}_{\mathbb{I}}^{A, B}(e)}(0, 1, p_\mathbb{I}) \equiv e:A \simeq B}$$

* typal computation rules
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \beta_{\mathrm{I}}^{0, A, B}(e):\mathrm{typerec}_{\mathbb{I}}^{A, B}(e, 0) \simeq A}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \beta_{\mathrm{I}}^{1, A, B}(e):\mathrm{typerec}_{\mathbb{I}}^{A, B}(e, 1) \simeq B}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \quad \Gamma \vdash e:A \simeq B}{\Gamma \vdash \beta_{\mathrm{I}}^{p_\mathrm{I}, A, B}(e):\beta_{\mathrm{I}}^{1, A, B}(e) \circ \mathrm{transport}_{\mathrm{typerec}_{\mathbb{I}}^{A, B}(e)}(0, 1, p_\mathbb{I}) \circ \beta_{\mathrm{I}}^{0, A, B}(e)^{-1} =_{A \simeq B} e}$$

### Using a function from the boolean domain

The interval type is defined by the following rules:

Formation rules for the interval type:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathbb{I} \; \mathrm{type}}$$

Introduction rules for the interval type:
$$\frac{\Gamma \vdash a:\mathbb{2}}{\Gamma \vdash j(a):\mathbb{I}} \qquad \frac{\Gamma \vdash 0:\mathbb{2} \quad \Gamma \vdash 1:\mathbb{2}}{\Gamma \vdash p:j(0) =_\mathbb{I} j(1)}$$

Elimination rules for the interval type:
$$\frac{\Gamma, x:\mathbb{I} \vdash C \; \mathrm{type} \quad \Gamma, a:\mathbb{2} \vdash c:C[j(a)/x] \quad \Gamma \vdash 0:\mathbb{2} \quad \Gamma \vdash 1:\mathbb{2} \quad \Gamma \vdash c_p:c[j(0)/x] =_C^p c[j(1)/x]}{\Gamma, x:\mathbb{I}, a:\mathbb{2} \vdash \mathrm{ind}_\mathbb{I}^C(c[j(a)/x], c_p):C}$$

Computation rules for the interval type:
$$\frac{\Gamma, x:\mathbb{I} \vdash C \; \mathrm{type} \quad \Gamma, a:\mathbb{2} \vdash c:C[j(a)/x] \quad \Gamma \vdash 0:\mathbb{2} \quad \Gamma \vdash 1:\mathbb{2} \quad \Gamma \vdash c_p:c[j(0)/x] =_C^p c[j(1)/x]}{\Gamma, a:\mathbb{2} \vdash \beta_\mathbb{I}^{j}:\mathrm{ind}_\mathbb{I}^{C}(c[j(a)/x], c_p)[j(a)/x] =_{C[j(a)/x]} c[j(a)/x]}$$

$$\frac{\Gamma, x:\mathbb{I} \vdash C \; \mathrm{type} \quad \Gamma, a:\mathbb{2} \vdash c:C[j(a)/x] \quad \Gamma \vdash 0:\mathbb{2} \quad \Gamma \vdash 1:\mathbb{2} \quad \Gamma \vdash c_p:c[j(0)/x] =_C^p c[j(1)/x]}{\Gamma, a:\mathbb{2}, \vdash \beta_\mathbb{I}^{p}:\mathrm{apd}_C^p(\mathrm{ind}_\mathbb{I}^{C}(c[j(a)/x], c_p)) =_{c[j(0)/x] =_C^p c[j(1)/x]} c_p}$$

Uniqueness rules for the interval type:

...

## Properties

* An interval type is provably [[contractible type|contractible]].  Conversely, any contractible type satisfies the rules of an interval type up to [[typal equality]].

* An interval type is a [[suspension type]] of the [[unit type]], and the suspension of an interval type is a 2-[[globe]] type.

* An interval type is a [[cone type]] of the unit type.

* An interval type is a [[cubical type]] $\Box^1$.

### Induction principle without heterogeneous identifications

There is a version of the induction principle which uses a type $C$ and a function $f:C \to \mathbb{I}$ instead of a type family $P(x)$ indexed by $x:\mathbb{I}$. It has the benefit of not requiring that one has first defined [[heterogeneous identification types]], whether as an [[inductive family]] of types or by using [[transport]].

The induction principle of the interval type says that given a type $C$ and a function $f:C \to \mathbb{I}$, as well as

* elements $c_0:C$ and $c_1:C$

* identifications $c_p:c_0 =_C c_1$, $q_0:f(c_0) =_\mathbb{I} 0$ and $q_1:f(c_q) =_\mathbb{I} 1$ such that $\mathrm{ap}_f(c_p)$, $q_0$, $q_1$, and $p$ form a square

$$
\begin{array}{c}
    & f(c_0) & \overset{\mathrm{ap}_{f}(c_p)}= & f(c_1) &  \\
    q_0 & \Vert &  & \Vert & q_1\\
    & 0 & \underset{p}= & 1 & \\
\end{array}
$$

* an identification saying that the square commutes

$$q_p:\mathrm{ap}_f(c_p) \bullet q_1 =_{f(c_0) =_\mathbb{I} f(c_1)} q_0 \bullet p$$

one can construct

* a function

$$g:\mathbb{I} \to C$$

* a homotopy witnessing that $g$ is a [[section]] of $f$:

$$\mathrm{sec}_g:\prod_{x:\mathbb{I}} f(g(x)) =_\mathbb{I} x$$

such that

$$g(0) \equiv c_0 \quad \mathrm{sec}_g(0) \equiv q_0 \quad g(1) \equiv c_1 \quad \mathrm{sec}_g(1) \equiv q_1 \quad \mathrm{ap}_{g}(p) \equiv c_p$$

$$\mathrm{ind}_{=}\left(\lambda x:\mathbb{I}.\mathrm{refl}_{f(g(x)) =_\mathbb{I} x}(\mathrm{sec}_g(x)), 0, 1, p\right) \equiv q_p$$

The last condition needs some explanation. Since $g$ is a section of $f$, the composite $f \circ g$ is [[generalized the|the]] [[identity function]] on the [[interval type]], up to [[identification]]. Now, given any identity function on the interval type $i:\mathbb{I} \to \mathbb{I}$ with homotopy

$$j:\prod_{x:\mathbb{I}} i(x) =_\mathbb{I} x$$

we have the following square for all $x:\mathbb{I}$, $y:\mathbb{I}$, and $q:x =_\mathbb{I} y$:

$$
\begin{array}{c}
    & i(x) & \overset{\mathrm{ap}_{i}(q)}= & i(y) &  \\
    j(x) & \Vert &  & \Vert & j(y)\\
    & x & \underset{q}= & y & \\
\end{array}
$$

This [[commutative square|square commutes]] via the [[J rule]]: it suffices to construct an element of

$$\mathrm{ap}_{i}(\mathrm{refl}_\mathbb{I}(x)) \bullet j(x) =_{i(x) =_\mathbb{I} x} j(x) \bullet \mathrm{refl}_\mathbb{I}(x)$$

But $\mathrm{ap}_{i}(\mathrm{refl}_\mathbb{I}(x)) \bullet j(x)$ reduces down to $j(x)$ via
$$\mathrm{ap}_{i}(\mathrm{refl}_\mathbb{I}(x)) \bullet j(x) \equiv \mathrm{refl}_\mathbb{I}(i(x)) \bullet j(x) \equiv j(x)$$
and similarly $j(x) \bullet \mathrm{refl}_\mathbb{I}(x)$ reduces down to $j(x)$, so just take reflexivity of $j(x)$.

So the naturality square is inductively defined by

$$\mathrm{ind}_{=}\left(\lambda x:\mathbb{I}.\mathrm{refl}_{i(x) =_\mathbb{I} x}(j(x)), x, y, q\right):\mathrm{ap}_{i}(q) \bullet j(y) =_{i(x) =_\mathbb{I} y} j(x) \bullet q$$

When $i \coloneqq f \circ g$, $j \coloneqq \mathrm{sec}_g$, $x \coloneqq 0$, $y \coloneqq 1$, and $q \coloneqq p$, this results in the identification

$$\mathrm{ind}_{=}\left(\lambda x:\mathbb{I}.\mathrm{refl}_{f(g(x)) =_\mathbb{I} x}(\mathrm{sec}_g(x)), 0, 1, p\right)$$

which is of the same type as $q_p$ due to the [[judgmental equalities]] in the other computation rules.

One gets back the usual induction principle of the interval type when $C \equiv \sum_{x:\mathbb{I}} P(x)$ and $f \equiv \pi_1$ the first projection function of the dependent sum type, and one gets back the recursion principle of the interval type when $C \equiv \mathbb{I} \times P$ and $f \equiv \pi_1$ the first projection function of the product type.

### Path types and identity types

In general, functions from $\mathbb{I}$ to a type $A$ can be thought of as the [[paths]] in $A$ in [[Martin-Löf type theory]], and the [[function type]] $\mathbb{I} \to A$ can be thought of as the **[[path types]]** of $A$, similar to how in [[topology]] paths in a (topological) space $A$ are (continuous) functions from the unit interval, and how in [[cubical type theory]] the [[cubical paths]] are a kind of function type out of the pre-defined interval pre-type.

The recursion principle of the interval type allows for paths to be defined from a given [[identification]], and [[function application to identifications]] allows for identifications to be defined from a given path:

\begin{theorem}
Every [[identification]] $q:a =_A b$ between two terms $a:A$ and $b:A$ of a type $A$ has an associated path $\mathrm{rec}_{\mathbb{I}}(a, b, p):\mathbb{I} \to A$, recursively defined by

* $\beta_\mathbb{I}^0(a, b, q):\mathrm{rec}_{\mathbb{I}}(a, b, q)(0) =_A a$
* $\beta_\mathbb{I}^1(a, b, q):\mathrm{rec}_{\mathbb{I}}(a, b, q)(1) =_A b$
* $\beta_\mathbb{I}^p(a, b, q):\mathrm{ap}_{\mathrm{rec}_{\mathbb{I}}(a, b, q)}(p) =_{f(0) =_A f(1)} \beta_\mathbb{I}^0(a, b, q) \bullet q \bullet \beta_\mathbb{I}^p(a, b, q)^{-1}$

where
$$\mathrm{ap}_{\mathrm{rec}_{\mathbb{I}}(a, b, q)}:(0 =_\mathbb{I} 1) \to (f(0) =_A f(1))$$
is the [[function application to identities]],
$$(-)\bullet(-):(a =_A b) \times (b =_A c) \to (a =_A c)$$
is concatenation of identities (i.e. [[transitivity]]), and
$$(-)^{-1}:(a =_A b) \to (b =_A a)$$
is the inverse of identities (i.e. [[symmetry]]).
\end{theorem}

\begin{theorem}
Given a path $q:\mathbb{I} \to A$ and terms $a:A$ and $b:A$ with identities $\delta_a:q(0) =_A a$ and $\delta_b:q(1) =_A b$, there is an identity

$$\delta_a^{-1} \bullet \mathrm{ap}_{q}(p) \bullet \delta_b:a =_{A} b$$
\end{theorem}

The path version of [[reflexivity]] of an element $x:A$ is represented by the [[constant function]] $\lambda i:\mathbb{I}.x:\mathbb{I} \to A$. By definition of [[function application to identifications]], one has

$$\mathrm{ap}_{\lambda i:\mathbb{I}.x}(i, j, q) \equiv \mathrm{refl}_A(x)$$

for all $i, j:\mathbb{I}$ and $q:i =_\mathbb{I} j$.

This allows us to posit versions of [[path induction]] using functions from the interval type, which states that:

\begin{theorem}
Given a type $A$, a type family $C(z)$ indexed by $z:\mathbb{I} \to A$, and a family of elements $t:\prod_{x:A} C(\lambda i:\mathbb{I}.x)$, one could construct a dependent function $f(t):\prod_{z:\mathbb{I} \to A} C(z)$ such that $f(t, \lambda i:\mathbb{I}.x) \equiv t:C(\lambda i:\mathbb{I}.x)$.

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, z:\mathbb{I} \to A \vdash C(z) \quad t:\prod_{x:A} C(\lambda i:\mathbb{I}.x)}{\Gamma \vdash \mathrm{ind}_{\mathbb{I} \to A}(t):\prod_{z:\mathbb{I} \to A} C(z)}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, z:\mathbb{I} \to A \vdash C(z) \quad t:\prod_{x:A} C(\lambda i:\mathbb{I}.x)}{\Gamma, x:A \vdash \mathrm{ind}_{\mathbb{I} \to A}(t, \lambda i:\mathbb{I}.x) \equiv t:C(\lambda i:\mathbb{I}.x)}$$
\end{theorem}

The alternate induction principle of the path type, which uses functions into the path type rather than families indexed by the path type, is given by:

\begin{theorem}
Given any type $C$ and function $f:C \to (\mathbb{I} \to A)$ into the path type in $A$, and given a function $c:A \to C$ and a homotopy
$$p:\prod_{x:A} f(c(x)) =_{\mathbb{I} \to A} \lambda i:\mathbb{I}.x$$
which states that the composite of $f$ and $c$ is the canonical function which takes elements of $A$ to constant paths into $A$, one can construct a function $g:\left(\mathbb{I} \to A\right) \to C$ and a homotopy witnessing that $g$ is a [[section]] of $f$:
$$\mathrm{sec}_g:\prod_{z:\mathbb{I} \to A} f(g(z)) =_{\mathbb{I} \to A} z$$
such that for all $x:A$, $g(\lambda i:\mathbb{I}.x) \equiv c(x)$ and $\mathrm{sec}_g(\lambda i:\mathbb{I}.x) \equiv p(x)$.

**elimination rules** for path induction:
$$\frac{
\begin{array}{c}
    \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash C \; \mathrm{type} \quad \Gamma \vdash f:C \to (\mathbb{I} \to A) \\
    \Gamma \vdash c:A \to C \quad \Gamma \vdash p:\prod_{x:A} f(c(x)) =_{\mathbb{I} \to A} \lambda i:\mathbb{I}.x \\
\end{array}
}{\Gamma, z:\mathbb{I} \to A \vdash \mathrm{ind}_{\mathbb{I} \to A}^{C}(f, c, p, z):C}$$

$$\frac{
\begin{array}{c}
    \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash C \; \mathrm{type} \quad \Gamma \vdash f:C \to (\mathbb{I} \to A) \\
    \Gamma \vdash c:A \to C \quad \Gamma \vdash p:\prod_{x:A} f(c(x)) =_{\mathbb{I} \to A} \lambda i:\mathbb{I}.x \\
\end{array}
}{\Gamma, z:\mathbb{I} \to A \vdash \mathrm{indsec}_\mathrm{Unit}^{C}(f, c, p, z):f(\mathrm{ind}_\mathrm{Unit}^{C}(f, c, p, z)) =_{\mathbb{I} \to A} z}$$

**computation rules** for path induction:
$$\frac{
\begin{array}{c}
    \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash C \; \mathrm{type} \quad \Gamma \vdash f:C \to (\mathbb{I} \to A) \\
    \Gamma \vdash c:A \to C \quad \Gamma \vdash p:\prod_{x:A} f(c(x)) =_{\mathbb{I} \to A} \lambda i:\mathbb{I}.x \\
\end{array}
}{\Gamma, x:A \vdash \mathrm{ind}_{\mathbb{I} \to A}^{C}(f, c, p, \lambda i:\mathbb{I}.x) \equiv c(x):C}$$

$$\frac{
\begin{array}{c}
    \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash C \; \mathrm{type} \quad \Gamma \vdash f:C \to (\mathbb{I} \to A) \\
    \Gamma \vdash c:A \to C \quad \Gamma \vdash p:\prod_{x:A} f(c(x)) =_{\mathbb{I} \to A} \lambda i:\mathbb{I}.x \\
\end{array}
}{\Gamma, x:A \vdash \mathrm{indsec}_{\mathbb{I} \to A}^{C}(f, c, p, \lambda i:\mathbb{I}.x) \equiv p(x):f(\mathrm{ind}_{\mathbb{I} \to A}^{C}(f, c, p, z)) =_{\mathbb{I} \to A} z}$$
\end{theorem}

\begin{theorem}
Suppose that path induction for function types out of the interval type is true.

Then the [[J-rule]] is true: given a type $A$ and given a type family $C(x, y, p)$ indexed by $x:A$, $y:A$, and $p:x =_A y$, and a dependent function $t:\prod_{x:A} C(x, x, \mathrm{refl}_A(x))$, one can construct a dependent function

$$\mathrm{ind}_{=, A}(t):\prod_{x:A} \prod_{y:A} \prod_{p:x =_A y} C(x, y, p)$$

such that for all $x:A$,

$$J(t, x, x, \mathrm{refl}_A(x)) \equiv t(x)$$
\end{theorem}

\begin{proof}
By path induction on the type family $C(f(0), f(1), \mathrm{toId}_A(f))$ indexed by $f:\mathbb{I} \to A$, we can construct a dependent function

$$\mathrm{ind}_{\mathbb{I} \to A}(t):\prod_{f:\mathbb{I} \to A} C(f(0), f(1), \mathrm{toId}_A(f))$$

such that for all $x:A$,

$$\mathrm{ind}_{\mathbb{I} \to A}(t, \lambda i:\mathbb{I}.x) \equiv t(x):C(\lambda i:\mathbb{I}.x)$$

since by definition of constant function and reflexivity, one has

$$(\lambda i:\mathbb{I}.x)(0) \equiv x \quad (\lambda i:\mathbb{I}.x)(1) \equiv x \quad \mathrm{ap}_{\lambda i:\mathbb{I}.x}(\mathcal{p}) \equiv \mathrm{refl}_A(x)$$

We define

$$J(t, x, y, p) \equiv \mathrm{ind}_{\mathbb{I} \to A}(t, \mathrm{rec}_\mathbb{I}^A(x, y, p))$$

since by interval recursion one has a path $\mathrm{rec}_\mathbb{I}^A(x, y, p):\mathbb{I} \to A$ such that

$$\mathrm{rec}_{\mathbb{I}}^{A}(x, y, p)(0) \equiv x \quad \mathrm{rec}_{\mathbb{I}}^{A}(x, y, p)(1) \equiv y \quad \mathrm{ap}_{\mathrm{rec}_\mathbb{I}^{A}(x, y, p)}(0, 1, \mathcal{p}) \equiv p$$
\end{proof}

### Relation to dependent identity types

Given a type $A$, a dependent type $x:A \vdash B(x)$, terms $a_0:A$ and $a_1:A$, identity $q:a_0 =_A a_1$, terms $b_0:B(a_0)$ and $b_1:B(a_1)$, and [[dependent identity]] $r:b_0 =_B^q b_1$, let us inductively define the family of elements $x:\mathbb{I} \vdash f(x):B(x)$ by

* $\beta_f^0:f(0) =_{B(a_0)} b_0$
* $\beta_f^1:f(1) =_{B(a_1)} b_1$
* $\beta_f^p:\mathrm{apd}_f(p) =_{f(0) =_B^q f(1)} \mathrm{concat}_{\mathrm{trans}_B^q(f(0)), b_1, f(1)}(\mathrm{concat}_{\mathrm{trans}_B^q(f(0)), \mathrm{trans}_B^q(b_0), b_1}(\mathrm{apd}_{\mathrm{trans}_B^q}(\beta_f^0), r), \mathrm{inv}_{f(1), b}(\beta_f^1))$

where $\mathrm{trans}_B^q:B(a_0) \to B(a_1)$ is [[transport]], $\mathrm{ap}_f:(0 =_\mathbb{I} 1) \to (f(0) =_A f(1))$ is the [[function application to identities]], $\mathrm{concat}_{a, b, c}:(a =_A b) \times (b =_A c) \to (a =_A c)$ is concatenation of identities (i.e. [[transitivity]]), and $\mathrm{inv}_{a, b}:(a =_A b) \to (b =_A a)$ is the inverse of identities (i.e. [[symmetry]]).

Let $A$ and $B$ be types, and let $e:A \simeq B$ be an equivalence between $A$ and $B$. Then there is a type family $x:\mathbb{I} \vdash C(x) \; \mathrm{type}$ defined by $C(0) \coloneqq A$, $C(1) \coloneqq B$, and $\mathrm{trans}_C^p \coloneqq e:A \simeq B$.

### Relation to function extensionality

Postulating an interval type with [[judgmental equality|judgmental]] [[computation rules]] for the point constructors of the interval type implies [[function extensionality]]. ([Shulman](#Shulman)).

The proof assumes a typal [[uniqueness rule]] for [[function types]]. First it constructs a function $k:A \to (\mathbb{I} \to B)$ from a dependent function $h:\prod_{x:A} f(x) =_B g(x)$, inductively defined by

* $\beta_{k(x)}^0:k(x)(0) =_B f(x)$
* $\beta_{k(x)}^1:k(x)(1) =_B g(x)$
* $\beta_{k(x)}^p:\mathrm{ap}_{k(x)}(p) =_{k(x)(0) =_B k(x)(1)} \beta_{k(x)}^0 \bullet h(x) \bullet (\beta_{k(x)}^1)^{-1}$

Then it uses the properties of function types, product types, currying, uncurrying, and the symmetry of products $A \times B \simeq B \times A$, to construct a function $k':\mathbb{I} \to (A \to B)$, inductively defined by

* $\beta_{k'}^0(x):k'(0)(x) =_B f(x)$
* $\beta_{k'}^1(x):k'(1)(x) =_B g(x)$
* $\beta_{k'}^p(x):\mathrm{ap}_{k'}(p)(x) =_{k'(0)(x) =_B k'(1)(x)} \beta_{k'}^0(x) \bullet h(x) \bullet (\beta_{k'}^1(x))^{-1})$

If the interval type has judgmental computation rules for the point constructors, then $k'(x)(0) \equiv f(x)$ and $k'(x)(1) \equiv g(x)$ for all $x:A$, which implies that $k'(0)(x) \equiv f(x)$ and $k'(1)(x) \equiv g(x)$ for all $x:A$, and subsequently that $k'(0) \equiv f$ and $k'(1) \equiv g$. This means that there are identities $\beta_{k'}^0:k'(0) =_{A \to B} f$ and $\beta_{k'}^1:k'(1) =_{A \to B} g$, and an identity

$$(\beta_{k'}^0)^{-1} \bullet \mathrm{ap}_{k'}(p) \bullet \beta_{k'}^1:f =_{A \to B} g$$

thus proving function extensionality.

An interval type with only typal computation rules for the point constructors does not imply function extensionality. This is because the proof with the judgmental computation rules uses the fact that $k'(0)(x) \equiv f(x)$ and $k'(1)(x) \equiv g(x)$ for all $x:A$ implies that $k'(0) \equiv f$ and $k'(1) \equiv g$. However, if the computation rules are typal, then the equivalent statement is that having identities $\beta_{k'}^0(x):k'(0)(x) =_B f(x)$ and $\beta_{k'}^1(x):k'(1)(x) =_B g(x)$ for all $x:A$ implies that there are identities $\beta_{k'}^0:k'(0) =_{A \to B} f$ and $\beta_{k'}^1:k'(1) =_{A \to B} g$, which is precisely [[function extensionality]], and so cannot be used to prove function extensionality.

### Relation to propositional truncations

An interval type is the [[propositional truncation]] of the [[boolean domain]] $\mathbb{2}$. We use the definition of an interval type using a function from $\mathbb{2}$. Since the interval type has identities

* $\mathrm{refl}_\mathbb{I}(j(0)):j(0) =_\mathbb{I} j(0)$,
* $p:j(0) =_\mathbb{I} j(1)$,
* $\mathrm{inv}_{j(0), j(1)}(p):j(1) =_\mathbb{I} j(0)$,
* $\mathrm{refl}_\mathbb{I}(j(1)):j(1) =_\mathbb{I} j(1)$,

there is a dependent function
$$f:\prod_{a:\mathbb{2}} \prod_{b:\mathbb{2}} j(a) =_\mathbb{I} j(b)$$
inductively defined by the identities
$$\beta_{f}(0, 0):f(0)(0) =_{j(0) =_\mathbb{I} j(0)} \mathrm{refl}_\mathbb{I}(j(0))$$
$$\beta_{f}(0, 1):f(0)(1) =_{j(0) =_\mathbb{I} j(1)} p$$
$$\beta_{f}(1, 0):f(1)(0) =_{j(1) =_\mathbb{I} j(0)} \mathrm{inv}_{j(0), j(1)}(p)$$
$$\beta_{f}(1, 1):f(1)(1) =_{j(1) =_\mathbb{I} j(1)} \mathrm{refl}_\mathbb{I}(j(1))$$

If [[dependent product types]] have [[judgmental equality|judgmental]] [[computation rules]], then the above becomes

$$f(0)(0) \equiv \mathrm{refl}_\mathbb{I}(j(0)):j(0) =_\mathbb{I} j(0)$$
$$f(0)(1) \equiv p:j(0) =_\mathbb{I} j(1)$$
$$f(1)(0) \equiv \mathrm{inv}_{j(0), j(1)}(p):j(1) =_\mathbb{I} j(0)$$
$$f(1)(1) \equiv \mathrm{refl}_\mathbb{I}(j(1)):j(1) =_\mathbb{I} j(1)$$

Both show that the interval type is the propositional truncation of the boolean domain.

The converse is true as well: the propositional truncation of the boolean domain is the interval type. Recall that $\left[\mathbb{2}\right]$ is inductively generated by a function $j:\mathbb{2} \to \left[\mathbb{2}\right]$ and a dependent function

$$f:\prod_{a:\mathbb{2}} \prod_{b:\mathbb{2}} j(a) =_{\left[\mathbb{2}\right]} j(b)$$

which makes $\left[\mathbb{2}\right]$ into an [[h-proposition]]. By definition of an h-proposition, for each element $a:\mathbb{2}$ and $b:\mathbb{2}$, the identity type $j(a) =_{\left[\mathbb{2}\right]} j(b)$ is a [[contractible type]]. In particular, by induction on $\mathbb{2}$, this means that there are identities
$$\beta_{f}(0, 0):f(0)(0) =_{j(0) =_{\left[\mathbb{2}\right]} j(0)} \mathrm{refl}_{\left[\mathbb{2}\right]}(j(0))$$
$$\beta_{f}(1, 1):f(1)(1) =_{j(1) =_{\left[\mathbb{2}\right]} j(1)} \mathrm{refl}_{\left[\mathbb{2}\right]}(j(1))$$
and for every identity $p:0 =_{\left[\mathbb{2}\right]} 1$, there are identities
$$\beta_{f}(0, 1):f(0)(1) =_{j(0) =_{\left[\mathbb{2}\right]} j(1)} p$$
$$\beta_{f}(1, 0):f(1)(0) =_{j(1) =_{\left[\mathbb{2}\right]} j(0)} \mathrm{inv}_{j(0), j(1)}(p)$$

Thus, one could simply take $j(0)$ and $j(1)$ as the term constructors and $f(0)(1)$ as the identity constructor of the interval type.

If both propositional truncations and the boolean domain have [[judgmental equality|judgmental]] [[computation rules]], the the interval type also has judgmental computation rules. See ([this file](https://www.cs.bham.ac.uk/~mhe/truncation-and-extensionality/hsetfunext.html))

## Related concepts

* [[interval]], [[interval object]]

* [[booleans type]]

* [[suspension type]]

* [[circle type]]

* [[cone type]]

* [[square type]]

* [[line type]]

* [[cubical type theory]]

## References

Proofs of [[function extensionality]] using an interval type with [[judgmental equality|judgmental]] [[computation rules]] for point constructors could be found here

* [[Mike Shulman]], _An interval type implies functional extensionality_ ([blog post](http://homotopytypetheory.org/2011/04/04/an-interval-type-implies-function-extensionality/))
 {#Shulman11}

* Carlo Angiuli, _Univalence implies function extensionality_ ([blog](http://homotopytypetheory.org/2011/12/05/hott-in-prose/), [pdf](http://hottheory.files.wordpress.com/2011/12/hott2.pdf))

[[!redirects interval types]]


interval type localization

\tableofcontents

## Idea

The **principle of [[interval type]] localization** states that for all types $A$, $A$ is $\mathbb{I}$-[[localization of a type|local]], or equivalently that the function
$$\mathrm{const}_{A, \mathbb{I}} \equiv \lambda x:A.\lambda i:mathbb{I}.x:A \to (\mathbb{I} \to A)$$
is an [[equivalence of types]].

There is also a **definitional interval type localization** which says that the function
$$\mathrm{const}_{A, \mathbb{I}} \equiv \lambda x:A.\lambda i:mathbb{I}.x:A \to (\mathbb{I} \to A)$$
is a definitional or [[strict equivalence of types]]. The usual notion of interval type localization can be called **propositional interval type localization**.

One has the following analogies between localization at a specific type and the type theoretic letter rule that it proves:

| localization rule | type theoretic letter rule |
|-------------------|----------------------------|
| [[I-localization|$\mathbb{I}$-localization]] | [[J-rule]] |
| [[S1-localization|$S^1$-localization]] | [[K-rule]] |

## Axiom of interval type localization

In [[Martin-Löf type theory]], interval type localization is a provable statement from the [[J-rule]] and the [[recursion principle]] of the [[interval type]]. However, in other dependent type theories where [[identity types]] are defined in terms of the interval type, **interval type localization** can be added as a separate axiom to the type theory as an alternative to the [[J-rule]], because it implies the [[J-rule]].

Suppose that one has an [[interval type]] $\mathbb{I}$, with elements $0:\mathbb{I}$ and $1:\mathbb{I}$.

$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathbb{I} \; \mathrm{type}}$$

$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash 0:\mathbb{I}} \quad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash 1:\mathbb{I}}$$

Usually, the [[recursion principle]] of the [[interval type]] is interpreted as a way to construct, from elements $x:A$ and $y:A$ and identification $p:x =_A y$, paths $p:\mathbb{I} \to A$, aka functions from the interval type to $A$. Interpreted another way, the recursion principle of the interval type are the negative elimination and computation rules for [[identity types]], allowing one to define identity types as [[negative types]].

* The formation rule of identity types state that given a type $A$ and elements $x:A$ and $y:A$, one can form the identity type $x =_A y$. Syntactically, this is given by the following [[inference rules]]:

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, x:A, y:A \vdash x =_A y \; \mathrm{type}}$$

* The introduction rule of identity types state that given a type $A$ and a path $p:\mathbb{I} \to A$, one can construct an [[identification]] $\mathrm{toId}_A(f):f(0) =_A f(1)$. Syntactically, this is given by the following [[inference rules]]:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash f:\mathbb{I} \to A}{\Gamma \vdash \mathrm{toId}_A(f):f(0) =_A f(1)}$$

Normally, this would be [[function application to identifications|function application]] to the canonical identification $\mathcal{p}:0 =_\mathbb{I} 1$, but here we haven't defined $\mathcal{p}$ yet since we haven't defined the identity type yet, and with this rule one can define said identification to be the identification of the identity function on the interval type
$$\mathcal{p} \equiv \mathrm{toId}_\mathbb{I}(\mathrm{id}_\mathbb{I}):0 =_\mathbb{I} 1$$
In addition, reflexivity of an element $x:A$ is given by sending the constant path of $x:A$ to its equality

$$\mathrm{refl}_A(x) \equiv \mathrm{toId}_{A}(\lambda i:\mathbb{I}.x):x =_A x$$

* The elimination rule of identity types state that given a type $A$, elements $x:A$ and $y:A$, and identification $p:x =_A y$, one can construct a path $\mathrm{topath}_\mathbb{I}^A(x, y, p):\mathbb{I} \to A$. Syntactically, this is given by the following [[inference rules]]:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash x:A \quad \Gamma \vdash y:A \quad \Gamma \vdash p:x =_A y}{\Gamma \vdash \mathrm{topath}_\mathbb{I}^A(x, y, p):\mathbb{I} \to A}$$

This is just another name for the recursor of the interval type $\mathrm{rec}_\mathbb{I}^A(x, y, p) \equiv \mathrm{topath}_\mathbb{I}^A(x, y, p):\mathbb{I} \to A$.

* The three computation rules of identity types state that given a type $A$, elements $x:A$ and $y:A$, and identification $p:x =_A y$,
$$\mathrm{topath}_\mathbb{I}^A(x, y, p)(0) \equiv x \quad \mathrm{topath}_\mathbb{I}^A(x, y, p)(1) \equiv y \quad \mathrm{toId}_{A}(\mathrm{topath}_\mathbb{I}^A(x, y, p)) \equiv p$$
Syntactically, this is given by the following [[inference rules]]:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash x:A \quad \Gamma \vdash y:A \quad \Gamma \vdash p:x =_A y}{\Gamma \vdash \mathrm{topath}_\mathbb{I}^A(x, y, p)(0) \equiv x:A}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash x:A \quad \Gamma \vdash y:A \quad \Gamma \vdash p:x =_A y}{\Gamma \vdash \mathrm{topath}_\mathbb{I}^A(x, y, p)(1) \equiv y:A}$$

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash x:A \quad \Gamma \vdash y:A \quad \Gamma \vdash p:x =_A y}{\Gamma \vdash \mathrm{toId}_{A}(\mathrm{topath}_\mathbb{I}^A(x, y, p)) \equiv p:x =_A y}$$

* The uniqueness rule of identity types state that given a type $A$ and a path $p:\mathbb{I} \to A$,
$$\mathrm{topath}_\mathbb{I}^A(p(0), p(1), \mathrm{toId}_A(p)) \equiv p$$

Syntactically, this is given by the following [[inference rules]]:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash f:\mathbb{I} \to A}{\Gamma \vdash \mathrm{topath}_\mathbb{I}^A(f(0), f(1), \mathrm{toId}_A(f)) \equiv f:\mathbb{I} \to A}$$

Then **$\mathrm{I}$-localization** is given by the following axiom:

$$\prod_{A:\mathrm{type}} \sum_{g:(\mathbb{I} \to A) \to A} \left(\prod_{x:A} g(\lambda i:\mathbb{I}.x) =_A x\right) \times \left(\prod_{p:\mathbb{I} \to A} \lambda i:\mathbb{I}.g(p) =_{\mathbb{I} \to A} p\right)$$

While this states that $\mathrm{const}_{A, \mathbb{I}}$ is only a [[quasi-invertible function]], it is well known that every quasi-invertible function can be made into a [[coherently invertible function]] by constructing a new [[section]] or [[retraction]] which satisfies a suitable family of [[naturality squares]].

If the dependent type theory does not have [[type universes]], then the axiom of $\mathrm{I}$-localization needs to be expressed as an inference rule:

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \sum_{g:(\mathbb{I} \to A) \to A} \left(\prod_{x:A} g(\lambda i:\mathbb{I}.x) =_A x\right) \times \left(\prod_{p:\mathbb{I} \to A} \lambda i:\mathbb{I}.g(p) =_{\mathbb{I} \to A} p\right)}$$

and if the dependent type theory does not have [[dependent sum types]], then this would have to be expressed as three separate rules:

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, p:\mathbb{I} \to A \vdash \mathrm{const}_{A, \mathrm{I}}^{-1}(p):A}$$

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, x:A \vdash \beta_{\mathbb{I} \to A}(x):\mathrm{const}_{A, \mathrm{I}}^{-1}(\lambda i:\mathbb{I}.x) =_{A} x}$$

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, p:\mathbb{I} \to A \vdash \eta_{\mathbb{I} \to A}(p):\lambda i:\mathbb{I}.\mathrm{const}_{A, \mathrm{I}}^{-1}(p) =_{\mathbb{I} \to A} p}$$

**Definitional $\mathrm{I}$-localization** is given by the following rules:

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, p:\mathbb{I} \to A \vdash \mathrm{const}_{A, \mathrm{I}}^{-1}(p):A}$$

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, x:A \vdash \mathrm{const}_{A, \mathrm{I}}^{-1}(\lambda i:\mathbb{I}.x) \equiv x:A}$$

$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma, p:\mathbb{I} \to A \vdash \lambda i:\mathbb{I}.\mathrm{const}_{A, \mathrm{I}}^{-1}(p) \equiv p:\mathbb{I} \to A}$$

This makes $\mathrm{const}_{A, \mathbb{I}}$ into a strict equivalence of types, which is always a coherently invertible function.

### Interval type localization implies the J-rule

The [[function application to identifications]] can be defined without the use of path induction:

\begin{theorem}
Given types $A$ and $B$, a a function $f:A \to B$, elements $x:A$ and $y:A$ and an identification $p:x =_A y$, one can construct the identification $\mathrm{ap}_f(x, y, p):f(x) =_B f(y)$.
\end{theorem}

This is defined through the inference rules for identity types and function composition:

$$\mathrm{ap}_f(x, y, p) \equiv \mathrm{toId}_B(f \circ \mathrm{rec}_\mathbb{I}^A(x, y, p)):f(x) =_B f(y)$$

\begin{theorem}
Suppose that every type $A$ is definitionally $\mathbb{I}$-local.

Then path induction for function types out of the interval type holds: given any type $A$, and any type family $C(p)$ indexed by paths $p:\mathbb{I} \to A$ in $A$, and given any dependent function $t:\prod_{x:A} C(\lambda i:\mathbb{I}.x)$ which says that for all elements $x:A$,  there is an element of the type defined by substituting the constant path of $x:A$ into $C$, $C(\lambda i:\mathbb{I}.x)$, one can construct a dependent function $\mathrm{ind}_{\mathbb{I} \to A}(t):\prod_{z:\mathbb{I} \to A} C(z)$ such that for all $x:A$, $\mathrm{ind}_{\mathbb{I} \to A}(t, \lambda i:\mathbb{I}.x) \equiv t(x):C(\lambda i:\mathbb{I}.x)$.
\end{theorem}

\begin{proof}
$\mathrm{ind}_{\mathbb{I} \to A}(t)$ is defined to be

$$\mathrm{ind}_{\mathbb{I} \to A}(t) \equiv \lambda p:\mathbb{I} \to A.t(\mathrm{const}_{A, \mathrm{I}}^{-1}(p))$$

and by the computation rules of path types as negative copies, one has that for all $x:A$,

$$\mathrm{const}_{A, \mathrm{I}}^{-1}(\lambda i:\mathbb{I}.x) \equiv x$$

and so by definition of $\mathrm{ind}_{\mathbb{I} \to A}(t)$ and the judgmental congruence rules for substitution, one has

$$\mathrm{ind}_{\mathbb{I} \to A}(t, \lambda i:\mathbb{I}.x) \equiv t(\mathrm{const}_{A, \mathrm{I}}^{-1}(\lambda i:\mathbb{I}.x)) \equiv t(x)$$
\end{proof}

\begin{theorem}
Suppose that path induction for function types out of the interval type is true.

Then the J-rule is true: given a type $A$ and given a type family $C(x, y, p)$ indexed by $x:A$, $y:A$, and $p:x =_A y$, and a dependent function $t:\prod_{x:A} C(x, x, \mathrm{refl}_A(x))$, one can construct a dependent function

$$\mathrm{ind}_{=, A}(t):\prod_{x:A} \prod_{y:A} \prod_{p:x =_A y} C(x, y, p)$$

such that for all $x:A$,

$$J(t, x, x, \mathrm{refl}_A(x)) \equiv t(x)$$
\end{theorem}

\begin{proof}
By path induction on the type family $C(f(0), f(1), \mathrm{toId}_A(f))$ indexed by $f:\mathbb{I} \to A$, we can construct a dependent function

$$\mathrm{ind}_{\mathbb{I} \to A}(t):\prod_{f:\mathbb{I} \to A} C(f(0), f(1), \mathrm{toId}_A(f))$$

such that for all $x:A$,

$$\mathrm{ind}_{\mathbb{I} \to A}(t, \lambda i:\mathbb{I}.x) \equiv t(x):C(\lambda i:\mathbb{I}.x)$$

since by definition of constant function and reflexivity, one has

$$(\lambda i:\mathbb{I}.x)(0) \equiv x \quad (\lambda i:\mathbb{I}.x)(1) \equiv x \quad \mathrm{ap}_{\lambda i:\mathbb{I}.x}(\mathcal{p}) \equiv \mathrm{refl}_A(x)$$

We define

$$J(t, x, y, p) \equiv \mathrm{ind}_{\mathbb{I} \to A}(t, \mathrm{rec}_\mathbb{I}^A(x, y, p))$$

since by interval recursion one has a path $\mathrm{rec}_\mathbb{I}^A(x, y, p):\mathbb{I} \to A$ such that

$$\mathrm{rec}_{\mathbb{I}}^{A}(x, y, p)(0) \equiv x \quad \mathrm{rec}_{\mathbb{I}}^{A}(x, y, p)(1) \equiv y \quad \mathrm{ap}_{\mathrm{rec}_\mathbb{I}^{A}(x, y, p)}(0, 1, \mathcal{p}) \equiv p$$
\end{proof}

## Related concepts

* [[identity type]], [[J-rule]]

* [[loop space type]], [[K-rule]], [[circle type localization]]

[[!redirects interval type localization]]
[[!redirects I localization]]
[[!redirects I-localization]]

[[!redirects axiom of interval type localization]]
[[!redirects axiom of I localization]]
[[!redirects axiom of I-localization]]


intrinsic and extrinsic views of typing

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Deduction and Induction
+-- {: .hide}
[[!include deduction and induction - contents]]
=--
#### Constructivism, Realizability, Computability
+-- {: .hide}
[[!include constructivism - contents]]
=--
#### Foundations
+-- {: .hide}
[[!include foundations - contents]]
=--
=--
=--

# Contents
* table of contents
{: toc}

##Idea

The intrinsic and extrinsic views of [[type theory|typing]] correspond to different interpretations of types, also known as the contrast between "types à la Church" and "types à la Curry".

Reynolds claims ([Rey00](#Rey00)),

>There are two very different ways of giving denotational semantics to a programming language (or other formal language) with a nontrivial type system. In an intrinsic semantics, only phrases that satisfy typing judgements have meanings. Indeed, meanings are assigned to the typing judgements, rather than to the phrases themselves, so that a phrase that satisfies several judgements will have several meanings.

>In contrast, in an extrinsic semantics, the meaning of each phrase is the same as it would be in a untyped language, regardless of its typing properties. In this view, a typing judgement is an assertion that the meaning of a phrase possesses some property.

>The terms "intrinsic" and "extrinsic" are recent coinages by the author ([Rey98, Chapter 15](#Rey98)), but the concepts are much older. The intrinsic view is associated with Alonzo Church, and has been called "ontological" by Leivant ([Lev86](#Lev86)). The extrinsic view is associated with Haskell Curry, and has been called "semantical" by Leivant.

According to Melliès and Zeilberger ([MZ13](#MZ13)),

>One of the difficulties in giving a clear mathematical definition of the "topic" of type theory is that the word "type" is actually used with two very different intuitive meanings and technical purposes in mind:

> (1). Like the syntactician's parts of speech, as a way of defining the grammar of well-formed expressions.
> (2). Like the semanticist's predicates, as a way of identifying subsets of expressions with certain desirable properties.

>These two different views of types are often associated respectively with Alonzo Church and Haskell Curry (hence "types à la Church" and "types à la Curry"), while the late John Reynolds referred to these as the intrinsic and the extrinsic interpretations of types ([Rey00](#Rey00)). In the intrinsic view, all expressions carry a type, and there is no need (or even sense) to consider the meaning of "untyped" expressions; while in the extrinsic view, every expression carries an independent meaning, and typing judgments serve to assert some property
of that meaning.

###Related concepts

* [[coercion]]
* [[type refinement]]

###References

* {#Rey98} [[John Reynolds]], _Theories of Programming Languages_. Cambridge University Press, Cambridge, England, 1998.
* {#Lev86} [[Daniel Leivant]], _Typing and computational properties of lambda expressions_, Theoretical Computer Science, 44(1):51–68, 1986.
* {#Rey00} [[John Reynolds]], _The Meaning of Types: from Intrinsic to Extrinsic Semantics_, BRICS Report RS-00-32, Aarhus University, December 2000. [pdf](http://www.cs.cmu.edu/afs/cs/user/jcr/ftp/typemeaning.pdf)
* {#MZ13} [[Paul-André Melliès]], [[Noam Zeilberger]], _Type refinement and monoidal closed bifibrations_, [ arXiv:1310.0263](http://arxiv.org/abs/1310.0263)

Attempts to bring both views together in a theory of [[type refinement]]:

* [[Frank Pfenning]], _Church and Curry: Combining Intrinsic and Extrinsic Typing_, ([pdf](https://www.cs.cmu.edu/~fp/papers/andrews08.pdf))
* [[Paul-André Melliès]], [[Noam Zeilberger]], _Functors are Type Refinement Systems_, ([pdf](http://noamz.org/papers/funts.pdf))

[[!redirects intrinsic type]]
[[!redirects extrinsic type]]
[[!redirects intrinsic types]]
[[!redirects extrinsic types]]