Lectures onType Theory
Chapter 217
Chapter 217Core route

Cubical Type Theory I: De Morgan Cubes

In axiomatic HoTT, transport along ua(e) has no head rule. Cubical type theory represents a path a=b by a term p(i) with p(0)a and p(1)b; transport then computes by the Kan operations of the family p(i). We use De Morgan cubes, and the Glue former turns equivalences into computational paths in the universe.

The interval

The interval enters the syntax not as a type but as a new sort of context entry; its elements form an algebra of formal points of [0,1].

Definition 80.1 — The interval

Fix a countably infinite set of names (dimension variables) i,j,k,, disjoint from the term variables of definition 26.1. The interval I is the free De Morgan algebra on the names: the set of expressions r,s::=01i1rrsrs taken modulo the laws of a bounded distributive lattice with bottom 0, top 1, meet , join , together with the laws making 1() a De Morgan involution: 10=1,11=0,1(1r)=r, 1(rs)=(1r)(1s),1(rs)=(1r)(1s). The intended reading is rs=min(r,s), rs=max(r,s), 1r the reversal of the unit interval.

Proposition 80.2 — Normal form; decidability

As a bounded distributive lattice, I is free on the set of literals {i, 1ii a name}, with no relations between i and 1i. Consequently every rI equals a finite join of finite meets of literals, and equality in I is decidable.

Proof of Proposition 80.2 — Normal form; decidability

Proof. The De Morgan laws push every occurrence of 1() down to the generators, so each element is a lattice polynomial in literals; distributivity yields the disjunctive normal form. For decidability it suffices to decide rs on normal forms: in a free distributive lattice a meet m of generators satisfies mlml if and only if mml for some l, i.e. ml uses only literals of m for some l. For the nontrivial direction, if no ml is contained in m, assign every literal of m the value 1 and, for each ml, choose one additional literal and assign it 0; freeness extends this to a lattice valuation separating the two sides. Sorting each meet, deleting absorbed meets, and sorting the resulting antichain therefore produces a canonical finite normal form, whose syntactic comparison decides equality. ◻

Remark 80.3 — is not Boolean

In I neither r(1r)=0 nor r(1r)=1 holds in general. By freeness, any valuation of names in the De Morgan algebra [0,1] extends to a homomorphism I[0,1]; the valuation i12 sends i(1i) to 120 (exercise 80.2). Geometrically: a point of the square need not lie on its boundary.

Definition 80.4 — Dimension contexts

A dimension context is a context that may also declare interval names. As always, the notation Γ,i:I carries the freshness condition idom(Γ), cf. definition 26.22):

Γ ctx
Γ,i:I ctx
Ctx-Dim

The judgment Γr:I holds when Γ ctx and every name occurring in r is declared in Γ; the judgment Γrs:I holds when in addition r=s in the algebra I. Both are defined judgments of the metatheory, not inductively generated by new rules.

Convention 80.5 — Dimension substitution

The dimension substitution e[r/i] substitutes the interval expression r for the dimension name i; e[0/i] and e[1/i] are its two faces. By contrast, A[φu] is the type A with the boundary equation a=u imposed under the face formula φ.

Remark 80.6 — Geometric reading

A judgment in a context declaring n names is an n-cube: a type Γ,i:IA type is a line of types, a term Γ,i:I,j:It:A a square of elements, and so on. The interval operations act by substitution:

substitution geometric operation
[0/i], [1/i] faces in direction i
weakening by i:I degeneracy (constant line)
[j/i] renaming a direction
[1i/i] reversal
[ij/i], [ij/i] connections (degenerate squares)

Faces commute: e[0/i][1/j]=e[1/j][0/i] for ij.

Remark 80.7 — The interval is not a type

No rule makes I a type: it has no code in U, cannot be quantified over by Π or Σ, and has no eliminator — one cannot branch on whether r=0 or r=1, and remark 80.3 shows these cases are not exhaustive. Names are bound only by the dedicated binders i() (§ 80.2) and compi (§ 80.4). Because dimensions are substituted only by homomorphisms II, interval and face equations remain valid after [r/i]; in particular the endpoint equations of a path remain true.

Variants of the algebra. This chapter uses the free De Morgan algebra, whose finite-name fragments are finite and decidable. The Cartesian calculus drops reversal and connections and postulates different Kan operations [ABC^+21]. The intermediate Kleene variant is compared in [CCHM18].

Exercise 80.1

★☆☆ Show from definition 80.1 that 1():II is an isomorphism onto the order-dual of I (it exchanges with and 0 with 1), and that it is determined uniquely by its action on names.

Exercise 80.2

★★★ Verify that [0,1] with min, max, x1x is a De Morgan algebra, and that every function from names to [0,1] extends uniquely to a homomorphism I[0,1]. Conclude the claims of remark 80.3, and exhibit rs in I whose [0,1]-interpretations agree (so the extension of proposition 80.2 to Kleene algebras is a genuine quotient).

Exercise 80.3

★★★ Complete the proof of proposition 80.2: prove the primality of meets of generators in a free bounded distributive lattice, and describe the resulting decision procedure for r=s in I.

Path types

A path in A is a term depending on one fresh name; the path type internalizes this judgmental situation, in the fourfold rhythm of convention 27.1.

Definition 80.8 — Path types

Cubical type theory has the type formers PathA(a,b) and, for a line of types i.A (the name i bound in A), the dependent path type PathPi.A(a0,a1). Path abstraction it binds i in t; path application tr applies t to rI. The rules (premises compressed per convention 26.14; the congruence and substitution rules of definition 26.22 extend to the new formers):

ΓA typeΓa:AΓb:A
ΓPathA(a,b) type
Path-form
Γ,i:It:A
Γit:PathA(t[0/i],t[1/i])
Path-intro
Γt:PathA(u0,u1)Γr:I
Γtr:A
Path-elim
Γ,i:It:AΓr:I
Γ(it)rt[r/i]:A
Path-β
Γt:PathA(u0,u1)
Γt0u0:A
Path-_0
Γt:PathA(u0,u1)
Γt1u1:A
Path-_1
Γ,i:Itiui:A
Γtu:PathA(u0,u1)
Path-η

For the dependent version, with Γ,i:IA type:

Γ,i:IA typeΓa0:A[0/i]Γa1:A[1/i]
ΓPathPi.A(a0,a1) type
PathP-form
Γ,i:It:A
Γit:PathPi.A(t[0/i],t[1/i])
PathP-intro
Γp:PathPi.A(a0,a1)Γr:I
Γpr:A[r/i]
PathP-elim

with β, and η rules exactly as for Path (endpoints at the types A[0/i], A[1/i]). When i is not free in A, we identify PathA(a,b)PathPi.A(a,b); only the dependent former is primitive.

Lemma 80.9 — Judgmental equality yields paths

Define refla:=ia. If Γa:A then Γrefla:PathA(a,a); if moreover Γab:A then Γrefla:PathA(a,b).

Proof of Lemma 80.9 — Judgmental equality yields paths

Proof. By Path-intro, since a[0/i]aa[1/i] (i fresh); the second claim by the congruence rule for Path-form and conversion. ◻

Construction 80.10 — Inversion and action of functions

Let Γp:PathA(a,b).

  1. p1:=ip(1i) inhabits PathA(b,a): by Path-elim, Γ,i:Ip(1i):A, and the faces are p(10)p1b and p(11)p0a by Path-β and Path-.

  2. For Γf:AB:  apf(p):=if(pi) inhabits PathB(fa,fb).

  3. For dependent Γf:x:AB: the same term apdf(p):=if(pi) inhabits PathPi.B[pi/x](fa,fb).

Example 80.11 — Connection squares

In context Γ,i:I,j:I the terms p(ij) and p(ij) are squares: Mathematical diagramDiagramMathematical diagramDiagram (horizontal direction i, vertical j; unlabeled equalities are constant paths). For instance the four faces of p(ij) are p(i0)p0a (bottom), pi (top), a (left), pj (right). Connections manufacture squares whose boundary mixes p with constant paths — the key device below.

Construction 80.12 — Contractibility of singletons

Let Γp:PathA(a,b). Then θp:=i(pi,jp(ij))inhabitsPathx:APathA(a,x)((a,refla),(b,p)). Indeed at i=0 the value is (p0,jp0)(a,refla), and at i=1 it is (p1,jpj)(b,p), the last step by Path-η. (Compare the corresponding construction for Id in chapter 30, which needs J; here two connections suffice.)

Remark 80.13 — What is still missing

The rules of definition 80.8 give maps into path types and evaluation at points of I, but no transport: nothing yet carries an element of B[a/x] to B[b/x] along p:PathA(a,b), and the eliminator J of definition 30.1 is not derivable. In the fourfold order of convention 27.1 the elimination form present (Path-elim) is that of a function type on I, not that of an identity type. The missing structure is supplied uniformly for every type by Kan composition (§ 80.4).

Exercise 80.4

★★☆ Write out the equality derivations showing Γapf(p):PathB(fa,fb) in construction 80.10, naming each rule. Then show that ap is judgmentally functorial: apg(apf(p))apgf(p) and apλx.x(p)p. Contrast with the merely propositional functoriality available for Id in chapter 30.

Exercise 80.5

★★☆ Compute the four faces of p(ij) in example 80.11. Then show ip(i(1i)) inhabits PathA(b,b), and explain why it is not judgmentally equal to reflb (use proposition 80.2).

Exercise 80.6

★★☆ Verify the typing of apd in construction 80.10(3): exhibit the line of types over which it is a dependent path, and check both endpoint equalities. Show also that over a constant line, PathP-* specializes rule-by-rule to Path-*.

The face lattice, restrictions, and systems

To state the composition operation we must speak of partial types and elements — data given only on a union of faces of a cube. The shapes of partiality are recorded by a lattice of formulas.

Definition 80.14 — The face lattice

The face lattice F is the distributive lattice generated by the symbols (i=0) and (i=1), for i a name, subject to (i=0)(i=1)=0F. Its elements, the face formulas, are generated by φ,ψ::=0F1F(i=0)(i=1)φψφψ. There is a lattice map IF, written r(r=1), sending i(i=1) and 1i(i=0); we set (r=0):=(1r=1). Every φ is the join of the irreducible elements below it, an irreducible element being a conjunction of atoms in distinct names; equality in F is decidable by distributing to DNF, deleting monomials containing both (i=0) and (i=1), and comparing the remaining finite antichains. Substitution φ[r/i] acts by (i=1)(r=1), (i=0)(r=0). The judgment Γφ:F holds when Γ ctx and all names of φ are declared in Γ.

Definition 80.15 — Restricted contexts

Contexts may be restricted by a face formula:

Γφ:F
Γ,φ ctx
Ctx-Restr

In Γ,φ add the equation φ=1F. Thus Γ,(i=0)rs:I holds exactly when Γr[0/i]s[0/i]:I does. A join of faces imposes the intersection of their congruences, and Γ,0F validates every equality. A substitution σ:Δ(Γ,φ) consists of σ:ΔΓ together with Δφ[σ]1F:F.

Lemma 80.16 — Restriction calculus

The following are admissible. Restriction by 1F changes nothing (Γ,1FJ iff ΓJ); if φψ in F and Γ,ψJ then Γ,φJ; iterated restriction is conjunction (Γ,φ,ψJ iff Γ,φψJ); and if φ does not mention i then Γ,i:I,φJ iff Γ,φ,i:IJ.

Proof of Lemma 80.16 — Restriction calculus

Proof. Each clause is induced by a substitution of restricted contexts. For 1F the identity substitution works in both directions. If φψ, the inclusion Γ,φΓ,ψ is well formed because ψ=1F follows from φ=1F; substitution of the given derivation along it gives the second clause. The contexts Γ,φ,ψ and Γ,φψ impose the same congruence, so their identity lists define inverse substitutions. Finally, when i does not occur in φ, the identity assignments define substitutions (Γ,i:I,φ)(Γ,φ,i:I) and back; both satisfy the face premise because φ does not contain i. Substituting along these two maps proves the exchange equivalence. ◻

Lemma 80.17 — Quantifier elimination

For each name i let i:FF be the lattice map sending (i=0) and (i=1) to 0F and fixing the other generators. Then for ψ not mentioning i:  ψφ iff ψi.φ. Moreover φ=(i.φ)(φ(i=0))=(φ(i=1)),φ(i=0)φ[0/i],φ(i=1)φ[1/i].

Proof of Lemma 80.17 — Quantifier elimination

Proof. Write φ as a join of irreducibles (definition 80.14). An irreducible c either does not mention i — then i.c=c — or contains exactly one atom in i, say (i=0); then i.c=0F and c=c(i=0)φ(i=0). This proves the decomposition, each disjunct being φ because i.φφ on irreducibles. For the adjunction, if ψ is independent of i, every irreducible summand of ψ is also independent of i; hence ψφ holds exactly when those summands occur among the i-free summands retained by i.φ. The two face inequalities follow by substituting 0 and 1 into the summands that contain the corresponding atom. ◻

Definition 80.18 — Systems

A two-face system [φ0t0,φ1t1] is defined when t0=t1 on φ0φ1; it is total when φ0φ1=1F. A system is a formal amalgam [φ1t1,,φntn] of terms (or types) given on faces; n=0 is allowed, giving the empty system []. The rules below carry the common side condition Γφ1φn1F:F (for n=0: Γ0F1F:F, so the empty system lives only in inconsistently restricted contexts):

Γ,φ1A1 typeΓ,φnAn typeΓ,φkφlAkAl type (1k,ln)
Γ[φ1A1,,φnAn] type
Sys-form
ΓA typeΓ,φ1t1:AΓ,φntn:AΓ,φkφltktl:A (1k,ln)
Γ[φ1t1,,φntn]:A
Sys-intro
Γ[φ1t1,,φntn]:AΓφk1F:F
Γ[φ1t1,,φntn]tk:A
Sys-sel
Γ,φ1JΓ,φnJ
ΓJ
Sys-glob

(Sys-sel has a variant for types; J in Sys-glob ranges over arbitrary judgments, so with n=0 everything holds in a context restricted by 0F.)

Convention 80.19 — Partial elements; constraint notation

Let ΓA type and Γ,φu:A; we call u a partial element of A of extent φ. The notation Γa:A[φu]abbreviatesΓa:A  and  Γ,φau:A, read: a extends the partial element u. With several faces, A[φ1u1,,φkuk] imposes one constraint per listed face: a=uk in Γ,φk for every k. The notation [] is the empty list of constraints.

Example 80.20 — Partial elements are boundaries

Let ΓA type and φ=(i=0)(i=1) in Γ,i:I. A partial element of extent φ is, by Sys-glob and definition 80.15, exactly a pair of elements a0,a1:A; an element of A[(i=0)a0,(i=1)a1] in Γ,i:I is exactly a path from a0 to a1, up to the abstraction of Path-intro.

Exercise 80.7

★★★ Establish the disjunctive normal form for F claimed in definition 80.14 (note the relation (i=0)(i=1)=0F kills monomials mentioning both atoms of one name) and derive a decision procedure for φ=ψ in F.

Exercise 80.8

★★☆ Complete lemma 80.17. Compute i.((i=0)((i=1)(j=0))(j=1)).

Exercise 80.9

★☆☆ Show that in a context Γ with Γ0F1F:F, every type is inhabited (by the empty system) and every judgmental equality holds. Why does this not threaten consistency? (Compare the role of 0-elimination, definition 28.7.)

Composition, filling, and transport

Being extensible — convention 80.19 — is the cubical generalization of being connected by a path; the composition operation asserts, with a term, that extensibility is preserved along lines of types. It is the entire Kan structure of the theory.

Definition 80.21 — Composition

For every line of types there is an operation compi, binding the name i in its type and system arguments:

Γφ:FΓ,i:IA typeΓ,φ,i:Iu:AΓa0:A[0/i][φu[0/i]]
ΓcompiA[φu]a0:A[1/i][φu[1/i]]
Comp

subject to the judgmental equality (a strengthening of the boundary constraint in the conclusion): ΓcompiA[1Fu]a0u[1/i]:A[1/i], and to the substitution clause extending definition 26.1: for a substitution σ into Γ and j fresh, (compiA[φu]a0)[σ]=compj(A[σ,j/i])[φ[σ]u[σ,j/i]](a0[σ]). The judgmental equalities computing compiA by cases on the shape of A are listed in definition 80.25 and §§ 80.580.6.

Remark 80.22 — Boxes and lids

Read compiA[φu]a0 as: an open box in the line A, with sides u prescribed over the extent φ for all i, and bottom a0 at i=0 agreeing with the sides; the composition is the missing lid at i=1, agreeing with the sides. The substitution clause is the uniformity of the operation: lids are computed compatibly with all faces, degeneracies, connections and reversals — the feature distinguishing the constructive cubical models from classical Kan simplicial sets. When φ is the boundary formula k(ik=0)(ik=1) of the names of Γ, one recovers the classical Kan box-filling condition.

Example 80.23 — Concatenation of paths

Let Γp:PathA(a,b) and Γq:PathA(b,c). Then pq:=icompjA[(i=0)a, (i=1)qj](pi):PathA(a,c), the lid of the square (direction i horizontal, j vertical): Mathematical diagramDiagram At i=0 the system’s first branch has extent 1F, so the composite is a; at i=1 it is q1c. The groupoid laws of theorem 30.20 hold for up to Path, as the box calculation below shows.

Construction 80.24 — Kan filling

With the data of Comp and j fresh, define in Γ,i:I filliA[φu]a0:=compj(A[ij/i])[φu[ij/i], (i=0)a0]a0. The connection ij replays the composition only up to level i; writing v for the filler, one derives Γv[0/i]a0:A[0/i],Γv[1/i]compiA[φu]a0:A[1/i],Γ,φ,i:Ivu:A. Thus not only the lid but the interior of an open box is constructible by the following direct substitutions: v[0/i]=0j=0;the(i=0)faceistotala0,v[1/i]=1j=j;the(i=0)faceisemptycompiA[φu]a0,v|φ=Compfaceu[i1/i]u. Note that filli does not bind i: the filler is a line in i.

Definition 80.25 — Composition computed by cases

For each type former of the frozen base Π,Σ,N,2,0,1,+,Path,PathP, comp has the following canonical-head judgmental equalities. Together with construction 80.38, definition 80.41, this list is the exact computation contract used in this chapter. A composition whose partial system has no uniform constructor head is neutral; the rules do not inspect a face formula to choose a constructor. Throughout, Γ,φ,i:Iu:C and Γc0:C[0/i][φu[0/i]] are the data of Comp at the line C.

Dependent products, Cx:AB: given Γa1:A[1/i], let w:=filli(A[1i/i])[]a1(in Γ,i:I),v:=w[1i/i](so v[1/i]a1), a line in A ending at a1; then put D:=B[v/x], uv:=uv, and d0:=c0(v[0/i]). Then Γ(compiC[φu]c0)a1compiD[φuv]d0:D[1/i].

Dependent sums, Cx:AB: let u1:=pr1(u), u2:=pr2(u), a0:=pr1(c0), and b0:=pr2(c0). Then let a:=filliA[φu1]a0,c1:=compiA[φu1]a0,c2:=compi(B[a/x])[φu2]b0. Then ΓcompiC[φu]c0(c1,c2):C[1/i].

Natural numbers, CN (constant in i): put n1:=compiN[φn]n0. Recursion gives ΓcompiN[φ0]00:N,ΓcompiN[φsuc(n)](suc(n0))suc(n1):N.

Finite base types and coproducts: the canonical-head rules are compi2[φtt]tttt,compi2[φff]ffff,compi1[φ]. For a coproduct put a1:=compiA[φu]a0,c1:=compiC[φu]c0. Its two canonical-head clauses are compi(A+C)[φinl(u)]inl(a0)inl(a1),compi(A+C)[φinr(u)]inr(c0)inr(c1). There is no canonical introduction case for 0. Mixed Boolean or coproduct systems and compositions on variables remain neutral; the normal-form grammar declares each such expression neutral.

Path types, CPathA(v0,v1) (all of A,v0,v1 may depend on i): for j fresh, put wj:=[φuj, (j=0)v0, (j=1)v1],dj:=compiAwj(c0j). Then ΓcompiC[φu]c0jdj:C[1/i]. For CPathP(j.A,v0,v1), the same displayed equation is used with A allowed to depend on j; this is the complete PathP clause. The clauses for Glue and U are construction 80.38 and definition 80.41.

Construction 80.26 — Transport

Composition with the empty constraint is transport along a line of types: for Γ,i:IA type and Γa:A[0/i], transpiAa:=compiA[]a:A[1/i], and ifilliA[]a is a dependent path PathPi.A(a,transpiAa) connecting a to its transport.

Remark 80.27 — Failure of regularity

If i is not free in A, the equality transpiAaa is not a rule of the theory: it fails in the intended model ([CCHM18], App. C, exhibits the geometric obstruction), and adding it naively breaks the uniformity of definition 80.21. Transport over a degenerate line is only path-equal to the identity (construction 80.26). This is the price of the cubical reading; its consequence for the eliminator J appears in theorem 80.28.

Theorem 80.28 — Path elimination

Let ΓA type, Γa:A and Γ,x:A,α:PathA(a,x)C type. For all Γd:C[a/x,refla/α], Γb:A and Γp:PathA(a,b) there is a term ΓJPath(d;p):C[b/x,p/α], and the computation rule of Id-comp holds up to a path: PathC[a/x,refla/α](JPath(d;refla),d) is inhabited.

Proof of Theorem 80.28 — Path elimination

Proof. Let θp be the singleton path of construction 80.12 and put JPath(d;p):=transpi(C[pr1(θpi)/x, pr2(θpi)/α])d. The line transports over is C pulled back along θp; its faces are C[a/x,refla/α] at i=0 and C[b/x,p/α] at i=1 by the endpoint computations in construction 80.12, so the transport has the stated type. For the computation rule: θreflai(a,refla) is constant, so JPath(d;refla)transpiCd with C:=C[a/x,refla/α] degenerate in i; the required path is the inverse (construction 80.10) of the filler path of construction 80.26. By remark 80.27 the equality is in general not judgmental. ◻

Proposition 217.29 — Cubical groupoid laws

With p1:=ip(1i), concatenation of example 80.23 has left and right units, left and right inverses, and is associative up to paths between paths.

Proof of Proposition 217.29 — Cubical groupoid laws

Proof. Use the derived eliminator of theorem 80.28 in the ordinary path-induction proofs of the five groupoid laws. The reflexivity cases are not judgmental because regularity fails, but construction 80.24 gives them. For example, put h(k,i):=fillkA[(i=0)a, (i=1)a]a. Then h(0,i)a, while h(1,i)(reflarefla)(i); its i=0,1 faces are a. Thus kih(1k,i):PathPathA(a,a)(reflarefla,refla) is the reflexivity case for the right-unit law. The same filler, with the two side branches exchanged, gives the left-unit base case. Path elimination on p propagates these terms to arbitrary paths. The two inverse laws follow by path elimination on p, with the same base filler; associativity follows by three path eliminations, and in the doubly reflexive base its two parenthesizations are joined through refla by the unit paths just constructed. Every displayed fill has a bottom and side system and computes its lid. ◻

Theorem 80.29 — Function extensionality, judgmental

Let ΓA type, Γ,x:AB type and f,g:x:AB. The terms funext(p):=iλx.pxiandhapply(q):=λx.iqix are well typed, funext:x:APathB(fx,gx)Pathx:AB(f,g),happly:Pathx:AB(f,g)x:APathB(fx,gx), and they are judgmentally mutually inverse: happly(funext(p))p and funext(happly(q))q.

Proof of Theorem 80.29 — Function extensionality, judgmental

Proof. Typing of funext(p): in Γ,i:I we have λx.pxi:x:AB; its face at 0 is λx.px0λx.fxf by Path-0 and Π-η (definition 27.2), likewise g at 1. The first round trip is happly(funext(p))Pathβ,Πβλx.ipxiΠη,Pathηp, and the second is funext(happly(q))Pathβ,Πβiλx.qixΠη,Pathηq. ◻

Remark 80.30 — Funext is free

The proof used only definition 80.8 and the βη-rules of Π: no Kan structure, no interval algebra beyond weakening. The principle not built into the base, with exact independence transfer still open (remark 111.89), and recovered from univalence only through a delicate argument (theorem 65.18) is, cubically, a rearrangement of binders. The dependent-path instance has an equally explicit form. If ΓA type, Γ,i:I,x:AB type, f0:x:AB[0/i], and f1:x:AB[1/i], then λp.iλx.pxi:(x:APathPi.B(f0x,f1x))PathPi.x:AB(f0,f1), with inverse λq.λx.iqix. In either composite, Path-β and Π-β expose the rearranged binders, and Path-η and Π-η reduce the result judgmentally to the input.

Exercise 80.10

★☆☆ Derive the three equalities of construction 80.24 from definition 80.21 and Sys-sel. (For the first, note (i=0) becomes 1F under [0/i].)

Exercise 80.11

★★☆ Verify that the Σ-clause of definition 80.25 is well typed: check that pr2(u) is a partial element of B[a/x] of extent φ, using the third filler equality of construction 80.24.

Exercise 80.12

★☆☆ Define an inversion of paths using comp but neither 1r nor connections: p1:=icompjA[(i=0)pj, (i=1)a]a. Check the faces, and compare with construction 80.10. (This is the derivation available when the interval algebra has no reversal or connections.)

Exercise 80.13

★★★ Using a connection square and one composition, construct PathPathA(a,b)(preflb,p) for the concatenation of example 80.23, and sketch the corresponding construction for associativity. (Cf. theorem 30.20; the cubical proofs need no induction.)

Exercise 80.14

★☆☆ Show by definition 80.25 that for every closed numeral n, transpiNnn — regularity holds at N on canonical forms, though not as a schematic rule (remark 80.27).

Glue types

Composition asserts that extensibility is preserved along paths; the Glue former asserts that it is preserved under equivalences, and is the engine of univalence. We first fix the cubical notions of contractibility and equivalence and three derived operations.

Definition 80.31 — Cubical equivalences

For ΓT type, ΓA type, f:TA and a:A: isContr(A):=x:Ay:APathA(x,y),fibf(a):=x:TPathA(a,fx), isEquiv(f):=a:AisContr(fibf(a)),TA:=f:TAisEquiv(f). These are the definitions of definition 62.21 with Path in place of the identity type. For e:TA we write et for pr1(e)t.

Lemma 80.32 — Contractible types are extensible

Let Γw:isContr(A) and Γ,φu:A. Then ext(w)[φu]:=compiA[φpr2(w)ui]pr1(w):A[φu]. Conversely, if A admits an extension operation — for every φ and every partial element u of extent φ, in every context extending Γ, a total element of A[φu] — then isContr(A) is inhabited.

Proof of Lemma 80.32 — Contractible types are extensible

Proof. Forward: pr2(w)u:PathA(pr1(w),u) over Γ,φ, so the composition is defined and equals pr2(w)u1u on φ. Conversely put x:=ext[] (extent 0F); given y:A, work in Γ,i:I with φ:=(i=0)(i=1) and u:=[(i=0)x,(i=1)y]; then iext[φu] is a path from x to y. ◻

Lemma 80.33 — Functions preserve composition up to a path

Let Γ,i:If:TA, Γφ:F, Γ,φ,i:It:T and Γt0:T[0/i][φt[0/i]]. Put c1:=compiA[φft](f[0/i]t0) and c2:=f[1/i](compiT[φt]t0). Then, with v:=filliT[φt]t0 and j fresh, presif[φt]t0:=jcompiA[φ(j=1)fv](f[0/i]t0) inhabits PathA[1/i](c1,c2) and is the constant path j(ft)[1/i] on φ.

Proof of Lemma 80.33 — Functions preserve composition up to a path

Proof. On φ, vt (construction 80.24), so the constraint is consistent; at j=0 the extra face vanishes and the body is c1; at j=1 the constraint has extent 1F, so the composition equals (fv)[1/i]c2 by the filler equalities. On the overlap φ(j=0) both descriptions reduce to (ft)[1/i]. On φ(j=1) the filler equation v[1/i]compiT[φt]t0 gives the same term. Thus the system is compatible, and restricting the displayed path to φ leaves the constant path j(ft)[1/i]. ◻

Lemma 80.34 — Equivalences are fiberwise extensible

Let Γe:TA with underlying f. Given Γa:A, Γ,φt:T and Γ,φp:PathA(a,ft), the operation exte[φ(t,p)]a:=ext(pr2(e)a)[φ(t,p)]:fibf(a)[φ(t,p)] extends the partial fiber element (t,p). Conversely, a function f:TA admitting such an operation (naturally in the context) is an equivalence.

Proof of Lemma 80.34 — Equivalences are fiberwise extensible

Proof. Forward: instance of lemma 80.32 at the contractible type fibf(a). Conversely, for each a:A, apply the extension operation to the empty partial element to obtain a center ca:fibf(a). For z:fibf(a), in a fresh dimension i extend the endpoint system [(i=0)ca,(i=1)z]; abstraction in i is a path from ca to z. Thus every fiber is contractible, which is precisely isEquiv(f). ◻

The endpoint data alone cannot replace Glue. The tempting universe line [(i=0)A, (i=1)B] is not a type in the unrestricted context i:I: Sys-form requires the extents to cover, but (i=0)(i=1)1F by proposition 80.2. Glue repairs the missing interior by supplying a total type underneath the partial endpoint data.

Definition 80.35 — Glue types

The former Glue, with introduction glue and elimination unglue, glues a partial type T onto a total type A along a partial equivalence f. Presuppositions are compressed per convention 26.14. The raw eliminator is written unglueφ,f: its annotation records the partial equivalence, and substitution acts on φ, f, and the argument.

ΓA typeΓφ:FΓ,φT typeΓ,φf:TA
ΓGlue[φ(T,f)]A type
Glue-form
ΓT typeΓf:TA
ΓGlue[1F(T,f)]AT type
Glue-form-1
Γ,φt:TΓa:A[φft]
Γglue[φt]a:Glue[φ(T,f)]A
Glue-intro
Γt:TΓf:TA
Γglue[1Ft](ft)t:T
Glue-intro-1
Γb:Glue[φ(T,f)]A
Γunglueφ,fb:A[φfb]
Glue-elim
Γ,φt:TΓa:A[φft]
Γunglueφ,f(glue[φt]a)a:A
Glue-β
Γb:Glue[φ(T,f)]A
Γbglue[φb](unglueφ,fb):Glue[φ(T,f)]A
Glue-η

Remark 80.36 — Derived boundary behavior

On the extent φ the Glue type is T: from Glue-form-1 and lemma 80.16, Γ,φb:T for any b:Glue[φ(T,f)]A — this establishes the premise fb in Glue-elim and the constraint φb in Glue-η well formed — and unglue extends f: Γ,φungluebfb:A. Thus unglue:Glue[φ(T,f)]AA is a total function restricting on φ to the partial equivalence f; that it is itself an equivalence is lemma 80.43.

Example 80.37 — A line of types from an equivalence

Let Γf:AB and let idB:BB be the identity function with the contractibility of its fibers fibid(y)x:BPathB(y,x) given by construction 80.12. In Γ,i:I put E:=Glue[(i=0)(A,f), (i=1)(B,idB)]B. By Sys-sel and Glue-form-1, E[0/i]A and E[1/i]B: an equivalence has become a line of types. (Once U reflects Glue, iE is a path in the universe — construction 80.42.)

The naive lid of a Glue composition would be glue[φ[1/i]t1]a1. It is not available: t1 is constructed only under δ:=i.φ, whereas the lid requires data on the generally larger face φ[1/i]. The fiber extension in the next construction enlarges t1 to that face, and the final composition in A[1/i] repairs its image so that Glue introduction applies.

Construction 80.38 — Composition for Glue

Let Γ,i:IB type with BGlue[φ(T,f)]A (all data may depend on i), and let Γ,ψ,i:Ib:B, Γb0:B[0/i][ψb[0/i]] be composition data. Write a:=unglueb, a0:=unglueb0 and δ:=i.φ (lemma 80.17); on δ the pair (T,f) is a line, on φ[1/i] only its face at 1 exists. Define a1:=compiA[ψa]a0(in Γ)t1:=compiT[ψb]b0(in Γ,δ)ω:=presif[ψb]b0(in Γ,δ)(t1,α):=extf[1/i][δ(t1,ω), ψ(b[1/i],ja1)]a1(in Γ,φ[1/i])a1:=compj(A[1/i])[φ[1/i]αj, ψa[1/i]]a1(in Γ) and set compiB[ψb]b0glue[φ[1/i]t1]a1, an element of B[1/i][ψb[1/i]]. When Γ,i:Iφ1F:F this agrees with compiT[ψb]b0, as required by Glue-form-1.

Two boundary checks close the construction. On δψ, the two proposed fiber elements reduce to (b[1/i],ja[1/i]) by the boundary equations for comp and pres; on ψ, the final A-composition reduces to a[1/i], so Glue η makes the result b[1/i]. If φ=1F throughout the line, then δ=1F and Glue-form-1 reduces the whole construction to the displayed composition in T [CCHM18].

Exercise 80.15

★☆☆ Derive the two claims of remark 80.36 from definition 80.35 and lemma 80.16, exhibiting the rules used at each step.

Exercise 80.16

★★☆ Write out idB of example 80.37 in full: give the contraction of fibid(y) by specializing construction 80.12, and check the two judgmental equalities E[0/i]A, E[1/i]B.

Exercise 80.17

★★☆ Complete the converse of lemma 80.34: from the extension operation build, for each a:A, the center and contraction of fibf(a), following the proof of lemma 80.32.

The universe and univalence

It remains to close a universe under the cubical formers and to compute composition in it; univalence is then a theorem about Glue.

Definition 80.39 — The cubical universe

The theory has a universe U à la Russell (cf. definition 29.1; we work with one level, the hierarchy and lifts being as in chapter 29):

Γ ctx
ΓU type
-form
ΓA:U
ΓA type
-Russell

and every former of the theory is reflected: if the constituents are in U, so are x:AB, x:AB, A+B, N, 2, 1, 0, PathA(a,b), PathPi.A(a0,a1) and Glue[φ(T,f)]A.

Construction 80.40 — From a line to an equivalence

For every Γ,i:IE type, with A:=E[0/i] and B:=E[1/i], the derived operator equivi(E):AB has underlying map xtranspiEx. We import the contraction of its fibers exactly from CCHM §7.1, the paragraph beginning “Next, given an element” [CCHM18]. There the terms θ0,θ1,ω,δ, their contexts, and all overlap equations are displayed; they assemble a path in fibtranspiE(y) from the chosen center to an arbitrary (x,β). This paragraph therefore fixes a sharply bounded derived operator; the prose summary is not used as its contraction proof. The source’s orientation is retained throughout: equivi(E):E[0/i]E[1/i].

Definition 80.41 — Composition for the universe

For composition data Γ,φ,i:IE:U, ΓA0:U[φE[0/i]]: ΓcompiU[φE]A0Glue[φ(E[1/i], equivi(E[1i/i]))]A0:U, where equivi(E[1i/i]):E[1/i]E[0/i] by construction 80.40 and E[0/i]A0 on φ. Thus the universe is Kan because Glue turns the transport equivalences of its constituent lines into a genuine type.

Construction 80.42 — Univalence map

For Γf:AB with A,B:U, define (via example 80.37 and definition 80.39) ua(f):=iGlue[(i=0)(A,f), (i=1)(B,idB)]B:PathU(A,B), with faces ua(f)0A and ua(f)1B judgmentally by Sys-sel followed by Glue-form-1: after [0/i] the first extent is 1F and the Glue type reduces to A; after [1/i] the second extent is 1F and it reduces to B.

Lemma 80.43 — Unglue is an equivalence

Let B:=Glue[φ(T,f)]A as in definition 80.35. Then unglue:BA is an equivalence.

Proof of Lemma 80.43 — Unglue is an equivalence

Proof. By the converse of lemma 80.34 it suffices, for Γa:A, Γ,ψb:B and Γ,ψα:PathA(a,unglueb), to produce b~:B[ψb] and α~:PathA(a,unglueb~)[ψα]. On φ: f is an equivalence, b:T and α:PathA(a,fb) (remark 80.36), so lemma 80.34 yields Γ,φt:T[ψb] and Γ,φβ:PathA(a,ft)[ψα]. Set a~:=compiA[φβi, ψαi]a,b~:=glue[φt]a~,α~:=ifilliA[φβi, ψαi]a. By Glue-β, unglueb~a~; the filler equalities of construction 80.24 give the endpoints of α~ and the constraints on ψ. ◻

Lemma 217.45 — Fiberwise maps over contractible totals

Let P,Q:XU have contractible total spaces, and let t:x:XPxQx. Then every tx is an equivalence.

Proof of Lemma 217.45 — Fiberwise maps over contractible totals

Proof. The induced total map T:x:XPxx:XQx sends (x,p) to (x,txp). Any map between contractible types is an equivalence: choose the constant map at the source center as a quasiinverse and use the two contractions for the homotopies; then use theorem 62.27. For q:Q(x), the fiber of tx over q is equivalent to the fiber of T over (x,q) because T preserves the first projection judgmentally. The latter is contractible, so tx is an equivalence [Uni13]. ◻

Theorem 80.44 — Univalence

Let U be the universe of definition 80.39. For every A:U:

  1. the type X:UXA is contractible;

  2. consequently, every fiberwise map t:B:UPathU(A,B)(AB) is an equivalence on each fiber. In particular this holds for tB(p):=equivi(p); hence PathU(A,B)(AB), with the orientation AB fixed by construction 80.40.

Proof of Theorem 80.44 — Univalence

Proof. Part (1) is CCHM Corollary 10 [CCHM18]. Its proof applies the extension-to-contractibility direction of lemma 80.32 to a partial pair (T,f):X:UXA. The total extension is

(Glue[φ(T,f)]A,unglue),

and lemma 80.43 gives its equivalence component. The path witnessing agreement with (T,f) on φ, including its composition and boundary reductions, is part of the cited corollary. We import that path rather than treating the displayed pair alone as a contraction proof.

For (2), the two total spaces are contractible by construction 80.12 and (1): the target total B:UAB is equivalent, by inversion of equivalences, to the contractible total in (1). Hence lemma 217.45 makes every such t an equivalence. For tB(p):=equivi(p), the endpoint convention of construction 80.40 gives exactly AB. This is CCHM Corollary 11 [CCHM18]. ◻

Remark 80.45 — Relation to the axiom

Definition 65.6 asserts that a specific map idtoeqv, defined by J-transport, is an equivalence. In cubical type theory J is the derived operator of theorem 80.28, and the resulting idtoeqv is a fiberwise map between the two contractible total spaces of theorem 80.44(2); it is therefore an equivalence, and the univalence axiom holds verbatim — but now with proof, not postulate. Consequently, earlier results stated only with Π-, Σ-, universe-, natural-number-, and path structure — for example theorem 65.22 — transfer to this frozen signature. Results using propositional or n-truncations, quotients, or higher inductive types require adjoining those individual signatures and their Kan clauses; the finer note below records that separate extension boundary.

Remark 80.46 — Univalence computes

Unlike UA, the theorem just proved introduces no constant without computation rules: ua(f) is a Glue type, transport along it unfolds by construction 80.38 and definition 80.41, and transpi(ua(f)i)a is path-equal to fa by the Glue calculation. For f=swap:22, the term transpi(ua(f)i)tt is connected by the path computed from Glue composition to ff; no judgmental reduction of that Boolean term is claimed.

Example 217.49 — A closed univalent transport

Let swap:22 exchange the two constructors and put u:=transpi(ua(swap)i)tt. In construction 80.38 take ψ=0F and φ=(i=0)(i=1). Then δ=i.φ=0F, so the t1 branch disappears; at i=1 the remaining equivalence is id2. Its fiber extension contracts the singleton over swap(tt), and the final A-composition returns its path component. Thus the rule produces jαj:Path2(u,swap(tt)),swap(tt)ff. The result is computed from Glue composition; it is not a postulated equation about an opaque univalence constant.

Identity types, higher inductive types, implementations. The theory as presented has no Id; theorem 80.28 recovers J with a propositional computation rule only. Swan’s construction repairs this: define IdAab as the type of pairs (ω,φ) with ω:PathA(a,b)[φia] — a path marked with an extent on which it is known to be constant. With refla:=(ia,1F), the eliminator defined by a composition over the marked extent satisfies J(d;refla)d judgmentally, and IdAabPathA(a,b), so univalence transfers to Id [CCHM18]. Higher inductive types also extend the theory: the circle of definition 68.8 is added with constructors base, loop(r) and a homogeneous composition constructor hcomp, and its eliminator computes on all three (ibid., §9.2). Splitting comp into hcomp and transp is also how Cubical Agda organizes the primitives; the Cartesian systems of Angiuli et al. make this split fundamental [ABC^+21].

Exercise 80.18

★☆☆ Verify in detail the two faces of ua(f) claimed in construction 80.42: restrict the system under [0/i] and [1/i], compute the resulting face formulas, and apply Sys-sel and Glue-form-1.

Exercise 80.19

★★★ Unfold transpi(ua(f)i)a using construction 80.38 with ψ=0F, and exhibit a path to fa in B. (Compute δ=i.φ=0F for φ=(i=0)(i=1); the interesting branch is φ[1/i]=1F, where extidB contracts a singleton.)

Exercise 80.20

★★☆ Spell out the fiberwise-equivalence criterion used in theorem 80.44(2): given families P,Q over U with contractible total spaces and a fiberwise map t, show each fibtX is contractible by transporting contractions along the total-space equivalence. (Cf. [Uni13], Thm. 4.7.7.)

Suggested first pass.

None of these problems is a prerequisite for a later chapter. Begin with exercise 217.21, then complete exercise 217.22.

Exercise 217.21

★★★ Write the complete boundary of a two-dimensional open box, construct its lid by composition, and restrict the result to every face. Then use Glue to calculate transport of both Boolean constructors along the swap line.

Exercise 217.22

★★★ Practical project.demorgan-face-normalizer Implement in Agda or Kappa normalization and entailment for finite De Morgan face formulas and compatibility checking for systems. Preserve formula equivalence under every endpoint assignment. Normalize the connection and reversal examples, accept a compatible square boundary, and reject two branches that disagree on their overlap. Mutation test: omit the overlap check and ensure the malformed system is then accepted.

Bibliographic notes

The system of this chapter is that of Cohen, Coquand, Huber and Mörtberg [CCHM18], from which our definition 80.1, definition 80.8, definition 80.14, definition 80.18, definition 80.21, definition 80.25, definition 80.35, definition 80.41 are taken with only notational change (they write t(i0), t(i/r) for our t[0/i], t[r/i], and separate system braces from constraint braces); the derived operations of § 80.5 are their §5, and theorem 80.44 assembles their Theorem 9 and Corollaries 10–11. The paper grew out of the first constructive cubical model of univalence by Bezem, Coquand and Huber, formulated in a substructural cube category without diagonals; the De Morgan structure — connections and reversal, after the cubes with connections of Brown and Higgins — was adopted precisely to make the filling of construction 80.24 derivable from composition and to accommodate higher inductive types (see the introduction of [CCHM18] for this history). The accompanying Haskell implementation cubicaltt typechecks all the constructions of this chapter, and the same rules underlie Cubical Agda. The marked identity type of the final finer block is due to Swan. Uniformity of composition (remark 80.22) descends from the earlier work and ultimately from the uniform Kan condition; the semantics in De Morgan cubical sets is developed in §8 of [CCHM18] and is best approached with the categories-with-families apparatus of chapter 54 (definition 54.16, theorem 54.28). Canonicity for this theory was proved by Huber by an operational-semantic argument; normalization and decidability came later, by the synthetic Tait computability of Sterling and Angiuli [SA21], stated for the Cartesian variant. Further Cartesian rules are developed in [ABC^+21], and Angiuli’s thesis gives their computational interpretation [Ang19]. Our route through interval, paths, partiality, composition, and Glue follows the draft account of Angiuli and Gratzer [AG26], which develops the design space between judgmental structure and type-level operations. The univalence-as-contractibility formulation of theorem 80.44(1) is the one they, following Escardó, emphasize. The homotopy-theoretic background and the fiberwise criterion are in the HoTT Book [Uni13], Chapter 4.

Search the book

Type to search the local edition.