diff --git a/search/search_index.json b/search/search_index.json index 7e38d5ad..e3384d70 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Simplicial HoTT and synthetic \u221e-categories","text":"

Info

This project originated as a fork of emilyriehl/yoneda.

This is a formalization library for simplicial Homotopy Type Theory (sHoTT) with the aim of proving resulting in synthetic \u221e-category theory, starting with the results from the following papers:

This formalization project follows the philosophy layed out in the article \"Could \u221e-category theory be taught to undergraduates?\" 4.

The formalizations are implemented using rzk, an experimental proof assistant for a variant of type theory with shapes.

See the list of contributors to this formalisation project at CONTRIBUTORS.md.

"},{"location":"#checking-the-formalisations-locally","title":"Checking the Formalisations Locally","text":"

It is recommended to use VS Code extension for Rzk (available in Visual Studio Marketplace, as well as in Open VSX). The extension should then manage an rzk executable and provide some feedback directly in VS Code, without users having to use the command line.

Otherwise, install the rzk proof assistant from sources. Then run the following command from the root of this repository:

rzk typecheck src/hott/* src/simplicial-hott/*\n
  1. Emily Riehl & Michael Shulman. A type theory for synthetic \u221e-categories. Higher Structures 1(1), 147-224. 2017. https://arxiv.org/abs/1705.07442 \u21a9

  2. Ulrik Buchholtz and Jonathan Weinberger. Synthetic fibered (\u221e, 1)-category theory. Higher Structures 7 (2023), 74\u2013165. Issue 1. https://doi.org/10.21136/HS.2023.04 \u21a9

  3. C\u00e9sar Bardomiano Mart\u00ednez. Limits and colimits of synthetic \u221e-categories. 1-33, 2022. https://arxiv.org/abs/2202.12386 \u21a9

  4. Emily Riehl. Could \u221e-category theory be taught to undergraduates? Notices of the AMS. May 2023. https://www.ams.org/journals/notices/202305/noti2692/noti2692.html \u21a9

"},{"location":"CONTRIBUTORS/","title":"A list of contributors","text":"

Formalizations were contributed by the following people (listed alphabetically):

You may see actual contributed commits in the Contributors page on GitHub.

"},{"location":"STYLEGUIDE/","title":"Style guide and design principles","text":"

This guide provides a set of design principles and guidelines for the sHoTT project. Our style and design principles borrows heavily from agda-unimath.

"},{"location":"STYLEGUIDE/#the-structure-of-code","title":"The structure of code","text":"

We enforce strict formatting rules. This formatting allows the type of the defined term to be easily readable, and aids in understanding the structure of the definition.

The general format of a definition is as follows:

#def concat\n( p : x = y)\n( q : y = z)\n  : (x = z)\n  := idJ (A , y , \\ z' q' \u2192 (x = z') , p , z , q)\n

(Currently just taken from agda-unimath and adapted to Rzk) In Rzk, every construction is structured like a tree, where each operation can be seen as a branching point. We use indentation levels and parentheses to highlight this structure, which makes the code feel more organized and understandable. For example, when a definition part extends beyond a line, we introduce line breaks at the earliest branching point, clearly displaying the tree structure of the definition. This allows the reader to follow the branches of the tree, and to visually grasp the scope of each operation and argument. Consider the following example about Segal types:

#def is-segal-is-local-horn-inclusion\n( A : U)\n( is-local-horn-inclusion-A : is-local-horn-inclusion A)\n  : isSegal A\n  :=\n\\ x y z f g \u2192\n    projection-equiv-contractible-fibers\n      ( \u039b \u2192 A)\n( \\ k \u2192\n        \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n          ( hom2 A\n            ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n            ( \\ t \u2192 k (t , 0\u2082))\n            ( \\ t \u2192 k (1\u2082 , t))\n            ( h)))\n( second\n        ( comp-equiv\n          ( \u03a3 ( k : \u039b \u2192 A ) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082))\n                ( \\ t \u2192 k (1\u2082 , t))\n                ( h)))\n          ( \u0394\u00b2 \u2192 A)\n          ( \u039b  \u2192 A)\n          ( inv-equiv\n            ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n                ( hom2 A\n                  ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                  ( \\ t \u2192 k (t , 0\u2082))\n                  ( \\ t \u2192 k (1\u2082 , t))\n                  ( h)))\n            ( equiv-horn-restriction A))\n          ( horn-restriction A , is-local-horn-inclusion-A)))\n      ( horn A x y z f g)\n

The root here is the function projection-equiv-contractible-fibers. It takes four arguments, each starting on a fresh line and is indented an extra level from the root. The first argument fits neatly on one line, but the second one is too large. In these cases, we add a line break right after the \u2192-symbol following the lambda-abstraction, which is the earliest branching point in this case. The next node is again \u03a3, with two arguments. The first one fits on a line, but the second does not, so we add a line break between them. This process is continued until the definition is complete.

Note also that we use parentheses to mark the branches. The extra space after the opening parentheses marking a branch is there to visually emphasize the tree structure of the definition, and synergizes with our convention to have two-space indentation level increases.

"},{"location":"STYLEGUIDE/#naming-conventions","title":"Naming conventions","text":"
#def function-type-Segal\n( A B : Segal)\n  : Segal\n
"},{"location":"STYLEGUIDE/#use-of-unicode-characters","title":"Use of Unicode characters","text":"

In the defined names we use Unicode symbols sparingly and only when they align with established mathematical practice.

For the builtin syntactic features of rzk we use the following Unicode symbols:

We use ASCII versions for TOP and BOT since \u22a4 and \u22a5 do not read better in the code. Same for first and second (\u03c0\u2081 and \u03c0\u2082 are not very readable). For the latter a lot of uses for projections should go away by using pattern matching (and let/where in the future).

"},{"location":"STYLEGUIDE/#use-of-comments","title":"Use of Comments","text":"

We do not explicitly ban code comments, but our other conventions should heavily limit their need.

Still, code annotations may find their uses.

Where to place literature references?

For instance, instead of writing first (second is-invertible-f), we define a named projection is-section-is-invertible. This may then be used as is-section-is-invertible A B f is-invertible-f in other places. This way, the code becomes self-documenting, and much easier to read.

However, we recognize that in rzk, since we do not have the luxury of implicit arguments, this may sometimes cause unnecessarily verbose code. In such cases, you may revert to using first and second.

"},{"location":"STYLEGUIDE/#adapting-and-evolving-the-style-guide","title":"Adapting and Evolving the Style Guide","text":"

This style guide should evolve as Rzk develops and grows. If new features, like implicit arguments, let-expressions, or where-blocks are added to the language, or if there is made changes to the syntax of the language, their use should be incorporated into this style guide.

At all times, the goal is to have code that is easy to read and navigate, even for those who are not the authors. We should also ensure that we maintain a consistent style across the entire repository.

"},{"location":"hott/00-common.rzk/","title":"0. Common","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/00-common.rzk/#products-of-types","title":"products of types","text":"
#def product\n( A B : U)\n  : U\n  := \u03a3 (x : A) , B\n

The following demonstrates the syntax for constructing terms in Sigma types:

#def diagonal\n( A : U)\n( a : A)\n  : product A A\n  := (a , a)\n
"},{"location":"hott/00-common.rzk/#the-type-of-logical-equivalences-between-types","title":"The type of logical equivalences between types","text":"
#def iff\n( A B : U)\n  : U\n  := product (A \u2192 B) (B \u2192 A)\n
"},{"location":"hott/00-common.rzk/#basic-function-definitions","title":"Basic function definitions","text":"
#section basic-functions\n#variables A B C D E : U\n#def comp\n( g : B \u2192 C)\n( f : A \u2192 B)\n  : A \u2192 C\n  := \\ z \u2192 g (f z)\n#def triple-comp\n( h : C \u2192 D)\n( g : B \u2192 C)\n( f : A \u2192 B)\n  : A \u2192 D\n  := \\ z \u2192 h (g (f z))\n#def quadruple-comp\n( k : D \u2192 E)\n( h : C \u2192 D)\n( g : B \u2192 C)\n( f : A \u2192 B)\n  : A \u2192 E\n  := \\ z \u2192 k (h (g (f z)))\n#def identity\n  : A \u2192 A\n  := \\ a \u2192 a\n#def constant\n( b : B)\n  : A \u2192 B\n  := \\ a \u2192 b\n#end basic-functions\n
"},{"location":"hott/00-common.rzk/#substitution","title":"Substitution","text":"Reindexing a type family along a function into the base type
#def reindex\n( A B : U)\n( f : B \u2192 A)\n( C : A \u2192 U)\n  : B \u2192 U\n  := \\ b \u2192 C (f b)\n
"},{"location":"hott/01-paths.rzk/","title":"1. Paths","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/01-paths.rzk/#path-induction","title":"Path induction","text":"

We define path induction in terms of the built-in J rule, so that we can apply it like any other function.

#define ind-path\n( A : U)\n( a : A)\n( C : (x : A) -> (a = x) -> U)\n( d : C a refl)\n( x : A)\n( p : a = x)\n  : C x p\n  := idJ (A , a , C , d , x , p)\n

To emphasize the fact that this version of path induction is biased towards paths with fixed starting point, we introduce the synonym ind-path-start. Later we will construct the analogous path induction ind-path-end, for paths with fixed end point.

#define ind-path-start\n( A : U)\n( a : A)\n( C : (x : A) -> (a = x) -> U)\n( d : C a refl)\n( x : A)\n( p : a = x)\n  : C x p\n  :=\n    ind-path A a C d x p\n
"},{"location":"hott/01-paths.rzk/#some-basic-path-algebra","title":"Some basic path algebra","text":"
#section path-algebra\n#variable A : U\n#variables x y z : A\n
"},{"location":"hott/01-paths.rzk/#path-reversal","title":"Path reversal","text":"
#def rev\n( p : x = y)\n  : y = x\n  := ind-path (A) (x) (\\ y' p' \u2192 y' = x) (refl) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#path-concatenation","title":"Path concatenation","text":"

We take path concatenation defined by induction on the second path variable as our main definition.

#def concat\n( p : x = y)\n( q : y = z)\n  : (x = z)\n  := ind-path (A) (y) (\\ z' q' \u2192 (x = z')) (p) (z) (q)\n

We also introduce a version defined by induction on the first path variable, for situations where it is easier to induct on the first path.

#def concat'\n( p : x = y)\n  : (y = z) \u2192 (x = z)\n  := ind-path (A) (x) (\\ y' p' \u2192 (y' = z) \u2192 (x = z)) (\\ q' \u2192 q') (y) (p)\n#end path-algebra\n
"},{"location":"hott/01-paths.rzk/#some-basic-coherences-in-path-algebra","title":"Some basic coherences in path algebra","text":"
#section basic-path-coherence\n#variable A : U\n#variables w x y z : A\n#def rev-rev\n( p : x = y)\n  : (rev A y x (rev A x y p)) = p\n  :=\n    ind-path\n    ( A) (x) (\\ y' p' \u2192 (rev A y' x (rev A x y' p')) = p') (refl) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#left-unit-law-for-path-concatenation","title":"Left unit law for path concatenation","text":"

The left unit law for path concatenation does not hold definitionally due to our choice of definition.

#def left-unit-concat\n( p : x = y)\n  : (concat A x x y refl p) = p\n  := ind-path (A) (x) (\\ y' p' \u2192 (concat A x x y' refl p') = p') (refl) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#associativity-of-path-concatenation","title":"Associativity of path concatenation","text":"
#def associative-concat\n( p : w = x)\n( q : x = y)\n( r : y = z)\n  : ( concat A w y z (concat A w x y p q) r) =\n    ( concat A w x z p (concat A x y z q r))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192\n        concat A w y z' (concat A w x y p q) r' =\n        concat A w x z' p (concat A x y z' q r'))\n      ( refl)\n      ( z)\n      ( r)\n#def rev-associative-concat\n( p : w = x)\n( q : x = y)\n( r : y = z)\n  : ( concat A w x z p (concat A x y z q r)) =\n    ( concat A w y z (concat A w x y p q) r)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192\n          concat A w x z' p (concat A x y z' q r') =\n          concat A w y z' (concat A w x y p q) r')\n      ( refl)\n      ( z)\n      ( r)\n#def right-inverse-concat\n( p : x = y)\n  : (concat A x y x p (rev A x y p)) = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 concat A x y' x p' (rev A x y' p') = refl)\n      ( refl)\n      ( y)\n      ( p)\n#def left-inverse-concat\n( p : x = y)\n  : (concat A y x y (rev A x y p) p) = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 concat A y' x y' (rev A x y' p') p' = refl)\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#concatenation-of-two-paths-with-common-codomain","title":"Concatenation of two paths with common codomain","text":"

Concatenation of two paths with common codomain; defined using concat and rev.

#def zig-zag-concat\n( p : x = y)\n( q : z = y)\n  : (x = z)\n  := concat A x y z p (rev A z y q)\n
"},{"location":"hott/01-paths.rzk/#concatenation-of-two-paths-with-common-domain","title":"Concatenation of two paths with common domain","text":"

Concatenation of two paths with common domain; defined using concat and rev.

#def zag-zig-concat\n(p : y = x)\n(q : y = z)\n  : (x = z)\n  := concat A x y z (rev A y x p) q\n#def right-cancel-concat\n( p q : x = y)\n( r : y = z)\n  : ((concat A x y z p r) = (concat A x y z q r)) \u2192 (p = q)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192 ((concat A x y z' p r') = (concat A x y z' q r')) \u2192 (p = q))\n      ( \\ H \u2192 H)\n      ( z)\n      ( r)\n#end basic-path-coherence\n
"},{"location":"hott/01-paths.rzk/#some-derived-coherences-in-path-algebra","title":"Some derived coherences in path algebra","text":"

The statements or proofs of the following path algebra coherences reference one of the path algebra coherences defined above.

#section derived-path-coherence\n#variable A : U\n#variables x y z : A\n#def rev-concat\n( p : x = y)\n( q : y = z)\n  : ( rev A x z (concat A x y z p q)) =\n    ( concat A z y x (rev A y z q) (rev A x y p))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n          (rev A x z' (concat A x y z' p q')) =\n          (concat A z' y x (rev A y z' q') (rev A x y p)))\n      ( rev\n          ( y = x)\n          ( concat A y y x refl (rev A x y p))\n          ( rev A x y p)\n          ( left-unit-concat A y x (rev A x y p)))\n      ( z)\n      ( q)\n
"},{"location":"hott/01-paths.rzk/#postwhiskering-paths-of-paths","title":"Postwhiskering paths of paths","text":"
#def concat-eq-left\n( p q : x = y)\n( H : p = q)\n( r : y = z)\n  : (concat A x y z p r) = (concat A x y z q r)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192 (concat A x y z' p r') = (concat A x y z' q r'))\n      ( H)\n      ( z)\n      ( r)\n
"},{"location":"hott/01-paths.rzk/#prewhiskering-paths-of-paths","title":"Prewhiskering paths of paths","text":"

Prewhiskering paths of paths is much harder.

#def concat-eq-right\n( p : x = y)\n  : ( q : y = z) \u2192\n( r : y = z) \u2192\n( H : q = r) \u2192\n    ( concat A x y z p q) = (concat A x y z p r)\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' p' \u2192\n        ( q : y' = z) \u2192\n( r : y' = z) \u2192\n( H : q = r) \u2192\n        ( concat A x y' z p' q) = (concat A x y' z p' r))\n      ( \\ q r H \u2192\n        concat\n          ( x = z)\n          ( concat A x x z refl q)\n          ( r)\n          ( concat A x x z refl r)\n          ( concat (x = z) (concat A x x z refl q) q r (left-unit-concat A x z q) H)\n          ( rev (x = z) (concat A x x z refl r) r (left-unit-concat A x z r)))\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#identifying-the-two-definitions-of-path-concatenation","title":"Identifying the two definitions of path concatenation","text":"
#def concat-concat'\n( p : x = y)\n  : ( q : y = z) \u2192\n    ( concat A x y z p q) = (concat' A x y z p q)\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' p' \u2192\n          (q' : y' =_{A} z) \u2192\n          (concat A x y' z p' q') =_{x =_{A} z} concat' A x y' z p' q')\n      ( \\ q' \u2192 left-unit-concat A x z q')\n      ( y)\n      ( p)\n#def concat'-concat\n( p : x = y)\n( q : y = z)\n  : concat' A x y z p q = concat A x y z p q\n  :=\n    rev\n      ( x = z)\n      ( concat A x y z p q)\n      ( concat' A x y z p q)\n      ( concat-concat' p q)\n

This is easier to prove for concat' than for concat.

#def alt-triangle-rotation\n( p : x = z)\n( q : x = y)\n  : ( r : y = z) \u2192\n( H : p = concat' A x y z q r) \u2192\n    ( concat' A y x z (rev A x y q) p) = r\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' q' \u2192\n        ( r' : y' =_{A} z) \u2192\n( H' : p = concat' A x y' z q' r') \u2192\n        ( concat' A y' x z (rev A x y' q') p) = r')\n      ( \\ r' H' \u2192 H')\n      ( y)\n      ( q)\n

The following needs to be outside the previous section because of the usage of concat-concat' A y x.

#end derived-path-coherence\n#def triangle-rotation\n( A : U)\n( x y z : A)\n( p : x = z)\n( q : x = y)\n( r : y = z)\n( H : p = concat A x y z q r)\n  : (concat A y x z (rev A x y q) p) = r\n  :=\n    concat\n      ( y = z)\n      ( concat A y x z (rev A x y q) p)\n      ( concat' A y x z (rev A x y q) p)\n      ( r)\n      ( concat-concat' A y x z (rev A x y q) p)\n      ( alt-triangle-rotation\n        ( A) (x) (y) (z) (p) (q) (r)\n        ( concat\n          ( x = z)\n          ( p)\n          ( concat A x y z q r)\n          ( concat' A x y z q r)\n          ( H)\n          ( concat-concat' A x y z q r)))\n
"},{"location":"hott/01-paths.rzk/#concatenation-with-a-path-and-its-reversal","title":"Concatenation with a path and its reversal","text":"
#def retraction-preconcat\n( A : U)\n( x y z : A)\n( p : x = y)\n( q : y = z)\n  : concat A y x z (rev A x y p) (concat A x y z p q) = q\n  :=\n    ind-path (A) (y)\n    ( \\ z' q' \u2192 concat A y x z' (rev A x y p) (concat A x y z' p q') = q') (left-inverse-concat A x y p) (z) (q)\n#def section-preconcat\n( A : U)\n( x y z : A)\n( p : x = y)\n( r : x = z)\n  : concat A x y z p (concat A y x z (rev A x y p) r) = r\n  :=\n    ind-path (A) (x)\n    ( \\ z' r' \u2192 concat A x y z' p (concat A y x z' (rev A x y p) r') = r') (right-inverse-concat A x y p) (z) (r)\n#def retraction-postconcat\n( A : U)\n( x y z : A)\n( q : y = z)\n( p : x = y)\n  : concat A x z y (concat A x y z p q) (rev A y z q) = p\n  :=\n    ind-path (A) (y)\n    ( \\ z' q' \u2192 concat A x z' y (concat A x y z' p q') (rev A y z' q') = p)\n    ( refl) (z) (q)\n#def section-postconcat\n( A : U)\n( x y z : A)\n( q : y = z)\n( r : x = z)\n  : concat A x y z (concat A x z y r (rev A y z q)) q = r\n  :=\n    concat\n      ( x = z)\n      ( concat A x y z (concat A x z y r (rev A y z q)) q)\n      ( concat A x z z r (concat A z y z (rev A y z q) q))\n      ( r)\n      ( associative-concat A x z y z r (rev A y z q) q)\n      ( concat-eq-right A x z z r\n        ( concat A z y z (rev A y z q) q)\n        ( refl)\n        ( left-inverse-concat A y z q))\n
"},{"location":"hott/01-paths.rzk/#application-of-functions-to-paths","title":"Application of functions to paths","text":"
#def ap\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (f x = f y)\n  := ind-path (A) (x) (\\ y' p' \u2192 (f x = f y')) (refl) (y) (p)\n#def ap-rev\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (ap A B y x f (rev A x y p)) = (rev B (f x) (f y) (ap A B x y f p))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ap A B y' x f (rev A x y' p') = rev B (f x) (f y') (ap A B x y' f p'))\n      ( refl)\n      ( y)\n      ( p)\n#def ap-concat\n( A B : U)\n( x y z : A)\n( f : A \u2192 B)\n( p : x = y)\n( q : y = z)\n  : ( ap A B x z f (concat A x y z p q)) =\n    ( concat B (f x) (f y) (f z) (ap A B x y f p) (ap A B y z f q))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n        ( ap A B x z' f (concat A x y z' p q')) =\n        ( concat B (f x) (f y) (f z') (ap A B x y f p) (ap A B y z' f q')))\n      ( refl)\n      ( z)\n      ( q)\n#def rev-ap-rev\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (rev B (f y) (f x) (ap A B y x f (rev A x y p))) = (ap A B x y f p)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        (rev B (f y') (f x) (ap A B y' x f (rev A x y' p'))) =\n        (ap A B x y' f p'))\n      ( refl)\n      ( y)\n      ( p)\n

The following is for a specific use.

#def concat-ap-rev-ap-id\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : ( concat\n      ( B) (f y) (f x) (f y)\n      ( ap A B y x f (rev A x y p))\n      ( ap A B x y f p)) =\n    ( refl)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( concat\n          ( B) (f y') (f x) (f y')\n          ( ap A B y' x f (rev A x y' p')) (ap A B x y' f p')) =\n        ( refl))\n      ( refl)\n      ( y)\n      ( p)\n#def ap-id\n( A : U)\n( x y : A)\n( p : x = y)\n  : (ap A A x y (identity A) p) = p\n  := ind-path (A) (x) (\\ y' p' \u2192 (ap A A x y' (\\ z \u2192 z) p') = p') (refl) (y) (p)\n

Application of a function to homotopic paths yields homotopic paths.

#def ap-eq\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p q : x = y)\n( H : p = q)\n  : (ap A B x y f p) = (ap A B x y f q)\n  :=\n    ind-path\n      ( x = y)\n      ( p)\n      ( \\ q' H' \u2192 (ap A B x y f p) = (ap A B x y f q'))\n      ( refl)\n      ( q)\n      ( H)\n#def ap-comp\n( A B C : U)\n( x y : A)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( p : x = y)\n  : ( ap A C x y (comp A B C g f) p) =\n    ( ap B C (f x) (f y) g (ap A B x y f p))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( ap A C x y' (\\ z \u2192 g (f z)) p') =\n        ( ap B C (f x) (f y') g (ap A B x y' f p')))\n      ( refl)\n      ( y)\n      ( p)\n#def rev-ap-comp\n( A B C : U)\n( x y : A)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( p : x = y)\n  : ( ap B C (f x) (f y) g (ap A B x y f p)) =\n    ( ap A C x y (comp A B C g f) p)\n  :=\n    rev\n      ( g (f x) = g (f y))\n      ( ap A C x y (\\ z \u2192 g (f z)) p)\n      ( ap B C (f x) (f y) g (ap A B x y f p))\n      ( ap-comp A B C x y f g p)\n
"},{"location":"hott/01-paths.rzk/#transport","title":"Transport","text":"
#section transport\n#variable A : U\n#variable B : A \u2192 U\n
"},{"location":"hott/01-paths.rzk/#transport-in-a-type-family-along-a-path-in-the-base","title":"Transport in a type family along a path in the base","text":"
#def transport\n( x y : A)\n( p : x = y)\n( u : B x)\n  : B y\n  := ind-path (A) (x) (\\ y' p' \u2192 B y') (u) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#the-lift-of-a-base-path-to-a-path-from-a-term-in-the-total-space-to-its-transport","title":"The lift of a base path to a path from a term in the total space to its transport","text":"
#def transport-lift\n( x y : A)\n( p : x = y)\n( u : B x)\n  : (x , u) =_{\u03a3 (z : A) , B z} (y , transport x y p u)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 (x , u) =_{\u03a3 (z : A) , B z} (y' , transport x y' p' u))\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#transport-along-concatenated-paths","title":"Transport along concatenated paths","text":"
#def transport-concat\n( x y z : A)\n( p : x = y)\n( q : y = z)\n( u : B x)\n  : ( transport x z (concat A x y z p q) u) =\n    ( transport y z q (transport x y p u))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n        ( transport x z' (concat A x y z' p q') u) =\n        ( transport y z' q' (transport x y p u)))\n      ( refl)\n      ( z)\n      ( q)\n#def transport-concat-rev\n( x y z : A)\n( p : x = y)\n( q : y = z)\n( u : B x)\n  : ( transport y z q (transport x y p u)) =\n    ( transport x z (concat A x y z p q) u)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n        ( transport y z' q' (transport x y p u)) =\n        ( transport x z' (concat A x y z' p q') u))\n      ( refl)\n      ( z)\n      ( q)\n
"},{"location":"hott/01-paths.rzk/#transport-along-homotopic-paths","title":"Transport along homotopic paths","text":"
#def transport2\n( x y : A)\n( p q : x = y)\n( H : p = q)\n( u : B x)\n  : (transport x y p u) = (transport x y q u)\n  :=\n    ind-path\n      ( x = y)\n      ( p)\n      ( \\ q' H' \u2192 (transport x y p u) = (transport x y q' u))\n      ( refl)\n      ( q)\n      ( H)\n
"},{"location":"hott/01-paths.rzk/#transport-along-a-loop","title":"Transport along a loop","text":"
#def transport-loop\n( a : A)\n( b : B a)\n  : (a = a) \u2192 B a\n  := \\ p \u2192 (transport a a p b)\n
#end transport\n
"},{"location":"hott/01-paths.rzk/#substitution-law-for-transport","title":"Substitution law for transport","text":"
#def transport-substitution\n( A' A : U)\n( B : A \u2192 U)\n( f : A' \u2192 A)\n( x y : A')\n( p : x = y)\n( u : B (f x))\n  : transport A' (\\ x \u2192 B (f x)) x y p u =\n    transport A B (f x) (f y) (ap A' A x y f p) u\n  :=\n    ind-path\n      ( A')\n      ( x)\n      ( \\ y' p' \u2192\n        transport A' (\\ x \u2192 B (f x)) x y' p' u =\n        transport A B (f x) (f y') (ap A' A x y' f p') u)\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#path-induction_1","title":"Path induction","text":"

Using rev we can deduce a path induction principle with fixed end point.

#def ind-path-end\n( A : U)\n( a : A)\n( C : (x : A) \u2192 (x = a) -> U)\n( d : C a refl)\n( x : A)\n( p : x = a)\n  : C x p\n  :=\n    transport (x = a) (\\ q \u2192 C x q) (rev A a x (rev A x a p)) p\n      (rev-rev A x a p)\n      (ind-path A a (\\ y q \u2192 C y (rev A a y q)) d x (rev A x a p))\n
"},{"location":"hott/01-paths.rzk/#dependent-application","title":"Dependent application","text":"
#def apd\n( A : U)\n( B : A \u2192 U)\n( x y : A)\n( f : (z : A) \u2192 B z)\n( p : x = y)\n  : (transport A B x y p (f x)) = f y\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( (\\ y' p' \u2192 (transport A B x y' p' (f x)) = f y'))\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#higher-order-concatenation","title":"Higher-order concatenation","text":"

For convenience, we record lemmas for higher-order concatenation here.

#section higher-concatenation\n#variable A : U\n#def triple-concat\n( a0 a1 a2 a3 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n  : a0 = a3\n  := concat A a0 a1 a3 p1 (concat A a1 a2 a3 p2 p3)\n#def quadruple-concat\n( a0 a1 a2 a3 a4 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n( p4 : a3 = a4)\n  : a0 = a4\n  := triple-concat a0 a1 a2 a4 p1 p2 (concat A a2 a3 a4 p3 p4)\n#def quintuple-concat\n( a0 a1 a2 a3 a4 a5 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n( p4 : a3 = a4)\n( p5 : a4 = a5)\n  : a0 = a5\n  := quadruple-concat a0 a1 a2 a3 a5 p1 p2 p3 (concat A a3 a4 a5 p4 p5)\n#def alternating-quintuple-concat\n( a0 : A)\n( a1 : A) (p1 : a0 = a1)\n( a2 : A) (p2 : a1 = a2)\n( a3 : A) (p3 : a2 = a3)\n( a4 : A) (p4 : a3 = a4)\n( a5 : A) (p5 : a4 = a5)\n  : a0 = a5\n  := quadruple-concat a0 a1 a2 a3 a5 p1 p2 p3 (concat A a3 a4 a5 p4 p5)\n#def 12ary-concat\n( a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n( p4 : a3 = a4)\n( p5 : a4 = a5)\n( p6 : a5 = a6)\n( p7 : a6 = a7)\n( p8 : a7 = a8)\n( p9 : a8 = a9)\n( p10 : a9 = a10)\n( p11 : a10 = a11)\n( p12 : a11 = a12)\n  : a0 = a12\n  :=\n    quintuple-concat\n      a0 a1 a2 a3 a4 a12\n      p1 p2 p3 p4\n      ( quintuple-concat\n        a4 a5 a6 a7 a8 a12\n        p5 p6 p7 p8\n        ( quadruple-concat\n          a8 a9 a10 a11 a12\n          p9 p10 p11 p12))\n

The following is the same as above but with alternating arguments.

#def alternating-12ary-concat\n( a0 : A)\n( a1 : A) (p1 : a0 = a1)\n( a2 : A) (p2 : a1 = a2)\n( a3 : A) (p3 : a2 = a3)\n( a4 : A) (p4 : a3 = a4)\n( a5 : A) (p5 : a4 = a5)\n( a6 : A) (p6 : a5 = a6)\n( a7 : A) (p7 : a6 = a7)\n( a8 : A) (p8 : a7 = a8)\n( a9 : A) (p9 : a8 = a9)\n( a10 : A) (p10 : a9 = a10)\n( a11 : A) (p11 : a10 = a11)\n( a12 : A) (p12 : a11 = a12)\n  : a0 = a12\n  :=\n    12ary-concat\n      a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12\n      p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12\n#end higher-concatenation\n
"},{"location":"hott/01-paths.rzk/#higher-order-coherences","title":"Higher-order coherences","text":"
#def rev-refl-id-triple-concat\n( A : U)\n( x y : A)\n( p : x = y)\n  : triple-concat A y x x y (rev A x y p) refl p = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 triple-concat A y' x x y' (rev A x y' p') refl p' = refl)\n      ( refl)\n      ( y)\n      ( p)\n#def ap-rev-refl-id-triple-concat\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (ap A B y y f (triple-concat A y x x y (rev A x y p) refl p)) = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( ap A B y' y' f (triple-concat A y' x x y' (rev A x y' p') refl p')) =\n        ( refl))\n      ( refl)\n      ( y)\n      ( p)\n#def ap-triple-concat\n( A B : U)\n( w x y z : A)\n( f : A \u2192 B)\n( p : w = x)\n( q : x = y)\n( r : y = z)\n  : ( ap A B w z f (triple-concat A w x y z p q r)) =\n    ( triple-concat\n      ( B)\n      ( f w)\n      ( f x)\n      ( f y)\n      ( f z)\n      ( ap A B w x f p)\n      ( ap A B x y f q)\n      ( ap A B y z f r))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192\n        ( ap A B w z' f (triple-concat A w x y z' p q r')) =\n        ( triple-concat\n          ( B)\n          ( f w) (f x) (f y) (f z')\n          ( ap A B w x f p)\n          ( ap A B x y f q)\n          ( ap A B y z' f r')))\n      ( ap-concat A B w x y f p q)\n      ( z)\n      ( r)\n#def triple-concat-eq-first\n( A : U)\n( w x y z : A)\n( p q : w = x)\n( r : x = y)\n( s : y = z)\n( H : p = q)\n  : (triple-concat A w x y z p r s) = (triple-concat A w x y z q r s)\n  := concat-eq-left A w x z p q H (concat A x y z r s)\n#def triple-concat-eq-second\n( A : U)\n( w x y z : A)\n( p : w = x)\n( q r : x = y)\n( s : y = z)\n( H : q = r)\n  : (triple-concat A w x y z p q s) = (triple-concat A w x y z p r s)\n  :=\n    ind-path\n      ( x = y)\n      ( q)\n      ( \\ r' H' \u2192\n        triple-concat A w x y z p q s = triple-concat A w x y z p r' s)\n      ( refl)\n      ( r)\n      ( H)\n
"},{"location":"hott/02-homotopies.rzk/","title":"2. Homotopies","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/02-homotopies.rzk/#homotopies-and-their-algebra","title":"Homotopies and their algebra","text":"
#section homotopies\n#variables A B : U\n
The type of homotopies between parallel functions
#def homotopy\n( f g : A \u2192 B)\n  : U\n  := ( a : A) \u2192 (f a = g a)\n
The reversal of a homotopy
#def rev-homotopy\n( f g : A \u2192 B)\n( H : homotopy f g)\n  : homotopy g f\n  := \\ a \u2192 rev B (f a) (g a) (H a)\n
#def concat-homotopy\n( f g h : A \u2192 B)\n( H : homotopy f g)\n( K : homotopy g h)\n  : homotopy f h\n  := \\ a \u2192 concat B (f a) (g a) (h a) (H a) (K a)\n

Homotopy composition is defined in diagrammatic order like concat but unlike composition.

#end homotopies\n
"},{"location":"hott/02-homotopies.rzk/#whiskering-homotopies","title":"Whiskering homotopies","text":"
#section homotopy-whiskering\n#variables A B C : U\n#def postwhisker-homotopy\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( h : B \u2192 C)\n  : homotopy A C (comp A B C h f) (comp A B C h g)\n  := \\ a \u2192 ap B C (f a) (g a) h (H a)\n#def prewhisker-homotopy\n( f g : B \u2192 C)\n( H : homotopy B C f g)\n( h : A \u2192 B)\n  : homotopy A C (comp A B C f h) (comp A B C g h)\n  := \\ a \u2192 H (h a)\n#end homotopy-whiskering\n#def whisker-homotopy\n( A B C D : U)\n( h k : B \u2192 C)\n( H : homotopy B C h k)\n( f : A \u2192 B)\n( g : C \u2192 D)\n  : homotopy\n      A\n      D\n      (triple-comp A B C D g h f)\n      (triple-comp A B C D g k f)\n  :=\n    postwhisker-homotopy\n      A\n      C\n      D\n      ( comp A B C h f)\n      ( comp A B C k f)\n      ( prewhisker-homotopy A B C h k H f)\n      g\n
"},{"location":"hott/02-homotopies.rzk/#naturality","title":"Naturality","text":"The naturality square associated to a homotopy and a path
#def nat-htpy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( x y : A)\n( p : x = y)\n  : ( concat B (f x) (f y) (g y) (ap A B x y f p) (H y)) =\n    ( concat B (f x) (g x) (g y) (H x) (ap A B x y g p))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( concat B (f x) (f y') (g y') (ap A B x y' f p') (H y')) =\n        ( concat B (f x) (g x) (g y') (H x) (ap A B x y' g p')))\n      ( left-unit-concat B (f x) (g x) (H x))\n      ( y)\n      ( p)\n
Naturality in another form
#def triple-concat-nat-htpy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( x y : A)\n( p : x = y)\n  : triple-concat\n      ( B) (g x) (f x) (f y) (g y)\n      ( rev B (f x) (g x) (H x)) (ap A B x y f p) (H y) =\n    ap A B x y g p\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n          triple-concat\n            ( B)\n            ( g x)\n            ( f x)\n            ( f y')\n            ( g y')\n            ( rev B (f x) (g x) (H x))\n            ( ap A B x y' f p')\n            ( H y') =\n          ap A B x y' g p')\n      ( rev-refl-id-triple-concat B (f x) (g x) (H x))\n      ( y)\n      ( p)\n
"},{"location":"hott/02-homotopies.rzk/#an-application","title":"An application","text":"
#section cocone-naturality\n#variable A : U\n#variable f : A \u2192 A\n#variable H : homotopy A A f (identity A)\n#variable a : A\n

In the case of a homotopy H from f to the identity the previous square applies to the path H a to produce the following naturality square.

#def cocone-naturality\n  : ( concat A (f (f a)) (f a) a (ap A A (f a) a f (H a)) (H a)) =\n    ( concat A (f (f a)) (f a) (a) (H (f a)) (ap A A (f a) a (identity A) (H a)))\n  := nat-htpy A A f (identity A) H (f a) a (H a)\n

After composing with ap-id, this naturality square transforms to the following:

#def reduced-cocone-naturality\n  : ( concat A (f (f a)) (f a) a (ap A A (f a) a f (H a)) (H a)) =\n    ( concat A (f (f a)) (f a) (a) (H (f a)) (H a))\n  :=\n    concat\n      ( (f (f a)) = a)\n      ( concat A (f (f a)) (f a) a (ap A A (f a) a f (H a)) (H a))\n      ( concat\n        ( A)\n        ( f (f a))\n        ( f a)\n        ( a)\n        ( H (f a))\n        ( ap A A (f a) a (identity A) (H a)))\n      ( concat A (f (f a)) (f a) (a) (H (f a)) (H a))\n      ( cocone-naturality)\n      ( concat-eq-right\n        ( A)\n        ( f (f a))\n        ( f a)\n        ( a)\n        ( H (f a))\n        ( ap A A (f a) a (identity A) (H a))\n        ( H a)\n        ( ap-id A (f a) a (H a)))\n

Cancelling the path H a on the right and reversing yields a path we need:

#def cocone-naturality-coherence\n  : (H (f a)) = (ap A A (f a) a f (H a))\n  :=\n    rev\n      ( f (f a) = f a)\n      ( ap A A (f a) a f (H a)) (H (f a))\n      ( right-cancel-concat\n        ( A)\n        ( f (f a))\n        ( f a)\n        ( a)\n        ( ap A A (f a) a f (H a))\n        ( H (f a))\n        ( H a)\n        ( reduced-cocone-naturality))\n#end cocone-naturality\n
"},{"location":"hott/02-homotopies.rzk/#conjugation-with-higher-homotopies","title":"Conjugation with higher homotopies","text":"
#def triple-concat-higher-homotopy\n( A B : U)\n( f g : A \u2192 B)\n( H K : homotopy A B f g)\n( \u03b1 : (a : A) \u2192 H a = K a)\n( x y : A)\n( p : f x = f y)\n  : triple-concat B (g x) (f x) (f y) (g y) (rev B (f x) (g x) (H x)) p (H y) =\n    triple-concat B (g x) (f x) (f y) (g y) (rev B (f x) (g x) (K x)) p (K y)\n  :=\n    ind-path\n      ( f y = g y)\n      ( H y)\n      ( \\ Ky \u03b1' \u2192\n        ( triple-concat\n          ( B) (g x) (f x) (f y) (g y)\n          ( rev B (f x) (g x) (H x)) (p) (H y)) =\n        ( triple-concat\n          ( B) (g x) (f x) (f y) (g y)\n          ( rev B (f x) (g x) (K x)) (p) (Ky)))\n      ( triple-concat-eq-first\n        ( B) (g x) (f x) (f y) (g y)\n        ( rev B (f x) (g x) (H x))\n        ( rev B (f x) (g x) (K x))\n        ( p)\n        ( H y)\n        ( ap\n          ( f x = g x)\n          ( g x = f x)\n          ( H x)\n          ( K x)\n          ( rev B (f x) (g x))\n          ( \u03b1 x)))\n      ( K y)\n      (\u03b1 y)\n
"},{"location":"hott/03-equivalences.rzk/","title":"3. Equivalences","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/03-equivalences.rzk/#sections-retractions-and-equivalences","title":"Sections, retractions, and equivalences","text":"
#section is-equiv\n#variables A B : U\n#def has-section\n( f : A \u2192 B)\n  : U\n  := \u03a3 (s : B \u2192 A) , (homotopy B B (comp B A B f s) (identity B))\n#def has-retraction\n( f : A \u2192 B)\n  : U\n  := \u03a3 (r : B \u2192 A) , (homotopy A A (comp A B A r f) (identity A))\n
#def ind-has-section\n( f : A \u2192 B)\n  ( ( sec-f , \u03b5-f) : has-section f)\n( C : B \u2192 U)\n( s : ( a : A) \u2192 C ( f a))\n( b : B)\n  : C b\n  :=\n    transport B C ( f (sec-f b)) b ( \u03b5-f b) ( s (sec-f b))\n

We define equivalences to be bi-invertible maps.

#def is-equiv\n( f : A \u2192 B)\n  : U\n  := product (has-retraction f) (has-section f)\n#end is-equiv\n
"},{"location":"hott/03-equivalences.rzk/#the-identity-is-an-equivalence","title":"The identity is an equivalence","text":"
#def is-equiv-identity\n( A : U)\n  : is-equiv A A (\\ a \u2192 a)\n  :=\n    ( (\\ a \u2192 a, \\ _ \u2192 refl), (\\ a \u2192 a, \\ _ \u2192 refl))\n
"},{"location":"hott/03-equivalences.rzk/#equivalence-data","title":"Equivalence data","text":"
#section equivalence-data\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-equiv-f : is-equiv A B f\n#def section-is-equiv uses (f)\n  : B \u2192 A\n  := first (second is-equiv-f)\n#def retraction-is-equiv uses (f)\n  : B \u2192 A\n  := first (first is-equiv-f)\n
The homotopy between the section and retraction of an equivalence
#def homotopy-section-retraction-is-equiv uses (f)\n  : homotopy B A section-is-equiv retraction-is-equiv\n  :=\n    concat-homotopy B A\n      ( section-is-equiv)\n      ( triple-comp B A B A retraction-is-equiv f section-is-equiv)\n      ( retraction-is-equiv)\n      ( rev-homotopy B A\n        ( triple-comp B A B A retraction-is-equiv f section-is-equiv)\n        ( section-is-equiv)\n        ( prewhisker-homotopy B A A\n          ( comp A B A retraction-is-equiv f)\n          ( identity A)\n          ( second (first is-equiv-f))\n          ( section-is-equiv)))\n      ( postwhisker-homotopy B B A\n        ( comp B A B f section-is-equiv)\n        ( identity B)\n        ( second (second is-equiv-f))\n        ( retraction-is-equiv))\n#end equivalence-data\n
"},{"location":"hott/03-equivalences.rzk/#invertible-maps","title":"Invertible maps","text":"

The following type of more coherent equivalences is not a proposition.

#def has-inverse\n( A B : U)\n( f : A \u2192 B)\n  : U\n  :=\n\u03a3 ( g : B \u2192 A) ,\n      ( product\n        ( homotopy A A (comp A B A g f) (identity A))\n        ( homotopy B B (comp B A B f g) (identity B)))\n
"},{"location":"hott/03-equivalences.rzk/#equivalences-are-invertible-maps","title":"Equivalences are invertible maps","text":"Invertible maps are equivalences
#def is-equiv-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : is-equiv A B f\n  :=\n    ( ( first has-inverse-f , first (second has-inverse-f)) ,\n      ( first has-inverse-f , second (second has-inverse-f)))\n
Equivalences are invertible
#def has-inverse-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : has-inverse A B f\n  :=\n    ( section-is-equiv A B f is-equiv-f ,\n      ( concat-homotopy A A\n        ( comp A B A (section-is-equiv A B f is-equiv-f) f)\n        ( comp A B A (retraction-is-equiv A B f is-equiv-f) f)\n        ( identity A)\n        ( prewhisker-homotopy A B A\n          ( section-is-equiv A B f is-equiv-f)\n          ( retraction-is-equiv A B f is-equiv-f)\n          ( homotopy-section-retraction-is-equiv A B f is-equiv-f)\n          ( f))\n        ( second (first is-equiv-f)) ,\n      ( second (second is-equiv-f))))\n
"},{"location":"hott/03-equivalences.rzk/#invertible-map-data","title":"Invertible map data","text":"
#section has-inverse-data\n#variables A B : U\n#variable f : A \u2192 B\n#variable has-inverse-f : has-inverse A B f\n
The inverse of a map with an inverse
#def map-inverse-has-inverse uses (f)\n  : B \u2192 A\n  := first (has-inverse-f)\n

The following are some iterated composites associated to a pair of invertible maps.

#def retraction-composite-has-inverse uses (B has-inverse-f)\n  : A \u2192 A\n  := comp A B A map-inverse-has-inverse f\n#def section-composite-has-inverse uses (A has-inverse-f)\n  : B \u2192 B\n  := comp B A B f map-inverse-has-inverse\n

This composite is parallel to f; we won't need the dual notion.

#def triple-composite-has-inverse uses (has-inverse-f)\n  : A \u2192 B\n  := triple-comp A B A B f map-inverse-has-inverse f\n

This composite is also parallel to f; again we won't need the dual notion.

#def quintuple-composite-has-inverse uses (has-inverse-f)\n  : A \u2192 B\n  := \\ a \u2192 f (map-inverse-has-inverse (f (map-inverse-has-inverse (f a))))\n#end has-inverse-data\n
"},{"location":"hott/03-equivalences.rzk/#symmetry-of-having-an-inverse","title":"Symmetry of having an inverse","text":"

The inverse of an invertible map has an inverse.

#def has-inverse-map-inverse-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : has-inverse B A ( map-inverse-has-inverse A B f has-inverse-f)\n  :=\n    ( f,\n      ( second ( second has-inverse-f) ,\nfirst ( second has-inverse-f)))\n
"},{"location":"hott/03-equivalences.rzk/#composing-equivalences","title":"Composing equivalences","text":"

The type of equivalences between types uses is-equiv rather than has-inverse.

#def Equiv\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B) , (is-equiv A B f)\n

The data of an equivalence is not symmetric so we promote an equivalence to an invertible map to prove symmetry:

#def inv-equiv\n( A B : U)\n( e : Equiv A B)\n  : Equiv B A\n  :=\n    ( first (has-inverse-is-equiv A B (first e) (second e)) ,\n      ( ( first e ,\nsecond (second (has-inverse-is-equiv A B (first e) (second e)))) ,\n        ( first e ,\nfirst (second (has-inverse-is-equiv A B (first e) (second e))))))\n
Composition of equivalences in diagrammatic order
#def equiv-comp\n( A B C : U)\n( A\u2243B : Equiv A B)\n( B\u2243C : Equiv B C)\n  : Equiv A C\n  :=\n    ( ( \\ a \u2192 first B\u2243C (first A\u2243B a)) ,\n      ( ( ( \\ c \u2192 first (first (second A\u2243B)) (first (first (second (B\u2243C))) c)) ,\n          ( \\ a \u2192\n            concat A\n              ( first\n                ( first (second A\u2243B))\n                ( first\n                  ( first (second B\u2243C))\n                  ( first B\u2243C (first A\u2243B a))))\n              ( first (first (second A\u2243B)) (first A\u2243B a))\n              ( a)\n              ( ap B A\n                ( first (first (second B\u2243C)) (first B\u2243C (first A\u2243B a)))\n                ( first A\u2243B a)\n                ( first (first (second A\u2243B)))\n                ( second (first (second B\u2243C)) (first A\u2243B a)))\n              ( second (first (second A\u2243B)) a))) ,\n        ( ( \\ c \u2192\nfirst\n            ( second (second A\u2243B))\n            ( first (second (second (B\u2243C))) c)) ,\n          ( \\ c \u2192\n            concat C\n              ( first B\u2243C\n                ( first A\u2243B\n                  ( first\n                    ( second (second A\u2243B))\n                    ( first (second (second B\u2243C)) c))))\n              ( first B\u2243C (first (second (second B\u2243C)) c))\n              ( c)\n              ( ap B C\n                ( first A\u2243B\n                  ( first\n                    ( second (second A\u2243B))\n                    ( first (second (second B\u2243C)) c)))\n                ( first (second (second B\u2243C)) c)\n                ( first B\u2243C)\n                ( second\n                  ( second (second A\u2243B))\n                  ( first (second (second B\u2243C)) c)))\n              ( second (second (second B\u2243C)) c)))))\n

Now we compose the functions that are equivalences.

#def is-equiv-comp\n( A B C : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( g : B \u2192 C)\n( is-equiv-g : is-equiv B C g)\n  : is-equiv A C (comp A B C g f)\n  :=\n    ( ( comp C B A\n        ( retraction-is-equiv A B f is-equiv-f)\n        ( retraction-is-equiv B C g is-equiv-g) ,\n        ( \\ a \u2192\n          concat A\n            ( retraction-is-equiv A B f is-equiv-f\n              ( retraction-is-equiv B C g is-equiv-g (g (f a))))\n            ( retraction-is-equiv A B f is-equiv-f (f a))\n            ( a)\n            ( ap B A\n              ( retraction-is-equiv B C g is-equiv-g (g (f a)))\n              ( f a)\n              ( retraction-is-equiv A B f is-equiv-f)\n              ( second (first is-equiv-g) (f a)))\n            ( second (first is-equiv-f) a))) ,\n      ( comp C B A\n        ( section-is-equiv A B f is-equiv-f)\n        ( section-is-equiv B C g is-equiv-g) ,\n        ( \\ c \u2192\n          concat C\n            ( g (f (first (second is-equiv-f) (first (second is-equiv-g) c))))\n            ( g (first (second is-equiv-g) c))\n            ( c)\n            ( ap B C\n              ( f (first (second is-equiv-f) (first (second is-equiv-g) c)))\n              ( first (second is-equiv-g) c)\n              ( g)\n              ( second (second is-equiv-f) (first (second is-equiv-g) c)))\n            ( second (second is-equiv-g) c))))\n
Right cancellation of equivalences in diagrammatic order
#def equiv-right-cancel\n( A B C : U)\n( A\u2243C : Equiv A C)\n( B\u2243C : Equiv B C)\n  : Equiv A B\n  := equiv-comp A C B (A\u2243C) (inv-equiv B C B\u2243C)\n
Left cancellation of equivalences in diagrammatic order
#def equiv-left-cancel\n( A B C : U)\n( A\u2243B : Equiv A B)\n( A\u2243C : Equiv A C)\n  : Equiv B C\n  := equiv-comp B A C (inv-equiv A B A\u2243B) (A\u2243C)\n

The following functions refine equiv-right-cancel and equiv-left-cancel by providing control over the underlying maps of the equivalence. They also weaken the hypotheses: if a composite is an equivalence and the second map has a retraction the first map is an equivalence, and dually.

#def ap-cancel-has-retraction\n( B C : U)\n( g : B \u2192 C)\n  ( (retr-g, \u03b7-g) : has-retraction B C g)\n( b b' : B)\n  : (g b = g b') \u2192 (b = b')\n  :=\n\\ gp \u2192\n      triple-concat B b (retr-g (g b)) (retr-g (g b')) b'\n        (rev B (retr-g (g b)) b\n          (\u03b7-g b))\n        (ap C B (g b) (g b') retr-g gp)\n        (\u03b7-g b')\n
Right cancellation of equivalence property in diagrammatic order
#def is-equiv-right-cancel\n( A B C : U)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( has-retraction-g : has-retraction B C g)\n  ( ( (retr-gf, \u03b7-gf), (sec-gf, \u03b5-gf)) : is-equiv A C (comp A B C g f))\n  : is-equiv A B f\n  :=\n    ( ( comp B C A retr-gf g, \u03b7-gf) ,\n      ( comp B C A sec-gf g ,\n\\ b \u2192\n            ap-cancel-has-retraction B C g\n            has-retraction-g (f (sec-gf (g b))) b\n            ( \u03b5-gf (g b))\n      )\n    )\n
Left cancellation of equivalence property in diagrammatic order
#def is-equiv-left-cancel\n( A B C : U)\n( f : A \u2192 B)\n( has-section-f : has-section A B f)\n( g : B \u2192 C)\n  ( ( ( retr-gf, \u03b7-gf), (sec-gf, \u03b5-gf)) : is-equiv A C (comp A B C g f))\n  : is-equiv B C g\n  :=\n    ( ( comp C A B f retr-gf ,\n        ind-has-section A B f has-section-f\n          ( \\ b \u2192 f (retr-gf (g b)) = b)\n          ( \\ a \u2192 ap A B (retr-gf (g ( f a))) a f (\u03b7-gf a))\n      ) ,\n      ( comp C A B f sec-gf, \u03b5-gf)\n    )\n

We typically apply the cancelation property in a setting where the composite and one map are known to be equivalences, so we define versions of the above functions with these stronger hypotheses.

#def is-equiv-right-factor\n( A B C : U)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( is-equiv-g : is-equiv B C g)\n( is-equiv-gf : is-equiv A C (comp A B C g f))\n  : is-equiv A B f\n  :=\n    is-equiv-right-cancel A B C f g (first is-equiv-g) is-equiv-gf\n#def is-equiv-left-factor\n( A B C : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( g : B \u2192 C)\n( is-equiv-gf : is-equiv A C (comp A B C g f))\n  : is-equiv B C g\n  :=\n    is-equiv-left-cancel A B C f (second is-equiv-f) g is-equiv-gf\n
A composition of three equivalences
#def equiv-triple-comp\n( A B C D : U)\n( A\u2243B : Equiv A B)\n( B\u2243C : Equiv B C)\n( C\u2243D : Equiv C D)\n  : Equiv A D\n  := equiv-comp A B D (A\u2243B) (equiv-comp B C D B\u2243C C\u2243D)\n#def is-equiv-triple-comp\n( A B C D : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( g : B \u2192 C)\n( is-equiv-g : is-equiv B C g)\n( h : C \u2192 D)\n( is-equiv-h : is-equiv C D h)\n  : is-equiv A D (triple-comp A B C D h g f)\n  :=\n    is-equiv-comp A B D\n      ( f)\n      ( is-equiv-f)\n      ( comp B C D h g)\n      ( is-equiv-comp B C D g is-equiv-g h is-equiv-h)\n
"},{"location":"hott/03-equivalences.rzk/#equivalences-and-homotopy","title":"Equivalences and homotopy","text":"

If a map is homotopic to an equivalence it is an equivalence.

#def is-equiv-homotopy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( is-equiv-g : is-equiv A B g)\n  : is-equiv A B f\n  :=\n    ( ( ( first (first is-equiv-g)) ,\n        ( \\ a \u2192\n          concat A\n            ( first (first is-equiv-g) (f a))\n            ( first (first is-equiv-g) (g a))\n            ( a)\n            ( ap B A (f a) (g a) (first (first is-equiv-g)) (H a))\n            ( second (first is-equiv-g) a))) ,\n      ( ( first (second is-equiv-g)) ,\n        ( \\ b \u2192\n          concat B\n            ( f (first (second is-equiv-g) b))\n            ( g (first (second is-equiv-g) b))\n            ( b)\n            ( H (first (second is-equiv-g) b))\n            ( second (second is-equiv-g) b))))\n#def is-equiv-rev-homotopy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( is-equiv-f : is-equiv A B f)\n  : is-equiv A B g\n  := is-equiv-homotopy A B g f (rev-homotopy A B f g H) is-equiv-f\n
"},{"location":"hott/03-equivalences.rzk/#reversing-equivalences","title":"Reversing equivalences","text":"

The section associated with an equivalence is an equivalence.

#def is-equiv-section-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-equiv B A ( section-is-equiv A B f is-equiv-f)\n  :=\n    is-equiv-has-inverse B A\n      ( section-is-equiv A B f is-equiv-f)\n      ( has-inverse-map-inverse-has-inverse A B f\n        ( has-inverse-is-equiv A B f is-equiv-f))\n

The retraction associated with an equivalence is an equivalence.

#def is-equiv-retraction-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-equiv B A ( retraction-is-equiv A B f is-equiv-f)\n  :=\n    is-equiv-rev-homotopy B A\n      ( section-is-equiv A B f is-equiv-f)\n      ( retraction-is-equiv A B f is-equiv-f)\n      ( homotopy-section-retraction-is-equiv A B f is-equiv-f)\n      ( is-equiv-section-is-equiv A B f is-equiv-f)\n
"},{"location":"hott/03-equivalences.rzk/#function-extensionality","title":"Function extensionality","text":"

By path induction, an identification between functions defines a homotopy.

#def htpy-eq\n( X : U)\n( A : X \u2192 U)\n( f g : (x : X) \u2192 A x)\n( p : f = g)\n  : (x : X) \u2192 (f x = g x)\n  :=\n    ind-path\n( (x : X) \u2192 A x)\n      ( f)\n( \\ g' p' \u2192 (x : X) \u2192 (f x = g' x))\n      ( \\ x \u2192 refl)\n      ( g)\n      ( p)\n

The function extensionality axiom asserts that this map defines a family of equivalences.

The type that encodes the function extensionality axiom
#def FunExt : U\n  :=\n( X : U) \u2192\n( A : X \u2192 U) \u2192\n( f : (x : X) \u2192 A x) \u2192\n( g : (x : X) \u2192 A x) \u2192\n    is-equiv (f = g) ((x : X) \u2192 f x = g x) (htpy-eq X A f g)\n

In the formalisations below, some definitions will assume function extensionality:

#assume funext : FunExt\n

Whenever a definition (implicitly) uses function extensionality, we write uses (funext). In particular, the following definitions rely on function extensionality:

The equivalence provided by function extensionality
#def equiv-FunExt uses (funext)\n( X : U)\n( A : X \u2192 U)\n( f g : (x : X) \u2192 A x)\n  : Equiv (f = g) ((x : X) \u2192 f x = g x)\n  := (htpy-eq X A f g , funext X A f g)\n

In particular, function extensionality implies that homotopies give rise to identifications. This defines eq-htpy to be the retraction to htpy-eq.

#def eq-htpy uses (funext)\n( X : U)\n( A : X \u2192 U)\n( f g : (x : X) \u2192 A x)\n  : ((x : X) \u2192 f x = g x) \u2192 (f = g)\n  := first (first (funext X A f g))\n

Using function extensionality, a fiberwise equivalence defines an equivalence of dependent function types.

#def is-equiv-function-is-equiv-family uses (funext)\n( X : U)\n( A B : X \u2192 U)\n( f : (x : X) \u2192 (A x) \u2192 (B x))\n( famisequiv : (x : X) \u2192 is-equiv (A x) (B x) (f x))\n  : is-equiv ((x : X) \u2192 A x) ((x : X) \u2192 B x) ( \\ a x \u2192 f x (a x))\n  :=\n    ( ( ( \\ b x \u2192 first (first (famisequiv x)) (b x)) ,\n        ( \\ a \u2192\n           eq-htpy\n            X A\n           ( \\ x \u2192\nfirst\n                ( first (famisequiv x))\n                ( f x (a x)))\n            ( a)\n            ( \\ x \u2192 second (first (famisequiv x)) (a x)))) ,\n      ( ( \\ b x \u2192 first (second (famisequiv x)) (b x)) ,\n        ( \\ b \u2192\n            eq-htpy\n            X B\n            ( \\ x \u2192\n               f x (first (second (famisequiv x)) (b x)))\n            ( b)\n            ( \\ x \u2192 second (second (famisequiv x)) (b x)))))\n
#def equiv-function-equiv-family uses (funext)\n( X : U)\n( A B : X \u2192 U)\n( famequiv : (x : X) \u2192 Equiv (A x) (B x))\n  : Equiv ((x : X) \u2192 A x) ((x : X) \u2192 B x)\n  :=\n    ( ( \\ a x \u2192 (first (famequiv x)) (a x)) ,\n      ( is-equiv-function-is-equiv-family\n        ( X)\n        ( A)\n        ( B)\n        ( \\ x ax \u2192 first (famequiv x) (ax))\n        ( \\ x \u2192 second (famequiv x))))\n
"},{"location":"hott/03-equivalences.rzk/#embeddings","title":"Embeddings","text":"
#def is-emb\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := (x : A) \u2192 (y : A) \u2192 is-equiv (x = y) (f x = f y) (ap A B x y f)\n#def Emb\n( A B : U)\n  : U\n  := (\u03a3 (f : A \u2192 B) , is-emb A B f)\n#def is-emb-is-inhabited-emb\n( A B : U)\n( f : A \u2192 B)\n( e : A \u2192 is-emb A B f)\n  : is-emb A B f\n  := \\ x y \u2192 e x x y\n#def inv-ap-is-emb\n( A B : U)\n( f : A \u2192 B)\n( is-emb-f : is-emb A B f)\n( x y : A)\n( p : f x = f y)\n  : (x = y)\n  := first (first (is-emb-f x y)) p\n
"},{"location":"hott/03-equivalences.rzk/#reversal-is-an-equivalence","title":"Reversal is an equivalence","text":"
#def equiv-rev\n( A : U)\n( x y : A)\n  : Equiv (x = y) (y = x)\n  := (rev A x y , ((rev A y x , rev-rev A x y) , (rev A y x , rev-rev A y x)))\n
"},{"location":"hott/03-equivalences.rzk/#concatenation-with-a-fixed-path-is-an-equivalence","title":"Concatenation with a fixed path is an equivalence","text":"
#def equiv-preconcat\n( A : U)\n( x y z : A)\n( p : x = y)\n  : Equiv (y = z) (x = z)\n  :=\n    ( concat A x y z p,\n      ( ( concat A y x z (rev A x y p), retraction-preconcat A x y z p),\n        ( concat A y x z (rev A x y p), section-preconcat A x y z p)))\n#def equiv-postconcat\n( A : U)\n( x y z : A)\n( q : y = z) : Equiv (x = y) (x = z)\n  :=\n    ( \\ p \u2192 concat A x y z p q,\n      ( ( \\ r \u2192 concat A x z y r (rev A y z q),\n          retraction-postconcat A x y z q),\n        ( \\ r \u2192 concat A x z y r (rev A y z q),\n          section-postconcat A x y z q)))\n
"},{"location":"hott/03-equivalences.rzk/#transport-along-a-path-is-an-equivalence","title":"Transport along a path is an equivalence","text":"
#def is-equiv-transport\n( A : U)\n( C : A \u2192 U)\n( x : A)\n  : (y : A) \u2192 ( p : x = y) \u2192 is-equiv (C x) (C y) (transport A C x y p)\n  := ind-path A x\n       ( \\ y p \u2192 is-equiv (C x) (C y) (transport A C x y p))\n       ( is-equiv-identity (C x) )\n
"},{"location":"hott/03-equivalences.rzk/#equivalence-is-equivalence-invariant","title":"Equivalence is equivalence invariant","text":"
#def map-of-maps\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  : U\n  :=\n\u03a3 ( ( s',s) : product ( A' \u2192 B' ) ( A \u2192 B)),\n( ( a' : A') \u2192 \u03b2 ( s' a') = s ( \u03b1 a'))\n#def Equiv-of-maps\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  : U\n  :=\n\u03a3 ( ((s', s), _) : map-of-maps A' A \u03b1 B' B \u03b2),\n      ( product\n          ( is-equiv A' B' s')\n          ( is-equiv A B s)\n      )\n#def is-equiv-equiv-is-equiv\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ((s', s), \u03b7) : map-of-maps A' A \u03b1 B' B \u03b2)\n( is-equiv-s' : is-equiv A' B' s')\n( is-equiv-s : is-equiv A B s)\n( is-equiv-\u03b2 : is-equiv B' B \u03b2)\n  : is-equiv A' A \u03b1\n  :=\n    is-equiv-right-factor A' A B \u03b1 s is-equiv-s\n      ( is-equiv-rev-homotopy A' B\n          ( comp A' B' B \u03b2 s')\n          ( comp A' A B s \u03b1)\n          ( \u03b7 )\n          ( is-equiv-comp A' B' B s' is-equiv-s' \u03b2 is-equiv-\u03b2)\n      )\n#def is-equiv-Equiv-is-equiv\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ( S, (is-equiv-s',is-equiv-s)) : Equiv-of-maps A' A \u03b1 B' B \u03b2 )\n  : is-equiv B' B \u03b2 \u2192 is-equiv A' A \u03b1\n  :=\n    is-equiv-equiv-is-equiv A' A \u03b1 B' B \u03b2 S is-equiv-s' is-equiv-s\n#def is-equiv-equiv-is-equiv'\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ((s', s), \u03b7) : map-of-maps A' A \u03b1 B' B \u03b2)\n( is-equiv-s' : is-equiv A' B' s')\n( is-equiv-s : is-equiv A B s)\n( is-equiv-\u03b1 : is-equiv A' A \u03b1)\n  : is-equiv B' B \u03b2\n  :=\n    is-equiv-left-factor A' B' B s' is-equiv-s' \u03b2\n      ( is-equiv-homotopy A' B\n        ( comp A' B' B \u03b2 s')\n        ( comp A' A B s \u03b1)\n        ( \u03b7)\n        ( is-equiv-comp A' A B \u03b1 is-equiv-\u03b1 s is-equiv-s)\n      )\n#def is-equiv-Equiv-is-equiv'\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ( S, (is-equiv-s',is-equiv-s)) : Equiv-of-maps A' A \u03b1 B' B \u03b2 )\n  : is-equiv A' A \u03b1 \u2192 is-equiv B' B \u03b2\n  :=\n    is-equiv-equiv-is-equiv' A' A \u03b1 B' B \u03b2 S is-equiv-s' is-equiv-s\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/","title":"4. Half Adjoint Equivalences","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#half-adjoint-equivalences","title":"Half adjoint equivalences","text":"

We'll require a more coherent notion of equivalence. Namely, the notion of half adjoint equivalences.

#def is-half-adjoint-equiv\n( A B : U)\n( f : A \u2192 B)\n  : U\n  :=\n\u03a3 ( has-inverse-f : (has-inverse A B f)) ,\n( ( a : A) \u2192\n        ( second (second has-inverse-f) (f a)) =\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f a)\n          ( a)\n          ( f)\n          ( first (second has-inverse-f) a)))\n

By function extensionality, the previous definition coincides with the following one:

#def is-half-adjoint-equiv'\n(A B : U)\n(f : A \u2192 B)\n  : U\n  :=\n\u03a3 ( has-inverse-f : (has-inverse A B f)) ,\n( ( a : A) \u2192\n        ( second (second has-inverse-f) (f a)) =\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f a)\n          ( a)\n          ( f)\n          ( first (second has-inverse-f) a)))\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#half-adjoint-equivalence-data","title":"Half adjoint equivalence data","text":"
#section half-adjoint-equivalence-data\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-hae-f : is-half-adjoint-equiv A B f\n#def map-inverse-is-half-adjoint-equiv uses (f)\n  : B \u2192 A\n  := map-inverse-has-inverse A B f (first is-hae-f)\n#def retraction-htpy-is-half-adjoint-equiv\n  : homotopy A A (comp A B A map-inverse-is-half-adjoint-equiv f) (identity A)\n  := first (second (first is-hae-f))\n#def section-htpy-is-half-adjoint-equiv\n  : homotopy B B (comp B A B f map-inverse-is-half-adjoint-equiv) (identity B)\n  := second (second (first is-hae-f))\n#def coherence-is-half-adjoint-equiv\n( a : A)\n  : section-htpy-is-half-adjoint-equiv (f a) =\n    ap A B (map-inverse-is-half-adjoint-equiv (f a)) a f\n    ( retraction-htpy-is-half-adjoint-equiv a)\n  := (second is-hae-f) a\n#end half-adjoint-equivalence-data\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#coherence-data-from-an-invertible-map","title":"Coherence data from an invertible map","text":"

To promote an invertible map to a half adjoint equivalence we keep one homotopy and discard the other.

#def has-inverse-kept-htpy\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : homotopy A A\n    ( retraction-composite-has-inverse A B f has-inverse-f) (identity A)\n  := ( first (second has-inverse-f))\n#def has-inverse-discarded-htpy\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : homotopy B B\n    ( section-composite-has-inverse A B f has-inverse-f) (identity B)\n  := (second (second has-inverse-f))\n

The required coherence will be built by transforming an instance of the following naturality square.

#section has-inverse-coherence\n#variables A B : U\n#variable f : A \u2192 B\n#variable has-inverse-f : has-inverse A B f\n#variable a : A\n#def has-inverse-discarded-naturality-square\n  : concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n    ( triple-composite-has-inverse A B f has-inverse-f a)\n    ( f a)\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( triple-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n    ( has-inverse-discarded-htpy A B f has-inverse-f (f a)) =\n    concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n      ( triple-composite-has-inverse A B f has-inverse-f a)\n      ( f a)\n      ( has-inverse-discarded-htpy A B f has-inverse-f\n        ( triple-composite-has-inverse A B f has-inverse-f a))\n      ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n        f (has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    nat-htpy A B\n    ( triple-composite-has-inverse A B f has-inverse-f)\n    ( f)\n    ( \\ x \u2192 has-inverse-discarded-htpy A B f has-inverse-f (f x))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( a)\n    ( has-inverse-kept-htpy A B f has-inverse-f a)\n

We build a path that will be whiskered into the naturality square above:

#def has-inverse-cocone-homotopy-coherence\n  : has-inverse-kept-htpy A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a) =\n    ap A A (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( retraction-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a)\n  :=\n    cocone-naturality-coherence\n      ( A)\n      ( retraction-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f)\n      ( a)\n#def has-inverse-ap-cocone-homotopy-coherence\n  : ap A B\n    ( retraction-composite-has-inverse A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( f)\n    ( has-inverse-kept-htpy A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a)) =\n    ap A B\n    ( retraction-composite-has-inverse A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( f)\n    ( ap A A (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( retraction-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    ap-eq A B\n      ( retraction-composite-has-inverse A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a))\n      ( retraction-composite-has-inverse A B f has-inverse-f a)\n      ( f)\n      ( has-inverse-kept-htpy A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a))\n      ( ap A A (retraction-composite-has-inverse A B f has-inverse-f a) a\n        ( retraction-composite-has-inverse A B f has-inverse-f)\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n      ( has-inverse-cocone-homotopy-coherence)\n#def has-inverse-cocone-coherence\n  : ap A B\n    ( retraction-composite-has-inverse A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( f)\n    ( has-inverse-kept-htpy A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a)) =\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( triple-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    concat\n      ( quintuple-composite-has-inverse A B f has-inverse-f a =\n        triple-composite-has-inverse A B f has-inverse-f a)\n      ( ap A B\n        ( retraction-composite-has-inverse A B f has-inverse-f\n          ( retraction-composite-has-inverse A B f has-inverse-f a))\n        ( retraction-composite-has-inverse A B f has-inverse-f a)\n        ( f)\n        ( has-inverse-kept-htpy A B f has-inverse-f\n          ( retraction-composite-has-inverse A B f has-inverse-f a)))\n      ( ap A B\n        ( retraction-composite-has-inverse A B f has-inverse-f\n          ( retraction-composite-has-inverse A B f has-inverse-f a))\n        ( retraction-composite-has-inverse A B f has-inverse-f a)\n        ( f)\n        ( ap A A\n          ( retraction-composite-has-inverse A B f has-inverse-f a) a\n          ( retraction-composite-has-inverse A B f has-inverse-f)\n          ( has-inverse-kept-htpy A B f has-inverse-f a)))\n      ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n        ( triple-composite-has-inverse A B f has-inverse-f)\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n      ( has-inverse-ap-cocone-homotopy-coherence)\n      ( rev-ap-comp A A B\n        ( retraction-composite-has-inverse A B f has-inverse-f a) a\n        ( retraction-composite-has-inverse A B f has-inverse-f)\n        ( f)\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n

This morally gives the half adjoint inverse coherence. It just requires rotation.

#def has-inverse-replaced-naturality-square\n  : concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n    ( triple-composite-has-inverse A B f has-inverse-f a)\n    ( f a)\n    ( ap A B\n      ( retraction-composite-has-inverse A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a))\n      ( retraction-composite-has-inverse A B f has-inverse-f a)\n      ( f)\n      ( has-inverse-kept-htpy A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a)))\n    ( has-inverse-discarded-htpy A B f has-inverse-f (f a)) =\n    concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n    ( triple-composite-has-inverse A B f has-inverse-f a)\n    ( f a)\n    ( has-inverse-discarded-htpy A B f has-inverse-f\n      ( triple-composite-has-inverse A B f has-inverse-f a))\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    concat\n      ( quintuple-composite-has-inverse A B f has-inverse-f a = f a)\n      ( concat B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a)\n        ( f a)\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a))\n          ( retraction-composite-has-inverse A B f has-inverse-f a) f\n          ( has-inverse-kept-htpy A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a)))\n        ( has-inverse-discarded-htpy A B f has-inverse-f (f a)))\n      ( concat B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a)\n        ( f a)\n        ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n          ( triple-composite-has-inverse A B f has-inverse-f)\n          ( has-inverse-kept-htpy A B f has-inverse-f a))\n        ( has-inverse-discarded-htpy A B f has-inverse-f (f a)))\n      ( concat B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a) (f a)\n        ( has-inverse-discarded-htpy A B f has-inverse-f\n          ( triple-composite-has-inverse A B f has-inverse-f a))\n        ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n          ( has-inverse-kept-htpy A B f has-inverse-f a)))\n      ( concat-eq-left B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a)\n        ( f a)\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a))\n          ( retraction-composite-has-inverse A B f has-inverse-f a)\n          ( f)\n          ( has-inverse-kept-htpy A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a)))\n        ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n          ( triple-composite-has-inverse A B f has-inverse-f)\n          ( has-inverse-kept-htpy A B f has-inverse-f a))\n        ( has-inverse-cocone-coherence)\n        ( has-inverse-discarded-htpy A B f has-inverse-f (f a)))\n      ( has-inverse-discarded-naturality-square)\n

This will replace the discarded homotopy.

#def has-inverse-corrected-htpy\n  : homotopy B B (section-composite-has-inverse A B f has-inverse-f) (\\ b \u2192 b)\n  :=\n\\ b \u2192\n      concat B\n        ( (section-composite-has-inverse A B f has-inverse-f) b)\n        ( (section-composite-has-inverse A B f has-inverse-f)\n          ((section-composite-has-inverse A B f has-inverse-f) b))\n        ( b)\n        ( rev B\n          ( (section-composite-has-inverse A B f has-inverse-f)\n            ((section-composite-has-inverse A B f has-inverse-f) b))\n          ( (section-composite-has-inverse A B f has-inverse-f) b)\n          ( has-inverse-discarded-htpy A B f has-inverse-f\n            ((section-composite-has-inverse A B f has-inverse-f) b)))\n        ( concat B\n          ( (section-composite-has-inverse A B f has-inverse-f)\n            ((section-composite-has-inverse A B f has-inverse-f) b))\n          ( (section-composite-has-inverse A B f has-inverse-f) b)\n          ( b)\n          ( ap A B\n            ( (retraction-composite-has-inverse A B f has-inverse-f)\n              (map-inverse-has-inverse A B f has-inverse-f b))\n            ( map-inverse-has-inverse A B f has-inverse-f b) f\n            ( (first (second has-inverse-f))\n              (map-inverse-has-inverse A B f has-inverse-f b)))\n          ( (has-inverse-discarded-htpy A B f has-inverse-f b)))\n

The following is the half adjoint coherence.

#def has-inverse-coherence\n  : ( has-inverse-corrected-htpy (f a)) =\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    triangle-rotation B\n      ( quintuple-composite-has-inverse A B f has-inverse-f a)\n      ( triple-composite-has-inverse A B f has-inverse-f a)\n      ( f a)\n      ( concat B\n        ( (section-composite-has-inverse A B f has-inverse-f)\n          ((section-composite-has-inverse A B f has-inverse-f) (f a)))\n        ( (section-composite-has-inverse A B f has-inverse-f) (f a))\n        ( f a)\n        ( ap A B\n          ( (retraction-composite-has-inverse A B f has-inverse-f)\n            (map-inverse-has-inverse A B f has-inverse-f (f a)))\n          ( map-inverse-has-inverse A B f has-inverse-f (f a))\n            ( f)\n            ( (first (second has-inverse-f))\n              (map-inverse-has-inverse A B f has-inverse-f (f a))))\n        ( (has-inverse-discarded-htpy A B f has-inverse-f (f a))))\n      ( has-inverse-discarded-htpy A B f has-inverse-f\n        ( triple-composite-has-inverse A B f has-inverse-f a))\n      ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n      ( has-inverse-replaced-naturality-square)\n
#end has-inverse-coherence\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#invertible-maps-are-half-adjoint-equivalences","title":"Invertible maps are half adjoint equivalences","text":"

To promote an invertible map to a half adjoint equivalence we change the data of the invertible map by discarding the homotopy and replacing it with a corrected one.

#def corrected-has-inverse-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : has-inverse A B f\n  :=\n    ( map-inverse-has-inverse A B f has-inverse-f ,\n      ( has-inverse-kept-htpy A B f has-inverse-f ,\n        has-inverse-corrected-htpy A B f has-inverse-f))\n
Invertible maps are half adjoint equivalences!
#def is-half-adjoint-equiv-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : is-half-adjoint-equiv A B f\n  :=\n    ( corrected-has-inverse-has-inverse A B f has-inverse-f ,\n      has-inverse-coherence A B f has-inverse-f)\n
Equivalences are half adjoint equivalences!
#def is-half-adjoint-equiv-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-half-adjoint-equiv A B f\n  :=\n    is-half-adjoint-equiv-has-inverse A B f\n      ( has-inverse-is-equiv A B f is-equiv-f)\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#equivalences-are-embeddings","title":"Equivalences are embeddings","text":"

We use the notion of half adjoint equivalence to prove that equivalent types have equivalent identity types by showing that equivalences are embeddings.

#section equiv-identity-types-equiv\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-hae-f : is-half-adjoint-equiv A B f\n#def iff-ap-is-half-adjoint-equiv\n( x y : A)\n  : iff (x = y) (f x = f y)\n  :=\n    ( ap A B x y f ,\n\\ q \u2192\n      triple-concat A\n        ( x)\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( y)\n        ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n          ( (first (second (first is-hae-f))) x))\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q)\n        ( (first (second (first is-hae-f))) y))\n#def has-retraction-ap-is-half-adjoint-equiv\n(x y : A)\n  : has-retraction (x = y) (f x = f y) (ap A B x y f)\n  :=\n    ( ( second (iff-ap-is-half-adjoint-equiv x y)) ,\n      ( ind-path\n          ( A)\n          ( x)\n          ( \\ y' p' \u2192\n            ( second (iff-ap-is-half-adjoint-equiv x y')) (ap A B x y' f p') =\n            ( p'))\n          ( rev-refl-id-triple-concat A\n            ( map-inverse-has-inverse A B f (first is-hae-f) (f x))\n            ( x)\n            ( first (second (first is-hae-f)) x))\n          ( y)))\n#def ap-triple-concat-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : ap A B x y f ((second (iff-ap-is-half-adjoint-equiv x y)) q) =\n    (triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( ap A B x ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n        ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n          ( (first (second (first is-hae-f))) x)))\n      ( ap A B\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( f)\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n        ( (first (second (first is-hae-f))) y)))\n  :=\n    ap-triple-concat A B\n      ( x)\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( y)\n      ( f)\n      ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n        ( (first (second (first is-hae-f))) x))\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q)\n      ( (first (second (first is-hae-f))) y)\n#def ap-rev-triple-concat-eq-first-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( ap A B x ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n      (rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n        ( (first (second (first is-hae-f))) x)))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( f)\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n    ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n      ( (first (second (first is-hae-f))) y)) =\n    triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n        ( (first (second (first is-hae-f))) x)))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( f)\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( y)\n      ( f)\n      ( (first (second (first is-hae-f))) y))\n  :=\n    triple-concat-eq-first B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( ap A B\n      ( x) ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n      ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n        ( (first (second (first is-hae-f))) x)))\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n        ( (first (second (first is-hae-f))) x)))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( f)\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n    ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n      ( (first (second (first is-hae-f))) y))\n    ( ap-rev A B (retraction-composite-has-inverse A B f (first is-hae-f) x) x f\n      ( (first (second (first is-hae-f))) x))\n#def ap-ap-triple-concat-eq-first-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : (triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B\n        ( f (retraction-composite-has-inverse A B f (first is-hae-f) x))\n        ( f x)\n        ( ap A B\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n          ( (first (second (first is-hae-f))) x)))\n      ( ap A B\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( f)\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n        ( (first (second (first is-hae-f))) y))) =\n    ( triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B\n        ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n          ( (first (second (first is-hae-f))) x)))\n      ( ap B B (f x) (f y)\n        ( section-composite-has-inverse A B f (first is-hae-f)) q)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y\n        ( f) ((first (second (first is-hae-f))) y)))\n  :=\n    triple-concat-eq-second B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n          ( (first (second (first is-hae-f))) x)))\n      ( ap A B\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( f)\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n      ( ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n        ( (first (second (first is-hae-f))) y))\n      ( rev-ap-comp B A B (f x) (f y)\n        ( map-inverse-has-inverse A B f (first is-hae-f)) f q)\n-- This needs to be reversed later.\n#def triple-concat-higher-homotopy-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        ( (second (second (first is-hae-f))) (f x)))\n      ( ap B B (f x) (f y)\n        ( section-composite-has-inverse A B f (first is-hae-f)) q)\n      ( (second (second (first is-hae-f))) (f y)) =\n    triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      (rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        (ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f ((first (second (first is-hae-f))) x)))\n        (ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n        (ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f ((first (second (first is-hae-f))) y))\n  :=\n    triple-concat-higher-homotopy A B\n      ( triple-composite-has-inverse A B f (first is-hae-f)) f\n      ( \\ a \u2192 (((second (second (first is-hae-f)))) (f a)))\n      ( \\ a \u2192\n        ( ap A B (retraction-composite-has-inverse A B f (first is-hae-f) a) a f\n          ( ((first (second (first is-hae-f)))) a)))\n      ( second is-hae-f)\n      ( x)\n      ( y)\n      ( ap B B (f x) (f y)\n        ( section-composite-has-inverse A B f (first is-hae-f)) q)\n#def triple-concat-nat-htpy-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ((second (second (first is-hae-f)))) (f x)))\n    ( ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n    ( ((second (second (first is-hae-f)))) (f y))\n    = ap B B (f x) (f y) (identity B) q\n  :=\n    triple-concat-nat-htpy B B\n      ( section-composite-has-inverse A B f (first is-hae-f))\n      ( identity B)\n      ( (second (second (first is-hae-f))))\n      ( f x)\n      ( f y)\n      q\n#def zag-zig-concat-triple-concat-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n        ( (first (second (first is-hae-f))) x)))\n    ( ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n    ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n      ( (first (second (first is-hae-f))) y)) =\n    ap B B (f x) (f y) (identity B) q\n  :=\n    zag-zig-concat (f x = f y)\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n          ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n            ( (first (second (first is-hae-f))) x)))\n        ( ap B B (f x) (f y)\n          ( section-composite-has-inverse A B f (first is-hae-f)) q)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y\n          f ((first (second (first is-hae-f))) y)))\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x))\n          ( f x)\n          ( ((second (second (first is-hae-f)))) (f x)))\n        ( ap B B (f x) (f y)\n          ( section-composite-has-inverse A B f (first is-hae-f)) q)\n        ( ((second (second (first is-hae-f)))) (f y)))\n      ( ap B B (f x) (f y) (identity B) q)\n      ( triple-concat-higher-homotopy-is-half-adjoint-equiv x y q)\n      ( triple-concat-nat-htpy-is-half-adjoint-equiv x y q)\n#def triple-concat-reduction-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : ap B B (f x) (f y) (identity B) q = q\n  := ap-id B (f x) (f y) q\n#def section-htpy-ap-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : ap A B x y f ((second (iff-ap-is-half-adjoint-equiv x y)) q) = q\n  :=\n    alternating-quintuple-concat (f x = f y)\n      ( ap A B x y f ((second (iff-ap-is-half-adjoint-equiv x y)) q))\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( ap A B x ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n          ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n            ( (first (second (first is-hae-f))) x)))\n        ( ap A B\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y)) f\n          ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n          ( (first (second (first is-hae-f))) y)))\n      ( ap-triple-concat-is-half-adjoint-equiv x y q)\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n          ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n            ( (first (second (first is-hae-f))) x)))\n        ( ap A B\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y)) f\n          ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n          ( (first (second (first is-hae-f))) y)))\n      ( ap-rev-triple-concat-eq-first-is-half-adjoint-equiv x y q)\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x))\n          ( f x)\n          ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n            ( (first (second (first is-hae-f))) x)))\n        ( ap B B (f x) (f y)\n          ( section-composite-has-inverse A B f (first is-hae-f)) q)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y\n          f ((first (second (first is-hae-f))) y)))\n      ( ap-ap-triple-concat-eq-first-is-half-adjoint-equiv x y q)\n      ( ap B B (f x) (f y) (identity B) q)\n      ( zag-zig-concat-triple-concat-is-half-adjoint-equiv x y q)\n      ( q)\n      ( triple-concat-reduction-is-half-adjoint-equiv x y q)\n#def has-section-ap-is-half-adjoint-equiv uses (is-hae-f)\n( x y : A)\n  : has-section (x = y) (f x = f y) (ap A B x y f)\n  :=\n    ( second (iff-ap-is-half-adjoint-equiv x y) ,\n      section-htpy-ap-is-half-adjoint-equiv x y)\n#def is-equiv-ap-is-half-adjoint-equiv uses (is-hae-f)\n( x y : A)\n  : is-equiv (x = y) (f x = f y) (ap A B x y f)\n  :=\n    ( has-retraction-ap-is-half-adjoint-equiv x y ,\n      has-section-ap-is-half-adjoint-equiv x y)\n#end equiv-identity-types-equiv\n#def is-emb-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-emb A B f\n  :=\n    is-equiv-ap-is-half-adjoint-equiv A B f\n    ( is-half-adjoint-equiv-is-equiv A B f is-equiv-f)\n#def emb-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : Emb A B\n  := (f , is-emb-is-equiv A B f is-equiv-f)\n#def equiv-ap-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( x y : A)\n  : Equiv (x = y) (f x = f y)\n  := (ap A B x y f , is-emb-is-equiv A B f is-equiv-f x y)\n
"},{"location":"hott/05-sigma.rzk/","title":"5. Sigma types","text":"

This is a literate rzk file:

#lang rzk-1\n

It is convenient to have a shorthand for \u03a3 (x : A), B x which avoids explicit naming the variable x : A.

#def total-type\n( A : U)\n( B : A \u2192 U)\n  : U\n  := \u03a3 (x : A), B x\n#def projection-total-type\n( A : U)\n( B : A \u2192 U)\n  : (total-type A B) \u2192 A\n  := \\ z \u2192 first z\n
"},{"location":"hott/05-sigma.rzk/#paths-involving-products","title":"Paths involving products","text":"
#section paths-in-products\n#variables A B : U\n#def path-product\n( a a' : A)\n( b b' : B)\n( e_A : a = a')\n( e_B : b = b')\n  : ( a , b) =_{product A B} (a' , b')\n  :=\n    transport A (\\ x \u2192 (a , b) =_{product A B} (x , b')) a a' e_A\n      ( transport B (\\ y \u2192 (a , b) =_{product A B} (a , y)) b b' e_B refl)\n#def first-path-product\n( x y : product A B)\n( e : x =_{product A B} y)\n  : first x = first y\n  := ap (product A B) A x y (\\ z \u2192 first z) e\n#def second-path-product\n( x y : product A B)\n( e : x =_{product A B} y)\n  : second x = second y\n  := ap (product A B) B x y (\\ z \u2192 second z) e\n#end paths-in-products\n
"},{"location":"hott/05-sigma.rzk/#identity-types-of-sigma-types","title":"Identity types of Sigma types","text":"
#section paths-in-sigma\n#variable A : U\n#variable B : A \u2192 U\n#def first-path-\u03a3\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : first s = first t\n  := ap (\u03a3 (a : A) , B a) A s t (\\ z \u2192 first z) e\n#def second-path-\u03a3\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : ( transport A B (first s) (first t) (first-path-\u03a3 s t e) (second s)) =\n    ( second t)\n  :=\n    ind-path\n( \u03a3 (a : A) , B a)\n      ( s)\n      ( \\ t' e' \u2192\n        ( transport A B\n          ( first s) (first t') (first-path-\u03a3 s t' e') (second s)) =\n        ( second t'))\n      ( refl)\n      ( t)\n      ( e)\n
Rijke 22, Definition 9.3.1
#def Eq-\u03a3\n( s t : \u03a3 (a : A) , B a)\n  : U\n  :=\n\u03a3 ( p : (first s) = (first t)) ,\n      ( transport A B (first s) (first t) p (second s)) = (second t)\n
Rijke 22, Definition 9.3.3
#def pair-eq\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : Eq-\u03a3 s t\n  := (first-path-\u03a3 s t e , second-path-\u03a3 s t e)\n

A path in a fiber defines a path in the total space.

#def eq-eq-fiber-\u03a3\n( x : A)\n( u v : B x)\n( p : u = v)\n  : (x , u) =_{\u03a3 (a : A) , B a} (x , v)\n  := ind-path (B x) (u) (\\ v' p' \u2192 (x , u) = (x , v')) (refl) (v) (p)\n

The following is essentially eq-pair but with explicit arguments.

#def path-of-pairs-pair-of-paths\n( x y : A)\n( p : x = y)\n  : ( u : B x) \u2192\n( v : B y) \u2192\n    ( (transport A B x y p u) = v) \u2192\n    ( x , u) =_{\u03a3 (z : A) , B z} (y , v)\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' p' \u2192 (u' : B x) \u2192 (v' : B y') \u2192\n        ((transport A B x y' p' u') = v') \u2192\n        (x , u') =_{\u03a3 (z : A) , B z} (y' , v'))\n      ( \\ u' v' q' \u2192 (eq-eq-fiber-\u03a3 x u' v' q'))\n      ( y)\n      ( p)\n
The inverse to pair-eq
#def eq-pair\n( s t : \u03a3 (a : A) , B a)\n( e : Eq-\u03a3 s t)\n  : (s = t)\n  :=\n    path-of-pairs-pair-of-paths\n      ( first s) (first t) (first e) (second s) (second t) (second e)\n#def eq-pair-pair-eq\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : (eq-pair s t (pair-eq s t e)) = e\n  :=\n    ind-path\n( \u03a3 (a : A) , (B a))\n      ( s)\n      ( \\ t' e' \u2192 (eq-pair s t' (pair-eq s t' e')) = e')\n      ( refl)\n      ( t)\n      ( e)\n

Here we've decomposed e : Eq-\u03a3 s t as (e0, e1) and decomposed s and t similarly for induction purposes.

#def pair-eq-eq-pair-split\n( s0 : A)\n( s1 : B s0)\n( t0 : A)\n( e0 : s0 = t0)\n  : ( t1 : B t0) \u2192\n( e1 : (transport A B s0 t0 e0 s1) = t1) \u2192\n    ( ( pair-eq (s0 , s1) (t0 , t1) (eq-pair (s0 , s1) (t0 , t1) (e0 , e1)))\n      =_{Eq-\u03a3 (s0 , s1) (t0 , t1)}\n      ( e0 , e1))\n  :=\n    ind-path\n      ( A)\n      ( s0)\n( \\ t0' e0' \u2192\n        ( t1 : B t0') \u2192\n( e1 : (transport A B s0 t0' e0' s1) = t1) \u2192\n        ( pair-eq (s0 , s1) (t0' , t1) (eq-pair (s0 , s1) (t0' , t1) (e0' , e1)))\n        =_{Eq-\u03a3 (s0 , s1) (t0' , t1)}\n        ( e0' , e1))\n      ( ind-path\n        ( B s0)\n        ( s1)\n        ( \\ t1' e1' \u2192\n          ( pair-eq\n            ( s0 , s1)\n            ( s0 , t1')\n            ( eq-pair (s0 , s1) (s0 , t1') (refl , e1')))\n          =_{Eq-\u03a3 (s0 , s1) (s0 , t1')}\n          ( refl , e1'))\n        ( refl))\n      ( t0)\n      ( e0)\n#def pair-eq-eq-pair\n( s t : \u03a3 (a : A) , B a)\n( e : Eq-\u03a3 s t)\n  : ( pair-eq s t (eq-pair s t e)) =_{Eq-\u03a3 s t} e\n  :=\n    pair-eq-eq-pair-split\n      ( first s) (second s) (first t) (first e) (second t) (second e)\n#def extensionality-\u03a3\n( s t : \u03a3 (a : A) , B a)\n  : Equiv (s = t) (Eq-\u03a3 s t)\n  :=\n    ( pair-eq s t ,\n      ( ( eq-pair s t , eq-pair-pair-eq s t) ,\n        ( eq-pair s t , pair-eq-eq-pair s t)))\n#end paths-in-sigma\n#def first-path-\u03a3-eq-pair\n( A : U)\n( B : A \u2192 U)\n  ( (a,b) (a',b') : \u03a3 (a : A), B a)\n  ( (e0, e1) : Eq-\u03a3 A B (a,b) (a',b'))\n  : first-path-\u03a3 A B (a,b) (a',b') (eq-pair A B (a,b) (a',b') (e0, e1)) = e0\n  :=\n    first-path-\u03a3\n      ( a = a' )\n      ( \\ p \u2192 transport A B a a' p b = b' )\n      ( pair-eq A B (a,b) (a',b') (eq-pair A B (a,b) (a',b') (e0,e1)) )\n      ( e0, e1 )\n      ( pair-eq-eq-pair A B (a,b) (a',b') (e0,e1))\n
"},{"location":"hott/05-sigma.rzk/#identity-types-of-sigma-types-over-a-product","title":"Identity types of Sigma types over a product","text":"
#section paths-in-sigma-over-product\n#variables A B : U\n#variable C : A \u2192 B \u2192 U\n#def product-transport\n( a a' : A)\n( b b' : B)\n( p : a = a')\n( q : b = b')\n( c : C a b)\n  : C a' b'\n  :=\n    ind-path\n      ( B)\n      ( b)\n      ( \\ b'' q' \u2192 C a' b'')\n      ( ind-path (A) (a) (\\ a'' p' \u2192 C a'' b) (c) (a') (p))\n      ( b')\n      ( q)\n#def Eq-\u03a3-over-product\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n  : U\n  :=\n\u03a3 ( p : (first s) = (first t)) ,\n( \u03a3 ( q : (first (second s)) = (first (second t))) ,\n          ( product-transport\n            ( first s) (first t)\n            ( first (second s)) (first (second t)) p q (second (second s)) =\n            ( second (second t))))\n

Warning

The following definition of triple-eq is the lazy definition with bad computational properties.

#def triple-eq\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : s = t)\n  : Eq-\u03a3-over-product s t\n  :=\n    ind-path\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n      ( s)\n      ( \\ t' e' \u2192 (Eq-\u03a3-over-product s t'))\n      ( ( refl , (refl , refl)))\n      ( t)\n      ( e)\n

It's surprising that the following typechecks since we defined product-transport by a dual path induction over both p and q, rather than by saying that when p is refl this is ordinary transport.

The inverse with explicit arguments
#def triple-of-paths-path-of-triples\n( a a' : A)\n( u u' : B)\n( c : C a u)\n( p : a = a')\n  : ( q : u = u') \u2192\n( c' : C a' u') \u2192\n( r : product-transport a a' u u' p q c = c') \u2192\n    ( (a , (u , c)) =_{(\u03a3 (x : A) , (\u03a3 (y : B) , C x y))} (a' , (u' , c')))\n  :=\n    ind-path\n      ( A)\n      ( a)\n( \\ a'' p' \u2192\n        ( q : u = u') \u2192\n( c' : C a'' u') \u2192\n( r : product-transport a a'' u u' p' q c = c') \u2192\n        ( (a , (u , c)) =_{(\u03a3 (x : A) , (\u03a3 (y : B) , C x y))} (a'' , (u' , c'))))\n      ( \\ q c' r \u2192\n        eq-eq-fiber-\u03a3\n          ( A) (\\ x \u2192 (\u03a3 (v : B) , C x v)) (a)\n          ( u , c) ( u' , c')\n          ( path-of-pairs-pair-of-paths B (\\ y \u2192 C a y) u u' q c c' r))\n      ( a')\n      ( p)\n#def eq-triple\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : Eq-\u03a3-over-product s t)\n  : (s = t)\n  :=\n    triple-of-paths-path-of-triples\n    ( first s) (first t)\n    ( first (second s)) (first (second t))\n    ( second (second s)) (first e)\n    ( first (second e)) (second (second t))\n    ( second (second e))\n#def eq-triple-triple-eq\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : s = t)\n  : (eq-triple s t (triple-eq s t e)) = e\n  :=\n    ind-path\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n      ( s)\n      ( \\ t' e' \u2192 (eq-triple s t' (triple-eq s t' e')) = e')\n      ( refl)\n      ( t)\n      ( e)\n

Here we've decomposed s, t and e for induction purposes:

#def triple-eq-eq-triple-split\n( a a' : A)\n( b b' : B)\n( c : C a b)\n  : ( p : a = a') \u2192\n( q : b = b') \u2192\n( c' : C a' b') \u2192\n( r : product-transport a a' b b' p q c = c') \u2192\n    ( triple-eq\n      ( a , (b , c)) (a' , (b' , c'))\n      ( eq-triple (a , (b , c)) (a' , (b' , c')) (p , (q , r)))) =\n    ( p , (q , r))\n  :=\n    ind-path\n      ( A)\n      ( a)\n( \\ a'' p' \u2192\n        ( q : b = b') \u2192\n( c' : C a'' b') \u2192\n( r : product-transport a a'' b b' p' q c = c') \u2192\n        ( triple-eq\n          ( a , (b , c)) (a'' , (b' , c'))\n          ( eq-triple (a , (b , c)) (a'' , (b' , c')) (p' , (q , r)))) =\n        ( p' , (q , r)))\n      ( ind-path\n        ( B)\n        ( b)\n( \\ b'' q' \u2192\n          ( c' : C a b'') \u2192\n( r : product-transport a a b b'' refl q' c = c') \u2192\n          ( triple-eq\n            ( a , (b , c)) (a , (b'' , c'))\n            ( eq-triple (a , (b , c)) (a , (b'' , c')) (refl , (q' , r)))) =\n          ( refl , (q' , r)))\n        ( ind-path\n            ( C a b)\n            ( c)\n            ( \\ c'' r' \u2192\n              triple-eq\n                ( a , (b , c)) (a , (b , c''))\n                ( eq-triple\n                  ( a , (b , c)) (a , (b , c''))\n                  ( refl , (refl , r'))) =\n                ( refl , (refl , r')))\n            ( refl))\n        ( b'))\n      ( a')\n#def triple-eq-eq-triple\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : Eq-\u03a3-over-product s t)\n  : (triple-eq s t (eq-triple s t e)) = e\n  :=\n    triple-eq-eq-triple-split\n      ( first s) (first t)\n      ( first (second s)) (first (second t))\n      ( second (second s)) (first e)\n      ( first (second e)) (second (second t))\n      ( second (second e))\n#def extensionality-\u03a3-over-product\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n  : Equiv (s = t) (Eq-\u03a3-over-product s t)\n  :=\n    ( triple-eq s t ,\n      ( ( eq-triple s t , eq-triple-triple-eq s t) ,\n        ( eq-triple s t , triple-eq-eq-triple s t)))\n#end paths-in-sigma-over-product\n
"},{"location":"hott/05-sigma.rzk/#symmetry-of-products","title":"Symmetry of products","text":"
#def sym-product\n( A B : U)\n  : Equiv (product A B) (product B A)\n  :=\n    ( \\ (a , b) \u2192 (b , a) ,\n      ( ( \\ (b , a) \u2192 (a , b) ,\\ p \u2192 refl) ,\n        ( \\ (b , a) \u2192 (a , b) ,\\ p \u2192 refl)))\n
"},{"location":"hott/05-sigma.rzk/#fubini","title":"Fubini","text":"

Given a family over a pair of independent types, the order of summation is unimportant.

#def fubini-\u03a3\n( A B : U)\n( C : A \u2192 B \u2192 U)\n  : Equiv ( \u03a3 (x : A) , \u03a3 (y : B) , C x y) (\u03a3 (y : B) , \u03a3 (x : A) , C x y)\n  :=\n    ( \\ t \u2192 (first (second t) , (first t , second (second t))) ,\n      ( ( \\ t \u2192 (first (second t) , (first t , second (second t))) ,\n\\ t \u2192 refl) ,\n        ( \\ t \u2192 (first (second t) , (first t , second (second t))) ,\n\\ t \u2192 refl)))\n
Products distribute inside Sigma types
#def distributive-product-\u03a3\n( A B : U)\n( C : B \u2192 U)\n  : Equiv (product A (\u03a3 (b : B) , C b)) (\u03a3 (b : B) , product A (C b))\n  :=\n    ( \\ (a , (b , c)) \u2192 (b , (a , c)) ,\n      ( ( \\ (b , (a , c)) \u2192 (a , (b , c)) , \\ z \u2192 refl) ,\n        ( \\ (b , (a , c)) \u2192 (a , (b , c)) , \\ z \u2192 refl)))\n
"},{"location":"hott/05-sigma.rzk/#associativity","title":"Associativity","text":"
#def associative-\u03a3\n( A : U)\n( B : A \u2192 U)\n( C : (a : A) \u2192 B a \u2192 U)\n  : Equiv\n( \u03a3 (a : A) , \u03a3 (b : B a) , C a b)\n( \u03a3 (ab : \u03a3 (a : A) , B a) , C (first ab) (second ab))\n  :=\n    ( \\ (a , (b , c)) \u2192 ((a , b) , c) ,\n      ( ( \\ ((a , b) , c) \u2192 (a , (b , c)) , \\ _ \u2192 refl) ,\n        ( \\ ((a , b) , c) \u2192 (a , (b , c)) , \\ _ \u2192 refl)))\n
"},{"location":"hott/05-sigma.rzk/#currying","title":"Currying","text":"

This is the dependent version of the currying equivalence.

#def equiv-dependent-curry\n( A : U)\n( B : A \u2192 U)\n( C : (a : A) \u2192 B a \u2192 U)\n  : Equiv\n((p : \u03a3 (a : A) , (B a)) \u2192 C (first p) (second p))\n((a : A) \u2192 (b : B a) \u2192 C a b)\n  :=\n    ( ( \\ s a b \u2192 s (a , b)) ,\n      ( ( ( \\ f (a , b) \u2192 f a b ,\n\\ f \u2192 refl) ,\n          ( \\ f (a , b) \u2192 f a b ,\n\\ s \u2192 refl))))\n
"},{"location":"hott/05-sigma.rzk/#type-theoretic-principle-of-choice","title":"Type theoretic principle of choice","text":"Rijke 22, Theorem 13.2.1
#def choice\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : ( (x : A) \u2192 \u03a3 (y : B x) , C x y) \u2192\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n  := \\ h \u2192 (\\ x \u2192 first (h x) , \\ x \u2192 second (h x))\n#def choice-inverse\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : ( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x)) \u2192\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n  := \\ s \u2192 \\ x \u2192 ((first s) x , (second s) x)\n#def is-equiv-choice\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : is-equiv\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n      ( choice A B C)\n  :=\n    is-equiv-has-inverse\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n      ( choice A B C)\n      ( choice-inverse A B C , ( \\ h \u2192 refl , \\ s \u2192 refl))\n#def equiv-choice\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : Equiv\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n  := (choice A B C , is-equiv-choice A B C)\n
"},{"location":"hott/06-contractible.rzk/","title":"6. Contractible","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/06-contractible.rzk/#contractible-types","title":"Contractible types","text":"The type of contractibility proofs
#def is-contr (A : U) : U\n  := \u03a3 (x : A) , ((y : A) \u2192 x = y)\n
"},{"location":"hott/06-contractible.rzk/#contractible-type-data","title":"Contractible type data","text":"
#section contractible-data\n#variable A : U\n#variable is-contr-A : is-contr A\n#def center-contraction\n  : A\n  := (first is-contr-A)\n
The path from the contraction center to any point
#def homotopy-contraction\n  : ( z : A) \u2192 center-contraction = z\n  := second is-contr-A\n#def realign-homotopy-contraction uses (is-contr-A)\n  : ( z : A) \u2192 center-contraction = z\n  :=\n\\ z \u2192\n      ( concat A center-contraction center-contraction z\n          (rev A center-contraction center-contraction\n            ( homotopy-contraction center-contraction))\n          (homotopy-contraction z))\n#def path-realign-homotopy-contraction uses (is-contr-A)\n  : ( realign-homotopy-contraction center-contraction) = refl\n  :=\n    ( left-inverse-concat A center-contraction center-contraction\n      ( homotopy-contraction center-contraction))\n
A path between any pair of terms in a contractible type
#def eq-is-contr uses (is-contr-A)\n(x y : A)\n  : x = y\n  :=\n    zag-zig-concat A x center-contraction y\n      ( homotopy-contraction x) (homotopy-contraction y)\n#end contractible-data\n
"},{"location":"hott/06-contractible.rzk/#unit-type","title":"Unit type","text":"

The prototypical contractible type is the unit type, which is built-in to rzk.

#def ind-unit\n( C : Unit \u2192 U)\n( C-unit : C unit)\n( x : Unit)\n  : C x\n  := C-unit\n#def is-prop-unit\n( x y : Unit)\n  : x = y\n  := refl\n
The terminal projection as a constant map
#def terminal-map\n( A : U)\n  : A \u2192 Unit\n  := constant A Unit unit\n
"},{"location":"hott/06-contractible.rzk/#identity-types-of-unit-types","title":"Identity types of unit types","text":"
#def terminal-map-of-path-types-of-Unit-has-retr\n( x y : Unit)\n  : has-retraction (x = y) Unit (terminal-map (x = y))\n  :=\n    ( \\ a \u2192 refl ,\n\\ p \u2192 ind-path (Unit) (x) (\\ y' p' \u2192 refl =_{x = y'} p') (refl) (y) (p))\n#def terminal-map-of-path-types-of-Unit-has-sec\n( x y : Unit)\n  : has-section (x = y) Unit (terminal-map (x = y))\n  := ( \\ a \u2192 refl , \\ a \u2192 refl)\n#def terminal-map-of-path-types-of-Unit-is-equiv\n( x y : Unit)\n  : is-equiv (x = y) Unit (terminal-map (x = y))\n  :=\n    ( terminal-map-of-path-types-of-Unit-has-retr x y ,\n      terminal-map-of-path-types-of-Unit-has-sec x y)\n
"},{"location":"hott/06-contractible.rzk/#characterization-of-contractibility","title":"Characterization of contractibility","text":"

A type is contractible if and only if its terminal map is an equivalence.

#def terminal-map-is-equiv\n( A : U)\n  : U\n  := is-equiv A Unit (terminal-map A)\n#def contr-implies-terminal-map-is-equiv-retr\n( A : U)\n( is-contr-A : is-contr A)\n  : has-retraction A Unit (terminal-map A)\n  :=\n    ( constant Unit A (center-contraction A is-contr-A) ,\n\\ y \u2192 (homotopy-contraction A is-contr-A) y)\n#def contr-implies-terminal-map-is-equiv-sec\n( A : U)\n( is-contr-A : is-contr A)\n  : has-section A Unit (terminal-map A)\n  := ( constant Unit A (center-contraction A is-contr-A) , \\ z \u2192 refl)\n#def contr-implies-terminal-map-is-equiv\n( A : U)\n( is-contr-A : is-contr A)\n  : is-equiv A Unit (terminal-map A)\n  :=\n    ( contr-implies-terminal-map-is-equiv-retr A is-contr-A ,\n      contr-implies-terminal-map-is-equiv-sec A is-contr-A)\n#def terminal-map-is-equiv-implies-contr\n( A : U)\n(e : terminal-map-is-equiv A)\n  : is-contr A\n  := ( (first (first e)) unit , (second (first e)))\n#def contr-iff-terminal-map-is-equiv\n( A : U)\n  : iff (is-contr A) (terminal-map-is-equiv A)\n  :=\n    ( ( contr-implies-terminal-map-is-equiv A) ,\n      ( terminal-map-is-equiv-implies-contr A))\n#def equiv-with-contractible-domain-implies-contractible-codomain\n( A B : U)\n( f : Equiv A B)\n( is-contr-A : is-contr A)\n  : is-contr B\n  :=\n    ( terminal-map-is-equiv-implies-contr B\n      ( second\n        ( equiv-comp B A Unit\n          ( inv-equiv A B f)\n          ( ( terminal-map A) ,\n            ( contr-implies-terminal-map-is-equiv A is-contr-A)))))\n#def equiv-with-contractible-codomain-implies-contractible-domain\n( A B : U)\n( f : Equiv A B)\n( is-contr-B : is-contr B)\n  : is-contr A\n  :=\n    ( equiv-with-contractible-domain-implies-contractible-codomain B A\n      ( inv-equiv A B f) is-contr-B)\n#def equiv-then-domain-contractible-iff-codomain-contractible\n( A B : U)\n( f : Equiv A B)\n  : ( iff (is-contr A) (is-contr B))\n  :=\n    ( \\ is-contr-A \u2192\n      ( equiv-with-contractible-domain-implies-contractible-codomain\n        A B f is-contr-A) ,\n\\ is-contr-B \u2192\n      ( equiv-with-contractible-codomain-implies-contractible-domain\n        A B f is-contr-B))\n#def path-types-of-Unit-are-contractible\n( x y : Unit)\n  : is-contr (x = y)\n  :=\n    ( terminal-map-is-equiv-implies-contr\n      ( x = y) (terminal-map-of-path-types-of-Unit-is-equiv x y))\n
"},{"location":"hott/06-contractible.rzk/#retracts-of-contractible-types","title":"Retracts of contractible types","text":"

A retract of contractible types is contractible.

The type of proofs that A is a retract of B
#def is-retract-of\n( A B : U)\n  : U\n  := \u03a3 ( s : A \u2192 B) , has-retraction A B s\n#section retraction-data\n#variables A B : U\n#variable is-retract-of-A-B : is-retract-of A B\n#def is-retract-of-section\n  : A \u2192 B\n  := first is-retract-of-A-B\n#def is-retract-of-retraction\n  : B \u2192 A\n  := first (second is-retract-of-A-B)\n#def is-retract-of-homotopy\n  : homotopy A A (comp A B A is-retract-of-retraction is-retract-of-section) (identity A)\n  := second (second is-retract-of-A-B)\n
If A is a retract of a contractible type it has a term
#def is-retract-of-is-contr-isInhabited uses (is-retract-of-A-B)\n( is-contr-B : is-contr B)\n  : A\n  := is-retract-of-retraction (center-contraction B is-contr-B)\n
If A is a retract of a contractible type it has a contracting homotopy
#def is-retract-of-is-contr-hasHtpy uses (is-retract-of-A-B)\n( is-contr-B : is-contr B)\n( a : A)\n  : ( is-retract-of-is-contr-isInhabited is-contr-B) = a\n  :=\n    concat\n      ( A)\n      ( is-retract-of-is-contr-isInhabited is-contr-B)\n      ( (comp A B A is-retract-of-retraction is-retract-of-section) a)\n      ( a)\n      ( ap B A (center-contraction B is-contr-B) (is-retract-of-section a)\n        ( is-retract-of-retraction)\n        ( homotopy-contraction B is-contr-B (is-retract-of-section a)))\n      ( is-retract-of-homotopy a)\n
If A is a retract of a contractible type it is contractible
#def is-contr-is-retract-of-is-contr uses (is-retract-of-A-B)\n( is-contr-B : is-contr B)\n  : is-contr A\n  :=\n    ( is-retract-of-is-contr-isInhabited is-contr-B ,\n      is-retract-of-is-contr-hasHtpy is-contr-B)\n
#end retraction-data\n
"},{"location":"hott/06-contractible.rzk/#functions-between-contractible-types","title":"Functions between contractible types","text":"Any function between contractible types is an equivalence
#def is-equiv-are-contr\n( A B : U)\n( is-contr-A : is-contr A)\n( is-contr-B : is-contr B)\n( f : A \u2192 B)\n  : is-equiv A B f\n  :=\n    ( ( \\ b \u2192 center-contraction A is-contr-A ,\n\\ a \u2192 homotopy-contraction A is-contr-A a) ,\n      ( \\ b \u2192 center-contraction A is-contr-A ,\n\\ b \u2192 eq-is-contr B is-contr-B\n                (f (center-contraction A is-contr-A)) b))\n
A type equivalent to a contractible type is contractible
#def is-contr-equiv-is-contr'\n( A B : U)\n( e : Equiv A B)\n( is-contr-B : is-contr B)\n  : is-contr A\n  :=\n    is-contr-is-retract-of-is-contr A B (first e , first (second e)) is-contr-B\n#def is-contr-equiv-is-contr\n( A B : U)\n( e : Equiv A B)\n( is-contr-A : is-contr A)\n  : is-contr B\n  :=\n    is-contr-is-retract-of-is-contr B A\n      ( first (second (second e)) , (first e , second (second (second e))))\n      ( is-contr-A)\n
"},{"location":"hott/06-contractible.rzk/#based-path-spaces","title":"Based path spaces","text":"

For example, we prove that based path spaces are contractible.

Transport in the space of paths starting at a is concatenation
#def concat-as-based-transport\n( A : U)\n( a x y : A)\n( p : a = x)\n( q : x = y)\n  : ( transport A (\\ z \u2192 (a = z)) x y q p) = (concat A a x y p q)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' q' \u2192\n        ( transport A (\\ z \u2192 (a = z)) x y' q' p) = (concat A a x y' p q'))\n      ( refl)\n      ( y)\n      ( q)\n

The center of contraction in the based path space is (a , refl).

The center of contraction in the based path space
#def center-based-paths\n( A : U)\n( a : A)\n  : \u03a3 (x : A) , (a = x)\n  := (a , refl)\n
The contracting homotopy in the based path space
#def contraction-based-paths\n( A : U)\n( a : A)\n( p : \u03a3 (x : A) , a = x)\n  : (center-based-paths A a) = p\n  :=\n    path-of-pairs-pair-of-paths\n      A ( \\ z \u2192 a = z) a (first p) (second p) (refl) (second p)\n      ( concat\n        ( a = (first p))\n        ( transport A (\\ z \u2192 (a = z)) a (first p) (second p) (refl))\n        ( concat A a a (first p) (refl) (second p))\n        ( second p)\n        ( concat-as-based-transport A a a (first p) (refl) (second p))\n        ( left-unit-concat A a (first p) (second p)))\n
Based path spaces are contractible
#def is-contr-based-paths\n( A : U)\n( a : A)\n  : is-contr (\u03a3 (x : A) , a = x)\n  := (center-based-paths A a , contraction-based-paths A a)\n
"},{"location":"hott/06-contractible.rzk/#contractible-products","title":"Contractible products","text":"
#def is-contr-product\n( A B : U)\n( is-contr-A : is-contr A)\n( is-contr-B : is-contr B)\n  : is-contr (product A B)\n  :=\n    ( (first is-contr-A , first is-contr-B) ,\n\\ p \u2192 path-product A B\n              ( first is-contr-A) (first p)\n              ( first is-contr-B) (second p)\n              ( second is-contr-A (first p))\n              ( second is-contr-B (second p)))\n#def first-is-contr-product\n( A B : U)\n( AxB-is-contr : is-contr (product A B))\n  : is-contr A\n  :=\n    ( first (first AxB-is-contr) ,\n\\ a \u2192 first-path-product A B\n              ( first AxB-is-contr)\n              ( a , second (first AxB-is-contr))\n              ( second AxB-is-contr (a , second (first AxB-is-contr))))\n#def is-contr-base-is-contr-\u03a3\n( A : U)\n( B : A \u2192 U)\n( b : (a : A) \u2192 B a)\n( is-contr-AB : is-contr (\u03a3 (a : A) , B a))\n  : is-contr A\n  :=\n    ( first (first is-contr-AB) ,\n\\ a \u2192 first-path-\u03a3 A B\n              ( first is-contr-AB)\n              ( a , b a)\n              ( second is-contr-AB (a , b a)))\n
"},{"location":"hott/06-contractible.rzk/#weak-function-extensionality","title":"Weak function extensionality","text":"

The weak function extensionality axiom asserts that if a dependent type is locally contractible then its dependent function type is contractible.

Weak function extensionality is logically equivalent to function extensionality. However, for various applications it may be useful to have it stated as a separate hypothesis.

Weak function extensionality gives us contractible pi types
#def WeakFunExt : U\n  :=\n( A : U ) \u2192 (C : A \u2192 U) \u2192\n(is-contr-C : (a : A) \u2192 is-contr (C a) ) \u2192\n(is-contr ( (a : A) \u2192 C a ))\n

Function extensionality implies weak function extensionality.

#def map-weakfunext\n(A : U)\n(C : A \u2192 U)\n(is-contr-C : (a : A) \u2192 is-contr (C a))\n  : (a : A) \u2192 C a\n  :=\n\\ a \u2192 first (is-contr-C a)\n#def weakfunext-funext\n(funext : FunExt)\n  : WeakFunExt\n  :=\n\\ A C is-contr-C \u2192\n  ( map-weakfunext A C is-contr-C ,\n    ( \\ g \u2192\n      ( eq-htpy funext\n        ( A)\n        ( C)\n        ( map-weakfunext A C is-contr-C)\n        ( g)\n        ( \\ a \u2192 second (is-contr-C a) (g a)))))\n
"},{"location":"hott/06-contractible.rzk/#singleton-induction","title":"Singleton induction","text":"

A type is contractible if and only if it has singleton induction.

#def ev-pt\n( A : U)\n( a : A)\n( B : A \u2192 U)\n  : ((x : A) \u2192 B x) \u2192 B a\n  := \\ f \u2192 f a\n#def has-singleton-induction-pointed\n( A : U)\n( a : A)\n( B : A \u2192 U)\n  : U\n  := has-section ((x : A) \u2192 B x) (B a) (ev-pt A a B)\n#def has-singleton-induction-pointed-structure\n( A : U)\n( a : A)\n  : U\n  := ( B : A \u2192 U) \u2192 has-section ((x : A) \u2192 B x) (B a) (ev-pt A a B)\n#def has-singleton-induction\n( A : U)\n  : U\n  := \u03a3 ( a : A) , (B : A \u2192 U) \u2192 (has-singleton-induction-pointed A a B)\n#def ind-sing\n( A : U)\n( a : A)\n( B : A \u2192 U)\n(singleton-ind-A : has-singleton-induction-pointed A a B)\n  : (B a) \u2192 ((x : A) \u2192 B x)\n  := ( first singleton-ind-A)\n#def compute-ind-sing\n( A : U)\n( a : A)\n( B : A \u2192 U)\n( singleton-ind-A : has-singleton-induction-pointed A a B)\n  : ( homotopy\n      ( B a)\n      ( B a)\n      ( comp\n        ( B a)\n( (x : A) \u2192 B x)\n        ( B a)\n        ( ev-pt A a B)\n        ( ind-sing A a B singleton-ind-A))\n      ( identity (B a)))\n  := (second singleton-ind-A)\n#def contr-implies-singleton-induction-ind\n( A : U)\n( is-contr-A : is-contr A)\n  : (has-singleton-induction A)\n  :=\n    ( ( center-contraction A is-contr-A) ,\n\\ B \u2192\n        ( ( \\ b x \u2192\n                ( transport A B\n                  ( center-contraction A is-contr-A) x\n                  ( realign-homotopy-contraction A is-contr-A x) b)) ,\n          ( \\ b \u2192\n                ( ap\n                  ( (center-contraction A is-contr-A) =\n                    (center-contraction A is-contr-A))\n                  ( B (center-contraction A is-contr-A))\n                  ( realign-homotopy-contraction A is-contr-A\n                    ( center-contraction A is-contr-A))\nrefl_{(center-contraction A is-contr-A)}\n                  ( \\ p \u2192\n                    ( transport-loop A B (center-contraction A is-contr-A) b p))\n                  ( path-realign-homotopy-contraction A is-contr-A)))))\n#def contr-implies-singleton-induction-pointed\n( A : U)\n( is-contr-A : is-contr A)\n( B : A \u2192 U)\n  : has-singleton-induction-pointed A (center-contraction A is-contr-A) B\n  := ( second (contr-implies-singleton-induction-ind A is-contr-A)) B\n#def singleton-induction-ind-implies-contr\n( A : U)\n( a : A)\n( f : has-singleton-induction-pointed-structure A a)\n  : ( is-contr A)\n  := ( a , (first (f ( \\ x \u2192 a = x))) (refl_{a}))\n
"},{"location":"hott/06-contractible.rzk/#identity-types-of-contractible-types","title":"Identity types of contractible types","text":"

We show that any two paths between the same endpoints in a contractible type are the same.

In a contractible type any path \\(p : x = y\\) is equal to the path constructed in eq-is-contr.

#define path-eq-path-through-center-is-contr\n( A : U)\n( is-contr-A : is-contr A)\n( x y : A)\n( p : x = y)\n  : ((eq-is-contr A is-contr-A x y) = p)\n  := \n    ind-path\n    ( A)\n    ( x)\n    ( \\ y' p' \u2192 (eq-is-contr A is-contr-A x y') = p') \n    ( left-inverse-concat A (center-contraction A is-contr-A) x (homotopy-contraction A is-contr-A x)) \n    ( y) \n    ( p) \n

Finally, in a contractible type any two paths between the same end points are equal. There are many possible proofs of this (e.g. identifying contractible types with the unit type where it is more transparent), but we proceed by gluing together the two identifications to the out and back path.

#define all-paths-eq-is-contr ( A : U)\n( is-contr-A : is-contr A)\n( x y : A)\n( p q : x = y) \n : (p = q)\n := \n  concat\n    ( x = y)\n    ( p)\n    ( eq-is-contr A is-contr-A x y)\n    ( q)\n    ( rev\n      (x = y) \n      ( eq-is-contr A is-contr-A x y)\n      ( p) \n      ( path-eq-path-through-center-is-contr A is-contr-A x y p))\n    ( path-eq-path-through-center-is-contr A is-contr-A x y q)\n
"},{"location":"hott/07-fibers.rzk/","title":"7. Fibers","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/07-fibers.rzk/#fibers","title":"Fibers","text":"

The homotopy fiber of a map is the following type:

The fiber of a map
#def fib\n( A B : U)\n( f : A \u2192 B)\n( b : B)\n  : U\n  := \u03a3 (a : A) , (f a) = b\n

We calculate the transport of (a , q) : fib b along p : a = a':

#def transport-in-fiber\n( A B : U)\n( f : A \u2192 B)\n( b : B)\n( a a' : A)\n( u : (f a) = b)\n( p : a = a')\n  : ( transport A ( \\ x \u2192 (f x) = b) a a' p u) =\n    ( concat B (f a') (f a) b (ap A B a' a f (rev A a a' p)) u)\n  :=\n    ind-path\n      ( A)\n      ( a)\n      ( \\ a'' p' \u2192\n        ( transport (A) (\\ x \u2192 (f x) = b) (a) (a'') (p') (u)) =\n        ( concat (B) (f a'') (f a) (b) (ap A B a'' a f (rev A a a'' p')) (u)))\n      ( rev\n        ( (f a) = b) (concat B (f a) (f a) b refl u) (u)\n        ( left-unit-concat B (f a) b u))\n      ( a')\n      ( p)\n
"},{"location":"hott/07-fibers.rzk/#induction-principle-for-fibers","title":"Induction principle for fibers","text":"

The family of fibers has the following induction principle: To prove/construct something about/for every point in every fiber, it suffices to do so for points of the form (a, refl : f a = f a) : fib A B f.

#def ind-fib\n( A B : U)\n( f : A \u2192 B)\n( C : (b : B) \u2192 fib A B f b \u2192 U)\n( s : (a : A) \u2192 C (f a) (a, refl))\n( b : B)\n  ( (a, q) : fib A B f b)\n  : C b (a, q)\n  :=\n    ind-path B (f a) (\\ b p \u2192 C b (a, p)) (s a) b q\n#def ind-fib-computation\n( A B : U)\n( f : A \u2192 B)\n( C : (b : B) \u2192 fib A B f b \u2192 U)\n( s : (a : A) \u2192 C (f a) (a, refl))\n( a : A)\n  : ind-fib A B f C s (f a) (a, refl) = s a\n  := refl\n
"},{"location":"hott/07-fibers.rzk/#contractible-maps","title":"Contractible maps","text":"

A map is contractible just when its fibers are contractible.

Contractible maps
#def is-contr-map\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := (b : B) \u2192 is-contr (fib A B f b)\n
"},{"location":"hott/07-fibers.rzk/#contractible-maps-are-equivalences","title":"Contractible maps are equivalences","text":"

Contractible maps are equivalences:

#section is-equiv-is-contr-map\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-contr-f : is-contr-map A B f\n
The inverse to a contractible map
#def is-contr-map-inverse\n  : B \u2192 A\n  := \\ b \u2192 first (center-contraction (fib A B f b) (is-contr-f b))\n#def has-section-is-contr-map\n  : has-section A B f\n  :=\n    ( is-contr-map-inverse ,\n\\ b \u2192 second (center-contraction (fib A B f b) (is-contr-f b)))\n#def is-contr-map-data-in-fiber uses (is-contr-f)\n(a : A)\n  : fib A B f (f a)\n  := (is-contr-map-inverse (f a) , (second has-section-is-contr-map) (f a))\n#def is-contr-map-path-in-fiber\n(a : A)\n  : (is-contr-map-data-in-fiber a) =_{fib A B f (f a)} (a , refl)\n  :=\n    eq-is-contr\n      ( fib A B f (f a))\n      ( is-contr-f (f a))\n      ( is-contr-map-data-in-fiber a)\n      ( a , refl)\n#def is-contr-map-has-retraction uses (is-contr-f)\n  : has-retraction A B f\n  :=\n    ( is-contr-map-inverse ,\n\\ a \u2192 ( ap (fib A B f (f a)) A\n                ( is-contr-map-data-in-fiber a)\n                ( (a , refl))\n                ( \\ u \u2192 first u)\n                ( is-contr-map-path-in-fiber a)))\n#def is-equiv-is-contr-map uses (is-contr-f)\n  : is-equiv A B f\n  := (is-contr-map-has-retraction , has-section-is-contr-map)\n#end is-equiv-is-contr-map\n
"},{"location":"hott/07-fibers.rzk/#half-adjoint-equivalences-are-contractible-maps","title":"Half adjoint equivalences are contractible maps","text":"

We prove the converse by fiber induction. To define the contracting homotopy to the point (f a, refl) in the fiber over f a we find it easier to work from the assumption that f is a half adjoint equivalence.

#section is-contr-map-is-equiv\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-hae-f : is-half-adjoint-equiv A B f\n#def is-split-surjection-is-half-adjoint-equiv\n( b : B)\n  : fib A B f b\n  :=\n    ( map-inverse-is-half-adjoint-equiv A B f is-hae-f b,\n      section-htpy-is-half-adjoint-equiv A B f is-hae-f b)\n#def calculate-is-split-surjection-is-half-adjoint-equiv\n( a : A)\n  : is-split-surjection-is-half-adjoint-equiv (f a) = (a, refl)\n  :=\n    path-of-pairs-pair-of-paths\n    ( A)\n    ( \\ a' \u2192 f a' = f a)\n    ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n    ( a)\n    ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)\n    ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a))\n    ( refl)\n    ( triple-concat\n      ( f a = f a)\n      ( transport A ( \\ x \u2192 (f x) = (f a))\n        ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( a)\n        ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a)))\n      ( concat B\n        ( f a)\n        ( f (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)))\n        ( f a)\n        ( ap A B\n          ( a)\n          ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n          ( f)\n          ( rev A ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a\n            ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a)))\n      ( concat B\n        ( f a)\n        ( f (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)))\n        ( f a)\n        ( ap A B\n          ( a)\n          ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n          ( f)\n          ( rev A (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a\n            ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n        ( ap A B (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a f\n          ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n      ( refl)\n      ( transport-in-fiber A B f (f a)\n        ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( a)\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a))\n      ( concat-eq-right B\n        ( f a)\n        ( f (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)))\n        ( f a)\n        ( ap A B\n          ( a)\n          ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n          ( f)\n          ( rev A ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a\n            ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( ap A B (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a f\n          ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a))\n        (coherence-is-half-adjoint-equiv A B f is-hae-f a))\n      ( concat-ap-rev-ap-id A B\n        ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( a)\n        ( f)\n        ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n#def contraction-fib-is-half-adjoint-equiv uses (is-hae-f)\n( b : B)\n( z : fib A B f b)\n  : is-split-surjection-is-half-adjoint-equiv b = z\n  :=\n    ind-fib\n    ( A) (B) (f)\n    ( \\ b' z' \u2192 is-split-surjection-is-half-adjoint-equiv b' = z')\n    ( calculate-is-split-surjection-is-half-adjoint-equiv)\n    ( b)\n    ( z)\n#def is-contr-map-is-half-adjoint-equiv uses (is-hae-f)\n  : is-contr-map A B f\n  :=\n\\ b \u2192\n      ( is-split-surjection-is-half-adjoint-equiv b,\n        contraction-fib-is-half-adjoint-equiv b)\n#end is-contr-map-is-equiv\n
"},{"location":"hott/07-fibers.rzk/#equivalences-are-contractible-maps","title":"Equivalences are contractible maps","text":"
#def is-contr-map-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-contr-map A B f\n  :=\n\\ b \u2192\n    ( is-split-surjection-is-half-adjoint-equiv A B f\n      ( is-half-adjoint-equiv-is-equiv A B f is-equiv-f) b ,\n\\ z \u2192 contraction-fib-is-half-adjoint-equiv A B f\n        ( is-half-adjoint-equiv-is-equiv A B f is-equiv-f) b z)\n#def is-contr-map-iff-is-equiv\n( A B : U)\n( f : A \u2192 B)\n  : iff (is-contr-map A B f) (is-equiv A B f)\n  := (is-equiv-is-contr-map A B f , is-contr-map-is-equiv A B f)\n
"},{"location":"hott/07-fibers.rzk/#fibers-of-projections","title":"Fibers of projections","text":"

For a family of types B : A \u2192 U, the fiber of the projection from total-type A B to A over a : A is equivalent to B a. While both types deserve the name \"fibers\" to disambiguate, we temporarily refer to the fiber as the \"homotopy fiber\" and B a as the \"strict fiber.\"

#section strict-vs-homotopy-fiber\n#variable A : U\n#variable B : A \u2192 U\n#def homotopy-fiber-strict-fiber\n(a : A)\n(b : B a)\n  : fib (total-type A B) A (projection-total-type A B) a\n  := ((a, b), refl)\n#def strict-fiber-homotopy-fiber\n(a : A)\n  (((a', b'), p) : fib (total-type A B) A (projection-total-type A B) a)\n  : B a\n  := transport A B a' a p b'\n#def retract-homotopy-fiber-strict-fiber\n(a : A)\n(b : B a)\n  : strict-fiber-homotopy-fiber a (homotopy-fiber-strict-fiber a b) = b\n  := refl\n#def calculation-retract-strict-fiber-homotopy-fiber\n(a : A)\n(b : B a)\n  : homotopy-fiber-strict-fiber a\n    ( strict-fiber-homotopy-fiber a ((a, b), refl)) =\n    ( (a, b), refl)\n  := refl\n#def retract-strict-fiber-homotopy-fiber\n(a : A)\n  (((a', b'), p) : fib (total-type A B) A (projection-total-type A B) a)\n  : homotopy-fiber-strict-fiber a (strict-fiber-homotopy-fiber a ((a', b'), p))\n    = ((a', b'), p)\n  :=\n    ind-fib\n    ( total-type A B)\n    ( A)\n    ( projection-total-type A B)\n    ( \\ a0 ((a'', b''), p') \u2192\n      homotopy-fiber-strict-fiber a0\n      ( strict-fiber-homotopy-fiber a0 ((a'', b''), p')) = ((a'', b''), p'))\n    ( \\ (a'', b'') \u2192 refl)\n    ( a)\n    ( ((a', b'), p))\n#def equiv-homotopy-fiber-strict-fiber\n(a : A)\n  : Equiv\n    ( B a)\n    ( fib (total-type A B) A (projection-total-type A B) a)\n  :=\n    ( homotopy-fiber-strict-fiber a,\n      ( ( strict-fiber-homotopy-fiber a,\n          retract-homotopy-fiber-strict-fiber a),\n        ( strict-fiber-homotopy-fiber a,\n          retract-strict-fiber-homotopy-fiber a)))\n#end strict-vs-homotopy-fiber\n
"},{"location":"hott/07-fibers.rzk/#fibers-of-composites","title":"Fibers of composites","text":"

The fiber of a composite function is a sum over the fiber of the second function of the fibers of the first function.

#section fiber-composition\n#variables A B C : U\n#variable f : A \u2192 B\n#variable g : B \u2192 C\n#def fiber-sum-fiber-comp\n(c : C)\n  ((a, r) : fib A C (comp A B C g f) c)\n  : ( \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  := ((f a, r), (a, refl))\n#def fiber-comp-fiber-sum\n(c : C)\n  ( ((b, q), (a, p)) : \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  : fib A C (comp A B C g f) c\n  := (a, concat C (g (f a)) (g b) c (ap B C (f a) b g p) q)\n#def is-retract-fiber-sum-fiber-comp\n(c : C)\n  ((a, r) : fib A C (comp A B C g f) c)\n  : fiber-comp-fiber-sum c (fiber-sum-fiber-comp c (a, r)) = (a, r)\n  :=\n    eq-eq-fiber-\u03a3\n    ( A)\n    ( \\ a0 \u2192 (g (f a0)) = c)\n    ( a)\n    ( concat C (g (f a)) (g (f a)) c refl r)\n    ( r)\n    ( left-unit-concat C (g (f a)) c r)\n#def is-retract-fiber-comp-fiber-sum'\n(c : C)\n  ((b, q) : fib B C g c)\n  : ((a, p) : fib A B f b) \u2192\n    fiber-sum-fiber-comp c (fiber-comp-fiber-sum c ((b, q), (a, p))) =\n    ((b, q), (a, p))\n  :=\n    ind-fib B C g\n    ( \\ c' (b', q') \u2192 ((a, p) : fib A B f b') \u2192\n      fiber-sum-fiber-comp c' (fiber-comp-fiber-sum c' ((b', q'), (a, p))) =\n      ((b', q'), (a, p)))\n    ( \\ b0 (a, p) \u2192\n      ( ind-fib A B f\n        ( \\b0' (a', p') \u2192\n          fiber-sum-fiber-comp (g b0')\n          ( fiber-comp-fiber-sum (g b0') ((b0', refl), (a', p'))) =\n          ((b0', refl), (a', p')))\n        ( \\a0 \u2192 refl)\n        ( b0)\n        ( (a, p))))\n    ( c)\n    ( (b, q))\n#def is-retract-fiber-comp-fiber-sum\n(c : C)\n  ( ((b, q), (a, p)) : \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  : fiber-sum-fiber-comp c (fiber-comp-fiber-sum c ((b, q), (a, p))) =\n    ((b, q), (a, p))\n  := is-retract-fiber-comp-fiber-sum' c (b, q) (a, p)\n#def equiv-fiber-sum-fiber-comp\n(c : C)\n  : Equiv\n    ( fib A C (comp A B C g f) c)\n    ( \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  :=\n    ( fiber-sum-fiber-comp c,\n      ( ( fiber-comp-fiber-sum c,\n          is-retract-fiber-sum-fiber-comp c),\n        ( fiber-comp-fiber-sum c,\n          is-retract-fiber-comp-fiber-sum c)))\n#end fiber-composition\n
"},{"location":"hott/08-families-of-maps.rzk/","title":"8. Families of maps","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/08-families-of-maps.rzk/#fiber-of-total-map","title":"Fiber of total map","text":"

We now calculate the fiber of the map on total spaces associated to a family of maps.

#def total-map\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n  : ( \u03a3 (x : A) , B x) \u2192 (\u03a3 (x : A) , C x)\n  := \\ z \u2192 (first z , f (first z) (second z))\n#def total-map-to-fiber\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : fib (B (first w)) (C (first w)) (f (first w)) (second w) \u2192\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w)\n  :=\n    \\ (b , p) \u2192\n      ( (first w , b) ,\n        eq-eq-fiber-\u03a3 A C (first w) (f (first w) b) (second w) p)\n#def total-map-from-fiber\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w \u2192\n    fib (B (first w)) (C (first w)) (f (first w)) (second w)\n  :=\n    \\ (z , p) \u2192\n    ind-path\n( \u03a3 (x : A) , C x)\n      ( total-map A B C f z)\n      ( \\ w' p' \u2192 fib (B (first w')) (C (first w')) (f (first w')) (second w'))\n      ( second z , refl)\n      ( w)\n      ( p)\n#def total-map-to-fiber-retraction\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : has-retraction\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w)\n    ( total-map-to-fiber A B C f w)\n  :=\n    ( ( total-map-from-fiber A B C f w) ,\n      ( \\ (b , p) \u2192\n        ind-path\n          ( C (first w))\n          ( f (first w) b)\n          ( \\ w1 p' \u2192\n            ( ( total-map-from-fiber A B C f ((first w , w1)))\n              ( (total-map-to-fiber A B C f (first w , w1)) (b , p')))\n            =_{(fib (B (first w)) (C (first w)) (f (first w)) (w1))}\n            ( b , p'))\n          ( refl)\n          ( second w)\n          ( p)))\n#def total-map-to-fiber-section\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : has-section\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w)\n    ( total-map-to-fiber A B C f w)\n  :=\n    ( ( total-map-from-fiber A B C f w) ,\n      ( \\ (z , p) \u2192\n        ind-path\n( \u03a3 (x : A) , C x)\n          ( first z , f (first z) (second z))\n          ( \\ w' p' \u2192\n            ( ( total-map-to-fiber A B C f w')\n              ( ( total-map-from-fiber A B C f w') (z , p'))) =\n            ( z , p'))\n          ( refl)\n          ( w)\n          ( p)))\n#def total-map-to-fiber-is-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : is-equiv\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n      ( total-map A B C f) w)\n    ( total-map-to-fiber A B C f w)\n  :=\n    ( total-map-to-fiber-retraction A B C f w ,\n      total-map-to-fiber-section A B C f w)\n#def total-map-fiber-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : Equiv\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n      ( total-map A B C f) w)\n  := (total-map-to-fiber A B C f w , total-map-to-fiber-is-equiv A B C f w)\n
"},{"location":"hott/08-families-of-maps.rzk/#families-of-equivalences","title":"Families of equivalences","text":"

A family of equivalences induces an equivalence on total spaces and conversely. It will be easiest to work with the incoherent notion of two-sided-inverses.

#def invertible-family-total-inverse\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : ( \u03a3 (x : A) , C x) \u2192 (\u03a3 (x : A) , B x)\n  := \\ (a , c) \u2192 (a , (map-inverse-has-inverse (B a) (C a) (f a) (invfamily a)) c)\n#def invertible-family-total-retraction\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : has-retraction\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n    ( total-map A B C f)\n  :=\n    ( invertible-family-total-inverse A B C f invfamily ,\n      \\ (a , b) \u2192\n        (eq-eq-fiber-\u03a3 A B a\n          ( (map-inverse-has-inverse (B a) (C a) (f a) (invfamily a)) (f a b)) b\n          ( (first (second (invfamily a))) b)))\n#def invertible-family-total-section\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : has-section (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n  :=\n    ( invertible-family-total-inverse A B C f invfamily ,\n      \\ (a , c) \u2192\n        ( eq-eq-fiber-\u03a3 A C a\n          ( f a ((map-inverse-has-inverse (B a) (C a) (f a) (invfamily a)) c)) c\n          ( (second (second (invfamily a))) c)))\n#def invertible-family-total-invertible\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : has-inverse\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n    ( total-map A B C f)\n  :=\n    ( invertible-family-total-inverse A B C f invfamily ,\n      ( second (invertible-family-total-retraction A B C f invfamily) ,\nsecond (invertible-family-total-section A B C f invfamily)))\n#def family-of-equiv-total-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( familyequiv : (a : A) \u2192 is-equiv (B a) (C a) (f a))\n  : is-equiv\n( \u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n  :=\n    is-equiv-has-inverse\n( \u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n    ( invertible-family-total-invertible A B C f\n      ( \\ a \u2192 has-inverse-is-equiv (B a) (C a) (f a) (familyequiv a)))\n#def total-equiv-family-equiv\n( A : U)\n( B C : A \u2192 U)\n( familyeq : (a : A) \u2192 Equiv (B a) (C a))\n  : Equiv (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n  :=\n    ( total-map A B C (\\ a \u2192 first (familyeq a)) ,\n      family-of-equiv-total-equiv A B C\n        ( \\ a \u2192 first (familyeq a))\n        ( \\ a \u2192 second (familyeq a)))\n

The one-way result: that a family of equivalence gives an invertible map (and thus an equivalence) on total spaces.

#def total-has-inverse-family-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( familyequiv : (a : A) \u2192 is-equiv (B a) (C a) (f a))\n  : has-inverse (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n  :=\n    invertible-family-total-invertible A B C f\n    ( \\ a \u2192 has-inverse-is-equiv (B a) (C a) (f a) (familyequiv a))\n

For the converse, we make use of our calculation on fibers. The first implication could be proven similarly.

#def total-contr-map-family-of-contr-maps\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( totalcontrmap :\n    is-contr-map\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n      ( total-map A B C f))\n( a : A)\n  : is-contr-map (B a) (C a) (f a)\n  :=\n\\ c \u2192\n      is-contr-equiv-is-contr'\n        ( fib (B a) (C a) (f a) c)\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n          ( total-map A B C f) ((a , c)))\n        ( total-map-fiber-equiv A B C f ((a , c)))\n        ( totalcontrmap ((a , c)))\n#def total-equiv-family-of-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( totalequiv : is-equiv\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n                ( total-map A B C f))\n(a : A)\n  : is-equiv (B a) (C a) (f a)\n  :=\n    is-equiv-is-contr-map (B a) (C a) (f a)\n( total-contr-map-family-of-contr-maps A B C f\n      ( is-contr-map-is-equiv\n        ( \u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n        ( total-map A B C f) totalequiv) a)\n#def family-equiv-total-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( totalequiv : is-equiv\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n                ( total-map A B C f))\n( a : A)\n  : Equiv (B a) (C a)\n  := ( f a , total-equiv-family-of-equiv A B C f totalequiv a)\n

In summary, a family of maps is an equivalence iff the map on total spaces is an equivalence.

#def total-equiv-iff-family-of-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n  : iff\n( (a : A) \u2192 is-equiv (B a) (C a) (f a))\n( is-equiv (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n        ( total-map A B C f))\n  := (family-of-equiv-total-equiv A B C f , total-equiv-family-of-equiv A B C f)\n
"},{"location":"hott/08-families-of-maps.rzk/#endpoint-based-path-spaces","title":"Endpoint based path spaces","text":"An equivalence between the based path spaces
#def equiv-based-paths\n( A : U)\n( a : A)\n  : Equiv (\u03a3 (x : A) , x = a) (\u03a3 (x : A) , a = x)\n  := total-equiv-family-equiv A (\\ x \u2192 x = a) (\\ x \u2192 a = x) (\\ x \u2192 equiv-rev A x a)\n
Endpoint based path spaces are contractible
#def is-contr-endpoint-based-paths\n( A : U)\n( a : A)\n  : is-contr (\u03a3 (x : A) , x = a)\n  :=\n    is-contr-equiv-is-contr' (\u03a3 (x : A) , x = a) (\u03a3 (x : A) , a = x)\n      ( equiv-based-paths A a)\n      ( is-contr-based-paths A a)\n
"},{"location":"hott/08-families-of-maps.rzk/#pullback-of-a-type-family","title":"Pullback of a type family","text":"

A family of types over B pulls back along any function f : A \u2192 B to define a family of types over A.

#def pullback\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n  : A \u2192 U\n  := \\ a \u2192 C (f a)\n

The pullback of a family along homotopic maps is equivalent.

#section is-equiv-pullback-htpy\n#variables A B : U\n#variables f g : A \u2192 B\n#variable \u03b1 : homotopy A B f g\n#variable C : B \u2192 U\n#variable a : A\n#def pullback-homotopy\n  : (pullback A B f C a) \u2192 (pullback A B g C a)\n  := transport B C (f a) (g a) (\u03b1 a)\n#def map-inverse-pullback-homotopy\n  : (pullback A B g C a) \u2192 (pullback A B f C a)\n  := transport B C (g a) (f a) (rev B (f a) (g a) (\u03b1 a))\n#def has-retraction-pullback-homotopy\n  : has-retraction\n    ( pullback A B f C a)\n    ( pullback A B g C a)\n    ( pullback-homotopy)\n  :=\n    ( map-inverse-pullback-homotopy ,\n\\ c \u2192\n        concat\n        ( pullback A B f C a)\n        ( transport B C (g a) (f a)\n          ( rev B (f a) (g a) (\u03b1 a))\n          ( transport B C (f a) (g a) (\u03b1 a) c))\n        ( transport B C (f a) (f a)\n          ( concat B (f a) (g a) (f a) (\u03b1 a) (rev B (f a) (g a) (\u03b1 a))) c)\n        ( c)\n        ( transport-concat-rev B C (f a) (g a) (f a) (\u03b1 a)\n          ( rev B (f a) (g a) (\u03b1 a)) c)\n        ( transport2 B C (f a) (f a)\n          ( concat B (f a) (g a) (f a) (\u03b1 a) (rev B (f a) (g a) (\u03b1 a))) refl\n          ( right-inverse-concat B (f a) (g a) (\u03b1 a)) c))\n#def has-section-pullback-homotopy\n  : has-section (pullback A B f C a) (pullback A B g C a)\n    ( pullback-homotopy)\n  :=\n    ( map-inverse-pullback-homotopy ,\n\\ c \u2192\n      concat\n        ( pullback A B g C a)\n        ( transport B C (f a) (g a) (\u03b1 a)\n          ( transport B C (g a) (f a) (rev B (f a) (g a) (\u03b1 a)) c))\n        ( transport B C (g a) (g a)\n          ( concat B (g a) (f a) (g a) (rev B (f a) (g a) (\u03b1 a)) (\u03b1 a)) c)\n        ( c)\n        ( transport-concat-rev B C (g a) (f a) (g a)\n          ( rev B (f a) (g a) (\u03b1 a)) (\u03b1 a) (c))\n        ( transport2 B C (g a) (g a)\n          ( concat B (g a) (f a) (g a) (rev B (f a) (g a) (\u03b1 a)) (\u03b1 a))\n          ( refl)\n          ( left-inverse-concat B (f a) (g a) (\u03b1 a)) c))\n#def is-equiv-pullback-homotopy uses (\u03b1)\n  : is-equiv\n      ( pullback A B f C a)\n      ( pullback A B g C a)\n      ( pullback-homotopy)\n  := ( has-retraction-pullback-homotopy , has-section-pullback-homotopy)\n#def equiv-pullback-homotopy uses (\u03b1)\n  : Equiv (pullback A B f C a) (pullback A B g C a)\n  := (pullback-homotopy , is-equiv-pullback-homotopy)\n#end is-equiv-pullback-htpy\n

The total space of a pulled back family of types maps to the original total space.

#def pullback-comparison-map\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n  : (\u03a3 (a : A) , (pullback A B f C) a) \u2192 (\u03a3 (b : B) , C b)\n  := \\ (a , c) \u2192 (f a , c)\n

Now we show that if a family is pulled back along an equivalence, the total spaces are equivalent by proving that the comparison is a contractible map. For this, we first prove that each fiber is equivalent to a fiber of the original map.

#def pullback-comparison-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : U\n  :=\n    fib\n( \u03a3 (a : A) , (pullback A B f C) a)\n( \u03a3 (b : B) , C b)\n      ( pullback-comparison-map A B f C) z\n#def pullback-comparison-fiber-to-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : (pullback-comparison-fiber A B f C z) \u2192 (fib A B f (first z))\n  :=\n    \\ (w , p) \u2192\n    ind-path\n( \u03a3 (b : B) , C b)\n      ( pullback-comparison-map A B f C w)\n      ( \\ z' p' \u2192\n        ( fib A B f (first z')))\n      ( first w , refl)\n      ( z)\n      ( p)\n#def from-base-fiber-to-pullback-comparison-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( b : B)\n  : (fib A B f b) \u2192 (c : C b) \u2192 (pullback-comparison-fiber A B f C (b , c))\n  :=\n    \\ (a , p) \u2192\n    ind-path\n      ( B)\n      ( f a)\n( \\ b' p' \u2192\n          (c : C b') \u2192 (pullback-comparison-fiber A B f C ((b' , c))))\n      ( \\ c \u2192 ((a , c) , refl))\n      ( b)\n      ( p)\n#def pullback-comparison-fiber-to-fiber-inv\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : (fib A B f (first z)) \u2192 (pullback-comparison-fiber A B f C z)\n  :=\n    \\ (a , p) \u2192\n      from-base-fiber-to-pullback-comparison-fiber A B f C\n      ( first z) (a , p) (second z)\n#def pullback-comparison-fiber-to-fiber-retracting-homotopy\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  ( (w , p) : pullback-comparison-fiber A B f C z)\n  : ( (pullback-comparison-fiber-to-fiber-inv A B f C z)\n      ( (pullback-comparison-fiber-to-fiber A B f C z) (w , p))) = (w , p)\n  :=\n    ind-path\n( \u03a3 (b : B) , C b)\n      ( pullback-comparison-map A B f C w)\n      ( \\ z' p' \u2192\n        ( ( pullback-comparison-fiber-to-fiber-inv A B f C z')\n          ( ( pullback-comparison-fiber-to-fiber A B f C z') (w , p'))) =\n        ( w , p'))\n      ( refl)\n      ( z)\n      ( p)\n#def pullback-comparison-fiber-to-fiber-section-homotopy-map\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( b : B)\n  ( (a , p) : fib A B f b)\n  : (c : C b) \u2192\n      ((pullback-comparison-fiber-to-fiber A B f C (b , c))\n        ((pullback-comparison-fiber-to-fiber-inv A B f C (b , c)) (a , p))) =\n      (a , p)\n  :=\n    ind-path\n      ( B)\n      ( f a)\n( \\ b' p' \u2192\n        ( c : C b') \u2192\n        ( ( pullback-comparison-fiber-to-fiber A B f C (b' , c))\n          ( (pullback-comparison-fiber-to-fiber-inv A B f C (b' , c)) (a , p'))) =\n        ( a , p'))\n      ( \\ c \u2192 refl)\n      ( b)\n      ( p)\n#def pullback-comparison-fiber-to-fiber-section-homotopy\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  ( (a , p) : fib A B f (first z))\n  : ( pullback-comparison-fiber-to-fiber A B f C z\n      ( pullback-comparison-fiber-to-fiber-inv A B f C z (a , p))) = (a , p)\n  :=\n    pullback-comparison-fiber-to-fiber-section-homotopy-map A B f C\n      ( first z) (a , p) (second z)\n#def equiv-pullback-comparison-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : Equiv (pullback-comparison-fiber A B f C z) (fib A B f (first z))\n  :=\n    ( pullback-comparison-fiber-to-fiber A B f C z ,\n      ( ( pullback-comparison-fiber-to-fiber-inv A B f C z ,\n          pullback-comparison-fiber-to-fiber-retracting-homotopy A B f C z) ,\n        ( pullback-comparison-fiber-to-fiber-inv A B f C z ,\n          pullback-comparison-fiber-to-fiber-section-homotopy A B f C z)))\n

As a corollary, we show that pullback along an equivalence induces an equivalence of total spaces.

#def total-equiv-pullback-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( C : B \u2192 U)\n  : Equiv (\u03a3 (a : A) , (pullback A B f C) a) (\u03a3 (b : B) , C b)\n  :=\n( pullback-comparison-map A B f C ,\n      is-equiv-is-contr-map\n        ( \u03a3 (a : A) , (pullback A B f C) a)\n( \u03a3 (b : B) , C b)\n        ( pullback-comparison-map A B f C)\n        ( \\ z \u2192\n          ( is-contr-equiv-is-contr'\n            ( pullback-comparison-fiber A B f C z)\n            ( fib A B f (first z))\n            ( equiv-pullback-comparison-fiber A B f C z)\n            ( is-contr-map-is-equiv A B f is-equiv-f (first z)))))\n
"},{"location":"hott/08-families-of-maps.rzk/#fundamental-theorem-of-identity-types","title":"Fundamental theorem of identity types","text":"
#section fundamental-thm-id-types\n#variable A : U\n#variable a : A\n#variable B : A \u2192 U\n#variable f : (x : A) \u2192 (a = x) \u2192 B x\n#def fund-id-fam-of-eqs-implies-sum-over-codomain-contr\n  : ((x : A) \u2192 (is-equiv (a = x) (B x) (f x))) \u2192 (is-contr (\u03a3 (x : A) , B x))\n  :=\n( \\ familyequiv \u2192\n      ( equiv-with-contractible-domain-implies-contractible-codomain\n        ( \u03a3 (x : A) , a = x) (\u03a3 (x : A) , B x)\n        ( ( total-map A ( \\ x \u2192 (a = x)) B f) ,\n( is-equiv-has-inverse (\u03a3 (x : A) , a = x) (\u03a3 (x : A) , B x)\n            ( total-map A ( \\ x \u2192 (a = x)) B f)\n            ( total-has-inverse-family-equiv A\n              ( \\ x \u2192 (a = x)) B f familyequiv)))\n        ( is-contr-based-paths A a)))\n#def fund-id-sum-over-codomain-contr-implies-fam-of-eqs\n  : ( is-contr (\u03a3 (x : A) , B x)) \u2192\n( (x : A) \u2192 (is-equiv (a = x) (B x) (f x)))\n  :=\n    ( \\ is-contr-\u03a3-A-B x \u2192\n      total-equiv-family-of-equiv A\n        ( \\ x' \u2192 (a = x'))\n        ( B)\n        ( f)\n( is-equiv-are-contr\n          ( \u03a3 (x' : A) , (a = x'))\n( \u03a3 (x' : A) , (B x'))\n          ( is-contr-based-paths A a)\n          ( is-contr-\u03a3-A-B)\n          ( total-map A (\\ x' \u2192 (a = x')) B f))\n        ( x))\n

This allows us to apply \"based path induction\" to a family satisfying the fundamental theorem:

-- Please suggest a better name.\n#def ind-based-path\n( familyequiv : (z : A) \u2192 (is-equiv (a = z) (B z) (f z)))\n( P : (z : A) \u2192 B z \u2192 U)\n( p0 : P a (f a refl))\n( u : A)\n( p : B u)\n  : P u p\n  :=\n    ind-sing\n( \u03a3 (v : A) , B v)\n      ( a , f a refl)\n      ( \\ (u' , p') \u2192 P u' p')\n( contr-implies-singleton-induction-pointed\n        ( \u03a3 (z : A) , B z)\n        ( fund-id-fam-of-eqs-implies-sum-over-codomain-contr familyequiv)\n        ( \\ (x' , p') \u2192 P x' p'))\n      ( p0)\n      ( u , p)\n#end fundamental-thm-id-types\n
"},{"location":"hott/08-families-of-maps.rzk/#maps-over-product-types","title":"Maps over product types","text":"

For later use, we specialize the previous results to the case of a family of types over a product type.

#section fibered-map-over-product\n#variables A A' B B' : U\n#variable C : A \u2192 B \u2192 U\n#variable C' : A' \u2192 B' \u2192 U\n#variable f : A \u2192 A'\n#variable g : B \u2192 B'\n#variable h : (a : A) \u2192 (b : B) \u2192 (c : C a b) \u2192 C' (f a) (g b)\n#def total-map-fibered-map-over-product\n  : (\u03a3 (a : A) , (\u03a3 (b : B) , C a b)) \u2192 (\u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n  := \\ (a , (b , c)) \u2192 (f a , (g b , h a b c))\n#def pullback-is-equiv-base-is-equiv-total-is-equiv\n( is-equiv-total :\n    is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n      ( total-map-fibered-map-over-product))\n( is-equiv-f : is-equiv A A' f)\n  : is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b' : B') , C' (f a) b'))\n      ( \\ (a , (b , c)) \u2192 (a , (g b , h a b c)))\n  :=\n    is-equiv-right-factor\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b' : B') , C' (f a) b'))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n    ( \\ (a , (b , c)) \u2192 (a , (g b , h a b c)))\n    ( \\ (a , (b' , c')) \u2192 (f a , (b' , c')))\n    ( second\n      ( total-equiv-pullback-is-equiv\n        ( A) (A')\n        ( f) (is-equiv-f)\n( \\ a' \u2192 (\u03a3 (b' : B') , C' a' b'))))\n    ( is-equiv-total)\n#def pullback-is-equiv-bases-are-equiv-total-is-equiv\n( is-equiv-total :\n      is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n        ( total-map-fibered-map-over-product))\n( is-equiv-f : is-equiv A A' f)\n( is-equiv-g : is-equiv B B' g)\n  : is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b : B) , C' (f a) (g b)))\n      ( \\ (a , (b , c)) \u2192 (a , (b , h a b c)))\n  :=\n    is-equiv-right-factor\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b : B) , C' (f a) (g b)))\n( \u03a3 (a : A) , (\u03a3 (b' : B') , C' (f a) b'))\n    ( \\ (a , (b , c)) \u2192 (a , (b , h a b c)))\n    ( \\ (a , (b , c)) \u2192 (a , (g b , c)))\n( family-of-equiv-total-equiv A\n      ( \\ a \u2192 (\u03a3 (b : B) , C' (f a) (g b)))\n( \\ a \u2192 (\u03a3 (b' : B') , C' (f a) b'))\n      ( \\ a (b , c) \u2192 (g b , c))\n      ( \\ a \u2192\n        ( second\n          ( total-equiv-pullback-is-equiv\n            ( B) (B')\n            ( g) (is-equiv-g)\n            ( \\ b' \u2192 C' (f a) b')))))\n    ( pullback-is-equiv-base-is-equiv-total-is-equiv is-equiv-total is-equiv-f)\n#def fibered-map-is-equiv-bases-are-equiv-total-map-is-equiv\n( is-equiv-total :\n      is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n        ( total-map-fibered-map-over-product))\n( is-equiv-f : is-equiv A A' f)\n( is-equiv-g : is-equiv B B' g)\n( a0 : A)\n( b0 : B)\n  : is-equiv (C a0 b0) (C' (f a0) (g b0)) (h a0 b0)\n  :=\n    total-equiv-family-of-equiv B\n      ( \\ b \u2192 C a0 b)\n      ( \\ b \u2192 C' (f a0) (g b))\n      ( \\ b c \u2192 h a0 b c)\n      ( total-equiv-family-of-equiv\n        ( A)\n( \\ a \u2192 (\u03a3 (b : B) , C a b))\n( \\ a \u2192 (\u03a3 (b : B) , C' (f a) (g b)))\n        ( \\ a (b , c) \u2192 (b , h a b c))\n        ( pullback-is-equiv-bases-are-equiv-total-is-equiv\n            is-equiv-total is-equiv-f is-equiv-g)\n        ( a0))\n      ( b0)\n#end fibered-map-over-product\n
"},{"location":"hott/09-propositions.rzk/","title":"9. Propositions","text":"

This is a literate rzk file:

#lang rzk-1\n

Some of the definitions in this file rely on function extensionality and weak function extensionality:

#assume funext : FunExt\n#assume weakfunext : WeakFunExt\n
"},{"location":"hott/09-propositions.rzk/#propositions","title":"Propositions","text":"

A type is a proposition when its identity types are contractible.

#def is-prop\n(A : U)\n  : U\n  := (a : A) \u2192 (b : A) \u2192 is-contr (a = b)\n#def is-prop-Unit\n  : is-prop Unit\n  := \\ x y \u2192 (path-types-of-Unit-are-contractible x y)\n
"},{"location":"hott/09-propositions.rzk/#alternative-characterizations-definitions","title":"Alternative characterizations: definitions","text":"
#def all-elements-equal\n(A : U)\n  : U\n  := (a : A) \u2192 (b : A) \u2192 (a = b)\n#def is-contr-is-inhabited\n(A : U)\n  : U\n  := A \u2192 is-contr A\n#def is-emb-terminal-map\n(A : U)\n  : U\n  := is-emb A Unit (terminal-map A)\n
"},{"location":"hott/09-propositions.rzk/#alternative-characterizations-proofs","title":"Alternative characterizations: proofs","text":"
#def all-elements-equal-is-prop\n( A : U)\n( is-prop-A : is-prop A)\n  : all-elements-equal A\n  := \\ a b \u2192 (first (is-prop-A a b))\n#def is-contr-is-inhabited-all-elements-equal\n( A : U)\n( all-elements-equal-A : all-elements-equal A)\n  : is-contr-is-inhabited A\n  := \\ a \u2192 (a , all-elements-equal-A a)\n#def terminal-map-is-emb-is-inhabited-is-contr-is-inhabited\n( A : U)\n( c : is-contr-is-inhabited A)\n  : A \u2192 (is-emb-terminal-map A)\n  :=\n\\ x \u2192\n      ( is-emb-is-equiv A Unit (terminal-map A)\n        ( contr-implies-terminal-map-is-equiv A (c x)))\n#def terminal-map-is-emb-is-contr-is-inhabited\n( A : U)\n( c : is-contr-is-inhabited A)\n  : (is-emb-terminal-map A)\n  :=\n    ( is-emb-is-inhabited-emb A Unit (terminal-map A)\n      ( terminal-map-is-emb-is-inhabited-is-contr-is-inhabited A c))\n#def is-prop-is-emb-terminal-map\n( A : U)\n( f : is-emb-terminal-map A)\n  : is-prop A\n  :=\n\\ x y \u2192\n      ( is-contr-equiv-is-contr' (x = y) (unit = unit)\n        ( (ap A Unit x y (terminal-map A)) , (f x y))\n        ( path-types-of-Unit-are-contractible unit unit))\n#def is-prop-is-contr-is-inhabited\n( A : U)\n( c : is-contr-is-inhabited A)\n  : is-prop A\n  :=\n    ( is-prop-is-emb-terminal-map A\n      ( terminal-map-is-emb-is-contr-is-inhabited A c))\n
"},{"location":"hott/09-propositions.rzk/#properties-of-propositions","title":"Properties of propositions","text":"

If some family B : A \u2192 U is fiberwise a proposition, then the type of dependent functions (x : A) \u2192 B x is a proposition.

#def is-prop-fiberwise-prop uses (funext weakfunext)\n( A : U)\n( B : A \u2192 U)\n( fiberwise-prop-B : (x : A) \u2192 is-prop (B x))\n  : is-prop ((x : A) \u2192 B x)\n  :=\n\\ f g \u2192\n    is-contr-equiv-is-contr'\n      ( f = g)\n( (x : A) \u2192 f x = g x)\n      ( equiv-FunExt funext A B f g)\n      ( weakfunext A (\\ x \u2192 f x = g x) (\\ x \u2192 fiberwise-prop-B x (f x) (g x)))\n

If two propositions are logically equivalent, then they are equivalent:

#def is-equiv-iff-is-prop-is-prop\n( A B : U)\n( is-prop-A : is-prop A)\n( is-prop-B : is-prop B)\n  ( (f , g) : iff A B)\n  : is-equiv A B f\n  :=\n    ( ( g ,\n\\ a \u2192\n          (all-elements-equal-is-prop A is-prop-A) ((comp A B A g f) a) a) ,\n      ( g ,\n\\ b \u2192\n          (all-elements-equal-is-prop B is-prop-B) ((comp B A B f g) b) b))\n#def equiv-iff-is-prop-is-prop\n( A B : U)\n( is-prop-A : is-prop A)\n( is-prop-B : is-prop B)\n( e : iff A B)\n  : Equiv A B\n  := (first e, is-equiv-iff-is-prop-is-prop A B is-prop-A is-prop-B e)\n
"},{"location":"hott/10-trivial-fibrations.rzk/","title":"10. Trivial Fibrations","text":"

This is a literate rzk file:

#lang rzk-1\n

In what follows we show that the projection from the total space of a Sigma type is an equivalence if and only if its fibers are contractible.

"},{"location":"hott/10-trivial-fibrations.rzk/#contractible-fibers","title":"Contractible fibers","text":"

The following type asserts that the fibers of a type family are contractible.

#def contractible-fibers\n( A : U)\n( B : A \u2192 U)\n  : U\n  := ((x : A) \u2192 is-contr (B x))\n#section contractible-fibers-data\n#variable A : U\n#variable B : A \u2192 U\n#variable contractible-fibers-A-B : contractible-fibers A B\n
The center of contraction in contractible fibers
#def contractible-fibers-section\n  : (x : A) \u2192 B x\n  := \\ x \u2192 center-contraction (B x) (contractible-fibers-A-B x)\n
The section of the total space projection built from the contraction centers
#def contractible-fibers-actual-section uses (contractible-fibers-A-B)\n  : (a : A) \u2192 \u03a3 (x : A) , B x\n  := \\ a \u2192 (a , contractible-fibers-section a)\n#def contractible-fibers-section-htpy uses (contractible-fibers-A-B)\n  : homotopy A A\n( comp A (\u03a3 (x : A) , B x) A\n      ( projection-total-type A B) (contractible-fibers-actual-section))\n    ( identity A)\n  := \\ x \u2192 refl\n#def contractible-fibers-section-is-section uses (contractible-fibers-A-B)\n  : has-section (\u03a3 (x : A) , B x) A (projection-total-type A B)\n  := (contractible-fibers-actual-section , contractible-fibers-section-htpy)\n

This can be used to define the retraction homotopy for the total space projection, called first here:

#def contractible-fibers-retraction-htpy\n  : (z : \u03a3 (x : A) , B x) \u2192\n      (contractible-fibers-actual-section) (first z) = z\n  :=\n\\ z \u2192\n    eq-eq-fiber-\u03a3 A B\n      ( first z)\n      ( (contractible-fibers-section) (first z))\n      ( second z)\n      ( homotopy-contraction (B (first z)) (contractible-fibers-A-B (first z)) (second z))\n#def contractible-fibers-retraction uses (contractible-fibers-A-B)\n  : has-retraction (\u03a3 (x : A) , B x) A (projection-total-type A B)\n  := (contractible-fibers-actual-section , contractible-fibers-retraction-htpy)\n

The first half of our main result:

#def is-equiv-projection-contractible-fibers uses (contractible-fibers-A-B)\n  : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B)\n  := (contractible-fibers-retraction , contractible-fibers-section-is-section)\n#def equiv-projection-contractible-fibers uses (contractible-fibers-A-B)\n  : Equiv (\u03a3 (x : A) , B x) A\n  := (projection-total-type A B , is-equiv-projection-contractible-fibers)\n#end contractible-fibers-data\n
"},{"location":"hott/10-trivial-fibrations.rzk/#projection-equivalences","title":"Projection equivalences","text":"

From a projection equivalence, it's not hard to inhabit fibers:

#def inhabited-fibers-is-equiv-projection\n( A : U)\n( B : A \u2192 U)\n( proj-B-to-A-is-equiv : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n( a : A)\n  : B a\n  :=\n    transport A B (first ((first (second proj-B-to-A-is-equiv)) a)) a\n      ( (second (second proj-B-to-A-is-equiv)) a)\n      ( second ((first (second proj-B-to-A-is-equiv)) a))\n

This is great but we need more coherence to show that the inhabited fibers are contractible; the following proof fails:

#def is-equiv-projection-implies-contractible-fibers\n  ( A : U)\n  ( B : A \u2192 U)\n  ( proj-B-to-A-is-equiv : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n  : contractible-fibers A B\n  :=\n    ( \\ x \u2192 (second (first (first proj-B-to-A-is-equiv) x) ,\n      ( \\ u \u2192\n        second-path-\u03a3 A B (first (first proj-B-to-A-is-equiv) x) (x , u)\n          ( second (first proj-B-to-A-is-equiv) (x , u)))))\n
#section projection-hae-data\n#variable A : U\n#variable B : A \u2192 U\n#variable proj-B-to-A-is-half-adjoint-equivalence :\n  is-half-adjoint-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B)\n#variable w : (\u03a3 (x : A) , B x)\n

We start over from a stronger hypothesis of a half adjoint equivalence.

#def projection-hae-inverse\n(a : A)\n  : \u03a3 (x : A) , B x\n  := (first (first proj-B-to-A-is-half-adjoint-equivalence)) a\n#def projection-hae-base-htpy uses (B)\n(a : A)\n  : (first (projection-hae-inverse a)) = a\n  := (second (second (first proj-B-to-A-is-half-adjoint-equivalence))) a\n#def projection-hae-section uses (proj-B-to-A-is-half-adjoint-equivalence)\n(a : A)\n  : B a\n  :=\n    transport A B (first (projection-hae-inverse a)) a\n      ( projection-hae-base-htpy a)\n      ( second (projection-hae-inverse a))\n#def projection-hae-total-htpy\n  : (projection-hae-inverse (first w)) = w\n  := (first (second (first proj-B-to-A-is-half-adjoint-equivalence))) w\n#def projection-hae-fibered-htpy\n  : (transport A B (first ((projection-hae-inverse (first w)))) (first w)\n    ( first-path-\u03a3 A B\n      ( projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy))\n    ( second (projection-hae-inverse (first w)))) =\n    ( second w)\n  :=\n    second-path-\u03a3 A B (projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy)\n#def projection-hae-base-coherence\n  : ( projection-hae-base-htpy (first w)) =\n    ( first-path-\u03a3 A B (projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy))\n  := (second proj-B-to-A-is-half-adjoint-equivalence) w\n#def projection-hae-transport-coherence\n  : ( projection-hae-section (first w)) =\n    ( transport A B (first ((projection-hae-inverse (first w)))) (first w)\n      ( first-path-\u03a3 A B\n        ( projection-hae-inverse (first w)) w\n        ( projection-hae-total-htpy))\n      ( second (projection-hae-inverse (first w))))\n  :=\n    transport2 A B (first (projection-hae-inverse (first w))) (first w)\n    ( projection-hae-base-htpy (first w))\n    ( first-path-\u03a3 A B (projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy))\n    ( projection-hae-base-coherence)\n    ( second (projection-hae-inverse (first w)))\n#def projection-hae-fibered-homotopy-contraction\n  : (projection-hae-section (first w)) =_{B (first w)} (second w)\n  :=\n    concat (B (first w))\n      ( projection-hae-section (first w))\n      ( transport A B\n        ( first ((projection-hae-inverse (first w))))\n        ( first w)\n        ( first-path-\u03a3 A B (projection-hae-inverse (first w)) w\n          ( projection-hae-total-htpy))\n        ( second (projection-hae-inverse (first w))))\n      ( second w)\n      ( projection-hae-transport-coherence)\n      ( projection-hae-fibered-htpy)\n#end projection-hae-data\n

Finally, we have:

#def contractible-fibers-is-half-adjoint-equiv-projection\n( A : U)\n( B : A \u2192 U)\n( proj-B-to-A-is-half-adjoint-equivalence\n    : is-half-adjoint-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n  : contractible-fibers A B\n  :=\n\\ x \u2192\n      ( (projection-hae-section A B proj-B-to-A-is-half-adjoint-equivalence x) ,\n\\ u \u2192\n          projection-hae-fibered-homotopy-contraction\n          A B proj-B-to-A-is-half-adjoint-equivalence (x , u))\n
The converse to our first result
#def contractible-fibers-is-equiv-projection\n( A : U)\n( B : A \u2192 U)\n( proj-B-to-A-is-equiv\n    : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n  : contractible-fibers A B\n  :=\n    contractible-fibers-is-half-adjoint-equiv-projection A B\n( is-half-adjoint-equiv-is-equiv (\u03a3 (x : A) , B x) A\n        ( projection-total-type A B) proj-B-to-A-is-equiv)\n
The main theorem
#def projection-theorem\n( A : U)\n( B : A \u2192 U)\n  : iff\n( is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n    ( contractible-fibers A B)\n  :=\n    ( \\ proj-B-to-A-is-equiv \u2192\n      contractible-fibers-is-equiv-projection A B proj-B-to-A-is-equiv ,\n\\ contractible-fibers-A-B \u2192\n      is-equiv-projection-contractible-fibers A B contractible-fibers-A-B)\n
"},{"location":"hott/10-trivial-fibrations.rzk/#equivalence-between-domain-and-sum-of-fibers","title":"Equivalence between domain and sum of fibers","text":"

For any map f : A \u2192 B the domain A is equivalent to the sum of the fibers.

#def equiv-domain-sum-of-fibers\n(A B : U)\n(f : A \u2192 B)\n  : Equiv A (\u03a3 (b : B), fib A B f b)\n  :=\n    equiv-left-cancel\n( \u03a3 (a : A), \u03a3 (b : B), f a = b)\n    ( A)\n( \u03a3 (b : B), fib A B f b)\n( equiv-projection-contractible-fibers\n      A\n      ( \\ a \u2192 \u03a3 (b : B), f a = b)\n      ( \\ a \u2192 is-contr-based-paths B (f a)))\n    ( fubini-\u03a3 A B (\\ a b \u2192 f a = b))\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/","title":"11. Homotopy cartesian squares","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#homotopy-cartesian-squares","title":"Homotopy cartesian squares","text":"

We start by fixing the data of a map between two type families A' \u2192 U and A \u2192 U, which we think of as a commutative square

\u03a3 A' \u2192 \u03a3 A\n \u2193      \u2193\n A'  \u2192  A\n

#section homotopy-cartesian\n-- We prepend all local names in this section\n-- with the random identifier temp-uBDx\n-- to avoid cluttering the global name space.\n-- Once rzk supports local variables, these should be renamed.\n#variable A' : U\n#variable C' : A' \u2192 U\n#variable A : U\n#variable C : A \u2192 U\n#variable \u03b1 : A' \u2192 A\n#variable \u03b3 : (a' : A') \u2192 C' a' \u2192 C (\u03b1 a')\n#def temp-uBDx-\u03a3\u03b1\u03b3\n  : total-type A' C' \u2192 total-type A C\n  := \\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c')\n

We say that such a square is homotopy cartesian just if it induces an equivalence componentwise.

#def is-homotopy-cartesian uses (A)\n  : U\n  :=\n( a' : A') \u2192 is-equiv (C' a') (C (\u03b1 a')) (\u03b3 a')\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#interaction-with-horizontal-equivalences","title":"Interaction with horizontal equivalences","text":"

We implement various ways homotopy-cartesian squares interact with horizontal equivalences.

For example, if the lower map \u03b1 : A' \u2192 A is an equivalence in a homotopy cartesian square, then so is the upper one \u03a3\u03b1\u03b3 : \u03a3 C' \u2192 \u03a3 C.

#def temp-uBDx-comp\n  : (total-type A' C') \u2192 (total-type A C)\n  := comp\n      ( total-type A' C')\n( \u03a3 (a' : A'), C (\u03b1 a'))\n      ( total-type A C)\n      ( \\ (a', c) \u2192 (\u03b1 a', c) )\n      ( total-map A' C' (\\ a' \u2192 C (\u03b1 a')) \u03b3)\n#def pull-up-equiv-is-homotopy-cartesian\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian)\n( is-equiv-\u03b1 : is-equiv A' A \u03b1)\n  : is-equiv (total-type A' C') (total-type A C) (\\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n  :=\n    is-equiv-homotopy\n      ( total-type A' C')\n      ( total-type A C)\n      ( temp-uBDx-\u03a3\u03b1\u03b3 )\n      ( temp-uBDx-comp )\n      (\\ _ \u2192 refl)\n      ( is-equiv-comp\n        ( total-type A' C')\n( \u03a3 (a' : A'), C (\u03b1 a'))\n        ( total-type A C)\n        ( total-map A' C' (\\ a' \u2192 C (\u03b1 a')) \u03b3)\n        ( family-of-equiv-total-equiv\n          ( A' )\n          ( C' )\n          ( \\ a' \u2192 C (\u03b1 a') )\n          ( \u03b3)\n          ( \\ a' \u2192 is-hc-\u03b1-\u03b3 a'))\n        ( \\ (a', c) \u2192 (\u03b1 a', c) )\n        ( second\n          ( total-equiv-pullback-is-equiv\n            ( A')\n            ( A )\n            ( \u03b1 )\n            ( is-equiv-\u03b1 )\n            ( C ))))\n

Conversely, if both the upper and the lower maps are equivalences, then the square is homotopy-cartesian.

#def is-homotopy-cartesian-is-horizontal-equiv\n( is-equiv-\u03b1 : is-equiv A' A \u03b1)\n( is-equiv-\u03a3\u03b1\u03b3 : is-equiv\n      (total-type A' C') (total-type A C) (\\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n  )\n  : is-homotopy-cartesian\n  :=\n    total-equiv-family-of-equiv\n        A' C' ( \\ x \u2192 C (\u03b1 x) ) \u03b3    -- use x instead of a' to avoid shadowing\n        ( is-equiv-right-factor\n            ( total-type A' C')\n( \u03a3 (x : A'), C (\u03b1 x))\n            ( total-type A C)\n            ( total-map A' C' (\\ x \u2192 C (\u03b1 x)) \u03b3)\n            ( \\ (x, c) \u2192 (\u03b1 x, c) )\n            ( second ( total-equiv-pullback-is-equiv A' A \u03b1 is-equiv-\u03b1 C))\n            ( is-equiv-homotopy\n                ( total-type A' C')\n                ( total-type A C )\n                ( temp-uBDx-comp )\n                ( temp-uBDx-\u03a3\u03b1\u03b3 )\n                ( \\ _ \u2192 refl)\n                ( is-equiv-\u03a3\u03b1\u03b3)))\n

In a general homotopy-cartesian square we cannot deduce is-equiv \u03b1 from is-equiv (\u03a3\u03b3). However, if the square has a vertical section then we can always do this (whether the square is homotopy-cartesian or not).

#def has-section-family-over-map\n  : U\n  :=\n\u03a3 ( ( s', s) : product ((a' : A') \u2192 C' a') ((a : A) \u2192 C a) ),\n( (a' : A') \u2192 \u03b3 a' (s' a') = s (\u03b1 a'))\n#def induced-map-on-fibers-\u03a3 uses (\u03b3)\n( c\u0302 : total-type A C)\n  ( (c\u0302', q\u0302) : fib\n                (total-type A' C') (total-type A C)\n                (\\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n                c\u0302)\n  : fib A' A \u03b1 (first c\u0302)\n  :=\n    (first c\u0302', first-path-\u03a3 A C (temp-uBDx-\u03a3\u03b1\u03b3 c\u0302') c\u0302 q\u0302)\n#def temp-uBDx-helper-type uses (\u03b3 C')\n  ( ((s', s) , \u03b7) : has-section-family-over-map)\n( a : A )\n  ( (a', p) : fib A' A \u03b1 a )\n  : U\n  :=\n\u03a3 ( q\u0302 : temp-uBDx-\u03a3\u03b1\u03b3 (a', s' a') = (a, s a)),\n        ( induced-map-on-fibers-\u03a3 (a, s a) ((a', s' a'), q\u0302) = (a', p))\n#def temp-uBDx-helper uses (\u03b3 C')\n  ( ((s', s) , \u03b7) : has-section-family-over-map)\n  : ( a : A) \u2192\n    ( (a', p) : fib A' A \u03b1 a ) \u2192\n    temp-uBDx-helper-type ((s',s), \u03b7) a (a', p)\n  :=\n    ind-fib A' A \u03b1\n    ( temp-uBDx-helper-type ((s',s), \u03b7))\n    ( \\ a' \u2192\n      ( eq-pair A C (\u03b1 a', \u03b3 a' (s' a')) (\u03b1 a', s (\u03b1 a')) ( refl, \u03b7 a' ) ,\n        eq-pair\n        ( A')\n        ( \\ x \u2192 \u03b1 x = \u03b1 a')\n        ( a' ,\n          first-path-\u03a3 A C\n          ( \u03b1 a', \u03b3 a' (s' a'))\n          ( \u03b1 a', s (\u03b1 a'))\n          ( eq-pair A C (\u03b1 a', \u03b3 a' (s' a')) (\u03b1 a', s (\u03b1 a')) ( refl, \u03b7 a' )))\n        ( a' , refl)\n        ( refl ,\n          first-path-\u03a3-eq-pair\n            A C (\u03b1 a', \u03b3 a' (s' a')) (\u03b1 a', s (\u03b1 a')) ( refl, \u03b7 a' ))))\n#def induced-retraction-on-fibers-with-section uses (\u03b3)\n  ( ((s',s),\u03b7) : has-section-family-over-map)\n( a : A )\n  : ( is-retract-of\n      ( fib A' A \u03b1 a )\n      ( fib\n        ( total-type A' C') (total-type A C)\n        ( \\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n        ( a, s a)))\n  :=\n    ( \\ (a', p) \u2192 ( (a', s' a'), first (temp-uBDx-helper ((s',s),\u03b7) a (a',p))),\n      ( induced-map-on-fibers-\u03a3 (a, s a) ,\n        \\ (a', p) \u2192 second (temp-uBDx-helper ((s',s),\u03b7) a (a',p))))\n#def push-down-equiv-with-section uses (\u03b3)\n  ( ((s',s),\u03b7) : has-section-family-over-map)\n( is-equiv-\u03a3\u03b1\u03b3 : is-equiv\n      (total-type A' C') (total-type A C) temp-uBDx-\u03a3\u03b1\u03b3)\n  : is-equiv A' A \u03b1\n  :=\n    is-equiv-is-contr-map A' A \u03b1\n    ( \\ a \u2192\n      is-contr-is-retract-of-is-contr\n      ( fib A' A \u03b1 a)\n      ( fib (total-type A' C') (total-type A C) (temp-uBDx-\u03a3\u03b1\u03b3) (a, s a))\n      ( induced-retraction-on-fibers-with-section ((s',s),\u03b7) a)\n      ( is-contr-map-is-equiv\n        ( total-type A' C') (total-type A C)\n        (temp-uBDx-\u03a3\u03b1\u03b3)\n        ( is-equiv-\u03a3\u03b1\u03b3 )\n        (a, s a)))\n#end homotopy-cartesian\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#invariance-under-pullbacks","title":"Invariance under pullbacks","text":"

We can pullback a homotopy cartesian square over \u03b1 : A' \u2192 A along any map of maps \u03b2 \u2192 \u03b1 and obtain another homotopy cartesian square.

#def is-homotopy-cartesian-pullback\n( A' : U)\n( C' : A' \u2192 U)\n( A : U)\n( C : A \u2192 U)\n( \u03b1 : A' \u2192 A)\n( \u03b3 : ( a' : A') \u2192 C' a' \u2192 C (\u03b1 a'))\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ((s', s), \u03b7) : map-of-maps B' B \u03b2 A' A \u03b1)\n( is-hc-\u03b1 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3)\n  : is-homotopy-cartesian\n      B' ( \\ b' \u2192 C' (s' b'))\n      B  ( \\ b \u2192 C (s b))\n      \u03b2  ( \\ b' c' \u2192 transport A C (\u03b1 (s' b')) (s (\u03b2 b')) (\u03b7 b') (\u03b3 (s' b') c'))\n  :=\n\\ b' \u2192\n      is-equiv-comp (C' (s' b')) (C (\u03b1 (s' b'))) (C (s (\u03b2 b')))\n        ( \u03b3 (s' b'))\n        ( is-hc-\u03b1 (s' b'))\n        ( transport A C (\u03b1 (s' b')) (s (\u03b2 b')) (\u03b7 b'))\n        ( is-equiv-transport A C (\u03b1 (s' b')) (s (\u03b2 b')) (\u03b7 b'))\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#pasting-calculus-for-homotopy-cartesian-squares","title":"Pasting calculus for homotopy cartesian squares","text":"

Currently our notion of squares is not symmetric, since the vertical maps are given by type families, i.e. they are display maps, while the horizontal maps are arbitrary. Therefore we distinquish between the vertical and the horizontal pasting calculus.

"},{"location":"hott/11-homotopy-pullbacks.rzk/#vertical-calculus","title":"Vertical calculus","text":"

The following vertical composition and cancellation laws follow easily from the corresponding statements about equivalences established above.

#section homotopy-cartesian-vertical-calculus\n#variable A' : U\n#variable C' : A' \u2192 U\n#variable D' : ( a' : A') \u2192 C' a' \u2192 U\n#variable A : U\n#variable C : A \u2192 U\n#variable D : (a : A) \u2192 C a \u2192 U\n#variable \u03b1 : A' \u2192 A\n#variable \u03b3 : (a' : A') \u2192 C' a' \u2192 C (\u03b1 a')\n#variable \u03b4 : (a' : A') \u2192 (c' : C' a') \u2192 D' a' c' \u2192 D (\u03b1 a') (\u03b3 a' c')\n#def is-homotopy-cartesian-upper\n  : U\n  := ( is-homotopy-cartesian\n       ( total-type A' C')\n       ( \\ (a', c') \u2192 D' a' c')\n       ( total-type A C)\n       ( \\ (a, c) \u2192 D a c)\n       ( \\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n       ( \\ (a', c') \u2192 \u03b4 a' c'))\n#def is-homotopy-cartesian-upper-to-fibers uses (A)\n( is-hc-\u03b3-\u03b4 : is-homotopy-cartesian-upper)\n( a' : A')\n  : is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n  :=\n\\ c' \u2192 is-hc-\u03b3-\u03b4 (a', c')\n#def is-homotopy-cartesian-upper-from-fibers uses (A)\n( is-fiberwise-hc-\u03b3-\u03b4\n    : ( a' : A') \u2192\n      is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a'))\n  : is-homotopy-cartesian-upper\n  :=\n    \\ (a', c') \u2192 is-fiberwise-hc-\u03b3-\u03b4 a' c'\n#def is-homotopy-cartesian-vertical-pasted\n  : U\n  :=\n    is-homotopy-cartesian\n      A' (\\ a' \u2192 total-type (C' a') (D' a'))\n      A (\\ a \u2192 total-type (C a) (D a))\n      \u03b1 (\\ a' (c', d') \u2192 (\u03b3 a' c', \u03b4 a' c' d'))\n#def is-homotopy-cartesian-vertical-pasting\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-hc-\u03b3-\u03b4 : is-homotopy-cartesian-upper)\n  : is-homotopy-cartesian-vertical-pasted\n  :=\n\\ a' \u2192\n      pull-up-equiv-is-homotopy-cartesian\n        (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n        ( is-homotopy-cartesian-upper-to-fibers is-hc-\u03b3-\u03b4 a')\n        ( is-hc-\u03b1-\u03b3 a' )\n#def is-homotopy-cartesian-vertical-pasting-from-fibers\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-fiberwise-hc-\u03b3-\u03b4\n    : ( a' : A') \u2192\n      is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a'))\n  : is-homotopy-cartesian-vertical-pasted\n  :=\n    is-homotopy-cartesian-vertical-pasting\n      is-hc-\u03b1-\u03b3\n      ( is-homotopy-cartesian-upper-from-fibers is-fiberwise-hc-\u03b3-\u03b4)\n#def is-homotopy-cartesian-lower-cancel-to-fibers\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-hc-\u03b1-\u03b4 : is-homotopy-cartesian-vertical-pasted)\n( a' : A')\n  : is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n  :=\n    is-homotopy-cartesian-is-horizontal-equiv\n      ( C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n      ( is-hc-\u03b1-\u03b3 a')\n      ( is-hc-\u03b1-\u03b4 a')\n#def is-homotopy-cartesian-lower-cancel uses (D D' \u03b4)\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-hc-\u03b1-\u03b4 : is-homotopy-cartesian-vertical-pasted\n  )\n  : is-homotopy-cartesian-upper\n  :=\n    is-homotopy-cartesian-upper-from-fibers\n      (is-homotopy-cartesian-lower-cancel-to-fibers is-hc-\u03b1-\u03b3 is-hc-\u03b1-\u03b4)\n#def is-homotopy-cartesian-upper-cancel-with-section\n( has-sec-\u03b3-\u03b4 : (a' : A') \u2192\n      has-section-family-over-map\n        (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a'))\n( is-hc-\u03b1-\u03b4 : is-homotopy-cartesian-vertical-pasted)\n  : is-homotopy-cartesian A' C' A C \u03b1 \u03b3\n  :=\n\\ a' \u2192\n      push-down-equiv-with-section\n      ( C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n      ( has-sec-\u03b3-\u03b4 a')\n      ( is-hc-\u03b1-\u03b4 a')\n#end homotopy-cartesian-vertical-calculus\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#horizontal-calculus","title":"Horizontal calculus","text":"

We also have the horizontal version of pasting and cancellation which follows from composition and cancelling laws for equivalences.

#section homotopy-cartesian-horizontal-calculus\n#variable A'' : U\n#variable C'' : A'' \u2192 U\n#variable A' : U\n#variable C' : A' \u2192 U\n#variable A : U\n#variable C : A \u2192 U\n#variable f' : A'' \u2192 A'\n#variable F' : (a'' : A'') \u2192 C'' a'' \u2192 C' (f' a'')\n#variable f : A' \u2192 A\n#variable F : (a' : A') \u2192 C' a' \u2192 C (f a')\n#def is-homotopy-cartesian-horizontal-pasting\n( ihc : is-homotopy-cartesian A' C' A C f F)\n( ihc' : is-homotopy-cartesian A'' C'' A' C' f' F')\n  : is-homotopy-cartesian A'' C'' A C\n    ( comp A'' A' A f f')\n    ( \\ a'' \u2192\n        comp (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n         (F (f' a'')) (F' a''))\n  :=\n\\ a'' \u2192\n    is-equiv-comp (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n      (F' a'') (ihc' a'')\n      (F (f' a'')) (ihc (f' a''))\n#def is-homotopy-cartesian-right-cancel\n( ihc : is-homotopy-cartesian A' C' A C f F)\n( ihc'' : is-homotopy-cartesian A'' C'' A C\n              ( comp A'' A' A f f')\n              ( \\ a'' \u2192\n                comp (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n                  (F (f' a'')) (F' a'')))\n  : is-homotopy-cartesian A'' C'' A' C' f' F'\n  :=\n\\ a'' \u2192\n    is-equiv-right-factor (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n    ( F' a'') (F (f' a''))\n    ( ihc (f' a''))\n    ( ihc'' a'')\n#end homotopy-cartesian-horizontal-calculus\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/","title":"3. Simplicial Type Theory","text":"

These formalisations correspond in part to Section 3 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#simplices-and-their-subshapes","title":"Simplices and their subshapes","text":""},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#simplices","title":"Simplices","text":"The 1-simplex
#def \u0394\u00b9 : 2 \u2192 TOPE\n  := \\ t \u2192 TOP\n
The 2-simplex
#def \u0394\u00b2 : (2 \u00d7 2) \u2192 TOPE\n  := \\ (t , s) \u2192 s \u2264 t\n
The 3-simplex
#def \u0394\u00b3 : (2 \u00d7 2 \u00d7 2) \u2192 TOPE\n  := \\ ((t1 , t2) , t3) \u2192 t3 \u2264 t2 \u2227 t2 \u2264 t1\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#boundaries-of-simplices","title":"Boundaries of simplices","text":"The boundary of a 1-simplex
#def \u2202\u0394\u00b9 : \u0394\u00b9 \u2192 TOPE\n  := \\ t \u2192 (t \u2261 0\u2082 \u2228 t \u2261 1\u2082)\n
The boundary of a 2-simplex
#def \u2202\u0394\u00b2 : \u0394\u00b2 \u2192 TOPE\n  :=\n    \\ (t , s) \u2192 (s \u2261 0\u2082 \u2228 t \u2261 1\u2082 \u2228 s \u2261 t)\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#the-2-dimensional-inner-horn","title":"The 2 dimensional inner horn","text":"
#def \u039b : (2 \u00d7 2) \u2192 TOPE\n  := \\ (t , s) \u2192 (s \u2261 0\u2082 \u2228 t \u2261 1\u2082)\n#def \u039b\u00b2\u2081 : \u0394\u00b2 \u2192 TOPE\n  := \\ (s,t) \u2192 \u039b (s,t)\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#the-3-dimensional-inner-horns","title":"The 3 dimensional inner horns","text":"
#def \u039b\u00b3\u2081 : \u0394\u00b3 \u2192 TOPE\n  := \\ ((t1, t2), t3) \u2192 t3 \u2261 0\u2082 \u2228 t2 \u2261 t1 \u2228 t1 \u2261 1\u2082\n#def \u039b\u00b3\u2082 : \u0394\u00b3 \u2192 TOPE\n  := \\ ((t1, t2), t3) \u2192 t3 \u2261 0\u2082 \u2228 t3 \u2261 t2 \u2228 t1 \u2261 1\u2082\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#products","title":"Products","text":"

The product of topes defines the product of shapes.

#def shape-prod\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03c7 : J \u2192 TOPE)\n  : (I \u00d7 J) \u2192 TOPE\n  := \\ (t , s) \u2192 \u03c8 t \u2227 \u03c7 s\n
The square as a product
#def \u0394\u00b9\u00d7\u0394\u00b9 : (2 \u00d7 2) \u2192 TOPE\n  := shape-prod 2 2 \u0394\u00b9 \u0394\u00b9\n
The total boundary of the square
#def \u2202\u25a1 : (2 \u00d7 2) \u2192 TOPE\n  := \\ (t ,s) \u2192 ((\u2202\u0394\u00b9 t) \u2227 (\u0394\u00b9 s)) \u2228 ((\u0394\u00b9 t) \u2227 (\u2202\u0394\u00b9 s))\n
The vertical boundary of the square
#def \u2202\u0394\u00b9\u00d7\u0394\u00b9 : (2 \u00d7 2) \u2192 TOPE\n  := shape-prod 2 2 \u2202\u0394\u00b9 \u0394\u00b9\n
The horizontal boundary of the square
#def \u0394\u00b9\u00d7\u2202\u0394\u00b9 : (2 \u00d7 2) \u2192 TOPE\n  := shape-prod 2 2 \u0394\u00b9 \u2202\u0394\u00b9\n
The prism from a 2-simplex in an arrow type
#def \u0394\u00b2\u00d7\u0394\u00b9 : (2 \u00d7 2 \u00d7 2) \u2192 TOPE\n  := shape-prod (2 \u00d7 2) 2 \u0394\u00b2 \u0394\u00b9\n
#def \u0394\u00b3\u00d7\u0394\u00b2 : ((2 \u00d7 2 \u00d7 2) \u00d7 (2 \u00d7 2)) \u2192 TOPE\n  := shape-prod (2 \u00d7 2 \u00d7 2) (2 \u00d7 2) \u0394\u00b3 \u0394\u00b2\n

Maps out of \\(\u0394\u00b2\\) are a retract of maps out of \\(\u0394\u00b9\u00d7\u0394\u00b9\\).

RS17, Proposition 3.6
#def \u0394\u00b2-is-retract-\u0394\u00b9\u00d7\u0394\u00b9\n(A : U)\n  : is-retract-of (\u0394\u00b2 \u2192 A) (\u0394\u00b9\u00d7\u0394\u00b9 \u2192 A)\n  :=\n    ( ( \\ f \u2192 \\ (t , s) \u2192\nrecOR\n          ( t <= s |-> f (t , t) ,\n            s <= t |-> f (t , s))) ,\n      ( ( \\ f \u2192 \\ ts \u2192 f ts ) , \\ _ \u2192 refl))\n

Maps out of \\(\u0394\u00b3\\) are a retract of maps out of \\(\u0394\u00b2\u00d7\u0394\u00b9\\).

RS17, Proposition 3.7
#def \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-retraction\n(A : U)\n  : (\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A) \u2192 (\u0394\u00b3 \u2192 A)\n  := \\ f \u2192 \\ ((t1 , t2) , t3) \u2192 f ((t1 , t3) , t2)\n#def \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-section\n(A : U)\n  : (\u0394\u00b3 \u2192 A) \u2192 (\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A)\n  :=\n\\ f \u2192 \\ ((t1 , t2) , t3) \u2192\nrecOR\n      ( t3 <= t2 |-> f ((t1 , t2) , t2) ,\n        t2 <= t3 |->\nrecOR\n            ( t3 <= t1 |-> f ((t1 , t3) , t2) ,\n              t1 <= t3 |-> f ((t1 , t1) , t2)))\n#def \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9\n( A : U)\n  : is-retract-of (\u0394\u00b3 \u2192 A) (\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A)\n  :=\n    ( \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-section A ,\n      ( \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-retraction A , \\ _ \u2192 refl))\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#pushout-product","title":"Pushout product","text":"

Pushout product \u03a6\u00d7\u03b6 \u222a_{\u03a6\u00d7\u03c7} \u03c8\u00d7\u03c7 of \u03a6 \u21aa \u03c8 and \u03c7 \u21aa \u03b6, domain of the co-gap map.

#def shape-pushout-prod\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03a6 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n  : (shape-prod I J \u03c8 \u03b6) \u2192 TOPE\n  := \\ (t,s) \u2192 (\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#intersections","title":"Intersections","text":"

The intersection of shapes is defined by conjunction on topes.

#def shape-intersection\n( I : CUBE)\n( \u03c8 \u03c7 : I \u2192 TOPE)\n  : I \u2192 TOPE\n  := \\ t \u2192 \u03c8 t \u2227 \u03c7 t\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#unions","title":"Unions","text":"

The union of shapes is defined by disjunction on topes.

#def shape-union\n( I : CUBE)\n( \u03c8 \u03c7 : I \u2192 TOPE)\n  : I \u2192 TOPE\n  := \\ t \u2192 \u03c8 t \u2228 \u03c7 t\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#connection-squares","title":"Connection Squares","text":"

f f f f f f f \u2022 \u2022 \u2022 \u2022

RS17 Proposition 3.5(a)
#define join-square-arrow\n(A : U)\n(f : 2 \u2192 A)\n  : (2 \u00d7 2) \u2192 A\n  := \\ (t, s) \u2192 recOR ( t \u2264 s \u21a6 f s , s \u2264 t \u21a6 f t )\n

f f f f f \u2022 \u2022 \u2022 \u2022

RS17 Proposition 3.5(b)
#define meet-square-arrow\n(A : U)\n(f : 2 \u2192 A)\n  : (2 \u00d7 2) \u2192 A\n  := \\ (t, s) \u2192 recOR ( t \u2264 s \u21a6 f t , s \u2264 t \u21a6 f s )\n

"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#functorial-comparisons-of-shapes","title":"Functorial comparisons of shapes","text":""},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#functorial-retracts","title":"Functorial retracts","text":"

For a subshape \u03d5 \u2282 \u03c8 we have an easy way of stating that it is a retract in a strict and functorial way. Intuitively this happens when there is a map from \u03c8 to \u03d5 that fixes the subshape \u03c8. But in the definition below we actually ask for a section of the family of extensions of a function \u03d5 \u2192 A to a function \u03c8 \u2192 A and we ask for this section to be natural in the type A.

#def is-functorial-shape-retract\n( I : CUBE )\n( \u03c8 : I \u2192 TOPE )\n( \u03d5 : \u03c8 \u2192 TOPE )\n  : U\n  :=\n( A' : U) \u2192 (A : U) \u2192 (\u03b1 : A' \u2192 A) \u2192\n    has-section-family-over-map\n      ( \u03d5 \u2192 A') (\\ f \u2192 (t : \u03c8) \u2192 A' [\u03d5 t \u21a6 f t])\n      ( \u03d5 \u2192 A) (\\ f \u2192 (t : \u03c8) \u2192 A [\u03d5 t \u21a6 f t])\n      ( \\ f t \u2192 \u03b1 (f t))\n      ( \\ _ g t \u2192 \u03b1 (g t))\n

For example, this applies to \u0394\u00b2 \u2282 \u0394\u00b9\u00d7\u0394\u00b9.

#def \u0394\u00b2-is-functorial-retract-\u0394\u00b9\u00d7\u0394\u00b9\n  : is-functorial-shape-retract (2 \u00d7 2) (\u0394\u00b9\u00d7\u0394\u00b9) (\u0394\u00b2)\n  :=\n\\ A' A \u03b1 \u2192\n      ( ( first (\u0394\u00b2-is-retract-\u0394\u00b9\u00d7\u0394\u00b9 A'), first (\u0394\u00b2-is-retract-\u0394\u00b9\u00d7\u0394\u00b9 A) ) ,\n\\ a' \u2192 refl)\n

Every functorial shape retract automatically induces a section when restricting to diagrams extending a fixed diagram \u03c3': \u03d5 \u2192 A' (or, respectively, its image \u03d5 \u2192 A under \u03b1).

#def relativize-is-functorial-shape-retract\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03c7 : \u03c8 \u2192 TOPE)\n( is-fretract-\u03c8-\u03c7 : is-functorial-shape-retract I \u03c8 \u03c7)\n( \u03d5 : \u03c7 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( \u03c3' : \u03d5 \u2192 A')\n  : has-section-family-over-map\n( (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n( (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n( \\ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n      ( \\ \u03c4' t \u2192 \u03b1 (\u03c4' t))\n      ( \\ _ \u03c5' t \u2192 \u03b1 (\u03c5' t))\n  :=\n    ( ( \\ \u03c4' \u2192 first (first (is-fretract-\u03c8-\u03c7 A' A \u03b1)) \u03c4'\n      , \\ \u03c4 \u2192 second (first (is-fretract-\u03c8-\u03c7 A' A \u03b1)) \u03c4\n      )\n    , \\ \u03c4' \u2192 second (is-fretract-\u03c8-\u03c7 A' A \u03b1) \u03c4'\n    )\n
"},{"location":"simplicial-hott/03-extension-types.rzk/","title":"4. Equivalences involving extension types","text":"

These formalisations correspond to Section 3 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#prerequisites","title":"Prerequisites","text":""},{"location":"simplicial-hott/03-extension-types.rzk/#extension-up-to-homotopy","title":"Extension up to homotopy","text":"

For a shape inclusion \u03d5 \u2282 \u03c8 and any type A, we have the inbuilt extension types (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t] (for every \u03c3 : \u03d5 \u2192 A).

We show that these extension types are equivalent to the fibers of the canonical restriction map (\u03c8 \u2192 A) \u2192 (\u03d5 \u2192 A), which we can view as the types of \"extension up to homotopy\".

#section extensions-up-to-homotopy\n#variable I : CUBE\n#variable \u03c8 : I \u2192 TOPE\n#variable \u03d5 : \u03c8 \u2192 TOPE\n#variable A : U\n#def extension-type\n( \u03c3 : \u03d5 \u2192 A)\n  : U\n  :=\n( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t]\n#def homotopy-extension-type\n( \u03c3 : \u03d5 \u2192 A)\n  : U\n  := fib (\u03c8 \u2192 A) (\u03d5 \u2192 A) (\\ \u03c4 t \u2192 \u03c4 t) (\u03c3)\n#def extension-type-weakening-map\n( \u03c3 : \u03d5 \u2192 A)\n  : extension-type \u03c3 \u2192 homotopy-extension-type \u03c3\n  :=\n\\ \u03c4 \u2192 ( \u03c4, refl)\n#def extension-type-weakening-section\n  : ( \u03c3 : \u03d5 \u2192 A) \u2192\n( th : homotopy-extension-type \u03c3) \u2192\n\u03a3 (\u03c4 : extension-type \u03c3), (( \u03c4, refl) =_{homotopy-extension-type \u03c3} th)\n  :=\n    ind-fib (\u03c8 \u2192 A) (\u03d5 \u2192 A) (\\ \u03c4 t \u2192 \u03c4 t)\n( \\ \u03c3 th \u2192\n          \u03a3 (\u03c4 : extension-type \u03c3),\n            ( \u03c4, refl) =_{homotopy-extension-type \u03c3} th)\n( \\ (\u03c4 : \u03c8 \u2192 A) \u2192 (\u03c4, refl))\n#def is-equiv-extension-type-weakening\n( \u03c3 : \u03d5 \u2192 A)\n  : is-equiv (extension-type \u03c3) (homotopy-extension-type \u03c3)\n      (extension-type-weakening-map \u03c3)\n  :=\n    ( ( \\ th \u2192 first (extension-type-weakening-section \u03c3 th),\n\\ _ \u2192 refl),\n      ( \\ th \u2192 ( first (extension-type-weakening-section \u03c3 th)),\n\\ th \u2192 ( second (extension-type-weakening-section \u03c3 th))))\n#def extension-type-weakening\n( \u03c3 : \u03d5 \u2192 A)\n  : Equiv (extension-type \u03c3) (homotopy-extension-type \u03c3)\n  := ( extension-type-weakening-map \u03c3 , is-equiv-extension-type-weakening \u03c3)\n#end extensions-up-to-homotopy\n

This equivalence is functorial in the following sense:

#def extension-type-weakening-functorial\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( \u03c3' : \u03d5 \u2192 A')\n  : Equiv-of-maps\n      ( extension-type I \u03c8 \u03d5 A' \u03c3')\n      ( extension-type I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t)))\n      ( \\ \u03c4' t \u2192 \u03b1 (\u03c4' t))\n      ( homotopy-extension-type I \u03c8 \u03d5 A' \u03c3')\n      ( homotopy-extension-type I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t)))\n      ( \\ (\u03c4', p) \u2192\n          ( \\ t \u2192 \u03b1 (\u03c4' t),\n            ap (\u03d5 \u2192 A') (\u03d5 \u2192 A)\n( \\ (t : \u03d5) \u2192 \u03c4' t)\n( \\ (t : \u03d5) \u2192 \u03c3' t)\n               ( \\ \u03c3'' t \u2192 \u03b1 (\u03c3'' t))\n               ( p)))\n  :=\n    ( ( ( extension-type-weakening-map I \u03c8 \u03d5 A' \u03c3'\n        , extension-type-weakening-map I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t))\n        )\n      , \\ _ \u2192 refl\n      )\n    , ( is-equiv-extension-type-weakening I \u03c8 \u03d5 A' \u03c3'\n      , is-equiv-extension-type-weakening I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t))\n      )\n    )\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#commutation-of-arguments-and-currying","title":"Commutation of arguments and currying","text":"RS17, Theorem 4.1
#def flip-ext-fun\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : U)\n( Y : \u03c8 \u2192 X \u2192 U)\n( f : (t : \u03d5) \u2192 (x : X) \u2192 Y t x)\n  : Equiv\n( (t : \u03c8) \u2192 ((x : X) \u2192 Y t x) [\u03d5 t \u21a6 f t])\n( (x : X) \u2192 (t : \u03c8) \u2192 Y t x [\u03d5 t \u21a6 f t x])\n  :=\n    ( \\ g x t \u2192 g t x ,\n      ( ( \\ h t x \u2192 (h x) t ,\n\\ g \u2192 refl) ,\n        ( \\ h t x \u2192 (h x) t ,\n\\ h \u2192 refl)))\n#def flip-ext-fun-inv\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : U)\n( Y : \u03c8 \u2192 X \u2192 U)\n( f : (t : \u03d5) \u2192 (x : X) \u2192 Y t x)\n  : Equiv\n( (x : X) \u2192 (t : \u03c8) \u2192 Y t x [\u03d5 t \u21a6 f t x])\n( (t : \u03c8) \u2192 ((x : X) \u2192 Y t x) [\u03d5 t \u21a6 f t])\n  :=\n    ( \\ h t x \u2192 (h x) t ,\n      ( ( \\ g x t \u2192 g t x ,\n\\ h \u2192 refl) ,\n        ( \\ g x t \u2192 g t x ,\n\\ g \u2192 refl)))\n
RS17, Theorem 4.2
#def curry-uncurry\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n( X : \u03c8 \u2192 \u03b6 \u2192 U)\n( f : ((t , s) : I \u00d7 J | (\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)) \u2192 X t s)\n  : Equiv\n( (t : \u03c8) \u2192\n( (s : \u03b6) \u2192 X t s [\u03c7 s \u21a6 f (t , s)]) [\u03d5 t \u21a6 \\ s \u2192 f (t , s)])\n    ( ((t , s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192\n      X t s [(\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 f (t , s)])\n  :=\n    ( \\ g (t , s) \u2192 (g t) s ,\n      ( ( \\ h t s \u2192 h (t , s) ,\n\\ g \u2192 refl) ,\n        ( \\ h t s \u2192 h (t , s) ,\n\\ h \u2192 refl)))\n#def uncurry-opcurry\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n( X : \u03c8 \u2192 \u03b6 \u2192 U)\n( f : ((t , s) : I \u00d7 J | (\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)) \u2192 X t s)\n  : Equiv\n    ( ((t , s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192\n      X t s [(\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 f (t , s)])\n( ( s : \u03b6) \u2192\n( (t : \u03c8) \u2192 X t s [\u03d5 t \u21a6 f (t , s)]) [\u03c7 s \u21a6 \\ t \u2192 f (t , s)])\n  :=\n    ( \\ h s t \u2192 h (t , s) ,\n      ( ( \\ g (t , s) \u2192 (g s) t ,\n\\ h \u2192 refl) ,\n        ( \\ g (t , s) \u2192 (g s) t ,\n\\ g \u2192 refl)))\n#def fubini\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n( X : \u03c8 \u2192 \u03b6 \u2192 U)\n( f : ((t , s) : I \u00d7 J | (\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)) \u2192 X t s)\n  : Equiv\n( ( t : \u03c8) \u2192\n( (s : \u03b6) \u2192 X t s [\u03c7 s \u21a6 f (t , s)]) [\u03d5 t \u21a6 \\ s \u2192 f (t , s)])\n( ( s : \u03b6) \u2192\n( (t : \u03c8) \u2192 X t s [\u03d5 t \u21a6 f (t , s)]) [\u03c7 s \u21a6 \\ t \u2192 f (t , s)])\n  :=\n    equiv-comp\n( ( t : \u03c8) \u2192\n( (s : \u03b6) \u2192 X t s [\u03c7 s \u21a6 f (t , s)]) [\u03d5 t \u21a6 \\ s \u2192 f (t , s)])\n      ( ( (t , s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192\n        X t s [(\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 f (t , s)])\n( ( s : \u03b6) \u2192\n( (t : \u03c8) \u2192 X t s [\u03d5 t \u21a6 f (t , s)]) [\u03c7 s \u21a6 \\ t \u2192 f (t , s)])\n      ( curry-uncurry I J \u03c8 \u03d5 \u03b6 \u03c7 X f)\n      ( uncurry-opcurry I J \u03c8 \u03d5 \u03b6 \u03c7 X f)\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#extending-into-types-the-non-axiom-of-choice","title":"Extending into \u03a3-types (the non-axiom of choice)","text":"RS17, Theorem 4.3
#def axiom-choice\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : \u03c8 \u2192 U)\n( Y : (t : \u03c8) \u2192 (x : X t) \u2192 U)\n( a : (t : \u03d5) \u2192 X t)\n( b : (t : \u03d5) \u2192 Y t (a t))\n  : Equiv\n( (t : \u03c8) \u2192 (\u03a3 (x : X t) , Y t x) [\u03d5 t \u21a6 (a t , b t)])\n( \u03a3 ( f : ((t : \u03c8) \u2192 X t [\u03d5 t \u21a6 a t])) ,\n( (t : \u03c8) \u2192 Y t (f t) [\u03d5 t \u21a6 b t]))\n    :=\n      ( \\ g \u2192 (\\ t \u2192 (first (g t)) , \\ t \u2192 second (g t)) ,\n        ( ( \\ (f , h) t \u2192 (f t , h t) ,\n\\ _ \u2192 refl) ,\n          ( \\ (f , h) t \u2192 (f t , h t) ,\n\\ _ \u2192 refl)))\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#composites-and-unions-of-cofibrations","title":"Composites and unions of cofibrations","text":"

The original form.

RS17, Theorem 4.4
#def cofibration-composition\n( I : CUBE)\n( \u03c7 : I \u2192 TOPE)\n( \u03c8 : \u03c7 \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : \u03c7 \u2192 U)\n( a : (t : \u03d5) \u2192 X t)\n  : Equiv\n( (t : \u03c7) \u2192 X t [\u03d5 t \u21a6 a t])\n( \u03a3 ( f : (t : \u03c8) \u2192 X t [\u03d5 t \u21a6 a t]) ,\n( (t : \u03c7) \u2192 X t [\u03c8 t \u21a6 f t]))\n  :=\n    ( \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t) ,\n      ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n        ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl))))\n#def cofibration-composition-functorial\n( I : CUBE)\n( \u03c7 : I \u2192 TOPE)\n( \u03c8 : \u03c7 \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : \u03c7 \u2192 U)\n( \u03b1 : (t : \u03c7) \u2192 A' t \u2192 A t)\n( \u03c3' : (t : \u03d5) \u2192 A' t)\n  : Equiv-of-maps\n( (t : \u03c7) \u2192 A' t [\u03d5 t \u21a6 \u03c3' t])\n( (t : \u03c7) \u2192 A t [\u03d5 t \u21a6 \u03b1 t (\u03c3' t)])\n     ( \\ \u03c4' t \u2192 \u03b1 t (\u03c4' t))\n( \u03a3 ( \u03c4' : (t : \u03c8) \u2192 A' t [\u03d5 t \u21a6 \u03c3' t]) ,\n( (t : \u03c7) \u2192 A' t [\u03c8 t \u21a6 \u03c4' t]))\n( \u03a3 ( \u03c4 : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 \u03b1 t (\u03c3' t)]) ,\n( (t : \u03c7) \u2192 A t [\u03c8 t \u21a6 \u03c4 t]))\n     ( \\ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 t (\u03c4' t), \\t \u2192 \u03b1 t (\u03c5' t)))\n  :=\n    ( ( ( \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t) , \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t)),\n\\ _ \u2192 refl),\n      ( ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n          ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl))),\n        ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n          ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl)))))\n

A reformulated version via tope disjunction instead of inclusion (see https://github.com/rzk-lang/rzk/issues/8).

RS17, Theorem 4.4
#def cofibration-composition'\n( I : CUBE)\n( \u03c7 \u03c8 \u03d5 : I \u2192 TOPE)\n( X : \u03c7 \u2192 U)\n( a : (t : I | \u03c7 t \u2227 \u03c8 t \u2227 \u03d5 t) \u2192 X t)\n  : Equiv\n( (t : \u03c7) \u2192 X t [\u03c7 t \u2227 \u03c8 t \u2227 \u03d5 t \u21a6 a t])\n( \u03a3 ( f : (t : I | \u03c7 t \u2227 \u03c8 t) \u2192 X t [\u03c7 t \u2227 \u03c8 t \u2227 \u03d5 t \u21a6 a t]) ,\n( (t : \u03c7) \u2192 X t [\u03c7 t \u2227 \u03c8 t \u21a6 f t]))\n  :=\n    ( \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t) ,\n      ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n        ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl)))\n
RS17, Theorem 4.5
#def cofibration-union\n( I : CUBE)\n( \u03d5 \u03c8 : I \u2192 TOPE)\n( X : (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 U)\n( a : (t : \u03c8) \u2192 X t)\n  : Equiv\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 X t [\u03c8 t \u21a6 a t])\n( (t : \u03d5) \u2192 X t [\u03d5 t \u2227 \u03c8 t \u21a6 a t])\n  :=\n    (\\ h t \u2192 h t ,\n      ( ( \\ g t \u2192 recOR (\u03d5 t \u21a6 g t , \u03c8 t \u21a6 a t) , \\ _ \u2192 refl) ,\n        ( \\ g t \u2192 recOR (\u03d5 t \u21a6 g t , \u03c8 t \u21a6 a t) , \\ _ \u2192 refl)))\n#def cofibration-union-functorial\n( I : CUBE)\n( \u03d5 \u03c8 : I \u2192 TOPE)\n( A' A : (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 U)\n( \u03b1 : (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A' t \u2192 A t)\n( \u03c4' : (t : \u03c8) \u2192 A' t)\n  : Equiv-of-maps\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A' t [\u03c8 t \u21a6 \u03c4' t])\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A t [\u03c8 t \u21a6 \u03b1 t (\u03c4' t)])\n      ( \\ \u03c5' t \u2192 \u03b1 t (\u03c5' t))\n( (t : \u03d5) \u2192 A' t [\u03d5 t \u2227 \u03c8 t \u21a6 \u03c4' t])\n( (t : \u03d5) \u2192 A t [\u03d5 t \u2227 \u03c8 t \u21a6 \u03b1 t (\u03c4' t)])\n      ( \\ \u03bd' t \u2192 \u03b1 t (\u03bd' t))\n  :=\n     ( ( ( \\ \u03c5' t \u2192 \u03c5' t\n         , \\ \u03c5 t \u2192 \u03c5 t\n         )\n       , \\ _ \u2192 refl\n       )\n     , ( second (cofibration-union I \u03d5 \u03c8 A' \u03c4')\n       ,\nsecond (cofibration-union I \u03d5 \u03c8 A ( \\ t \u2192 \u03b1 t (\u03c4' t)))\n       )\n     )\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#extension-extensionality","title":"Extension extensionality","text":"

There are various equivalent forms of the relative function extensionality axiom for extension types. One form corresponds to the standard weak function extensionality. As suggested by footnote 8, we refer to this as a \"weak extension extensionality\" axiom.

RS17, Axiom 4.6, Weak extension extensionality
#define WeakExtExt\n  : U\n  := ( I : CUBE) \u2192 (\u03c8 : I \u2192 TOPE) \u2192 (\u03d5 : \u03c8 \u2192 TOPE) \u2192 (A : \u03c8 \u2192 U) \u2192\n( is-locally-contr-A : (t : \u03c8) \u2192 is-contr (A t)) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192 is-contr ((t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n

We refer to another form as an \"extension extensionality\" axiom.

#def ext-htpy-eq\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n( p : f = g)\n  : (t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]\n  :=\n    ind-path\n( (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n      ( f)\n( \\ g' p' \u2192 (t : \u03c8) \u2192 (f t = g' t) [\u03d5 t \u21a6 refl])\n      ( \\ t \u2192 refl)\n      ( g)\n      ( p)\n
RS17, Proposition 4.8(ii)
#def ExtExt\n  : U\n  :=\n( I : CUBE) \u2192\n( \u03c8 : I \u2192 TOPE) \u2192\n( \u03d5 : \u03c8 \u2192 TOPE) \u2192\n( A : \u03c8 \u2192 U) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192\n( f  : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n( g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n    is-equiv\n      ( f = g)\n( (t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n      ( ext-htpy-eq I \u03c8 \u03d5 A a f g)\n
The equivalence provided by extension extensionality
#def equiv-ExtExt\n( extext : ExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n  : Equiv (f = g) ((t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n  := (ext-htpy-eq I \u03c8 \u03d5 A a f g , extext I \u03c8 \u03d5 A a f g)\n

For readability of code, it is useful to the function that supplies an equality between terms of an extension type from a pointwise equality extending refl. In fact, sometimes only this weaker form of the axiom is needed.

#def NaiveExtExt\n  : U\n  :=\n( I : CUBE) \u2192\n( \u03c8 : I \u2192 TOPE) \u2192\n( \u03d5 : \u03c8 \u2192 TOPE) \u2192\n( A : \u03c8 \u2192 U) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192\n( f : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n( g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n( (t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]) \u2192\n    ( f = g)\n#def naiveextext-extext\n( extext : ExtExt)\n  : NaiveExtExt\n  :=\n\\ I \u03c8 \u03d5 A a f g \u2192\n      ( first (first (extext I \u03c8 \u03d5 A a f g)))\n

Weak extension extensionality implies extension extensionality; this is the context of RS17 Proposition 4.8 (i). We prove this in a series of lemmas. The ext-projection-temp function is a (hopefully temporary) helper that explicitly cases an extension type to a function type.

#section rs-4-8\n#variable  weakextext : WeakExtExt\n#variable  I : CUBE\n#variable  \u03c8 : I \u2192 TOPE\n#variable  \u03d5 : \u03c8 \u2192 TOPE\n#variable  A : \u03c8 \u2192 U\n#variable  a : (t : \u03d5 ) \u2192 A t\n#variable  f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]\n#define ext-projection-temp uses (I \u03c8 \u03d5 A a f)\n  : ((t : \u03c8 ) \u2192 A t)\n  := f\n#define is-contr-ext-based-paths uses (weakextext f)\n  : is-contr ((t : \u03c8 ) \u2192 (\u03a3 (y : A t) ,\n              ((ext-projection-temp) t = y))[\u03d5 t \u21a6 (a t , refl)])\n  :=\n    weakextext\n    ( I )\n    ( \u03c8 )\n    ( \u03d5 )\n( \\ t \u2192 (\u03a3 (y : A t) , ((ext-projection-temp) t = y)))\n    ( \\ t \u2192\n      is-contr-based-paths (A t ) ((ext-projection-temp) t))\n    ( \\ t \u2192 (a t , refl) )\n#define is-contr-ext-endpoint-based-paths uses (weakextext f)\n  : is-contr\n( ( t : \u03c8) \u2192\n( \u03a3 (y : A t) , (y = ext-projection-temp t)) [ \u03d5 t \u21a6 (a t , refl)])\n  :=\n    weakextext\n    ( I)\n    ( \u03c8)\n    ( \u03d5)\n( \\ t \u2192 (\u03a3 (y : A t) , y = ext-projection-temp t))\n    ( \\ t \u2192 is-contr-endpoint-based-paths (A t) (ext-projection-temp t))\n    ( \\ t \u2192 (a t , refl))\n#define is-contr-based-paths-ext uses (weakextext)\n  : is-contr (\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n(t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n  :=\n    is-contr-equiv-is-contr\n( (t : \u03c8 ) \u2192 (\u03a3 (y : A t),\n                     ((ext-projection-temp ) t = y)) [\u03d5 t \u21a6 (a t , refl)] )\n( \u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n(t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl] )\n    ( axiom-choice\n      ( I )\n      ( \u03c8 )\n      ( \u03d5 )\n      ( A )\n      ( \\ t y \u2192 (ext-projection-temp) t = y)\n      ( a )\n      ( \\t \u2192 refl ))\n    ( is-contr-ext-based-paths)\n#end rs-4-8\n

The map that defines extension extensionality

RS17 4.7
#define extext-weakextext-map\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : ((\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]), (f = g)) \u2192\n\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]))\n  :=\n    total-map\n( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n    ( \\ g \u2192 (f = g))\n( \\ g \u2192 (t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n    ( ext-htpy-eq I \u03c8 \u03d5 A a f)\n

The total bundle version of extension extensionality

#define extext-weakextext-bundle-version\n( weakextext : WeakExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : is-equiv ((\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]), (f = g)))\n(\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]))\n               (extext-weakextext-map I \u03c8 \u03d5 A a f)\n  :=\n    is-equiv-are-contr\n( \u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]), (f = g)  )\n( \u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]))\n( is-contr-based-paths\n      ( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n      ( f ))\n    ( is-contr-based-paths-ext weakextext I \u03c8 \u03d5 A a f)\n    ( extext-weakextext-map I \u03c8 \u03d5 A a f)\n

Finally, using equivalences between families of equivalences and bundles of equivalences we have that weak extension extensionality implies extension extensionality. The following is statement the as proved in RS17.

RS17 Prop 4.8(i) as proved
#define extext-weakextext'\n( weakextext : WeakExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n      is-equiv\n        ( f = g)\n( (t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n        ( ext-htpy-eq I \u03c8 \u03d5 A a f g)\n  := total-equiv-family-of-equiv\n( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t] )\n      ( \\ g \u2192 (f = g) )\n( \\ g \u2192 (t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n      ( ext-htpy-eq I \u03c8 \u03d5 A a f)\n      ( extext-weakextext-bundle-version weakextext I \u03c8 \u03d5 A a f)\n

The following is the literal statement of weak extension extensionality implying extension extensionality that we get by extraccting the fiberwise equivalence.

RS17 Proposition 4.8(i)
#define extext-weakextext\n(weakextext : WeakExtExt)\n  :  ExtExt\n  := \\ I \u03c8 \u03d5 A a f g \u2192\n      extext-weakextext' weakextext I \u03c8 \u03d5 A a f g\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#applications-of-extension-extensionality","title":"Applications of extension extensionality","text":"

We now assume extension extensionality and derive a few consequences.

#assume extext : ExtExt\n

In particular, extension extensionality implies that homotopies give rise to identifications. This definition defines eq-ext-htpy to be the retraction to ext-htpy-eq.

#def eq-ext-htpy uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n  : ((t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]) \u2192 (f = g)\n  := first (first (extext I \u03c8 \u03d5 A a f g))\n

By extension extensionality, fiberwise equivalences of extension types define equivalences of extension types. For simplicity, we extend from BOT.

#def equiv-extension-equiv-family uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A B : \u03c8 \u2192 U)\n( famequiv : (t : \u03c8) \u2192 (Equiv (A t) (B t)))\n  : Equiv ((t : \u03c8) \u2192 A t) ((t : \u03c8) \u2192 B t)\n  :=\n    ( ( \\ a t \u2192 (first (famequiv t)) (a t)) ,\n      ( ( ( \\ b t \u2192 (first (first (second (famequiv t)))) (b t)) ,\n          ( \\ a \u2192\n            eq-ext-htpy\n              ( I)\n              ( \u03c8)\n              ( \\ t \u2192 BOT)\n              ( A)\n              ( \\ u \u2192 recBOT)\n              ( \\ t \u2192\nfirst (first (second (famequiv t))) (first (famequiv t) (a t)))\n              ( a)\n              ( \\ t \u2192 second (first (second (famequiv t))) (a t)))) ,\n        ( ( \\ b t \u2192 first (second (second (famequiv t))) (b t)) ,\n          ( \\ b \u2192\n            eq-ext-htpy\n              ( I)\n              ( \u03c8)\n              ( \\ t \u2192 BOT)\n              ( B)\n              ( \\ u \u2192 recBOT)\n              ( \\ t \u2192\nfirst (famequiv t) (first (second (second (famequiv t))) (b t)))\n              ( b)\n              ( \\ t \u2192 second (second (second (famequiv t))) (b t))))))\n

We have a homotopy extension property.

The following code is another instantiation of casting, necessary for some arguments below.

#define restrict\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n  : (t : \u03c8 ) \u2192 A t\n  := f\n

The homotopy extension property has the following signature. We state this separately since below we will will both show that this follows from extension extensionality, but we will also show that extension extensionality follows from the homotopy extension property together with extra hypotheses.

#define HtpyExtProperty\n  : U\n  :=\n( I : CUBE) \u2192\n( \u03c8 : I \u2192 TOPE) \u2192\n( \u03d5 : \u03c8 \u2192 TOPE) \u2192\n( A : \u03c8 \u2192 U) \u2192\n( b : (t : \u03c8) \u2192 A t) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192\n( e : (t : \u03d5) \u2192 a t = b t) \u2192\n\u03a3 (a' : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8) \u2192 (restrict I \u03c8 \u03d5 A a a' t = b t) [\u03d5 t \u21a6 e t])\n

If we assume weak extension extensionality, then then homotopy extension property follows from a straightforward application of the axiom of choice to the point of contraction for weak extension extensionality.

RS17 Proposition 4.10
#define htpy-ext-property-weakextext\n( weakextext : WeakExtExt)\n  : HtpyExtProperty\n  :=\n\\ I \u03c8 \u03d5 A b a e \u2192\nfirst\n    ( axiom-choice\n      ( I)\n      ( \u03c8)\n      ( \u03d5)\n      ( A)\n      ( \\ t y \u2192 y = b t)\n      ( a)\n      ( e))\n    ( first\n      ( weakextext\n        ( I)\n        ( \u03c8)\n        ( \u03d5)\n( \\ t \u2192 (\u03a3 (y : A t) , y = b t))\n        ( \\ t \u2192 is-contr-endpoint-based-paths\n                ( A t)\n                ( b t))\n        ( \\ t \u2192 ( a t , e t) )))\n
RS17 Proposition 4.10
#define htpy-ext-prop-weakextext\n( weakextext : WeakExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( b : (t : \u03c8) \u2192 A t)\n( a : (t : \u03d5) \u2192 A t)\n( e : (t : \u03d5) \u2192 a t = b t)\n  : \u03a3 (a' : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8) \u2192 (restrict I \u03c8 \u03d5 A a a' t = b t) [\u03d5 t \u21a6 e t])\n  :=\nfirst\n    ( axiom-choice\n      ( I)\n      ( \u03c8)\n      ( \u03d5)\n      ( A)\n      ( \\ t y \u2192 y = b t)\n      ( a)\n      ( e))\n    ( first\n      ( weakextext\n        ( I)\n        ( \u03c8)\n        ( \u03d5)\n( \\ t \u2192 (\u03a3 (y : A t) , y = b t))\n        ( \\ t \u2192 is-contr-endpoint-based-paths\n                ( A t)\n                ( b t))\n        ( \\ t \u2192 ( a t , e t) )))\n

In an extension type of a dependent type that is pointwise contractible, then we have an inhabitant of the extension type witnessing the contraction, at every inhabitant of the base, of each point in the fiber to the center of the fiber. Both directions of this statement will be needed.

#def eq-ext-is-contr\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr ( A t))\n  : (t : \u03d5 ) \u2192 ((first (is-contr-fiberwise-A t)) = a t)\n  :=  \\ t \u2192 ( second (is-contr-fiberwise-A t) (a t))\n#def codomain-eq-ext-is-contr\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr ( A t))\n  : (t : \u03d5 ) \u2192 (a t = first (is-contr-fiberwise-A t))\n  :=  \\ t \u2192\n          rev\n            ( A t )\n            ( first (is-contr-fiberwise-A t) )\n            ( a t)\n            ( second (is-contr-fiberwise-A t) (a t))\n

The below gives us the inhabitant \\((a', e') : \\sum_{\\left\\langle\\prod_{t : I|\\psi} A (t) \\biggr|^\\phi_a\\right\\rangle} \\left\\langle \\prod_{t: I |\\psi} a'(t) = b(t)\\biggr|^\\phi_e \\right\\rangle\\) from the first part of the proof of RS Prop 4.11. It amounts to the fact that parameterized contractibility, i.e. A : \u03c8 \u2192 U such that each A t is contractible, implies the hypotheses of the homotopy extension property are satisfied, and so assuming homotopy extension property, we are entitled to the conclusion.

#define htpy-ext-prop-is-fiberwise-contr\n(htpy-ext-property : HtpyExtProperty)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n(is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr (A t))\n  : \u03a3 (a' : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]),\n((t : \u03c8 ) \u2192\n            (restrict I \u03c8 \u03d5 A a a' t =\nfirst (is-contr-fiberwise-A t))\n              [\u03d5 t \u21a6 codomain-eq-ext-is-contr I \u03c8 \u03d5 A a is-contr-fiberwise-A t] )\n  :=\n    htpy-ext-property\n    ( I )\n    ( \u03c8 )\n    ( \u03d5 )\n    ( A )\n    (\\ t \u2192  first (is-contr-fiberwise-A t))\n    ( a)\n    ( codomain-eq-ext-is-contr I \u03c8 \u03d5 A a is-contr-fiberwise-A)\n

The expression below give us the inhabitant c : (t : \u03c8) \u2192 f t = a' t used in the proof of RS Proposition 4.11. It follows from a more general statement about the contractibility of identity types, but it is unclear if that generality is needed.

#define RS-4-11-c\n(htpy-ext-prop : HtpyExtProperty)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n(is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr (A t))\n  : (t : \u03c8 ) \u2192 f t = (first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A)) t\n  := \\ t \u2192 eq-is-contr\n              ( A t)\n              ( is-contr-fiberwise-A t)\n              ( f t )\n              ( restrict I \u03c8 \u03d5 A a (first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A)) t)\n

And below proves that c(t) = refl. Again, this is a consequence of a slightly more general statement.

#define RS-4-11-c-is-refl\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-fiberwise-contr : (t : \u03c8 ) \u2192 is-contr (A t))\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n( a' : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n( c : (t : \u03c8 ) \u2192 (f t = a' t))\n  : (t : \u03d5 ) \u2192 (refl =_{f t = a' t} c t)\n  :=  \\ t \u2192\n    all-paths-eq-is-contr\n    ( A t)\n    ( is-fiberwise-contr t)\n    ( f t)\n    ( a' t)\n    ( refl )\n    ( c t )\n

Given the a' produced above, the following gives an inhabitant of \\(\\left \\langle_{t : I |\\psi} f(t) = a'(t) \\biggr|^\\phi_{\\lambda t.refl} \\right\\rangle\\)

#define is-fiberwise-contr-ext-is-fiberwise-contr\n(htpy-ext-prop : HtpyExtProperty)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr (A t))\n-- ( b : (t : \u03c8) \u2192 A t)\n( a : (t : \u03d5) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : (t : \u03c8 ) \u2192\n      (f t = (first\n              (htpy-ext-prop-is-fiberwise-contr\n                htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A)) t)[\u03d5 t \u21a6 refl]\n  :=\nfirst(\n    htpy-ext-prop\n    ( I )\n    ( \u03c8 )\n    ( \u03d5 )\n    ( \\ t \u2192 f t = first\n                  (htpy-ext-prop-is-fiberwise-contr\n                    htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A) t)\n    ( RS-4-11-c\n      htpy-ext-prop I \u03c8 \u03d5 A a f is-contr-fiberwise-A)\n    ( \\ t \u2192 refl )\n    ( RS-4-11-c-is-refl\n      ( I)\n      ( \u03c8)\n      ( \u03d5)\n      ( A)\n      ( is-contr-fiberwise-A)\n      ( a )\n      ( f )\n      ( first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A))\n      ( RS-4-11-c\n        ( htpy-ext-prop)\n        ( I)\n        ( \u03c8)\n        ( \u03d5)\n        ( A)\n        ( a)\n        ( f)\n        ( is-contr-fiberwise-A ))))\n#define weak-ext-ext-from-eq-ext-htpy-htpy-ext-property\n(naiveextext : NaiveExtExt)\n(htpy-ext-prop : HtpyExtProperty)\n : WeakExtExt\n  := \\ I \u03c8 \u03d5 A is-contr-fiberwise-A a \u2192\n    (first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A),\n\\ f \u2192\n      rev\n( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n      ( f )\n      ( first (htpy-ext-prop-is-fiberwise-contr\n                htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A))\n      (naiveextext\n      ( I)\n      ( \u03c8 )\n      ( \u03d5 )\n      ( A)\n      ( a)\n      ( f)\n      ( first (htpy-ext-prop-is-fiberwise-contr\n                htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A))\n      ( is-fiberwise-contr-ext-is-fiberwise-contr\n        ( htpy-ext-prop)\n        ( I)\n        ( \u03c8 )\n        ( \u03d5 )\n        ( A)\n        ( is-contr-fiberwise-A)\n        ( a)\n        ( f))))\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/","title":"4a. Right orthogonal fibrations","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on naive extension extensionality:

#assume naiveextext : NaiveExtExt\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#right-orthogonal-maps-with-respect-to-shapes","title":"Right orthogonal maps with respect to shapes","text":"

For every shape inclusion \u03d5 \u2282 \u03c8, we obtain a fibrancy condition for a map \u03b1 : A' \u2192 A in terms of unique extension along \u03d5 \u2282 \u03c8. This is a relative version of unique extension along \u03d5 \u2282 \u03c8.

We say that \u03b1 : A' \u2192 A is right orthogonal to the shape inclusion \u03d5 \u2282 \u03c8, if the square

(\u03c8 \u2192 A') \u2192 (\u03c8 \u2192 A)\n\n   \u2193          \u2193\n\n(\u03d5 \u2192 A') \u2192 (\u03d5 \u2192 A)\n
is homotopy cartesian.

Equivalently, we can interpret this orthogonality as a cofibrancy condition on the shape inclusion. We say that the shape inclusion \u03d5 \u2282 \u03c8 is left orthogonal to the map \u03b1, if \u03b1 : A' \u2192 A is right orthogonal to \u03d5 \u2282 \u03c8.

BW23, Section 3
#def is-right-orthogonal-to-shape\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE )\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n  : U\n  :=\n    is-homotopy-cartesian\n      ( \u03d5 \u2192 A' ) ( \\ \u03c3' \u2192 (t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n      ( \u03d5 \u2192 A ) ( \\ \u03c3 \u2192 (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n      ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t)) ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-properties-of-left-orthogonal-shape-inclusions","title":"Stability properties of left orthogonal shape inclusions","text":"

We fix a map \u03b1 : A' \u2192 A.

#section left-orthogonal-calculus-1\n#variables A' A : U\n#variable \u03b1 : A' \u2192 A\n
Consider nested shapes \u03d5 \u2282 \u03c7 \u2282 \u03c8 and the three possible right orthogonality conditions.

#variable I : CUBE\n#variable \u03c8 : I \u2192 TOPE\n#variable \u03c7 : \u03c8 \u2192 TOPE\n#variable \u03d5 : \u03c7 \u2192 TOPE\n#variable is-orth-\u03c8-\u03c7 : is-right-orthogonal-to-shape I \u03c8 \u03c7 A' A \u03b1\n#variable is-orth-\u03c7-\u03d5 : is-right-orthogonal-to-shape\n                          I ( \\ t \u2192 \u03c7 t) ( \\ t \u2192 \u03d5 t) A' A \u03b1\n#variable is-orth-\u03c8-\u03d5 : is-right-orthogonal-to-shape I \u03c8 ( \\ t \u2192 \u03d5 t) A' A \u03b1\n-- rzk does not accept these terms after \u03b7-reduction\n

Using the vertical pasting calculus for homotopy cartesian squares, it is not hard to deduce the corresponding composition and cancellation properties for left orthogonality of shape inclusion with respect to \u03b1 : A' \u2192 A.

"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#over-an-intermediate-shape","title":"\u03a3 over an intermediate shape","text":"

The only fact that stops some of these laws from being a direct corollary is that the \u03a3-types appearing in the vertical pasting of the relevant squares (such as \u03a3 (\\ \u03c3 : \u03d5 \u2192 A), ( (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])) are not literally equal to the corresponding extension types (such as \u03c4 \u2192 A). Therefore we have to occasionally go back or forth along the functorial equivalence cofibration-composition-functorial.

#def is-homotopy-cartesian-\u03a3-is-right-orthogonal-to-shape uses (is-orth-\u03c8-\u03d5)\n  : is-homotopy-cartesian\n    ( \u03d5 \u2192 A')\n( \\ \u03c3' \u2192 \u03a3 ( \u03c4' : (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t]), ( t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n    ( \u03d5 \u2192 A)\n( \\ \u03c3 \u2192 \u03a3 ( \u03c4 : (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t]), ( t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n    ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n    ( \\ _ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 (\u03c4' t), \\ t \u2192 \u03b1 (\u03c5' t) ))\n  :=\n( \\ (\u03c3' : \u03d5 \u2192 A') \u2192\n    is-equiv-Equiv-is-equiv'\n( ( t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( ( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n      ( \\ \u03c5' t \u2192 \u03b1 ( \u03c5' t))\n( \u03a3 ( \u03c4' : (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t]),\n( ( t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t]))\n( \u03a3 ( \u03c4 : ( t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)]),\n( ( t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t]))\n      ( \\ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 (\u03c4' t), \\t \u2192 \u03b1 (\u03c5' t)))\n      ( cofibration-composition-functorial I \u03c8 \u03c7 \u03d5\n        ( \\ _ \u2192 A') ( \\ _ \u2192 A) ( \\ _ \u2192 \u03b1) \u03c3')\n      ( is-orth-\u03c8-\u03d5 \u03c3'))\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-under-composition","title":"Stability under composition","text":"

Left orthogonal shape inclusions are preserved under composition.

right-orthogonality for composition of shape inclusions
#def is-right-orthogonal-to-shape-comp uses (is-orth-\u03c8-\u03c7 is-orth-\u03c7-\u03d5)\n  : is-right-orthogonal-to-shape I \u03c8 ( \\ t \u2192 \u03d5 t) A' A \u03b1\n  :=\n\\ \u03c3' \u2192\n      is-equiv-Equiv-is-equiv\n( ( t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( ( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n        ( \\ \u03c5' t \u2192 \u03b1 ( \u03c5' t))\n( \u03a3 ( \u03c4' : (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t]),\n( ( t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t]))\n( \u03a3 ( \u03c4 : ( t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)]),\n( ( t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t]))\n        ( \\ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 (\u03c4' t), \\t \u2192 \u03b1 (\u03c5' t)))\n        ( cofibration-composition-functorial I \u03c8 \u03c7 \u03d5\n          ( \\ _ \u2192 A') ( \\ _ \u2192 A) ( \\ _ \u2192 \u03b1) \u03c3')\n        ( is-homotopy-cartesian-vertical-pasting-from-fibers\n          ( \u03d5 \u2192 A' )\n( \\ \u03c3' \u2192 (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ _ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n          ( \u03d5 \u2192 A )\n( \\ \u03c3 \u2192 (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n( \\ _ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n          ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n          ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n          ( \\ _ _ \u03c5' x \u2192 \u03b1 (\u03c5' x) )\n          is-orth-\u03c7-\u03d5\n          ( \\ _ \u03c4' \u2192 is-orth-\u03c8-\u03c7 \u03c4')\n          \u03c3')\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#cancellation-laws","title":"Cancellation laws","text":"

If \u03d5 \u2282 \u03c7 and \u03d5 \u2282 \u03c8 are left orthogonal to \u03b1 : A' \u2192 A, then so is \u03c7 \u2282 \u03c8.

#def is-right-orthogonal-to-shape-left-cancel uses (is-orth-\u03c7-\u03d5 is-orth-\u03c8-\u03d5)\n  : is-right-orthogonal-to-shape I \u03c8 \u03c7 A' A \u03b1\n  :=\n\\ \u03c4' \u2192\n        is-homotopy-cartesian-lower-cancel-to-fibers\n          ( \u03d5 \u2192 A' )\n( \\ \u03c3' \u2192 (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ _ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n          ( \u03d5 \u2192 A )\n( \\ \u03c3 \u2192 (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n( \\ _ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n          ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n          ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n          ( \\ _ _ \u03c5' x \u2192 \u03b1 (\u03c5' x) )\n          ( is-orth-\u03c7-\u03d5 )\n          (is-homotopy-cartesian-\u03a3-is-right-orthogonal-to-shape)\n( \\ ( t : \u03d5) \u2192 \u03c4' t)\n          \u03c4'\n

If \u03d5 \u2282 \u03c8 is left orthogonal to \u03b1 : A' \u2192 A and \u03c7 \u2282 \u03c8 is a (functorial) shape retract, then \u03d5 \u2282 \u03c8 is left orthogonal to \u03b1 : A' \u2192 A.

#def is-right-orthogonal-to-shape-right-cancel-retract uses (is-orth-\u03c8-\u03d5)\n( is-fretract-\u03c8-\u03c7 : is-functorial-shape-retract I \u03c8 \u03c7)\n  : is-right-orthogonal-to-shape I ( \\ t \u2192 \u03c7 t) ( \\ t \u2192 \u03d5 t) A' A \u03b1\n  :=\n    is-homotopy-cartesian-upper-cancel-with-section\n      ( \u03d5 \u2192 A' )\n( \\ \u03c3' \u2192 (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ _ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n      ( \u03d5 \u2192 A )\n( \\ \u03c3 \u2192 (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n( \\ _ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n      ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n      ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n      ( \\ _ _ \u03c5' x \u2192 \u03b1 (\u03c5' x) )\n      ( relativize-is-functorial-shape-retract I \u03c8 \u03c7 is-fretract-\u03c8-\u03c7 \u03d5 A' A \u03b1)\n      (is-homotopy-cartesian-\u03a3-is-right-orthogonal-to-shape)\n#end left-orthogonal-calculus-1\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-under-exponentiation","title":"Stability under exponentiation","text":"

If \u03d5 \u2282 \u03c8 is left orthogonal to \u03b1 : A' \u2192 A then so is \u03c7 \u00d7 \u03d5 \u2282 \u03c7 \u00d7 \u03c8 for every other shape \u03c7.

The following proof uses a lot of currying and uncurrying and relies on (the naive form of) extension extensionality.

#def is-right-orthogonal-to-shape-\u00d7 uses (naiveextext)\n-- this should be refactored by introducing cofibration-product-functorial\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( J : CUBE)\n( \u03c7 : J \u2192 TOPE)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE )\n( \u03d5 : \u03c8 \u2192 TOPE )\n( is-orth-\u03c8-\u03d5 : is-right-orthogonal-to-shape I \u03c8 \u03d5 A' A \u03b1)\n  : is-right-orthogonal-to-shape\n      ( J \u00d7 I) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03c8 s) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03d5 s) A' A \u03b1\n  :=\n    \\ ( \u03c3' : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03d5 s) \u2192 A') \u2192\n(\n( \\ ( \u03c4 : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A[\u03d5 s \u21a6 \u03b1 (\u03c3' (t,s))])\n            ( t, s) \u2192\n          ( first (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s'))))) ( \\ s' \u2192 \u03c4 (t, s')) s\n        ,\n          \\ ( \u03c4' : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A' [\u03d5 s \u21a6 \u03c3' (t,s)]) \u2192\n            naiveextext\n              ( J \u00d7 I) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03c8 s) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03d5 s)\n              ( \\ _ \u2192 A')\n              ( \\ ( t,s) \u2192 \u03c3' (t,s))\n              ( \\ ( t,s) \u2192\n                ( first (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                  ( \\ s' \u2192 \u03b1 (\u03c4' (t, s'))) s)\n              ( \u03c4')\n              ( \\ ( t,s) \u2192\n                ext-htpy-eq I \u03c8 \u03d5 (\\ _ \u2192 A') ( \\ s' \u2192 \u03c3' (t, s'))\n                  ( ( first (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                    ( \\ s' \u2192 \u03b1 (\u03c4' (t, s'))))\n                  ( \\ s' \u2192 \u03c4' (t, s') )\n                  ( ( second (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                    ( \\ s' \u2192 \u03c4' (t, s')))\n                  ( s)\n              )\n        )\n      ,\n( \\ ( \u03c4 : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A [\u03d5 s \u21a6 \u03b1 (\u03c3' (t,s))])\n            ( t, s) \u2192\n          ( first (second (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s'))))) ( \\ s' \u2192 \u03c4 (t, s')) s\n        ,\n          \\ ( \u03c4 : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A [\u03d5 s \u21a6 \u03b1 (\u03c3' (t,s))]) \u2192\n            naiveextext\n              ( J \u00d7 I) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03c8 s) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03d5 s)\n              ( \\ _ \u2192 A)\n              ( \\ (t,s) \u2192 \u03b1 (\u03c3' (t,s)))\n              ( \\ (t,s) \u2192\n                \u03b1 ( ( first ( second ( is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                      ( \\ s' \u2192 \u03c4 (t, s')) s))\n              ( \u03c4)\n              ( \\ ( t,s) \u2192\n                ext-htpy-eq I \u03c8 \u03d5 (\\ _ \u2192 A) ( \\ s' \u2192 \u03b1 (\u03c3' (t, s')))\n                  ( \\ s'' \u2192\n                      \u03b1 ( ( first (second (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                          ( \\ s' \u2192 \u03c4 (t, s'))\n                          (s'')))\n                  ( \\ s' \u2192 \u03c4 (t, s') )\n                  ( ( second ( second (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                    ( \\ s' \u2192 \u03c4 (t, s')))\n                  ( s)\n              )\n        )\n      )\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-under-exact-pushouts","title":"Stability under exact pushouts","text":"

For any two shapes \u03d5, \u03c8 \u2282 I, if \u03d5 \u2229 \u03c8 \u2282 \u03d5 is left orthogonal to \u03b1 : A' \u2192 A, then so is \u03c8 \u2282 \u03d5 \u222a \u03c8.

#def is-right-orthogonal-to-shape-pushout\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( I : CUBE)\n( \u03d5 \u03c8 : I \u2192 TOPE)\n( is-orth-\u03d5-\u03c8\u2227\u03d5 : is-right-orthogonal-to-shape I \u03d5 ( \\ t \u2192 \u03d5 t \u2227 \u03c8 t) A' A \u03b1)\n  : is-right-orthogonal-to-shape I ( \\ t \u2192 \u03d5 t \u2228 \u03c8 t) ( \\ t \u2192 \u03c8 t) A' A \u03b1\n  := \\ ( \u03c4' : \u03c8 \u2192 A') \u2192\n       is-equiv-Equiv-is-equiv\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A' [\u03c8 t \u21a6 \u03c4' t])\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A [\u03c8 t \u21a6 \u03b1 (\u03c4' t)])\n         ( \\ \u03c5' t \u2192 \u03b1 (\u03c5' t))\n( (t : \u03d5) \u2192 A' [\u03d5 t \u2227 \u03c8 t \u21a6 \u03c4' t])\n( (t : \u03d5) \u2192 A [\u03d5 t \u2227 \u03c8 t \u21a6 \u03b1 (\u03c4' t)])\n         ( \\ \u03bd' t \u2192 \u03b1 (\u03bd' t))\n         ( cofibration-union-functorial I \u03d5 \u03c8 (\\ _ \u2192 A') (\\ _ \u2192 A) (\\ _ \u2192 \u03b1) \u03c4')\n         ( is-orth-\u03d5-\u03c8\u2227\u03d5 ( \\ t \u2192 \u03c4' t))\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#types-with-unique-extension","title":"Types with unique extension","text":"

We say that an type A has unique extensions for a shape inclusion \u03d5 \u2282 \u03c8, if for each \u03c3 : \u03d5 \u2192 A the type of \u03c8-extensions is contractible.

#def has-unique-extensions\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : U)\n  : U\n  :=\n( \u03c3 : \u03d5 \u2192 A) \u2192 is-contr ( (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n

The property of having unique extension can be pulled back along any right orthogonal map.

#def has-unique-extensions-domain-right-orthogonal-has-unique-extensions-codomain\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( is-orth-\u03c8-\u03d5-\u03b1 : is-right-orthogonal-to-shape I \u03c8 \u03d5 A' A \u03b1)\n  : has-unique-extensions I \u03c8 \u03d5 A \u2192 has-unique-extensions I \u03c8 \u03d5 A'\n  :=\n\\ has-ue-A ( \u03c3' : \u03d5 \u2192 A') \u2192\n      is-contr-equiv-is-contr'\n( ( t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( ( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n        ( \\ \u03c4' t \u2192 \u03b1 (\u03c4' t) , is-orth-\u03c8-\u03d5-\u03b1 \u03c3')\n        ( has-ue-A (\\ t \u2192 \u03b1 (\u03c3' t)))\n

Alternatively, we can ask that the canonical restriction map (\u03c8 \u2192 A) \u2192 (\u03d5 \u2192 A) is an equivalence.

#section is-local-type\n#variable I : CUBE\n#variable \u03c8 : I \u2192 TOPE\n#variable \u03d5 : \u03c8 \u2192 TOPE\n#variable A : U\n#def is-local-type\n  : U\n  :=\n    is-equiv (\u03c8 \u2192 A) (\u03d5 \u2192 A) ( \\ \u03c4 t \u2192 \u03c4 t)\n

This follows straightforwardly from the fact that for every \u03c3 : \u03d5 \u2192 A we have an equivalence between the extension type (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t] and the fiber of the restriction map (\u03c8 \u2192 A) \u2192 (\u03d5 \u2192 A).

#def is-local-type-has-unique-extensions\n( has-ue-\u03c8-\u03d5-A : has-unique-extensions I \u03c8 \u03d5 A)\n  : is-local-type\n  :=\n    is-equiv-is-contr-map (\u03c8 \u2192 A) (\u03d5 \u2192 A) ( \\ \u03c4 t \u2192 \u03c4 t)\n( \\ ( \u03c3 : \u03d5 \u2192 A) \u2192\n          is-contr-equiv-is-contr\n            ( extension-type I \u03c8 \u03d5 A \u03c3)\n            ( homotopy-extension-type I \u03c8 \u03d5 A \u03c3)\n            ( extension-type-weakening I \u03c8 \u03d5 A \u03c3)\n            ( has-ue-\u03c8-\u03d5-A \u03c3))\n#def has-unique-extensions-is-local-type\n( is-lt-\u03c8-\u03d5-A : is-local-type)\n  : has-unique-extensions I \u03c8 \u03d5 A\n  :=\n\\ \u03c3 \u2192\n      is-contr-equiv-is-contr'\n        ( extension-type I \u03c8 \u03d5 A \u03c3)\n        ( homotopy-extension-type I \u03c8 \u03d5 A \u03c3)\n        ( extension-type-weakening I \u03c8 \u03d5 A \u03c3)\n        ( is-contr-map-is-equiv\n            ( \u03c8 \u2192 A) (\u03d5 \u2192 A) ( \\ \u03c4 t \u2192 \u03c4 t)\n            ( is-lt-\u03c8-\u03d5-A)\n            ( \u03c3))\n#end is-local-type\n

Since the property of having unique extensions passes from the codomain to the domain of a right orthogonal map, the same is true for locality of types.

#def is-local-type-domain-right-orthogonal-is-local-type-codomain\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( is-orth-\u03b1 : is-right-orthogonal-to-shape I \u03c8 \u03d5 A' A \u03b1)\n( is-local-A : is-local-type I \u03c8 \u03d5 A)\n  : is-local-type I \u03c8 \u03d5 A'\n  :=\n    is-local-type-has-unique-extensions I \u03c8 \u03d5 A'\n      ( has-unique-extensions-domain-right-orthogonal-has-unique-extensions-codomain\n          I \u03c8 \u03d5 A' A \u03b1 is-orth-\u03b1\n          ( has-unique-extensions-is-local-type I \u03c8 \u03d5 A is-local-A))\n
"},{"location":"simplicial-hott/05-segal-types.rzk/","title":"Segal Types","text":"

These formalisations correspond to Section 5 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume weakextext : WeakExtExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#hom-types","title":"Hom types","text":"

Extension types are used to define the type of arrows between fixed terms:

x y

RS17, Definition 5.1
#def hom\n( A : U)\n( x y : A)\n  : U\n  :=\n( t : \u0394\u00b9) \u2192\n    A [ t \u2261 0\u2082 \u21a6 x ,  -- the left endpoint is exactly x\n        t \u2261 1\u2082 \u21a6 y]   -- the right endpoint is exactly y\n

For each a : A, the total types of the representables \\ z \u2192 hom A a z and \\ z \u2192 hom A z a are called the coslice and slice, respectively.

#def coslice\n( A : U)\n( a : A)\n  : U\n  := \u03a3 ( z : A) , (hom A a z)\n#def slice\n( A : U)\n( a : A)\n  : U\n  := \u03a3 (z : A) , (hom A z a)\n

The types coslice A a and slice A a are functorial in A in the following sense:

#def coslice-fun\n(A B : U)\n(f : A \u2192 B)\n(a : A)\n  : coslice A a \u2192 coslice B (f a)\n  :=\n    \\ (a', g) \u2192 (f a', \\ t \u2192 f (g t))\n#def slice-fun\n(A B : U)\n(f : A \u2192 B)\n(a : A)\n  : slice A a \u2192 slice B (f a)\n  :=\n    \\ (a', g) \u2192 (f a', \\ t \u2192 f (g t))\n

Slices and coslices can also be defined directly as extension types:

#section coslice-as-extension-type\n#variable A : U\n#variable a : A\n#def coslice'\n  : U\n  := ( t : \u0394\u00b9) \u2192 A [t \u2261 0\u2082 \u21a6 a]\n#def coslice'-coslice\n  : coslice A a \u2192 coslice'\n  := \\ (_, f) \u2192 f\n#def coslice-coslice'\n  : coslice' \u2192 coslice A a\n  := \\ f \u2192 ( f 1\u2082 , \\ t \u2192 f t) -- does not typecheck after \u03b7-reduction\n#def is-id-coslice-coslice'-coslice\n  ( (a', f) : coslice A a)\n  : ( coslice-coslice' ( coslice'-coslice (a', f)) = (a', f))\n  :=\n    eq-pair A (hom A a)\n      ( coslice-coslice' ( coslice'-coslice (a', f))) (a', f)\n      (refl, refl)\n#def is-id-coslice'-coslice-coslice'\n( f : coslice')\n  : ( coslice'-coslice ( coslice-coslice' f) = f)\n  :=\nrefl\n#def is-equiv-coslice'-coslice\n  : is-equiv (coslice A a) coslice' coslice'-coslice\n  :=\n    ( ( coslice-coslice', is-id-coslice-coslice'-coslice),\n      ( coslice-coslice', is-id-coslice'-coslice-coslice')\n    )\n#def is-equiv-coslice-coslice'\n  : is-equiv coslice' (coslice A a)  coslice-coslice'\n  :=\n    ( ( coslice'-coslice, is-id-coslice'-coslice-coslice'),\n      ( coslice'-coslice, is-id-coslice-coslice'-coslice)\n    )\n#end coslice-as-extension-type\n#section slice-as-extension-type\n#variable A : U\n#variable a : A\n#def slice'\n  : U\n  := ( t : \u0394\u00b9) \u2192 A[t \u2261 1\u2082 \u21a6 a]\n#def slice'-slice\n  : slice A a \u2192 slice'\n  := \\ (_, f) \u2192 f\n#def slice-slice'\n  : slice' \u2192 slice A a\n  := \\ f \u2192 ( f 0\u2082 , \\ t \u2192 f t) -- does not typecheck after \u03b7-reduction\n#def is-id-slice-slice'-slice\n  ( (a', f) : slice A a)\n  : ( slice-slice' ( slice'-slice (a', f)) = (a', f))\n  :=\n    eq-pair A (\\ a' \u2192 hom A a' a)\n      ( slice-slice' ( slice'-slice (a', f))) (a', f)\n      (refl, refl)\n#def is-id-slice'-slice-slice'\n( f : slice')\n  : ( slice'-slice ( slice-slice' f) = f)\n  :=\nrefl\n#def is-equiv-slice'-slice\n  : is-equiv (slice A a) slice' slice'-slice\n  :=\n    ( ( slice-slice', is-id-slice-slice'-slice),\n      ( slice-slice', is-id-slice'-slice-slice')\n    )\n#def is-equiv-slice-slice'\n  : is-equiv slice' (slice A a)  slice-slice'\n  :=\n    ( ( slice'-slice, is-id-slice'-slice-slice'),\n      ( slice'-slice, is-id-slice-slice'-slice)\n    )\n#end slice-as-extension-type\n

Extension types are also used to define the type of commutative triangles:

x y z f g h

RS17, Definition 5.2
#def hom2\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n  : U\n  :=\n    ( (t\u2081 , t\u2082) : \u0394\u00b2) \u2192\n    A [ t\u2082 \u2261 0\u2082 \u21a6 f t\u2081 ,  -- the top edge is exactly `f`,\n        t\u2081 \u2261 1\u2082 \u21a6 g t\u2082 ,  -- the right edge is exactly `g`, and\n        t\u2082 \u2261 t\u2081 \u21a6 h t\u2082]   -- the diagonal is exactly `h`\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#the-segal-condition","title":"The Segal condition","text":"

A type is Segal if every composable pair of arrows has a unique composite. Note this is a considerable simplification of the usual Segal condition, which also requires homotopical uniqueness of higher-order composites.

RS17, Definition 5.3
#def is-segal\n( A : U)\n  : U\n  :=\n(x : A) \u2192 (y : A) \u2192 (z : A) \u2192\n(f : hom A x y) \u2192 (g : hom A y z) \u2192\n    is-contr (\u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n

Segal types have a composition functor and witnesses to the composition relation. Composition is written in diagrammatic order to match the order of arguments in is-segal.

#def comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : hom A x z\n  := first (first (is-segal-A x y z f g))\n#def witness-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : hom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)\n  := second (first (is-segal-A x y z f g))\n

Composition in a Segal type is unique in the following sense. If there is a witness that an arrow \\(h\\) is a composite of \\(f\\) and \\(g\\), then the specified composite equals \\(h\\).

x y z f g h \u03b1 = x y z f g comp-is-segal witness-comp-is-segal

#def uniqueness-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n( alpha : hom2 A x y z f g h)\n  : ( comp-is-segal A is-segal-A x y z f g) = h\n  :=\n    first-path-\u03a3\n      ( hom A x z)\n      ( hom2 A x y z f g)\n      ( comp-is-segal A is-segal-A x y z f g ,\n        witness-comp-is-segal A is-segal-A x y z f g)\n      ( h , alpha)\n( homotopy-contraction\n        ( \u03a3 (k : hom A x z) , (hom2 A x y z f g k))\n        ( is-segal-A x y z f g)\n        ( h , alpha))\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#characterizing-segal-types","title":"Characterizing Segal types","text":"

Our aim is to prove that a type is Segal if and only if the horn-restriction map, defined below, is an equivalence.

x y z f g

A pair of composable arrows form a horn.

#def horn\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : \u039b \u2192 A\n  :=\n    \\ (t , s) \u2192\nrecOR\n      ( s \u2261 0\u2082 \u21a6 f t ,\n        t \u2261 1\u2082 \u21a6 g s)\n

The underlying horn of a simplex:

#def horn-restriction\n( A : U)\n  : (\u0394\u00b2 \u2192 A) \u2192 (\u039b \u2192 A)\n  := \\ f t \u2192 f t\n

This provides an alternate definition of Segal types as types which are local for the inclusion \u039b \u2282 \u0394\u00b9.

#def is-local-horn-inclusion\n  : U \u2192 U\n  := is-local-type (2 \u00d7 2) \u0394\u00b2 (\\ t \u2192 \u039b t)\n#def is-local-horn-inclusion-unpacked\n( A : U)\n  : is-local-horn-inclusion A = is-equiv (\u0394\u00b2 \u2192 A) (\u039b \u2192 A) (horn-restriction A)\n  := refl\n

Now we prove this definition is equivalent to the original one. Here, we prove the equivalence used in [RS17, Theorem 5.5]. However, we do this by constructing the equivalence directly, instead of using a composition of equivalences, as it is easier to write down and it computes better (we can use refl for the witnesses of the equivalence).

#def compositions-are-horn-fillings\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : Equiv\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n( (t : \u0394\u00b2) \u2192 A [\u039b t \u21a6 horn A x y z f g t])\n  :=\n    ( \\ hh t \u2192 (second hh) t ,\n      ( ( \\ k \u2192 (\\ t \u2192 k (t , t) , \\ (t , s) \u2192 k (t , s)) ,\n\\ hh \u2192 refl) ,\n        ( \\ k \u2192 (\\ t \u2192 k (t , t) , \\ (t , s) \u2192 k (t , s)) ,\n\\ hh \u2192 refl)))\n#def equiv-horn-restriction\n( A : U)\n  : Equiv\n    ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n( \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n            ( hom2 A\n              ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n              ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n              ( h))))\n  :=\n    ( \\ k \u2192\n      ( ( \\ t \u2192 k t) ,\n        ( \\ t \u2192 k (t , t) , \\ t \u2192 k t)) ,\n      ( ( \\ khh t \u2192 (second (second khh)) t , \\ k \u2192 refl) ,\n        ( \\ khh t \u2192 (second (second khh)) t , \\ k \u2192 refl)))\n
RS17, Theorem 5.5 (the hard direction)
#def equiv-horn-restriction-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : Equiv (\u0394\u00b2 \u2192 A) (\u039b \u2192 A)\n  :=\n    equiv-comp\n      ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n( \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n                ( h))))\n      ( \u039b \u2192 A)\n      ( equiv-horn-restriction A)\n      ( projection-total-type\n        ( \u039b \u2192 A)\n( \\ k \u2192\n          \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n            ( hom2 A\n              ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n              ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n              ( h))) ,\n      ( is-equiv-projection-contractible-fibers\n          ( \u039b \u2192 A)\n( \\ k \u2192\n            \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n                ( h)))\n          ( \\ k \u2192\n            is-segal-A\n              ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n              ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t)))))\n

We verify that the mapping in Segal-equiv-horn-restriction A is-segal-A is exactly horn-restriction A.

#def test-equiv-horn-restriction-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : (first (equiv-horn-restriction-is-segal A is-segal-A)) = (horn-restriction A)\n  := refl\n
Segal types are types that are local at the horn inclusion
#def is-local-horn-inclusion-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : is-local-horn-inclusion A\n  := second (equiv-horn-restriction-is-segal A is-segal-A)\n
Types that are local at the horn inclusion are Segal types
#def is-segal-is-local-horn-inclusion\n( A : U)\n( is-local-horn-inclusion-A : is-local-horn-inclusion A)\n  : is-segal A\n  :=\n\\ x y z f g \u2192\n    contractible-fibers-is-equiv-projection\n      ( \u039b \u2192 A)\n( \\ k \u2192\n        \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n          ( hom2 A\n            ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n            ( \\ t \u2192 k (t , 0\u2082))\n            ( \\ t \u2192 k (1\u2082 , t))\n            ( h)))\n( second\n        ( equiv-comp\n          ( \u03a3 ( k : \u039b \u2192 A) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082))\n                ( \\ t \u2192 k (1\u2082 , t))\n                ( h)))\n          ( \u0394\u00b2 \u2192 A)\n          ( \u039b  \u2192 A)\n          ( inv-equiv\n            ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n                ( hom2 A\n                  ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                  ( \\ t \u2192 k (t , 0\u2082))\n                  ( \\ t \u2192 k (1\u2082 , t))\n                  ( h)))\n            ( equiv-horn-restriction A))\n          ( horn-restriction A , is-local-horn-inclusion-A)))\n    ( horn A x y z f g)\n

We have now proven that both notions of Segal types are logically equivalent.

RS17, Theorem 5.5
#def is-segal-iff-is-local-horn-inclusion\n( A : U)\n  : iff (is-segal A) (is-local-horn-inclusion A)\n  := (is-local-horn-inclusion-is-segal A , is-segal-is-local-horn-inclusion A)\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#segal-function-and-extension-types","title":"Segal function and extension types","text":"

Using the new characterization of Segal types, we can show that the type of functions or extensions into a family of Segal types is again a Segal type. For instance if \\(X\\) is a type and \\(A : X \u2192 U\\) is such that \\(A x\\) is a Segal type for all \\(x\\) then \\((x : X) \u2192 A x\\) is a Segal type.

RS17, Corollary 5.6(i)
#def is-local-horn-inclusion-function-type uses (funext)\n( X : U)\n( A : X \u2192 U)\n( fiberwise-is-segal-A : (x : X) \u2192 is-local-horn-inclusion (A x))\n  : is-local-horn-inclusion ((x : X) \u2192 A x)\n  :=\n    is-equiv-triple-comp\n( \u0394\u00b2 \u2192 ((x : X) \u2192 A x))\n( (x : X) \u2192 \u0394\u00b2 \u2192 A x)\n( (x : X) \u2192 \u039b \u2192 A x)\n( \u039b \u2192 ((x : X) \u2192 A x))\n      ( \\ g x t \u2192 g t x) -- first equivalence\n      ( second (flip-ext-fun\n        ( 2 \u00d7 2)\n        ( \u0394\u00b2)\n        ( \\ t \u2192 BOT)\n        ( X)\n        ( \\ t \u2192 A)\n        ( \\ t \u2192 recBOT)))\n      ( \\ h x t \u2192 h x t) -- second equivalence\n      ( second (equiv-function-equiv-family\n        ( funext)\n        ( X)\n        ( \\ x \u2192 (\u0394\u00b2 \u2192 A x))\n        ( \\ x \u2192 (\u039b \u2192 A x))\n        ( \\ x \u2192 (horn-restriction (A x) , fiberwise-is-segal-A x))))\n      ( \\ h t x \u2192 (h x) t) -- third equivalence\n      ( second (flip-ext-fun-inv\n        ( 2 \u00d7 2)\n        ( \u039b)\n        ( \\ t \u2192 BOT)\n        ( X)\n        ( \\ t \u2192 A)\n        ( \\ t \u2192 recBOT)))\n#def is-segal-function-type uses (funext)\n( X : U)\n( A : X \u2192 U)\n( fiberwise-is-segal-A : (x : X) \u2192 is-segal (A x))\n  : is-segal ((x : X) \u2192 A x)\n  :=\n    is-segal-is-local-horn-inclusion\n( (x : X) \u2192 A x)\n      ( is-local-horn-inclusion-function-type\n        ( X) (A)\n        ( \\ x \u2192 is-local-horn-inclusion-is-segal (A x)(fiberwise-is-segal-A x)))\n

If \\(X\\) is a shape and \\(A : X \u2192 U\\) is such that \\(A x\\) is a Segal type for all \\(x\\) then \\((x : X) \u2192 A x\\) is a Segal type.

RS17, Corollary 5.6(ii)
#def is-local-horn-inclusion-extension-type uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( fiberwise-is-segal-A : (s : \u03c8) \u2192 is-local-horn-inclusion (A s))\n  : is-local-horn-inclusion ((s : \u03c8) \u2192 A s)\n  :=\n    is-equiv-triple-comp\n( \u0394\u00b2 \u2192 (s : \u03c8) \u2192 A s)\n( (s : \u03c8) \u2192 \u0394\u00b2 \u2192 A s)\n( (s : \u03c8) \u2192 \u039b \u2192 A s)\n( \u039b \u2192 (s : \u03c8) \u2192 A s)\n      ( \\ g s t \u2192 g t s)  -- first equivalence\n      ( second\n        ( fubini\n          ( 2 \u00d7 2)\n          ( I)\n          ( \u0394\u00b2)\n          ( \\ t \u2192 BOT)\n          ( \u03c8)\n          ( \\ s \u2192 BOT)\n          ( \\ t s \u2192 A s)\n          ( \\ u \u2192 recBOT)))\n      ( \\ h s t \u2192 h s t) -- second equivalence\n      ( second (equiv-extension-equiv-family extext I \u03c8\n        ( \\ s \u2192 \u0394\u00b2 \u2192 A s)\n        ( \\ s \u2192 \u039b \u2192 A s)\n        ( \\ s \u2192 (horn-restriction (A s) , fiberwise-is-segal-A s))))\n      ( \\ h t s \u2192 (h s) t) -- third equivalence\n      ( second\n        ( fubini\n          ( I)\n          ( 2 \u00d7 2)\n          ( \u03c8)\n          ( \\ s \u2192 BOT)\n          ( \u039b)\n          ( \\ t \u2192 BOT)\n          ( \\ s t \u2192 A s)\n          ( \\ u \u2192 recBOT)))\n#def is-segal-extension-type uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( fiberwise-is-segal-A : (s : \u03c8) \u2192 is-segal (A s))\n  : is-segal ((s : \u03c8) \u2192 A s)\n  :=\n    is-segal-is-local-horn-inclusion\n( (s : \u03c8) \u2192 A s)\n      ( is-local-horn-inclusion-extension-type\n        ( I) (\u03c8) (A)\n        ( \\ s \u2192 is-local-horn-inclusion-is-segal (A s)(fiberwise-is-segal-A s)))\n

In particular, the arrow type of a Segal type is Segal. First, we define the arrow type:

#def arr\n( A : U)\n  : U\n  := \u0394\u00b9 \u2192 A\n

For later use, an equivalent characterization of the arrow type.

#def arr-\u03a3-hom\n( A : U)\n  : ( arr A) \u2192 (\u03a3 (x : A) , (\u03a3 (y : A) , hom A x y))\n  := \\ f \u2192 (f 0\u2082 , (f 1\u2082 , f))\n#def is-equiv-arr-\u03a3-hom\n( A : U)\n  : is-equiv (arr A) (\u03a3 (x : A) , (\u03a3 (y : A) , hom A x y)) (arr-\u03a3-hom A)\n  :=\n    ( ( \\ (x , (y , f)) \u2192 f , \\ f \u2192 refl) ,\n      ( \\ (x , (y , f)) \u2192 f , \\ xyf \u2192 refl))\n#def equiv-arr-\u03a3-hom\n( A : U)\n  : Equiv (arr A) (\u03a3 (x : A) , (\u03a3 (y : A) , hom A x y))\n  := ( arr-\u03a3-hom A , is-equiv-arr-\u03a3-hom A)\n
RS17, Corollary 5.6(ii), special case for locality at the horn inclusion
#def is-local-horn-inclusion-arr uses (extext)\n( A : U)\n( is-segal-A : is-local-horn-inclusion A)\n  : is-local-horn-inclusion (arr A)\n  :=\n    is-local-horn-inclusion-extension-type\n      ( 2)\n      ( \u0394\u00b9)\n      ( \\ _ \u2192 A)\n      ( \\ _ \u2192 is-segal-A)\n
RS17, Corollary 5.6(ii), special case for the Segal condition
#def is-segal-arr uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n  : is-segal (arr A)\n  :=\n    is-segal-extension-type\n      ( 2)\n      ( \u0394\u00b9)\n      ( \\ _ \u2192 A)\n      ( \\ _ \u2192 is-segal-A)\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#identity","title":"Identity","text":"

All types have identity arrows and witnesses to the identity composition law.

x x x

RS17, Definition 5.7
#def id-hom\n( A : U)\n( x : A)\n  : hom A x x\n  := \\ t \u2192 x\n

Witness for the right identity law:

x y y f y f f

RS17, Proposition 5.8a
#def comp-id-witness\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : hom2 A x y y f (id-hom A y) f\n  := \\ (t , s) \u2192 f t\n

Witness for the left identity law:

x x y x f f f

RS17, Proposition 5.8b
#def id-comp-witness\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : hom2 A x x y (id-hom A x) f f\n  := \\ (t , s) \u2192 f s\n

In a Segal type, where composition is unique, it follows that composition with an identity arrow recovers the original arrow. Thus, an identity axiom was not needed in the definition of Segal types.

If A is Segal then the right unit law holds
#def comp-id-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : ( comp-is-segal A is-segal-A x y y f (id-hom A y)) = f\n  :=\n    uniqueness-comp-is-segal\n      ( A)\n      ( is-segal-A)\n      ( x) (y) (y)\n      ( f)\n      ( id-hom A y)\n      ( f)\n      ( comp-id-witness A x y f)\n
If A is Segal then the left unit law holds
#def id-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (comp-is-segal A is-segal-A x x y (id-hom A x) f) =_{hom A x y} f\n  :=\n    uniqueness-comp-is-segal\n      ( A)\n      ( is-segal-A)\n      ( x) (x) (y)\n      ( id-hom A x)\n      ( f)\n      ( f)\n      ( id-comp-witness A x y f)\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#associativity","title":"Associativity","text":"

We now prove that composition in a Segal type is associative, by using the fact that the type of arrows in a Segal type is itself a Segal type.

\u2022 \u2022 \u2022 \u2022

#def unfolding-square\n( A : U)\n( triangle : \u0394\u00b2 \u2192 A)\n  : \u0394\u00b9\u00d7\u0394\u00b9 \u2192 A\n  :=\n    \\ (t , s) \u2192\nrecOR\n      ( t \u2264 s \u21a6 triangle (s , t) ,\n        s \u2264 t \u21a6 triangle (t , s))\n

For use in the proof of associativity:

x y z y f g comp-is-segal g f

#def witness-square-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : \u0394\u00b9\u00d7\u0394\u00b9 \u2192 A\n  := unfolding-square A (witness-comp-is-segal A is-segal-A x y z f g)\n

The witness-square-comp-is-segal as an arrow in the arrow type:

x y z y f g

#def arr-in-arr-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : hom (arr A) f g\n  := \\ t s \u2192 witness-square-comp-is-segal A is-segal-A x y z f g (t , s)\n

w x x y y z f g h

#def witness-asociative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom2 (arr A) f g h\n      (arr-in-arr-is-segal A is-segal-A w x y f g)\n      (arr-in-arr-is-segal A is-segal-A x y z g h)\n      (comp-is-segal (arr A) (is-segal-arr A is-segal-A)\n      f g h\n      (arr-in-arr-is-segal A is-segal-A w x y f g)\n      (arr-in-arr-is-segal A is-segal-A x y z g h))\n  :=\n    witness-comp-is-segal\n      ( arr A)\n      ( is-segal-arr A is-segal-A)\n      f g h\n      ( arr-in-arr-is-segal A is-segal-A w x y f g)\n      ( arr-in-arr-is-segal A is-segal-A x y z g h)\n

w x y z g f h

The witness-associative-is-segal curries to define a diagram \\(\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A\\). The tetrahedron-associative-is-segal is extracted via the middle-simplex map \\(((t , s) , r) \u21a6 ((t , r) , s)\\) from \\(\u0394\u00b3\\) to \\(\u0394\u00b2\u00d7\u0394\u00b9\\).

#def tetrahedron-associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : \u0394\u00b3 \u2192 A\n  :=\n    \\ ((t , s) , r) \u2192\n    (witness-asociative-is-segal A is-segal-A w x y z f g h) (t , r) s\n

w x y z g f h

The diagonal composite of three arrows extracted from the tetrahedron-associative-is-segal.

#def triple-comp-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom A w z\n  :=\n\\ t \u2192\n    tetrahedron-associative-is-segal A is-segal-A w x y z f g h\n      ( (t , t) , t)\n

w x y z g f h

#def left-witness-asociative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom2 A w y z\n    (comp-is-segal A is-segal-A w x y f g)\n    h\n    (triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    \\ (t , s) \u2192\n    tetrahedron-associative-is-segal A is-segal-A w x y z f g h\n      ( (t , t) , s)\n

The front face:

w x y z g f h

#def right-witness-asociative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom2 A w x z\n    ( f)\n    ( comp-is-segal A is-segal-A x y z g h)\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    \\ (t , s) \u2192\n    tetrahedron-associative-is-segal A is-segal-A w x y z f g h\n      ( (t , s) , s)\n
#def left-associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : ( comp-is-segal A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h) =\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    uniqueness-comp-is-segal\n      A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h\n      ( triple-comp-is-segal A is-segal-A w x y z f g h)\n      ( left-witness-asociative-is-segal A is-segal-A w x y z f g h)\n#def right-associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : ( comp-is-segal A is-segal-A w x z f (comp-is-segal A is-segal-A x y z g h)) =\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    uniqueness-comp-is-segal\n      ( A) (is-segal-A) (w) (x) (z) (f) (comp-is-segal A is-segal-A x y z g h)\n      ( triple-comp-is-segal A is-segal-A w x y z f g h)\n      ( right-witness-asociative-is-segal A is-segal-A w x y z f g h)\n

We conclude that Segal composition is associative.

RS17, Proposition 5.9
#def associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : ( comp-is-segal A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h) =\n    ( comp-is-segal A is-segal-A w x z f (comp-is-segal A is-segal-A x y z g h))\n  :=\n    zig-zag-concat\n    ( hom A w z)\n    ( comp-is-segal A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h)\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n    ( comp-is-segal A is-segal-A w x z f (comp-is-segal A is-segal-A x y z g h))\n    ( left-associative-is-segal A is-segal-A w x y z f g h)\n    ( right-associative-is-segal A is-segal-A w x y z f g h)\n#def postcomp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (z : A) \u2192 (hom A z x) \u2192 (hom A z y)\n  := \\ z g \u2192 comp-is-segal A is-segal-A z x y g f\n#def precomp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (z : A) \u2192 (hom A y z) \u2192 (hom A x z)\n  := \\ z \u2192 comp-is-segal A is-segal-A x y z f\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#homotopies","title":"Homotopies","text":"

We may define a \"homotopy\" to be a path between parallel arrows. In a Segal type, homotopies are equivalent to terms in hom2 types involving an identity arrow.

#def map-hom2-homotopy\n( A : U)\n( x y : A)\n( f g : hom A x y)\n  : (f = g) \u2192 (hom2 A x x y (id-hom A x) f g)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192 (hom2 A x x y (id-hom A x) f g'))\n      ( id-comp-witness A x y f)\n      ( g)\n#def map-total-hom2-homotopy\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : ( \u03a3 (g : hom A x y) , (f = g)) \u2192\n( \u03a3 (g : hom A x y) , (hom2 A x x y (id-hom A x) f g))\n  := \\ (g , p) \u2192 (g , map-hom2-homotopy A x y f g p)\n#def is-equiv-map-total-hom2-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : is-equiv\n( \u03a3 (g : hom A x y) , f = g)\n( \u03a3 (g : hom A x y) , (hom2 A x x y (id-hom A x) f g))\n      ( map-total-hom2-homotopy A x y f)\n  :=\n    is-equiv-are-contr\n( \u03a3 (g : hom A x y) , (f = g))\n( \u03a3 (g : hom A x y) , (hom2 A x x y (id-hom A x) f g))\n      ( is-contr-based-paths (hom A x y) f)\n      ( is-segal-A x x y (id-hom A x) f)\n      ( map-total-hom2-homotopy A x y f)\n
RS17, Proposition 5.10
#def equiv-homotopy-hom2-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f h : hom A x y)\n  : Equiv (f = h) (hom2 A x x y (id-hom A x) f h)\n  :=\n    ( ( map-hom2-homotopy A x y f h) ,\n      ( total-equiv-family-of-equiv\n        ( hom A x y)\n        ( \\ k \u2192 (f = k))\n        ( \\ k \u2192 (hom2 A x x y (id-hom A x) f k))\n        ( map-hom2-homotopy A x y f)\n        ( is-equiv-map-total-hom2-homotopy-is-segal A is-segal-A x y f)\n        ( h)))\n

A dual notion of homotopy can be defined similarly.

#def map-hom2-homotopy'\n( A : U)\n( x y : A)\n( f g : hom A x y)\n( p : f = g)\n  : (hom2 A x y y f (id-hom A y) g)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192 (hom2 A x y y f (id-hom A y) g'))\n      ( comp-id-witness A x y f)\n      ( g)\n      ( p)\n#def map-total-hom2-homotopy'\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : ( \u03a3 (g : hom A x y) , (f = g)) \u2192\n( \u03a3 (g : hom A x y) , (hom2 A x y y f (id-hom A y) g))\n  := \\ (g , p) \u2192 (g , map-hom2-homotopy' A x y f g p)\n#def is-equiv-map-total-hom2-homotopy'-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : is-equiv\n( \u03a3 (g : hom A x y) , f = g)\n( \u03a3 (g : hom A x y) , (hom2 A x y y f (id-hom A y) g))\n      ( map-total-hom2-homotopy' A x y f)\n  :=\n    is-equiv-are-contr\n( \u03a3 (g : hom A x y) , (f = g))\n( \u03a3 (g : hom A x y) , (hom2 A x y y f (id-hom A y) g))\n      ( is-contr-based-paths (hom A x y) f)\n      ( is-segal-A x y y f (id-hom A y))\n      ( map-total-hom2-homotopy' A x y f)\n
RS17, Proposition 5.10
#def equiv-homotopy-hom2'-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f h : hom A x y)\n  : Equiv (f = h) (hom2 A x y y f (id-hom A y) h)\n  :=\n    ( ( map-hom2-homotopy' A x y f h) ,\n      ( total-equiv-family-of-equiv\n        ( hom A x y)\n        ( \\ k \u2192 (f = k))\n        ( \\ k \u2192 (hom2 A x y y f (id-hom A y) k))\n        ( map-hom2-homotopy' A x y f)\n        ( is-equiv-map-total-hom2-homotopy'-is-segal A is-segal-A x y f)\n        ( h)))\n

More generally, a homotopy between a composite and another map is equivalent to the data provided by a commutative triangle with that boundary.

#def map-hom2-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n( p : (comp-is-segal A is-segal-A x y z f g) = h)\n  : ( hom2 A x y z f g h)\n  :=\n    ind-path\n      ( hom A x z)\n      ( comp-is-segal A is-segal-A x y z f g)\n      ( \\ h' p' \u2192 hom2 A x y z f g h')\n      ( witness-comp-is-segal A is-segal-A x y z f g)\n      ( h)\n      ( p)\n#def map-total-hom2-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : ( \u03a3 (h : hom A x z) , (comp-is-segal A is-segal-A x y z f g) = h) \u2192\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n  := \\ (h , p) \u2192 (h , map-hom2-eq-is-segal A is-segal-A x y z f g h p)\n#def is-equiv-map-total-hom2-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : is-equiv\n( \u03a3 (h : hom A x z) , (comp-is-segal A is-segal-A x y z f g) = h)\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n      ( map-total-hom2-eq-is-segal A is-segal-A x y z f g)\n  :=\n    is-equiv-are-contr\n( \u03a3 (h : hom A x z) , (comp-is-segal A is-segal-A x y z f g) = h)\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n      ( is-contr-based-paths (hom A x z) (comp-is-segal A is-segal-A x y z f g))\n      ( is-segal-A x y z f g)\n      ( map-total-hom2-eq-is-segal A is-segal-A x y z f g)\n
RS17, Proposition 5.12
#def equiv-hom2-eq-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( k : hom A x z)\n  : Equiv ((comp-is-segal A is-segal-A x y z f g) = k) (hom2 A x y z f g k)\n  :=\n    ( ( map-hom2-eq-is-segal A is-segal-A x y z f g k) ,\n      ( total-equiv-family-of-equiv\n        ( hom A x z)\n        ( \\ m \u2192 (comp-is-segal A is-segal-A x y z f g) = m)\n        ( hom2 A x y z f g)\n        ( map-hom2-eq-is-segal A is-segal-A x y z f g)\n        ( is-equiv-map-total-hom2-eq-is-segal A is-segal-A x y z f g)\n        ( k)))\n

Homotopies form a congruence, meaning that homotopies are respected by composition:

RS17, Proposition 5.13
#def congruence-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f g : hom A x y)\n( h k : hom A y z)\n( p : f = g)\n( q : h = k)\n  : ( comp-is-segal A is-segal-A x y z f h) =\n    ( comp-is-segal A is-segal-A x y z g k)\n  :=\n    ind-path\n      ( hom A y z)\n      ( h)\n      ( \\ k' q' \u2192\n        ( comp-is-segal A is-segal-A x y z f h) =\n        ( comp-is-segal A is-segal-A x y z g k'))\n      ( ind-path\n        ( hom A x y)\n        ( f)\n        ( \\ g' p' \u2192\n          ( comp-is-segal A is-segal-A x y z f h) =\n          ( comp-is-segal A is-segal-A x y z g' h))\n        ( refl)\n        ( g)\n        ( p))\n      ( k)\n      ( q)\n

As a special case of the above:

#def postwhisker-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f g : hom A x y)\n( h : hom A y z)\n( p : f = g)\n  : ( comp-is-segal A is-segal-A x y z f h) = (comp-is-segal A is-segal-A x y z g h)\n  := congruence-homotopy-is-segal A is-segal-A x y z f g h h p refl\n

As a special case of the above:

#def prewhisker-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( w x y : A)\n( k : hom A w x)\n( f g : hom A x y)\n( p : f = g)\n  : ( comp-is-segal A is-segal-A w x y k f) =\n    ( comp-is-segal A is-segal-A w x y k g)\n  := congruence-homotopy-is-segal A is-segal-A w x y k k f g refl p\n
RS17, Proposition 5.14(a)
#def compute-postwhisker-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f g : hom A x y)\n( h : hom A y z)\n( p : f = g)\n  : ( postwhisker-homotopy-is-segal A is-segal-A x y z f g h p) =\n    ( ap (hom A x y) (hom A x z) f g (\\ k \u2192 comp-is-segal A is-segal-A x y z k h) p)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192\n        ( postwhisker-homotopy-is-segal A is-segal-A x y z f g' h p') =\n        ( ap\n          (hom A x y) (hom A x z)\n          (f) (g') (\\ k \u2192 comp-is-segal A is-segal-A x y z k h) (p')))\n      ( refl)\n      ( g)\n      ( p)\n
RS17, Proposition 5.14(b)
#def prewhisker-homotopy-is-ap-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( w x y : A)\n( k : hom A w x)\n( f g : hom A x y)\n( p : f = g)\n  : ( prewhisker-homotopy-is-segal A is-segal-A w x y k f g p) =\n    ( ap (hom A x y) (hom A w y) f g (comp-is-segal A is-segal-A w x y k) p)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192\n        ( prewhisker-homotopy-is-segal A is-segal-A w x y k f g' p') =\n        ( ap (hom A x y) (hom A w y) f g' (comp-is-segal A is-segal-A w x y k) p'))\n      ( refl)\n      ( g)\n      ( p)\n#section is-segal-Unit\n#def is-contr-Unit : is-contr Unit := (unit , \\ _ \u2192 refl)\n#def is-contr-\u0394\u00b2\u2192Unit uses (extext)\n  : is-contr (\u0394\u00b2 \u2192 Unit)\n  :=\n    ( \\ _ \u2192 unit ,\n\\ k \u2192\n      eq-ext-htpy extext\n        ( 2 \u00d7 2) \u0394\u00b2 (\\ _ \u2192 BOT)\n        ( \\ _ \u2192 Unit) (\\ _ \u2192 recBOT)\n        ( \\ _ \u2192 unit) k\n        ( \\ _ \u2192 refl))\n#def is-segal-Unit uses (extext)\n  : is-segal Unit\n  :=\n\\ x y z f g \u2192\n    is-contr-is-retract-of-is-contr\n( \u03a3 (h : hom Unit x z) , (hom2 Unit x y z f g h))\n      ( \u0394\u00b2 \u2192 Unit)\n      ( ( \\ (_ , k) \u2192 k) ,\n        ( \\ k \u2192 ((\\ t \u2192 k (t , t)) , k) , \\ _ \u2192 refl))\n      ( is-contr-\u0394\u00b2\u2192Unit)\n#end is-segal-Unit\n

Interchange law

#section homotopy-interchange-law\n#variable A : U\n#variable is-segal-A : is-segal A\n#variables x y z : A\n#def homotopy-interchange-law-statement\n( f1 f2 f3 : hom A x y)\n( h1 h2 h3 : hom A y z)\n( p : f1 = f2)\n( q : f2 = f3)\n( p' : h1 = h2)\n( q' : h2 = h3)\n  : U\n  := congruence-homotopy-is-segal A is-segal-A x y z f1 f3 h1 h3\n      ( concat (hom A x y) f1 f2 f3 p q)\n      ( concat (hom A y z) h1 h2 h3 p' q') =\n    concat\n      ( hom A x z)\n      ( comp-is-segal A is-segal-A x y z f1 h1)\n      ( comp-is-segal A is-segal-A x y z f2 h2)\n      ( comp-is-segal A is-segal-A x y z f3 h3)\n      ( congruence-homotopy-is-segal A is-segal-A x y z f1 f2 h1 h2 p p')\n      ( congruence-homotopy-is-segal A is-segal-A x y z f2 f3 h2 h3 q q')\n
RS17, Proposition 5.15
#def homotopy-interchange-law\n( f1 f2 f3 : hom A x y)\n( h1 h2 h3 : hom A y z)\n( p : f1 = f2)\n( q : f2 = f3)\n( p' : h1 = h2)\n( q' : h2 = h3)\n  : homotopy-interchange-law-statement f1 f2 f3 h1 h2 h3 p q p' q'\n  := ind-path\n    ( hom A x y)\n    ( f2)\n    ( \\ f3 q -> homotopy-interchange-law-statement f1 f2 f3 h1 h2 h3 p q p' q')\n    ( ind-path\n      ( hom A x y)\n      ( f1)\n      ( \\ f2 p -> homotopy-interchange-law-statement f1 f2 f2 h1 h2 h3\n          p refl p' q')\n      ( ind-path\n        ( hom A y z)\n        ( h2)\n        ( \\ h3 q' -> homotopy-interchange-law-statement f1 f1 f1 h1 h2 h3\nrefl refl p' q')\n        ( ind-path\n          ( hom A y z)\n          ( h1)\n          ( \\ h2 p' -> homotopy-interchange-law-statement f1 f1 f1 h1 h2 h2\nrefl refl p' refl)\n          ( refl)\n          ( h2)\n          ( p'))\n        ( h3)\n        ( q'))\n      ( f2)\n      ( p))\n    ( f3)\n    ( q)\n#end homotopy-interchange-law\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#inner-anodyne-maps","title":"Inner anodyne maps","text":"RS17, Definition 5.19
#def is-inner-anodyne\n(I : CUBE)\n(\u03c8 : I \u2192 TOPE)\n(\u03a6 : \u03c8 \u2192 TOPE)\n  : U\n  := (A : U) \u2192 is-segal A \u2192 (h : \u03a6 \u2192 A) \u2192 is-contr ((t : \u03c8) \u2192 A[ \u03a6 t \u21a6 h t ])\n

The cofibration \u039b\u00b2\u2081 \u2192 \u0394\u00b2 is inner anodyne

#def is-inner-anodyne-\u039b\u00b2\u2081\n  : is-inner-anodyne (2 \u00d7 2) \u0394\u00b2 \u039b\u00b2\u2081\n  := \\ A is-segal-A h' \u2192\n    equiv-with-contractible-domain-implies-contractible-codomain\n( \u03a3 (h : hom A (h' (0\u2082,0\u2082)) (h' (1\u2082,1\u2082))) ,\n          (hom2 A (h' (0\u2082,0\u2082)) (h' (1\u2082,0\u2082)) (h' (1\u2082,1\u2082))\n          (\\ t \u2192 h' (t,0\u2082)) (\\ s \u2192 h' (1\u2082,s)) h))\n( (t : \u0394\u00b2) \u2192 A [\u039b t \u21a6 h' t])\n      (compositions-are-horn-fillings\n        A (h' (0\u2082,0\u2082)) (h' (1\u2082,0\u2082)) (h' (1\u2082,1\u2082))\n          (\\ t \u2192 h' (t,0\u2082)) (\\ s \u2192 h' (1\u2082,s)))\n      (is-segal-A (h' (0\u2082,0\u2082)) (h' (1\u2082,0\u2082)) (h' (1\u2082,1\u2082))\n          (\\ t \u2192 h' (t,0\u2082)) (\\ s \u2192 h' (1\u2082,s)))\n
RS17, lemma 5.20
#def is-inner-anodyne-pushout-product-left-is-inner-anodyne uses (weakextext)\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03a6 : \u03c8 \u2192 TOPE)\n(is-inner-anodyne-\u03c8-\u03a6 : is-inner-anodyne I \u03c8 \u03a6)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n  : is-inner-anodyne (I \u00d7 J)\n      (\\ (t,s) \u2192 \u03c8 t \u2227 \u03b6 s)\n      (\\ (t,s) \u2192 (\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s))\n  := \\ A is-segal-A h \u2192\n    equiv-with-contractible-codomain-implies-contractible-domain\n      (((t,s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192 A[(\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 h (t,s)])\n( (s : \u03b6) \u2192 ((t : \u03c8) \u2192 A[ \u03a6 t \u21a6 h (t,s)])[ \u03c7 s \u21a6 \\ t \u2192 h (t, s)])\n      (uncurry-opcurry I J \u03c8 \u03a6 \u03b6 \u03c7 (\\ s t \u2192 A) h)\n      (weakextext\n        ( J)\n        ( \u03b6)\n        ( \u03c7)\n( \\ s \u2192 (t : \u03c8) \u2192 A[ \u03a6 t \u21a6 h (t,s)])\n        ( \\ s \u2192 is-inner-anodyne-\u03c8-\u03a6 A is-segal-A (\\ t \u2192 h (t,s)))\n        ( \\ s t \u2192 h (t,s)))\n#def is-inner-anodyne-pushout-product-right-is-inner-anodyne uses (weakextext)\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03a6 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n(is-inner-anodyne-\u03b6-\u03c7 : is-inner-anodyne J \u03b6 \u03c7)\n  : is-inner-anodyne (I \u00d7 J)\n      (\\ (t,s) \u2192 \u03c8 t \u2227 \u03b6 s)\n      (\\ (t,s) \u2192 (\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s))\n  := \\ A is-segal-A h \u2192\n    equiv-with-contractible-domain-implies-contractible-codomain\n( (t : \u03c8) \u2192 ((s : \u03b6) \u2192 A[ \u03c7 s \u21a6 h (t,s)])[ \u03a6 t \u21a6 \\ s \u2192 h (t, s)])\n      (((t,s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192 A[(\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 h (t,s)])\n      (curry-uncurry I J \u03c8 \u03a6 \u03b6 \u03c7 (\\ s t \u2192 A) h)\n      (weakextext\n        ( I)\n        ( \u03c8)\n        ( \u03a6)\n( \\ t \u2192 (s : \u03b6) \u2192 A[ \u03c7 s \u21a6 h (t,s)])\n        ( \\ t \u2192 is-inner-anodyne-\u03b6-\u03c7 A is-segal-A (\\ s \u2192 h (t,s)))\n        ( \\ s t \u2192 h (s,t)))\n
RS17, lemma 5.21
#section retraction-\u039b\u00b3\u2082-\u0394\u00b3-pushout-product-\u039b\u00b2\u2081-\u0394\u00b2\n-- \u0394\u00b3\u00d7\u039b\u00b2\u2081 \u222a_{\u039b\u00b3\u2082\u00d7\u039b\u00b2\u2081} \u039b\u00b3\u2082\u00d7\u0394\u00b2\n#def pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081\n  : (\u0394\u00b3\u00d7\u0394\u00b2) \u2192 TOPE\n  := shape-pushout-prod (2 \u00d7 2 \u00d7 2) (2 \u00d7 2) \u0394\u00b3 \u039b\u00b3\u2082 \u0394\u00b2 \u039b\u00b2\u2081\n#variable A : U\n#variable h : \u039b\u00b3\u2082 \u2192 A\n#def h^\n  : pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081 \u2192 A\n  := \\ ( ((t1, t2), t3), (s1, s2) ) \u2192\nrecOR\n      ( s1 \u2264 t1 \u2227 t2 \u2264 s2 \u21a6 h ((t1, t2), t3),\n        t1 \u2264 s1 \u2227 t2 \u2264 s2 \u21a6 h ((s1, t2), t3),\n        s1 \u2264 t1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 h ((t1, s2), t3),\n        t1 \u2264 s1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 h ((s1, s2), t3),\n        s1 \u2264 t1 \u2227 s2 \u2264 t3 \u21a6 h ((t1, s2), s2),\n        t1 \u2264 s1 \u2227 s2 \u2264 t3 \u21a6 h ((s1, s2), s2))\n#def extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n  : U\n  := (t : \u0394\u00b3) \u2192 A[ \u039b\u00b3\u2082 t \u21a6 h t ]\n#def extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (h)\n  : U\n  := (x : \u0394\u00b3\u00d7\u0394\u00b2) \u2192 A[ pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081 x \u21a6 h^ x]\n#def retract-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n(f : extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2)\n  : extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n  := \\ ((t1, t2), t3) \u2192 f ( ((t1, t2), t3), (t1, t2) )\n#def section-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n(g : (t : \u0394\u00b3) \u2192 A[ \u039b\u00b3\u2082 t \u21a6 h t ])\n  : (x : \u0394\u00b3\u00d7\u0394\u00b2) \u2192 A[ pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081 x \u21a6 h^ x]\n  :=\n    \\ ( ((t1, t2), t3), (s1, s2) ) \u2192\nrecOR\n      ( s1 \u2264 t1 \u2227 t2 \u2264 s2 \u21a6 g ((t1, t2), t3),\n        t1 \u2264 s1 \u2227 t2 \u2264 s2 \u21a6 g ((s1, t2), t3),\n        s1 \u2264 t1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 g ((t1, s2), t3),\n        t1 \u2264 s1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 g ((s1, s2), t3),\n        s1 \u2264 t1 \u2227 s2 \u2264 t3 \u21a6 g ((t1, s2), s2),\n        t1 \u2264 s1 \u2227 s2 \u2264 t3 \u21a6 g ((s1, s2), s2))\n#def homotopy-retraction-section-id-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n  : homotopy extend-against-\u039b\u00b3\u2082-\u0394\u00b3 extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n    ( comp\n      ( extend-against-\u039b\u00b3\u2082-\u0394\u00b3)\n      ( extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2)\n      ( extend-against-\u039b\u00b3\u2082-\u0394\u00b3)\n      ( retract-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2)\n      ( section-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2))\n    ( identity extend-against-\u039b\u00b3\u2082-\u0394\u00b3)\n  := \\ t \u2192 refl\n#def is-retract-of-\u0394\u00b3-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n  : is-retract-of\n      extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n      extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2\n  :=\n    ( section-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 ,\n      ( retract-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 ,\n        homotopy-retraction-section-id-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2))\n#end retraction-\u039b\u00b3\u2082-\u0394\u00b3-pushout-product-\u039b\u00b2\u2081-\u0394\u00b2\n#def is-inner-anodyne-\u0394\u00b3-\u039b\u00b3\u2082 uses (weakextext)\n  : is-inner-anodyne (2 \u00d7 2 \u00d7 2) \u0394\u00b3 \u039b\u00b3\u2082\n  :=\n\\ A is-segal-A h \u2192\n    is-contr-is-retract-of-is-contr\n      (extend-against-\u039b\u00b3\u2082-\u0394\u00b3 A h)\n      (extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 A h)\n      (is-retract-of-\u0394\u00b3-\u0394\u00b3\u00d7\u0394\u00b2 A h)\n      (is-inner-anodyne-pushout-product-right-is-inner-anodyne\n        ( 2 \u00d7 2 \u00d7 2)\n        ( 2 \u00d7 2)\n        ( \u0394\u00b3)\n        ( \u039b\u00b3\u2082)\n        ( \u0394\u00b2)\n        ( \u039b\u00b2\u2081)\n        ( is-inner-anodyne-\u039b\u00b2\u2081)\n        ( A)\n        ( is-segal-A)\n        ( h^ A h))\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#inner-fibrations","title":"Inner fibrations","text":"

An inner fibration is a map \u03b1 : A' \u2192 A which is right orthogonal to \u039b \u2282 \u0394\u00b2. This is the relative notion of a Segal type.

#def is-inner-fibration\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n  : U\n  := is-right-orthogonal-to-shape (2 \u00d7 2) \u0394\u00b2 (\\ t \u2192 \u039b t) A' A \u03b1\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#products-of-segal-types","title":"Products of Segal Types","text":"

This is an additional section which describes morphisms in products of types as products of morphisms. It is implicitly stated in Proposition 8.21.

#section morphisms-of-products-is-products-of-morphisms\n#variables A B : U\n#variable p : ( product A B )\n#variable p' : ( product A B )\n#def morphism-in-product-to-product-of-morphism\n  : hom ( product A B ) p p' \u2192\n    product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) )\n  :=  \\ f \u2192 ( \\ ( t : \u0394\u00b9 ) \u2192 first ( f t ) , \\ ( t : \u0394\u00b9 ) \u2192 second ( f t ) )\n#def product-of-morphism-to-morphism-in-product\n  : product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) ) \u2192\n    hom ( product A B ) p p'\n  := \\ ( f , g ) ( t : \u0394\u00b9 ) \u2192 ( f t , g t )\n#def morphisms-in-product-to-product-of-morphism-to-morphism-in-product-is-id\n  : ( f :  product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) ) ) \u2192\n    ( morphism-in-product-to-product-of-morphism )\n    ( ( product-of-morphism-to-morphism-in-product )\n      f ) = f\n  := \\ f \u2192 refl\n#def product-of-morphism-to-morphisms-in-product-to-product-of-morphism-is-id\n  : ( f :  hom ( product A B ) p p' ) \u2192\n    ( product-of-morphism-to-morphism-in-product )\n    ( ( morphism-in-product-to-product-of-morphism )\n      f ) = f\n  := \\ f \u2192 refl\n#def morphism-in-product-equiv-product-of-morphism\n  : Equiv\n    ( hom ( product A B ) p p' )\n    ( product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) ) )\n  :=\n    ( ( morphism-in-product-to-product-of-morphism ) ,\n      ( ( ( product-of-morphism-to-morphism-in-product ) ,\n          ( product-of-morphism-to-morphisms-in-product-to-product-of-morphism-is-id ) ) ,\n        ( ( product-of-morphism-to-morphism-in-product ) ,\n          ( morphisms-in-product-to-product-of-morphism-to-morphism-in-product-is-id ) ) ) )\n#end morphisms-of-products-is-products-of-morphisms\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/","title":"The 2-category of Segal types","text":"

These formalisations correspond to Section 6 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#functors","title":"Functors","text":"

Functions between types induce an action on hom types, preserving sources and targets. The action is called ap-hom to avoid conflicting with ap.

RS17, Section 6.1
#def ap-hom\n( A B : U)\n( F : A \u2192 B)\n( x y : A)\n( f : hom A x y)\n  : hom B (F x) (F y)\n  := \\ t \u2192 F (f t)\n#def ap-hom2\n( A B : U)\n( F : A \u2192 B)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n(\u03b1 : hom2 A x y z f g h)\n  : hom2 B (F x) (F y) (F z)\n    ( ap-hom A B F x y f) (ap-hom A B F y z g) (ap-hom A B F x z h)\n  := \\ t \u2192 F (\u03b1 t)\n

Functions between types automatically preserve identity arrows. Preservation of identities follows from extension extensionality because these arrows are pointwise equal.

RS17, Proposition 6.1.a
#def functors-pres-id uses (extext)\n( A B : U)\n( F : A \u2192 B)\n( x : A)\n  : ( ap-hom A B F x x (id-hom A x)) = (id-hom B (F x))\n  :=\n    eq-ext-htpy\n      ( extext)\n      ( 2)\n      ( \u0394\u00b9)\n      ( \u2202\u0394\u00b9)\n      ( \\ t \u2192 B)\n      ( \\ t \u2192 recOR (t \u2261 0\u2082 \u21a6 F x , t \u2261 1\u2082 \u21a6 F x))\n      ( ap-hom A B F x x (id-hom A x))\n      ( id-hom B (F x))\n      ( \\ t \u2192 refl)\n

Preservation of composition requires the Segal hypothesis.

RS17, Proposition 6.1.b
#def functors-pres-comp\n( A B : U)\n( is-segal-A : is-segal A)\n( is-segal-B : is-segal B)\n( F : A \u2192 B)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  :\n    ( comp-is-segal B is-segal-B\n      ( F x) (F y) (F z)\n      ( ap-hom A B F x y f)\n      ( ap-hom A B F y z g))\n    =\n    ( ap-hom A B F x z (comp-is-segal A is-segal-A x y z f g))\n  :=\n    uniqueness-comp-is-segal B is-segal-B\n      ( F x) (F y) (F z)\n      ( ap-hom A B F x y f)\n      ( ap-hom A B F y z g)\n      ( ap-hom A B F x z (comp-is-segal A is-segal-A x y z f g))\n      ( ap-hom2 A B F x y z f g\n        ( comp-is-segal A is-segal-A x y z f g)\n        ( witness-comp-is-segal A is-segal-A x y z f g))\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#natural-transformations","title":"Natural transformations","text":"

Given two simplicial maps f g : (x : A) \u2192 B x , a natural transformation from f to g is an arrow \u03b7 : hom ((x : A) \u2192 B x) f g between them.

RS17, Definition 6.2
#def nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : U\n  := hom ((x : A) \u2192 (B x)) f g\n

Equivalently , natural transformations can be determined by their components , i.e. as a family of arrows (x : A) \u2192 hom (B x) (f x) (g x).

#def nat-trans-components\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : U\n  := ( x : A) \u2192 hom (B x) (f x) (g x)\n
#def ev-components-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans A B f g)\n  : nat-trans-components A B f g\n  := \\ x t \u2192 \u03b7 t x\n#def nat-trans-nat-trans-components\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans-components A B f g)\n  : nat-trans A B f g\n  := \\ t x \u2192 \u03b7 x t\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#natural-transformation-extensionality","title":"Natural transformation extensionality","text":"RS17, Proposition 6.3
#def is-equiv-ev-components-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : is-equiv\n      ( nat-trans A B f g)\n      ( nat-trans-components A B f g)\n      ( ev-components-nat-trans A B f g)\n  :=\n    ( ( \\ \u03b7 t x \u2192 \u03b7 x t , \\ _ \u2192 refl) ,\n      ( \\ \u03b7 t x \u2192 \u03b7 x t , \\ _ \u2192 refl))\n#def equiv-components-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : Equiv (nat-trans A B f g) (nat-trans-components A B f g)\n  :=\n    ( ev-components-nat-trans A B f g ,\n      is-equiv-ev-components-nat-trans A B f g)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#naturality-square","title":"Naturality square","text":"

Natural transformations are automatically natural when the codomain is a Segal type.

RS17, Proposition 6.6
#section comp-eq-square-is-segal\n#variable A : U\n#variable is-segal-A : is-segal A\n#variable \u03b1 : (\u0394\u00b9\u00d7\u0394\u00b9) \u2192 A\n#def \u03b100 : A := \u03b1 (0\u2082,0\u2082)\n#def \u03b101 : A := \u03b1 (0\u2082,1\u2082)\n#def \u03b110 : A := \u03b1 (1\u2082,0\u2082)\n#def \u03b111 : A := \u03b1 (1\u2082,1\u2082)\n#def \u03b10* : \u0394\u00b9 \u2192 A := \\ t \u2192 \u03b1 (0\u2082,t)\n#def \u03b11* : \u0394\u00b9 \u2192 A := \\ t \u2192 \u03b1 (1\u2082,t)\n#def \u03b1*0 : \u0394\u00b9 \u2192 A := \\ s \u2192 \u03b1 (s,0\u2082)\n#def \u03b1*1 : \u0394\u00b9 \u2192 A := \\ s \u2192 \u03b1 (s,1\u2082)\n#def \u03b1-diag : \u0394\u00b9 \u2192 A := \\ s \u2192 \u03b1 (s,s)\n#def lhs uses (\u03b1) : \u0394\u00b9 \u2192 A := comp-is-segal A is-segal-A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1\n#def rhs uses (\u03b1) : \u0394\u00b9 \u2192 A := comp-is-segal A is-segal-A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11*\n#def lower-triangle-square : hom2 A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1 \u03b1-diag\n  := \\ (s, t) \u2192 \u03b1 (t,s)\n#def upper-triangle-square : hom2 A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11* \u03b1-diag\n  := \\ (s,t) \u2192 \u03b1 (s,t)\n#def comp-eq-square-is-segal uses (\u03b1)\n  : comp-is-segal A is-segal-A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1 =\n    comp-is-segal A is-segal-A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11*\n  :=\n    zig-zag-concat (hom A \u03b100 \u03b111) lhs \u03b1-diag rhs\n    ( uniqueness-comp-is-segal A is-segal-A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1 \u03b1-diag\n      ( lower-triangle-square))\n    ( uniqueness-comp-is-segal A is-segal-A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11* \u03b1-diag\n      ( upper-triangle-square))\n#end comp-eq-square-is-segal\n

We now extract a naturality square from a natural transformation whose codomain is a Segal type.

RS17, Proposition 6.6
#def naturality-nat-trans-is-segal\n(A B : U)\n(is-segal-B : is-segal B)\n(f g : A \u2192 B)\n(\u03b1 : nat-trans A (\\ _ \u2192 B) f g)\n(x y : A)\n(k : hom A x y)\n  : comp-is-segal B is-segal-B (f x) (f y) (g y)\n    ( ap-hom A B f x y k)\n    ( \\ s \u2192 \u03b1 s y) =\n    comp-is-segal B is-segal-B (f x) (g x) (g y)\n    ( \\ s \u2192 \u03b1 s x)\n    ( ap-hom A B g x y k)\n  := comp-eq-square-is-segal B is-segal-B (\\ (s,t) \u2192 \u03b1 s (k t))\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#vertical-composition","title":"Vertical composition","text":"

We can define vertical composition for natural transformations in families of Segal types.

#def vertical-comp-nat-trans-components\n( A : U)\n( B : A \u2192 U)\n( is-segal-B : (x : A) \u2192 is-segal (B x))\n( f g h : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans-components A B f g)\n( \u03b7' : nat-trans-components A B g h)\n  : nat-trans-components A B f h\n  := \\ x \u2192 comp-is-segal (B x) (is-segal-B x) (f x) (g x) (h x) (\u03b7 x) (\u03b7' x)\n#def vertical-comp-nat-trans\n( A : U)\n( B : A \u2192 U)\n( is-segal-B : (x : A) \u2192 is-segal (B x))\n( f g h : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans A B f g)\n( \u03b7' : nat-trans A B g h)\n  : nat-trans A B f h\n  :=\n\\ t x \u2192\n    vertical-comp-nat-trans-components A B is-segal-B f g h\n      ( \\ x' t' \u2192 \u03b7 t' x')\n      ( \\ x' t' \u2192 \u03b7' t' x')\n      ( x)\n      ( t)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#functoriality-of-evaluation-at-components","title":"Functoriality of evaluation at components","text":"

The components of the identity natural transformation are identity arrows.

RS17, Proposition 6.5(ii)
#def id-arr-components-id-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f : (x : A) \u2192 (B x))\n( a : A)\n  : (ev-components-nat-trans A B f f (id-hom ((x : A) \u2192 B x) f)) a =\n    id-hom (B a) (f a)\n  := refl\n

When the fibers of a family of types B : A \u2192 U are Segal types, the components of the natural transformation defined by composing in the Segal type (x : A) \u2192 B x agree with the components defined by vertical composition.

RS17, Proposition 6.5(i)
#def comp-components-comp-nat-trans-is-segal uses (funext)\n( A : U)\n( B : A \u2192 U)\n( is-segal-B : (x : A) \u2192 is-segal (B x))\n( f g h : (x : A) \u2192 (B x))\n( \u03b1 : nat-trans A B f g)\n( \u03b2 : nat-trans A B g h)\n( a : A)\n  : ( comp-is-segal (B a) (is-segal-B a) (f a) (g a) (h a)\n      ( ev-components-nat-trans A B f g \u03b1 a)\n      ( ev-components-nat-trans A B g h \u03b2 a)) =\n( ev-components-nat-trans A B f h\n      ( comp-is-segal\n        ( (x : A) \u2192 B x) ( is-segal-function-type (funext) (A) (B) (is-segal-B))\n        ( f) (g) (h) (\u03b1) (\u03b2))) a\n  :=\n    functors-pres-comp\n( (x : A) \u2192 (B x)) (B a)\n    ( is-segal-function-type (funext) (A) (B) (is-segal-B)) (is-segal-B a)\n    ( \\ s \u2192 s a) (f) (g) (h) (\u03b1) (\u03b2)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#horizontal-composition","title":"Horizontal composition","text":"

Horizontal composition of natural transformations makes sense over any type. In particular , contrary to what is written in [RS17] we do not need C to be Segal.

#def horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : nat-trans A (\\ _ \u2192 C) (\\ x \u2192 f' (f x)) (\\ x \u2192 g' (g x))\n  := \\ t x \u2192 \u03b7' t (\u03b7 t x)\n#def horizontal-comp-nat-trans-components\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans-components A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans-components B (\\ _ \u2192 C) f' g')\n  : nat-trans-components A (\\ _ \u2192 C) (\\ x \u2192 f' (f x)) (\\ x \u2192 g' (g x))\n  := \\ x t \u2192 \u03b7' (\u03b7 x t) t\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#whiskering","title":"Whiskering","text":"

Whiskering is a special case of horizontal composition when one of the natural transformations is the identity.

#def postwhisker-nat-trans\n( B C D : U)\n( f g : B \u2192 C)\n( h : C \u2192 D)\n( \u03b7 : nat-trans B (\\ _ \u2192 C) f g)\n  : nat-trans B (\\ _ \u2192 D) (comp B C D h f) (comp B C D h g)\n  := horizontal-comp-nat-trans B C D f g h h \u03b7 (id-hom (C \u2192 D) h)\n#def prewhisker-nat-trans\n( A B C : U)\n( k : A \u2192 B)\n( f g : B \u2192 C)\n( \u03b7 : nat-trans B (\\ _ \u2192 C) f g)\n  : nat-trans A (\\ _ \u2192 C) (comp A B C f k) (comp A B C g k)\n  := horizontal-comp-nat-trans A B C k k f g (id-hom (A \u2192 B) k) \u03b7\n#def whisker-nat-trans\n( A B C D : U)\n( k : A \u2192 B)\n( f g : B \u2192 C)\n( h : C \u2192 D)\n( \u03b7 : nat-trans B (\\ _ \u2192 C) f g)\n  : nat-trans A (\\ _ \u2192 D)\n    ( triple-comp A B C D h f k)\n    ( triple-comp A B C D h g k)\n  :=\n    postwhisker-nat-trans A C D (comp A B C f k) (comp A B C g k) h\n    ( prewhisker-nat-trans A B C k f g \u03b7)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#gray-interchanger","title":"Gray interchanger","text":"

The horizontal composition operation also defines coherence data in the form of the \"Gray interchanger\" built from two commutative triangles.

#def gray-interchanger-horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : \u0394\u00b9\u00d7\u0394\u00b9 \u2192 (A \u2192 C)\n  := \\ (t, s) a \u2192 \u03b7' s (\u03b7 t a)\n#def left-gray-interchanger-horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : hom2 (A \u2192 C) (comp A B C f' f) (comp A B C f' g) (comp A B C g' g)\n    ( postwhisker-nat-trans A B C f g f' \u03b7)\n    ( prewhisker-nat-trans A B C g f' g' \u03b7')\n    ( horizontal-comp-nat-trans A B C f g f' g' \u03b7 \u03b7')\n  := \\ (t, s) a \u2192 \u03b7' s (\u03b7 t a)\n#def right-gray-interchanger-horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : hom2 (A \u2192 C) (comp A B C f' f) (comp A B C g' f) (comp A B C g' g)\n    ( prewhisker-nat-trans A B C f f' g' \u03b7')\n    ( postwhisker-nat-trans A B C f g g' \u03b7)\n    ( horizontal-comp-nat-trans A B C f g f' g' \u03b7 \u03b7')\n  := \\ (t, s) a \u2192 \u03b7' t (\u03b7 s a)\n
"},{"location":"simplicial-hott/07-discrete.rzk/","title":"Discrete types","text":"

These formalisations correspond to Section 7 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/07-discrete.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/07-discrete.rzk/#the-definition","title":"The definition","text":"

Discrete types are types in which the hom-types are canonically equivalent to identity types.

RS17, Definition 7.1
#def hom-eq\n( A : U)\n( x y : A)\n( p : x = y)\n  : hom A x y\n  := ind-path (A) (x) (\\ y' p' \u2192 hom A x y') ((id-hom A x)) (y) (p)\n#def is-discrete\n( A : U)\n  : U\n  := (x : A) \u2192 (y : A) \u2192 is-equiv (x = y) (hom A x y) (hom-eq A x y)\n
"},{"location":"simplicial-hott/07-discrete.rzk/#families-of-discrete-types","title":"Families of discrete types","text":"

By function extensionality, the dependent function type associated to a family of discrete types is discrete.

#def equiv-hom-eq-function-type-is-discrete uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-discrete-A : (x : X) \u2192 is-discrete (A x))\n( f g : (x : X) \u2192 A x)\n  : Equiv (f = g) (hom ((x : X) \u2192 A x) f g)\n  :=\n    equiv-triple-comp\n      ( f = g)\n( (x : X) \u2192 f x = g x)\n( (x : X) \u2192 hom (A x) (f x) (g x))\n( hom ((x : X) \u2192 A x) f g)\n      ( equiv-FunExt funext X A f g)\n      ( equiv-function-equiv-family funext X\n        ( \\ x \u2192 (f x = g x))\n        ( \\ x \u2192 hom (A x) (f x) (g x))\n        ( \\ x \u2192 (hom-eq (A x) (f x) (g x) , (is-discrete-A x (f x) (g x)))))\n      ( flip-ext-fun-inv\n        ( 2)\n        ( \u0394\u00b9)\n        ( \u2202\u0394\u00b9)\n        ( X)\n        ( \\ t x \u2192 A x)\n        ( \\ t x \u2192 recOR (t \u2261 0\u2082 \u21a6 f x , t \u2261 1\u2082 \u21a6 g x)))\n#def compute-hom-eq-function-type-is-discrete uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-discrete-A : (x : X) \u2192 is-discrete (A x))\n( f g : (x : X) \u2192 A x)\n( h : f = g)\n  : ( hom-eq ((x : X) \u2192 A x) f g h) =\n    ( first (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g)) h\n  :=\n    ind-path\n( (x : X) \u2192 A x)\n      ( f)\n( \\ g' h' \u2192\n        hom-eq ((x : X) \u2192 A x) f g' h' =\n        (first (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g')) h')\n      ( refl)\n      ( g)\n      ( h)\n
RS17, Proposition 7.2
#def is-discrete-function-type uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-discrete-A : (x : X) \u2192 is-discrete (A x))\n  : is-discrete ((x : X) \u2192 A x)\n  :=\n\\ f g \u2192\n    is-equiv-homotopy\n      ( f = g)\n( hom ((x : X) \u2192 A x) f g)\n( hom-eq ((x : X) \u2192 A x) f g)\n      ( first (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g))\n      ( compute-hom-eq-function-type-is-discrete X A is-discrete-A f g)\n      ( second (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g))\n

By extension extensionality, an extension type into a family of discrete types is discrete. Since equiv-extension-equiv-family considers total extension types only, extending from BOT, that's all we prove here for now.

#def equiv-hom-eq-extension-type-is-discrete uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-discrete-A : (t : \u03c8) \u2192 is-discrete (A t))\n( f g : (t : \u03c8) \u2192 A t)\n  : Equiv (f = g) (hom ((t : \u03c8) \u2192 A t) f g)\n  :=\n    equiv-triple-comp\n      ( f = g)\n( (t : \u03c8) \u2192 f t = g t)\n( (t : \u03c8) \u2192 hom (A t) (f t) (g t))\n( hom ((t : \u03c8) \u2192 A t) f g)\n      ( equiv-ExtExt extext I \u03c8 (\\ _ \u2192 BOT) A (\\ _ \u2192 recBOT) f g)\n      ( equiv-extension-equiv-family\n        ( extext)\n        ( I)\n        ( \u03c8)\n        ( \\ t \u2192 f t = g t)\n        ( \\ t \u2192 hom (A t) (f t) (g t))\n        ( \\ t \u2192 (hom-eq (A t) (f t) (g t) , (is-discrete-A t (f t) (g t)))))\n      ( fubini\n        ( I)\n        ( 2)\n        ( \u03c8)\n        ( \\ t \u2192 BOT)\n        ( \u0394\u00b9)\n        ( \u2202\u0394\u00b9)\n        ( \\ t s \u2192 A t)\n        ( \\ (t , s) \u2192 recOR (s \u2261 0\u2082 \u21a6 f t , s \u2261 1\u2082 \u21a6 g t)))\n#def compute-hom-eq-extension-type-is-discrete uses (extext)\n( I : CUBE)\n( \u03c8 : (t : I) \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-discrete-A : (t : \u03c8) \u2192 is-discrete (A t))\n( f g : (t : \u03c8) \u2192 A t)\n( h : f = g)\n  : ( hom-eq ((t : \u03c8) \u2192 A t) f g h) =\n    ( first (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g)) h\n  :=\n    ind-path\n( (t : \u03c8) \u2192 A t)\n      ( f)\n( \\ g' h' \u2192\n        ( hom-eq ((t : \u03c8) \u2192 A t) f g' h') =\n        ( first (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g') h'))\n      ( refl)\n      ( g)\n      ( h)\n
RS17, Proposition 7.2, for extension types
#def is-discrete-extension-type uses (extext)\n( I : CUBE)\n( \u03c8 : (t : I) \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-discrete-A : (t : \u03c8) \u2192 is-discrete (A t))\n  : is-discrete ((t : \u03c8) \u2192 A t)\n  :=\n\\ f g \u2192\n    is-equiv-homotopy\n      ( f = g)\n( hom ((t : \u03c8) \u2192 A t) f g)\n( hom-eq ((t : \u03c8) \u2192 A t) f g)\n      ( first (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g))\n      ( compute-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g)\n      ( second (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g))\n

For instance, the arrow type of a discrete type is discrete.

#def is-discrete-arr uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n  : is-discrete (arr A)\n  := is-discrete-extension-type 2 \u0394\u00b9 (\\ _ \u2192 A) (\\ _ \u2192 is-discrete-A)\n
"},{"location":"simplicial-hott/07-discrete.rzk/#discrete-types-are-segal-types","title":"Discrete types are Segal types","text":"

Discrete types are automatically Segal types.

#section discrete-arr-equivalences\n#variable A : U\n#variable is-discrete-A : is-discrete A\n#variables x y z w : A\n#variable f : hom A x y\n#variable g : hom A z w\n#def is-equiv-hom-eq-discrete uses (extext x y z w)\n  : is-equiv (f =_{arr A} g) (hom (arr A) f g) (hom-eq (arr A) f g)\n  := (is-discrete-arr A is-discrete-A) f g\n#def equiv-hom-eq-discrete uses (extext x y z w)\n  : Equiv (f =_{arr A} g) (hom (arr A) f g)\n  := (hom-eq (arr A) f g , (is-discrete-arr A is-discrete-A) f g)\n#def equiv-square-hom-arr\n  : Equiv\n      ( hom (arr A) f g)\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n              ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n                A [ t \u2261 0\u2082 \u2227 \u0394\u00b9 s \u21a6 f s ,\n                    t \u2261 1\u2082 \u2227 \u0394\u00b9 s \u21a6 g s ,\n                    \u0394\u00b9 t \u2227 s \u2261 0\u2082 \u21a6 h t ,\n                    \u0394\u00b9 t \u2227 s \u2261 1\u2082 \u21a6 k t])))\n  :=\n    ( \\ \u03b1 \u2192\n      ( ( \\ t \u2192 \u03b1 t 0\u2082) ,\n        ( ( \\ t \u2192 \u03b1 t 1\u2082) , (\\ (t , s) \u2192 \u03b1 t s))) ,\n      ( ( ( \\ \u03c3 t s \u2192 (second (second \u03c3)) (t , s)) , (\\ \u03b1 \u2192 refl)) ,\n        ( ( \\ \u03c3 t s \u2192 (second (second \u03c3)) (t , s)) , (\\ \u03c3 \u2192 refl))))\n

The equivalence underlying equiv-arr-\u03a3-hom:

#def fibered-arr-free-arr\n  : (arr A) \u2192 (\u03a3 (u : A) , (\u03a3 (v : A) , hom A u v))\n  := \\ k \u2192 (k 0\u2082 , (k 1\u2082 , k))\n#def is-equiv-fibered-arr-free-arr\n  : is-equiv (arr A) (\u03a3 (u : A) , (\u03a3 (v : A) , hom A u v)) (fibered-arr-free-arr)\n  := is-equiv-arr-\u03a3-hom A\n#def is-equiv-ap-fibered-arr-free-arr uses (w x y z)\n  : is-equiv\n      ( f =_{\u0394\u00b9 \u2192 A} g)\n      ( fibered-arr-free-arr f = fibered-arr-free-arr g)\n      ( ap\n        ( arr A)\n( \u03a3 (u : A) , (\u03a3 (v : A) , (hom A u v)))\n        ( f)\n        ( g)\n        ( fibered-arr-free-arr))\n  :=\n    is-emb-is-equiv\n      ( arr A)\n( \u03a3 (u : A) , (\u03a3 (v : A) , (hom A u v)))\n      ( fibered-arr-free-arr)\n      ( is-equiv-fibered-arr-free-arr)\n      ( f)\n      ( g)\n#def equiv-eq-fibered-arr-eq-free-arr uses (w x y z)\n  : Equiv (f =_{\u0394\u00b9 \u2192 A} g) (fibered-arr-free-arr f = fibered-arr-free-arr g)\n  :=\n    equiv-ap-is-equiv\n      ( arr A)\n( \u03a3 (u : A) , (\u03a3 (v : A) , (hom A u v)))\n      ( fibered-arr-free-arr)\n      ( is-equiv-fibered-arr-free-arr)\n      ( f)\n      ( g)\n#def equiv-sigma-over-product-hom-eq\n  : Equiv\n      ( fibered-arr-free-arr f = fibered-arr-free-arr g)\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n              ( product-transport A A (hom A) x z y w p q f = g)))\n  :=\n    extensionality-\u03a3-over-product\n      ( A) (A)\n      ( hom A)\n      ( fibered-arr-free-arr f)\n      ( fibered-arr-free-arr g)\n#def equiv-square-sigma-over-product uses (extext is-discrete-A)\n  : Equiv\n( \u03a3 ( p : x = z) ,\n( \u03a3 (q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n            ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n  :=\n    equiv-left-cancel\n      ( f =_{\u0394\u00b9 \u2192 A} g)\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n              ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n              ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n                A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                    (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                    (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                    (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n      ( equiv-comp\n        ( f =_{\u0394\u00b9 \u2192 A} g)\n        ( fibered-arr-free-arr f = fibered-arr-free-arr g)\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n                ( product-transport A A (hom A) x z y w p q f = g)))\n        equiv-eq-fibered-arr-eq-free-arr\n        equiv-sigma-over-product-hom-eq)\n      ( equiv-comp\n        ( f =_{\u0394\u00b9 \u2192 A} g)\n        ( hom (arr A) f g)\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n                ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n                  A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                      (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                      (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                      (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n        ( equiv-hom-eq-discrete)\n        ( equiv-square-hom-arr))\n

We close the section so we can use path induction.

#end discrete-arr-equivalences\n
#def fibered-map-square-sigma-over-product\n( A : U)\n( x y z w : A)\n( f : hom A x y)\n( p : x = z)\n( q : y = w)\n  : ( g : hom A z w) \u2192\n    ( product-transport A A (hom A) x z y w p q f = g) \u2192\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 (hom-eq A x z p) t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w q) t])\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ z' p' \u2192\n        ( g : hom A z' w) \u2192\n        ( product-transport A A (hom A) x z' y w p' q f = g) \u2192\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 (hom-eq A x z' p') t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w q) t]))\n      ( ind-path\n        ( A)\n        ( y)\n( \\ w' q' \u2192\n          ( g : hom A x w') \u2192\n          ( product-transport A A (hom A) x x y w' refl q' f = g) \u2192\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w' q') t]))\n        ( ind-path\n          ( hom A x y)\n          ( f)\n          ( \\ g' \u03c4' \u2192\n            ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g' s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n          ( \\ (t , s) \u2192 f s))\n        ( w)\n        ( q))\n      ( z)\n      ( p)\n#def square-sigma-over-product\n( A : U)\n( x y z w : A)\n( f : hom A x y)\n( g : hom A z w)\n  ( ( p , (q , \u03c4)) :\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g))))\n  : \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t]))\n  :=\n    ( ( hom-eq A x z p) ,\n      ( ( hom-eq A y w q) ,\n        ( fibered-map-square-sigma-over-product\n          ( A)\n          ( x) (y) (z) (w)\n          ( f) (p) (q) (g)\n          ( \u03c4))))\n#def refl-refl-map-equiv-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f g : hom A x y)\n( \u03c4 : product-transport A A (hom A) x x y y refl refl f = g)\n  : ( first\n      ( equiv-square-sigma-over-product A is-discrete-A x y x y f g)\n      (refl , (refl , \u03c4))) =\n    ( square-sigma-over-product\n      ( A)\n      ( x) (y) (x) (y)\n      ( f) (g)\n      ( refl , (refl , \u03c4)))\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' \u03c4' \u2192\n        ( first\n          ( equiv-square-sigma-over-product A is-discrete-A x y x y f g')\n          ( refl , (refl , \u03c4'))) =\n        ( square-sigma-over-product\n          ( A)\n          ( x) (y) (x) (y)\n          ( f) (g')\n          ( refl , (refl , \u03c4'))))\n      ( refl)\n      ( g)\n      ( \u03c4)\n#def map-equiv-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z w : A)\n( f : hom A x y)\n( p : x = z)\n( q : y = w)\n  : ( g : hom A z w) \u2192\n( \u03c4 : product-transport A A (hom A) x z y w p q f = g) \u2192\n    ( first\n      ( equiv-square-sigma-over-product A is-discrete-A x y z w f g)\n      ( p , (q , \u03c4))) =\n    ( square-sigma-over-product\n        A x y z w f g (p , (q , \u03c4)))\n  :=\n    ind-path\n      ( A)\n      ( y)\n( \\ w' q' \u2192\n        ( g : hom A z w') \u2192\n( \u03c4 : product-transport A A (hom A) x z y w' p q' f = g) \u2192\n        ( first\n          ( equiv-square-sigma-over-product\n              A is-discrete-A x y z w' f g))\n          ( p , (q' , \u03c4)) =\n        ( square-sigma-over-product A x y z w' f g)\n          ( p , (q' , \u03c4)))\n      ( ind-path\n        ( A)\n        ( x)\n( \\ z' p' \u2192\n          ( g : hom A z' y) \u2192\n( \u03c4 : product-transport A A (hom A) x z' y y p' refl f = g) \u2192\n          ( first\n            ( equiv-square-sigma-over-product A is-discrete-A x y z' y f g)\n            ( p' , (refl , \u03c4))) =\n          ( square-sigma-over-product A x y z' y f g (p' , (refl , \u03c4))))\n        ( refl-refl-map-equiv-square-sigma-over-product\n            ( A) (is-discrete-A) (x) (y) (f))\n        ( z)\n        ( p))\n      ( w)\n      ( q)\n#def is-equiv-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z w : A)\n( f : hom A x y)\n( g : hom A z w)\n  : is-equiv\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n            ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n    ( square-sigma-over-product A x y z w f g)\n  :=\n    is-equiv-rev-homotopy\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n            ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n    ( first (equiv-square-sigma-over-product A is-discrete-A x y z w f g))\n    ( square-sigma-over-product A x y z w f g)\n    ( \\ (p , (q , \u03c4)) \u2192\n      map-equiv-square-sigma-over-product A is-discrete-A x y z w f p q g \u03c4)\n    ( second (equiv-square-sigma-over-product A is-discrete-A x y z w f g))\n#def is-equiv-fibered-map-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z w : A)\n( f : hom A x y)\n( g : hom A z w)\n( p : x = z)\n( q : y = w)\n  : is-equiv\n    ( product-transport A A (hom A) x z y w p q f = g)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 (hom-eq A x z p) t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w q) t])\n    ( fibered-map-square-sigma-over-product A x y z w f p q g)\n  :=\n    fibered-map-is-equiv-bases-are-equiv-total-map-is-equiv\n      ( x = z)\n      ( hom A x z)\n      ( y = w)\n      ( hom A y w)\n      ( \\ p' q' \u2192 (product-transport A A (hom A) x z y w p' q' f) = g)\n      ( \\ h' k' \u2192\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h' t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k' t]))\n      ( hom-eq A x z)\n      ( hom-eq A y w)\n      ( \\ p' q' \u2192\n        fibered-map-square-sigma-over-product\n          ( A)\n          ( x) (y) (z) (w)\n          ( f)\n          ( p')\n          ( q')\n          ( g))\n      ( is-equiv-square-sigma-over-product A is-discrete-A x y z w f g)\n      ( is-discrete-A x z)\n      ( is-discrete-A y w)\n      ( p)\n      ( q)\n#def is-equiv-fibered-map-square-sigma-over-product-refl-refl uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n( g : hom A x y)\n  : is-equiv\n    (f = g)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n    ( fibered-map-square-sigma-over-product\n      A x y x y f refl refl g)\n  :=\n    is-equiv-fibered-map-square-sigma-over-product\n      A is-discrete-A x y x y f g refl refl\n

The previous calculations allow us to establish a family of equivalences:

#def is-equiv-sum-fibered-map-square-sigma-over-product-refl-refl uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : is-equiv\n( \u03a3 ( g : hom A x y) , f = g)\n( \u03a3 ( g : hom A x y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n    ( total-map\n      ( hom A x y)\n      ( \\ g \u2192 f = g)\n      ( \\ g \u2192\n        ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n      ( fibered-map-square-sigma-over-product\n          A x y x y f refl refl))\n  :=\n    family-of-equiv-total-equiv\n      ( hom A x y)\n      ( \\ g \u2192 f = g)\n      ( \\ g \u2192\n        ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n      ( fibered-map-square-sigma-over-product\n          A x y x y f refl refl)\n      ( \\ g \u2192\n        is-equiv-fibered-map-square-sigma-over-product-refl-refl\n          ( A) (is-discrete-A)\n          ( x) (y)\n          ( f) (g))\n#def equiv-sum-fibered-map-square-sigma-over-product-refl-refl uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : Equiv\n( \u03a3 (g : hom A x y) , f = g)\n( \u03a3 (g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  :=\n    ( ( total-map\n        ( hom A x y)\n        ( \\ g \u2192 f = g)\n        ( \\ g \u2192\n          ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n        ( fibered-map-square-sigma-over-product\n            A x y x y f refl refl)) ,\n    is-equiv-sum-fibered-map-square-sigma-over-product-refl-refl\n      A is-discrete-A x y f)\n

Now using the equivalence on total spaces and the contractibility of based path spaces, we conclude that the codomain extension type is contractible.

#def is-contr-horn-refl-refl-extension-type uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : is-contr\n( \u03a3 ( g : hom A x y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  :=\n    is-contr-equiv-is-contr\n( \u03a3 ( g : hom A x y) , f = g)\n( \u03a3 ( g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n      ( equiv-sum-fibered-map-square-sigma-over-product-refl-refl\n          A is-discrete-A x y f)\n      ( is-contr-based-paths (hom A x y) f)\n

The extension types that appear in the Segal condition are retracts of this type --- at least when the second arrow in the composable pair is an identity.

#def triangle-to-square-section\n( A : U)\n( x y : A)\n( f g : hom A x y)\n( \u03b1 : hom2 A x y y f (id-hom A y) g)\n  : ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n    A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n        (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n        (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n        (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]\n  := \\ (t , s) \u2192 recOR (t \u2264 s \u21a6 \u03b1 (s , t) , s \u2264 t \u21a6 g s)\n#def sigma-triangle-to-sigma-square-section\n( A : U)\n( x y : A)\n( f : hom A x y)\n  ( (d , \u03b1) : \u03a3 (d : hom A x y) , hom2 A x y y f (id-hom A y) d)\n  : \u03a3 ( g : hom A x y) ,\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n  := ( d , triangle-to-square-section A x y f d \u03b1)\n#def sigma-square-to-sigma-triangle-retraction\n( A : U)\n( x y : A)\n( f : hom A x y)\n  ( (g , \u03c3) :\n\u03a3 ( g : hom A x y) ,\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  : \u03a3 (d : hom A x y) , (hom2 A x y y f (id-hom A y) d)\n  := ( (\\ t \u2192 \u03c3 (t , t)) , (\\ (t , s) \u2192 \u03c3 (s , t)))\n#def sigma-triangle-to-sigma-square-retract\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : is-retract-of\n( \u03a3 (d : hom A x y) , (hom2 A x y y f (id-hom A y) d))\n( \u03a3 ( g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  :=\n    ( ( sigma-triangle-to-sigma-square-section A x y f) ,\n      ( ( sigma-square-to-sigma-triangle-retraction A x y f) ,\n        ( \\ d\u03b1 \u2192 refl)))\n

We can now verify the Segal condition in the case of composable pairs in which the second arrow is an identity.

#def is-contr-hom2-with-id-is-discrete uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : is-contr ( \u03a3 (d : hom A x y) , (hom2 A x y y f (id-hom A y) d))\n  :=\n    is-contr-is-retract-of-is-contr\n( \u03a3 ( d : hom A x y) , (hom2 A x y y f (id-hom A y) d))\n( \u03a3 ( g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n      ( sigma-triangle-to-sigma-square-retract A x y f)\n      ( is-contr-horn-refl-refl-extension-type A is-discrete-A x y f)\n

But since A is discrete, its hom type family is equivalent to its identity type family, and we can use \"path induction\" over arrows to reduce the general case to the one just proven:

#def is-contr-hom2-is-discrete uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : is-contr (\u03a3 (h : hom A x z) , hom2 A x y z f g h)\n  :=\n    ind-based-path\n      ( A)\n      ( y)\n      ( \\ w \u2192 hom A y w)\n      ( \\ w \u2192 hom-eq A y w)\n      ( is-discrete-A y)\n( \\ w d \u2192 is-contr ( \u03a3 (h : hom A x w) , hom2 A x y w f d h))\n      ( is-contr-hom2-with-id-is-discrete A is-discrete-A x y f)\n      ( z)\n      ( g)\n

Finally, we conclude:

RS17, Proposition 7.3
#def is-segal-is-discrete uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n  : is-segal A\n  := is-contr-hom2-is-discrete A is-discrete-A\n
"},{"location":"simplicial-hott/08-covariant.rzk/","title":"Covariant families","text":"

These formalisations correspond to Section 8 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/08-covariant.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on extension extensionality:

#assume extext : ExtExt\n#assume weakfunext : WeakFunExt\n#assume naiveextext : NaiveExtExt\n
"},{"location":"simplicial-hott/08-covariant.rzk/#dependent-hom-types","title":"Dependent hom types","text":"

In a type family over a base type, there is a dependent hom type of arrows that live over a specified arrow in the base type.

RS17, Section 8 Prelim
#def dhom\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( u : C x)\n( v : C y)\n  : U\n  := (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u , t \u2261 1\u2082 \u21a6 v]\n

It will be convenient to collect together dependent hom types with fixed domain but varying codomain.

#def dhom-from\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( u : C x)\n  : U\n  := ( \u03a3 (v : C y) , dhom A x y f C u v)\n

There is also a type of dependent commutative triangles over a base commutative triangle.

#def dhom2\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n( \u03b1 : hom2 A x y z f g h)\n( C : A \u2192 U)\n( u : C x)\n( v : C y)\n( w : C z)\n( ff : dhom A x y f C u v)\n( gg : dhom A y z g C v w)\n( hh : dhom A x z h C u w)\n  : U\n  :=\n    ( (t1 , t2) : \u0394\u00b2) \u2192 C (\u03b1 (t1 , t2)) [\n        t2 \u2261 0\u2082 \u21a6 ff t1 ,\n        t1 \u2261 1\u2082 \u21a6 gg t2 ,\n        t2 \u2261 t1 \u21a6 hh t2\n      ]\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-families_1","title":"Covariant families","text":"

A family of types over a base type is covariant if every arrow in the base has a unique lift with specified domain.

RS17, Definition 8.2
#def is-covariant\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (u : C x) \u2192\n    is-contr (dhom-from A x y f C u)\n
The type of covariant families over a fixed type
#def covariant-family (A : U) : U\n  := ( \u03a3 (C : (A \u2192 U)) , is-covariant A C)\n

The notion of a covariant family is stable under substitution into the base.

RS17, Remark 8.3
#def is-covariant-substitution-is-covariant\n( A B : U)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( g : B \u2192 A)\n  : is-covariant B (\\ b \u2192 C (g b))\n  := \\ x y f u \u2192 is-covariant-C (g x) (g y) (ap-hom B A g x y f) u\n

The notion of having a unique lift with a fixed domain may also be expressed by contractibility of the type of extensions along the domain inclusion into the 1-simplex.

#def has-unique-fixed-domain-lifts\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (u : C x) \u2192\n    is-contr ((t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n

These two notions of covariance are equivalent because the two types of lifts of a base arrow with fixed domain are equivalent. Note that this is not quite an instance of Theorem 4.4 but its proof, with a very small modification, works here.

#def equiv-lifts-with-fixed-domain\n( A : U)\n( C : A \u2192 U)\n( x y : A)\n( f : hom A x y)\n( u : C x)\n  : Equiv\n((t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n      (dhom-from A x y f C u)\n  :=\n    ( \\ h \u2192 (h 1\u2082 , \\ t \u2192 h t) ,\n      ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl) ,\n        ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl))))\n

By the equivalence-invariance of contractibility, this proves the desired logical equivalence

#def is-covariant-has-unique-fixed-domain-lifts\n( A : U)\n( C : A \u2192 U)\n  : (has-unique-fixed-domain-lifts A C) \u2192 ( is-covariant A C)\n  :=\n\\ C-has-unique-lifts x y f u \u2192\n      is-contr-equiv-is-contr\n( (t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n        ( dhom-from A x y f C u)\n        ( equiv-lifts-with-fixed-domain A C x y f u)\n        ( C-has-unique-lifts x y f u)\n#def has-unique-fixed-domain-lifts-is-covariant\n( A : U)\n( C : A \u2192 U)\n  : (is-covariant A C) \u2192 (has-unique-fixed-domain-lifts A C)\n  :=\n\\ is-covariant-C x y f u \u2192\n      is-contr-equiv-is-contr'\n( (t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n        ( dhom-from A x y f C u)\n        ( equiv-lifts-with-fixed-domain A C x y f u)\n        ( is-covariant-C x y f u)\n
RS17, Proposition 8.4
#def has-unique-fixed-domain-lifts-iff-is-covariant\n( A : U)\n( C : A \u2192 U)\n  : iff\n      ( has-unique-fixed-domain-lifts A C)\n      ( is-covariant A C)\n  :=\n    ( is-covariant-has-unique-fixed-domain-lifts A C,\n      has-unique-fixed-domain-lifts-is-covariant A C)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#naive-left-fibrations","title":"Naive left fibrations","text":"

For any functor p : C\u0302 \u2192 A, we can make a naive definition of what it means to be a left fibration.

#def is-naive-left-fibration\n( A C\u0302 : U)\n( p : C\u0302 \u2192 A)\n  : U\n  :=\n    is-homotopy-cartesian\n      C\u0302 (coslice C\u0302)\n      A (coslice A)\n      p (coslice-fun C\u0302 A p)\n

As a sanity check we unpack the definition of is-naive-left-fibration.

#def is-naive-left-fibration-unpacked\n( A C\u0302 : U)\n( p : C\u0302 \u2192 A)\n  : is-naive-left-fibration A C\u0302 p =\n((c : C\u0302) \u2192 is-equiv (coslice C\u0302 c) (coslice A (p c)) (coslice-fun C\u0302 A p c))\n  := refl\n
"},{"location":"simplicial-hott/08-covariant.rzk/#naive-left-fibrations-are-left-fibrations","title":"Naive left fibrations are left fibrations","text":"

A map \u03b1 : A' \u2192 A is called a left fibration if it is right orthogonal to the shape inclusion {0} \u2282 \u0394\u00b9.

#section is-left-fibration\n#variables A' A : U\n#variable \u03b1 : A' \u2192 A\n#def is-left-fibration\n  : U\n  := is-right-orthogonal-to-shape 2 \u0394\u00b9 ( \\ s \u2192 s \u2261 0\u2082) A' A \u03b1\n

This notion agrees with that of a naive left fibration.

#def is-left-fibration-is-naive-left-fibration\n( is-nlf : is-naive-left-fibration A A' \u03b1)\n  : is-left-fibration\n  :=\n\\ a' \u2192\n      is-equiv-equiv-is-equiv\n        ( coslice' A' (a' 0\u2082)) (coslice' A (\u03b1 (a' 0\u2082)))\n        ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n        ( coslice A' (a' 0\u2082)) (coslice A (\u03b1 (a' 0\u2082)))\n        ( coslice-fun A' A \u03b1 (a' 0\u2082))\n        ( ( coslice-coslice' A' (a' 0\u2082), coslice-coslice' A (\u03b1 (a' 0\u2082))),\n\\ _ \u2192 refl)\n        ( is-equiv-coslice-coslice' A' (a' 0\u2082))\n        ( is-equiv-coslice-coslice' A (\u03b1 (a' 0\u2082)))\n        ( is-nlf (a' 0\u2082))\n#def is-naive-left-fibration-is-left-fibration\n( is-lf : is-left-fibration)\n  : is-naive-left-fibration A A' \u03b1\n  :=\n\\ a' \u2192\n      is-equiv-equiv-is-equiv'\n        ( coslice' A' a') (coslice' A (\u03b1 a'))\n        ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n        ( coslice A' a') (coslice A (\u03b1 a'))\n        ( coslice-fun A' A \u03b1 a')\n        ( ( coslice-coslice' A' a', coslice-coslice' A (\u03b1 a')),\n\\ _ \u2192 refl)\n        ( is-equiv-coslice-coslice' A' a')\n        ( is-equiv-coslice-coslice' A (\u03b1 a'))\n        ( is-lf (\\ t \u2192 a'))\n#def is-naive-left-fibration-iff-is-left-fibration\n  : iff\n      ( is-naive-left-fibration A A' \u03b1)\n      ( is-left-fibration)\n  :=\n    ( is-left-fibration-is-naive-left-fibration,\n      is-naive-left-fibration-is-left-fibration)\n#end is-left-fibration\n
"},{"location":"simplicial-hott/08-covariant.rzk/#left-fibrations-are-inner-fibrations","title":"Left fibrations are inner fibrations","text":"

Recall that an inner fibration is a map \u03b1 : A' \u2192 A which is right orthogonal to \u039b \u2282 \u0394\u00b2.

We aim to show that every left fibration is an inner fibration. This is a sequence of manipulations where we start with the assumption that {0} \u2282 \u0394\u00b9 is left orthogonal to \u03b1 : A' \u2192 A, i.e.

#section is-inner-fibration-is-left-fibration\n#variables A' A : U\n#variable \u03b1 : A' \u2192 A\n#variable is-left-fib-\u03b1 : is-left-fibration A' A \u03b1\n

and deduce that various other shape inclusions are left orthogonal as well.

The first step is to identify the pair {0} \u2282 \u0394\u00b9 with the pair of subshapes {1} \u2282 right-leg-of-\u039b of \u039b.

#def right-leg-of-\u039b : \u039b \u2192 TOPE\n  := \\ (t, s) \u2192 t \u2261 1\u2082\n#def is-equiv-\u0394\u00b9-to-right-leg-of-\u039b-rel-start\n( B : U)\n( b : B)\n  : is-equiv\n( ( s : \u0394\u00b9) \u2192 B [ s \u2261 0\u2082 \u21a6 b])\n      ( ( (t,s) : right-leg-of-\u039b) \u2192 B [ s \u2261 0\u2082 \u21a6 b])\n      ( \\ \u03c4 (t,s) \u2192 \u03c4 s)\n  :=\n    ( ( \\ \u03c5 s \u2192 \u03c5 (1\u2082, s) , \\ _ \u2192 refl),\n      ( \\ \u03c5 s \u2192 \u03c5 (1\u2082, s) , \\ _ \u2192 refl))\n#def is-right-orthogonal-to-10-1\u00d7\u0394\u00b9-is-inner-fibration uses (is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) (\\ ts \u2192 right-leg-of-\u039b ts) ( \\ (_,s) \u2192 s \u2261 0\u2082) A' A \u03b1\n  :=\n    \\ ( \u03c3' : ( (t,s) : 2 \u00d7 2 | right-leg-of-\u039b (t,s) \u2227 s \u2261 0\u2082) \u2192 A') \u2192\n      is-equiv-Equiv-is-equiv'\n( ( s : \u0394\u00b9) \u2192 A' [s \u2261 0\u2082 \u21a6 \u03c3' (1\u2082, s)])\n( ( s : \u0394\u00b9) \u2192 A [s \u2261 0\u2082 \u21a6 \u03b1 (\u03c3' (1\u2082, s))])\n        ( \\ \u03c4 s \u2192 \u03b1 (\u03c4 s))\n        ( ( (_, s) : right-leg-of-\u039b) \u2192 A' [ s \u2261 0\u2082 \u21a6 \u03c3' (1\u2082,s)])\n        ( ( (_, s) : right-leg-of-\u039b) \u2192 A [ s \u2261 0\u2082 \u21a6 \u03b1 ( \u03c3' (1\u2082,s))])\n        ( \\ \u03c5 ts \u2192 \u03b1 (\u03c5 ts))\n        ( ( ( \\ \u03c4' (t,s) \u2192 \u03c4' s , \\ \u03c4 (t,s) \u2192 \u03c4 s) , \\ _ \u2192 refl),\n          ( is-equiv-\u0394\u00b9-to-right-leg-of-\u039b-rel-start A' ( \u03c3' (1\u2082, 0\u2082))\n          , is-equiv-\u0394\u00b9-to-right-leg-of-\u039b-rel-start A ( \u03b1 ( \u03c3' (1\u2082, 0\u2082)))\n          )\n        )\n( is-left-fib-\u03b1 ( \\ ( s : 2 | \u0394\u00b9 s \u2227 s \u2261 0\u2082) \u2192 \u03c3' (1\u2082,s)))\n

Next we use that \u039b is the pushout of its left leg and its right leg to deduce that the pair left-leg-of-\u039b \u2282 \u039b is left orthogonal.

#def left-leg-of-\u039b : \u039b \u2192 TOPE\n  := \\ (t, s) \u2192 s \u2261 0\u2082\n#def is-right-orthogonal-to-left-leg-of-\u039b-\u039b-is-inner-fibration uses (is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u039b ts) ( \\ ts \u2192 left-leg-of-\u039b ts) A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-pushout A' A \u03b1\n      ( 2 \u00d7 2) ( \\ ts \u2192 right-leg-of-\u039b ts) (\\ ts \u2192 left-leg-of-\u039b ts)\n      ( is-right-orthogonal-to-10-1\u00d7\u0394\u00b9-is-inner-fibration)\n

Furthermore, we observe that the pair left-leg-of-\u0394 \u2282 \u0394\u00b9\u00d7\u0394\u00b9 is the product of \u0394\u00b9 with the left orthogonal pair {0} \u2282 \u0394\u00b9, hence left orthogonal itself.

#def is-right-orthogonal-to-left-leg-of-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration\nuses (naiveextext is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 left-leg-of-\u039b ts) A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-\u00d7 naiveextext A' A \u03b1\n2 \u0394\u00b9 2 \u0394\u00b9 ( \\ s \u2192 s \u2261 0\u2082) is-left-fib-\u03b1\n

Next, we use the left cancellation of left orthogonal shape inclusions to deduce that \u039b \u2282 \u0394\u00b9\u00d7\u0394\u00b9 is left orthogonal to \u03b1 : A' \u2192 A.

#def is-right-orthogonal-to-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration\nuses (naiveextext is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 \u039b ts) A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-left-cancel A' A \u03b1\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 \u039b ts) ( \\ ts \u2192 left-leg-of-\u039b ts)\n      ( is-right-orthogonal-to-left-leg-of-\u039b-\u039b-is-inner-fibration)\n      ( is-right-orthogonal-to-left-leg-of-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration)\n

Finally, we right cancel the functorial retract \u0394\u00b2 \u2282 \u0394\u00b9\u00d7\u0394\u00b9 to obtain the desired left orthogonal shape inclusion \u039b \u2282 \u0394\u00b2.

#def is-inner-fibration-is-left-fibration uses (naiveextext is-left-fib-\u03b1)\n  : is-inner-fibration A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-right-cancel-retract A' A \u03b1\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 \u0394\u00b2 ts) ( \\ ts \u2192 \u039b ts)\n      ( is-right-orthogonal-to-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration)\n      ( \u0394\u00b2-is-functorial-retract-\u0394\u00b9\u00d7\u0394\u00b9)\n#end is-inner-fibration-is-left-fibration\n

Since the Segal types are precisely the local types with respect to \u039b \u2282 \u0394\u00b9, we immediately deduce that in any left fibration \u03b1 : A' \u2192 A, if A is a Segal type, then so is A'.

Theorem 8.8, categorical version
#def is-segal-domain-left-fibration-is-segal-codomain uses (naiveextext)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( is-left-fib-\u03b1 : is-left-fibration A' A \u03b1)\n( is-segal-A : is-segal A)\n  : is-segal A'\n  :=\n    is-segal-is-local-horn-inclusion A'\n      ( is-local-type-domain-right-orthogonal-is-local-type-codomain\n        ( 2 \u00d7 2) \u0394\u00b2 ( \\ ts \u2192 \u039b ts) A' A \u03b1\n        ( is-inner-fibration-is-left-fibration A' A \u03b1 is-left-fib-\u03b1)\n        ( is-local-horn-inclusion-is-segal A is-segal-A))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#naive-left-fibrations-vs-covariant-families","title":"Naive left fibrations vs. covariant families","text":"

We aim to prove that a type family C : A \u2192 U, is covariant if and only if the projection p : total-type A C \u2192 A is a naive left fibration.

The theorem asserts the logical equivalence of two contractibility statements, one for the types dhom-from A a a' f C c and one for the fibers of the canonical map coslice (total-type A C) (a, c) \u2192 coslice A a; Thus it suffices to show that for each a a' : A, f : hom A a a', c : C a. these two types are equivalent.

We fix the following variables.

#section is-naive-left-fibration-is-covariant-proof\n#variable A : U\n#variable a : A\n#variable C : A \u2192 U\n#variable c : C a\n

Note that we do not fix a' : A and f : hom A a a'. Letting these vary lets us give an easy proof by invoking the induction principle for fibers.

We make some abbreviations to make the proof more readable:

-- We prepend all local names in this section\n-- with the random identifyier temp-b9wX\n-- to avoid cluttering the global name space.\n-- Once rzk supports local variables, these should be renamed.\n#def temp-b9wX-coslice-fun\n  : coslice (total-type A C) (a, c) \u2192 coslice A a\n  := coslice-fun (total-type A C) A (\\ (x, _) \u2192 x) (a, c)\n#def temp-b9wX-fib\n(a' : A)\n(f : hom A a a')\n  : U\n  :=\n    fib (coslice (total-type A C) (a, c))\n        (coslice A a)\n        (temp-b9wX-coslice-fun)\n        (a', f)\n

We construct the forward map; this one is straightforward since it goes from strict extension type to a weak one.

#def temp-b9wX-forward\n( a' : A)\n( f : hom A a a')\n  : dhom-from A a a' f C c \u2192 temp-b9wX-fib a' f\n  :=\n    \\ (c', f\u0302) \u2192 (((a', c'), \\ t \u2192 (f t, f\u0302 t)) , refl)\n

The only non-trivial part is showing that this map has a section. We do this by the following fiber induction.

#def temp-b9wX-has-section'-forward\n  ( (a', f) : coslice A a)\n( u : temp-b9wX-fib a' f)\n  : U\n  := \u03a3 ( v : dhom-from A a a' f C c), ( temp-b9wX-forward a' f v = u)\n#def temp-b9wX-forward-section'\n  : ( (a', f) : coslice A a) \u2192\n( u : temp-b9wX-fib a' f) \u2192\n    temp-b9wX-has-section'-forward (a', f) u\n  :=\n    ind-fib\n      ( coslice (total-type A C) (a, c))\n      ( coslice A a)\n      ( temp-b9wX-coslice-fun)\n      ( temp-b9wX-has-section'-forward)\n      (\\ ((a', c'), g\u0302) \u2192 ((c', \\ t \u2192 second (g\u0302 t)) , refl))\n

We have constructed a section. It is also definitionally a retraction, yielding the desired equivalence.

#def temp-b9wX-has-inverse-forward\n( a' : A)\n( f : hom A a a')\n  : has-inverse\n      (dhom-from A a a' f C c)\n      (temp-b9wX-fib a' f)\n      (temp-b9wX-forward a' f)\n  :=\n    ( \\ u \u2192 first (temp-b9wX-forward-section' (a', f) u),\n    ( \\ _ \u2192 refl,\n\\ u \u2192 second (temp-b9wX-forward-section' (a', f) u)\n    ))\n#def temp-b9wX-the-equivalence\n( a' : A)\n( f : hom A a a')\n  : Equiv\n      (dhom-from A a a' f C c)\n      (temp-b9wX-fib a' f)\n  :=\n    ( (temp-b9wX-forward a' f),\n      is-equiv-has-inverse\n        (dhom-from A a a' f C c)\n        (temp-b9wX-fib a' f)\n        (temp-b9wX-forward a' f)\n        (temp-b9wX-has-inverse-forward a' f)\n    )\n#end is-naive-left-fibration-is-covariant-proof\n

Finally, we deduce the theorem by some straightforward logical bookkeeping.

RS17, Theorem 8.5
#def is-naive-left-fibration-is-covariant\n( A : U)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-naive-left-fibration A (total-type A C) (\\ (a, _) \u2192 a)\n  :=\n    \\ (a, c) \u2192\n      is-equiv-is-contr-map\n        ( coslice (total-type A C) (a, c))\n        ( coslice A a)\n        ( temp-b9wX-coslice-fun A a C c)\n        ( \\ (a', f) \u2192\n          is-contr-equiv-is-contr\n            (dhom-from A a a' f C c)\n            (temp-b9wX-fib A a C c a' f)\n            (temp-b9wX-the-equivalence A a C c a' f)\n            (is-covariant-C a a' f c)\n        )\n#def is-covariant-is-naive-left-fibration\n( A : U)\n( C : A \u2192 U)\n( inlf-\u03a3C : is-naive-left-fibration A (total-type A C) (\\ (a, _) \u2192 a))\n  : is-covariant A C\n  :=\n\\ a a' f c \u2192\n      is-contr-equiv-is-contr'\n        ( dhom-from A a a' f C c)\n        ( temp-b9wX-fib A a C c a' f)\n        ( temp-b9wX-the-equivalence A a C c a' f)\n        ( is-contr-map-is-equiv\n          ( coslice (total-type A C) (a, c))\n          ( coslice A a)\n          ( temp-b9wX-coslice-fun A a C c)\n          ( inlf-\u03a3C (a, c))\n          (a', f)\n        )\n#def is-naive-left-fibration-iff-is-covariant\n( A : U)\n( C : A \u2192 U)\n  :\n    iff\n      (is-covariant A C)\n      (is-naive-left-fibration A (total-type A C) (\\ (a, _) \u2192 a))\n  :=\n    ( is-naive-left-fibration-is-covariant A C,\n      is-covariant-is-naive-left-fibration A C)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#total-space-of-a-covariant-family-over-a-segal-type","title":"Total space of a covariant family over a Segal type","text":"

We prove that the total space of a covariant family over a Segal type is a Segal type. We split the proof into intermediate steps. Let A be a type and a type family C : A \u2192 U.

"},{"location":"simplicial-hott/08-covariant.rzk/#category-theoretic-proof","title":"Category theoretic proof","text":"

For every covariant family C : A \u2192 U, the projection \u03a3 A, C \u2192 A is an left fibration, hence an inner fibration. It immediately follows that if A is Segal, then so is \u03a3 A, C.

RS17, Theorem 8.8
#def is-segal-total-space-covariant-family-is-segal-base uses (naiveextext)\n( A : U)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-segal A \u2192 is-segal (total-type A C)\n  :=\n    is-segal-domain-left-fibration-is-segal-codomain\n      ( total-type A C) A (\\ (a,_) \u2192 a)\n        ( is-left-fibration-is-naive-left-fibration\n            ( total-type A C) A (\\ (a,_) \u2192 a)\n            ( is-naive-left-fibration-is-covariant A C is-covariant-C))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#type-theoretic-proof","title":"Type theoretic proof","text":"

We examine the fibers of the horn restriction on the total space of C. First note we have the equivalences:

#def apply-4-3\n( A : U )\n( C : A \u2192 U )\n  : Equiv\n( \u039b \u2192 (\u03a3 ( a : A ), C a ) )\n( \u03a3 ( f : \u039b \u2192 A ), ( t : \u039b ) \u2192 ( C ( f t ) ) )\n  :=\n    axiom-choice ( 2 \u00d7 2 ) \u039b ( \\ t \u2192 BOT ) ( \\ t \u2192 A )\n    ( \\ t a \u2192 C a ) ( \\ t \u2192 recBOT ) ( \\ t \u2192 recBOT )\n#def apply-4-3-again\n( A : U )\n( C : A \u2192 U )\n  : Equiv\n( \u0394\u00b2 \u2192 (\u03a3 ( a : A ), C a ) )\n( \u03a3 ( f : \u0394\u00b2 \u2192 A ), ( t : \u0394\u00b2 ) \u2192 ( C ( f t ) ) )\n  :=\n    axiom-choice ( 2 \u00d7 2 ) \u0394\u00b2 ( \\ t \u2192 BOT ) ( \\ t \u2192 A )\n    ( \\ t a \u2192 C a ) ( \\ t \u2192 recBOT ) ( \\ t \u2192 recBOT )\n

We show that the induced map between this types is an equivalence. First we exhibit the map:

#def total-inner-horn-restriction\n( A : U )\n( C : A \u2192 U )\n  : ( \u03a3 ( f : \u0394\u00b2 \u2192 A ), ( t : \u0394\u00b2 ) \u2192 ( C ( f t ) ) ) \u2192\n( \u03a3 ( g : \u039b \u2192 A ), ( t : \u039b ) \u2192 ( C ( g t ) ) )\n  := \\ ( f, \u03bc ) \u2192 ( \\ t \u2192 f t , \\ t \u2192 \u03bc t)\n

Next we compute the fibers of this map by showing the equivalence as claimed in the proof of Theorem 8.8 in RS17. The following maps will be packed into some Equiv.

#def map-to-total-inner-horn-restriction-fiber\n( A : U )\n( C : A \u2192 U )\n  ( (g , \u03c6) : ( \u03a3 ( k : \u039b \u2192 A ), ( t : \u039b ) \u2192 C ( k t ) ) )\n  : ( \u03a3 (h : (t : \u0394\u00b2) \u2192 A [ \u039b t \u21a6 g t ] ) ,\n(( t : \u0394\u00b2 ) \u2192 C (h t) [ \u039b t \u21a6 \u03c6 t])) \u2192\n( fib ( \u03a3 ( l : \u0394\u00b2 \u2192 A ), ( t : \u0394\u00b2 ) \u2192 ( C ( l t ) ))\n( \u03a3 ( k : \u039b \u2192 A ), ( t : \u039b ) \u2192 ( C ( k t ) ))\n          ( total-inner-horn-restriction A C )\n          ( g,  \u03c6) )\n  := \\ ( f,\u03bc ) \u2192 ( ( \\ t \u2192 f t, \\ t \u2192 \u03bc t  ), refl )\n
"},{"location":"simplicial-hott/08-covariant.rzk/#representable-covariant-families","title":"Representable covariant families","text":"

If A is a Segal type and a : A is any term, then hom A a defines a covariant family over A, and conversely if this family is covariant for every a : A, then A must be a Segal type. The proof involves a rather lengthy composition of equivalences.

#def dhom-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n( v : hom A a y)\n  : U\n  := dhom A x y f (\\ z \u2192 hom A a z) u v\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n( v : hom A a y)\n  : Equiv\n    ( dhom-representable A a x y f u v)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n  :=\n    curry-uncurry 2 2 \u0394\u00b9 \u2202\u0394\u00b9 \u0394\u00b9 \u2202\u0394\u00b9 (\\ t s \u2192 A)\n    ( \\ (t , s) \u2192\nrecOR\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t))\n#def dhom-from-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : U\n  := dhom-from A x y f (\\ z \u2192 hom A a z) u\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-from-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( v : hom A a y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ v \u2192 dhom-representable A a x y f u v)\n      ( \\ v \u2192\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n      ( \\ v \u2192 uncurried-dhom-representable A a x y f u v)\n#def square-to-hom2-pushout\n( A : U)\n( w x y z : A)\n( u : hom A w x)\n( f : hom A x z)\n( g : hom A w y)\n( v : hom A y z)\n  : ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 g t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) \u2192\n( \u03a3 (d : hom A w z) , product (hom2 A w x z u f d) (hom2 A w y z g v d))\n  :=\n\\ sq \u2192\n    ( ( \\ t \u2192 sq (t , t)) , (\\ (t , s) \u2192 sq (s , t) , \\ (t , s) \u2192 sq (t , s)))\n#def hom2-pushout-to-square\n( A : U)\n( w x y z : A)\n( u : hom A w x)\n( f : hom A x z)\n( g : hom A w y)\n( v : hom A y z)\n  : ( \u03a3 ( d : hom A w z) ,\n        ( product (hom2 A w x z u f d) (hom2 A w y z g v d))) \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 g t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n  :=\n    \\ (d , (\u03b11 , \u03b12)) (t , s) \u2192\nrecOR\n      ( t \u2264 s \u21a6 \u03b11 (s , t) ,\n        s \u2264 t \u21a6 \u03b12 (t , s))\n#def equiv-square-hom2-pushout\n( A : U)\n( w x y z : A)\n( u : hom A w x)\n( f : hom A x z)\n( g : hom A w y)\n( v : hom A y z)\n  : Equiv\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 g t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n( \u03a3 (d : hom A w z) , (product (hom2 A w x z u f d) (hom2 A w y z g v d)))\n  :=\n    ( ( square-to-hom2-pushout A w x y z u f g v) ,\n      ( ( hom2-pushout-to-square A w x y z u f g v , \\ sq \u2192 refl) ,\n        ( hom2-pushout-to-square A w x y z u f g v , \\ \u03b1s \u2192 refl)))\n#def representable-dhom-from-uncurry-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n( \u03a3 (v : hom A a y) ,\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n( \u03a3 ( d : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n  :=\n    total-equiv-family-equiv\n    ( hom A a y)\n    ( \\ v \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \\ v \u2192\n      ( \u03a3 ( d : hom A a y) ,\n          ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n    ( \\ v \u2192 equiv-square-hom2-pushout A a x a y u f (id-hom A a) v)\n#def representable-dhom-from-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n  :=\n    equiv-triple-comp\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( v : hom A a y) ,\n        ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n( \u03a3 ( d : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n( \u03a3 ( d : hom A a y) ,\n( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n    ( uncurried-dhom-from-representable A a x y f u)\n    ( representable-dhom-from-uncurry-hom2 A a x y f u)\n    ( fubini-\u03a3 (hom A a y) (hom A a y)\n      ( \\ v d \u2192 product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d)))\n#def representable-dhom-from-hom2-dist\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , (hom2 A a a y (id-hom A a) v d))))\n  :=\n    equiv-right-cancel\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d)))\n( \u03a3 ( d : hom A a y) ,\n( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n    ( representable-dhom-from-hom2 A a x y f u)\n    ( total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ d \u2192\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , (hom2 A a a y (id-hom A a) v d))))\n( \\ d \u2192\n        ( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n      ( \\ d \u2192\n        ( distributive-product-\u03a3\n          ( hom2 A a x y u f d)\n          ( hom A a y)\n          ( \\ v \u2192 hom2 A a a y (id-hom A a) v d))))\n

Now we introduce the hypothesis that A is Segal type.

#def representable-dhom-from-path-space-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d))))\n  :=\n    equiv-right-cancel\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d))))\n( \u03a3 ( d : hom A a y) ,\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d)))\n    ( representable-dhom-from-hom2-dist A a x y f u)\n    ( total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ d \u2192 product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d)))\n      ( \\ d \u2192\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d)))\n      ( \\ d \u2192\n        ( total-equiv-family-equiv\n          ( hom2 A a x y u f d)\n( \\ \u03b1 \u2192 (\u03a3 (v : hom A a y) , (v = d)))\n( \\ \u03b1 \u2192 (\u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d))\n          ( \\ \u03b1 \u2192\n            ( total-equiv-family-equiv\n              ( hom A a y)\n              ( \\ v \u2192 (v = d))\n              ( \\ v \u2192 hom2 A a a y (id-hom A a) v d)\n              ( \\ v \u2192 (equiv-homotopy-hom2-is-segal A is-segal-A a y v d)))))))\n#def codomain-based-paths-contraction\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n( d : hom A a y)\n  : Equiv\n    ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d)))\n    ( hom2 A a x y u f d)\n  :=\n    equiv-projection-contractible-fibers\n      ( hom2 A a x y u f d)\n( \\ \u03b1 \u2192 (\u03a3 (v : hom A a y) , (v = d)))\n      ( \\ \u03b1 \u2192 is-contr-endpoint-based-paths (hom A a y) d)\n#def is-segal-representable-dhom-from-hom2\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 (d : hom A a y) , (hom2 A a x y u f d))\n  :=\n    equiv-comp\n    ( dhom-from-representable A a x y f u)\n( \u03a3 (d : hom A a y) ,\n      ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d))))\n( \u03a3 (d : hom A a y) , (hom2 A a x y u f d))\n    ( representable-dhom-from-path-space-is-segal A is-segal-A a x y f u)\n    ( total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ d \u2192 product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d)))\n      ( \\ d \u2192 hom2 A a x y u f d)\n      ( \\ d \u2192 codomain-based-paths-contraction A a x y f u d))\n#def is-segal-representable-dhom-from-contractible\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : is-contr (dhom-from-representable A a x y f u)\n  :=\n    is-contr-equiv-is-contr'\n      ( dhom-from-representable A a x y f u)\n( \u03a3 (d : hom A a y) , (hom2 A a x y u f d))\n      ( is-segal-representable-dhom-from-hom2 A is-segal-A a x y f u)\n      ( is-segal-A a x y u f)\n

Finally, we see that covariant hom families in a Segal type are covariant.

RS17, Proposition 8.13(<-)
#def is-covariant-representable-is-segal\n(A : U)\n(is-segal-A : is-segal A)\n(a : A)\n  : is-covariant A (hom A a)\n  := is-segal-representable-dhom-from-contractible A is-segal-A a\n

The proof of the claimed converse result given in the original source is circular - using Proposition 5.10, which holds only for Segal types - so instead we argue as follows:

RS17, Proposition 8.13(\u2192)
#def is-segal-is-covariant-representable\n( A : U)\n( corepresentable-family-is-covariant : (a : A) \u2192\n    is-covariant A (\\ x \u2192 hom A a x))\n  : is-segal A\n  :=\n\\ x y z f g \u2192\n    is-contr-base-is-contr-\u03a3\n( \u03a3 (h : hom A x z) , hom2 A x y z f g h)\n( \\ hk \u2192 \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk))\n    ( \\ hk \u2192 (first hk , \\ (t , s) \u2192 first hk s))\n( is-contr-equiv-is-contr'\n      ( \u03a3 ( hk : \u03a3 (h : hom A x z) , hom2 A x y z f g h) ,\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk)))\n      ( dhom-from-representable A x y z g f)\n      ( inv-equiv\n        ( dhom-from-representable A x y z g f)\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , hom2 A x y z f g h) ,\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk)))\n        ( equiv-comp\n          ( dhom-from-representable A x y z g f)\n( \u03a3 ( h : hom A x z) ,\n              ( product\n                ( hom2 A x y z f g h)\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v h)))\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , hom2 A x y z f g h) ,\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk)))\n          ( representable-dhom-from-hom2-dist A x y z g f)\n          ( associative-\u03a3\n            ( hom A x z)\n            ( \\ h \u2192 hom2 A x y z f g h)\n( \\ h _ \u2192 \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v h))))\n      ( corepresentable-family-is-covariant x y z g f))\n

While not needed to prove Proposition 8.13, it is interesting to observe that the dependent hom types in a representable family can be understood as extension types as follows.

#def cofibration-union-test\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( ( (t , s) : 2 \u00d7 2 | (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s)) \u2192\n      A [ (t \u2261 1\u2082) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (t \u2261 1\u2082) \u2227 (s \u2261 1\u2082) \u21a6 y])\n  :=\n    cofibration-union\n    ( 2 \u00d7 2)\n    ( \\ (t , s) \u2192 (t \u2261 1\u2082) \u2227 \u0394\u00b9 s)\n    ( \\ (t , s) \u2192\n      ((t \u2261 0\u2082) \u2227 (\u0394\u00b9 s)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 0\u2082)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 1\u2082)))\n    ( \\ (t , s) \u2192 A)\n    ( \\ (t , s) \u2192\nrecOR\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t))\n#def base-hom-rewriting\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : 2 \u00d7 2 | (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s)) \u2192\n      A [ (t \u2261 1\u2082) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (t \u2261 1\u2082) \u2227 (s \u2261 1\u2082) \u21a6 y])\n    ( hom A a y)\n  :=\n    ( ( \\ v \u2192 (\\ r \u2192 v ((1\u2082 , r)))) ,\n      ( ( \\ v (t , s) \u2192 v s , \\ _ \u2192 refl) ,\n        ( \\ v (_ , s) \u2192 v s , \\ _ \u2192 refl)))\n#def base-hom-expansion\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( hom A a y)\n  :=\n    equiv-comp\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( ( (t , s) : 2 \u00d7 2 | (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s)) \u2192\n      A [ (t \u2261 1\u2082) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (t \u2261 1\u2082) \u2227 (s \u2261 1\u2082) \u21a6 y])\n    ( hom A a y)\n    ( cofibration-union-test A a x y f u)\n    ( base-hom-rewriting A a x y f u)\n#def representable-dhom-from-expansion\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    total-equiv-pullback-is-equiv\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( hom A a y)\n    ( first (base-hom-expansion A a x y f u))\n    ( second (base-hom-expansion A a x y f u))\n    ( \\ v \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n#def representable-dhom-from-composite-expansion\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    equiv-right-cancel\n      ( dhom-from-representable A a x y f u)\n( \u03a3 ( sq :\n            ( (t , s) : \u2202\u25a1) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n      ( uncurried-dhom-from-representable A a x y f u)\n      ( representable-dhom-from-expansion A a x y f u)\n#def representable-dhom-from-cofibration-composition\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    cofibration-composition (2 \u00d7 2) \u0394\u00b9\u00d7\u0394\u00b9 \u2202\u25a1\n      ( \\ (t , s) \u2192\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 0\u2082)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 1\u2082)))\n      ( \\ ts \u2192 A)\n      ( \\ (t , s) \u2192\nrecOR\n          ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t))\n#def representable-dhom-from-as-extension-type\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n      ( dhom-from-representable A a x y f u)\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n  :=\n    equiv-right-cancel\n    ( dhom-from-representable A a x y f u)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n    ( representable-dhom-from-composite-expansion A a x y f u)\n    ( representable-dhom-from-cofibration-composition A a x y f u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-lifts-transport-and-uniqueness","title":"Covariant lifts, transport, and uniqueness","text":"

In a covariant family C over a base type A , a term u : C x may be transported along an arrow f : hom A x y to give a term in C y.

RS17, covariant transport from beginning of Section 8.2
#def covariant-transport\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : C y\n  :=\nfirst (center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))\n

For example, if A is a Segal type and a : A, the family C x := hom A a x is covariant as shown above. Transport of an e : C x along an arrow f : hom A x y just yields composition of f with e.

RS17, Example 8.14
#def compute-covariant-transport-of-hom-family-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( e : hom A a x)\n( f : hom A x y)\n  : covariant-transport A x y f\n      (hom A a) (is-covariant-representable-is-segal A is-segal-A a) e =\n    comp-is-segal A is-segal-A a x y e f\n  :=\nrefl\n
RS17, covariant lift from beginning of Section 8.2
#def covariant-lift\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : ( dhom A x y f C u (covariant-transport A x y f C is-covariant-C u))\n  :=\nsecond (center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))\n#def covariant-uniqueness\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n( lift : dhom-from A x y f C u)\n  : ( covariant-transport A x y f C is-covariant-C u) = (first lift)\n  :=\n    first-path-\u03a3\n    ( C y)\n    ( \\ v \u2192 dhom A x y f C u v)\n    ( center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))\n    ( lift)\n    ( homotopy-contraction (dhom-from A x y f C u) (is-covariant-C x y f u) lift)\n#def covariant-uniqueness-curried\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : ( v : C y)\n  \u2192 ( dhom A x y f C u v)\n  \u2192 ( covariant-transport A x y f C is-covariant-C u) = v\n  :=\n\\ v g \u2192 covariant-uniqueness A x y f C is-covariant-C u (v, g)\n

We show that for each v : C y, the map covariant-uniqueness is an equivalence. This follows from the fact that the total spaces (summed over v : C y) of both sides are contractible.

RS17, Lemma 8.15
#def is-equiv-total-map-covariant-uniqueness-curried\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : is-equiv\n(\u03a3 (v : C y), dhom A x y f C u v)\n(\u03a3 (v : C y), covariant-transport A x y f C is-covariant-C u = v)\n      ( total-map (C y)\n        (dhom A x y f C u)\n        (\\ v \u2192 covariant-transport A x y f C is-covariant-C u = v)\n        (covariant-uniqueness-curried A x y f C is-covariant-C u)\n      )\n  :=\n    is-equiv-are-contr\n(\u03a3 (v : C y), dhom A x y f C u v)\n(\u03a3 (v : C y), covariant-transport A x y f C is-covariant-C u = v)\n      (is-covariant-C x y f u)\n      (is-contr-based-paths (C y) (covariant-transport A x y f C is-covariant-C u))\n      ( total-map (C y)\n        (dhom A x y f C u)\n        (\\ v \u2192 covariant-transport A x y f C is-covariant-C u = v)\n        (covariant-uniqueness-curried A x y f C is-covariant-C u)\n      )\n#def is-equiv-covariant-uniqueness-curried\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n( v : C y)\n  : is-equiv\n      (dhom A x y f C u v)\n      (covariant-transport A x y f C is-covariant-C u = v)\n      (covariant-uniqueness-curried A x y f C is-covariant-C u v)\n  :=\n    total-equiv-family-of-equiv\n      (C y)\n      (dhom A x y f C u)\n      (\\ v' \u2192 covariant-transport A x y f C is-covariant-C u = v')\n      (covariant-uniqueness-curried A x y f C is-covariant-C u)\n      (is-equiv-total-map-covariant-uniqueness-curried A x y f C is-covariant-C u)\n      v\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-functoriality","title":"Covariant functoriality","text":"

The covariant transport operation defines a covariantly functorial action of arrows in the base on terms in the fibers. In particular, there is an identity transport law.

#def id-dhom\n( A : U)\n( x : A)\n( C : A \u2192 U)\n( u : C x)\n  : dhom A x x (id-hom A x) C u u\n  := \\ t \u2192 u\n
RS17, Proposition 8.16, Part 2, Covariant families preserve identities
#def id-arr-covariant-transport\n( A : U)\n( x : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : ( covariant-transport A x x (id-hom A x) C is-covariant-C u) = u\n  :=\n    covariant-uniqueness\n      A x x (id-hom A x) C is-covariant-C u (u , id-dhom A x C u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#natural-transformations","title":"Natural transformations","text":"

A fiberwise map between covariant families is automatically \"natural\" commuting with the covariant lifts.

RS17, Proposition 8.17, Covariant naturality
#def covariant-fiberwise-transformation-application\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( u : C x)\n  : dhom-from A x y f D (\u03d5 x u)\n  :=\n    ( ( \u03d5 y (covariant-transport A x y f C is-covariant-C u)) ,\n      ( \\ t \u2192 \u03d5 (f t) (covariant-lift A x y f C is-covariant-C u t)))\n#def naturality-covariant-fiberwise-transformation\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( u : C x)\n  : ( covariant-transport A x y f D is-covariant-D (\u03d5 x u)) =\n    ( \u03d5 y (covariant-transport A x y f C is-covariant-C u))\n  :=\n    covariant-uniqueness A x y f D is-covariant-D (\u03d5 x u)\n      ( covariant-fiberwise-transformation-application\n          A x y f C D is-covariant-C \u03d5 u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-equivalence","title":"Covariant equivalence","text":"

A family of types that is equivalent to a covariant family is itself covariant.

To prove this we first show that the corresponding types of lifts with fixed domain are equivalent:

#def equiv-covariant-total-dhom\n( A : U)\n( C : A \u2192 U)\n( x y : A)\n( f : hom A x y)\n  : Equiv\n( (t : \u0394\u00b9) \u2192 C (f t))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n  :=\n    ( ( \\ h \u2192 (h 0\u2082 , \\ t \u2192 h t)) ,\n      ( ( \\ k t \u2192 (second k) t , \\ h \u2192 refl) ,\n        ( ( \\ k t \u2192 (second k) t , \\ h \u2192 refl))))\n
#section dhom-from-equivalence\n#variable A : U\n#variables B C : A \u2192 U\n#variable equiv-BC : (a : A) \u2192 Equiv (B a) (C a)\n#variables x y : A\n#variable f : hom A x y\n#def equiv-total-dhom-equiv uses (A x y)\n  : Equiv ( (t : \u0394\u00b9) \u2192 B (f t)) ((t : \u0394\u00b9) \u2192 C (f t))\n  :=\n    equiv-extension-equiv-family\n      ( extext)\n      ( 2)\n      ( \u0394\u00b9)\n      ( \\ t \u2192 B (f t))\n      ( \\ t \u2192 C (f t))\n      ( \\ t \u2192 equiv-BC (f t))\n#def equiv-total-covariant-dhom-equiv uses (extext equiv-BC)\n  : Equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n  :=\n    equiv-triple-comp\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( (t : \u0394\u00b9) \u2192 B (f t))\n( (t : \u0394\u00b9) \u2192 C (f t))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n( inv-equiv\n      ( (t : \u0394\u00b9) \u2192 B (f t))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n      ( equiv-covariant-total-dhom A B x y f))\n    ( equiv-total-dhom-equiv)\n    ( equiv-covariant-total-dhom A C x y f)\n#def equiv-pullback-total-covariant-dhom-equiv uses (A y)\n  : Equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n  :=\n    total-equiv-pullback-is-equiv\n      ( B x)\n      ( C x)\n      ( first (equiv-BC x))\n      ( second (equiv-BC x))\n( \\ u \u2192 ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n#def is-equiv-to-pullback-total-covariant-dhom-equiv uses (extext A y)\n  : is-equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n    ( \\ (i , h) \u2192 (i , \\ t \u2192 (first (equiv-BC (f t))) (h t)))\n  :=\n    is-equiv-right-factor\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n    ( \\ (i , h) \u2192 (i , \\ t \u2192 (first (equiv-BC (f t))) (h t)))\n    ( first (equiv-pullback-total-covariant-dhom-equiv))\n    ( second (equiv-pullback-total-covariant-dhom-equiv))\n    ( second (equiv-total-covariant-dhom-equiv))\n#def equiv-to-pullback-total-covariant-dhom-equiv uses (extext A y)\n  : Equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n  :=\n    ( \\ (i , h) \u2192 (i , \\ t \u2192 (first (equiv-BC (f t))) (h t)) ,\n      is-equiv-to-pullback-total-covariant-dhom-equiv)\n#def family-equiv-dhom-family-equiv uses (extext A y)\n(i : B x)\n  : Equiv\n( (t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i])\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i])\n  :=\n    family-equiv-total-equiv\n    ( B x)\n( \\ ii \u2192 ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 ii]))\n( \\ ii \u2192 ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) ii]))\n    ( \\ ii h t \u2192 (first (equiv-BC (f t))) (h t))\n    ( is-equiv-to-pullback-total-covariant-dhom-equiv)\n    ( i)\n#end dhom-from-equivalence\n

Now we introduce the hypothesis that C is covariant in the form of has-unique-fixed-domain-lifts.

#def equiv-has-unique-fixed-domain-lifts uses (extext)\n( A : U)\n( B C : A \u2192 U)\n( equiv-BC : (a : A) \u2192 Equiv (B a) (C a))\n( has-unique-fixed-domain-lifts-C :\n    has-unique-fixed-domain-lifts A C)\n  : has-unique-fixed-domain-lifts A B\n  :=\n\\ x y f i \u2192\n    is-contr-equiv-is-contr'\n( (t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i])\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i])\n    ( family-equiv-dhom-family-equiv A B C equiv-BC x y f i)\n    ( has-unique-fixed-domain-lifts-C x y f ((first (equiv-BC x)) i))\n#def equiv-is-covariant uses (extext)\n( A : U)\n( B C : A \u2192 U)\n( equiv-BC : (a : A) \u2192 Equiv (B a) (C a))\n( is-covariant-C : is-covariant A C)\n  : is-covariant A B\n  :=\n    ( first (has-unique-fixed-domain-lifts-iff-is-covariant A B))\n      ( equiv-has-unique-fixed-domain-lifts\n        A B C equiv-BC\n        ( (second (has-unique-fixed-domain-lifts-iff-is-covariant A C))\n          is-covariant-C))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-families","title":"Contravariant families","text":"

A family of types over a base type is contravariant if every arrow in the base has a unique lift with specified codomain.

#def dhom-to\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( v : C y)\n  : U\n  := ( \u03a3 (u : C x) , dhom A x y f C u v)\n
RS17, Definition 8.2, dual form
#def is-contravariant\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (v : C y) \u2192\n    is-contr (dhom-to A x y f C v)\n
The type of contravariant families over a fixed type
#def contravariant-family (A : U) : U\n  := ( \u03a3 (C : A \u2192 U) , is-contravariant A C)\n

The notion of a contravariant family is stable under substitution into the base.

RS17, Remark 8.3, dual form
#def is-contravariant-substitution-is-contravariant\n( A B : U)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( g : B \u2192 A)\n  : is-contravariant B (\\ b \u2192 C (g b))\n  := \\ x y f v \u2192 is-contravariant-C (g x) (g y) (ap-hom B A g x y f) v\n

The notion of having a unique lift with a fixed codomain may also be expressed by contractibility of the type of extensions along the codomain inclusion into the 1-simplex.

#def has-unique-fixed-codomain-lifts\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (v : C y) \u2192\n    is-contr ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n

These two notions of covariance are equivalent because the two types of lifts of a base arrow with fixed codomain are equivalent. Note that this is not quite an instance of Theorem 4.4 but its proof, with a very small modification, works here.

#def equiv-lifts-with-fixed-codomain\n( A : U)\n( C : A \u2192 U)\n( x y : A)\n( f : hom A x y)\n( v : C y)\n  : Equiv\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n      ( dhom-to A x y f C v)\n  :=\n    ( ( \\ h \u2192 (h 0\u2082 , \\ t \u2192 h t)) ,\n      ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl) ,\n        ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl))))\n

By the equivalence-invariance of contractibility, this proves the desired logical equivalence

#def is-contravariant-has-unique-fixed-codomain-lifts\n( A : U)\n( C : A \u2192 U)\n  : (has-unique-fixed-codomain-lifts A C) \u2192 ( is-contravariant A C)\n  :=\n\\ C-has-unique-lifts x y f v \u2192\n      is-contr-equiv-is-contr\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n      ( dhom-to A x y f C v)\n      ( equiv-lifts-with-fixed-codomain A C x y f v)\n      ( C-has-unique-lifts x y f v)\n#def has-unique-fixed-codomain-lifts-is-contravariant\n( A : U)\n( C : A \u2192 U)\n  : (is-contravariant A C) \u2192 (has-unique-fixed-codomain-lifts A C)\n  :=\n\\ is-contravariant-C x y f v \u2192\n      is-contr-equiv-is-contr'\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n      ( dhom-to A x y f C v)\n      ( equiv-lifts-with-fixed-codomain A C x y f v)\n      ( is-contravariant-C x y f v)\n
RS17, Proposition 8.4
#def has-unique-fixed-codomain-lifts-iff-is-contravariant\n( A : U)\n( C : A \u2192 U)\n  : iff\n      ( has-unique-fixed-codomain-lifts A C)\n      ( is-contravariant A C)\n  :=\n    ( is-contravariant-has-unique-fixed-codomain-lifts A C,\n      has-unique-fixed-codomain-lifts-is-contravariant A C)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#representable-contravariant-families","title":"Representable contravariant families","text":"

If A is a Segal type and a : A is any term, then the family \\ x \u2192 hom A x a defines a contravariant family over A , and conversely if this family is contravariant for every a : A , then A must be a Segal type. The proof involves a rather lengthy composition of equivalences.

#def dhom-contra-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A x a)\n( v : hom A y a)\n  : U\n  := dhom A x y f (\\ z \u2192 hom A z a) u v\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-contra-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A x a)\n( v : hom A y a)\n  : Equiv\n    ( dhom-contra-representable A a x y f u v)\n    ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a])\n  :=\n    curry-uncurry 2 2 \u0394\u00b9 \u2202\u0394\u00b9 \u0394\u00b9 \u2202\u0394\u00b9 (\\ t s \u2192 A)\n      ( \\ (t , s) \u2192\nrecOR\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a))\n#def dhom-to-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : U\n  := dhom-to A x y f (\\ z \u2192 hom A z a) v\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-to-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (u : hom A x a) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n  :=\n    total-equiv-family-equiv\n    ( hom A x a)\n    ( \\ u \u2192 dhom-contra-representable A a x y f u v)\n    ( \\ u \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n    ( \\ u \u2192 uncurried-dhom-contra-representable A a x y f u v)\n#def representable-dhom-to-uncurry-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n( \u03a3 ( u : hom A x a) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n( \u03a3 (u : hom A x a) ,\n(\u03a3 (d : hom A x a) ,\n        product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n  :=\n    total-equiv-family-equiv (hom A x a)\n    ( \\ u \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n( \\ u \u2192\n      \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n    ( \\ u \u2192 equiv-square-hom2-pushout A x a y a u (id-hom A a) f v)\n#def representable-dhom-to-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) ,\n( \u03a3 (u : hom A x a) ,\n        product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n  :=\n    equiv-triple-comp\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( u : hom A x a) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n( \u03a3 ( u : hom A x a) ,\n( \u03a3 ( d : hom A x a) ,\n            ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n    ( uncurried-dhom-to-representable A a x y f v)\n    ( representable-dhom-to-uncurry-hom2 A a x y f v)\n    ( fubini-\u03a3 (hom A x a) (hom A x a)\n      ( \\ u d \u2192 product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n#def representable-dhom-to-hom2-swap\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))))\n  :=\n    equiv-comp\n      ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n              ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n              ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))))\n      ( representable-dhom-to-hom2 A a x y f v)\n      ( total-equiv-family-equiv (hom A x a)\n(\\ d \u2192\n          \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n( \\ d \u2192\n          \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d)))\n        ( \\ d \u2192 total-equiv-family-equiv (hom A x a)\n          ( \\ u \u2192 product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))\n          ( \\ u \u2192 product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))\n          ( \\ u \u2192\n            sym-product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n#def representable-dhom-to-hom2-dist\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n      ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n          ( product\n            ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d)))\n  :=\n    equiv-right-cancel\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) ,\n        ( product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d)))\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 (u : hom A x a) ,\n          product\n          ( hom2 A x y a f v d)\n          ( hom2 A x a a u (id-hom A a) d)))\n    ( representable-dhom-to-hom2-swap A a x y f v)\n    ( total-equiv-family-equiv (hom A x a)\n      ( \\ d \u2192\n        ( product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d)))\n( \\ d \u2192\n        ( \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))))\n      ( \\ d \u2192\n        ( distributive-product-\u03a3\n          ( hom2 A x y a f v d)\n          ( hom A x a)\n          ( \\ u \u2192 hom2 A x a a u (id-hom A a) d))))\n

Now we introduce the hypothesis that A is Segal type.

#def representable-dhom-to-path-space-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d))))\n  :=\n    equiv-right-cancel\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d))))\n( \u03a3 ( d : hom A x a) ,\n        ( product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , (hom2 A x a a u (id-hom A a) d))))\n    ( representable-dhom-to-hom2-dist A a x y f v)\n    ( total-equiv-family-equiv (hom A x a)\n      ( \\ d \u2192 product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d)))\n      ( \\ d \u2192\n        product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d))\n      ( \\ d \u2192\n        total-equiv-family-equiv\n          ( hom2 A x y a f v d)\n( \\ \u03b1 \u2192 (\u03a3 (u : hom A x a) , (u = d)))\n( \\ \u03b1 \u2192 (\u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d))\n          ( \\ \u03b1 \u2192\n          ( total-equiv-family-equiv\n            ( hom A x a)\n            ( \\ u \u2192 (u = d))\n            ( \\ u \u2192 hom2 A x a a u (id-hom A a) d)\n            ( \\ u \u2192 equiv-homotopy-hom2'-is-segal A is-segal-A x a u d)))))\n#def is-segal-representable-dhom-to-hom2\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) , (hom2 A x y a f v d))\n  :=\n    equiv-comp\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d))))\n( \u03a3 (d : hom A x a) , (hom2 A x y a f v d))\n    ( representable-dhom-to-path-space-is-segal A is-segal-A a x y f v)\n    ( total-equiv-family-equiv\n      ( hom A x a)\n      ( \\ d \u2192 product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d)))\n      ( \\ d \u2192 hom2 A x y a f v d)\n      ( \\ d \u2192 codomain-based-paths-contraction A x y a v f d))\n#def is-segal-representable-dhom-to-contractible\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : is-contr (dhom-to-representable A a x y f v)\n  :=\n    is-contr-equiv-is-contr'\n      ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) , (hom2 A x y a f v d))\n      ( is-segal-representable-dhom-to-hom2 A is-segal-A a x y f v)\n      ( is-segal-A x y a f v)\n

Finally, we see that contravariant hom families in a Segal type are contravariant.

RS17, Proposition 8.13(<-), dual
#def is-contravariant-representable-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n  : is-contravariant A (\\ x \u2192 hom A x a)\n  := is-segal-representable-dhom-to-contractible A is-segal-A a\n

The proof of the claimed converse result given in the original source is circular - using Proposition 5.10, which holds only for Segal types - so instead we argue as follows:

RS17, Proposition 8.13(\u2192), dual
#def is-segal-is-contravariant-representable\n( A : U)\n( representable-family-is-contravariant : (a : A) \u2192\n    is-contravariant A (\\ x \u2192 hom A x a))\n  : is-segal A\n  :=\n\\ x y z f g \u2192\n      is-contr-base-is-contr-\u03a3\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n( \\ hk \u2192 \u03a3 (u : hom A x z) , (hom2 A x z z u (id-hom A z) (first hk)))\n      ( \\ hk \u2192 (first hk , \\ (t , s) \u2192 first hk t))\n( is-contr-equiv-is-contr'\n        ( \u03a3 ( hk : \u03a3 (h : hom A x z) , (hom2 A x y z f g h)) ,\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) (first hk)))\n        ( dhom-to-representable A z x y f g)\n        ( inv-equiv\n          ( dhom-to-representable A z x y f g)\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , (hom2 A x y z f g h)) ,\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) (first hk)))\n          ( equiv-comp\n            ( dhom-to-representable A z x y f g)\n( \u03a3 ( h : hom A x z) ,\n                ( product\n                  ( hom2 A x y z f g h)\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) h)))\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , (hom2 A x y z f g h)) ,\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) (first hk)))\n            ( representable-dhom-to-hom2-dist A z x y f g)\n            ( associative-\u03a3\n              ( hom A x z)\n              ( \\ h \u2192 hom2 A x y z f g h)\n( \\ h _ \u2192 \u03a3 (u : hom A x z) , (hom2 A x z z u (id-hom A z) h)))))\n              ( representable-family-is-contravariant z x y f g))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-lifts-transport-and-uniqueness","title":"Contravariant lifts, transport, and uniqueness","text":"

In a contravariant family C over a base type A, a term v : C y may be transported along an arrow f : hom A x y to give a term in C x.

RS17, contravariant transport from beginning of Section 8.2
#def contravariant-transport\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C y)\n  : C x\n  :=\nfirst\n      ( center-contraction (dhom-to A x y f C v) (is-contravariant-C x y f v))\n
RS17, contravariant lift from beginning of Section 8.2
#def contravariant-lift\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C y)\n  : ( dhom A x y f C (contravariant-transport A x y f C is-contravariant-C v) v)\n  :=\nsecond\n      ( center-contraction (dhom-to A x y f C v) (is-contravariant-C x y f v))\n#def contravariant-uniqueness\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C y)\n( lift : dhom-to A x y f C v)\n  : ( contravariant-transport A x y f C is-contravariant-C v) = (first lift)\n  :=\n    first-path-\u03a3\n    ( C x)\n    ( \\ u \u2192 dhom A x y f C u v)\n    ( center-contraction\n      ( dhom-to A x y f C v)\n      ( is-contravariant-C x y f v))\n    ( lift)\n    ( homotopy-contraction\n      ( dhom-to A x y f C v)\n      ( is-contravariant-C x y f v)\n      ( lift))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-functoriality","title":"Contravariant functoriality","text":"

The contravariant transport operation defines a comtravariantly functorial action of arrows in the base on terms in the fibers. In particular, there is an identity transport law.

RS17, Proposition 8.16, Part 2, dual, Contravariant families preserve identities
#def id-arr-contravariant-transport\n( A : U)\n( x : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( u : C x)\n  : ( contravariant-transport A x x (id-hom A x) C is-contravariant-C u) = u\n  :=\n    contravariant-uniqueness A x x (id-hom A x) C is-contravariant-C u\n      ( u , id-dhom A x C u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-natural-transformations","title":"Contravariant natural transformations","text":"

A fiberwise map between contrvariant families is automatically \"natural\" commuting with the contravariant lifts.

RS17, Proposition 8.17, dual, Contravariant naturality
#def contravariant-fiberwise-transformation-application\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( v : C y)\n  : dhom-to A x y f D (\u03d5 y v)\n  :=\n    ( \u03d5 x (contravariant-transport A x y f C is-contravariant-C v) ,\n\\ t \u2192 \u03d5 (f t) (contravariant-lift A x y f C is-contravariant-C v t))\n#def naturality-contravariant-fiberwise-transformation\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( v : C y)\n  : ( contravariant-transport A x y f D is-contravariant-D (\u03d5 y v)) =\n    ( \u03d5 x (contravariant-transport A x y f C is-contravariant-C v))\n  :=\n    contravariant-uniqueness A x y f D is-contravariant-D (\u03d5 y v)\n    ( contravariant-fiberwise-transformation-application\n        A x y f C D is-contravariant-C \u03d5 v)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#two-sided-discrete-fibrations","title":"Two sided discrete fibrations","text":"RS17, Definition 8.28
#def is-two-sided-discrete\n( A B : U)\n( C : A \u2192 B \u2192 U)\n  : U\n  :=\n    product\n( (a : A) \u2192 is-covariant B (\\b \u2192 C a b))\n( (b : B) \u2192 is-contravariant A (\\ a \u2192 C a b))\n
RS17, Proposition 8.29
#def is-two-sided-discrete-hom-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : is-two-sided-discrete A A (hom A)\n  :=\n    ( is-covariant-representable-is-segal A is-segal-A ,\n      is-contravariant-representable-is-segal A is-segal-A)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#closure-properties-of-covariance","title":"Closure properties of covariance","text":"RS17, Theorem 8.30
#def is-covariant-is-locally-covariant uses (weakfunext)\n( A B : U)\n( C : A \u2192 B \u2192 U)\n( is-locally-covariant : (b : B) \u2192 is-covariant A ( \\ a \u2192 C a b ) )\n  : is-covariant A ( \\ a \u2192 (( b : B ) \u2192 (C a b)))\n  :=\n    is-covariant-has-unique-fixed-domain-lifts\n      ( A)\n( \\ a \u2192 ( b : B ) \u2192 (C a b) )\n( \\ x y f g \u2192\n        equiv-with-contractible-codomain-implies-contractible-domain\n          ( (t : \u0394\u00b9) \u2192 ((b : B) \u2192 C (f t) b) [  t \u2261 0\u2082 \u21a6 g ])\n( (b : B) \u2192 (t : \u0394\u00b9) \u2192 C (f t) b [ t \u2261 0\u2082 \u21a6 g b])\n          ( flip-ext-fun 2 \u0394\u00b9 (\\ t \u2192 t \u2261 0\u2082) B ( \\ t \u2192  C (f t)) ( \\ t \u2192 g))\n( weakfunext B\n            ( \\ b \u2192 ( (t : \u0394\u00b9) \u2192 C (f t) b [ t \u2261 0\u2082 \u21a6 g b] ) )\n            ( \\ b \u2192\n              ( has-unique-fixed-domain-lifts-is-covariant\n                ( A)\n                ( \\ a  \u2192 (C a b))\n                ( is-locally-covariant b))\n             x y f (g b))))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/","title":"The Yoneda lemma","text":"

These formalisations correspond to Section 9 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#natural-transformations-involving-a-representable-functor","title":"Natural transformations involving a representable functor","text":"

Fix a Segal type A and a term a : A. The Yoneda lemma characterizes natural transformations from the representable type family hom A a : A \u2192 U to a covariant type family C : A \u2192 U.

Ordinarily, such a natural transformation would involve a family of maps

\u03d5 : (z : A) \u2192 hom A a z \u2192 C z

together with a proof of naturality of these components, but by naturality-covariant-fiberwise-transformation naturality is automatic.

#def naturality-covariant-fiberwise-representable-transformation\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A a x)\n( g : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n  : (covariant-transport A x y g C is-covariant-C (\u03d5 x f)) =\n    (\u03d5 y (comp-is-segal A is-segal-A a x y f g))\n  :=\n    naturality-covariant-fiberwise-transformation A x y g\n      (\\ z \u2192 hom A a z)\n      ( C)\n      ( is-covariant-representable-is-segal A is-segal-A a)\n      ( is-covariant-C)\n      ( \u03d5)\n      ( f)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#the-yoneda-maps","title":"The Yoneda maps","text":"

For any Segal type A and term a : A, the Yoneda lemma provides an equivalence between the type (z : A) \u2192 hom A a z \u2192 C z of natural transformations out of the functor hom A a and values in an arbitrary covariant family C and the type C a.

One of the maps in this equivalence is evaluation at the identity. The inverse map makes use of the covariant transport operation.

The following map, evid, evaluates a natural transformation out of a representable functor at the identity arrow.

#def evid\n( A : U)\n( a : A)\n( C : A \u2192 U)\n  : ( (z : A) \u2192 hom A a z \u2192 C z) \u2192 C a\n  := \\ \u03d5 \u2192 \u03d5 a (id-hom A a)\n

The inverse map only exists for Segal types.

#def yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : C a \u2192 ( (z : A) \u2192 hom A a z \u2192 C z)\n  := \\ u x f \u2192 covariant-transport A a x f C is-covariant-C u\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#the-yoneda-composites","title":"The Yoneda composites","text":"

It remains to show that the Yoneda maps are inverses. One retraction is straightforward:

#def evid-yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C a)\n  : ( evid A a C) ((yon A is-segal-A a C is-covariant-C) u) = u\n  := id-arr-covariant-transport A a C is-covariant-C u\n

The other composite carries \u03d5 to an a priori distinct natural transformation. We first show that these are pointwise equal at all x : A and f : hom A a x in two steps.

#section yon-evid\n#variable A : U\n#variable is-segal-A : is-segal A\n#variable a : A\n#variable C : A \u2192 U\n#variable is-covariant-C : is-covariant A C\n

The composite yon-evid of \u03d5 equals \u03d5 at all x : A and f : hom A a x.

#def yon-evid-twice-pointwise\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n( x : A)\n( f : hom A a x)\n  : ( (yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x f = \u03d5 x f\n  :=\n    concat\n      ( C x)\n      ( ((yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x f)\n      ( \u03d5 x (comp-is-segal A is-segal-A a a x (id-hom A a) f))\n      ( \u03d5 x f)\n      ( naturality-covariant-fiberwise-representable-transformation\n        A is-segal-A a a x (id-hom A a) f C is-covariant-C \u03d5)\n      ( ap\n        ( hom A a x)\n        ( C x)\n        ( comp-is-segal A is-segal-A a a x (id-hom A a) f)\n        ( f)\n        ( \u03d5 x)\n        ( id-comp-is-segal A is-segal-A a x f))\n

By funext, these are equals as functions of f pointwise in x.

#def yon-evid-once-pointwise uses (funext)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n( x : A)\n  : ( (yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x = \u03d5 x\n  :=\n    eq-htpy funext\n      ( hom A a x)\n      ( \\ f \u2192 C x)\n      ( \\ f \u2192 ((yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x f)\n      ( \\ f \u2192 (\u03d5 x f))\n      ( \\ f \u2192 yon-evid-twice-pointwise \u03d5 x f)\n

By funext again, these are equal as functions of x and f.

#def yon-evid uses (funext)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n  : ( (yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) = \u03d5\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 (hom A a x \u2192 C x))\n      ( \\ x \u2192 ((yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x)\n      ( \\ x \u2192 (\u03d5 x))\n      ( \\ x \u2192 yon-evid-once-pointwise \u03d5 x)\n#end yon-evid\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#the-yoneda-lemma_1","title":"The Yoneda lemma","text":"

The Yoneda lemma says that evaluation at the identity defines an equivalence. This is proven combining the previous steps.

RS17, Theorem 9.1
#def yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-equiv ((z : A) \u2192 hom A a z \u2192 C z) (C a) (evid A a C)\n  :=\n    ( ( ( yon A is-segal-A a C is-covariant-C) ,\n        ( yon-evid A is-segal-A a C is-covariant-C)) ,\n      ( ( yon A is-segal-A a C is-covariant-C) ,\n        ( evid-yon A is-segal-A a C is-covariant-C)))\n

For later use, we observe that the same proof shows that the inverse map is an equivalence.

#def inv-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-equiv (C a) ((z : A) \u2192 hom A a z \u2192 C z)\n      ( yon A is-segal-A a C is-covariant-C)\n  :=\n    ( ( ( evid A a C) ,\n        ( evid-yon A is-segal-A a C is-covariant-C)) ,\n      ( ( evid A a C) ,\n        ( yon-evid A is-segal-A a C is-covariant-C)))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#naturality","title":"Naturality","text":"

The equivalence of the Yoneda lemma is natural in both a : A and C : A \u2192 U.

Naturality in a follows from the fact that the maps evid and yon are fiberwise equivalences between covariant families over A, though it requires some work to prove that the domain is covariant.

#def is-covariant-yoneda-domain uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-covariant A (\\ a \u2192 (z : A) \u2192 hom A a z \u2192 C z)\n  :=\n    equiv-is-covariant\n    ( extext)\n    ( A)\n( \\ a -> (z : A) \u2192 hom A a z \u2192 C z)\n    ( C)\n    ( \\ a -> (evid A a C , yoneda-lemma A is-segal-A a C is-covariant-C))\n    ( is-covariant-C)\n#def is-natural-in-object-evid uses (funext extext)\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( f : hom A a b)\n( C : A -> U)\n( is-covariant-C : is-covariant A C)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n  : ( covariant-transport A a b f C is-covariant-C (evid A a C \u03d5)) =\n( evid A b C\n\n      ( covariant-transport A a b f\n        ( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n        ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C) \u03d5))\n  :=\n    naturality-covariant-fiberwise-transformation\n    ( A)\n    ( a)\n    ( b)\n    ( f)\n( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n    ( C)\n    ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C)\n    ( is-covariant-C)\n    ( \\ x -> evid A x C)\n    ( \u03d5)\n#def is-natural-in-object-yon uses (funext extext)\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( f : hom A a b)\n( C : A -> U)\n( is-covariant-C : is-covariant A C)\n( u : C a)\n  : ( covariant-transport\n      A a b f\n      ( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n      ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C)\n      ( yon A is-segal-A a C is-covariant-C u)) =\n    ( yon A is-segal-A b C is-covariant-C\n      ( covariant-transport A a b f C is-covariant-C u))\n  :=\n    naturality-covariant-fiberwise-transformation\n    ( A)\n    ( a)\n    ( b)\n    ( f)\n    ( C)\n( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n    ( is-covariant-C)\n    ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C)\n    ( \\ x -> yon A is-segal-A x C is-covariant-C)\n    ( u)\n

Naturality in C is not automatic but can be proven easily:

RS17, Lemma 9.2(i)
#def is-natural-in-family-evid\n( A : U)\n( a : A)\n( C D : A \u2192 U)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( \u03c6 : (z : A) \u2192 hom A a z \u2192 C z)\n  : ( comp ((z : A) \u2192 hom A a z \u2192 C z) (C a) (D a) (\u03c8 a) (evid A a C)) \u03c6 =\n( comp ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z) (D a)\n    ( evid A a D) ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))) \u03c6\n  := refl\n
RS17, Lemma 9.2(ii)
#def is-natural-in-family-yon-twice-pointwise\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n( f : hom A a x)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x f =\n    ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x f\n  :=\n    naturality-covariant-fiberwise-transformation\n      A a x f C D is-covariant-C is-covariant-D \u03c8 u\n#def is-natural-in-family-yon-once-pointwise uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x =\n    ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x\n  :=\n    eq-htpy funext\n      ( hom A a x)\n      ( \\ f \u2192 D x)\n      ( \\ f \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n          ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x f)\n      ( \\ f \u2192\n        ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x f)\n      ( \\ f \u2192\n        is-natural-in-family-yon-twice-pointwise\n          A is-segal-A a C D is-covariant-C is-covariant-D \u03c8 u x f)\n#def is-natural-in-family-yon uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u =\n    ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 hom A a x \u2192 D x)\n      ( \\ x \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n          ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x)\n      ( \\ x \u2192\n        ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x)\n      ( \\ x \u2192\n        is-natural-in-family-yon-once-pointwise\n          A is-segal-A a C D is-covariant-C is-covariant-D \u03c8 u x)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#yoneda-for-contravariant-families","title":"Yoneda for contravariant families","text":"

Dually, the Yoneda lemma for contravariant type families characterizes natural transformations from the contravariant family represented by a term a : A in a Segal type to a contravariant type family C : A \u2192 U.

By naturality-contravariant-fiberwise-transformation naturality is again automatic.

#def naturality-contravariant-fiberwise-representable-transformation\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A y a)\n( g : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n  : ( contravariant-transport A x y g C is-contravariant-C (\u03d5 y f)) =\n    ( \u03d5 x (comp-is-segal A is-segal-A x y a g f))\n  :=\n    naturality-contravariant-fiberwise-transformation A x y g\n      ( \\ z \u2192 hom A z a) C\n      ( is-contravariant-representable-is-segal A is-segal-A a)\n      ( is-contravariant-C)\n      ( \u03d5)\n      ( f)\n

For any Segal type A and term a : A, the contravariant Yoneda lemma provides an equivalence between the type (z : A) \u2192 hom A z a \u2192 C z of natural transformations out of the functor \\ z \u2192 hom A z a and valued in an arbitrary contravariant family C and the type C a.

One of the maps in this equivalence is evaluation at the identity. The inverse map makes use of the contravariant transport operation.

The following map, contra-evid evaluates a natural transformation out of a representable functor at the identity arrow.

#def contra-evid\n( A : U)\n( a : A)\n( C : A \u2192 U)\n  : ( (z : A) \u2192 hom A z a \u2192 C z) \u2192 C a\n  := \\ \u03d5 \u2192 \u03d5 a (id-hom A a)\n

The inverse map only exists for Segal types and contravariant families.

#def contra-yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : C a \u2192 ((z : A) \u2192 hom A z a \u2192 C z)\n  := \\ v z f \u2192 contravariant-transport A z a f C is-contravariant-C v\n

It remains to show that the Yoneda maps are inverses. One retraction is straightforward:

#def contra-evid-yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C a)\n  : contra-evid A a C ((contra-yon A is-segal-A a C is-contravariant-C) v) = v\n  := id-arr-contravariant-transport A a C is-contravariant-C v\n

The other composite carries \u03d5 to an a priori distinct natural transformation. We first show that these are pointwise equal at all x : A and f : hom A x a in two steps.

#section contra-yon-evid\n#variable A : U\n#variable is-segal-A : is-segal A\n#variable a : A\n#variable C : A \u2192 U\n#variable is-contravariant-C : is-contravariant A C\n

The composite contra-yon-evid of \u03d5 equals \u03d5 at all x : A and f : hom A x a.

#def contra-yon-evid-twice-pointwise\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n( x : A)\n( f : hom A x a)\n  : ( (contra-yon A is-segal-A a C is-contravariant-C)\n        ((contra-evid A a C) \u03d5)) x f = \u03d5 x f\n  :=\n    concat\n      ( C x)\n      ( ((contra-yon A is-segal-A a C is-contravariant-C)\n            ((contra-evid A a C) \u03d5)) x f)\n      ( \u03d5 x (comp-is-segal A is-segal-A x a a f (id-hom A a)))\n      ( \u03d5 x f)\n      ( naturality-contravariant-fiberwise-representable-transformation\n          A is-segal-A a x a (id-hom A a) f C is-contravariant-C \u03d5)\n      ( ap\n        ( hom A x a)\n        ( C x)\n        ( comp-is-segal A is-segal-A x a a f (id-hom A a))\n        ( f)\n        ( \u03d5 x)\n        ( comp-id-is-segal A is-segal-A x a f))\n

By funext, these are equals as functions of f pointwise in x.

#def contra-yon-evid-once-pointwise uses (funext)\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n( x : A)\n  : ( (contra-yon A is-segal-A a C is-contravariant-C)\n        ( (contra-evid A a C) \u03d5)) x = \u03d5 x\n  :=\n    eq-htpy funext\n      ( hom A x a)\n      ( \\ f \u2192 C x)\n      ( \\ f \u2192\n        ( (contra-yon A is-segal-A a C is-contravariant-C)\n          ( (contra-evid A a C) \u03d5)) x f)\n      ( \\ f \u2192 (\u03d5 x f))\n      ( \\ f \u2192 contra-yon-evid-twice-pointwise \u03d5 x f)\n

By funext again, these are equal as functions of x and f.

#def contra-yon-evid uses (funext)\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n  : contra-yon A is-segal-A a C is-contravariant-C (contra-evid A a C \u03d5) = \u03d5\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 (hom A x a \u2192 C x))\n      ( contra-yon A is-segal-A a C is-contravariant-C (contra-evid A a C \u03d5))\n      ( \u03d5)\n      ( contra-yon-evid-once-pointwise \u03d5)\n#end contra-yon-evid\n

The contravariant Yoneda lemma says that evaluation at the identity defines an equivalence.

#def contra-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : is-equiv ((z : A) \u2192 hom A z a \u2192 C z) (C a) (contra-evid A a C)\n  :=\n    ( ( ( contra-yon A is-segal-A a C is-contravariant-C) ,\n        ( contra-yon-evid A is-segal-A a C is-contravariant-C)) ,\n      ( ( contra-yon A is-segal-A a C is-contravariant-C) ,\n        ( contra-evid-yon A is-segal-A a C is-contravariant-C)))\n

For later use, we observe that the same proof shows that the inverse map is an equivalence.

#def inv-contra-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : is-equiv (C a) ((z : A) \u2192 hom A z a \u2192 C z)\n      ( contra-yon A is-segal-A a C is-contravariant-C)\n  :=\n    ( ( ( contra-evid A a C) ,\n        ( contra-evid-yon A is-segal-A a C is-contravariant-C)) ,\n      ( ( contra-evid A a C) ,\n        ( contra-yon-evid A is-segal-A a C is-contravariant-C)))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#contravariant-naturality","title":"Contravariant Naturality","text":"

The equivalence of the Yoneda lemma is natural in both a : A and C : A \u2192 U.

Naturality in a follows from the fact that the maps evid and yon are fiberwise equivalences between contravariant families over A, though it requires some work, which has not yet been formalized, to prove that the domain is contravariant.

Naturality in C is not automatic but can be proven easily:

RS17, Lemma 9.2(i), dual
#def is-natural-in-family-contra-evid\n( A : U)\n( a : A)\n( C D : A \u2192 U)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( \u03c6 : (z : A) \u2192 hom A z a \u2192 C z)\n  : ( comp ((z : A) \u2192 hom A z a \u2192 C z) (C a) (D a)\n      ( \u03c8 a) (contra-evid A a C)) \u03c6 =\n( comp ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z) (D a)\n      ( contra-evid A a D) ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))) \u03c6\n  := refl\n
RS17, Lemma 9.2(ii), dual
#def is-natural-in-family-contra-yon-twice-pointwise\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n( f : hom A x a)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x f =\n    ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n      ( contra-yon A is-segal-A a C is-contravariant-C)) u x f\n  :=\n    naturality-contravariant-fiberwise-transformation\n      A x a f C D is-contravariant-C is-contravariant-D \u03c8 u\n#def is-natural-in-family-contra-yon-once-pointwise uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n      (contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x =\n    ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n      (\\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n      (contra-yon A is-segal-A a C is-contravariant-C)) u x\n  :=\n    eq-htpy funext\n      ( hom A x a)\n      ( \\ f \u2192 D x)\n      ( \\ f \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n          ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x f)\n      ( \\ f \u2192\n        ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n        ( contra-yon A is-segal-A a C is-contravariant-C)) u x f)\n      ( \\ f \u2192\n        is-natural-in-family-contra-yon-twice-pointwise\n          A is-segal-A a C D is-contravariant-C is-contravariant-D \u03c8 u x f)\n#def is-natural-in-family-contra-yon uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u =\n    ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n      ( contra-yon A is-segal-A a C is-contravariant-C)) u\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 hom A x a \u2192 D x)\n      ( \\ x \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n          ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x)\n      ( \\ x \u2192\n        ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n        ( contra-yon A is-segal-A a C is-contravariant-C)) u x)\n      ( \\ x \u2192\n        is-natural-in-family-contra-yon-once-pointwise\n          A is-segal-A a C D is-contravariant-C is-contravariant-D \u03c8 u x)\n

From a type-theoretic perspective, the Yoneda lemma is a \u201cdirected\u201d version of the \u201ctransport\u201d operation for identity types. This suggests a \u201cdependently typed\u201d generalization of the Yoneda lemma, analogous to the full induction principle for identity types. We prove this as a special case of a result about covariant families over a type with an initial object.

"},{"location":"simplicial-hott/09-yoneda.rzk/#initial-objects","title":"Initial objects","text":"

A term a in a type A is initial if all of its mapping-out hom types are contractible.

RS17, Definition 9.6
#def is-initial\n( A : U)\n( a : A)\n  : U\n  := ( x : A) \u2192 is-contr (hom A a x)\n

Initial objects satisfy an induction principle relative to covariant families.

#section initial-evaluation-equivalence\n#variable A : U\n#variable a : A\n#variable is-initial-a : is-initial A a\n#variable C : A \u2192 U\n#variable is-covariant-C : is-covariant A C\n#def arrows-from-initial\n( x : A)\n  : hom A a x\n  := center-contraction (hom A a x) (is-initial-a x)\n#def identity-component-arrows-from-initial\n  : arrows-from-initial a = id-hom A a\n  := homotopy-contraction (hom A a a) (is-initial-a a) (id-hom A a)\n#def ind-initial uses (is-initial-a)\n( u : C a)\n  : ( x : A) \u2192 C x\n  :=\n\\ x \u2192 covariant-transport A a x (arrows-from-initial x) C is-covariant-C u\n#def has-cov-section-ev-pt uses (is-initial-a)\n  : has-section ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ind-initial) ,\n      ( \\ u \u2192\n        concat\n          ( C a)\n          ( covariant-transport A a a\n            ( arrows-from-initial a) C is-covariant-C u)\n          ( covariant-transport A a a\n            ( id-hom A a) C is-covariant-C u)\n          ( u)\n          ( ap\n            ( hom A a a)\n            ( C a)\n            ( arrows-from-initial a)\n            ( id-hom A a)\n            ( \\ f \u2192\n              covariant-transport A a a f C is-covariant-C u)\n            ( identity-component-arrows-from-initial))\n          ( id-arr-covariant-transport A a C is-covariant-C u)))\n#def ind-initial-ev-pt-pointwise uses (is-initial-a)\n( s : (x : A) \u2192 C x)\n( b : A)\n  : ind-initial (ev-pt A a C s) b = s b\n  :=\n    covariant-uniqueness\n      ( A)\n      ( a)\n      ( b)\n      ( arrows-from-initial b)\n      ( C)\n      ( is-covariant-C)\n      ( ev-pt A a C s)\n      ( ( s b , \\ t \u2192 s (arrows-from-initial b t)))\n#end initial-evaluation-equivalence\n

We now prove that induction from an initial element in the base of a covariant family defines an inverse equivalence to evaluation at the element.

RS17, Theorem 9.7
#def is-equiv-covariant-ev-initial uses (funext)\n( A : U)\n( a : A)\n( is-initial-a : is-initial A a)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-equiv ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ( ind-initial A a is-initial-a C is-covariant-C) ,\n        ( \\ s \u2192 eq-htpy\n                  funext\n                    ( A)\n                    ( C)\n                    ( ind-initial\n                        A a is-initial-a C is-covariant-C (ev-pt A a C s))\n                    ( s)\n                    ( ind-initial-ev-pt-pointwise\n                        A a is-initial-a C is-covariant-C s))) ,\n      ( has-cov-section-ev-pt A a is-initial-a C is-covariant-C))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#initial-objects-in-slice-categories","title":"Initial objects in slice categories","text":"

Recall that the type coslice A a is the type of arrows in A with domain a.

We now show that the coslice under a in a Segal type A has an initial object given by the identity arrow at a. This makes use of the following equivalence.

#def equiv-hom-in-coslice\n( A : U)\n( a x : A)\n( f : hom A a x)\n  : Equiv\n    ( hom (coslice A a) (a , id-hom A a) (x , f))\n( (t : \u0394\u00b9) \u2192 hom A a (f t) [t \u2261 0\u2082 \u21a6 id-hom A a])\n  :=\n    ( \\ h t s \u2192 (second (h s)) t ,\n      (( \\ k s \u2192 ( k 1\u2082 s , \\ t \u2192 k t s) ,\n\\ h \u2192 refl) ,\n      ( \\ k s \u2192 ( k 1\u2082 s , \\ t \u2192 k t s) ,\n\\ k \u2192 refl)))\n

Since hom A a is covariant when A is Segal, this latter type is contractible.

#def is-contr-is-segal-hom-in-coslice\n( A : U)\n( is-segal-A : is-segal A)\n( a x : A)\n( f : hom A a x)\n  : is-contr ( (t : \u0394\u00b9) \u2192 hom A a (f t) [t \u2261 0\u2082 \u21a6 id-hom A a])\n  :=\n    ( second (has-unique-fixed-domain-lifts-iff-is-covariant\n                A (\\ z \u2192 hom A a z)))\n      ( is-covariant-representable-is-segal A is-segal-A a)\n      ( a)\n      ( x)\n      ( f)\n      ( id-hom A a)\n

This proves the initiality of identity arrows in the coslice of a Segal type.

RS17, Lemma 9.8
#def is-initial-id-hom-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n  : is-initial (coslice A a) (a , id-hom A a)\n  :=\n    \\ (x , f) \u2192\n    is-contr-equiv-is-contr'\n      ( hom (coslice A a) (a , id-hom A a) (x , f))\n( (t : \u0394\u00b9) \u2192 hom A a (f t) [t \u2261 0\u2082 \u21a6 id-hom A a])\n      ( equiv-hom-in-coslice A a x f)\n      ( is-contr-is-segal-hom-in-coslice A is-segal-A a x f)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#dependent-yoneda-lemma","title":"Dependent Yoneda lemma","text":"

The dependent Yoneda lemma now follows by specializing these results.

#def dependent-evid\n( A : U)\n( a : A)\n( C : (coslice A a) \u2192 U)\n  : ( (p : coslice A a) \u2192 C p) \u2192 C (a , id-hom A a)\n  := \\ s \u2192 s (a , id-hom A a)\n#def dependent-yoneda-lemma' uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (coslice A a) \u2192 U)\n( is-covariant-C : is-covariant (coslice A a) C)\n  : is-equiv\n( (p : coslice A a) \u2192 C p)\n      ( C (a , id-hom A a))\n      ( dependent-evid A a C)\n  :=\n    is-equiv-covariant-ev-initial\n      ( coslice A a)\n      ( (a , id-hom A a))\n      ( is-initial-id-hom-is-segal A is-segal-A a)\n      ( C)\n      ( is-covariant-C)\n

The actual dependent Yoneda is equivalent to the result just proven, just with an equivalent type in the domain of the evaluation map.

RS17, Theorem 9.5
#def dependent-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (coslice A a) \u2192 U)\n( is-covariant-C : is-covariant (coslice A a) C)\n  : is-equiv\n( (x : A) \u2192 (f : hom A a x) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( \\ s \u2192 s a (id-hom A a))\n  :=\n    is-equiv-left-factor\n( (p : coslice A a) \u2192 C p)\n( (x : A) \u2192 (f : hom A a x) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( first (equiv-dependent-curry A (\\ z \u2192 hom A a z) (\\ x f \u2192 C (x , f))))\n      ( second (equiv-dependent-curry A (\\ z \u2192 hom A a z) (\\ x f \u2192 C (x , f))))\n      ( \\ s \u2192 s a (id-hom A a))\n      ( dependent-yoneda-lemma' A is-segal-A a C is-covariant-C)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#final-objects","title":"Final objects","text":"

A term a in a type A is initial if all of its mapping-out hom types are contractible.

#def is-final\n( A : U)\n( a : A)\n  : U\n  := (x : A) \u2192 is-contr (hom A x a)\n

Final objects satisfy an induction principle relative to contravariant families.

#section final-evaluation-equivalence\n#variable A : U\n#variable a : A\n#variable is-final-a : is-final A a\n#variable C : A \u2192 U\n#variable is-contravariant-C : is-contravariant A C\n#def arrows-to-final\n( x : A)\n  : hom A x a\n  := center-contraction (hom A x a) (is-final-a x)\n#def identity-component-arrows-to-final\n  : arrows-to-final a = id-hom A a\n  := homotopy-contraction (hom A a a) (is-final-a a) (id-hom A a)\n#def ind-final uses (is-final-a)\n( u : C a)\n  : ( x : A) \u2192 C x\n  :=\n\\ x \u2192\n    contravariant-transport A x a (arrows-to-final x) C is-contravariant-C u\n#def has-contra-section-ev-pt uses (is-final-a)\n  : has-section ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ind-final) ,\n      ( \\ u \u2192\n        concat\n          ( C a)\n          ( contravariant-transport A a a\n            ( arrows-to-final a) C is-contravariant-C u)\n          ( contravariant-transport A a a\n            ( id-hom A a) C is-contravariant-C u)\n          ( u)\n          ( ap\n            ( hom A a a)\n            ( C a)\n            ( arrows-to-final a)\n            ( id-hom A a)\n            ( \\ f \u2192\n              contravariant-transport A a a f C is-contravariant-C u)\n            ( identity-component-arrows-to-final))\n          ( id-arr-contravariant-transport A a C is-contravariant-C u)))\n#def ind-final-ev-pt-pointwise uses (is-final-a)\n( s : (x : A) \u2192 C x)\n( b : A)\n  : ind-final (ev-pt A a C s) b = s b\n  :=\n    contravariant-uniqueness\n      ( A)\n      ( b)\n      ( a)\n      ( arrows-to-final b)\n      ( C)\n      ( is-contravariant-C)\n      ( ev-pt A a C s)\n      ( ( s b , \\ t \u2192 s (arrows-to-final b t)))\n#end final-evaluation-equivalence\n

We now prove that induction from a final element in the base of a contravariant family defines an inverse equivalence to evaluation at the element.

RS17, Theorem 9.7, dual
#def is-equiv-contravariant-ev-final uses (funext)\n( A : U)\n( a : A)\n( is-final-a : is-final A a)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : is-equiv ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ( ind-final A a is-final-a C is-contravariant-C) ,\n        ( \\ s \u2192 eq-htpy\n                  funext\n                    ( A)\n                    ( C)\n                    ( ind-final\n                        A a is-final-a C is-contravariant-C (ev-pt A a C s))\n                    ( s)\n                    ( ind-final-ev-pt-pointwise\n                        A a is-final-a C is-contravariant-C s))) ,\n      ( has-contra-section-ev-pt A a is-final-a C is-contravariant-C))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#final-objects-in-slice-categories","title":"Final objects in slice categories","text":"

Recall that the type slice A a is the type of arrows in A with codomain a.

We now show that the slice over a in a Segal type A has a final object given by the identity arrow at a. This makes use of the following equivalence.

#def equiv-hom-in-slice\n( A : U)\n( a x : A)\n( f : hom A x a)\n  : Equiv\n    ( hom (slice A a) (x , f) (a , id-hom A a))\n( (t : \u0394\u00b9) \u2192 hom A (f t) a [t \u2261 1\u2082 \u21a6 id-hom A a])\n  :=\n    ( \\ h t s \u2192 (second (h s)) t ,\n      (( \\ k s \u2192 ( k 0\u2082 s , \\ t \u2192 k t s) ,\n\\ h \u2192 refl) ,\n      ( \\ k s \u2192 ( k 0\u2082 s , \\ t \u2192 k t s) ,\n\\ k \u2192 refl)))\n

Since \\ z \u2192 hom A z a is contravariant when A is Segal, this latter type is contractible.

#def is-contr-is-segal-hom-in-slice\n( A : U)\n( is-segal-A : is-segal A)\n( a x : A)\n( f : hom A x a)\n  : is-contr ( (t : \u0394\u00b9) \u2192 hom A (f t) a [t \u2261 1\u2082 \u21a6 id-hom A a])\n  :=\n    ( second (has-unique-fixed-codomain-lifts-iff-is-contravariant\n                A (\\ z \u2192 hom A z a)))\n      ( is-contravariant-representable-is-segal A is-segal-A a)\n      ( x)\n      ( a)\n      ( f)\n      ( id-hom A a)\n

This proves the finality of identity arrows in the slice of a Segal type.

RS17, Lemma 9.8, dual
#def is-final-id-hom-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n  : is-final (slice A a) (a , id-hom A a)\n  :=\n    \\ (x , f) \u2192\n    is-contr-equiv-is-contr'\n      ( hom (slice A a) (x , f) (a , id-hom A a))\n( (t : \u0394\u00b9) \u2192 hom A (f t) a [t \u2261 1\u2082 \u21a6 id-hom A a])\n      ( equiv-hom-in-slice A a x f)\n      ( is-contr-is-segal-hom-in-slice A is-segal-A a x f)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#contravariant-dependent-yoneda-lemma","title":"Contravariant Dependent Yoneda lemma","text":"

The contravariant version of the dependent Yoneda lemma now follows by specializing these results.

#def contra-dependent-evid\n( A : U)\n( a : A)\n( C : (slice A a) \u2192 U)\n  : ((p : slice A a) \u2192 C p) \u2192 C (a , id-hom A a)\n  := \\ s \u2192 s (a , id-hom A a)\n#def contra-dependent-yoneda-lemma' uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (slice A a) \u2192 U)\n( is-contravariant-C : is-contravariant (slice A a) C)\n  : is-equiv\n( (p : slice A a) \u2192 C p)\n      ( C (a , id-hom A a))\n      ( contra-dependent-evid A a C)\n  :=\n    is-equiv-contravariant-ev-final\n      ( slice A a)\n      ( (a , id-hom A a))\n      ( is-final-id-hom-is-segal A is-segal-A a)\n      ( C)\n      ( is-contravariant-C)\n

The actual contravariant dependent Yoneda is equivalent to the result just proven, just with an equivalent type in the domain of the evaluation map.

RS17, Theorem 9.5, dual
#def contra-dependent-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (slice A a) \u2192 U)\n( is-contravariant-C : is-contravariant (slice A a) C)\n  : is-equiv\n( (x : A) \u2192 (f : hom A x a) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( \\ s \u2192 s a (id-hom A a))\n  :=\n    is-equiv-left-factor\n( (p : slice A a) \u2192 C p)\n( (x : A) \u2192 (f : hom A x a) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( first (equiv-dependent-curry A (\\ z \u2192 hom A z a) (\\ x f \u2192 C (x , f))))\n      ( second (equiv-dependent-curry A (\\ z \u2192 hom A z a) (\\ x f \u2192 C (x , f))))\n      ( \\ s \u2192 s a (id-hom A a))\n      ( contra-dependent-yoneda-lemma'\n          A is-segal-A a C is-contravariant-C)\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/","title":"Rezk types","text":"

This is a literate rzk file:

#lang rzk-1\n

Some of the definitions in this file rely on function extensionality, extension extensionality and weak function extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n#assume weakfunext : WeakFunExt\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#isomorphisms","title":"Isomorphisms","text":"
#def has-retraction-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n  : U\n  := ( comp-is-segal A is-segal-A x y x f g) =_{hom A x x} (id-hom A x)\n#def Retraction-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : U\n  := \u03a3 ( g : hom A y x) , ( has-retraction-arrow A is-segal-A x y f g)\n#def has-section-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( h : hom A y x)\n  : U\n  := ( comp-is-segal A is-segal-A y x y h f) =_{hom A y y} (id-hom A y)\n#def Section-arrow\n(A : U)\n(is-segal-A : is-segal A)\n(x y : A)\n(f : hom A x y)\n  : U\n  := \u03a3 (h : hom A y x) , (has-section-arrow A is-segal-A x y f h)\n#def is-iso-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : U\n  :=\n    product\n    ( Retraction-arrow A is-segal-A x y f)\n    ( Section-arrow A is-segal-A x y f)\n#def Iso\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n  : U\n  := \u03a3 ( f : hom A x y) , is-iso-arrow A is-segal-A x y f\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#invertible-arrows","title":"Invertible arrows","text":"

We now show that f : hom A a x is an isomorphism if and only if it is invertible, meaning f has a two-sided composition inverse g : hom A x a.

#def has-inverse-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : U\n  :=\n\u03a3 ( g : hom A y x) ,\n      product\n      ( has-retraction-arrow A is-segal-A x y f g)\n      ( has-section-arrow A is-segal-A x y f g)\n#def is-iso-arrow-has-inverse-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : ( has-inverse-arrow A is-segal-A x y f) \u2192 (is-iso-arrow A is-segal-A x y f)\n  :=\n    ( \\ (g , (p , q)) \u2192 ((g , p) , (g , q)))\n#def has-inverse-arrow-is-iso-arrow uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (is-iso-arrow A is-segal-A x y f) \u2192 (has-inverse-arrow A is-segal-A x y f)\n  :=\n    ( \\ ((g , p) , (h , q)) \u2192\n      ( g ,\n        ( p ,\n          ( concat\n            ( hom A y y)\n            ( comp-is-segal A is-segal-A y x y g f)\n            ( comp-is-segal A is-segal-A y x y h f)\n            ( id-hom A y)\n            ( postwhisker-homotopy-is-segal A is-segal-A y x y g h f\n              ( alternating-quintuple-concat\n                ( hom A y x)\n                ( g)\n                ( comp-is-segal A is-segal-A y y x (id-hom A y) g)\n                ( rev\n                  ( hom A y x)\n                  ( comp-is-segal A is-segal-A y y x (id-hom A y) g)\n                  ( g)\n                  ( id-comp-is-segal A is-segal-A y x g))\n                ( comp-is-segal A is-segal-A y y x\n                  ( comp-is-segal A is-segal-A y x y h f) ( g))\n                ( postwhisker-homotopy-is-segal A is-segal-A y y x\n                  ( id-hom A y)\n                  ( comp-is-segal A is-segal-A y x y h f)\n                  ( g)\n                  ( rev\n                    ( hom A y y)\n                    ( comp-is-segal A is-segal-A y x y h f)\n                    ( id-hom A y)\n                    ( q)))\n                ( comp-is-segal A is-segal-A y x x\n                  ( h)\n                  ( comp-is-segal A is-segal-A x y x f g))\n                ( associative-is-segal extext A is-segal-A y x y x h f g)\n                ( comp-is-segal A is-segal-A y x x h (id-hom A x))\n                ( prewhisker-homotopy-is-segal A is-segal-A y x x h\n                  ( comp-is-segal A is-segal-A x y x f g)\n                  ( id-hom A x) p)\n                ( h)\n                ( comp-id-is-segal A is-segal-A y x h)))\n            ( q)))))\n
RS17, Proposition 10.1
#def inverse-iff-iso-arrow uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : iff (has-inverse-arrow A is-segal-A x y f) (is-iso-arrow A is-segal-A x y f)\n  :=\n    ( is-iso-arrow-has-inverse-arrow A is-segal-A x y f ,\n      has-inverse-arrow-is-iso-arrow A is-segal-A x y f)\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#being-an-isomorphism-is-a-proposition","title":"Being an isomorphism is a proposition","text":"

The predicate is-iso-arrow is a proposition.

#def has-retraction-postcomp-has-retraction uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n  : ( z : A) \u2192\n    has-retraction (hom A z x) (hom A z y)\n      ( postcomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( postcomp-is-segal A is-segal-A y x g z) ,\n\\ k \u2192\n      ( triple-concat\n        ( hom A z x)\n        ( comp-is-segal A is-segal-A z y x\n          ( comp-is-segal A is-segal-A z x y k f) g)\n        ( comp-is-segal A is-segal-A z x x\n          k ( comp-is-segal A is-segal-A x y x f g))\n        ( comp-is-segal A is-segal-A z x x k (id-hom A x))\n        ( k)\n        ( associative-is-segal extext A is-segal-A z x y x k f g)\n        ( prewhisker-homotopy-is-segal A is-segal-A z x x k\n          ( comp-is-segal A is-segal-A x y x f g) (id-hom A x) gg)\n        ( comp-id-is-segal A is-segal-A z x k)))\n#def has-section-postcomp-has-section uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : ( z : A) \u2192\n    has-section (hom A z x) (hom A z y) (postcomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( postcomp-is-segal A is-segal-A y x h z) ,\n\\ k \u2192\n        ( triple-concat\n          ( hom A z y)\n          ( comp-is-segal A is-segal-A z x y\n            ( comp-is-segal A is-segal-A z y x k h) f)\n          ( comp-is-segal A is-segal-A z y y\n            k (comp-is-segal A is-segal-A y x y h f))\n          ( comp-is-segal A is-segal-A z y y k (id-hom A y))\n          ( k)\n          ( associative-is-segal extext A is-segal-A z y x y k h f)\n          ( prewhisker-homotopy-is-segal A is-segal-A z y y k\n            ( comp-is-segal A is-segal-A y x y h f) (id-hom A y) hh)\n          ( comp-id-is-segal A is-segal-A z y k)))\n#def is-equiv-postcomp-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : (z : A) \u2192\n    is-equiv (hom A z x) (hom A z y) (postcomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( has-retraction-postcomp-has-retraction A is-segal-A x y f g gg z) ,\n      ( has-section-postcomp-has-section A is-segal-A x y f h hh z))\n#def has-retraction-precomp-has-section uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : (z : A) \u2192\n    has-retraction (hom A y z) (hom A x z)\n      ( precomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( precomp-is-segal A is-segal-A y x h z) ,\n\\ k \u2192\n        ( triple-concat\n          ( hom A y z)\n          ( comp-is-segal A is-segal-A y x z\n            h (comp-is-segal A is-segal-A x y z f k))\n          ( comp-is-segal A is-segal-A y y z\n            ( comp-is-segal A is-segal-A y x y h f) k)\n          ( comp-is-segal A is-segal-A y y z (id-hom A y) k)\n          ( k)\n          ( rev\n            ( hom A y z)\n            ( comp-is-segal A is-segal-A y y z\n              ( comp-is-segal A is-segal-A y x y h f) k)\n            ( comp-is-segal A is-segal-A y x z\n              h (comp-is-segal A is-segal-A x y z f k))\n            ( associative-is-segal extext A is-segal-A y x y z h f k))\n          ( postwhisker-homotopy-is-segal A is-segal-A y y z\n            ( comp-is-segal A is-segal-A y x y h f)\n            ( id-hom A y) k hh)\n          ( id-comp-is-segal A is-segal-A y z k)\n        )\n    )\n#def has-section-precomp-has-retraction uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n  : (z : A) \u2192\n    has-section (hom A y z) (hom A x z) (precomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( precomp-is-segal A is-segal-A y x g z) ,\n\\ k \u2192\n        ( triple-concat\n          ( hom A x z)\n          ( comp-is-segal A is-segal-A x y z\n            f (comp-is-segal A is-segal-A y x z g k))\n          ( comp-is-segal A is-segal-A x x z\n            ( comp-is-segal A is-segal-A x y x f g) k)\n          ( comp-is-segal A is-segal-A x x z\n            ( id-hom A x) k)\n          ( k)\n          ( rev\n            ( hom A x z)\n            ( comp-is-segal A is-segal-A x x z\n              ( comp-is-segal A is-segal-A x y x f g) k)\n            ( comp-is-segal A is-segal-A x y z\n              f (comp-is-segal A is-segal-A y x z g k))\n            ( associative-is-segal extext A is-segal-A x y x z f g k))\n          ( postwhisker-homotopy-is-segal A is-segal-A x x z\n            ( comp-is-segal A is-segal-A x y x f g)\n            ( id-hom A x)\n            ( k)\n            ( gg))\n          ( id-comp-is-segal A is-segal-A x z k)))\n#def is-equiv-precomp-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : (z : A) \u2192\n    is-equiv (hom A y z) (hom A x z) (precomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n      ( ( has-retraction-precomp-has-section A is-segal-A x y f h hh z) ,\n        ( has-section-precomp-has-retraction A is-segal-A x y f g gg z))\n#def is-contr-Retraction-arrow-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : is-contr (Retraction-arrow A is-segal-A x y f)\n  :=\n    ( is-contr-map-is-equiv\n      ( hom A y x)\n      ( hom A x x)\n      ( precomp-is-segal A is-segal-A x y f x)\n      ( is-equiv-precomp-is-iso A is-segal-A x y f g gg h hh x))\n    ( id-hom A x)\n#def is-contr-Section-arrow-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : is-contr (Section-arrow A is-segal-A x y f)\n  :=\n    ( is-contr-map-is-equiv\n      ( hom A y x)\n      ( hom A y y)\n      ( postcomp-is-segal A is-segal-A x y f y)\n      ( is-equiv-postcomp-is-iso A is-segal-A x y f g gg h hh y))\n    ( id-hom A y)\n#def is-contr-is-iso-arrow-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : is-contr (is-iso-arrow A is-segal-A x y f)\n  :=\n    ( is-contr-product\n      ( Retraction-arrow A is-segal-A x y f)\n      ( Section-arrow A is-segal-A x y f)\n      ( is-contr-Retraction-arrow-is-iso A is-segal-A x y f g gg h hh)\n      ( is-contr-Section-arrow-is-iso A is-segal-A x y f g gg h hh))\n
RS17, Proposition 10.2
#def is-prop-is-iso-arrow uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (is-prop (is-iso-arrow A is-segal-A x y f))\n  :=\n    ( is-prop-is-contr-is-inhabited\n      ( is-iso-arrow A is-segal-A x y f)\n      ( \\ is-isof \u2192\n        ( is-contr-is-iso-arrow-is-iso A is-segal-A x y f\n          ( first (first is-isof))\n          ( second (first is-isof))\n          ( first (second is-isof))\n          ( second (second is-isof)))))\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#isomorphism-extensionality","title":"Isomorphism extensionality","text":"RS17, Proposition 10.3
#def ev-components-nat-trans-preserves-iso uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : ( is-iso-arrow\n      ( (x : X) \u2192 A x)\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1) \u2192\n( x : X) \u2192\n    ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n      ( ev-components-nat-trans X A f g \u03b1 x))\n  :=\n    \\ ((\u03b2 , p) , (\u03b3 , q)) \u2192\n\\ x \u2192\n    ( ( ( ev-components-nat-trans X A g f \u03b2 x) ,\n        ( triple-concat\n          ( hom (A x) (f x) (f x))\n          ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n            ( ev-components-nat-trans X A f g \u03b1 x)\n            ( ev-components-nat-trans X A g f \u03b2 x))\n( ev-components-nat-trans X A f f\n            ( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) f g f \u03b1 \u03b2)\n            ( x))\n( ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 (A x')) f) x)\n          ( id-hom (A x) (f x))\n          ( comp-components-comp-nat-trans-is-segal\n            funext X A is-segal-A f g f \u03b1 \u03b2 x)\n          ( ap\n            ( nat-trans X A f f)\n            ( hom (A x) (f x) (f x))\n( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) f g f \u03b1 \u03b2)\n( id-hom ((x' : X) \u2192 (A x')) f)\n            (\\ \u03b1' \u2192 ev-components-nat-trans X A f f \u03b1' x)\n            ( p))\n          ( id-arr-components-id-nat-trans X A f x))) ,\n      ( ( ev-components-nat-trans X A g f \u03b3 x) ,\n        ( triple-concat\n          (hom (A x) (g x) (g x))\n          ( comp-is-segal (A x) (is-segal-A x) (g x) (f x) (g x)\n            ( ev-components-nat-trans X A g f \u03b3 x)\n            ( ev-components-nat-trans X A f g \u03b1 x))\n( ev-components-nat-trans X A g g\n            ( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) g f g \u03b3 \u03b1)\n            ( x))\n( ev-components-nat-trans X A g g (id-hom ((x' : X) \u2192 (A x')) g) x)\n          ( id-hom (A x) (g x))\n          ( comp-components-comp-nat-trans-is-segal\n            funext X A is-segal-A g f g \u03b3 \u03b1 x)\n          ( ap\n            ( nat-trans X A g g)\n            ( hom (A x) (g x) (g x))\n( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) g f g \u03b3 \u03b1)\n( id-hom ((x' : X) \u2192 (A x')) g)\n            ( \\ \u03b1' \u2192 ev-components-nat-trans X A g g \u03b1' x)\n            ( q))\n          ( id-arr-components-id-nat-trans X A g x))))\n#def nat-trans-nat-trans-components-preserves-iso-helper uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n( \u03b2 : nat-trans X A g f)\n  : ( ( x : X) \u2192\n      ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n        ( ev-components-nat-trans X A f g \u03b1 x)\n        ( ev-components-nat-trans X A g f \u03b2 x)) =\n      (id-hom (A x) (f x))) \u2192\n( comp-is-segal\n      ( (x' : X) \u2192 A x')\n      ( is-segal-function-type funext X A is-segal-A)\n      f g f \u03b1 \u03b2) =\n(id-hom ((x' : X) \u2192 A x') f)\n  :=\n\\ H \u2192\n    ap\n      ( nat-trans-components X A f f)\n      ( nat-trans X A f f)\n( \\ x \u2192\n        ev-components-nat-trans X A f f\n          ( comp-is-segal\n            ( (x' : X) \u2192 A x')\n            ( is-segal-function-type funext X A is-segal-A)\n            f g f \u03b1 \u03b2)\n          ( x))\n( \\ x \u2192 ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 A x') f) x)\n( first\n        ( has-inverse-is-equiv\n          ( hom ((x' : X) \u2192 A x') f f)\n( (x : X) \u2192 hom (A x) (f x) (f x))\n          ( ev-components-nat-trans X A f f)\n          ( is-equiv-ev-components-nat-trans X A f f)))\n      ( eq-htpy funext X\n        ( \\ x \u2192 (hom (A x) (f x) (f x)))\n( \\ x \u2192\n          ( ev-components-nat-trans X A f f\n            ( comp-is-segal\n              ( (x' : X) \u2192 A x')\n              ( is-segal-function-type funext X A is-segal-A)\n              f g f \u03b1 \u03b2)\n            ( x)))\n        ( \\ x \u2192 (id-hom (A x) (f x)))\n        ( \\ x \u2192\n          ( triple-concat\n            ( hom (A x) (f x) (f x))\n( ev-components-nat-trans X A f f\n              ( comp-is-segal\n                ( (x' : X) \u2192 A x')\n                ( is-segal-function-type funext X A is-segal-A)\n                f g f \u03b1 \u03b2)\n              ( x))\n            ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n              ( ev-components-nat-trans X A f g \u03b1 x)\n              ( ev-components-nat-trans X A g f \u03b2 x))\n            ( id-hom (A x) (f x))\n( ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 A x') f) x)\n            ( rev\n              (hom (A x) (f x) (f x))\n              ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n                ( ev-components-nat-trans X A f g \u03b1 x)\n                ( ev-components-nat-trans X A g f \u03b2 x))\n( ev-components-nat-trans X A f f\n                ( comp-is-segal\n                  ( (x' : X) \u2192 A x')\n                  ( is-segal-function-type funext X A is-segal-A)\n                  f g f \u03b1 \u03b2)\n                ( x))\n              ( comp-components-comp-nat-trans-is-segal\n                funext X A is-segal-A f g f \u03b1 \u03b2 x))\n            ( H x)\n            ( rev\n              ( hom (A x) (f x) (f x))\n( ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 A x') f) x)\n              ( id-hom (A x) (f x))\n              ( id-arr-components-id-nat-trans X A f x)))))\n#def nat-trans-nat-trans-components-preserves-iso uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : ( ( x : X) \u2192\n      ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n        ( ev-components-nat-trans X A f g \u03b1 x))) \u2192\n( is-iso-arrow\n      ( (x' : X) \u2192 A x')\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n  :=\n\\ H \u2192\n    ( ( \\ t x \u2192 (first (first (H x))) t ,\n        nat-trans-nat-trans-components-preserves-iso-helper X A is-segal-A f g\n          ( \u03b1)\n          ( \\ t x \u2192 (first (first (H x))) t)\n          ( \\ x \u2192 (second (first (H x))))) ,\n      ( \\ t x \u2192 (first (second (H x))) t ,\n        nat-trans-nat-trans-components-preserves-iso-helper X A is-segal-A g f\n          ( \\ t x \u2192 (first (second (H x))) t)\n          ( \u03b1)\n          ( \\ x \u2192 (second (second (H x))))))\n#def iff-is-iso-pointwise-is-iso uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : iff\n( is-iso-arrow\n      ( (x : X) \u2192 A x)\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n( ( x : X) \u2192\n        ( is-iso-arrow\n          ( A x)\n          ( is-segal-A x)\n          ( f x)\n          ( g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n  :=\n    ( ev-components-nat-trans-preserves-iso X A is-segal-A f g \u03b1,\n      nat-trans-nat-trans-components-preserves-iso X A is-segal-A f g \u03b1)\n#def equiv-is-iso-pointwise-is-iso uses (extext funext weakfunext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : Equiv\n( is-iso-arrow\n      ( (x : X) \u2192 A x)\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n( ( x : X) \u2192\n        ( is-iso-arrow\n          ( A x)\n          ( is-segal-A x)\n          ( f x)\n          ( g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n  :=\n    equiv-iff-is-prop-is-prop\n( is-iso-arrow\n        ( (x : X) \u2192 A x)\n        ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n( ( x : X) \u2192\n        ( is-iso-arrow\n          ( A x)\n          ( is-segal-A x)\n          ( f x)\n          ( g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n( is-prop-is-iso-arrow\n        ( (x : X) \u2192 A x)\n        ( is-segal-function-type funext X A is-segal-A)\n        ( f)\n        ( g)\n        ( \u03b1))\n      ( is-prop-fiberwise-prop funext weakfunext\n        ( X)\n        ( \\ x \u2192\n          ( is-iso-arrow\n            ( A x)\n            ( is-segal-A x)\n            ( f x)\n            ( g x)\n            ( ev-components-nat-trans X A f g \u03b1 x)))\n        ( \\ x \u2192\n          is-prop-is-iso-arrow\n            ( A x)\n            ( is-segal-A x)\n            ( f x)\n            ( g x)\n            ( ev-components-nat-trans X A f g \u03b1 x)))\n      ( iff-is-iso-pointwise-is-iso X A is-segal-A f g \u03b1)\n
RS17, Corollary 10.4
#def iso-extensionality uses (extext funext weakfunext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n  : Equiv\n( Iso ((x : X) \u2192 A x) (is-segal-function-type funext X A is-segal-A) f g)\n( ( x : X) \u2192 Iso (A x) (is-segal-A x) (f x) (g x))\n  :=\n    equiv-triple-comp\n( Iso ((x : X) \u2192 A x) (is-segal-function-type funext X A is-segal-A) f g)\n( \u03a3 ( \u03b1 : nat-trans X A f g) ,\n( x : X) \u2192\n        ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n( \u03a3 ( \u03b1' : nat-trans-components X A f g) ,\n( x : X) \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) (\u03b1' x))\n( (x : X) \u2192 Iso (A x) (is-segal-A x) (f x) (g x))\n      ( total-equiv-family-equiv\n        ( nat-trans X A f g)\n( \\ \u03b1 \u2192\n          ( is-iso-arrow\n            ( (x : X) \u2192 A x)\n            ( is-segal-function-type funext X A is-segal-A)\n            f g \u03b1))\n( \\ \u03b1 \u2192\n          ( x : X) \u2192\n          ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n            ( ev-components-nat-trans X A f g \u03b1 x)))\n        ( \\ \u03b1 \u2192 equiv-is-iso-pointwise-is-iso X A is-segal-A f g \u03b1))\n      ( total-equiv-pullback-is-equiv\n        ( nat-trans X A f g)\n        ( nat-trans-components X A f g)\n        ( ev-components-nat-trans X A f g)\n        ( is-equiv-ev-components-nat-trans X A f g)\n( \\ \u03b1' \u2192\n          ( x : X) \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) (\u03b1' x)))\n( inv-equiv\n        ( (x : X) \u2192 Iso (A x) (is-segal-A x) (f x) (g x))\n( \u03a3 ( \u03b1' : nat-trans-components X A f g) ,\n( x : X) \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) (\u03b1' x))\n        ( equiv-choice X\n          ( \\ x \u2192 hom (A x) (f x) (g x))\n          ( \\ x \u03b1\u2093 \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) \u03b1\u2093)))\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#rezk-types_1","title":"Rezk types","text":"

A Segal type \\(A\\) is a Rezk type just when, for all x y : A, the natural map from x = y to Iso A is-segal-A x y is an equivalence.

#def iso-id-arrow\n(A : U)\n(is-segal-A : is-segal A)\n  : (x : A) \u2192 Iso A is-segal-A x x\n  :=\n\\ x \u2192\n    (\n    (id-hom A x) ,\n    (\n    (\n      (id-hom A x) ,\n      (id-comp-is-segal A is-segal-A x x (id-hom A x))\n    ) ,\n    (\n      (id-hom A x) ,\n      (id-comp-is-segal A is-segal-A x x (id-hom A x))\n    )\n      )\n  )\n#def iso-eq\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n  : (x = y) \u2192 Iso A is-segal-A x y\n  :=\n\\ p \u2192\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 Iso A is-segal-A x y')\n      ( iso-id-arrow A is-segal-A x)\n      ( y)\n      ( p)\n
RS17, Definition 10.6
#def is-rezk\n( A : U)\n  : U\n  :=\n\u03a3 ( is-segal-A : is-segal A) ,\n(x : A) \u2192 (y : A) \u2192\n        is-equiv (x = y) (Iso A is-segal-A x y) (iso-eq A is-segal-A x y)\n

The following results show how iso-eq mediates between the type-theoretic operations on paths and the category-theoretic operations on arrows.

RS17, Lemma 10.7
#def compute-covariant-transport-of-hom-family-iso-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( x y : A)\n( e : x = y)\n( u : C x)\n  : covariant-transport\n      ( A)\n      ( x)\n      ( y)\n      ( first (iso-eq A is-segal-A x y e))\n      ( C)\n      ( is-covariant-C)\n      ( u)\n    = transport A C x y e u\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' e' \u2192\n        covariant-transport\n          ( A)\n          ( x)\n          ( y')\n          ( first (iso-eq A is-segal-A x y' e'))\n          ( C)\n          ( is-covariant-C)\n          ( u)\n        = transport A C x y' e' u)\n      ( id-arr-covariant-transport A x C is-covariant-C u)\n      ( y)\n      ( e)\n
RS17, Lemma 10.8
#def compute-ap-hom-of-iso-eq\n( A B : U)\n( is-segal-A : is-segal A)\n( is-segal-B : is-segal B)\n( f : A \u2192 B)\n( x y : A)\n( e : x = y)\n  : ( ap-hom A B f x y (first (iso-eq A is-segal-A x y e))) =\n    ( first ( iso-eq B is-segal-B (f x) (f y) (ap A B x y f e)))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' e' \u2192\n        ( ap-hom A B f x y' (first (iso-eq A is-segal-A x y' e'))) =\n        ( first (iso-eq B is-segal-B (f x) (f y') (ap A B x y' f e'))))\n      ( refl)\n      ( y)\n      ( e)\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/","title":"Adjunctions","text":"

This is a literate rzk file:

#lang rzk-1\n

Some of the definitions in this file rely on function extensionality:

#assume funext : FunExt\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#transposing-adjunctions","title":"Transposing adjunctions","text":"

Transposing adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A together with a family of \"transposing equivalences\" between appropriate hom types.

RS17, Definition 11.1
#def is-transposing-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  := (a : A) \u2192 (b : B) \u2192 Equiv (hom B (f a) b) (hom A a (u b))\n#def transposing-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), is-transposing-adj A B f u\n

A functor f : A \u2192 B is a transposing left adjoint if it has a transposing right adjoint. Later we will show that the type is-transposing-left-adj A B f is a proposition when A is Rezk and B is Segal.

#def is-transposing-left-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), is-transposing-adj A B f u\n#def is-transposing-right-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), is-transposing-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#quasi-diagrammatic-adjunctions","title":"Quasi-diagrammatic adjunctions","text":"

Quasi-diagrammatic adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A, unit and counit natural transformations, and a pair of witnesses to the triangle identities.

RS17, Definition 11.2
#def has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  :=\n\u03a3 (\u03b7 : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)),\n\u03a3 (\u03f5 : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)),\n    product\n      ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n        ( id-hom (B \u2192 A) u))\n      ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n#def quasi-diagrammatic-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), has-quasi-diagrammatic-adj A B f u\n

Quasi-diagrammatic adjunctions have left and right adjoints, but being the left or right adjoint part of a quasi-diagrammatic adjunction is not a proposition. Thus, we assign slightly different names to the following types.

#def has-quasi-diagrammatic-right-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), has-quasi-diagrammatic-adj A B f u\n#def has-quasi-diagrammatic-left-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), has-quasi-diagrammatic-adj A B f u\n

The following projection functions extract the core data of a quasi-diagrammatic adjunction.

#def unit-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)\n  := first (has-quasi-diagrammatic-adj-fu)\n#def counit-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)\n  := first (second (has-quasi-diagrammatic-adj-fu))\n#def right-adj-triangle-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n    ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f)\n      ( unit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u\n      ( counit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( id-hom (B \u2192 A) u)\n  := first (second (second (has-quasi-diagrammatic-adj-fu)))\n#def left-adj-triangle-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n    ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f\n      ( unit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B)\n      ( counit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( id-hom (A \u2192 B) f)\n  := second (second (second (has-quasi-diagrammatic-adj-fu)))\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#half-adjoint-diagrammatic-adjunctions","title":"Half-adjoint diagrammatic adjunctions","text":"

A half-adjoint diagrammatic adjunction extends a quasi-diagrammatic adjunction with higher coherence data that makes the specified witnesses to the triangle identities coherent. This extra coherence data involves a pair of 3-simplices belonging to a hom3 type we now define.

Unlike the convention used by the arguments of hom2, we introduce the boundary data of a 3-simplex in lexicographic order.

#def hom3\n( A : U)\n( w x y z : A)\n( f : hom A w x)\n( gf : hom A w y)\n( hgf : hom A w z)\n( g : hom A x y)\n( hg : hom A x z)\n( h : hom A y z)\n( \u03b1\u2083 : hom2 A w x y f g gf)\n( \u03b1\u2082 : hom2 A w x z f hg hgf)\n( \u03b1\u2081 : hom2 A w y z gf h hgf)\n( \u03b1\u2080 : hom2 A x y z g h hg)\n  : U\n  :=\n    ( ((t\u2081 , t\u2082 ) , t\u2083 ) : \u0394\u00b3) \u2192\n    A [ t\u2083 \u2261 0\u2082 \u21a6 \u03b1\u2083 (t\u2081 , t\u2082 ),\n        t\u2082 \u2261 t\u2083 \u21a6 \u03b1\u2082 (t\u2081 , t\u2083 ),\n        t\u2081 \u2261 t\u2082 \u21a6 \u03b1\u2081 (t\u2081 , t\u2083 ),\n        t\u2081 \u2261 1\u2082 \u21a6 \u03b1\u2080 (t\u2082 , t\u2083 )]\n
RS17, Definition 11.3
#def is-half-adjoint-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  :=\n\u03a3 ( (\u03b7 , (\u03f5 , (\u03b1 , \u03b2))) : has-quasi-diagrammatic-adj A B f u),\n\u03a3 ( \u03bc : hom2\n            ( B \u2192 B)\n            ( comp B A B f u)\n            ( quadruple-comp B A B A B f u f u)\n            ( identity B)\n            ( whisker-nat-trans B A A B u (identity A) (comp A B A u f) f \u03b7)\n            ( horizontal-comp-nat-trans B B B\n              ( comp B A B f u) (identity B) (comp B A B f u) (identity B)\n              ( \u03f5) ( \u03f5))\n            ( \u03f5)),\n    product\n    ( hom3 (B \u2192 B)\n      ( comp B A B f u)\n      ( quadruple-comp B A B A B f u f u)\n      ( comp B A B f u)\n      ( identity B)\n      ( whisker-nat-trans B A A B u (identity A) (comp A B A u f) f \u03b7)\n      ( id-hom (B \u2192 B) (comp B A B f u))\n      ( \u03f5)\n      ( postwhisker-nat-trans B B B\n        ( comp B A B f u) (identity B) (comp B A B f u) \u03f5)\n      ( horizontal-comp-nat-trans B B B\n              ( comp B A B f u) (identity B) (comp B A B f u) (identity B)\n              ( \u03f5) ( \u03f5))\n      ( \u03f5)\n      ( \\ t a \u2192 f (\u03b1 t a))\n      ( \u03bc)\n      ( id-comp-witness (B \u2192 B) (comp B A B f u) (identity B) \u03f5)\n      ( left-gray-interchanger-horizontal-comp-nat-trans B B B\n        ( comp B A B f u) (identity B) ( comp B A B f u) (identity B)\n        ( \u03f5)\n        ( \u03f5)))\n    ( hom3\n      ( B \u2192 B)\n      ( comp B A B f u)\n      ( quadruple-comp B A B A B f u f u)\n      ( comp B A B f u)\n      ( identity B)\n      ( whisker-nat-trans B A A B u (identity A) (comp A B A u f) f \u03b7)\n      ( id-hom (B \u2192 B) (comp B A B f u))\n      ( \u03f5)\n      ( prewhisker-nat-trans B B B\n        ( comp B A B f u) (comp B A B f u) (identity B) \u03f5)\n      ( horizontal-comp-nat-trans B B B\n              ( comp B A B f u) (identity B) (comp B A B f u) (identity B)\n              ( \u03f5) ( \u03f5))\n      ( \u03f5)\n      ( \\ t b \u2192 \u03b2 t (u b))\n      ( \u03bc)\n      ( id-comp-witness (B \u2192 B) (comp B A B f u) (identity B) \u03f5)\n      ( right-gray-interchanger-horizontal-comp-nat-trans B B B\n        ( comp B A B f u) (identity B) ( comp B A B f u) (identity B)\n        ( \u03f5)\n        ( \u03f5)))\n#def half-adjoint-diagrammatic-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), is-half-adjoint-diagrammatic-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#bi-diagrammatic-adjunction","title":"Bi-diagrammatic adjunction","text":"

Bi-diagrammatic adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A, a unit natural transformation \u03b7, two counit natural transformations \u03f5 and \u03f5', and a pair of witnesses to the triangle identities, one involving each counit.

RS17, Definition 11.6
#def is-bi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  :=\n\u03a3 (\u03b7 : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)),\n\u03a3 (\u03f5 : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)),\n\u03a3 (\u03f5' : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)),\n    product\n      ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n        ( id-hom (B \u2192 A) u))\n      ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5' )\n        ( id-hom (A \u2192 B) f))\n#def bi-diagrammatic-adj\n(A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), is-bi-diagrammatic-adj A B f u\n#def is-bi-diagrammatic-left-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), is-bi-diagrammatic-adj A B f u\n#def is-bi-diagrammatic-right-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), is-bi-diagrammatic-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#quasi-transposing-adjunction","title":"Quasi-transposing adjunction","text":"

Quasi-transposing adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A together with a family of \"transposing quasi-equivalences\" where \"quasi-equivalence\" is another name for \"invertible map.\"

RS17, Definition 11.7
#def has-quasi-transposing-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  := (a : A) \u2192 (b : B) \u2192\n\u03a3 (\u03d5 : (hom B (f a) b) \u2192 (hom A a (u b))),\n      has-inverse (hom B (f a) b) (hom A a (u b)) \u03d5\n#def quasi-transposing-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), has-quasi-transposing-adj A B f u\n#def has-quasi-transposing-right-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), has-quasi-transposing-adj A B f u\n#def has-quasi-transposing-left-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), has-quasi-transposing-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#equivalence-of-quasi-transposing-and-quasi-diagrammatic-adjunctions","title":"Equivalence of quasi-transposing and quasi-diagrammatic adjunctions","text":"

When A and B are Segal types, quasi-transposing-adj A B and quasi-diagrammatic-adj A B are equivalent.

We first connect the components of the unit and counit to the transposition maps in the usual way, as an application of the Yoneda lemma.

#section unit-counit-transposition\n#variables A B : U\n#variable is-segal-A : is-segal A\n#variable is-segal-B : is-segal B\n#variable f : A \u2192 B\n#variable u : B \u2192 A\n#def equiv-transposition-unit-component uses (funext)\n(a : A)\n  : Equiv ((b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b))) (hom A a (u (f a)))\n  :=\n    ( evid B (f a) (\\ b \u2192 hom A a (u b)) ,\n      yoneda-lemma\n        ( funext)\n        ( B)\n        ( is-segal-B)\n        ( f a)\n        ( \\ b \u2192 hom A a (u b))\n        ( is-covariant-substitution-is-covariant\n          ( A)\n          ( B)\n          ( hom A a)\n          ( is-covariant-representable-is-segal A is-segal-A a)\n          ( u)))\n#def equiv-unit-components\n  : Equiv\n( (a : A) \u2192 hom A a (u (f a)))\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n  :=\n    inv-equiv\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n( (a : A) \u2192 hom A a (u (f a)))\n    ( equiv-components-nat-trans\n      ( A)\n      ( \\ _ \u2192 A)\n      ( identity A)\n      ( comp A B A u f))\n#def equiv-transposition-unit uses (is-segal-A is-segal-B funext)\n  : Equiv\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n  :=\n    equiv-comp\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n( (a : A) \u2192 hom A a (u (f a)))\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n    ( equiv-function-equiv-family\n      ( funext)\n      ( A)\n( \\ a \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n      ( \\ a \u2192 hom A a (u (f a)))\n      ( equiv-transposition-unit-component))\n    ( equiv-unit-components)\n

We now reverse direction of the equivalence and extract the explicit map defining the transposition function associated to a unit natural transformation.

#def is-equiv-unit-component-transposition uses (funext)\n(a : A)\n  : is-equiv (hom A a (u (f a))) ((b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( \\ \u03b7a b k \u2192\n      comp-is-segal A is-segal-A a (u (f a)) (u b) \u03b7a (ap-hom B A u (f a) b k))\n  :=\n    inv-yoneda-lemma\n        ( funext)\n        ( B)\n        ( is-segal-B)\n        ( f a)\n        ( \\ b \u2192 hom A a (u b))\n        ( is-covariant-substitution-is-covariant\n          ( A)\n          ( B)\n          ( hom A a)\n          ( is-covariant-representable-is-segal A is-segal-A a)\n          ( u))\n#def is-equiv-unit-transposition uses (is-segal-A is-segal-B funext)\n  : is-equiv\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( \\ \u03b7 a b k \u2192\n      comp-is-segal A is-segal-A a (u (f a)) (u b)\n      ( \\ t -> \u03b7 t a)\n      ( ap-hom B A u (f a) b k))\n  :=\n    is-equiv-comp\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n( (a : A) \u2192 hom A a (u (f a)))\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( ev-components-nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n    ( is-equiv-ev-components-nat-trans A (\\ _ \u2192 A)(identity A)(comp A B A u f))\n    ( \\ \u03b7 a b k \u2192\n      comp-is-segal A is-segal-A a (u (f a)) (u b)\n      ( \\ t -> \u03b7 a t)\n      ( ap-hom B A u (f a) b k))\n    ( is-equiv-function-is-equiv-family\n      ( funext)\n      ( A)\n      ( \\ a \u2192 hom A a (u (f a)))\n( \\ a \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n      ( \\ a \u03b7a b k \u2192\n        comp-is-segal A is-segal-A a (u (f a)) (u b)\n        ( \u03b7a)\n        ( ap-hom B A u (f a) b k))\n      ( is-equiv-unit-component-transposition))\n

The results for counits are dual.

#def equiv-transposition-counit-component uses (funext)\n(b : B)\n  : Equiv ((a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b)) (hom B (f (u b)) b)\n  :=\n    ( contra-evid A (u b) (\\ a \u2192 hom B (f a) b) ,\n      contra-yoneda-lemma\n        ( funext)\n        ( A)\n        ( is-segal-A)\n        ( u b)\n        ( \\ a \u2192 hom B (f a) b)\n        ( is-contravariant-substitution-is-contravariant\n          ( B)\n          ( A)\n          ( \\ x -> hom B x b)\n          ( is-contravariant-representable-is-segal B is-segal-B b)\n          ( f)))\n#def equiv-counit-components\n  : Equiv\n( (b : B) \u2192 hom B (f (u b)) b)\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n  :=\n    inv-equiv\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n( (b : B) \u2192 hom B (f (u b)) b)\n    ( equiv-components-nat-trans\n      ( B)\n      ( \\ _ \u2192 B)\n      ( comp B A B f u)\n      ( identity B))\n#def equiv-transposition-counit uses (is-segal-A is-segal-B funext)\n  : Equiv\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n  :=\n    equiv-comp\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n( (b : B) \u2192 hom B (f (u b)) b)\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n    ( equiv-function-equiv-family\n      ( funext)\n      ( B)\n( \\ b \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n      ( \\ b \u2192 hom B (f (u b)) b)\n      ( equiv-transposition-counit-component))\n    ( equiv-counit-components)\n

We again reverse direction of the equivalence and extract the explicit map defining the transposition function associated to a counit natural transformation.

#def is-equiv-counit-component-transposition uses (funext)\n(b : B)\n  : is-equiv (hom B (f (u b)) b) ((a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( \\ \u03f5b a k \u2192\n      comp-is-segal B is-segal-B (f a) (f (u b)) b (ap-hom A B f a (u b) k) \u03f5b)\n  :=\n    inv-contra-yoneda-lemma\n        ( funext)\n        ( A)\n        ( is-segal-A)\n        ( u b)\n        ( \\ a \u2192 hom B (f a) b)\n        ( is-contravariant-substitution-is-contravariant\n          ( B)\n          ( A)\n          ( \\ z \u2192 hom B z b)\n          ( is-contravariant-representable-is-segal B is-segal-B b)\n          ( f))\n#def is-equiv-counit-transposition uses (is-segal-A is-segal-B funext)\n  : is-equiv\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( \\ \u03f5 b a k \u2192\n      comp-is-segal B is-segal-B (f a) (f (u b)) b\n      ( ap-hom A B f a (u b) k)\n      ( \\ t -> \u03f5 t b))\n  :=\n    is-equiv-comp\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n( (b : B) \u2192 hom B (f (u b)) b)\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( ev-components-nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n    ( is-equiv-ev-components-nat-trans B (\\ _ \u2192 B)(comp B A B f u) (identity B))\n    ( \\ \u03f5 b a k \u2192\n      comp-is-segal B is-segal-B (f a) (f (u b)) b\n      ( ap-hom A B f a (u b) k)\n      ( \\ t -> \u03f5 b t))\n    ( is-equiv-function-is-equiv-family\n      ( funext)\n      ( B)\n      ( \\ b \u2192 hom B (f (u b)) b)\n( \\ b \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n      ( \\ b \u03f5b a k \u2192\n        comp-is-segal B is-segal-B (f a) (f (u b)) b\n        ( ap-hom A B f a (u b) k)\n        ( \u03f5b))\n      ( is-equiv-counit-component-transposition))\n#end unit-counit-transposition\n

We next connect the triangle identity witnesses to the usual triangle identities as an application of the dependent Yoneda lemma.

#section triangle-identities\n#variables A B : U\n#variable is-segal-A : is-segal A\n#variable is-segal-B : is-segal B\n#variable f : A \u2192 B\n#variable u : B \u2192 A\n#variable \u03b7 : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)\n#variable \u03f5 : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)\n#def equiv-radj-triangle uses (funext)\n  : Equiv\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n  :=\n    inv-equiv\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n    ( equiv-hom2-eq-comp-is-segal\n      ( B \u2192 A)\n      ( is-segal-function-type\n        ( funext)\n        ( B)\n        ( \\ _ \u2192 A)\n        ( \\ _ \u2192 is-segal-A ))\n      ( u)\n      (triple-comp B A B A u f u)\n      ( u)\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n#def equiv-ev-components-radj-triangle\n  : Equiv\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n        ( comp-is-segal\n          ( B \u2192 A)\n          ( is-segal-function-type\n            ( funext)\n            ( B)\n            ( \\ _ \u2192 A)\n            ( \\ _ \u2192 is-segal-A ))\n          ( u)\n          (triple-comp B A B A u f u)\n          ( u)\n          ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n          ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))) =\n      ( \\ b \u2192 id-hom A ( u b)))\n  :=\n    equiv-ap-is-equiv\n    ( nat-trans B (\\ _ \u2192 A) u u)\n    ( nat-trans-components B (\\ _ \u2192 A) u u)\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u)\n    ( is-equiv-ev-components-nat-trans B (\\ _ \u2192 A) u u)\n    ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n    ( id-hom (B \u2192 A) u)\n#def equiv-components-radj-triangle-funext uses (funext)\n  : Equiv\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n        ( comp-is-segal\n          ( B \u2192 A)\n          ( is-segal-function-type\n            ( funext)\n            ( B)\n            ( \\ _ \u2192 A)\n            ( \\ _ \u2192 is-segal-A ))\n          ( u)\n          (triple-comp B A B A u f u)\n          ( u)\n          ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n          ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))) =\n      ( \\ b \u2192 id-hom A ( u b)))\n( ( b : B) \u2192\n      ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n        ( id-hom A ( u b))))\n  :=\n    equiv-FunExt\n    ( funext)\n    ( B)\n    ( \\ b \u2192 (hom A (u b) (u b)))\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n      ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )))\n    ( \\ b \u2192 id-hom A (u b))\n#def eq-ladj-triangle-comp-components-comp-nat-trans-is-segal uses (funext)\n(b : B)\n  : ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n      ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type (funext) (B) (\\ _ \u2192 A) (\\ _ \u2192 is-segal-A))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n      ( b))\n  :=\n    comp-components-comp-nat-trans-is-segal\n    ( funext)\n    ( B)\n    ( \\ _ \u2192 A)\n    ( \\ _ \u2192 is-segal-A)\n    ( u)\n    (triple-comp B A B A u f u)\n    ( u)\n    ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n    ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n    ( b)\n#def equiv-preconcat-radj-triangle uses (funext)\n(b : B)\n  : Equiv\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n      ( id-hom A ( u b)))\n    ( ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n  :=\n    equiv-preconcat\n    ( hom A (u b) (u b))\n    ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b)))\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n      ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type (funext) (B) (\\ _ \u2192 A) (\\ _ \u2192 is-segal-A))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n      ( b))\n      ( id-hom A (u b))\n      (eq-ladj-triangle-comp-components-comp-nat-trans-is-segal b)\n#def equiv-component-comp-segal-comp-radj-triangle uses (funext)\n  : Equiv\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n  :=\n    equiv-triple-comp\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n        ( comp-is-segal\n          ( B \u2192 A)\n          ( is-segal-function-type\n            ( funext)\n            ( B)\n            ( \\ _ \u2192 A)\n            ( \\ _ \u2192 is-segal-A ))\n          ( u)\n          (triple-comp B A B A u f u)\n          ( u)\n          ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n          ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))) =\n      ( \\ b \u2192 id-hom A ( u b)))\n( ( b : B) \u2192\n      ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n        ( id-hom A ( u b))))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n    ( equiv-ev-components-radj-triangle)\n    ( equiv-components-radj-triangle-funext)\n    ( equiv-function-equiv-family\n      ( funext)\n      ( B)\n      ( \\ b \u2192\n        ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n        ( id-hom A ( u b)))\n      ( \\ b \u2192\n        ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n          ( \\ t \u2192 \u03b7 t (u b) )\n          ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n        ( id-hom A ( u b)))\n      ( equiv-preconcat-radj-triangle))\n

We finally arrive at the desired equivalence.

#def equiv-components-radj-triangle uses (funext)\n  : Equiv\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n  :=\n    equiv-comp\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n    ( equiv-radj-triangle)\n    ( equiv-component-comp-segal-comp-radj-triangle)\n

The calculation for the other triangle identity is dual.

#def equiv-ladj-triangle uses (funext)\n  : Equiv\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ a \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n  :=\n    inv-equiv\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n    ( equiv-hom2-eq-comp-is-segal\n      ( A \u2192 B)\n      ( is-segal-function-type\n        ( funext)\n        ( A)\n        ( \\ _ \u2192 B)\n        ( \\ _ \u2192 is-segal-B ))\n      ( f)\n      (triple-comp A B A B f u f)\n      ( f)\n      ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n      ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n      ( id-hom (A \u2192 B) f))\n#def equiv-ev-components-ladj-triangle\n  : Equiv\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n        ( comp-is-segal\n          ( A \u2192 B)\n          ( is-segal-function-type\n            ( funext)\n            ( A)\n            ( \\ _ \u2192 B)\n            ( \\ _ \u2192 is-segal-B ))\n          ( f)\n          (triple-comp A B A B f u f)\n          ( f)\n          ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n          ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))) =\n      ( \\ a \u2192 id-hom B ( f a)))\n  :=\n    equiv-ap-is-equiv\n    ( nat-trans A (\\ _ \u2192 B) f f)\n    ( nat-trans-components A (\\ _ \u2192 B) f f)\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f)\n    ( is-equiv-ev-components-nat-trans A (\\ _ \u2192 B) f f)\n    ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n    ( id-hom (A \u2192 B) f)\n#def equiv-components-ladj-triangle-funext uses (funext)\n  : Equiv\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n        ( comp-is-segal\n          ( A \u2192 B)\n          ( is-segal-function-type\n            ( funext)\n            ( A)\n            ( \\ _ \u2192 B)\n            ( \\ _ \u2192 is-segal-B ))\n          ( f)\n          (triple-comp A B A B f u f)\n          ( f)\n          ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n          ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))) =\n      ( \\ a \u2192 id-hom B ( f a)))\n( ( a : A) \u2192\n      ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a))))\n  :=\n    equiv-FunExt\n    ( funext)\n    ( A)\n    ( \\ a \u2192 (hom B (f a) (f a)))\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n      ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )))\n    ( \\ a \u2192 id-hom B (f a))\n#def eq-radj-triangle-comp-components-comp-nat-trans-is-segal uses (funext)\n(a : A)\n  : ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n      ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n      ( \\ t \u2192 \u03f5 t (f a))) =\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n      ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type (funext) (A) (\\ _ \u2192 B) (\\ _ \u2192 is-segal-B))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n      ( a))\n  :=\n    comp-components-comp-nat-trans-is-segal\n    ( funext)\n    ( A)\n    ( \\ _ \u2192 B)\n    ( \\ _ \u2192 is-segal-B)\n    ( f)\n    (triple-comp A B A B f u f)\n    ( f)\n    ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n    ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n    ( a)\n#def equiv-preconcat-ladj-triangle uses (funext)\n(a : A)\n  : Equiv\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a)))\n    ( ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n  :=\n    equiv-preconcat\n    ( hom B (f a) (f a))\n    ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n      ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n      ( \\ t \u2192 \u03f5 t (f a)))\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n      ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n      ( a))\n    ( id-hom B (f a))\n    (eq-radj-triangle-comp-components-comp-nat-trans-is-segal a)\n#def equiv-component-comp-segal-comp-ladj-triangle uses (funext)\n  : Equiv\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n  :=\n    equiv-triple-comp\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n        ( comp-is-segal\n          ( A \u2192 B)\n          ( is-segal-function-type\n            ( funext)\n            ( A)\n            ( \\ _ \u2192 B)\n            ( \\ _ \u2192 is-segal-B ))\n          ( f)\n          (triple-comp A B A B f u f)\n          ( f)\n          ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n          ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))) =\n      ( \\ a \u2192 id-hom B ( f a)))\n( ( a : A) \u2192\n      ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a))))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n    ( equiv-ev-components-ladj-triangle)\n    ( equiv-components-ladj-triangle-funext)\n    ( equiv-function-equiv-family\n      ( funext)\n      ( A)\n      ( \\ a \u2192\n        ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a)))\n      ( \\ a \u2192\n        ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n          ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n          ( \\ t \u2192 \u03f5 t (f a))) =\n        ( id-hom B ( f a)))\n      ( equiv-preconcat-ladj-triangle))\n#def equiv-components-ladj-triangle uses (funext)\n  : Equiv\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n  :=\n    equiv-comp\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n    ( equiv-ladj-triangle)\n    ( equiv-component-comp-segal-comp-ladj-triangle)\n#end triangle-identities\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/","title":"Cocartesian families","text":"

These formalizations capture cocartesian families as treated in BW23.

The goal, for now, is not to give a general structural account as in the paper but rather to provide the definitions and results that are necessary to prove the cocartesian Yoneda Lemma.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#prerequisites","title":"Prerequisites","text":""},{"location":"simplicial-hott/12-cocartesian.rzk/#iso-inner-families","title":"(Iso-)Inner families","text":"

This is a (tentative and redundant) definition of (iso-)inner families. In the future, hopefully, these can be replaced by instances of orthogonal and LARI families.

#def is-inner-family\n( B : U)\n( P : B \u2192 U)\n  : U\n  :=\n    product\n    ( product (is-segal B) (is-segal (\u03a3 (b : B) , P b)))\n( (b : B) \u2192 (is-segal (P b)))\n#def is-isoinner-family\n( B : U)\n( P : B \u2192 U)\n  : U\n  :=\n    product\n    ( product (is-rezk B) (is-rezk (\u03a3 (b : B) , P b)))\n( (b : B) \u2192 (is-rezk (P b)))\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#cocartesian-arrows","title":"Cocartesian arrows","text":"

Here we define the proposition that a dependent arrow in a family is cocartesian. This is an alternative version using unpacked extension types, as this is preferred for usage.

BW23, Definition 5.1.1
#def is-cocartesian-arrow\n( B : U)\n( b b' : B)\n( u : hom B b b')\n( P : B \u2192 U)\n( e : P b)\n( e' : P b')\n( f : dhom B b b' u P e e')\n  : U\n  :=\n(b'' : B) \u2192 (v : hom B b' b'') \u2192 (w : hom B b b'') \u2192\n(sigma : hom2 B b b' b'' u v w) \u2192 (e'' : P b'') \u2192\n(h : dhom B b b'' w P e e'') \u2192\n      is-contr\n( \u03a3 ( g : dhom B b' b'' v P e' e'') ,\n          ( dhom2 B b b' b'' u v w sigma P e e' e'' f g h))\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#cocartesian-lifts","title":"Cocartesian lifts","text":"

The following is the type of cocartesian lifts of a fixed arrow in the base with a given starting point in the fiber.

BW23, Definition 5.1.2
#def cocartesian-lift\n( B : U)\n( b b' : B)\n( u : hom B b b')\n( P : B \u2192 U)\n( e : P b)\n  : U\n  :=\n\u03a3 (e' : P b') ,\n\u03a3 (f : dhom B b b' u P e e') , is-cocartesian-arrow B b b' u P e e' f\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#cocartesian-family","title":"Cocartesian family","text":"

A family over cocartesian if it is isoinner and any arrow in the has a cocartesian lift, given a point in the fiber over the domain.

BW23, Definition 5.2.1
#def has-cocartesian-lifts\n( B : U)\n( P : B \u2192 U)\n  : U\n  :=\n( b : B) \u2192 ( b' : B) \u2192 ( u : hom B b b') \u2192\n( e : P b) \u2192 ( \u03a3 (e' : P b'),\n( \u03a3 (f : dhom B b b' u P e e'), is-cocartesian-arrow B b b' u P e e' f))\n
BW23, Definition 5.2.2
#def is-cocartesian-family\n( B : U)\n( P : B \u2192 U)\n  : U\n  := product (is-isoinner-family B P) (has-cocartesian-lifts B P)\n
"},{"location":"simplicial-hott/13-limits.rzk/","title":"13. Limits and colimits","text":"

These formalisations correspond in part to Section 3 of the BM22 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/13-limits.rzk/#definition-limits-and-colimits","title":"Definition limits and colimits","text":"

Given a function f : A \u2192 B and b:B we define the type of cones over f.

#def cone\n( A B : U )\n( f : A \u2192 B )\n  : U\n  := \u03a3 (b : B), hom (A \u2192 B) (constant A B b) f\n

Given a function f : A \u2192 B and b:B we define the type of cocones under f.

#def cocone\n( A B : U )\n( f : A \u2192 B )\n  : U\n  := \u03a3 (b : B), hom ( A \u2192 B) f (constant A B b)\n
We define a colimit for f : A \u2192 B as an initial cocone under f.

#def colimit\n( A B : U )\n( f : A \u2192 B )\n  : U\n  := \u03a3 ( x : cocone A B f ) , is-initial (cocone A B f) x\n

We define a limit of f : A \u2192 B as a terminal cone over f.

#def limit\n( A B : U )\n( f : A \u2192 B )\n  : U\n  :=  \u03a3 ( x : cone A B f ) , is-final (cone A B f) x\n
We give a second definition of limits, we eventually want to prove both definitions coincide. Define cone as a family.

#def cone2\n(A B : U)\n  : (A \u2192 B) \u2192 (B) \u2192 U\n  := \\ f \u2192 \\ b \u2192 (hom (A \u2192 B) (constant A B b) f)\n
#def constant-nat-trans\n(A B : U)\n( x y : B )\n( k : hom B x y)\n  : hom (A \u2192 B) (constant A B x) (constant A B y)\n  := \\ t a \u2192 ( constant A ( hom B x y ) k ) a t\n

#def cone-precomposition\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B )\n( b x : B )\n( k : hom B b x)\n  : (cone2 A B f x) \u2192  (cone2 A B f b)\n  := \\ \u03b1 \u2192 vertical-comp-nat-trans\n              ( A)\n              ( \\ a \u2192 B)\n              ( \\ a \u2192 is-segal-B)\n              ( constant A B b)\n              ( constant A B x)\n              (f)\n              ( constant-nat-trans A B b x k )\n              ( \u03b1)\n
Another definition of limit.

#def limit2\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (b : B),\n\u03a3 ( c : cone2 A B f b ),\n( x : B) \u2192 ( k : hom B b x)\n      \u2192 is-equiv (cone2 A B f x) (cone2 A B f b) (cone-precomposition A B is-segal-B f b x k )\n

We give a second definition of colimits, we eventually want to prove both definitions coincide. Define cocone as a family.

#def cocone2\n(A B : U)\n  : (A \u2192 B) \u2192 (B) \u2192 U\n  := \\ f \u2192 \\ b \u2192 (hom (A \u2192 B) f (constant A B b))\n

#def cocone-postcomposition\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B )\n( x b : B )\n( k : hom B x b)\n  : (cocone2 A B f x) \u2192 (cocone2 A B f b)\n  := \\ \u03b1 \u2192 vertical-comp-nat-trans\n              ( A)\n              ( \\ a \u2192 B)\n              ( \\ a \u2192 is-segal-B)\n              (f)\n              ( constant A B x)\n              ( constant A B b)\n              ( \u03b1)\n              ( constant-nat-trans A B x b k )\n
Another definition of colimit.

#def colimit2\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (b : B),\n\u03a3 ( c : cocone2 A B f b ),\n( x : B) \u2192 ( k : hom B x b)\n      \u2192 is-equiv (cocone2 A B f x) (cocone2 A B f b) (cocone-postcomposition A B is-segal-B f x b k )\n
The following alternative definition does not require a Segalness condition. When is-segal B then definitions 1 and 3 coincide.

#def limit3\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 ( b : B),(x : B) \u2192 Equiv (hom B b x ) (cone2 A B f x)\n
#def colimit3\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 ( b : B),(x : B) \u2192 Equiv (hom B x b ) (cocone2 A B f x)\n

"},{"location":"simplicial-hott/13-limits.rzk/#uniqueness-of-initial-and-final-objects","title":"Uniqueness of initial and final objects.","text":"

In a Segal type, initial objects are isomorphic.

#def iso-initial\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( is-initial-a : is-initial A a)\n( is-initial-b : is-initial A b)\n  : Iso A is-segal-A a b\n  :=\n    ( first (is-initial-a b) ,\n      ( ( first (is-initial-b a) ,\n          eq-is-contr\n            ( hom A a a)\n            ( is-initial-a a)\n            ( comp-is-segal A is-segal-A a b a\n              ( first (is-initial-a b))\n              ( first (is-initial-b a)))\n            ( id-hom A a)) ,\n        ( first (is-initial-b a) ,\n          eq-is-contr\n            ( hom A b b)\n            ( is-initial-b b)\n            ( comp-is-segal A is-segal-A b a b\n              ( first (is-initial-b a))\n              ( first (is-initial-a b)))\n            ( id-hom A b))))\n

In a Segal type, final objects are isomorphic.

#def iso-final\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( is-final-a : is-final A a)\n( is-final-b : is-final A b)\n( iso : Iso A is-segal-A a b)\n  : Iso A is-segal-A a b\n  :=\n    ( first (is-final-b a) ,\n      ( ( first (is-final-a b) ,\n          eq-is-contr\n            ( hom A a a)\n            ( is-final-a a)\n            ( comp-is-segal A is-segal-A a b a\n              ( first (is-final-b a))\n              ( first (is-final-a b)))\n            ( id-hom A a)) ,\n        ( first (is-final-a b) ,\n          eq-is-contr\n            ( hom A b b)\n            ( is-final-b b)\n            ( comp-is-segal A is-segal-A b a b\n              ( first (is-final-a b))\n              ( first (is-final-b a)))\n            ( id-hom A b))))\n
"},{"location":"simplicial-hott/13-limits.rzk/#uniqueness-up-to-isomophism-of-colimits","title":"Uniqueness up to isomophism of (co)limits","text":""}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Simplicial HoTT and synthetic \u221e-categories","text":"

Info

This project originated as a fork of emilyriehl/yoneda.

This is a formalization library for simplicial Homotopy Type Theory (sHoTT) with the aim of proving resulting in synthetic \u221e-category theory, starting with the results from the following papers:

This formalization project follows the philosophy layed out in the article \"Could \u221e-category theory be taught to undergraduates?\" 4.

The formalizations are implemented using rzk, an experimental proof assistant for a variant of type theory with shapes.

See the list of contributors to this formalisation project at CONTRIBUTORS.md.

"},{"location":"#checking-the-formalisations-locally","title":"Checking the Formalisations Locally","text":"

It is recommended to use VS Code extension for Rzk (available in Visual Studio Marketplace, as well as in Open VSX). The extension should then manage an rzk executable and provide some feedback directly in VS Code, without users having to use the command line.

Otherwise, install the rzk proof assistant from sources. Then run the following command from the root of this repository:

rzk typecheck src/hott/* src/simplicial-hott/*\n
  1. Emily Riehl & Michael Shulman. A type theory for synthetic \u221e-categories. Higher Structures 1(1), 147-224. 2017. https://arxiv.org/abs/1705.07442 \u21a9

  2. Ulrik Buchholtz and Jonathan Weinberger. Synthetic fibered (\u221e, 1)-category theory. Higher Structures 7 (2023), 74\u2013165. Issue 1. https://doi.org/10.21136/HS.2023.04 \u21a9

  3. C\u00e9sar Bardomiano Mart\u00ednez. Limits and colimits of synthetic \u221e-categories. 1-33, 2022. https://arxiv.org/abs/2202.12386 \u21a9

  4. Emily Riehl. Could \u221e-category theory be taught to undergraduates? Notices of the AMS. May 2023. https://www.ams.org/journals/notices/202305/noti2692/noti2692.html \u21a9

"},{"location":"CONTRIBUTORS/","title":"A list of contributors","text":"

Formalizations were contributed by the following people (listed alphabetically):

You may see actual contributed commits in the Contributors page on GitHub.

"},{"location":"STYLEGUIDE/","title":"Style guide and design principles","text":"

This guide provides a set of design principles and guidelines for the sHoTT project. Our style and design principles borrows heavily from agda-unimath.

"},{"location":"STYLEGUIDE/#the-structure-of-code","title":"The structure of code","text":"

We enforce strict formatting rules. This formatting allows the type of the defined term to be easily readable, and aids in understanding the structure of the definition.

The general format of a definition is as follows:

#def concat\n( p : x = y)\n( q : y = z)\n  : (x = z)\n  := idJ (A , y , \\ z' q' \u2192 (x = z') , p , z , q)\n

(Currently just taken from agda-unimath and adapted to Rzk) In Rzk, every construction is structured like a tree, where each operation can be seen as a branching point. We use indentation levels and parentheses to highlight this structure, which makes the code feel more organized and understandable. For example, when a definition part extends beyond a line, we introduce line breaks at the earliest branching point, clearly displaying the tree structure of the definition. This allows the reader to follow the branches of the tree, and to visually grasp the scope of each operation and argument. Consider the following example about Segal types:

#def is-segal-is-local-horn-inclusion\n( A : U)\n( is-local-horn-inclusion-A : is-local-horn-inclusion A)\n  : isSegal A\n  :=\n\\ x y z f g \u2192\n    projection-equiv-contractible-fibers\n      ( \u039b \u2192 A)\n( \\ k \u2192\n        \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n          ( hom2 A\n            ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n            ( \\ t \u2192 k (t , 0\u2082))\n            ( \\ t \u2192 k (1\u2082 , t))\n            ( h)))\n( second\n        ( comp-equiv\n          ( \u03a3 ( k : \u039b \u2192 A ) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082))\n                ( \\ t \u2192 k (1\u2082 , t))\n                ( h)))\n          ( \u0394\u00b2 \u2192 A)\n          ( \u039b  \u2192 A)\n          ( inv-equiv\n            ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n                ( hom2 A\n                  ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                  ( \\ t \u2192 k (t , 0\u2082))\n                  ( \\ t \u2192 k (1\u2082 , t))\n                  ( h)))\n            ( equiv-horn-restriction A))\n          ( horn-restriction A , is-local-horn-inclusion-A)))\n      ( horn A x y z f g)\n

The root here is the function projection-equiv-contractible-fibers. It takes four arguments, each starting on a fresh line and is indented an extra level from the root. The first argument fits neatly on one line, but the second one is too large. In these cases, we add a line break right after the \u2192-symbol following the lambda-abstraction, which is the earliest branching point in this case. The next node is again \u03a3, with two arguments. The first one fits on a line, but the second does not, so we add a line break between them. This process is continued until the definition is complete.

Note also that we use parentheses to mark the branches. The extra space after the opening parentheses marking a branch is there to visually emphasize the tree structure of the definition, and synergizes with our convention to have two-space indentation level increases.

"},{"location":"STYLEGUIDE/#naming-conventions","title":"Naming conventions","text":"
#def function-type-Segal\n( A B : Segal)\n  : Segal\n
"},{"location":"STYLEGUIDE/#use-of-unicode-characters","title":"Use of Unicode characters","text":"

In the defined names we use Unicode symbols sparingly and only when they align with established mathematical practice.

For the builtin syntactic features of rzk we use the following Unicode symbols:

We use ASCII versions for TOP and BOT since \u22a4 and \u22a5 do not read better in the code. Same for first and second (\u03c0\u2081 and \u03c0\u2082 are not very readable). For the latter a lot of uses for projections should go away by using pattern matching (and let/where in the future).

"},{"location":"STYLEGUIDE/#use-of-comments","title":"Use of Comments","text":"

We do not explicitly ban code comments, but our other conventions should heavily limit their need.

Still, code annotations may find their uses.

Where to place literature references?

For instance, instead of writing first (second is-invertible-f), we define a named projection is-section-is-invertible. This may then be used as is-section-is-invertible A B f is-invertible-f in other places. This way, the code becomes self-documenting, and much easier to read.

However, we recognize that in rzk, since we do not have the luxury of implicit arguments, this may sometimes cause unnecessarily verbose code. In such cases, you may revert to using first and second.

"},{"location":"STYLEGUIDE/#adapting-and-evolving-the-style-guide","title":"Adapting and Evolving the Style Guide","text":"

This style guide should evolve as Rzk develops and grows. If new features, like implicit arguments, let-expressions, or where-blocks are added to the language, or if there is made changes to the syntax of the language, their use should be incorporated into this style guide.

At all times, the goal is to have code that is easy to read and navigate, even for those who are not the authors. We should also ensure that we maintain a consistent style across the entire repository.

"},{"location":"hott/00-common.rzk/","title":"0. Common","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/00-common.rzk/#products-of-types","title":"products of types","text":"
#def product\n( A B : U)\n  : U\n  := \u03a3 (x : A) , B\n

The following demonstrates the syntax for constructing terms in Sigma types:

#def diagonal\n( A : U)\n( a : A)\n  : product A A\n  := (a , a)\n
"},{"location":"hott/00-common.rzk/#the-type-of-logical-equivalences-between-types","title":"The type of logical equivalences between types","text":"
#def iff\n( A B : U)\n  : U\n  := product (A \u2192 B) (B \u2192 A)\n
"},{"location":"hott/00-common.rzk/#basic-function-definitions","title":"Basic function definitions","text":"
#section basic-functions\n#variables A B C D E : U\n#def comp\n( g : B \u2192 C)\n( f : A \u2192 B)\n  : A \u2192 C\n  := \\ z \u2192 g (f z)\n#def triple-comp\n( h : C \u2192 D)\n( g : B \u2192 C)\n( f : A \u2192 B)\n  : A \u2192 D\n  := \\ z \u2192 h (g (f z))\n#def quadruple-comp\n( k : D \u2192 E)\n( h : C \u2192 D)\n( g : B \u2192 C)\n( f : A \u2192 B)\n  : A \u2192 E\n  := \\ z \u2192 k (h (g (f z)))\n#def identity\n  : A \u2192 A\n  := \\ a \u2192 a\n#def constant\n( b : B)\n  : A \u2192 B\n  := \\ a \u2192 b\n#end basic-functions\n
"},{"location":"hott/00-common.rzk/#substitution","title":"Substitution","text":"Reindexing a type family along a function into the base type
#def reindex\n( A B : U)\n( f : B \u2192 A)\n( C : A \u2192 U)\n  : B \u2192 U\n  := \\ b \u2192 C (f b)\n
"},{"location":"hott/01-paths.rzk/","title":"1. Paths","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/01-paths.rzk/#path-induction","title":"Path induction","text":"

We define path induction in terms of the built-in J rule, so that we can apply it like any other function.

#define ind-path\n( A : U)\n( a : A)\n( C : (x : A) -> (a = x) -> U)\n( d : C a refl)\n( x : A)\n( p : a = x)\n  : C x p\n  := idJ (A , a , C , d , x , p)\n

To emphasize the fact that this version of path induction is biased towards paths with fixed starting point, we introduce the synonym ind-path-start. Later we will construct the analogous path induction ind-path-end, for paths with fixed end point.

#define ind-path-start\n( A : U)\n( a : A)\n( C : (x : A) -> (a = x) -> U)\n( d : C a refl)\n( x : A)\n( p : a = x)\n  : C x p\n  :=\n    ind-path A a C d x p\n
"},{"location":"hott/01-paths.rzk/#some-basic-path-algebra","title":"Some basic path algebra","text":"
#section path-algebra\n#variable A : U\n#variables x y z : A\n
"},{"location":"hott/01-paths.rzk/#path-reversal","title":"Path reversal","text":"
#def rev\n( p : x = y)\n  : y = x\n  := ind-path (A) (x) (\\ y' p' \u2192 y' = x) (refl) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#path-concatenation","title":"Path concatenation","text":"

We take path concatenation defined by induction on the second path variable as our main definition.

#def concat\n( p : x = y)\n( q : y = z)\n  : (x = z)\n  := ind-path (A) (y) (\\ z' q' \u2192 (x = z')) (p) (z) (q)\n

We also introduce a version defined by induction on the first path variable, for situations where it is easier to induct on the first path.

#def concat'\n( p : x = y)\n  : (y = z) \u2192 (x = z)\n  := ind-path (A) (x) (\\ y' p' \u2192 (y' = z) \u2192 (x = z)) (\\ q' \u2192 q') (y) (p)\n#end path-algebra\n
"},{"location":"hott/01-paths.rzk/#some-basic-coherences-in-path-algebra","title":"Some basic coherences in path algebra","text":"
#section basic-path-coherence\n#variable A : U\n#variables w x y z : A\n#def rev-rev\n( p : x = y)\n  : (rev A y x (rev A x y p)) = p\n  :=\n    ind-path\n    ( A) (x) (\\ y' p' \u2192 (rev A y' x (rev A x y' p')) = p') (refl) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#left-unit-law-for-path-concatenation","title":"Left unit law for path concatenation","text":"

The left unit law for path concatenation does not hold definitionally due to our choice of definition.

#def left-unit-concat\n( p : x = y)\n  : (concat A x x y refl p) = p\n  := ind-path (A) (x) (\\ y' p' \u2192 (concat A x x y' refl p') = p') (refl) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#associativity-of-path-concatenation","title":"Associativity of path concatenation","text":"
#def associative-concat\n( p : w = x)\n( q : x = y)\n( r : y = z)\n  : ( concat A w y z (concat A w x y p q) r) =\n    ( concat A w x z p (concat A x y z q r))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192\n        concat A w y z' (concat A w x y p q) r' =\n        concat A w x z' p (concat A x y z' q r'))\n      ( refl)\n      ( z)\n      ( r)\n#def rev-associative-concat\n( p : w = x)\n( q : x = y)\n( r : y = z)\n  : ( concat A w x z p (concat A x y z q r)) =\n    ( concat A w y z (concat A w x y p q) r)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192\n          concat A w x z' p (concat A x y z' q r') =\n          concat A w y z' (concat A w x y p q) r')\n      ( refl)\n      ( z)\n      ( r)\n#def right-inverse-concat\n( p : x = y)\n  : (concat A x y x p (rev A x y p)) = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 concat A x y' x p' (rev A x y' p') = refl)\n      ( refl)\n      ( y)\n      ( p)\n#def left-inverse-concat\n( p : x = y)\n  : (concat A y x y (rev A x y p) p) = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 concat A y' x y' (rev A x y' p') p' = refl)\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#concatenation-of-two-paths-with-common-codomain","title":"Concatenation of two paths with common codomain","text":"

Concatenation of two paths with common codomain; defined using concat and rev.

#def zig-zag-concat\n( p : x = y)\n( q : z = y)\n  : (x = z)\n  := concat A x y z p (rev A z y q)\n
"},{"location":"hott/01-paths.rzk/#concatenation-of-two-paths-with-common-domain","title":"Concatenation of two paths with common domain","text":"

Concatenation of two paths with common domain; defined using concat and rev.

#def zag-zig-concat\n(p : y = x)\n(q : y = z)\n  : (x = z)\n  := concat A x y z (rev A y x p) q\n#def right-cancel-concat\n( p q : x = y)\n( r : y = z)\n  : ((concat A x y z p r) = (concat A x y z q r)) \u2192 (p = q)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192 ((concat A x y z' p r') = (concat A x y z' q r')) \u2192 (p = q))\n      ( \\ H \u2192 H)\n      ( z)\n      ( r)\n#end basic-path-coherence\n
"},{"location":"hott/01-paths.rzk/#some-derived-coherences-in-path-algebra","title":"Some derived coherences in path algebra","text":"

The statements or proofs of the following path algebra coherences reference one of the path algebra coherences defined above.

#section derived-path-coherence\n#variable A : U\n#variables x y z : A\n#def rev-concat\n( p : x = y)\n( q : y = z)\n  : ( rev A x z (concat A x y z p q)) =\n    ( concat A z y x (rev A y z q) (rev A x y p))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n          (rev A x z' (concat A x y z' p q')) =\n          (concat A z' y x (rev A y z' q') (rev A x y p)))\n      ( rev\n          ( y = x)\n          ( concat A y y x refl (rev A x y p))\n          ( rev A x y p)\n          ( left-unit-concat A y x (rev A x y p)))\n      ( z)\n      ( q)\n
"},{"location":"hott/01-paths.rzk/#postwhiskering-paths-of-paths","title":"Postwhiskering paths of paths","text":"
#def concat-eq-left\n( p q : x = y)\n( H : p = q)\n( r : y = z)\n  : (concat A x y z p r) = (concat A x y z q r)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192 (concat A x y z' p r') = (concat A x y z' q r'))\n      ( H)\n      ( z)\n      ( r)\n
"},{"location":"hott/01-paths.rzk/#prewhiskering-paths-of-paths","title":"Prewhiskering paths of paths","text":"

Prewhiskering paths of paths is much harder.

#def concat-eq-right\n( p : x = y)\n  : ( q : y = z) \u2192\n( r : y = z) \u2192\n( H : q = r) \u2192\n    ( concat A x y z p q) = (concat A x y z p r)\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' p' \u2192\n        ( q : y' = z) \u2192\n( r : y' = z) \u2192\n( H : q = r) \u2192\n        ( concat A x y' z p' q) = (concat A x y' z p' r))\n      ( \\ q r H \u2192\n        concat\n          ( x = z)\n          ( concat A x x z refl q)\n          ( r)\n          ( concat A x x z refl r)\n          ( concat (x = z) (concat A x x z refl q) q r (left-unit-concat A x z q) H)\n          ( rev (x = z) (concat A x x z refl r) r (left-unit-concat A x z r)))\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#identifying-the-two-definitions-of-path-concatenation","title":"Identifying the two definitions of path concatenation","text":"
#def concat-concat'\n( p : x = y)\n  : ( q : y = z) \u2192\n    ( concat A x y z p q) = (concat' A x y z p q)\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' p' \u2192\n          (q' : y' =_{A} z) \u2192\n          (concat A x y' z p' q') =_{x =_{A} z} concat' A x y' z p' q')\n      ( \\ q' \u2192 left-unit-concat A x z q')\n      ( y)\n      ( p)\n#def concat'-concat\n( p : x = y)\n( q : y = z)\n  : concat' A x y z p q = concat A x y z p q\n  :=\n    rev\n      ( x = z)\n      ( concat A x y z p q)\n      ( concat' A x y z p q)\n      ( concat-concat' p q)\n

This is easier to prove for concat' than for concat.

#def alt-triangle-rotation\n( p : x = z)\n( q : x = y)\n  : ( r : y = z) \u2192\n( H : p = concat' A x y z q r) \u2192\n    ( concat' A y x z (rev A x y q) p) = r\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' q' \u2192\n        ( r' : y' =_{A} z) \u2192\n( H' : p = concat' A x y' z q' r') \u2192\n        ( concat' A y' x z (rev A x y' q') p) = r')\n      ( \\ r' H' \u2192 H')\n      ( y)\n      ( q)\n

The following needs to be outside the previous section because of the usage of concat-concat' A y x.

#end derived-path-coherence\n#def triangle-rotation\n( A : U)\n( x y z : A)\n( p : x = z)\n( q : x = y)\n( r : y = z)\n( H : p = concat A x y z q r)\n  : (concat A y x z (rev A x y q) p) = r\n  :=\n    concat\n      ( y = z)\n      ( concat A y x z (rev A x y q) p)\n      ( concat' A y x z (rev A x y q) p)\n      ( r)\n      ( concat-concat' A y x z (rev A x y q) p)\n      ( alt-triangle-rotation\n        ( A) (x) (y) (z) (p) (q) (r)\n        ( concat\n          ( x = z)\n          ( p)\n          ( concat A x y z q r)\n          ( concat' A x y z q r)\n          ( H)\n          ( concat-concat' A x y z q r)))\n
"},{"location":"hott/01-paths.rzk/#concatenation-with-a-path-and-its-reversal","title":"Concatenation with a path and its reversal","text":"
#def retraction-preconcat\n( A : U)\n( x y z : A)\n( p : x = y)\n( q : y = z)\n  : concat A y x z (rev A x y p) (concat A x y z p q) = q\n  :=\n    ind-path (A) (y)\n    ( \\ z' q' \u2192 concat A y x z' (rev A x y p) (concat A x y z' p q') = q') (left-inverse-concat A x y p) (z) (q)\n#def section-preconcat\n( A : U)\n( x y z : A)\n( p : x = y)\n( r : x = z)\n  : concat A x y z p (concat A y x z (rev A x y p) r) = r\n  :=\n    ind-path (A) (x)\n    ( \\ z' r' \u2192 concat A x y z' p (concat A y x z' (rev A x y p) r') = r') (right-inverse-concat A x y p) (z) (r)\n#def retraction-postconcat\n( A : U)\n( x y z : A)\n( q : y = z)\n( p : x = y)\n  : concat A x z y (concat A x y z p q) (rev A y z q) = p\n  :=\n    ind-path (A) (y)\n    ( \\ z' q' \u2192 concat A x z' y (concat A x y z' p q') (rev A y z' q') = p)\n    ( refl) (z) (q)\n#def section-postconcat\n( A : U)\n( x y z : A)\n( q : y = z)\n( r : x = z)\n  : concat A x y z (concat A x z y r (rev A y z q)) q = r\n  :=\n    concat\n      ( x = z)\n      ( concat A x y z (concat A x z y r (rev A y z q)) q)\n      ( concat A x z z r (concat A z y z (rev A y z q) q))\n      ( r)\n      ( associative-concat A x z y z r (rev A y z q) q)\n      ( concat-eq-right A x z z r\n        ( concat A z y z (rev A y z q) q)\n        ( refl)\n        ( left-inverse-concat A y z q))\n
"},{"location":"hott/01-paths.rzk/#application-of-functions-to-paths","title":"Application of functions to paths","text":"
#def ap\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (f x = f y)\n  := ind-path (A) (x) (\\ y' p' \u2192 (f x = f y')) (refl) (y) (p)\n#def ap-rev\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (ap A B y x f (rev A x y p)) = (rev B (f x) (f y) (ap A B x y f p))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ap A B y' x f (rev A x y' p') = rev B (f x) (f y') (ap A B x y' f p'))\n      ( refl)\n      ( y)\n      ( p)\n#def ap-concat\n( A B : U)\n( x y z : A)\n( f : A \u2192 B)\n( p : x = y)\n( q : y = z)\n  : ( ap A B x z f (concat A x y z p q)) =\n    ( concat B (f x) (f y) (f z) (ap A B x y f p) (ap A B y z f q))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n        ( ap A B x z' f (concat A x y z' p q')) =\n        ( concat B (f x) (f y) (f z') (ap A B x y f p) (ap A B y z' f q')))\n      ( refl)\n      ( z)\n      ( q)\n#def rev-ap-rev\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (rev B (f y) (f x) (ap A B y x f (rev A x y p))) = (ap A B x y f p)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        (rev B (f y') (f x) (ap A B y' x f (rev A x y' p'))) =\n        (ap A B x y' f p'))\n      ( refl)\n      ( y)\n      ( p)\n

The following is for a specific use.

#def concat-ap-rev-ap-id\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : ( concat\n      ( B) (f y) (f x) (f y)\n      ( ap A B y x f (rev A x y p))\n      ( ap A B x y f p)) =\n    ( refl)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( concat\n          ( B) (f y') (f x) (f y')\n          ( ap A B y' x f (rev A x y' p')) (ap A B x y' f p')) =\n        ( refl))\n      ( refl)\n      ( y)\n      ( p)\n#def ap-id\n( A : U)\n( x y : A)\n( p : x = y)\n  : (ap A A x y (identity A) p) = p\n  := ind-path (A) (x) (\\ y' p' \u2192 (ap A A x y' (\\ z \u2192 z) p') = p') (refl) (y) (p)\n

Application of a function to homotopic paths yields homotopic paths.

#def ap-eq\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p q : x = y)\n( H : p = q)\n  : (ap A B x y f p) = (ap A B x y f q)\n  :=\n    ind-path\n      ( x = y)\n      ( p)\n      ( \\ q' H' \u2192 (ap A B x y f p) = (ap A B x y f q'))\n      ( refl)\n      ( q)\n      ( H)\n#def ap-comp\n( A B C : U)\n( x y : A)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( p : x = y)\n  : ( ap A C x y (comp A B C g f) p) =\n    ( ap B C (f x) (f y) g (ap A B x y f p))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( ap A C x y' (\\ z \u2192 g (f z)) p') =\n        ( ap B C (f x) (f y') g (ap A B x y' f p')))\n      ( refl)\n      ( y)\n      ( p)\n#def rev-ap-comp\n( A B C : U)\n( x y : A)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( p : x = y)\n  : ( ap B C (f x) (f y) g (ap A B x y f p)) =\n    ( ap A C x y (comp A B C g f) p)\n  :=\n    rev\n      ( g (f x) = g (f y))\n      ( ap A C x y (\\ z \u2192 g (f z)) p)\n      ( ap B C (f x) (f y) g (ap A B x y f p))\n      ( ap-comp A B C x y f g p)\n
"},{"location":"hott/01-paths.rzk/#transport","title":"Transport","text":"
#section transport\n#variable A : U\n#variable B : A \u2192 U\n
"},{"location":"hott/01-paths.rzk/#transport-in-a-type-family-along-a-path-in-the-base","title":"Transport in a type family along a path in the base","text":"
#def transport\n( x y : A)\n( p : x = y)\n( u : B x)\n  : B y\n  := ind-path (A) (x) (\\ y' p' \u2192 B y') (u) (y) (p)\n
"},{"location":"hott/01-paths.rzk/#the-lift-of-a-base-path-to-a-path-from-a-term-in-the-total-space-to-its-transport","title":"The lift of a base path to a path from a term in the total space to its transport","text":"
#def transport-lift\n( x y : A)\n( p : x = y)\n( u : B x)\n  : (x , u) =_{\u03a3 (z : A) , B z} (y , transport x y p u)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 (x , u) =_{\u03a3 (z : A) , B z} (y' , transport x y' p' u))\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#transport-along-concatenated-paths","title":"Transport along concatenated paths","text":"
#def transport-concat\n( x y z : A)\n( p : x = y)\n( q : y = z)\n( u : B x)\n  : ( transport x z (concat A x y z p q) u) =\n    ( transport y z q (transport x y p u))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n        ( transport x z' (concat A x y z' p q') u) =\n        ( transport y z' q' (transport x y p u)))\n      ( refl)\n      ( z)\n      ( q)\n#def transport-concat-rev\n( x y z : A)\n( p : x = y)\n( q : y = z)\n( u : B x)\n  : ( transport y z q (transport x y p u)) =\n    ( transport x z (concat A x y z p q) u)\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' q' \u2192\n        ( transport y z' q' (transport x y p u)) =\n        ( transport x z' (concat A x y z' p q') u))\n      ( refl)\n      ( z)\n      ( q)\n
"},{"location":"hott/01-paths.rzk/#transport-along-homotopic-paths","title":"Transport along homotopic paths","text":"
#def transport2\n( x y : A)\n( p q : x = y)\n( H : p = q)\n( u : B x)\n  : (transport x y p u) = (transport x y q u)\n  :=\n    ind-path\n      ( x = y)\n      ( p)\n      ( \\ q' H' \u2192 (transport x y p u) = (transport x y q' u))\n      ( refl)\n      ( q)\n      ( H)\n
"},{"location":"hott/01-paths.rzk/#transport-along-a-loop","title":"Transport along a loop","text":"
#def transport-loop\n( a : A)\n( b : B a)\n  : (a = a) \u2192 B a\n  := \\ p \u2192 (transport a a p b)\n
#end transport\n
"},{"location":"hott/01-paths.rzk/#substitution-law-for-transport","title":"Substitution law for transport","text":"
#def transport-substitution\n( A' A : U)\n( B : A \u2192 U)\n( f : A' \u2192 A)\n( x y : A')\n( p : x = y)\n( u : B (f x))\n  : transport A' (\\ x \u2192 B (f x)) x y p u =\n    transport A B (f x) (f y) (ap A' A x y f p) u\n  :=\n    ind-path\n      ( A')\n      ( x)\n      ( \\ y' p' \u2192\n        transport A' (\\ x \u2192 B (f x)) x y' p' u =\n        transport A B (f x) (f y') (ap A' A x y' f p') u)\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#path-induction_1","title":"Path induction","text":"

Using rev we can deduce a path induction principle with fixed end point.

#def ind-path-end\n( A : U)\n( a : A)\n( C : (x : A) \u2192 (x = a) -> U)\n( d : C a refl)\n( x : A)\n( p : x = a)\n  : C x p\n  :=\n    transport (x = a) (\\ q \u2192 C x q) (rev A a x (rev A x a p)) p\n      (rev-rev A x a p)\n      (ind-path A a (\\ y q \u2192 C y (rev A a y q)) d x (rev A x a p))\n
"},{"location":"hott/01-paths.rzk/#dependent-application","title":"Dependent application","text":"
#def apd\n( A : U)\n( B : A \u2192 U)\n( x y : A)\n( f : (z : A) \u2192 B z)\n( p : x = y)\n  : (transport A B x y p (f x)) = f y\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( (\\ y' p' \u2192 (transport A B x y' p' (f x)) = f y'))\n      ( refl)\n      ( y)\n      ( p)\n
"},{"location":"hott/01-paths.rzk/#higher-order-concatenation","title":"Higher-order concatenation","text":"

For convenience, we record lemmas for higher-order concatenation here.

#section higher-concatenation\n#variable A : U\n#def triple-concat\n( a0 a1 a2 a3 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n  : a0 = a3\n  := concat A a0 a1 a3 p1 (concat A a1 a2 a3 p2 p3)\n#def quadruple-concat\n( a0 a1 a2 a3 a4 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n( p4 : a3 = a4)\n  : a0 = a4\n  := triple-concat a0 a1 a2 a4 p1 p2 (concat A a2 a3 a4 p3 p4)\n#def quintuple-concat\n( a0 a1 a2 a3 a4 a5 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n( p4 : a3 = a4)\n( p5 : a4 = a5)\n  : a0 = a5\n  := quadruple-concat a0 a1 a2 a3 a5 p1 p2 p3 (concat A a3 a4 a5 p4 p5)\n#def alternating-quintuple-concat\n( a0 : A)\n( a1 : A) (p1 : a0 = a1)\n( a2 : A) (p2 : a1 = a2)\n( a3 : A) (p3 : a2 = a3)\n( a4 : A) (p4 : a3 = a4)\n( a5 : A) (p5 : a4 = a5)\n  : a0 = a5\n  := quadruple-concat a0 a1 a2 a3 a5 p1 p2 p3 (concat A a3 a4 a5 p4 p5)\n#def 12ary-concat\n( a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 : A)\n( p1 : a0 = a1)\n( p2 : a1 = a2)\n( p3 : a2 = a3)\n( p4 : a3 = a4)\n( p5 : a4 = a5)\n( p6 : a5 = a6)\n( p7 : a6 = a7)\n( p8 : a7 = a8)\n( p9 : a8 = a9)\n( p10 : a9 = a10)\n( p11 : a10 = a11)\n( p12 : a11 = a12)\n  : a0 = a12\n  :=\n    quintuple-concat\n      a0 a1 a2 a3 a4 a12\n      p1 p2 p3 p4\n      ( quintuple-concat\n        a4 a5 a6 a7 a8 a12\n        p5 p6 p7 p8\n        ( quadruple-concat\n          a8 a9 a10 a11 a12\n          p9 p10 p11 p12))\n

The following is the same as above but with alternating arguments.

#def alternating-12ary-concat\n( a0 : A)\n( a1 : A) (p1 : a0 = a1)\n( a2 : A) (p2 : a1 = a2)\n( a3 : A) (p3 : a2 = a3)\n( a4 : A) (p4 : a3 = a4)\n( a5 : A) (p5 : a4 = a5)\n( a6 : A) (p6 : a5 = a6)\n( a7 : A) (p7 : a6 = a7)\n( a8 : A) (p8 : a7 = a8)\n( a9 : A) (p9 : a8 = a9)\n( a10 : A) (p10 : a9 = a10)\n( a11 : A) (p11 : a10 = a11)\n( a12 : A) (p12 : a11 = a12)\n  : a0 = a12\n  :=\n    12ary-concat\n      a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12\n      p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12\n#end higher-concatenation\n
"},{"location":"hott/01-paths.rzk/#higher-order-coherences","title":"Higher-order coherences","text":"
#def rev-refl-id-triple-concat\n( A : U)\n( x y : A)\n( p : x = y)\n  : triple-concat A y x x y (rev A x y p) refl p = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 triple-concat A y' x x y' (rev A x y' p') refl p' = refl)\n      ( refl)\n      ( y)\n      ( p)\n#def ap-rev-refl-id-triple-concat\n( A B : U)\n( x y : A)\n( f : A \u2192 B)\n( p : x = y)\n  : (ap A B y y f (triple-concat A y x x y (rev A x y p) refl p)) = refl\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( ap A B y' y' f (triple-concat A y' x x y' (rev A x y' p') refl p')) =\n        ( refl))\n      ( refl)\n      ( y)\n      ( p)\n#def ap-triple-concat\n( A B : U)\n( w x y z : A)\n( f : A \u2192 B)\n( p : w = x)\n( q : x = y)\n( r : y = z)\n  : ( ap A B w z f (triple-concat A w x y z p q r)) =\n    ( triple-concat\n      ( B)\n      ( f w)\n      ( f x)\n      ( f y)\n      ( f z)\n      ( ap A B w x f p)\n      ( ap A B x y f q)\n      ( ap A B y z f r))\n  :=\n    ind-path\n      ( A)\n      ( y)\n      ( \\ z' r' \u2192\n        ( ap A B w z' f (triple-concat A w x y z' p q r')) =\n        ( triple-concat\n          ( B)\n          ( f w) (f x) (f y) (f z')\n          ( ap A B w x f p)\n          ( ap A B x y f q)\n          ( ap A B y z' f r')))\n      ( ap-concat A B w x y f p q)\n      ( z)\n      ( r)\n#def triple-concat-eq-first\n( A : U)\n( w x y z : A)\n( p q : w = x)\n( r : x = y)\n( s : y = z)\n( H : p = q)\n  : (triple-concat A w x y z p r s) = (triple-concat A w x y z q r s)\n  := concat-eq-left A w x z p q H (concat A x y z r s)\n#def triple-concat-eq-second\n( A : U)\n( w x y z : A)\n( p : w = x)\n( q r : x = y)\n( s : y = z)\n( H : q = r)\n  : (triple-concat A w x y z p q s) = (triple-concat A w x y z p r s)\n  :=\n    ind-path\n      ( x = y)\n      ( q)\n      ( \\ r' H' \u2192\n        triple-concat A w x y z p q s = triple-concat A w x y z p r' s)\n      ( refl)\n      ( r)\n      ( H)\n
"},{"location":"hott/02-homotopies.rzk/","title":"2. Homotopies","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/02-homotopies.rzk/#homotopies-and-their-algebra","title":"Homotopies and their algebra","text":"
#section homotopies\n#variables A B : U\n
The type of homotopies between parallel functions
#def homotopy\n( f g : A \u2192 B)\n  : U\n  := ( a : A) \u2192 (f a = g a)\n
The reversal of a homotopy
#def rev-homotopy\n( f g : A \u2192 B)\n( H : homotopy f g)\n  : homotopy g f\n  := \\ a \u2192 rev B (f a) (g a) (H a)\n
#def concat-homotopy\n( f g h : A \u2192 B)\n( H : homotopy f g)\n( K : homotopy g h)\n  : homotopy f h\n  := \\ a \u2192 concat B (f a) (g a) (h a) (H a) (K a)\n

Homotopy composition is defined in diagrammatic order like concat but unlike composition.

#end homotopies\n
"},{"location":"hott/02-homotopies.rzk/#whiskering-homotopies","title":"Whiskering homotopies","text":"
#section homotopy-whiskering\n#variables A B C : U\n#def postwhisker-homotopy\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( h : B \u2192 C)\n  : homotopy A C (comp A B C h f) (comp A B C h g)\n  := \\ a \u2192 ap B C (f a) (g a) h (H a)\n#def prewhisker-homotopy\n( f g : B \u2192 C)\n( H : homotopy B C f g)\n( h : A \u2192 B)\n  : homotopy A C (comp A B C f h) (comp A B C g h)\n  := \\ a \u2192 H (h a)\n#end homotopy-whiskering\n#def whisker-homotopy\n( A B C D : U)\n( h k : B \u2192 C)\n( H : homotopy B C h k)\n( f : A \u2192 B)\n( g : C \u2192 D)\n  : homotopy\n      A\n      D\n      (triple-comp A B C D g h f)\n      (triple-comp A B C D g k f)\n  :=\n    postwhisker-homotopy\n      A\n      C\n      D\n      ( comp A B C h f)\n      ( comp A B C k f)\n      ( prewhisker-homotopy A B C h k H f)\n      g\n
"},{"location":"hott/02-homotopies.rzk/#naturality","title":"Naturality","text":"The naturality square associated to a homotopy and a path
#def nat-htpy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( x y : A)\n( p : x = y)\n  : ( concat B (f x) (f y) (g y) (ap A B x y f p) (H y)) =\n    ( concat B (f x) (g x) (g y) (H x) (ap A B x y g p))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n        ( concat B (f x) (f y') (g y') (ap A B x y' f p') (H y')) =\n        ( concat B (f x) (g x) (g y') (H x) (ap A B x y' g p')))\n      ( left-unit-concat B (f x) (g x) (H x))\n      ( y)\n      ( p)\n
Naturality in another form
#def triple-concat-nat-htpy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( x y : A)\n( p : x = y)\n  : triple-concat\n      ( B) (g x) (f x) (f y) (g y)\n      ( rev B (f x) (g x) (H x)) (ap A B x y f p) (H y) =\n    ap A B x y g p\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192\n          triple-concat\n            ( B)\n            ( g x)\n            ( f x)\n            ( f y')\n            ( g y')\n            ( rev B (f x) (g x) (H x))\n            ( ap A B x y' f p')\n            ( H y') =\n          ap A B x y' g p')\n      ( rev-refl-id-triple-concat B (f x) (g x) (H x))\n      ( y)\n      ( p)\n
"},{"location":"hott/02-homotopies.rzk/#an-application","title":"An application","text":"
#section cocone-naturality\n#variable A : U\n#variable f : A \u2192 A\n#variable H : homotopy A A f (identity A)\n#variable a : A\n

In the case of a homotopy H from f to the identity the previous square applies to the path H a to produce the following naturality square.

#def cocone-naturality\n  : ( concat A (f (f a)) (f a) a (ap A A (f a) a f (H a)) (H a)) =\n    ( concat A (f (f a)) (f a) (a) (H (f a)) (ap A A (f a) a (identity A) (H a)))\n  := nat-htpy A A f (identity A) H (f a) a (H a)\n

After composing with ap-id, this naturality square transforms to the following:

#def reduced-cocone-naturality\n  : ( concat A (f (f a)) (f a) a (ap A A (f a) a f (H a)) (H a)) =\n    ( concat A (f (f a)) (f a) (a) (H (f a)) (H a))\n  :=\n    concat\n      ( (f (f a)) = a)\n      ( concat A (f (f a)) (f a) a (ap A A (f a) a f (H a)) (H a))\n      ( concat\n        ( A)\n        ( f (f a))\n        ( f a)\n        ( a)\n        ( H (f a))\n        ( ap A A (f a) a (identity A) (H a)))\n      ( concat A (f (f a)) (f a) (a) (H (f a)) (H a))\n      ( cocone-naturality)\n      ( concat-eq-right\n        ( A)\n        ( f (f a))\n        ( f a)\n        ( a)\n        ( H (f a))\n        ( ap A A (f a) a (identity A) (H a))\n        ( H a)\n        ( ap-id A (f a) a (H a)))\n

Cancelling the path H a on the right and reversing yields a path we need:

#def cocone-naturality-coherence\n  : (H (f a)) = (ap A A (f a) a f (H a))\n  :=\n    rev\n      ( f (f a) = f a)\n      ( ap A A (f a) a f (H a)) (H (f a))\n      ( right-cancel-concat\n        ( A)\n        ( f (f a))\n        ( f a)\n        ( a)\n        ( ap A A (f a) a f (H a))\n        ( H (f a))\n        ( H a)\n        ( reduced-cocone-naturality))\n#end cocone-naturality\n
"},{"location":"hott/02-homotopies.rzk/#conjugation-with-higher-homotopies","title":"Conjugation with higher homotopies","text":"
#def triple-concat-higher-homotopy\n( A B : U)\n( f g : A \u2192 B)\n( H K : homotopy A B f g)\n( \u03b1 : (a : A) \u2192 H a = K a)\n( x y : A)\n( p : f x = f y)\n  : triple-concat B (g x) (f x) (f y) (g y) (rev B (f x) (g x) (H x)) p (H y) =\n    triple-concat B (g x) (f x) (f y) (g y) (rev B (f x) (g x) (K x)) p (K y)\n  :=\n    ind-path\n      ( f y = g y)\n      ( H y)\n      ( \\ Ky \u03b1' \u2192\n        ( triple-concat\n          ( B) (g x) (f x) (f y) (g y)\n          ( rev B (f x) (g x) (H x)) (p) (H y)) =\n        ( triple-concat\n          ( B) (g x) (f x) (f y) (g y)\n          ( rev B (f x) (g x) (K x)) (p) (Ky)))\n      ( triple-concat-eq-first\n        ( B) (g x) (f x) (f y) (g y)\n        ( rev B (f x) (g x) (H x))\n        ( rev B (f x) (g x) (K x))\n        ( p)\n        ( H y)\n        ( ap\n          ( f x = g x)\n          ( g x = f x)\n          ( H x)\n          ( K x)\n          ( rev B (f x) (g x))\n          ( \u03b1 x)))\n      ( K y)\n      (\u03b1 y)\n
"},{"location":"hott/03-equivalences.rzk/","title":"3. Equivalences","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/03-equivalences.rzk/#sections-retractions-and-equivalences","title":"Sections, retractions, and equivalences","text":"
#section is-equiv\n#variables A B : U\n#def has-section\n( f : A \u2192 B)\n  : U\n  := \u03a3 (s : B \u2192 A) , (homotopy B B (comp B A B f s) (identity B))\n#def has-retraction\n( f : A \u2192 B)\n  : U\n  := \u03a3 (r : B \u2192 A) , (homotopy A A (comp A B A r f) (identity A))\n
#def ind-has-section\n( f : A \u2192 B)\n  ( ( sec-f , \u03b5-f) : has-section f)\n( C : B \u2192 U)\n( s : ( a : A) \u2192 C ( f a))\n( b : B)\n  : C b\n  :=\n    transport B C ( f (sec-f b)) b ( \u03b5-f b) ( s (sec-f b))\n

We define equivalences to be bi-invertible maps.

#def is-equiv\n( f : A \u2192 B)\n  : U\n  := product (has-retraction f) (has-section f)\n#end is-equiv\n
"},{"location":"hott/03-equivalences.rzk/#the-identity-is-an-equivalence","title":"The identity is an equivalence","text":"
#def is-equiv-identity\n( A : U)\n  : is-equiv A A (\\ a \u2192 a)\n  :=\n    ( (\\ a \u2192 a, \\ _ \u2192 refl), (\\ a \u2192 a, \\ _ \u2192 refl))\n
"},{"location":"hott/03-equivalences.rzk/#equivalence-data","title":"Equivalence data","text":"
#section equivalence-data\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-equiv-f : is-equiv A B f\n#def section-is-equiv uses (f)\n  : B \u2192 A\n  := first (second is-equiv-f)\n#def retraction-is-equiv uses (f)\n  : B \u2192 A\n  := first (first is-equiv-f)\n
The homotopy between the section and retraction of an equivalence
#def homotopy-section-retraction-is-equiv uses (f)\n  : homotopy B A section-is-equiv retraction-is-equiv\n  :=\n    concat-homotopy B A\n      ( section-is-equiv)\n      ( triple-comp B A B A retraction-is-equiv f section-is-equiv)\n      ( retraction-is-equiv)\n      ( rev-homotopy B A\n        ( triple-comp B A B A retraction-is-equiv f section-is-equiv)\n        ( section-is-equiv)\n        ( prewhisker-homotopy B A A\n          ( comp A B A retraction-is-equiv f)\n          ( identity A)\n          ( second (first is-equiv-f))\n          ( section-is-equiv)))\n      ( postwhisker-homotopy B B A\n        ( comp B A B f section-is-equiv)\n        ( identity B)\n        ( second (second is-equiv-f))\n        ( retraction-is-equiv))\n#end equivalence-data\n
"},{"location":"hott/03-equivalences.rzk/#invertible-maps","title":"Invertible maps","text":"

The following type of more coherent equivalences is not a proposition.

#def has-inverse\n( A B : U)\n( f : A \u2192 B)\n  : U\n  :=\n\u03a3 ( g : B \u2192 A) ,\n      ( product\n        ( homotopy A A (comp A B A g f) (identity A))\n        ( homotopy B B (comp B A B f g) (identity B)))\n
"},{"location":"hott/03-equivalences.rzk/#equivalences-are-invertible-maps","title":"Equivalences are invertible maps","text":"Invertible maps are equivalences
#def is-equiv-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : is-equiv A B f\n  :=\n    ( ( first has-inverse-f , first (second has-inverse-f)) ,\n      ( first has-inverse-f , second (second has-inverse-f)))\n
Equivalences are invertible
#def has-inverse-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : has-inverse A B f\n  :=\n    ( section-is-equiv A B f is-equiv-f ,\n      ( concat-homotopy A A\n        ( comp A B A (section-is-equiv A B f is-equiv-f) f)\n        ( comp A B A (retraction-is-equiv A B f is-equiv-f) f)\n        ( identity A)\n        ( prewhisker-homotopy A B A\n          ( section-is-equiv A B f is-equiv-f)\n          ( retraction-is-equiv A B f is-equiv-f)\n          ( homotopy-section-retraction-is-equiv A B f is-equiv-f)\n          ( f))\n        ( second (first is-equiv-f)) ,\n      ( second (second is-equiv-f))))\n
"},{"location":"hott/03-equivalences.rzk/#invertible-map-data","title":"Invertible map data","text":"
#section has-inverse-data\n#variables A B : U\n#variable f : A \u2192 B\n#variable has-inverse-f : has-inverse A B f\n
The inverse of a map with an inverse
#def map-inverse-has-inverse uses (f)\n  : B \u2192 A\n  := first (has-inverse-f)\n

The following are some iterated composites associated to a pair of invertible maps.

#def retraction-composite-has-inverse uses (B has-inverse-f)\n  : A \u2192 A\n  := comp A B A map-inverse-has-inverse f\n#def section-composite-has-inverse uses (A has-inverse-f)\n  : B \u2192 B\n  := comp B A B f map-inverse-has-inverse\n

This composite is parallel to f; we won't need the dual notion.

#def triple-composite-has-inverse uses (has-inverse-f)\n  : A \u2192 B\n  := triple-comp A B A B f map-inverse-has-inverse f\n

This composite is also parallel to f; again we won't need the dual notion.

#def quintuple-composite-has-inverse uses (has-inverse-f)\n  : A \u2192 B\n  := \\ a \u2192 f (map-inverse-has-inverse (f (map-inverse-has-inverse (f a))))\n#end has-inverse-data\n
"},{"location":"hott/03-equivalences.rzk/#symmetry-of-having-an-inverse","title":"Symmetry of having an inverse","text":"

The inverse of an invertible map has an inverse.

#def has-inverse-map-inverse-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : has-inverse B A ( map-inverse-has-inverse A B f has-inverse-f)\n  :=\n    ( f,\n      ( second ( second has-inverse-f) ,\nfirst ( second has-inverse-f)))\n
"},{"location":"hott/03-equivalences.rzk/#composing-equivalences","title":"Composing equivalences","text":"

The type of equivalences between types uses is-equiv rather than has-inverse.

#def Equiv\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B) , (is-equiv A B f)\n

The data of an equivalence is not symmetric so we promote an equivalence to an invertible map to prove symmetry:

#def inv-equiv\n( A B : U)\n( e : Equiv A B)\n  : Equiv B A\n  :=\n    ( first (has-inverse-is-equiv A B (first e) (second e)) ,\n      ( ( first e ,\nsecond (second (has-inverse-is-equiv A B (first e) (second e)))) ,\n        ( first e ,\nfirst (second (has-inverse-is-equiv A B (first e) (second e))))))\n
Composition of equivalences in diagrammatic order
#def equiv-comp\n( A B C : U)\n( A\u2243B : Equiv A B)\n( B\u2243C : Equiv B C)\n  : Equiv A C\n  :=\n    ( ( \\ a \u2192 first B\u2243C (first A\u2243B a)) ,\n      ( ( ( \\ c \u2192 first (first (second A\u2243B)) (first (first (second (B\u2243C))) c)) ,\n          ( \\ a \u2192\n            concat A\n              ( first\n                ( first (second A\u2243B))\n                ( first\n                  ( first (second B\u2243C))\n                  ( first B\u2243C (first A\u2243B a))))\n              ( first (first (second A\u2243B)) (first A\u2243B a))\n              ( a)\n              ( ap B A\n                ( first (first (second B\u2243C)) (first B\u2243C (first A\u2243B a)))\n                ( first A\u2243B a)\n                ( first (first (second A\u2243B)))\n                ( second (first (second B\u2243C)) (first A\u2243B a)))\n              ( second (first (second A\u2243B)) a))) ,\n        ( ( \\ c \u2192\nfirst\n            ( second (second A\u2243B))\n            ( first (second (second (B\u2243C))) c)) ,\n          ( \\ c \u2192\n            concat C\n              ( first B\u2243C\n                ( first A\u2243B\n                  ( first\n                    ( second (second A\u2243B))\n                    ( first (second (second B\u2243C)) c))))\n              ( first B\u2243C (first (second (second B\u2243C)) c))\n              ( c)\n              ( ap B C\n                ( first A\u2243B\n                  ( first\n                    ( second (second A\u2243B))\n                    ( first (second (second B\u2243C)) c)))\n                ( first (second (second B\u2243C)) c)\n                ( first B\u2243C)\n                ( second\n                  ( second (second A\u2243B))\n                  ( first (second (second B\u2243C)) c)))\n              ( second (second (second B\u2243C)) c)))))\n

Now we compose the functions that are equivalences.

#def is-equiv-comp\n( A B C : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( g : B \u2192 C)\n( is-equiv-g : is-equiv B C g)\n  : is-equiv A C (comp A B C g f)\n  :=\n    ( ( comp C B A\n        ( retraction-is-equiv A B f is-equiv-f)\n        ( retraction-is-equiv B C g is-equiv-g) ,\n        ( \\ a \u2192\n          concat A\n            ( retraction-is-equiv A B f is-equiv-f\n              ( retraction-is-equiv B C g is-equiv-g (g (f a))))\n            ( retraction-is-equiv A B f is-equiv-f (f a))\n            ( a)\n            ( ap B A\n              ( retraction-is-equiv B C g is-equiv-g (g (f a)))\n              ( f a)\n              ( retraction-is-equiv A B f is-equiv-f)\n              ( second (first is-equiv-g) (f a)))\n            ( second (first is-equiv-f) a))) ,\n      ( comp C B A\n        ( section-is-equiv A B f is-equiv-f)\n        ( section-is-equiv B C g is-equiv-g) ,\n        ( \\ c \u2192\n          concat C\n            ( g (f (first (second is-equiv-f) (first (second is-equiv-g) c))))\n            ( g (first (second is-equiv-g) c))\n            ( c)\n            ( ap B C\n              ( f (first (second is-equiv-f) (first (second is-equiv-g) c)))\n              ( first (second is-equiv-g) c)\n              ( g)\n              ( second (second is-equiv-f) (first (second is-equiv-g) c)))\n            ( second (second is-equiv-g) c))))\n
Right cancellation of equivalences in diagrammatic order
#def equiv-right-cancel\n( A B C : U)\n( A\u2243C : Equiv A C)\n( B\u2243C : Equiv B C)\n  : Equiv A B\n  := equiv-comp A C B (A\u2243C) (inv-equiv B C B\u2243C)\n
Left cancellation of equivalences in diagrammatic order
#def equiv-left-cancel\n( A B C : U)\n( A\u2243B : Equiv A B)\n( A\u2243C : Equiv A C)\n  : Equiv B C\n  := equiv-comp B A C (inv-equiv A B A\u2243B) (A\u2243C)\n

The following functions refine equiv-right-cancel and equiv-left-cancel by providing control over the underlying maps of the equivalence. They also weaken the hypotheses: if a composite is an equivalence and the second map has a retraction the first map is an equivalence, and dually.

#def ap-cancel-has-retraction\n( B C : U)\n( g : B \u2192 C)\n  ( (retr-g, \u03b7-g) : has-retraction B C g)\n( b b' : B)\n  : (g b = g b') \u2192 (b = b')\n  :=\n\\ gp \u2192\n      triple-concat B b (retr-g (g b)) (retr-g (g b')) b'\n        (rev B (retr-g (g b)) b\n          (\u03b7-g b))\n        (ap C B (g b) (g b') retr-g gp)\n        (\u03b7-g b')\n
Right cancellation of equivalence property in diagrammatic order
#def is-equiv-right-cancel\n( A B C : U)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( has-retraction-g : has-retraction B C g)\n  ( ( (retr-gf, \u03b7-gf), (sec-gf, \u03b5-gf)) : is-equiv A C (comp A B C g f))\n  : is-equiv A B f\n  :=\n    ( ( comp B C A retr-gf g, \u03b7-gf) ,\n      ( comp B C A sec-gf g ,\n\\ b \u2192\n            ap-cancel-has-retraction B C g\n            has-retraction-g (f (sec-gf (g b))) b\n            ( \u03b5-gf (g b))\n      )\n    )\n
Left cancellation of equivalence property in diagrammatic order
#def is-equiv-left-cancel\n( A B C : U)\n( f : A \u2192 B)\n( has-section-f : has-section A B f)\n( g : B \u2192 C)\n  ( ( ( retr-gf, \u03b7-gf), (sec-gf, \u03b5-gf)) : is-equiv A C (comp A B C g f))\n  : is-equiv B C g\n  :=\n    ( ( comp C A B f retr-gf ,\n        ind-has-section A B f has-section-f\n          ( \\ b \u2192 f (retr-gf (g b)) = b)\n          ( \\ a \u2192 ap A B (retr-gf (g ( f a))) a f (\u03b7-gf a))\n      ) ,\n      ( comp C A B f sec-gf, \u03b5-gf)\n    )\n

We typically apply the cancelation property in a setting where the composite and one map are known to be equivalences, so we define versions of the above functions with these stronger hypotheses.

#def is-equiv-right-factor\n( A B C : U)\n( f : A \u2192 B)\n( g : B \u2192 C)\n( is-equiv-g : is-equiv B C g)\n( is-equiv-gf : is-equiv A C (comp A B C g f))\n  : is-equiv A B f\n  :=\n    is-equiv-right-cancel A B C f g (first is-equiv-g) is-equiv-gf\n#def is-equiv-left-factor\n( A B C : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( g : B \u2192 C)\n( is-equiv-gf : is-equiv A C (comp A B C g f))\n  : is-equiv B C g\n  :=\n    is-equiv-left-cancel A B C f (second is-equiv-f) g is-equiv-gf\n
A composition of three equivalences
#def equiv-triple-comp\n( A B C D : U)\n( A\u2243B : Equiv A B)\n( B\u2243C : Equiv B C)\n( C\u2243D : Equiv C D)\n  : Equiv A D\n  := equiv-comp A B D (A\u2243B) (equiv-comp B C D B\u2243C C\u2243D)\n#def is-equiv-triple-comp\n( A B C D : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( g : B \u2192 C)\n( is-equiv-g : is-equiv B C g)\n( h : C \u2192 D)\n( is-equiv-h : is-equiv C D h)\n  : is-equiv A D (triple-comp A B C D h g f)\n  :=\n    is-equiv-comp A B D\n      ( f)\n      ( is-equiv-f)\n      ( comp B C D h g)\n      ( is-equiv-comp B C D g is-equiv-g h is-equiv-h)\n
"},{"location":"hott/03-equivalences.rzk/#equivalences-and-homotopy","title":"Equivalences and homotopy","text":"

If a map is homotopic to an equivalence it is an equivalence.

#def is-equiv-homotopy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( is-equiv-g : is-equiv A B g)\n  : is-equiv A B f\n  :=\n    ( ( ( first (first is-equiv-g)) ,\n        ( \\ a \u2192\n          concat A\n            ( first (first is-equiv-g) (f a))\n            ( first (first is-equiv-g) (g a))\n            ( a)\n            ( ap B A (f a) (g a) (first (first is-equiv-g)) (H a))\n            ( second (first is-equiv-g) a))) ,\n      ( ( first (second is-equiv-g)) ,\n        ( \\ b \u2192\n          concat B\n            ( f (first (second is-equiv-g) b))\n            ( g (first (second is-equiv-g) b))\n            ( b)\n            ( H (first (second is-equiv-g) b))\n            ( second (second is-equiv-g) b))))\n#def is-equiv-rev-homotopy\n( A B : U)\n( f g : A \u2192 B)\n( H : homotopy A B f g)\n( is-equiv-f : is-equiv A B f)\n  : is-equiv A B g\n  := is-equiv-homotopy A B g f (rev-homotopy A B f g H) is-equiv-f\n
"},{"location":"hott/03-equivalences.rzk/#reversing-equivalences","title":"Reversing equivalences","text":"

The section associated with an equivalence is an equivalence.

#def is-equiv-section-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-equiv B A ( section-is-equiv A B f is-equiv-f)\n  :=\n    is-equiv-has-inverse B A\n      ( section-is-equiv A B f is-equiv-f)\n      ( has-inverse-map-inverse-has-inverse A B f\n        ( has-inverse-is-equiv A B f is-equiv-f))\n

The retraction associated with an equivalence is an equivalence.

#def is-equiv-retraction-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-equiv B A ( retraction-is-equiv A B f is-equiv-f)\n  :=\n    is-equiv-rev-homotopy B A\n      ( section-is-equiv A B f is-equiv-f)\n      ( retraction-is-equiv A B f is-equiv-f)\n      ( homotopy-section-retraction-is-equiv A B f is-equiv-f)\n      ( is-equiv-section-is-equiv A B f is-equiv-f)\n
"},{"location":"hott/03-equivalences.rzk/#function-extensionality","title":"Function extensionality","text":"

By path induction, an identification between functions defines a homotopy.

#def htpy-eq\n( X : U)\n( A : X \u2192 U)\n( f g : (x : X) \u2192 A x)\n( p : f = g)\n  : (x : X) \u2192 (f x = g x)\n  :=\n    ind-path\n( (x : X) \u2192 A x)\n      ( f)\n( \\ g' p' \u2192 (x : X) \u2192 (f x = g' x))\n      ( \\ x \u2192 refl)\n      ( g)\n      ( p)\n

The function extensionality axiom asserts that this map defines a family of equivalences.

The type that encodes the function extensionality axiom
#def FunExt : U\n  :=\n( X : U) \u2192\n( A : X \u2192 U) \u2192\n( f : (x : X) \u2192 A x) \u2192\n( g : (x : X) \u2192 A x) \u2192\n    is-equiv (f = g) ((x : X) \u2192 f x = g x) (htpy-eq X A f g)\n

In the formalisations below, some definitions will assume function extensionality:

#assume funext : FunExt\n

Whenever a definition (implicitly) uses function extensionality, we write uses (funext). In particular, the following definitions rely on function extensionality:

The equivalence provided by function extensionality
#def equiv-FunExt uses (funext)\n( X : U)\n( A : X \u2192 U)\n( f g : (x : X) \u2192 A x)\n  : Equiv (f = g) ((x : X) \u2192 f x = g x)\n  := (htpy-eq X A f g , funext X A f g)\n

In particular, function extensionality implies that homotopies give rise to identifications. This defines eq-htpy to be the retraction to htpy-eq.

#def eq-htpy uses (funext)\n( X : U)\n( A : X \u2192 U)\n( f g : (x : X) \u2192 A x)\n  : ((x : X) \u2192 f x = g x) \u2192 (f = g)\n  := first (first (funext X A f g))\n

Using function extensionality, a fiberwise equivalence defines an equivalence of dependent function types.

#def is-equiv-function-is-equiv-family uses (funext)\n( X : U)\n( A B : X \u2192 U)\n( f : (x : X) \u2192 (A x) \u2192 (B x))\n( famisequiv : (x : X) \u2192 is-equiv (A x) (B x) (f x))\n  : is-equiv ((x : X) \u2192 A x) ((x : X) \u2192 B x) ( \\ a x \u2192 f x (a x))\n  :=\n    ( ( ( \\ b x \u2192 first (first (famisequiv x)) (b x)) ,\n        ( \\ a \u2192\n           eq-htpy\n            X A\n           ( \\ x \u2192\nfirst\n                ( first (famisequiv x))\n                ( f x (a x)))\n            ( a)\n            ( \\ x \u2192 second (first (famisequiv x)) (a x)))) ,\n      ( ( \\ b x \u2192 first (second (famisequiv x)) (b x)) ,\n        ( \\ b \u2192\n            eq-htpy\n            X B\n            ( \\ x \u2192\n               f x (first (second (famisequiv x)) (b x)))\n            ( b)\n            ( \\ x \u2192 second (second (famisequiv x)) (b x)))))\n
#def equiv-function-equiv-family uses (funext)\n( X : U)\n( A B : X \u2192 U)\n( famequiv : (x : X) \u2192 Equiv (A x) (B x))\n  : Equiv ((x : X) \u2192 A x) ((x : X) \u2192 B x)\n  :=\n    ( ( \\ a x \u2192 (first (famequiv x)) (a x)) ,\n      ( is-equiv-function-is-equiv-family\n        ( X)\n        ( A)\n        ( B)\n        ( \\ x ax \u2192 first (famequiv x) (ax))\n        ( \\ x \u2192 second (famequiv x))))\n
"},{"location":"hott/03-equivalences.rzk/#embeddings","title":"Embeddings","text":"
#def is-emb\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := (x : A) \u2192 (y : A) \u2192 is-equiv (x = y) (f x = f y) (ap A B x y f)\n#def Emb\n( A B : U)\n  : U\n  := (\u03a3 (f : A \u2192 B) , is-emb A B f)\n#def is-emb-is-inhabited-emb\n( A B : U)\n( f : A \u2192 B)\n( e : A \u2192 is-emb A B f)\n  : is-emb A B f\n  := \\ x y \u2192 e x x y\n#def inv-ap-is-emb\n( A B : U)\n( f : A \u2192 B)\n( is-emb-f : is-emb A B f)\n( x y : A)\n( p : f x = f y)\n  : (x = y)\n  := first (first (is-emb-f x y)) p\n
"},{"location":"hott/03-equivalences.rzk/#reversal-is-an-equivalence","title":"Reversal is an equivalence","text":"
#def equiv-rev\n( A : U)\n( x y : A)\n  : Equiv (x = y) (y = x)\n  := (rev A x y , ((rev A y x , rev-rev A x y) , (rev A y x , rev-rev A y x)))\n
"},{"location":"hott/03-equivalences.rzk/#concatenation-with-a-fixed-path-is-an-equivalence","title":"Concatenation with a fixed path is an equivalence","text":"
#def equiv-preconcat\n( A : U)\n( x y z : A)\n( p : x = y)\n  : Equiv (y = z) (x = z)\n  :=\n    ( concat A x y z p,\n      ( ( concat A y x z (rev A x y p), retraction-preconcat A x y z p),\n        ( concat A y x z (rev A x y p), section-preconcat A x y z p)))\n#def equiv-postconcat\n( A : U)\n( x y z : A)\n( q : y = z) : Equiv (x = y) (x = z)\n  :=\n    ( \\ p \u2192 concat A x y z p q,\n      ( ( \\ r \u2192 concat A x z y r (rev A y z q),\n          retraction-postconcat A x y z q),\n        ( \\ r \u2192 concat A x z y r (rev A y z q),\n          section-postconcat A x y z q)))\n
"},{"location":"hott/03-equivalences.rzk/#transport-along-a-path-is-an-equivalence","title":"Transport along a path is an equivalence","text":"
#def is-equiv-transport\n( A : U)\n( C : A \u2192 U)\n( x : A)\n  : (y : A) \u2192 ( p : x = y) \u2192 is-equiv (C x) (C y) (transport A C x y p)\n  := ind-path A x\n       ( \\ y p \u2192 is-equiv (C x) (C y) (transport A C x y p))\n       ( is-equiv-identity (C x) )\n
"},{"location":"hott/03-equivalences.rzk/#equivalence-is-equivalence-invariant","title":"Equivalence is equivalence invariant","text":"
#def map-of-maps\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  : U\n  :=\n\u03a3 ( ( s',s) : product ( A' \u2192 B' ) ( A \u2192 B)),\n( ( a' : A') \u2192 \u03b2 ( s' a') = s ( \u03b1 a'))\n#def Equiv-of-maps\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  : U\n  :=\n\u03a3 ( ((s', s), _) : map-of-maps A' A \u03b1 B' B \u03b2),\n      ( product\n          ( is-equiv A' B' s')\n          ( is-equiv A B s)\n      )\n#def is-equiv-equiv-is-equiv\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ((s', s), \u03b7) : map-of-maps A' A \u03b1 B' B \u03b2)\n( is-equiv-s' : is-equiv A' B' s')\n( is-equiv-s : is-equiv A B s)\n( is-equiv-\u03b2 : is-equiv B' B \u03b2)\n  : is-equiv A' A \u03b1\n  :=\n    is-equiv-right-factor A' A B \u03b1 s is-equiv-s\n      ( is-equiv-rev-homotopy A' B\n          ( comp A' B' B \u03b2 s')\n          ( comp A' A B s \u03b1)\n          ( \u03b7 )\n          ( is-equiv-comp A' B' B s' is-equiv-s' \u03b2 is-equiv-\u03b2)\n      )\n#def is-equiv-Equiv-is-equiv\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ( S, (is-equiv-s',is-equiv-s)) : Equiv-of-maps A' A \u03b1 B' B \u03b2 )\n  : is-equiv B' B \u03b2 \u2192 is-equiv A' A \u03b1\n  :=\n    is-equiv-equiv-is-equiv A' A \u03b1 B' B \u03b2 S is-equiv-s' is-equiv-s\n#def is-equiv-equiv-is-equiv'\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ((s', s), \u03b7) : map-of-maps A' A \u03b1 B' B \u03b2)\n( is-equiv-s' : is-equiv A' B' s')\n( is-equiv-s : is-equiv A B s)\n( is-equiv-\u03b1 : is-equiv A' A \u03b1)\n  : is-equiv B' B \u03b2\n  :=\n    is-equiv-left-factor A' B' B s' is-equiv-s' \u03b2\n      ( is-equiv-homotopy A' B\n        ( comp A' B' B \u03b2 s')\n        ( comp A' A B s \u03b1)\n        ( \u03b7)\n        ( is-equiv-comp A' A B \u03b1 is-equiv-\u03b1 s is-equiv-s)\n      )\n#def is-equiv-Equiv-is-equiv'\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ( S, (is-equiv-s',is-equiv-s)) : Equiv-of-maps A' A \u03b1 B' B \u03b2 )\n  : is-equiv A' A \u03b1 \u2192 is-equiv B' B \u03b2\n  :=\n    is-equiv-equiv-is-equiv' A' A \u03b1 B' B \u03b2 S is-equiv-s' is-equiv-s\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/","title":"4. Half Adjoint Equivalences","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#half-adjoint-equivalences","title":"Half adjoint equivalences","text":"

We'll require a more coherent notion of equivalence. Namely, the notion of half adjoint equivalences.

#def is-half-adjoint-equiv\n( A B : U)\n( f : A \u2192 B)\n  : U\n  :=\n\u03a3 ( has-inverse-f : (has-inverse A B f)) ,\n( ( a : A) \u2192\n        ( second (second has-inverse-f) (f a)) =\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f a)\n          ( a)\n          ( f)\n          ( first (second has-inverse-f) a)))\n

By function extensionality, the previous definition coincides with the following one:

#def is-half-adjoint-equiv'\n(A B : U)\n(f : A \u2192 B)\n  : U\n  :=\n\u03a3 ( has-inverse-f : (has-inverse A B f)) ,\n( ( a : A) \u2192\n        ( second (second has-inverse-f) (f a)) =\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f a)\n          ( a)\n          ( f)\n          ( first (second has-inverse-f) a)))\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#half-adjoint-equivalence-data","title":"Half adjoint equivalence data","text":"
#section half-adjoint-equivalence-data\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-hae-f : is-half-adjoint-equiv A B f\n#def map-inverse-is-half-adjoint-equiv uses (f)\n  : B \u2192 A\n  := map-inverse-has-inverse A B f (first is-hae-f)\n#def retraction-htpy-is-half-adjoint-equiv\n  : homotopy A A (comp A B A map-inverse-is-half-adjoint-equiv f) (identity A)\n  := first (second (first is-hae-f))\n#def section-htpy-is-half-adjoint-equiv\n  : homotopy B B (comp B A B f map-inverse-is-half-adjoint-equiv) (identity B)\n  := second (second (first is-hae-f))\n#def coherence-is-half-adjoint-equiv\n( a : A)\n  : section-htpy-is-half-adjoint-equiv (f a) =\n    ap A B (map-inverse-is-half-adjoint-equiv (f a)) a f\n    ( retraction-htpy-is-half-adjoint-equiv a)\n  := (second is-hae-f) a\n#end half-adjoint-equivalence-data\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#coherence-data-from-an-invertible-map","title":"Coherence data from an invertible map","text":"

To promote an invertible map to a half adjoint equivalence we keep one homotopy and discard the other.

#def has-inverse-kept-htpy\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : homotopy A A\n    ( retraction-composite-has-inverse A B f has-inverse-f) (identity A)\n  := ( first (second has-inverse-f))\n#def has-inverse-discarded-htpy\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : homotopy B B\n    ( section-composite-has-inverse A B f has-inverse-f) (identity B)\n  := (second (second has-inverse-f))\n

The required coherence will be built by transforming an instance of the following naturality square.

#section has-inverse-coherence\n#variables A B : U\n#variable f : A \u2192 B\n#variable has-inverse-f : has-inverse A B f\n#variable a : A\n#def has-inverse-discarded-naturality-square\n  : concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n    ( triple-composite-has-inverse A B f has-inverse-f a)\n    ( f a)\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( triple-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n    ( has-inverse-discarded-htpy A B f has-inverse-f (f a)) =\n    concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n      ( triple-composite-has-inverse A B f has-inverse-f a)\n      ( f a)\n      ( has-inverse-discarded-htpy A B f has-inverse-f\n        ( triple-composite-has-inverse A B f has-inverse-f a))\n      ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n        f (has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    nat-htpy A B\n    ( triple-composite-has-inverse A B f has-inverse-f)\n    ( f)\n    ( \\ x \u2192 has-inverse-discarded-htpy A B f has-inverse-f (f x))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( a)\n    ( has-inverse-kept-htpy A B f has-inverse-f a)\n

We build a path that will be whiskered into the naturality square above:

#def has-inverse-cocone-homotopy-coherence\n  : has-inverse-kept-htpy A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a) =\n    ap A A (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( retraction-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a)\n  :=\n    cocone-naturality-coherence\n      ( A)\n      ( retraction-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f)\n      ( a)\n#def has-inverse-ap-cocone-homotopy-coherence\n  : ap A B\n    ( retraction-composite-has-inverse A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( f)\n    ( has-inverse-kept-htpy A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a)) =\n    ap A B\n    ( retraction-composite-has-inverse A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( f)\n    ( ap A A (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( retraction-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    ap-eq A B\n      ( retraction-composite-has-inverse A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a))\n      ( retraction-composite-has-inverse A B f has-inverse-f a)\n      ( f)\n      ( has-inverse-kept-htpy A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a))\n      ( ap A A (retraction-composite-has-inverse A B f has-inverse-f a) a\n        ( retraction-composite-has-inverse A B f has-inverse-f)\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n      ( has-inverse-cocone-homotopy-coherence)\n#def has-inverse-cocone-coherence\n  : ap A B\n    ( retraction-composite-has-inverse A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a))\n    ( retraction-composite-has-inverse A B f has-inverse-f a)\n    ( f)\n    ( has-inverse-kept-htpy A B f has-inverse-f\n      ( retraction-composite-has-inverse A B f has-inverse-f a)) =\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n      ( triple-composite-has-inverse A B f has-inverse-f)\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    concat\n      ( quintuple-composite-has-inverse A B f has-inverse-f a =\n        triple-composite-has-inverse A B f has-inverse-f a)\n      ( ap A B\n        ( retraction-composite-has-inverse A B f has-inverse-f\n          ( retraction-composite-has-inverse A B f has-inverse-f a))\n        ( retraction-composite-has-inverse A B f has-inverse-f a)\n        ( f)\n        ( has-inverse-kept-htpy A B f has-inverse-f\n          ( retraction-composite-has-inverse A B f has-inverse-f a)))\n      ( ap A B\n        ( retraction-composite-has-inverse A B f has-inverse-f\n          ( retraction-composite-has-inverse A B f has-inverse-f a))\n        ( retraction-composite-has-inverse A B f has-inverse-f a)\n        ( f)\n        ( ap A A\n          ( retraction-composite-has-inverse A B f has-inverse-f a) a\n          ( retraction-composite-has-inverse A B f has-inverse-f)\n          ( has-inverse-kept-htpy A B f has-inverse-f a)))\n      ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n        ( triple-composite-has-inverse A B f has-inverse-f)\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n      ( has-inverse-ap-cocone-homotopy-coherence)\n      ( rev-ap-comp A A B\n        ( retraction-composite-has-inverse A B f has-inverse-f a) a\n        ( retraction-composite-has-inverse A B f has-inverse-f)\n        ( f)\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n

This morally gives the half adjoint inverse coherence. It just requires rotation.

#def has-inverse-replaced-naturality-square\n  : concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n    ( triple-composite-has-inverse A B f has-inverse-f a)\n    ( f a)\n    ( ap A B\n      ( retraction-composite-has-inverse A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a))\n      ( retraction-composite-has-inverse A B f has-inverse-f a)\n      ( f)\n      ( has-inverse-kept-htpy A B f has-inverse-f\n        ( retraction-composite-has-inverse A B f has-inverse-f a)))\n    ( has-inverse-discarded-htpy A B f has-inverse-f (f a)) =\n    concat B\n    ( quintuple-composite-has-inverse A B f has-inverse-f a)\n    ( triple-composite-has-inverse A B f has-inverse-f a)\n    ( f a)\n    ( has-inverse-discarded-htpy A B f has-inverse-f\n      ( triple-composite-has-inverse A B f has-inverse-f a))\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    concat\n      ( quintuple-composite-has-inverse A B f has-inverse-f a = f a)\n      ( concat B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a)\n        ( f a)\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a))\n          ( retraction-composite-has-inverse A B f has-inverse-f a) f\n          ( has-inverse-kept-htpy A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a)))\n        ( has-inverse-discarded-htpy A B f has-inverse-f (f a)))\n      ( concat B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a)\n        ( f a)\n        ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n          ( triple-composite-has-inverse A B f has-inverse-f)\n          ( has-inverse-kept-htpy A B f has-inverse-f a))\n        ( has-inverse-discarded-htpy A B f has-inverse-f (f a)))\n      ( concat B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a) (f a)\n        ( has-inverse-discarded-htpy A B f has-inverse-f\n          ( triple-composite-has-inverse A B f has-inverse-f a))\n        ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n          ( has-inverse-kept-htpy A B f has-inverse-f a)))\n      ( concat-eq-left B\n        ( quintuple-composite-has-inverse A B f has-inverse-f a)\n        ( triple-composite-has-inverse A B f has-inverse-f a)\n        ( f a)\n        ( ap A B\n          ( retraction-composite-has-inverse A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a))\n          ( retraction-composite-has-inverse A B f has-inverse-f a)\n          ( f)\n          ( has-inverse-kept-htpy A B f has-inverse-f\n            ( retraction-composite-has-inverse A B f has-inverse-f a)))\n        ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a\n          ( triple-composite-has-inverse A B f has-inverse-f)\n          ( has-inverse-kept-htpy A B f has-inverse-f a))\n        ( has-inverse-cocone-coherence)\n        ( has-inverse-discarded-htpy A B f has-inverse-f (f a)))\n      ( has-inverse-discarded-naturality-square)\n

This will replace the discarded homotopy.

#def has-inverse-corrected-htpy\n  : homotopy B B (section-composite-has-inverse A B f has-inverse-f) (\\ b \u2192 b)\n  :=\n\\ b \u2192\n      concat B\n        ( (section-composite-has-inverse A B f has-inverse-f) b)\n        ( (section-composite-has-inverse A B f has-inverse-f)\n          ((section-composite-has-inverse A B f has-inverse-f) b))\n        ( b)\n        ( rev B\n          ( (section-composite-has-inverse A B f has-inverse-f)\n            ((section-composite-has-inverse A B f has-inverse-f) b))\n          ( (section-composite-has-inverse A B f has-inverse-f) b)\n          ( has-inverse-discarded-htpy A B f has-inverse-f\n            ((section-composite-has-inverse A B f has-inverse-f) b)))\n        ( concat B\n          ( (section-composite-has-inverse A B f has-inverse-f)\n            ((section-composite-has-inverse A B f has-inverse-f) b))\n          ( (section-composite-has-inverse A B f has-inverse-f) b)\n          ( b)\n          ( ap A B\n            ( (retraction-composite-has-inverse A B f has-inverse-f)\n              (map-inverse-has-inverse A B f has-inverse-f b))\n            ( map-inverse-has-inverse A B f has-inverse-f b) f\n            ( (first (second has-inverse-f))\n              (map-inverse-has-inverse A B f has-inverse-f b)))\n          ( (has-inverse-discarded-htpy A B f has-inverse-f b)))\n

The following is the half adjoint coherence.

#def has-inverse-coherence\n  : ( has-inverse-corrected-htpy (f a)) =\n    ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n      ( has-inverse-kept-htpy A B f has-inverse-f a))\n  :=\n    triangle-rotation B\n      ( quintuple-composite-has-inverse A B f has-inverse-f a)\n      ( triple-composite-has-inverse A B f has-inverse-f a)\n      ( f a)\n      ( concat B\n        ( (section-composite-has-inverse A B f has-inverse-f)\n          ((section-composite-has-inverse A B f has-inverse-f) (f a)))\n        ( (section-composite-has-inverse A B f has-inverse-f) (f a))\n        ( f a)\n        ( ap A B\n          ( (retraction-composite-has-inverse A B f has-inverse-f)\n            (map-inverse-has-inverse A B f has-inverse-f (f a)))\n          ( map-inverse-has-inverse A B f has-inverse-f (f a))\n            ( f)\n            ( (first (second has-inverse-f))\n              (map-inverse-has-inverse A B f has-inverse-f (f a))))\n        ( (has-inverse-discarded-htpy A B f has-inverse-f (f a))))\n      ( has-inverse-discarded-htpy A B f has-inverse-f\n        ( triple-composite-has-inverse A B f has-inverse-f a))\n      ( ap A B (retraction-composite-has-inverse A B f has-inverse-f a) a f\n        ( has-inverse-kept-htpy A B f has-inverse-f a))\n      ( has-inverse-replaced-naturality-square)\n
#end has-inverse-coherence\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#invertible-maps-are-half-adjoint-equivalences","title":"Invertible maps are half adjoint equivalences","text":"

To promote an invertible map to a half adjoint equivalence we change the data of the invertible map by discarding the homotopy and replacing it with a corrected one.

#def corrected-has-inverse-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : has-inverse A B f\n  :=\n    ( map-inverse-has-inverse A B f has-inverse-f ,\n      ( has-inverse-kept-htpy A B f has-inverse-f ,\n        has-inverse-corrected-htpy A B f has-inverse-f))\n
Invertible maps are half adjoint equivalences!
#def is-half-adjoint-equiv-has-inverse\n( A B : U)\n( f : A \u2192 B)\n( has-inverse-f : has-inverse A B f)\n  : is-half-adjoint-equiv A B f\n  :=\n    ( corrected-has-inverse-has-inverse A B f has-inverse-f ,\n      has-inverse-coherence A B f has-inverse-f)\n
Equivalences are half adjoint equivalences!
#def is-half-adjoint-equiv-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-half-adjoint-equiv A B f\n  :=\n    is-half-adjoint-equiv-has-inverse A B f\n      ( has-inverse-is-equiv A B f is-equiv-f)\n
"},{"location":"hott/04-half-adjoint-equivalences.rzk/#equivalences-are-embeddings","title":"Equivalences are embeddings","text":"

We use the notion of half adjoint equivalence to prove that equivalent types have equivalent identity types by showing that equivalences are embeddings.

#section equiv-identity-types-equiv\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-hae-f : is-half-adjoint-equiv A B f\n#def iff-ap-is-half-adjoint-equiv\n( x y : A)\n  : iff (x = y) (f x = f y)\n  :=\n    ( ap A B x y f ,\n\\ q \u2192\n      triple-concat A\n        ( x)\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( y)\n        ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n          ( (first (second (first is-hae-f))) x))\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q)\n        ( (first (second (first is-hae-f))) y))\n#def has-retraction-ap-is-half-adjoint-equiv\n(x y : A)\n  : has-retraction (x = y) (f x = f y) (ap A B x y f)\n  :=\n    ( ( second (iff-ap-is-half-adjoint-equiv x y)) ,\n      ( ind-path\n          ( A)\n          ( x)\n          ( \\ y' p' \u2192\n            ( second (iff-ap-is-half-adjoint-equiv x y')) (ap A B x y' f p') =\n            ( p'))\n          ( rev-refl-id-triple-concat A\n            ( map-inverse-has-inverse A B f (first is-hae-f) (f x))\n            ( x)\n            ( first (second (first is-hae-f)) x))\n          ( y)))\n#def ap-triple-concat-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : ap A B x y f ((second (iff-ap-is-half-adjoint-equiv x y)) q) =\n    (triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( ap A B x ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n        ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n          ( (first (second (first is-hae-f))) x)))\n      ( ap A B\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( f)\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n        ( (first (second (first is-hae-f))) y)))\n  :=\n    ap-triple-concat A B\n      ( x)\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( y)\n      ( f)\n      ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n        ( (first (second (first is-hae-f))) x))\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q)\n      ( (first (second (first is-hae-f))) y)\n#def ap-rev-triple-concat-eq-first-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( ap A B x ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n      (rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n        ( (first (second (first is-hae-f))) x)))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( f)\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n    ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n      ( (first (second (first is-hae-f))) y)) =\n    triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n        ( (first (second (first is-hae-f))) x)))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( f)\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( y)\n      ( f)\n      ( (first (second (first is-hae-f))) y))\n  :=\n    triple-concat-eq-first B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( ap A B\n      ( x) ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n      ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n        ( (first (second (first is-hae-f))) x)))\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n        ( (first (second (first is-hae-f))) x)))\n    ( ap A B\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n      ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n      ( f)\n      ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n    ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n      ( (first (second (first is-hae-f))) y))\n    ( ap-rev A B (retraction-composite-has-inverse A B f (first is-hae-f) x) x f\n      ( (first (second (first is-hae-f))) x))\n#def ap-ap-triple-concat-eq-first-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : (triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B\n        ( f (retraction-composite-has-inverse A B f (first is-hae-f) x))\n        ( f x)\n        ( ap A B\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n          ( (first (second (first is-hae-f))) x)))\n      ( ap A B\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( f)\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n        ( (first (second (first is-hae-f))) y))) =\n    ( triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B\n        ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n          ( (first (second (first is-hae-f))) x)))\n      ( ap B B (f x) (f y)\n        ( section-composite-has-inverse A B f (first is-hae-f)) q)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y\n        ( f) ((first (second (first is-hae-f))) y)))\n  :=\n    triple-concat-eq-second B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n          ( (first (second (first is-hae-f))) x)))\n      ( ap A B\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n        ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y))\n        ( f)\n        ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n      ( ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n        ( (first (second (first is-hae-f))) y))\n      ( rev-ap-comp B A B (f x) (f y)\n        ( map-inverse-has-inverse A B f (first is-hae-f)) f q)\n-- This needs to be reversed later.\n#def triple-concat-higher-homotopy-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      ( rev B ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        ( (second (second (first is-hae-f))) (f x)))\n      ( ap B B (f x) (f y)\n        ( section-composite-has-inverse A B f (first is-hae-f)) q)\n      ( (second (second (first is-hae-f))) (f y)) =\n    triple-concat B\n      ( f x)\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n      ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n      ( f y)\n      (rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n        (ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f ((first (second (first is-hae-f))) x)))\n        (ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n        (ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f ((first (second (first is-hae-f))) y))\n  :=\n    triple-concat-higher-homotopy A B\n      ( triple-composite-has-inverse A B f (first is-hae-f)) f\n      ( \\ a \u2192 (((second (second (first is-hae-f)))) (f a)))\n      ( \\ a \u2192\n        ( ap A B (retraction-composite-has-inverse A B f (first is-hae-f) a) a f\n          ( ((first (second (first is-hae-f)))) a)))\n      ( second is-hae-f)\n      ( x)\n      ( y)\n      ( ap B B (f x) (f y)\n        ( section-composite-has-inverse A B f (first is-hae-f)) q)\n#def triple-concat-nat-htpy-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ((second (second (first is-hae-f)))) (f x)))\n    ( ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n    ( ((second (second (first is-hae-f)))) (f y))\n    = ap B B (f x) (f y) (identity B) q\n  :=\n    triple-concat-nat-htpy B B\n      ( section-composite-has-inverse A B f (first is-hae-f))\n      ( identity B)\n      ( (second (second (first is-hae-f))))\n      ( f x)\n      ( f y)\n      q\n#def zag-zig-concat-triple-concat-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : triple-concat B\n    ( f x)\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n    ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n    ( f y)\n    ( rev B (f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n      ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n        ( (first (second (first is-hae-f))) x)))\n    ( ap B B (f x) (f y) (section-composite-has-inverse A B f (first is-hae-f)) q)\n    ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n      ( (first (second (first is-hae-f))) y)) =\n    ap B B (f x) (f y) (identity B) q\n  :=\n    zag-zig-concat (f x = f y)\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n          ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n            ( (first (second (first is-hae-f))) x)))\n        ( ap B B (f x) (f y)\n          ( section-composite-has-inverse A B f (first is-hae-f)) q)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y\n          f ((first (second (first is-hae-f))) y)))\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x))\n          ( f x)\n          ( ((second (second (first is-hae-f)))) (f x)))\n        ( ap B B (f x) (f y)\n          ( section-composite-has-inverse A B f (first is-hae-f)) q)\n        ( ((second (second (first is-hae-f)))) (f y)))\n      ( ap B B (f x) (f y) (identity B) q)\n      ( triple-concat-higher-homotopy-is-half-adjoint-equiv x y q)\n      ( triple-concat-nat-htpy-is-half-adjoint-equiv x y q)\n#def triple-concat-reduction-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : ap B B (f x) (f y) (identity B) q = q\n  := ap-id B (f x) (f y) q\n#def section-htpy-ap-is-half-adjoint-equiv\n( x y : A)\n( q : f x = f y)\n  : ap A B x y f ((second (iff-ap-is-half-adjoint-equiv x y)) q) = q\n  :=\n    alternating-quintuple-concat (f x = f y)\n      ( ap A B x y f ((second (iff-ap-is-half-adjoint-equiv x y)) q))\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( ap A B x ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) f\n          ( rev A (retraction-composite-has-inverse A B f (first is-hae-f) x) x\n            ( (first (second (first is-hae-f))) x)))\n        ( ap A B\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y)) f\n          ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n          ( (first (second (first is-hae-f))) y)))\n      ( ap-triple-concat-is-half-adjoint-equiv x y q)\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x)) (f x)\n          ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n            ( (first (second (first is-hae-f))) x)))\n        ( ap A B\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f x))\n          ( (map-inverse-has-inverse A B f (first is-hae-f)) (f y)) f\n          ( ap B A (f x) (f y) (map-inverse-has-inverse A B f (first is-hae-f)) q))\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y f\n          ( (first (second (first is-hae-f))) y)))\n      ( ap-rev-triple-concat-eq-first-is-half-adjoint-equiv x y q)\n      ( triple-concat B\n        ( f x)\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)))\n        ( f ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)))\n        ( f y)\n        ( rev B\n          ( f (retraction-composite-has-inverse A B f (first is-hae-f) x))\n          ( f x)\n          ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f x)) x f\n            ( (first (second (first is-hae-f))) x)))\n        ( ap B B (f x) (f y)\n          ( section-composite-has-inverse A B f (first is-hae-f)) q)\n        ( ap A B ((map-inverse-has-inverse A B f (first is-hae-f)) (f y)) y\n          f ((first (second (first is-hae-f))) y)))\n      ( ap-ap-triple-concat-eq-first-is-half-adjoint-equiv x y q)\n      ( ap B B (f x) (f y) (identity B) q)\n      ( zag-zig-concat-triple-concat-is-half-adjoint-equiv x y q)\n      ( q)\n      ( triple-concat-reduction-is-half-adjoint-equiv x y q)\n#def has-section-ap-is-half-adjoint-equiv uses (is-hae-f)\n( x y : A)\n  : has-section (x = y) (f x = f y) (ap A B x y f)\n  :=\n    ( second (iff-ap-is-half-adjoint-equiv x y) ,\n      section-htpy-ap-is-half-adjoint-equiv x y)\n#def is-equiv-ap-is-half-adjoint-equiv uses (is-hae-f)\n( x y : A)\n  : is-equiv (x = y) (f x = f y) (ap A B x y f)\n  :=\n    ( has-retraction-ap-is-half-adjoint-equiv x y ,\n      has-section-ap-is-half-adjoint-equiv x y)\n#end equiv-identity-types-equiv\n#def is-emb-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-emb A B f\n  :=\n    is-equiv-ap-is-half-adjoint-equiv A B f\n    ( is-half-adjoint-equiv-is-equiv A B f is-equiv-f)\n#def emb-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : Emb A B\n  := (f , is-emb-is-equiv A B f is-equiv-f)\n#def equiv-ap-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( x y : A)\n  : Equiv (x = y) (f x = f y)\n  := (ap A B x y f , is-emb-is-equiv A B f is-equiv-f x y)\n
"},{"location":"hott/05-sigma.rzk/","title":"5. Sigma types","text":"

This is a literate rzk file:

#lang rzk-1\n

It is convenient to have a shorthand for \u03a3 (x : A), B x which avoids explicit naming the variable x : A.

#def total-type\n( A : U)\n( B : A \u2192 U)\n  : U\n  := \u03a3 (x : A), B x\n#def projection-total-type\n( A : U)\n( B : A \u2192 U)\n  : (total-type A B) \u2192 A\n  := \\ z \u2192 first z\n
"},{"location":"hott/05-sigma.rzk/#paths-involving-products","title":"Paths involving products","text":"
#section paths-in-products\n#variables A B : U\n#def path-product\n( a a' : A)\n( b b' : B)\n( e_A : a = a')\n( e_B : b = b')\n  : ( a , b) =_{product A B} (a' , b')\n  :=\n    transport A (\\ x \u2192 (a , b) =_{product A B} (x , b')) a a' e_A\n      ( transport B (\\ y \u2192 (a , b) =_{product A B} (a , y)) b b' e_B refl)\n#def first-path-product\n( x y : product A B)\n( e : x =_{product A B} y)\n  : first x = first y\n  := ap (product A B) A x y (\\ z \u2192 first z) e\n#def second-path-product\n( x y : product A B)\n( e : x =_{product A B} y)\n  : second x = second y\n  := ap (product A B) B x y (\\ z \u2192 second z) e\n#end paths-in-products\n
"},{"location":"hott/05-sigma.rzk/#identity-types-of-sigma-types","title":"Identity types of Sigma types","text":"
#section paths-in-sigma\n#variable A : U\n#variable B : A \u2192 U\n#def first-path-\u03a3\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : first s = first t\n  := ap (\u03a3 (a : A) , B a) A s t (\\ z \u2192 first z) e\n#def second-path-\u03a3\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : ( transport A B (first s) (first t) (first-path-\u03a3 s t e) (second s)) =\n    ( second t)\n  :=\n    ind-path\n( \u03a3 (a : A) , B a)\n      ( s)\n      ( \\ t' e' \u2192\n        ( transport A B\n          ( first s) (first t') (first-path-\u03a3 s t' e') (second s)) =\n        ( second t'))\n      ( refl)\n      ( t)\n      ( e)\n
Rijke 22, Definition 9.3.1
#def Eq-\u03a3\n( s t : \u03a3 (a : A) , B a)\n  : U\n  :=\n\u03a3 ( p : (first s) = (first t)) ,\n      ( transport A B (first s) (first t) p (second s)) = (second t)\n
Rijke 22, Definition 9.3.3
#def pair-eq\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : Eq-\u03a3 s t\n  := (first-path-\u03a3 s t e , second-path-\u03a3 s t e)\n

A path in a fiber defines a path in the total space.

#def eq-eq-fiber-\u03a3\n( x : A)\n( u v : B x)\n( p : u = v)\n  : (x , u) =_{\u03a3 (a : A) , B a} (x , v)\n  := ind-path (B x) (u) (\\ v' p' \u2192 (x , u) = (x , v')) (refl) (v) (p)\n

The following is essentially eq-pair but with explicit arguments.

#def path-of-pairs-pair-of-paths\n( x y : A)\n( p : x = y)\n  : ( u : B x) \u2192\n( v : B y) \u2192\n    ( (transport A B x y p u) = v) \u2192\n    ( x , u) =_{\u03a3 (z : A) , B z} (y , v)\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ y' p' \u2192 (u' : B x) \u2192 (v' : B y') \u2192\n        ((transport A B x y' p' u') = v') \u2192\n        (x , u') =_{\u03a3 (z : A) , B z} (y' , v'))\n      ( \\ u' v' q' \u2192 (eq-eq-fiber-\u03a3 x u' v' q'))\n      ( y)\n      ( p)\n
The inverse to pair-eq
#def eq-pair\n( s t : \u03a3 (a : A) , B a)\n( e : Eq-\u03a3 s t)\n  : (s = t)\n  :=\n    path-of-pairs-pair-of-paths\n      ( first s) (first t) (first e) (second s) (second t) (second e)\n#def eq-pair-pair-eq\n( s t : \u03a3 (a : A) , B a)\n( e : s = t)\n  : (eq-pair s t (pair-eq s t e)) = e\n  :=\n    ind-path\n( \u03a3 (a : A) , (B a))\n      ( s)\n      ( \\ t' e' \u2192 (eq-pair s t' (pair-eq s t' e')) = e')\n      ( refl)\n      ( t)\n      ( e)\n

Here we've decomposed e : Eq-\u03a3 s t as (e0, e1) and decomposed s and t similarly for induction purposes.

#def pair-eq-eq-pair-split\n( s0 : A)\n( s1 : B s0)\n( t0 : A)\n( e0 : s0 = t0)\n  : ( t1 : B t0) \u2192\n( e1 : (transport A B s0 t0 e0 s1) = t1) \u2192\n    ( ( pair-eq (s0 , s1) (t0 , t1) (eq-pair (s0 , s1) (t0 , t1) (e0 , e1)))\n      =_{Eq-\u03a3 (s0 , s1) (t0 , t1)}\n      ( e0 , e1))\n  :=\n    ind-path\n      ( A)\n      ( s0)\n( \\ t0' e0' \u2192\n        ( t1 : B t0') \u2192\n( e1 : (transport A B s0 t0' e0' s1) = t1) \u2192\n        ( pair-eq (s0 , s1) (t0' , t1) (eq-pair (s0 , s1) (t0' , t1) (e0' , e1)))\n        =_{Eq-\u03a3 (s0 , s1) (t0' , t1)}\n        ( e0' , e1))\n      ( ind-path\n        ( B s0)\n        ( s1)\n        ( \\ t1' e1' \u2192\n          ( pair-eq\n            ( s0 , s1)\n            ( s0 , t1')\n            ( eq-pair (s0 , s1) (s0 , t1') (refl , e1')))\n          =_{Eq-\u03a3 (s0 , s1) (s0 , t1')}\n          ( refl , e1'))\n        ( refl))\n      ( t0)\n      ( e0)\n#def pair-eq-eq-pair\n( s t : \u03a3 (a : A) , B a)\n( e : Eq-\u03a3 s t)\n  : ( pair-eq s t (eq-pair s t e)) =_{Eq-\u03a3 s t} e\n  :=\n    pair-eq-eq-pair-split\n      ( first s) (second s) (first t) (first e) (second t) (second e)\n#def extensionality-\u03a3\n( s t : \u03a3 (a : A) , B a)\n  : Equiv (s = t) (Eq-\u03a3 s t)\n  :=\n    ( pair-eq s t ,\n      ( ( eq-pair s t , eq-pair-pair-eq s t) ,\n        ( eq-pair s t , pair-eq-eq-pair s t)))\n#end paths-in-sigma\n#def first-path-\u03a3-eq-pair\n( A : U)\n( B : A \u2192 U)\n  ( (a,b) (a',b') : \u03a3 (a : A), B a)\n  ( (e0, e1) : Eq-\u03a3 A B (a,b) (a',b'))\n  : first-path-\u03a3 A B (a,b) (a',b') (eq-pair A B (a,b) (a',b') (e0, e1)) = e0\n  :=\n    first-path-\u03a3\n      ( a = a' )\n      ( \\ p \u2192 transport A B a a' p b = b' )\n      ( pair-eq A B (a,b) (a',b') (eq-pair A B (a,b) (a',b') (e0,e1)) )\n      ( e0, e1 )\n      ( pair-eq-eq-pair A B (a,b) (a',b') (e0,e1))\n
"},{"location":"hott/05-sigma.rzk/#identity-types-of-sigma-types-over-a-product","title":"Identity types of Sigma types over a product","text":"
#section paths-in-sigma-over-product\n#variables A B : U\n#variable C : A \u2192 B \u2192 U\n#def product-transport\n( a a' : A)\n( b b' : B)\n( p : a = a')\n( q : b = b')\n( c : C a b)\n  : C a' b'\n  :=\n    ind-path\n      ( B)\n      ( b)\n      ( \\ b'' q' \u2192 C a' b'')\n      ( ind-path (A) (a) (\\ a'' p' \u2192 C a'' b) (c) (a') (p))\n      ( b')\n      ( q)\n#def Eq-\u03a3-over-product\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n  : U\n  :=\n\u03a3 ( p : (first s) = (first t)) ,\n( \u03a3 ( q : (first (second s)) = (first (second t))) ,\n          ( product-transport\n            ( first s) (first t)\n            ( first (second s)) (first (second t)) p q (second (second s)) =\n            ( second (second t))))\n

Warning

The following definition of triple-eq is the lazy definition with bad computational properties.

#def triple-eq\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : s = t)\n  : Eq-\u03a3-over-product s t\n  :=\n    ind-path\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n      ( s)\n      ( \\ t' e' \u2192 (Eq-\u03a3-over-product s t'))\n      ( ( refl , (refl , refl)))\n      ( t)\n      ( e)\n

It's surprising that the following typechecks since we defined product-transport by a dual path induction over both p and q, rather than by saying that when p is refl this is ordinary transport.

The inverse with explicit arguments
#def triple-of-paths-path-of-triples\n( a a' : A)\n( u u' : B)\n( c : C a u)\n( p : a = a')\n  : ( q : u = u') \u2192\n( c' : C a' u') \u2192\n( r : product-transport a a' u u' p q c = c') \u2192\n    ( (a , (u , c)) =_{(\u03a3 (x : A) , (\u03a3 (y : B) , C x y))} (a' , (u' , c')))\n  :=\n    ind-path\n      ( A)\n      ( a)\n( \\ a'' p' \u2192\n        ( q : u = u') \u2192\n( c' : C a'' u') \u2192\n( r : product-transport a a'' u u' p' q c = c') \u2192\n        ( (a , (u , c)) =_{(\u03a3 (x : A) , (\u03a3 (y : B) , C x y))} (a'' , (u' , c'))))\n      ( \\ q c' r \u2192\n        eq-eq-fiber-\u03a3\n          ( A) (\\ x \u2192 (\u03a3 (v : B) , C x v)) (a)\n          ( u , c) ( u' , c')\n          ( path-of-pairs-pair-of-paths B (\\ y \u2192 C a y) u u' q c c' r))\n      ( a')\n      ( p)\n#def eq-triple\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : Eq-\u03a3-over-product s t)\n  : (s = t)\n  :=\n    triple-of-paths-path-of-triples\n    ( first s) (first t)\n    ( first (second s)) (first (second t))\n    ( second (second s)) (first e)\n    ( first (second e)) (second (second t))\n    ( second (second e))\n#def eq-triple-triple-eq\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : s = t)\n  : (eq-triple s t (triple-eq s t e)) = e\n  :=\n    ind-path\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n      ( s)\n      ( \\ t' e' \u2192 (eq-triple s t' (triple-eq s t' e')) = e')\n      ( refl)\n      ( t)\n      ( e)\n

Here we've decomposed s, t and e for induction purposes:

#def triple-eq-eq-triple-split\n( a a' : A)\n( b b' : B)\n( c : C a b)\n  : ( p : a = a') \u2192\n( q : b = b') \u2192\n( c' : C a' b') \u2192\n( r : product-transport a a' b b' p q c = c') \u2192\n    ( triple-eq\n      ( a , (b , c)) (a' , (b' , c'))\n      ( eq-triple (a , (b , c)) (a' , (b' , c')) (p , (q , r)))) =\n    ( p , (q , r))\n  :=\n    ind-path\n      ( A)\n      ( a)\n( \\ a'' p' \u2192\n        ( q : b = b') \u2192\n( c' : C a'' b') \u2192\n( r : product-transport a a'' b b' p' q c = c') \u2192\n        ( triple-eq\n          ( a , (b , c)) (a'' , (b' , c'))\n          ( eq-triple (a , (b , c)) (a'' , (b' , c')) (p' , (q , r)))) =\n        ( p' , (q , r)))\n      ( ind-path\n        ( B)\n        ( b)\n( \\ b'' q' \u2192\n          ( c' : C a b'') \u2192\n( r : product-transport a a b b'' refl q' c = c') \u2192\n          ( triple-eq\n            ( a , (b , c)) (a , (b'' , c'))\n            ( eq-triple (a , (b , c)) (a , (b'' , c')) (refl , (q' , r)))) =\n          ( refl , (q' , r)))\n        ( ind-path\n            ( C a b)\n            ( c)\n            ( \\ c'' r' \u2192\n              triple-eq\n                ( a , (b , c)) (a , (b , c''))\n                ( eq-triple\n                  ( a , (b , c)) (a , (b , c''))\n                  ( refl , (refl , r'))) =\n                ( refl , (refl , r')))\n            ( refl))\n        ( b'))\n      ( a')\n#def triple-eq-eq-triple\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( e : Eq-\u03a3-over-product s t)\n  : (triple-eq s t (eq-triple s t e)) = e\n  :=\n    triple-eq-eq-triple-split\n      ( first s) (first t)\n      ( first (second s)) (first (second t))\n      ( second (second s)) (first e)\n      ( first (second e)) (second (second t))\n      ( second (second e))\n#def extensionality-\u03a3-over-product\n( s t : \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n  : Equiv (s = t) (Eq-\u03a3-over-product s t)\n  :=\n    ( triple-eq s t ,\n      ( ( eq-triple s t , eq-triple-triple-eq s t) ,\n        ( eq-triple s t , triple-eq-eq-triple s t)))\n#end paths-in-sigma-over-product\n
"},{"location":"hott/05-sigma.rzk/#symmetry-of-products","title":"Symmetry of products","text":"
#def sym-product\n( A B : U)\n  : Equiv (product A B) (product B A)\n  :=\n    ( \\ (a , b) \u2192 (b , a) ,\n      ( ( \\ (b , a) \u2192 (a , b) ,\\ p \u2192 refl) ,\n        ( \\ (b , a) \u2192 (a , b) ,\\ p \u2192 refl)))\n
"},{"location":"hott/05-sigma.rzk/#fubini","title":"Fubini","text":"

Given a family over a pair of independent types, the order of summation is unimportant.

#def fubini-\u03a3\n( A B : U)\n( C : A \u2192 B \u2192 U)\n  : Equiv ( \u03a3 (x : A) , \u03a3 (y : B) , C x y) (\u03a3 (y : B) , \u03a3 (x : A) , C x y)\n  :=\n    ( \\ t \u2192 (first (second t) , (first t , second (second t))) ,\n      ( ( \\ t \u2192 (first (second t) , (first t , second (second t))) ,\n\\ t \u2192 refl) ,\n        ( \\ t \u2192 (first (second t) , (first t , second (second t))) ,\n\\ t \u2192 refl)))\n
Products distribute inside Sigma types
#def distributive-product-\u03a3\n( A B : U)\n( C : B \u2192 U)\n  : Equiv (product A (\u03a3 (b : B) , C b)) (\u03a3 (b : B) , product A (C b))\n  :=\n    ( \\ (a , (b , c)) \u2192 (b , (a , c)) ,\n      ( ( \\ (b , (a , c)) \u2192 (a , (b , c)) , \\ z \u2192 refl) ,\n        ( \\ (b , (a , c)) \u2192 (a , (b , c)) , \\ z \u2192 refl)))\n
"},{"location":"hott/05-sigma.rzk/#associativity","title":"Associativity","text":"
#def associative-\u03a3\n( A : U)\n( B : A \u2192 U)\n( C : (a : A) \u2192 B a \u2192 U)\n  : Equiv\n( \u03a3 (a : A) , \u03a3 (b : B a) , C a b)\n( \u03a3 (ab : \u03a3 (a : A) , B a) , C (first ab) (second ab))\n  :=\n    ( \\ (a , (b , c)) \u2192 ((a , b) , c) ,\n      ( ( \\ ((a , b) , c) \u2192 (a , (b , c)) , \\ _ \u2192 refl) ,\n        ( \\ ((a , b) , c) \u2192 (a , (b , c)) , \\ _ \u2192 refl)))\n
"},{"location":"hott/05-sigma.rzk/#currying","title":"Currying","text":"

This is the dependent version of the currying equivalence.

#def equiv-dependent-curry\n( A : U)\n( B : A \u2192 U)\n( C : (a : A) \u2192 B a \u2192 U)\n  : Equiv\n((p : \u03a3 (a : A) , (B a)) \u2192 C (first p) (second p))\n((a : A) \u2192 (b : B a) \u2192 C a b)\n  :=\n    ( ( \\ s a b \u2192 s (a , b)) ,\n      ( ( ( \\ f (a , b) \u2192 f a b ,\n\\ f \u2192 refl) ,\n          ( \\ f (a , b) \u2192 f a b ,\n\\ s \u2192 refl))))\n
"},{"location":"hott/05-sigma.rzk/#type-theoretic-principle-of-choice","title":"Type theoretic principle of choice","text":"Rijke 22, Theorem 13.2.1
#def choice\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : ( (x : A) \u2192 \u03a3 (y : B x) , C x y) \u2192\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n  := \\ h \u2192 (\\ x \u2192 first (h x) , \\ x \u2192 second (h x))\n#def choice-inverse\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : ( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x)) \u2192\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n  := \\ s \u2192 \\ x \u2192 ((first s) x , (second s) x)\n#def is-equiv-choice\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : is-equiv\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n      ( choice A B C)\n  :=\n    is-equiv-has-inverse\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n      ( choice A B C)\n      ( choice-inverse A B C , ( \\ h \u2192 refl , \\ s \u2192 refl))\n#def equiv-choice\n( A : U)\n( B : A \u2192 U)\n( C : (x : A) \u2192 B x \u2192 U)\n  : Equiv\n( (x : A) \u2192 \u03a3 (y : B x) , C x y)\n( \u03a3 ( f : (x : A) \u2192 B x) , (x : A) \u2192 C x (f x))\n  := (choice A B C , is-equiv-choice A B C)\n
"},{"location":"hott/06-contractible.rzk/","title":"6. Contractible","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/06-contractible.rzk/#contractible-types","title":"Contractible types","text":"The type of contractibility proofs
#def is-contr (A : U) : U\n  := \u03a3 (x : A) , ((y : A) \u2192 x = y)\n
"},{"location":"hott/06-contractible.rzk/#contractible-type-data","title":"Contractible type data","text":"
#section contractible-data\n#variable A : U\n#variable is-contr-A : is-contr A\n#def center-contraction\n  : A\n  := (first is-contr-A)\n
The path from the contraction center to any point
#def homotopy-contraction\n  : ( z : A) \u2192 center-contraction = z\n  := second is-contr-A\n#def realign-homotopy-contraction uses (is-contr-A)\n  : ( z : A) \u2192 center-contraction = z\n  :=\n\\ z \u2192\n      ( concat A center-contraction center-contraction z\n          (rev A center-contraction center-contraction\n            ( homotopy-contraction center-contraction))\n          (homotopy-contraction z))\n#def path-realign-homotopy-contraction uses (is-contr-A)\n  : ( realign-homotopy-contraction center-contraction) = refl\n  :=\n    ( left-inverse-concat A center-contraction center-contraction\n      ( homotopy-contraction center-contraction))\n
A path between any pair of terms in a contractible type
#def eq-is-contr uses (is-contr-A)\n(x y : A)\n  : x = y\n  :=\n    zag-zig-concat A x center-contraction y\n      ( homotopy-contraction x) (homotopy-contraction y)\n#end contractible-data\n
"},{"location":"hott/06-contractible.rzk/#unit-type","title":"Unit type","text":"

The prototypical contractible type is the unit type, which is built-in to rzk.

#def ind-unit\n( C : Unit \u2192 U)\n( C-unit : C unit)\n( x : Unit)\n  : C x\n  := C-unit\n#def is-prop-unit\n( x y : Unit)\n  : x = y\n  := refl\n
The terminal projection as a constant map
#def terminal-map\n( A : U)\n  : A \u2192 Unit\n  := constant A Unit unit\n
"},{"location":"hott/06-contractible.rzk/#identity-types-of-unit-types","title":"Identity types of unit types","text":"
#def terminal-map-of-path-types-of-Unit-has-retr\n( x y : Unit)\n  : has-retraction (x = y) Unit (terminal-map (x = y))\n  :=\n    ( \\ a \u2192 refl ,\n\\ p \u2192 ind-path (Unit) (x) (\\ y' p' \u2192 refl =_{x = y'} p') (refl) (y) (p))\n#def terminal-map-of-path-types-of-Unit-has-sec\n( x y : Unit)\n  : has-section (x = y) Unit (terminal-map (x = y))\n  := ( \\ a \u2192 refl , \\ a \u2192 refl)\n#def terminal-map-of-path-types-of-Unit-is-equiv\n( x y : Unit)\n  : is-equiv (x = y) Unit (terminal-map (x = y))\n  :=\n    ( terminal-map-of-path-types-of-Unit-has-retr x y ,\n      terminal-map-of-path-types-of-Unit-has-sec x y)\n
"},{"location":"hott/06-contractible.rzk/#characterization-of-contractibility","title":"Characterization of contractibility","text":"

A type is contractible if and only if its terminal map is an equivalence.

#def terminal-map-is-equiv\n( A : U)\n  : U\n  := is-equiv A Unit (terminal-map A)\n#def contr-implies-terminal-map-is-equiv-retr\n( A : U)\n( is-contr-A : is-contr A)\n  : has-retraction A Unit (terminal-map A)\n  :=\n    ( constant Unit A (center-contraction A is-contr-A) ,\n\\ y \u2192 (homotopy-contraction A is-contr-A) y)\n#def contr-implies-terminal-map-is-equiv-sec\n( A : U)\n( is-contr-A : is-contr A)\n  : has-section A Unit (terminal-map A)\n  := ( constant Unit A (center-contraction A is-contr-A) , \\ z \u2192 refl)\n#def contr-implies-terminal-map-is-equiv\n( A : U)\n( is-contr-A : is-contr A)\n  : is-equiv A Unit (terminal-map A)\n  :=\n    ( contr-implies-terminal-map-is-equiv-retr A is-contr-A ,\n      contr-implies-terminal-map-is-equiv-sec A is-contr-A)\n#def terminal-map-is-equiv-implies-contr\n( A : U)\n(e : terminal-map-is-equiv A)\n  : is-contr A\n  := ( (first (first e)) unit , (second (first e)))\n#def contr-iff-terminal-map-is-equiv\n( A : U)\n  : iff (is-contr A) (terminal-map-is-equiv A)\n  :=\n    ( ( contr-implies-terminal-map-is-equiv A) ,\n      ( terminal-map-is-equiv-implies-contr A))\n#def equiv-with-contractible-domain-implies-contractible-codomain\n( A B : U)\n( f : Equiv A B)\n( is-contr-A : is-contr A)\n  : is-contr B\n  :=\n    ( terminal-map-is-equiv-implies-contr B\n      ( second\n        ( equiv-comp B A Unit\n          ( inv-equiv A B f)\n          ( ( terminal-map A) ,\n            ( contr-implies-terminal-map-is-equiv A is-contr-A)))))\n#def equiv-with-contractible-codomain-implies-contractible-domain\n( A B : U)\n( f : Equiv A B)\n( is-contr-B : is-contr B)\n  : is-contr A\n  :=\n    ( equiv-with-contractible-domain-implies-contractible-codomain B A\n      ( inv-equiv A B f) is-contr-B)\n#def equiv-then-domain-contractible-iff-codomain-contractible\n( A B : U)\n( f : Equiv A B)\n  : ( iff (is-contr A) (is-contr B))\n  :=\n    ( \\ is-contr-A \u2192\n      ( equiv-with-contractible-domain-implies-contractible-codomain\n        A B f is-contr-A) ,\n\\ is-contr-B \u2192\n      ( equiv-with-contractible-codomain-implies-contractible-domain\n        A B f is-contr-B))\n#def path-types-of-Unit-are-contractible\n( x y : Unit)\n  : is-contr (x = y)\n  :=\n    ( terminal-map-is-equiv-implies-contr\n      ( x = y) (terminal-map-of-path-types-of-Unit-is-equiv x y))\n
"},{"location":"hott/06-contractible.rzk/#retracts-of-contractible-types","title":"Retracts of contractible types","text":"

A retract of contractible types is contractible.

The type of proofs that A is a retract of B
#def is-retract-of\n( A B : U)\n  : U\n  := \u03a3 ( s : A \u2192 B) , has-retraction A B s\n#section retraction-data\n#variables A B : U\n#variable is-retract-of-A-B : is-retract-of A B\n#def is-retract-of-section\n  : A \u2192 B\n  := first is-retract-of-A-B\n#def is-retract-of-retraction\n  : B \u2192 A\n  := first (second is-retract-of-A-B)\n#def is-retract-of-homotopy\n  : homotopy A A (comp A B A is-retract-of-retraction is-retract-of-section) (identity A)\n  := second (second is-retract-of-A-B)\n
If A is a retract of a contractible type it has a term
#def is-retract-of-is-contr-isInhabited uses (is-retract-of-A-B)\n( is-contr-B : is-contr B)\n  : A\n  := is-retract-of-retraction (center-contraction B is-contr-B)\n
If A is a retract of a contractible type it has a contracting homotopy
#def is-retract-of-is-contr-hasHtpy uses (is-retract-of-A-B)\n( is-contr-B : is-contr B)\n( a : A)\n  : ( is-retract-of-is-contr-isInhabited is-contr-B) = a\n  :=\n    concat\n      ( A)\n      ( is-retract-of-is-contr-isInhabited is-contr-B)\n      ( (comp A B A is-retract-of-retraction is-retract-of-section) a)\n      ( a)\n      ( ap B A (center-contraction B is-contr-B) (is-retract-of-section a)\n        ( is-retract-of-retraction)\n        ( homotopy-contraction B is-contr-B (is-retract-of-section a)))\n      ( is-retract-of-homotopy a)\n
If A is a retract of a contractible type it is contractible
#def is-contr-is-retract-of-is-contr uses (is-retract-of-A-B)\n( is-contr-B : is-contr B)\n  : is-contr A\n  :=\n    ( is-retract-of-is-contr-isInhabited is-contr-B ,\n      is-retract-of-is-contr-hasHtpy is-contr-B)\n
#end retraction-data\n
"},{"location":"hott/06-contractible.rzk/#functions-between-contractible-types","title":"Functions between contractible types","text":"Any function between contractible types is an equivalence
#def is-equiv-are-contr\n( A B : U)\n( is-contr-A : is-contr A)\n( is-contr-B : is-contr B)\n( f : A \u2192 B)\n  : is-equiv A B f\n  :=\n    ( ( \\ b \u2192 center-contraction A is-contr-A ,\n\\ a \u2192 homotopy-contraction A is-contr-A a) ,\n      ( \\ b \u2192 center-contraction A is-contr-A ,\n\\ b \u2192 eq-is-contr B is-contr-B\n                (f (center-contraction A is-contr-A)) b))\n
A type equivalent to a contractible type is contractible
#def is-contr-equiv-is-contr'\n( A B : U)\n( e : Equiv A B)\n( is-contr-B : is-contr B)\n  : is-contr A\n  :=\n    is-contr-is-retract-of-is-contr A B (first e , first (second e)) is-contr-B\n#def is-contr-equiv-is-contr\n( A B : U)\n( e : Equiv A B)\n( is-contr-A : is-contr A)\n  : is-contr B\n  :=\n    is-contr-is-retract-of-is-contr B A\n      ( first (second (second e)) , (first e , second (second (second e))))\n      ( is-contr-A)\n
"},{"location":"hott/06-contractible.rzk/#based-path-spaces","title":"Based path spaces","text":"

For example, we prove that based path spaces are contractible.

Transport in the space of paths starting at a is concatenation
#def concat-as-based-transport\n( A : U)\n( a x y : A)\n( p : a = x)\n( q : x = y)\n  : ( transport A (\\ z \u2192 (a = z)) x y q p) = (concat A a x y p q)\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' q' \u2192\n        ( transport A (\\ z \u2192 (a = z)) x y' q' p) = (concat A a x y' p q'))\n      ( refl)\n      ( y)\n      ( q)\n

The center of contraction in the based path space is (a , refl).

The center of contraction in the based path space
#def center-based-paths\n( A : U)\n( a : A)\n  : \u03a3 (x : A) , (a = x)\n  := (a , refl)\n
The contracting homotopy in the based path space
#def contraction-based-paths\n( A : U)\n( a : A)\n( p : \u03a3 (x : A) , a = x)\n  : (center-based-paths A a) = p\n  :=\n    path-of-pairs-pair-of-paths\n      A ( \\ z \u2192 a = z) a (first p) (second p) (refl) (second p)\n      ( concat\n        ( a = (first p))\n        ( transport A (\\ z \u2192 (a = z)) a (first p) (second p) (refl))\n        ( concat A a a (first p) (refl) (second p))\n        ( second p)\n        ( concat-as-based-transport A a a (first p) (refl) (second p))\n        ( left-unit-concat A a (first p) (second p)))\n
Based path spaces are contractible
#def is-contr-based-paths\n( A : U)\n( a : A)\n  : is-contr (\u03a3 (x : A) , a = x)\n  := (center-based-paths A a , contraction-based-paths A a)\n
"},{"location":"hott/06-contractible.rzk/#contractible-products","title":"Contractible products","text":"
#def is-contr-product\n( A B : U)\n( is-contr-A : is-contr A)\n( is-contr-B : is-contr B)\n  : is-contr (product A B)\n  :=\n    ( (first is-contr-A , first is-contr-B) ,\n\\ p \u2192 path-product A B\n              ( first is-contr-A) (first p)\n              ( first is-contr-B) (second p)\n              ( second is-contr-A (first p))\n              ( second is-contr-B (second p)))\n#def first-is-contr-product\n( A B : U)\n( AxB-is-contr : is-contr (product A B))\n  : is-contr A\n  :=\n    ( first (first AxB-is-contr) ,\n\\ a \u2192 first-path-product A B\n              ( first AxB-is-contr)\n              ( a , second (first AxB-is-contr))\n              ( second AxB-is-contr (a , second (first AxB-is-contr))))\n#def is-contr-base-is-contr-\u03a3\n( A : U)\n( B : A \u2192 U)\n( b : (a : A) \u2192 B a)\n( is-contr-AB : is-contr (\u03a3 (a : A) , B a))\n  : is-contr A\n  :=\n    ( first (first is-contr-AB) ,\n\\ a \u2192 first-path-\u03a3 A B\n              ( first is-contr-AB)\n              ( a , b a)\n              ( second is-contr-AB (a , b a)))\n
"},{"location":"hott/06-contractible.rzk/#weak-function-extensionality","title":"Weak function extensionality","text":"

The weak function extensionality axiom asserts that if a dependent type is locally contractible then its dependent function type is contractible.

Weak function extensionality is logically equivalent to function extensionality. However, for various applications it may be useful to have it stated as a separate hypothesis.

Weak function extensionality gives us contractible pi types
#def WeakFunExt : U\n  :=\n( A : U ) \u2192 (C : A \u2192 U) \u2192\n(is-contr-C : (a : A) \u2192 is-contr (C a) ) \u2192\n(is-contr ( (a : A) \u2192 C a ))\n

Function extensionality implies weak function extensionality.

#def map-weakfunext\n(A : U)\n(C : A \u2192 U)\n(is-contr-C : (a : A) \u2192 is-contr (C a))\n  : (a : A) \u2192 C a\n  :=\n\\ a \u2192 first (is-contr-C a)\n#def weakfunext-funext\n(funext : FunExt)\n  : WeakFunExt\n  :=\n\\ A C is-contr-C \u2192\n  ( map-weakfunext A C is-contr-C ,\n    ( \\ g \u2192\n      ( eq-htpy funext\n        ( A)\n        ( C)\n        ( map-weakfunext A C is-contr-C)\n        ( g)\n        ( \\ a \u2192 second (is-contr-C a) (g a)))))\n
"},{"location":"hott/06-contractible.rzk/#singleton-induction","title":"Singleton induction","text":"

A type is contractible if and only if it has singleton induction.

#def ev-pt\n( A : U)\n( a : A)\n( B : A \u2192 U)\n  : ((x : A) \u2192 B x) \u2192 B a\n  := \\ f \u2192 f a\n#def has-singleton-induction-pointed\n( A : U)\n( a : A)\n( B : A \u2192 U)\n  : U\n  := has-section ((x : A) \u2192 B x) (B a) (ev-pt A a B)\n#def has-singleton-induction-pointed-structure\n( A : U)\n( a : A)\n  : U\n  := ( B : A \u2192 U) \u2192 has-section ((x : A) \u2192 B x) (B a) (ev-pt A a B)\n#def has-singleton-induction\n( A : U)\n  : U\n  := \u03a3 ( a : A) , (B : A \u2192 U) \u2192 (has-singleton-induction-pointed A a B)\n#def ind-sing\n( A : U)\n( a : A)\n( B : A \u2192 U)\n(singleton-ind-A : has-singleton-induction-pointed A a B)\n  : (B a) \u2192 ((x : A) \u2192 B x)\n  := ( first singleton-ind-A)\n#def compute-ind-sing\n( A : U)\n( a : A)\n( B : A \u2192 U)\n( singleton-ind-A : has-singleton-induction-pointed A a B)\n  : ( homotopy\n      ( B a)\n      ( B a)\n      ( comp\n        ( B a)\n( (x : A) \u2192 B x)\n        ( B a)\n        ( ev-pt A a B)\n        ( ind-sing A a B singleton-ind-A))\n      ( identity (B a)))\n  := (second singleton-ind-A)\n#def contr-implies-singleton-induction-ind\n( A : U)\n( is-contr-A : is-contr A)\n  : (has-singleton-induction A)\n  :=\n    ( ( center-contraction A is-contr-A) ,\n\\ B \u2192\n        ( ( \\ b x \u2192\n                ( transport A B\n                  ( center-contraction A is-contr-A) x\n                  ( realign-homotopy-contraction A is-contr-A x) b)) ,\n          ( \\ b \u2192\n                ( ap\n                  ( (center-contraction A is-contr-A) =\n                    (center-contraction A is-contr-A))\n                  ( B (center-contraction A is-contr-A))\n                  ( realign-homotopy-contraction A is-contr-A\n                    ( center-contraction A is-contr-A))\nrefl_{(center-contraction A is-contr-A)}\n                  ( \\ p \u2192\n                    ( transport-loop A B (center-contraction A is-contr-A) b p))\n                  ( path-realign-homotopy-contraction A is-contr-A)))))\n#def contr-implies-singleton-induction-pointed\n( A : U)\n( is-contr-A : is-contr A)\n( B : A \u2192 U)\n  : has-singleton-induction-pointed A (center-contraction A is-contr-A) B\n  := ( second (contr-implies-singleton-induction-ind A is-contr-A)) B\n#def singleton-induction-ind-implies-contr\n( A : U)\n( a : A)\n( f : has-singleton-induction-pointed-structure A a)\n  : ( is-contr A)\n  := ( a , (first (f ( \\ x \u2192 a = x))) (refl_{a}))\n
"},{"location":"hott/06-contractible.rzk/#identity-types-of-contractible-types","title":"Identity types of contractible types","text":"

We show that any two paths between the same endpoints in a contractible type are the same.

In a contractible type any path \\(p : x = y\\) is equal to the path constructed in eq-is-contr.

#define path-eq-path-through-center-is-contr\n( A : U)\n( is-contr-A : is-contr A)\n( x y : A)\n( p : x = y)\n  : ((eq-is-contr A is-contr-A x y) = p)\n  := \n    ind-path\n    ( A)\n    ( x)\n    ( \\ y' p' \u2192 (eq-is-contr A is-contr-A x y') = p') \n    ( left-inverse-concat A (center-contraction A is-contr-A) x (homotopy-contraction A is-contr-A x)) \n    ( y) \n    ( p) \n

Finally, in a contractible type any two paths between the same end points are equal. There are many possible proofs of this (e.g. identifying contractible types with the unit type where it is more transparent), but we proceed by gluing together the two identifications to the out and back path.

#define all-paths-eq-is-contr ( A : U)\n( is-contr-A : is-contr A)\n( x y : A)\n( p q : x = y) \n : (p = q)\n := \n  concat\n    ( x = y)\n    ( p)\n    ( eq-is-contr A is-contr-A x y)\n    ( q)\n    ( rev\n      (x = y) \n      ( eq-is-contr A is-contr-A x y)\n      ( p) \n      ( path-eq-path-through-center-is-contr A is-contr-A x y p))\n    ( path-eq-path-through-center-is-contr A is-contr-A x y q)\n
"},{"location":"hott/07-fibers.rzk/","title":"7. Fibers","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/07-fibers.rzk/#fibers","title":"Fibers","text":"

The homotopy fiber of a map is the following type:

The fiber of a map
#def fib\n( A B : U)\n( f : A \u2192 B)\n( b : B)\n  : U\n  := \u03a3 (a : A) , (f a) = b\n

We calculate the transport of (a , q) : fib b along p : a = a':

#def transport-in-fiber\n( A B : U)\n( f : A \u2192 B)\n( b : B)\n( a a' : A)\n( u : (f a) = b)\n( p : a = a')\n  : ( transport A ( \\ x \u2192 (f x) = b) a a' p u) =\n    ( concat B (f a') (f a) b (ap A B a' a f (rev A a a' p)) u)\n  :=\n    ind-path\n      ( A)\n      ( a)\n      ( \\ a'' p' \u2192\n        ( transport (A) (\\ x \u2192 (f x) = b) (a) (a'') (p') (u)) =\n        ( concat (B) (f a'') (f a) (b) (ap A B a'' a f (rev A a a'' p')) (u)))\n      ( rev\n        ( (f a) = b) (concat B (f a) (f a) b refl u) (u)\n        ( left-unit-concat B (f a) b u))\n      ( a')\n      ( p)\n
"},{"location":"hott/07-fibers.rzk/#induction-principle-for-fibers","title":"Induction principle for fibers","text":"

The family of fibers has the following induction principle: To prove/construct something about/for every point in every fiber, it suffices to do so for points of the form (a, refl : f a = f a) : fib A B f.

#def ind-fib\n( A B : U)\n( f : A \u2192 B)\n( C : (b : B) \u2192 fib A B f b \u2192 U)\n( s : (a : A) \u2192 C (f a) (a, refl))\n( b : B)\n  ( (a, q) : fib A B f b)\n  : C b (a, q)\n  :=\n    ind-path B (f a) (\\ b p \u2192 C b (a, p)) (s a) b q\n#def ind-fib-computation\n( A B : U)\n( f : A \u2192 B)\n( C : (b : B) \u2192 fib A B f b \u2192 U)\n( s : (a : A) \u2192 C (f a) (a, refl))\n( a : A)\n  : ind-fib A B f C s (f a) (a, refl) = s a\n  := refl\n
"},{"location":"hott/07-fibers.rzk/#contractible-maps","title":"Contractible maps","text":"

A map is contractible just when its fibers are contractible.

Contractible maps
#def is-contr-map\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := (b : B) \u2192 is-contr (fib A B f b)\n
"},{"location":"hott/07-fibers.rzk/#contractible-maps-are-equivalences","title":"Contractible maps are equivalences","text":"

Contractible maps are equivalences:

#section is-equiv-is-contr-map\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-contr-f : is-contr-map A B f\n
The inverse to a contractible map
#def is-contr-map-inverse\n  : B \u2192 A\n  := \\ b \u2192 first (center-contraction (fib A B f b) (is-contr-f b))\n#def has-section-is-contr-map\n  : has-section A B f\n  :=\n    ( is-contr-map-inverse ,\n\\ b \u2192 second (center-contraction (fib A B f b) (is-contr-f b)))\n#def is-contr-map-data-in-fiber uses (is-contr-f)\n(a : A)\n  : fib A B f (f a)\n  := (is-contr-map-inverse (f a) , (second has-section-is-contr-map) (f a))\n#def is-contr-map-path-in-fiber\n(a : A)\n  : (is-contr-map-data-in-fiber a) =_{fib A B f (f a)} (a , refl)\n  :=\n    eq-is-contr\n      ( fib A B f (f a))\n      ( is-contr-f (f a))\n      ( is-contr-map-data-in-fiber a)\n      ( a , refl)\n#def is-contr-map-has-retraction uses (is-contr-f)\n  : has-retraction A B f\n  :=\n    ( is-contr-map-inverse ,\n\\ a \u2192 ( ap (fib A B f (f a)) A\n                ( is-contr-map-data-in-fiber a)\n                ( (a , refl))\n                ( \\ u \u2192 first u)\n                ( is-contr-map-path-in-fiber a)))\n#def is-equiv-is-contr-map uses (is-contr-f)\n  : is-equiv A B f\n  := (is-contr-map-has-retraction , has-section-is-contr-map)\n#end is-equiv-is-contr-map\n
"},{"location":"hott/07-fibers.rzk/#half-adjoint-equivalences-are-contractible-maps","title":"Half adjoint equivalences are contractible maps","text":"

We prove the converse by fiber induction. To define the contracting homotopy to the point (f a, refl) in the fiber over f a we find it easier to work from the assumption that f is a half adjoint equivalence.

#section is-contr-map-is-equiv\n#variables A B : U\n#variable f : A \u2192 B\n#variable is-hae-f : is-half-adjoint-equiv A B f\n#def is-split-surjection-is-half-adjoint-equiv\n( b : B)\n  : fib A B f b\n  :=\n    ( map-inverse-is-half-adjoint-equiv A B f is-hae-f b,\n      section-htpy-is-half-adjoint-equiv A B f is-hae-f b)\n#def calculate-is-split-surjection-is-half-adjoint-equiv\n( a : A)\n  : is-split-surjection-is-half-adjoint-equiv (f a) = (a, refl)\n  :=\n    path-of-pairs-pair-of-paths\n    ( A)\n    ( \\ a' \u2192 f a' = f a)\n    ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n    ( a)\n    ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)\n    ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a))\n    ( refl)\n    ( triple-concat\n      ( f a = f a)\n      ( transport A ( \\ x \u2192 (f x) = (f a))\n        ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( a)\n        ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a)))\n      ( concat B\n        ( f a)\n        ( f (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)))\n        ( f a)\n        ( ap A B\n          ( a)\n          ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n          ( f)\n          ( rev A ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a\n            ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a)))\n      ( concat B\n        ( f a)\n        ( f (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)))\n        ( f a)\n        ( ap A B\n          ( a)\n          ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n          ( f)\n          ( rev A (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a\n            ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n        ( ap A B (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a f\n          ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n      ( refl)\n      ( transport-in-fiber A B f (f a)\n        ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( a)\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a))\n      ( concat-eq-right B\n        ( f a)\n        ( f (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)))\n        ( f a)\n        ( ap A B\n          ( a)\n          ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n          ( f)\n          ( rev A ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a\n            ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n        ( section-htpy-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( ap A B (map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a)) a f\n          ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a))\n        (coherence-is-half-adjoint-equiv A B f is-hae-f a))\n      ( concat-ap-rev-ap-id A B\n        ( map-inverse-is-half-adjoint-equiv A B f is-hae-f (f a))\n        ( a)\n        ( f)\n        ( retraction-htpy-is-half-adjoint-equiv A B f is-hae-f a)))\n#def contraction-fib-is-half-adjoint-equiv uses (is-hae-f)\n( b : B)\n( z : fib A B f b)\n  : is-split-surjection-is-half-adjoint-equiv b = z\n  :=\n    ind-fib\n    ( A) (B) (f)\n    ( \\ b' z' \u2192 is-split-surjection-is-half-adjoint-equiv b' = z')\n    ( calculate-is-split-surjection-is-half-adjoint-equiv)\n    ( b)\n    ( z)\n#def is-contr-map-is-half-adjoint-equiv uses (is-hae-f)\n  : is-contr-map A B f\n  :=\n\\ b \u2192\n      ( is-split-surjection-is-half-adjoint-equiv b,\n        contraction-fib-is-half-adjoint-equiv b)\n#end is-contr-map-is-equiv\n
"},{"location":"hott/07-fibers.rzk/#equivalences-are-contractible-maps","title":"Equivalences are contractible maps","text":"
#def is-contr-map-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n  : is-contr-map A B f\n  :=\n\\ b \u2192\n    ( is-split-surjection-is-half-adjoint-equiv A B f\n      ( is-half-adjoint-equiv-is-equiv A B f is-equiv-f) b ,\n\\ z \u2192 contraction-fib-is-half-adjoint-equiv A B f\n        ( is-half-adjoint-equiv-is-equiv A B f is-equiv-f) b z)\n#def is-contr-map-iff-is-equiv\n( A B : U)\n( f : A \u2192 B)\n  : iff (is-contr-map A B f) (is-equiv A B f)\n  := (is-equiv-is-contr-map A B f , is-contr-map-is-equiv A B f)\n
"},{"location":"hott/07-fibers.rzk/#fibers-of-projections","title":"Fibers of projections","text":"

For a family of types B : A \u2192 U, the fiber of the projection from total-type A B to A over a : A is equivalent to B a. While both types deserve the name \"fibers\" to disambiguate, we temporarily refer to the fiber as the \"homotopy fiber\" and B a as the \"strict fiber.\"

#section strict-vs-homotopy-fiber\n#variable A : U\n#variable B : A \u2192 U\n#def homotopy-fiber-strict-fiber\n(a : A)\n(b : B a)\n  : fib (total-type A B) A (projection-total-type A B) a\n  := ((a, b), refl)\n#def strict-fiber-homotopy-fiber\n(a : A)\n  (((a', b'), p) : fib (total-type A B) A (projection-total-type A B) a)\n  : B a\n  := transport A B a' a p b'\n#def retract-homotopy-fiber-strict-fiber\n(a : A)\n(b : B a)\n  : strict-fiber-homotopy-fiber a (homotopy-fiber-strict-fiber a b) = b\n  := refl\n#def calculation-retract-strict-fiber-homotopy-fiber\n(a : A)\n(b : B a)\n  : homotopy-fiber-strict-fiber a\n    ( strict-fiber-homotopy-fiber a ((a, b), refl)) =\n    ( (a, b), refl)\n  := refl\n#def retract-strict-fiber-homotopy-fiber\n(a : A)\n  (((a', b'), p) : fib (total-type A B) A (projection-total-type A B) a)\n  : homotopy-fiber-strict-fiber a (strict-fiber-homotopy-fiber a ((a', b'), p))\n    = ((a', b'), p)\n  :=\n    ind-fib\n    ( total-type A B)\n    ( A)\n    ( projection-total-type A B)\n    ( \\ a0 ((a'', b''), p') \u2192\n      homotopy-fiber-strict-fiber a0\n      ( strict-fiber-homotopy-fiber a0 ((a'', b''), p')) = ((a'', b''), p'))\n    ( \\ (a'', b'') \u2192 refl)\n    ( a)\n    ( ((a', b'), p))\n#def equiv-homotopy-fiber-strict-fiber\n(a : A)\n  : Equiv\n    ( B a)\n    ( fib (total-type A B) A (projection-total-type A B) a)\n  :=\n    ( homotopy-fiber-strict-fiber a,\n      ( ( strict-fiber-homotopy-fiber a,\n          retract-homotopy-fiber-strict-fiber a),\n        ( strict-fiber-homotopy-fiber a,\n          retract-strict-fiber-homotopy-fiber a)))\n#end strict-vs-homotopy-fiber\n
"},{"location":"hott/07-fibers.rzk/#fibers-of-composites","title":"Fibers of composites","text":"

The fiber of a composite function is a sum over the fiber of the second function of the fibers of the first function.

#section fiber-composition\n#variables A B C : U\n#variable f : A \u2192 B\n#variable g : B \u2192 C\n#def fiber-sum-fiber-comp\n(c : C)\n  ((a, r) : fib A C (comp A B C g f) c)\n  : ( \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  := ((f a, r), (a, refl))\n#def fiber-comp-fiber-sum\n(c : C)\n  ( ((b, q), (a, p)) : \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  : fib A C (comp A B C g f) c\n  := (a, concat C (g (f a)) (g b) c (ap B C (f a) b g p) q)\n#def is-retract-fiber-sum-fiber-comp\n(c : C)\n  ((a, r) : fib A C (comp A B C g f) c)\n  : fiber-comp-fiber-sum c (fiber-sum-fiber-comp c (a, r)) = (a, r)\n  :=\n    eq-eq-fiber-\u03a3\n    ( A)\n    ( \\ a0 \u2192 (g (f a0)) = c)\n    ( a)\n    ( concat C (g (f a)) (g (f a)) c refl r)\n    ( r)\n    ( left-unit-concat C (g (f a)) c r)\n#def is-retract-fiber-comp-fiber-sum'\n(c : C)\n  ((b, q) : fib B C g c)\n  : ((a, p) : fib A B f b) \u2192\n    fiber-sum-fiber-comp c (fiber-comp-fiber-sum c ((b, q), (a, p))) =\n    ((b, q), (a, p))\n  :=\n    ind-fib B C g\n    ( \\ c' (b', q') \u2192 ((a, p) : fib A B f b') \u2192\n      fiber-sum-fiber-comp c' (fiber-comp-fiber-sum c' ((b', q'), (a, p))) =\n      ((b', q'), (a, p)))\n    ( \\ b0 (a, p) \u2192\n      ( ind-fib A B f\n        ( \\b0' (a', p') \u2192\n          fiber-sum-fiber-comp (g b0')\n          ( fiber-comp-fiber-sum (g b0') ((b0', refl), (a', p'))) =\n          ((b0', refl), (a', p')))\n        ( \\a0 \u2192 refl)\n        ( b0)\n        ( (a, p))))\n    ( c)\n    ( (b, q))\n#def is-retract-fiber-comp-fiber-sum\n(c : C)\n  ( ((b, q), (a, p)) : \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  : fiber-sum-fiber-comp c (fiber-comp-fiber-sum c ((b, q), (a, p))) =\n    ((b, q), (a, p))\n  := is-retract-fiber-comp-fiber-sum' c (b, q) (a, p)\n#def equiv-fiber-sum-fiber-comp\n(c : C)\n  : Equiv\n    ( fib A C (comp A B C g f) c)\n    ( \u03a3 ((b, q) : fib B C g c), fib A B f b)\n  :=\n    ( fiber-sum-fiber-comp c,\n      ( ( fiber-comp-fiber-sum c,\n          is-retract-fiber-sum-fiber-comp c),\n        ( fiber-comp-fiber-sum c,\n          is-retract-fiber-comp-fiber-sum c)))\n#end fiber-composition\n
"},{"location":"hott/08-families-of-maps.rzk/","title":"8. Families of maps","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/08-families-of-maps.rzk/#fiber-of-total-map","title":"Fiber of total map","text":"

We now calculate the fiber of the map on total spaces associated to a family of maps.

#def total-map\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n  : ( \u03a3 (x : A) , B x) \u2192 (\u03a3 (x : A) , C x)\n  := \\ z \u2192 (first z , f (first z) (second z))\n#def total-map-to-fiber\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : fib (B (first w)) (C (first w)) (f (first w)) (second w) \u2192\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w)\n  :=\n    \\ (b , p) \u2192\n      ( (first w , b) ,\n        eq-eq-fiber-\u03a3 A C (first w) (f (first w) b) (second w) p)\n#def total-map-from-fiber\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w \u2192\n    fib (B (first w)) (C (first w)) (f (first w)) (second w)\n  :=\n    \\ (z , p) \u2192\n    ind-path\n( \u03a3 (x : A) , C x)\n      ( total-map A B C f z)\n      ( \\ w' p' \u2192 fib (B (first w')) (C (first w')) (f (first w')) (second w'))\n      ( second z , refl)\n      ( w)\n      ( p)\n#def total-map-to-fiber-retraction\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : has-retraction\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w)\n    ( total-map-to-fiber A B C f w)\n  :=\n    ( ( total-map-from-fiber A B C f w) ,\n      ( \\ (b , p) \u2192\n        ind-path\n          ( C (first w))\n          ( f (first w) b)\n          ( \\ w1 p' \u2192\n            ( ( total-map-from-fiber A B C f ((first w , w1)))\n              ( (total-map-to-fiber A B C f (first w , w1)) (b , p')))\n            =_{(fib (B (first w)) (C (first w)) (f (first w)) (w1))}\n            ( b , p'))\n          ( refl)\n          ( second w)\n          ( p)))\n#def total-map-to-fiber-section\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : has-section\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f) w)\n    ( total-map-to-fiber A B C f w)\n  :=\n    ( ( total-map-from-fiber A B C f w) ,\n      ( \\ (z , p) \u2192\n        ind-path\n( \u03a3 (x : A) , C x)\n          ( first z , f (first z) (second z))\n          ( \\ w' p' \u2192\n            ( ( total-map-to-fiber A B C f w')\n              ( ( total-map-from-fiber A B C f w') (z , p'))) =\n            ( z , p'))\n          ( refl)\n          ( w)\n          ( p)))\n#def total-map-to-fiber-is-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : is-equiv\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n      ( total-map A B C f) w)\n    ( total-map-to-fiber A B C f w)\n  :=\n    ( total-map-to-fiber-retraction A B C f w ,\n      total-map-to-fiber-section A B C f w)\n#def total-map-fiber-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( w : (\u03a3 (x : A) , C x))\n  : Equiv\n    ( fib (B (first w)) (C (first w)) (f (first w)) (second w))\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n      ( total-map A B C f) w)\n  := (total-map-to-fiber A B C f w , total-map-to-fiber-is-equiv A B C f w)\n
"},{"location":"hott/08-families-of-maps.rzk/#families-of-equivalences","title":"Families of equivalences","text":"

A family of equivalences induces an equivalence on total spaces and conversely. It will be easiest to work with the incoherent notion of two-sided-inverses.

#def invertible-family-total-inverse\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : ( \u03a3 (x : A) , C x) \u2192 (\u03a3 (x : A) , B x)\n  := \\ (a , c) \u2192 (a , (map-inverse-has-inverse (B a) (C a) (f a) (invfamily a)) c)\n#def invertible-family-total-retraction\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : has-retraction\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n    ( total-map A B C f)\n  :=\n    ( invertible-family-total-inverse A B C f invfamily ,\n      \\ (a , b) \u2192\n        (eq-eq-fiber-\u03a3 A B a\n          ( (map-inverse-has-inverse (B a) (C a) (f a) (invfamily a)) (f a b)) b\n          ( (first (second (invfamily a))) b)))\n#def invertible-family-total-section\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : has-section (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n  :=\n    ( invertible-family-total-inverse A B C f invfamily ,\n      \\ (a , c) \u2192\n        ( eq-eq-fiber-\u03a3 A C a\n          ( f a ((map-inverse-has-inverse (B a) (C a) (f a) (invfamily a)) c)) c\n          ( (second (second (invfamily a))) c)))\n#def invertible-family-total-invertible\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( invfamily : (a : A) \u2192 has-inverse (B a) (C a) (f a))\n  : has-inverse\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n    ( total-map A B C f)\n  :=\n    ( invertible-family-total-inverse A B C f invfamily ,\n      ( second (invertible-family-total-retraction A B C f invfamily) ,\nsecond (invertible-family-total-section A B C f invfamily)))\n#def family-of-equiv-total-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( familyequiv : (a : A) \u2192 is-equiv (B a) (C a) (f a))\n  : is-equiv\n( \u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n  :=\n    is-equiv-has-inverse\n( \u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n    ( invertible-family-total-invertible A B C f\n      ( \\ a \u2192 has-inverse-is-equiv (B a) (C a) (f a) (familyequiv a)))\n#def total-equiv-family-equiv\n( A : U)\n( B C : A \u2192 U)\n( familyeq : (a : A) \u2192 Equiv (B a) (C a))\n  : Equiv (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n  :=\n    ( total-map A B C (\\ a \u2192 first (familyeq a)) ,\n      family-of-equiv-total-equiv A B C\n        ( \\ a \u2192 first (familyeq a))\n        ( \\ a \u2192 second (familyeq a)))\n

The one-way result: that a family of equivalence gives an invertible map (and thus an equivalence) on total spaces.

#def total-has-inverse-family-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( familyequiv : (a : A) \u2192 is-equiv (B a) (C a) (f a))\n  : has-inverse (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x) (total-map A B C f)\n  :=\n    invertible-family-total-invertible A B C f\n    ( \\ a \u2192 has-inverse-is-equiv (B a) (C a) (f a) (familyequiv a))\n

For the converse, we make use of our calculation on fibers. The first implication could be proven similarly.

#def total-contr-map-family-of-contr-maps\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( totalcontrmap :\n    is-contr-map\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n      ( total-map A B C f))\n( a : A)\n  : is-contr-map (B a) (C a) (f a)\n  :=\n\\ c \u2192\n      is-contr-equiv-is-contr'\n        ( fib (B a) (C a) (f a) c)\n( fib (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n          ( total-map A B C f) ((a , c)))\n        ( total-map-fiber-equiv A B C f ((a , c)))\n        ( totalcontrmap ((a , c)))\n#def total-equiv-family-of-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( totalequiv : is-equiv\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n                ( total-map A B C f))\n(a : A)\n  : is-equiv (B a) (C a) (f a)\n  :=\n    is-equiv-is-contr-map (B a) (C a) (f a)\n( total-contr-map-family-of-contr-maps A B C f\n      ( is-contr-map-is-equiv\n        ( \u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n        ( total-map A B C f) totalequiv) a)\n#def family-equiv-total-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n( totalequiv : is-equiv\n( \u03a3 (x : A) , B x)\n( \u03a3 (x : A) , C x)\n                ( total-map A B C f))\n( a : A)\n  : Equiv (B a) (C a)\n  := ( f a , total-equiv-family-of-equiv A B C f totalequiv a)\n

In summary, a family of maps is an equivalence iff the map on total spaces is an equivalence.

#def total-equiv-iff-family-of-equiv\n( A : U)\n( B C : A \u2192 U)\n( f : (a : A) \u2192 (B a) \u2192 (C a))\n  : iff\n( (a : A) \u2192 is-equiv (B a) (C a) (f a))\n( is-equiv (\u03a3 (x : A) , B x) (\u03a3 (x : A) , C x)\n        ( total-map A B C f))\n  := (family-of-equiv-total-equiv A B C f , total-equiv-family-of-equiv A B C f)\n
"},{"location":"hott/08-families-of-maps.rzk/#endpoint-based-path-spaces","title":"Endpoint based path spaces","text":"An equivalence between the based path spaces
#def equiv-based-paths\n( A : U)\n( a : A)\n  : Equiv (\u03a3 (x : A) , x = a) (\u03a3 (x : A) , a = x)\n  := total-equiv-family-equiv A (\\ x \u2192 x = a) (\\ x \u2192 a = x) (\\ x \u2192 equiv-rev A x a)\n
Endpoint based path spaces are contractible
#def is-contr-endpoint-based-paths\n( A : U)\n( a : A)\n  : is-contr (\u03a3 (x : A) , x = a)\n  :=\n    is-contr-equiv-is-contr' (\u03a3 (x : A) , x = a) (\u03a3 (x : A) , a = x)\n      ( equiv-based-paths A a)\n      ( is-contr-based-paths A a)\n
"},{"location":"hott/08-families-of-maps.rzk/#pullback-of-a-type-family","title":"Pullback of a type family","text":"

A family of types over B pulls back along any function f : A \u2192 B to define a family of types over A.

#def pullback\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n  : A \u2192 U\n  := \\ a \u2192 C (f a)\n

The pullback of a family along homotopic maps is equivalent.

#section is-equiv-pullback-htpy\n#variables A B : U\n#variables f g : A \u2192 B\n#variable \u03b1 : homotopy A B f g\n#variable C : B \u2192 U\n#variable a : A\n#def pullback-homotopy\n  : (pullback A B f C a) \u2192 (pullback A B g C a)\n  := transport B C (f a) (g a) (\u03b1 a)\n#def map-inverse-pullback-homotopy\n  : (pullback A B g C a) \u2192 (pullback A B f C a)\n  := transport B C (g a) (f a) (rev B (f a) (g a) (\u03b1 a))\n#def has-retraction-pullback-homotopy\n  : has-retraction\n    ( pullback A B f C a)\n    ( pullback A B g C a)\n    ( pullback-homotopy)\n  :=\n    ( map-inverse-pullback-homotopy ,\n\\ c \u2192\n        concat\n        ( pullback A B f C a)\n        ( transport B C (g a) (f a)\n          ( rev B (f a) (g a) (\u03b1 a))\n          ( transport B C (f a) (g a) (\u03b1 a) c))\n        ( transport B C (f a) (f a)\n          ( concat B (f a) (g a) (f a) (\u03b1 a) (rev B (f a) (g a) (\u03b1 a))) c)\n        ( c)\n        ( transport-concat-rev B C (f a) (g a) (f a) (\u03b1 a)\n          ( rev B (f a) (g a) (\u03b1 a)) c)\n        ( transport2 B C (f a) (f a)\n          ( concat B (f a) (g a) (f a) (\u03b1 a) (rev B (f a) (g a) (\u03b1 a))) refl\n          ( right-inverse-concat B (f a) (g a) (\u03b1 a)) c))\n#def has-section-pullback-homotopy\n  : has-section (pullback A B f C a) (pullback A B g C a)\n    ( pullback-homotopy)\n  :=\n    ( map-inverse-pullback-homotopy ,\n\\ c \u2192\n      concat\n        ( pullback A B g C a)\n        ( transport B C (f a) (g a) (\u03b1 a)\n          ( transport B C (g a) (f a) (rev B (f a) (g a) (\u03b1 a)) c))\n        ( transport B C (g a) (g a)\n          ( concat B (g a) (f a) (g a) (rev B (f a) (g a) (\u03b1 a)) (\u03b1 a)) c)\n        ( c)\n        ( transport-concat-rev B C (g a) (f a) (g a)\n          ( rev B (f a) (g a) (\u03b1 a)) (\u03b1 a) (c))\n        ( transport2 B C (g a) (g a)\n          ( concat B (g a) (f a) (g a) (rev B (f a) (g a) (\u03b1 a)) (\u03b1 a))\n          ( refl)\n          ( left-inverse-concat B (f a) (g a) (\u03b1 a)) c))\n#def is-equiv-pullback-homotopy uses (\u03b1)\n  : is-equiv\n      ( pullback A B f C a)\n      ( pullback A B g C a)\n      ( pullback-homotopy)\n  := ( has-retraction-pullback-homotopy , has-section-pullback-homotopy)\n#def equiv-pullback-homotopy uses (\u03b1)\n  : Equiv (pullback A B f C a) (pullback A B g C a)\n  := (pullback-homotopy , is-equiv-pullback-homotopy)\n#end is-equiv-pullback-htpy\n

The total space of a pulled back family of types maps to the original total space.

#def pullback-comparison-map\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n  : (\u03a3 (a : A) , (pullback A B f C) a) \u2192 (\u03a3 (b : B) , C b)\n  := \\ (a , c) \u2192 (f a , c)\n

Now we show that if a family is pulled back along an equivalence, the total spaces are equivalent by proving that the comparison is a contractible map. For this, we first prove that each fiber is equivalent to a fiber of the original map.

#def pullback-comparison-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : U\n  :=\n    fib\n( \u03a3 (a : A) , (pullback A B f C) a)\n( \u03a3 (b : B) , C b)\n      ( pullback-comparison-map A B f C) z\n#def pullback-comparison-fiber-to-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : (pullback-comparison-fiber A B f C z) \u2192 (fib A B f (first z))\n  :=\n    \\ (w , p) \u2192\n    ind-path\n( \u03a3 (b : B) , C b)\n      ( pullback-comparison-map A B f C w)\n      ( \\ z' p' \u2192\n        ( fib A B f (first z')))\n      ( first w , refl)\n      ( z)\n      ( p)\n#def from-base-fiber-to-pullback-comparison-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( b : B)\n  : (fib A B f b) \u2192 (c : C b) \u2192 (pullback-comparison-fiber A B f C (b , c))\n  :=\n    \\ (a , p) \u2192\n    ind-path\n      ( B)\n      ( f a)\n( \\ b' p' \u2192\n          (c : C b') \u2192 (pullback-comparison-fiber A B f C ((b' , c))))\n      ( \\ c \u2192 ((a , c) , refl))\n      ( b)\n      ( p)\n#def pullback-comparison-fiber-to-fiber-inv\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : (fib A B f (first z)) \u2192 (pullback-comparison-fiber A B f C z)\n  :=\n    \\ (a , p) \u2192\n      from-base-fiber-to-pullback-comparison-fiber A B f C\n      ( first z) (a , p) (second z)\n#def pullback-comparison-fiber-to-fiber-retracting-homotopy\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  ( (w , p) : pullback-comparison-fiber A B f C z)\n  : ( (pullback-comparison-fiber-to-fiber-inv A B f C z)\n      ( (pullback-comparison-fiber-to-fiber A B f C z) (w , p))) = (w , p)\n  :=\n    ind-path\n( \u03a3 (b : B) , C b)\n      ( pullback-comparison-map A B f C w)\n      ( \\ z' p' \u2192\n        ( ( pullback-comparison-fiber-to-fiber-inv A B f C z')\n          ( ( pullback-comparison-fiber-to-fiber A B f C z') (w , p'))) =\n        ( w , p'))\n      ( refl)\n      ( z)\n      ( p)\n#def pullback-comparison-fiber-to-fiber-section-homotopy-map\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( b : B)\n  ( (a , p) : fib A B f b)\n  : (c : C b) \u2192\n      ((pullback-comparison-fiber-to-fiber A B f C (b , c))\n        ((pullback-comparison-fiber-to-fiber-inv A B f C (b , c)) (a , p))) =\n      (a , p)\n  :=\n    ind-path\n      ( B)\n      ( f a)\n( \\ b' p' \u2192\n        ( c : C b') \u2192\n        ( ( pullback-comparison-fiber-to-fiber A B f C (b' , c))\n          ( (pullback-comparison-fiber-to-fiber-inv A B f C (b' , c)) (a , p'))) =\n        ( a , p'))\n      ( \\ c \u2192 refl)\n      ( b)\n      ( p)\n#def pullback-comparison-fiber-to-fiber-section-homotopy\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  ( (a , p) : fib A B f (first z))\n  : ( pullback-comparison-fiber-to-fiber A B f C z\n      ( pullback-comparison-fiber-to-fiber-inv A B f C z (a , p))) = (a , p)\n  :=\n    pullback-comparison-fiber-to-fiber-section-homotopy-map A B f C\n      ( first z) (a , p) (second z)\n#def equiv-pullback-comparison-fiber\n( A B : U)\n( f : A \u2192 B)\n( C : B \u2192 U)\n( z : \u03a3 (b : B) , C b)\n  : Equiv (pullback-comparison-fiber A B f C z) (fib A B f (first z))\n  :=\n    ( pullback-comparison-fiber-to-fiber A B f C z ,\n      ( ( pullback-comparison-fiber-to-fiber-inv A B f C z ,\n          pullback-comparison-fiber-to-fiber-retracting-homotopy A B f C z) ,\n        ( pullback-comparison-fiber-to-fiber-inv A B f C z ,\n          pullback-comparison-fiber-to-fiber-section-homotopy A B f C z)))\n

As a corollary, we show that pullback along an equivalence induces an equivalence of total spaces.

#def total-equiv-pullback-is-equiv\n( A B : U)\n( f : A \u2192 B)\n( is-equiv-f : is-equiv A B f)\n( C : B \u2192 U)\n  : Equiv (\u03a3 (a : A) , (pullback A B f C) a) (\u03a3 (b : B) , C b)\n  :=\n( pullback-comparison-map A B f C ,\n      is-equiv-is-contr-map\n        ( \u03a3 (a : A) , (pullback A B f C) a)\n( \u03a3 (b : B) , C b)\n        ( pullback-comparison-map A B f C)\n        ( \\ z \u2192\n          ( is-contr-equiv-is-contr'\n            ( pullback-comparison-fiber A B f C z)\n            ( fib A B f (first z))\n            ( equiv-pullback-comparison-fiber A B f C z)\n            ( is-contr-map-is-equiv A B f is-equiv-f (first z)))))\n
"},{"location":"hott/08-families-of-maps.rzk/#fundamental-theorem-of-identity-types","title":"Fundamental theorem of identity types","text":"
#section fundamental-thm-id-types\n#variable A : U\n#variable a : A\n#variable B : A \u2192 U\n#variable f : (x : A) \u2192 (a = x) \u2192 B x\n#def fund-id-fam-of-eqs-implies-sum-over-codomain-contr\n  : ((x : A) \u2192 (is-equiv (a = x) (B x) (f x))) \u2192 (is-contr (\u03a3 (x : A) , B x))\n  :=\n( \\ familyequiv \u2192\n      ( equiv-with-contractible-domain-implies-contractible-codomain\n        ( \u03a3 (x : A) , a = x) (\u03a3 (x : A) , B x)\n        ( ( total-map A ( \\ x \u2192 (a = x)) B f) ,\n( is-equiv-has-inverse (\u03a3 (x : A) , a = x) (\u03a3 (x : A) , B x)\n            ( total-map A ( \\ x \u2192 (a = x)) B f)\n            ( total-has-inverse-family-equiv A\n              ( \\ x \u2192 (a = x)) B f familyequiv)))\n        ( is-contr-based-paths A a)))\n#def fund-id-sum-over-codomain-contr-implies-fam-of-eqs\n  : ( is-contr (\u03a3 (x : A) , B x)) \u2192\n( (x : A) \u2192 (is-equiv (a = x) (B x) (f x)))\n  :=\n    ( \\ is-contr-\u03a3-A-B x \u2192\n      total-equiv-family-of-equiv A\n        ( \\ x' \u2192 (a = x'))\n        ( B)\n        ( f)\n( is-equiv-are-contr\n          ( \u03a3 (x' : A) , (a = x'))\n( \u03a3 (x' : A) , (B x'))\n          ( is-contr-based-paths A a)\n          ( is-contr-\u03a3-A-B)\n          ( total-map A (\\ x' \u2192 (a = x')) B f))\n        ( x))\n

This allows us to apply \"based path induction\" to a family satisfying the fundamental theorem:

-- Please suggest a better name.\n#def ind-based-path\n( familyequiv : (z : A) \u2192 (is-equiv (a = z) (B z) (f z)))\n( P : (z : A) \u2192 B z \u2192 U)\n( p0 : P a (f a refl))\n( u : A)\n( p : B u)\n  : P u p\n  :=\n    ind-sing\n( \u03a3 (v : A) , B v)\n      ( a , f a refl)\n      ( \\ (u' , p') \u2192 P u' p')\n( contr-implies-singleton-induction-pointed\n        ( \u03a3 (z : A) , B z)\n        ( fund-id-fam-of-eqs-implies-sum-over-codomain-contr familyequiv)\n        ( \\ (x' , p') \u2192 P x' p'))\n      ( p0)\n      ( u , p)\n#end fundamental-thm-id-types\n
"},{"location":"hott/08-families-of-maps.rzk/#maps-over-product-types","title":"Maps over product types","text":"

For later use, we specialize the previous results to the case of a family of types over a product type.

#section fibered-map-over-product\n#variables A A' B B' : U\n#variable C : A \u2192 B \u2192 U\n#variable C' : A' \u2192 B' \u2192 U\n#variable f : A \u2192 A'\n#variable g : B \u2192 B'\n#variable h : (a : A) \u2192 (b : B) \u2192 (c : C a b) \u2192 C' (f a) (g b)\n#def total-map-fibered-map-over-product\n  : (\u03a3 (a : A) , (\u03a3 (b : B) , C a b)) \u2192 (\u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n  := \\ (a , (b , c)) \u2192 (f a , (g b , h a b c))\n#def pullback-is-equiv-base-is-equiv-total-is-equiv\n( is-equiv-total :\n    is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n      ( total-map-fibered-map-over-product))\n( is-equiv-f : is-equiv A A' f)\n  : is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b' : B') , C' (f a) b'))\n      ( \\ (a , (b , c)) \u2192 (a , (g b , h a b c)))\n  :=\n    is-equiv-right-factor\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b' : B') , C' (f a) b'))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n    ( \\ (a , (b , c)) \u2192 (a , (g b , h a b c)))\n    ( \\ (a , (b' , c')) \u2192 (f a , (b' , c')))\n    ( second\n      ( total-equiv-pullback-is-equiv\n        ( A) (A')\n        ( f) (is-equiv-f)\n( \\ a' \u2192 (\u03a3 (b' : B') , C' a' b'))))\n    ( is-equiv-total)\n#def pullback-is-equiv-bases-are-equiv-total-is-equiv\n( is-equiv-total :\n      is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n        ( total-map-fibered-map-over-product))\n( is-equiv-f : is-equiv A A' f)\n( is-equiv-g : is-equiv B B' g)\n  : is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b : B) , C' (f a) (g b)))\n      ( \\ (a , (b , c)) \u2192 (a , (b , h a b c)))\n  :=\n    is-equiv-right-factor\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a : A) , (\u03a3 (b : B) , C' (f a) (g b)))\n( \u03a3 (a : A) , (\u03a3 (b' : B') , C' (f a) b'))\n    ( \\ (a , (b , c)) \u2192 (a , (b , h a b c)))\n    ( \\ (a , (b , c)) \u2192 (a , (g b , c)))\n( family-of-equiv-total-equiv A\n      ( \\ a \u2192 (\u03a3 (b : B) , C' (f a) (g b)))\n( \\ a \u2192 (\u03a3 (b' : B') , C' (f a) b'))\n      ( \\ a (b , c) \u2192 (g b , c))\n      ( \\ a \u2192\n        ( second\n          ( total-equiv-pullback-is-equiv\n            ( B) (B')\n            ( g) (is-equiv-g)\n            ( \\ b' \u2192 C' (f a) b')))))\n    ( pullback-is-equiv-base-is-equiv-total-is-equiv is-equiv-total is-equiv-f)\n#def fibered-map-is-equiv-bases-are-equiv-total-map-is-equiv\n( is-equiv-total :\n      is-equiv\n( \u03a3 (a : A) , (\u03a3 (b : B) , C a b))\n( \u03a3 (a' : A') , (\u03a3 (b' : B') , C' a' b'))\n        ( total-map-fibered-map-over-product))\n( is-equiv-f : is-equiv A A' f)\n( is-equiv-g : is-equiv B B' g)\n( a0 : A)\n( b0 : B)\n  : is-equiv (C a0 b0) (C' (f a0) (g b0)) (h a0 b0)\n  :=\n    total-equiv-family-of-equiv B\n      ( \\ b \u2192 C a0 b)\n      ( \\ b \u2192 C' (f a0) (g b))\n      ( \\ b c \u2192 h a0 b c)\n      ( total-equiv-family-of-equiv\n        ( A)\n( \\ a \u2192 (\u03a3 (b : B) , C a b))\n( \\ a \u2192 (\u03a3 (b : B) , C' (f a) (g b)))\n        ( \\ a (b , c) \u2192 (b , h a b c))\n        ( pullback-is-equiv-bases-are-equiv-total-is-equiv\n            is-equiv-total is-equiv-f is-equiv-g)\n        ( a0))\n      ( b0)\n#end fibered-map-over-product\n
"},{"location":"hott/09-propositions.rzk/","title":"9. Propositions","text":"

This is a literate rzk file:

#lang rzk-1\n

Some of the definitions in this file rely on function extensionality and weak function extensionality:

#assume funext : FunExt\n#assume weakfunext : WeakFunExt\n
"},{"location":"hott/09-propositions.rzk/#propositions","title":"Propositions","text":"

A type is a proposition when its identity types are contractible.

#def is-prop\n(A : U)\n  : U\n  := (a : A) \u2192 (b : A) \u2192 is-contr (a = b)\n#def is-prop-Unit\n  : is-prop Unit\n  := \\ x y \u2192 (path-types-of-Unit-are-contractible x y)\n
"},{"location":"hott/09-propositions.rzk/#alternative-characterizations-definitions","title":"Alternative characterizations: definitions","text":"
#def all-elements-equal\n(A : U)\n  : U\n  := (a : A) \u2192 (b : A) \u2192 (a = b)\n#def is-contr-is-inhabited\n(A : U)\n  : U\n  := A \u2192 is-contr A\n#def is-emb-terminal-map\n(A : U)\n  : U\n  := is-emb A Unit (terminal-map A)\n
"},{"location":"hott/09-propositions.rzk/#alternative-characterizations-proofs","title":"Alternative characterizations: proofs","text":"
#def all-elements-equal-is-prop\n( A : U)\n( is-prop-A : is-prop A)\n  : all-elements-equal A\n  := \\ a b \u2192 (first (is-prop-A a b))\n#def is-contr-is-inhabited-all-elements-equal\n( A : U)\n( all-elements-equal-A : all-elements-equal A)\n  : is-contr-is-inhabited A\n  := \\ a \u2192 (a , all-elements-equal-A a)\n#def terminal-map-is-emb-is-inhabited-is-contr-is-inhabited\n( A : U)\n( c : is-contr-is-inhabited A)\n  : A \u2192 (is-emb-terminal-map A)\n  :=\n\\ x \u2192\n      ( is-emb-is-equiv A Unit (terminal-map A)\n        ( contr-implies-terminal-map-is-equiv A (c x)))\n#def terminal-map-is-emb-is-contr-is-inhabited\n( A : U)\n( c : is-contr-is-inhabited A)\n  : (is-emb-terminal-map A)\n  :=\n    ( is-emb-is-inhabited-emb A Unit (terminal-map A)\n      ( terminal-map-is-emb-is-inhabited-is-contr-is-inhabited A c))\n#def is-prop-is-emb-terminal-map\n( A : U)\n( f : is-emb-terminal-map A)\n  : is-prop A\n  :=\n\\ x y \u2192\n      ( is-contr-equiv-is-contr' (x = y) (unit = unit)\n        ( (ap A Unit x y (terminal-map A)) , (f x y))\n        ( path-types-of-Unit-are-contractible unit unit))\n#def is-prop-is-contr-is-inhabited\n( A : U)\n( c : is-contr-is-inhabited A)\n  : is-prop A\n  :=\n    ( is-prop-is-emb-terminal-map A\n      ( terminal-map-is-emb-is-contr-is-inhabited A c))\n
"},{"location":"hott/09-propositions.rzk/#properties-of-propositions","title":"Properties of propositions","text":"

If some family B : A \u2192 U is fiberwise a proposition, then the type of dependent functions (x : A) \u2192 B x is a proposition.

#def is-prop-fiberwise-prop uses (funext weakfunext)\n( A : U)\n( B : A \u2192 U)\n( fiberwise-prop-B : (x : A) \u2192 is-prop (B x))\n  : is-prop ((x : A) \u2192 B x)\n  :=\n\\ f g \u2192\n    is-contr-equiv-is-contr'\n      ( f = g)\n( (x : A) \u2192 f x = g x)\n      ( equiv-FunExt funext A B f g)\n      ( weakfunext A (\\ x \u2192 f x = g x) (\\ x \u2192 fiberwise-prop-B x (f x) (g x)))\n

If two propositions are logically equivalent, then they are equivalent:

#def is-equiv-iff-is-prop-is-prop\n( A B : U)\n( is-prop-A : is-prop A)\n( is-prop-B : is-prop B)\n  ( (f , g) : iff A B)\n  : is-equiv A B f\n  :=\n    ( ( g ,\n\\ a \u2192\n          (all-elements-equal-is-prop A is-prop-A) ((comp A B A g f) a) a) ,\n      ( g ,\n\\ b \u2192\n          (all-elements-equal-is-prop B is-prop-B) ((comp B A B f g) b) b))\n#def equiv-iff-is-prop-is-prop\n( A B : U)\n( is-prop-A : is-prop A)\n( is-prop-B : is-prop B)\n( e : iff A B)\n  : Equiv A B\n  := (first e, is-equiv-iff-is-prop-is-prop A B is-prop-A is-prop-B e)\n
"},{"location":"hott/10-trivial-fibrations.rzk/","title":"10. Trivial Fibrations","text":"

This is a literate rzk file:

#lang rzk-1\n

In what follows we show that the projection from the total space of a Sigma type is an equivalence if and only if its fibers are contractible.

"},{"location":"hott/10-trivial-fibrations.rzk/#contractible-fibers","title":"Contractible fibers","text":"

The following type asserts that the fibers of a type family are contractible.

#def contractible-fibers\n( A : U)\n( B : A \u2192 U)\n  : U\n  := ((x : A) \u2192 is-contr (B x))\n#section contractible-fibers-data\n#variable A : U\n#variable B : A \u2192 U\n#variable contractible-fibers-A-B : contractible-fibers A B\n
The center of contraction in contractible fibers
#def contractible-fibers-section\n  : (x : A) \u2192 B x\n  := \\ x \u2192 center-contraction (B x) (contractible-fibers-A-B x)\n
The section of the total space projection built from the contraction centers
#def contractible-fibers-actual-section uses (contractible-fibers-A-B)\n  : (a : A) \u2192 \u03a3 (x : A) , B x\n  := \\ a \u2192 (a , contractible-fibers-section a)\n#def contractible-fibers-section-htpy uses (contractible-fibers-A-B)\n  : homotopy A A\n( comp A (\u03a3 (x : A) , B x) A\n      ( projection-total-type A B) (contractible-fibers-actual-section))\n    ( identity A)\n  := \\ x \u2192 refl\n#def contractible-fibers-section-is-section uses (contractible-fibers-A-B)\n  : has-section (\u03a3 (x : A) , B x) A (projection-total-type A B)\n  := (contractible-fibers-actual-section , contractible-fibers-section-htpy)\n

This can be used to define the retraction homotopy for the total space projection, called first here:

#def contractible-fibers-retraction-htpy\n  : (z : \u03a3 (x : A) , B x) \u2192\n      (contractible-fibers-actual-section) (first z) = z\n  :=\n\\ z \u2192\n    eq-eq-fiber-\u03a3 A B\n      ( first z)\n      ( (contractible-fibers-section) (first z))\n      ( second z)\n      ( homotopy-contraction (B (first z)) (contractible-fibers-A-B (first z)) (second z))\n#def contractible-fibers-retraction uses (contractible-fibers-A-B)\n  : has-retraction (\u03a3 (x : A) , B x) A (projection-total-type A B)\n  := (contractible-fibers-actual-section , contractible-fibers-retraction-htpy)\n

The first half of our main result:

#def is-equiv-projection-contractible-fibers uses (contractible-fibers-A-B)\n  : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B)\n  := (contractible-fibers-retraction , contractible-fibers-section-is-section)\n#def equiv-projection-contractible-fibers uses (contractible-fibers-A-B)\n  : Equiv (\u03a3 (x : A) , B x) A\n  := (projection-total-type A B , is-equiv-projection-contractible-fibers)\n#end contractible-fibers-data\n
"},{"location":"hott/10-trivial-fibrations.rzk/#projection-equivalences","title":"Projection equivalences","text":"

From a projection equivalence, it's not hard to inhabit fibers:

#def inhabited-fibers-is-equiv-projection\n( A : U)\n( B : A \u2192 U)\n( proj-B-to-A-is-equiv : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n( a : A)\n  : B a\n  :=\n    transport A B (first ((first (second proj-B-to-A-is-equiv)) a)) a\n      ( (second (second proj-B-to-A-is-equiv)) a)\n      ( second ((first (second proj-B-to-A-is-equiv)) a))\n

This is great but we need more coherence to show that the inhabited fibers are contractible; the following proof fails:

#def is-equiv-projection-implies-contractible-fibers\n  ( A : U)\n  ( B : A \u2192 U)\n  ( proj-B-to-A-is-equiv : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n  : contractible-fibers A B\n  :=\n    ( \\ x \u2192 (second (first (first proj-B-to-A-is-equiv) x) ,\n      ( \\ u \u2192\n        second-path-\u03a3 A B (first (first proj-B-to-A-is-equiv) x) (x , u)\n          ( second (first proj-B-to-A-is-equiv) (x , u)))))\n
#section projection-hae-data\n#variable A : U\n#variable B : A \u2192 U\n#variable proj-B-to-A-is-half-adjoint-equivalence :\n  is-half-adjoint-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B)\n#variable w : (\u03a3 (x : A) , B x)\n

We start over from a stronger hypothesis of a half adjoint equivalence.

#def projection-hae-inverse\n(a : A)\n  : \u03a3 (x : A) , B x\n  := (first (first proj-B-to-A-is-half-adjoint-equivalence)) a\n#def projection-hae-base-htpy uses (B)\n(a : A)\n  : (first (projection-hae-inverse a)) = a\n  := (second (second (first proj-B-to-A-is-half-adjoint-equivalence))) a\n#def projection-hae-section uses (proj-B-to-A-is-half-adjoint-equivalence)\n(a : A)\n  : B a\n  :=\n    transport A B (first (projection-hae-inverse a)) a\n      ( projection-hae-base-htpy a)\n      ( second (projection-hae-inverse a))\n#def projection-hae-total-htpy\n  : (projection-hae-inverse (first w)) = w\n  := (first (second (first proj-B-to-A-is-half-adjoint-equivalence))) w\n#def projection-hae-fibered-htpy\n  : (transport A B (first ((projection-hae-inverse (first w)))) (first w)\n    ( first-path-\u03a3 A B\n      ( projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy))\n    ( second (projection-hae-inverse (first w)))) =\n    ( second w)\n  :=\n    second-path-\u03a3 A B (projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy)\n#def projection-hae-base-coherence\n  : ( projection-hae-base-htpy (first w)) =\n    ( first-path-\u03a3 A B (projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy))\n  := (second proj-B-to-A-is-half-adjoint-equivalence) w\n#def projection-hae-transport-coherence\n  : ( projection-hae-section (first w)) =\n    ( transport A B (first ((projection-hae-inverse (first w)))) (first w)\n      ( first-path-\u03a3 A B\n        ( projection-hae-inverse (first w)) w\n        ( projection-hae-total-htpy))\n      ( second (projection-hae-inverse (first w))))\n  :=\n    transport2 A B (first (projection-hae-inverse (first w))) (first w)\n    ( projection-hae-base-htpy (first w))\n    ( first-path-\u03a3 A B (projection-hae-inverse (first w)) w\n      ( projection-hae-total-htpy))\n    ( projection-hae-base-coherence)\n    ( second (projection-hae-inverse (first w)))\n#def projection-hae-fibered-homotopy-contraction\n  : (projection-hae-section (first w)) =_{B (first w)} (second w)\n  :=\n    concat (B (first w))\n      ( projection-hae-section (first w))\n      ( transport A B\n        ( first ((projection-hae-inverse (first w))))\n        ( first w)\n        ( first-path-\u03a3 A B (projection-hae-inverse (first w)) w\n          ( projection-hae-total-htpy))\n        ( second (projection-hae-inverse (first w))))\n      ( second w)\n      ( projection-hae-transport-coherence)\n      ( projection-hae-fibered-htpy)\n#end projection-hae-data\n

Finally, we have:

#def contractible-fibers-is-half-adjoint-equiv-projection\n( A : U)\n( B : A \u2192 U)\n( proj-B-to-A-is-half-adjoint-equivalence\n    : is-half-adjoint-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n  : contractible-fibers A B\n  :=\n\\ x \u2192\n      ( (projection-hae-section A B proj-B-to-A-is-half-adjoint-equivalence x) ,\n\\ u \u2192\n          projection-hae-fibered-homotopy-contraction\n          A B proj-B-to-A-is-half-adjoint-equivalence (x , u))\n
The converse to our first result
#def contractible-fibers-is-equiv-projection\n( A : U)\n( B : A \u2192 U)\n( proj-B-to-A-is-equiv\n    : is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n  : contractible-fibers A B\n  :=\n    contractible-fibers-is-half-adjoint-equiv-projection A B\n( is-half-adjoint-equiv-is-equiv (\u03a3 (x : A) , B x) A\n        ( projection-total-type A B) proj-B-to-A-is-equiv)\n
The main theorem
#def projection-theorem\n( A : U)\n( B : A \u2192 U)\n  : iff\n( is-equiv (\u03a3 (x : A) , B x) A (projection-total-type A B))\n    ( contractible-fibers A B)\n  :=\n    ( \\ proj-B-to-A-is-equiv \u2192\n      contractible-fibers-is-equiv-projection A B proj-B-to-A-is-equiv ,\n\\ contractible-fibers-A-B \u2192\n      is-equiv-projection-contractible-fibers A B contractible-fibers-A-B)\n
"},{"location":"hott/10-trivial-fibrations.rzk/#equivalence-between-domain-and-sum-of-fibers","title":"Equivalence between domain and sum of fibers","text":"

For any map f : A \u2192 B the domain A is equivalent to the sum of the fibers.

#def equiv-domain-sum-of-fibers\n(A B : U)\n(f : A \u2192 B)\n  : Equiv A (\u03a3 (b : B), fib A B f b)\n  :=\n    equiv-left-cancel\n( \u03a3 (a : A), \u03a3 (b : B), f a = b)\n    ( A)\n( \u03a3 (b : B), fib A B f b)\n( equiv-projection-contractible-fibers\n      A\n      ( \\ a \u2192 \u03a3 (b : B), f a = b)\n      ( \\ a \u2192 is-contr-based-paths B (f a)))\n    ( fubini-\u03a3 A B (\\ a b \u2192 f a = b))\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/","title":"11. Homotopy cartesian squares","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#homotopy-cartesian-squares","title":"Homotopy cartesian squares","text":"

We start by fixing the data of a map between two type families A' \u2192 U and A \u2192 U, which we think of as a commutative square

\u03a3 A' \u2192 \u03a3 A\n \u2193      \u2193\n A'  \u2192  A\n

#section homotopy-cartesian\n-- We prepend all local names in this section\n-- with the random identifier temp-uBDx\n-- to avoid cluttering the global name space.\n-- Once rzk supports local variables, these should be renamed.\n#variable A' : U\n#variable C' : A' \u2192 U\n#variable A : U\n#variable C : A \u2192 U\n#variable \u03b1 : A' \u2192 A\n#variable \u03b3 : (a' : A') \u2192 C' a' \u2192 C (\u03b1 a')\n#def temp-uBDx-\u03a3\u03b1\u03b3\n  : total-type A' C' \u2192 total-type A C\n  := \\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c')\n

We say that such a square is homotopy cartesian just if it induces an equivalence componentwise.

#def is-homotopy-cartesian uses (A)\n  : U\n  :=\n( a' : A') \u2192 is-equiv (C' a') (C (\u03b1 a')) (\u03b3 a')\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#interaction-with-horizontal-equivalences","title":"Interaction with horizontal equivalences","text":"

We implement various ways homotopy-cartesian squares interact with horizontal equivalences.

For example, if the lower map \u03b1 : A' \u2192 A is an equivalence in a homotopy cartesian square, then so is the upper one \u03a3\u03b1\u03b3 : \u03a3 C' \u2192 \u03a3 C.

#def temp-uBDx-comp\n  : (total-type A' C') \u2192 (total-type A C)\n  := comp\n      ( total-type A' C')\n( \u03a3 (a' : A'), C (\u03b1 a'))\n      ( total-type A C)\n      ( \\ (a', c) \u2192 (\u03b1 a', c) )\n      ( total-map A' C' (\\ a' \u2192 C (\u03b1 a')) \u03b3)\n#def pull-up-equiv-is-homotopy-cartesian\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian)\n( is-equiv-\u03b1 : is-equiv A' A \u03b1)\n  : is-equiv (total-type A' C') (total-type A C) (\\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n  :=\n    is-equiv-homotopy\n      ( total-type A' C')\n      ( total-type A C)\n      ( temp-uBDx-\u03a3\u03b1\u03b3 )\n      ( temp-uBDx-comp )\n      (\\ _ \u2192 refl)\n      ( is-equiv-comp\n        ( total-type A' C')\n( \u03a3 (a' : A'), C (\u03b1 a'))\n        ( total-type A C)\n        ( total-map A' C' (\\ a' \u2192 C (\u03b1 a')) \u03b3)\n        ( family-of-equiv-total-equiv\n          ( A' )\n          ( C' )\n          ( \\ a' \u2192 C (\u03b1 a') )\n          ( \u03b3)\n          ( \\ a' \u2192 is-hc-\u03b1-\u03b3 a'))\n        ( \\ (a', c) \u2192 (\u03b1 a', c) )\n        ( second\n          ( total-equiv-pullback-is-equiv\n            ( A')\n            ( A )\n            ( \u03b1 )\n            ( is-equiv-\u03b1 )\n            ( C ))))\n

Conversely, if both the upper and the lower maps are equivalences, then the square is homotopy-cartesian.

#def is-homotopy-cartesian-is-horizontal-equiv\n( is-equiv-\u03b1 : is-equiv A' A \u03b1)\n( is-equiv-\u03a3\u03b1\u03b3 : is-equiv\n      (total-type A' C') (total-type A C) (\\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n  )\n  : is-homotopy-cartesian\n  :=\n    total-equiv-family-of-equiv\n        A' C' ( \\ x \u2192 C (\u03b1 x) ) \u03b3    -- use x instead of a' to avoid shadowing\n        ( is-equiv-right-factor\n            ( total-type A' C')\n( \u03a3 (x : A'), C (\u03b1 x))\n            ( total-type A C)\n            ( total-map A' C' (\\ x \u2192 C (\u03b1 x)) \u03b3)\n            ( \\ (x, c) \u2192 (\u03b1 x, c) )\n            ( second ( total-equiv-pullback-is-equiv A' A \u03b1 is-equiv-\u03b1 C))\n            ( is-equiv-homotopy\n                ( total-type A' C')\n                ( total-type A C )\n                ( temp-uBDx-comp )\n                ( temp-uBDx-\u03a3\u03b1\u03b3 )\n                ( \\ _ \u2192 refl)\n                ( is-equiv-\u03a3\u03b1\u03b3)))\n

In a general homotopy-cartesian square we cannot deduce is-equiv \u03b1 from is-equiv (\u03a3\u03b3). However, if the square has a vertical section then we can always do this (whether the square is homotopy-cartesian or not).

#def has-section-family-over-map\n  : U\n  :=\n\u03a3 ( ( s', s) : product ((a' : A') \u2192 C' a') ((a : A) \u2192 C a) ),\n( (a' : A') \u2192 \u03b3 a' (s' a') = s (\u03b1 a'))\n#def induced-map-on-fibers-\u03a3 uses (\u03b3)\n( c\u0302 : total-type A C)\n  ( (c\u0302', q\u0302) : fib\n                (total-type A' C') (total-type A C)\n                (\\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n                c\u0302)\n  : fib A' A \u03b1 (first c\u0302)\n  :=\n    (first c\u0302', first-path-\u03a3 A C (temp-uBDx-\u03a3\u03b1\u03b3 c\u0302') c\u0302 q\u0302)\n#def temp-uBDx-helper-type uses (\u03b3 C')\n  ( ((s', s) , \u03b7) : has-section-family-over-map)\n( a : A )\n  ( (a', p) : fib A' A \u03b1 a )\n  : U\n  :=\n\u03a3 ( q\u0302 : temp-uBDx-\u03a3\u03b1\u03b3 (a', s' a') = (a, s a)),\n        ( induced-map-on-fibers-\u03a3 (a, s a) ((a', s' a'), q\u0302) = (a', p))\n#def temp-uBDx-helper uses (\u03b3 C')\n  ( ((s', s) , \u03b7) : has-section-family-over-map)\n  : ( a : A) \u2192\n    ( (a', p) : fib A' A \u03b1 a ) \u2192\n    temp-uBDx-helper-type ((s',s), \u03b7) a (a', p)\n  :=\n    ind-fib A' A \u03b1\n    ( temp-uBDx-helper-type ((s',s), \u03b7))\n    ( \\ a' \u2192\n      ( eq-pair A C (\u03b1 a', \u03b3 a' (s' a')) (\u03b1 a', s (\u03b1 a')) ( refl, \u03b7 a' ) ,\n        eq-pair\n        ( A')\n        ( \\ x \u2192 \u03b1 x = \u03b1 a')\n        ( a' ,\n          first-path-\u03a3 A C\n          ( \u03b1 a', \u03b3 a' (s' a'))\n          ( \u03b1 a', s (\u03b1 a'))\n          ( eq-pair A C (\u03b1 a', \u03b3 a' (s' a')) (\u03b1 a', s (\u03b1 a')) ( refl, \u03b7 a' )))\n        ( a' , refl)\n        ( refl ,\n          first-path-\u03a3-eq-pair\n            A C (\u03b1 a', \u03b3 a' (s' a')) (\u03b1 a', s (\u03b1 a')) ( refl, \u03b7 a' ))))\n#def induced-retraction-on-fibers-with-section uses (\u03b3)\n  ( ((s',s),\u03b7) : has-section-family-over-map)\n( a : A )\n  : ( is-retract-of\n      ( fib A' A \u03b1 a )\n      ( fib\n        ( total-type A' C') (total-type A C)\n        ( \\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n        ( a, s a)))\n  :=\n    ( \\ (a', p) \u2192 ( (a', s' a'), first (temp-uBDx-helper ((s',s),\u03b7) a (a',p))),\n      ( induced-map-on-fibers-\u03a3 (a, s a) ,\n        \\ (a', p) \u2192 second (temp-uBDx-helper ((s',s),\u03b7) a (a',p))))\n#def push-down-equiv-with-section uses (\u03b3)\n  ( ((s',s),\u03b7) : has-section-family-over-map)\n( is-equiv-\u03a3\u03b1\u03b3 : is-equiv\n      (total-type A' C') (total-type A C) temp-uBDx-\u03a3\u03b1\u03b3)\n  : is-equiv A' A \u03b1\n  :=\n    is-equiv-is-contr-map A' A \u03b1\n    ( \\ a \u2192\n      is-contr-is-retract-of-is-contr\n      ( fib A' A \u03b1 a)\n      ( fib (total-type A' C') (total-type A C) (temp-uBDx-\u03a3\u03b1\u03b3) (a, s a))\n      ( induced-retraction-on-fibers-with-section ((s',s),\u03b7) a)\n      ( is-contr-map-is-equiv\n        ( total-type A' C') (total-type A C)\n        (temp-uBDx-\u03a3\u03b1\u03b3)\n        ( is-equiv-\u03a3\u03b1\u03b3 )\n        (a, s a)))\n#end homotopy-cartesian\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#invariance-under-pullbacks","title":"Invariance under pullbacks","text":"

We can pullback a homotopy cartesian square over \u03b1 : A' \u2192 A along any map of maps \u03b2 \u2192 \u03b1 and obtain another homotopy cartesian square.

#def is-homotopy-cartesian-pullback\n( A' : U)\n( C' : A' \u2192 U)\n( A : U)\n( C : A \u2192 U)\n( \u03b1 : A' \u2192 A)\n( \u03b3 : ( a' : A') \u2192 C' a' \u2192 C (\u03b1 a'))\n( B' B : U)\n( \u03b2 : B' \u2192 B)\n  ( ((s', s), \u03b7) : map-of-maps B' B \u03b2 A' A \u03b1)\n( is-hc-\u03b1 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3)\n  : is-homotopy-cartesian\n      B' ( \\ b' \u2192 C' (s' b'))\n      B  ( \\ b \u2192 C (s b))\n      \u03b2  ( \\ b' c' \u2192 transport A C (\u03b1 (s' b')) (s (\u03b2 b')) (\u03b7 b') (\u03b3 (s' b') c'))\n  :=\n\\ b' \u2192\n      is-equiv-comp (C' (s' b')) (C (\u03b1 (s' b'))) (C (s (\u03b2 b')))\n        ( \u03b3 (s' b'))\n        ( is-hc-\u03b1 (s' b'))\n        ( transport A C (\u03b1 (s' b')) (s (\u03b2 b')) (\u03b7 b'))\n        ( is-equiv-transport A C (\u03b1 (s' b')) (s (\u03b2 b')) (\u03b7 b'))\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#pasting-calculus-for-homotopy-cartesian-squares","title":"Pasting calculus for homotopy cartesian squares","text":"

Currently our notion of squares is not symmetric, since the vertical maps are given by type families, i.e. they are display maps, while the horizontal maps are arbitrary. Therefore we distinquish between the vertical and the horizontal pasting calculus.

"},{"location":"hott/11-homotopy-pullbacks.rzk/#vertical-calculus","title":"Vertical calculus","text":"

The following vertical composition and cancellation laws follow easily from the corresponding statements about equivalences established above.

#section homotopy-cartesian-vertical-calculus\n#variable A' : U\n#variable C' : A' \u2192 U\n#variable D' : ( a' : A') \u2192 C' a' \u2192 U\n#variable A : U\n#variable C : A \u2192 U\n#variable D : (a : A) \u2192 C a \u2192 U\n#variable \u03b1 : A' \u2192 A\n#variable \u03b3 : (a' : A') \u2192 C' a' \u2192 C (\u03b1 a')\n#variable \u03b4 : (a' : A') \u2192 (c' : C' a') \u2192 D' a' c' \u2192 D (\u03b1 a') (\u03b3 a' c')\n#def is-homotopy-cartesian-upper\n  : U\n  := ( is-homotopy-cartesian\n       ( total-type A' C')\n       ( \\ (a', c') \u2192 D' a' c')\n       ( total-type A C)\n       ( \\ (a, c) \u2192 D a c)\n       ( \\ (a', c') \u2192 (\u03b1 a', \u03b3 a' c'))\n       ( \\ (a', c') \u2192 \u03b4 a' c'))\n#def is-homotopy-cartesian-upper-to-fibers uses (A)\n( is-hc-\u03b3-\u03b4 : is-homotopy-cartesian-upper)\n( a' : A')\n  : is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n  :=\n\\ c' \u2192 is-hc-\u03b3-\u03b4 (a', c')\n#def is-homotopy-cartesian-upper-from-fibers uses (A)\n( is-fiberwise-hc-\u03b3-\u03b4\n    : ( a' : A') \u2192\n      is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a'))\n  : is-homotopy-cartesian-upper\n  :=\n    \\ (a', c') \u2192 is-fiberwise-hc-\u03b3-\u03b4 a' c'\n#def is-homotopy-cartesian-vertical-pasted\n  : U\n  :=\n    is-homotopy-cartesian\n      A' (\\ a' \u2192 total-type (C' a') (D' a'))\n      A (\\ a \u2192 total-type (C a) (D a))\n      \u03b1 (\\ a' (c', d') \u2192 (\u03b3 a' c', \u03b4 a' c' d'))\n#def is-homotopy-cartesian-vertical-pasting\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-hc-\u03b3-\u03b4 : is-homotopy-cartesian-upper)\n  : is-homotopy-cartesian-vertical-pasted\n  :=\n\\ a' \u2192\n      pull-up-equiv-is-homotopy-cartesian\n        (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n        ( is-homotopy-cartesian-upper-to-fibers is-hc-\u03b3-\u03b4 a')\n        ( is-hc-\u03b1-\u03b3 a' )\n#def is-homotopy-cartesian-vertical-pasting-from-fibers\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-fiberwise-hc-\u03b3-\u03b4\n    : ( a' : A') \u2192\n      is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a'))\n  : is-homotopy-cartesian-vertical-pasted\n  :=\n    is-homotopy-cartesian-vertical-pasting\n      is-hc-\u03b1-\u03b3\n      ( is-homotopy-cartesian-upper-from-fibers is-fiberwise-hc-\u03b3-\u03b4)\n#def is-homotopy-cartesian-lower-cancel-to-fibers\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-hc-\u03b1-\u03b4 : is-homotopy-cartesian-vertical-pasted)\n( a' : A')\n  : is-homotopy-cartesian (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n  :=\n    is-homotopy-cartesian-is-horizontal-equiv\n      ( C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n      ( is-hc-\u03b1-\u03b3 a')\n      ( is-hc-\u03b1-\u03b4 a')\n#def is-homotopy-cartesian-lower-cancel uses (D D' \u03b4)\n( is-hc-\u03b1-\u03b3 : is-homotopy-cartesian A' C' A C \u03b1 \u03b3 )\n( is-hc-\u03b1-\u03b4 : is-homotopy-cartesian-vertical-pasted\n  )\n  : is-homotopy-cartesian-upper\n  :=\n    is-homotopy-cartesian-upper-from-fibers\n      (is-homotopy-cartesian-lower-cancel-to-fibers is-hc-\u03b1-\u03b3 is-hc-\u03b1-\u03b4)\n#def is-homotopy-cartesian-upper-cancel-with-section\n( has-sec-\u03b3-\u03b4 : (a' : A') \u2192\n      has-section-family-over-map\n        (C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a'))\n( is-hc-\u03b1-\u03b4 : is-homotopy-cartesian-vertical-pasted)\n  : is-homotopy-cartesian A' C' A C \u03b1 \u03b3\n  :=\n\\ a' \u2192\n      push-down-equiv-with-section\n      ( C' a') (D' a') (C (\u03b1 a')) (D (\u03b1 a')) (\u03b3 a') (\u03b4 a')\n      ( has-sec-\u03b3-\u03b4 a')\n      ( is-hc-\u03b1-\u03b4 a')\n#end homotopy-cartesian-vertical-calculus\n
"},{"location":"hott/11-homotopy-pullbacks.rzk/#horizontal-calculus","title":"Horizontal calculus","text":"

We also have the horizontal version of pasting and cancellation which follows from composition and cancelling laws for equivalences.

#section homotopy-cartesian-horizontal-calculus\n#variable A'' : U\n#variable C'' : A'' \u2192 U\n#variable A' : U\n#variable C' : A' \u2192 U\n#variable A : U\n#variable C : A \u2192 U\n#variable f' : A'' \u2192 A'\n#variable F' : (a'' : A'') \u2192 C'' a'' \u2192 C' (f' a'')\n#variable f : A' \u2192 A\n#variable F : (a' : A') \u2192 C' a' \u2192 C (f a')\n#def is-homotopy-cartesian-horizontal-pasting\n( ihc : is-homotopy-cartesian A' C' A C f F)\n( ihc' : is-homotopy-cartesian A'' C'' A' C' f' F')\n  : is-homotopy-cartesian A'' C'' A C\n    ( comp A'' A' A f f')\n    ( \\ a'' \u2192\n        comp (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n         (F (f' a'')) (F' a''))\n  :=\n\\ a'' \u2192\n    is-equiv-comp (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n      (F' a'') (ihc' a'')\n      (F (f' a'')) (ihc (f' a''))\n#def is-homotopy-cartesian-right-cancel\n( ihc : is-homotopy-cartesian A' C' A C f F)\n( ihc'' : is-homotopy-cartesian A'' C'' A C\n              ( comp A'' A' A f f')\n              ( \\ a'' \u2192\n                comp (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n                  (F (f' a'')) (F' a'')))\n  : is-homotopy-cartesian A'' C'' A' C' f' F'\n  :=\n\\ a'' \u2192\n    is-equiv-right-factor (C'' a'') (C' (f' a'')) (C (f (f' a'')))\n    ( F' a'') (F (f' a''))\n    ( ihc (f' a''))\n    ( ihc'' a'')\n#end homotopy-cartesian-horizontal-calculus\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/","title":"3. Simplicial Type Theory","text":"

These formalisations correspond in part to Section 3 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#simplices-and-their-subshapes","title":"Simplices and their subshapes","text":""},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#simplices","title":"Simplices","text":"The 1-simplex
#def \u0394\u00b9 : 2 \u2192 TOPE\n  := \\ t \u2192 TOP\n
The 2-simplex
#def \u0394\u00b2 : (2 \u00d7 2) \u2192 TOPE\n  := \\ (t , s) \u2192 s \u2264 t\n
The 3-simplex
#def \u0394\u00b3 : (2 \u00d7 2 \u00d7 2) \u2192 TOPE\n  := \\ ((t1 , t2) , t3) \u2192 t3 \u2264 t2 \u2227 t2 \u2264 t1\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#boundaries-of-simplices","title":"Boundaries of simplices","text":"The boundary of a 1-simplex
#def \u2202\u0394\u00b9 : \u0394\u00b9 \u2192 TOPE\n  := \\ t \u2192 (t \u2261 0\u2082 \u2228 t \u2261 1\u2082)\n
The boundary of a 2-simplex
#def \u2202\u0394\u00b2 : \u0394\u00b2 \u2192 TOPE\n  :=\n    \\ (t , s) \u2192 (s \u2261 0\u2082 \u2228 t \u2261 1\u2082 \u2228 s \u2261 t)\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#the-2-dimensional-inner-horn","title":"The 2 dimensional inner horn","text":"
#def \u039b : (2 \u00d7 2) \u2192 TOPE\n  := \\ (t , s) \u2192 (s \u2261 0\u2082 \u2228 t \u2261 1\u2082)\n#def \u039b\u00b2\u2081 : \u0394\u00b2 \u2192 TOPE\n  := \\ (s,t) \u2192 \u039b (s,t)\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#the-3-dimensional-inner-horns","title":"The 3 dimensional inner horns","text":"
#def \u039b\u00b3\u2081 : \u0394\u00b3 \u2192 TOPE\n  := \\ ((t1, t2), t3) \u2192 t3 \u2261 0\u2082 \u2228 t2 \u2261 t1 \u2228 t1 \u2261 1\u2082\n#def \u039b\u00b3\u2082 : \u0394\u00b3 \u2192 TOPE\n  := \\ ((t1, t2), t3) \u2192 t3 \u2261 0\u2082 \u2228 t3 \u2261 t2 \u2228 t1 \u2261 1\u2082\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#products","title":"Products","text":"

The product of topes defines the product of shapes.

#def shape-prod\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03c7 : J \u2192 TOPE)\n  : (I \u00d7 J) \u2192 TOPE\n  := \\ (t , s) \u2192 \u03c8 t \u2227 \u03c7 s\n
The square as a product
#def \u0394\u00b9\u00d7\u0394\u00b9 : (2 \u00d7 2) \u2192 TOPE\n  := shape-prod 2 2 \u0394\u00b9 \u0394\u00b9\n
The total boundary of the square
#def \u2202\u25a1 : (2 \u00d7 2) \u2192 TOPE\n  := \\ (t ,s) \u2192 ((\u2202\u0394\u00b9 t) \u2227 (\u0394\u00b9 s)) \u2228 ((\u0394\u00b9 t) \u2227 (\u2202\u0394\u00b9 s))\n
The vertical boundary of the square
#def \u2202\u0394\u00b9\u00d7\u0394\u00b9 : (2 \u00d7 2) \u2192 TOPE\n  := shape-prod 2 2 \u2202\u0394\u00b9 \u0394\u00b9\n
The horizontal boundary of the square
#def \u0394\u00b9\u00d7\u2202\u0394\u00b9 : (2 \u00d7 2) \u2192 TOPE\n  := shape-prod 2 2 \u0394\u00b9 \u2202\u0394\u00b9\n
The prism from a 2-simplex in an arrow type
#def \u0394\u00b2\u00d7\u0394\u00b9 : (2 \u00d7 2 \u00d7 2) \u2192 TOPE\n  := shape-prod (2 \u00d7 2) 2 \u0394\u00b2 \u0394\u00b9\n
#def \u0394\u00b3\u00d7\u0394\u00b2 : ((2 \u00d7 2 \u00d7 2) \u00d7 (2 \u00d7 2)) \u2192 TOPE\n  := shape-prod (2 \u00d7 2 \u00d7 2) (2 \u00d7 2) \u0394\u00b3 \u0394\u00b2\n

Maps out of \\(\u0394\u00b2\\) are a retract of maps out of \\(\u0394\u00b9\u00d7\u0394\u00b9\\).

RS17, Proposition 3.6
#def \u0394\u00b2-is-retract-\u0394\u00b9\u00d7\u0394\u00b9\n(A : U)\n  : is-retract-of (\u0394\u00b2 \u2192 A) (\u0394\u00b9\u00d7\u0394\u00b9 \u2192 A)\n  :=\n    ( ( \\ f \u2192 \\ (t , s) \u2192\nrecOR\n          ( t <= s |-> f (t , t) ,\n            s <= t |-> f (t , s))) ,\n      ( ( \\ f \u2192 \\ ts \u2192 f ts ) , \\ _ \u2192 refl))\n

Maps out of \\(\u0394\u00b3\\) are a retract of maps out of \\(\u0394\u00b2\u00d7\u0394\u00b9\\).

RS17, Proposition 3.7
#def \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-retraction\n(A : U)\n  : (\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A) \u2192 (\u0394\u00b3 \u2192 A)\n  := \\ f \u2192 \\ ((t1 , t2) , t3) \u2192 f ((t1 , t3) , t2)\n#def \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-section\n(A : U)\n  : (\u0394\u00b3 \u2192 A) \u2192 (\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A)\n  :=\n\\ f \u2192 \\ ((t1 , t2) , t3) \u2192\nrecOR\n      ( t3 <= t2 |-> f ((t1 , t2) , t2) ,\n        t2 <= t3 |->\nrecOR\n            ( t3 <= t1 |-> f ((t1 , t3) , t2) ,\n              t1 <= t3 |-> f ((t1 , t1) , t2)))\n#def \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9\n( A : U)\n  : is-retract-of (\u0394\u00b3 \u2192 A) (\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A)\n  :=\n    ( \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-section A ,\n      ( \u0394\u00b3-is-retract-\u0394\u00b2\u00d7\u0394\u00b9-retraction A , \\ _ \u2192 refl))\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#pushout-product","title":"Pushout product","text":"

Pushout product \u03a6\u00d7\u03b6 \u222a_{\u03a6\u00d7\u03c7} \u03c8\u00d7\u03c7 of \u03a6 \u21aa \u03c8 and \u03c7 \u21aa \u03b6, domain of the co-gap map.

#def shape-pushout-prod\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03a6 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n  : (shape-prod I J \u03c8 \u03b6) \u2192 TOPE\n  := \\ (t,s) \u2192 (\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#intersections","title":"Intersections","text":"

The intersection of shapes is defined by conjunction on topes.

#def shape-intersection\n( I : CUBE)\n( \u03c8 \u03c7 : I \u2192 TOPE)\n  : I \u2192 TOPE\n  := \\ t \u2192 \u03c8 t \u2227 \u03c7 t\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#unions","title":"Unions","text":"

The union of shapes is defined by disjunction on topes.

#def shape-union\n( I : CUBE)\n( \u03c8 \u03c7 : I \u2192 TOPE)\n  : I \u2192 TOPE\n  := \\ t \u2192 \u03c8 t \u2228 \u03c7 t\n
"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#connection-squares","title":"Connection Squares","text":"

f f f f f f f \u2022 \u2022 \u2022 \u2022

RS17 Proposition 3.5(a)
#define join-square-arrow\n(A : U)\n(f : 2 \u2192 A)\n  : (2 \u00d7 2) \u2192 A\n  := \\ (t, s) \u2192 recOR ( t \u2264 s \u21a6 f s , s \u2264 t \u21a6 f t )\n

f f f f f \u2022 \u2022 \u2022 \u2022

RS17 Proposition 3.5(b)
#define meet-square-arrow\n(A : U)\n(f : 2 \u2192 A)\n  : (2 \u00d7 2) \u2192 A\n  := \\ (t, s) \u2192 recOR ( t \u2264 s \u21a6 f t , s \u2264 t \u21a6 f s )\n

"},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#functorial-comparisons-of-shapes","title":"Functorial comparisons of shapes","text":""},{"location":"simplicial-hott/02-simplicial-type-theory.rzk/#functorial-retracts","title":"Functorial retracts","text":"

For a subshape \u03d5 \u2282 \u03c8 we have an easy way of stating that it is a retract in a strict and functorial way. Intuitively this happens when there is a map from \u03c8 to \u03d5 that fixes the subshape \u03c8. But in the definition below we actually ask for a section of the family of extensions of a function \u03d5 \u2192 A to a function \u03c8 \u2192 A and we ask for this section to be natural in the type A.

#def is-functorial-shape-retract\n( I : CUBE )\n( \u03c8 : I \u2192 TOPE )\n( \u03d5 : \u03c8 \u2192 TOPE )\n  : U\n  :=\n( A' : U) \u2192 (A : U) \u2192 (\u03b1 : A' \u2192 A) \u2192\n    has-section-family-over-map\n      ( \u03d5 \u2192 A') (\\ f \u2192 (t : \u03c8) \u2192 A' [\u03d5 t \u21a6 f t])\n      ( \u03d5 \u2192 A) (\\ f \u2192 (t : \u03c8) \u2192 A [\u03d5 t \u21a6 f t])\n      ( \\ f t \u2192 \u03b1 (f t))\n      ( \\ _ g t \u2192 \u03b1 (g t))\n

For example, this applies to \u0394\u00b2 \u2282 \u0394\u00b9\u00d7\u0394\u00b9.

#def \u0394\u00b2-is-functorial-retract-\u0394\u00b9\u00d7\u0394\u00b9\n  : is-functorial-shape-retract (2 \u00d7 2) (\u0394\u00b9\u00d7\u0394\u00b9) (\u0394\u00b2)\n  :=\n\\ A' A \u03b1 \u2192\n      ( ( first (\u0394\u00b2-is-retract-\u0394\u00b9\u00d7\u0394\u00b9 A'), first (\u0394\u00b2-is-retract-\u0394\u00b9\u00d7\u0394\u00b9 A) ) ,\n\\ a' \u2192 refl)\n

Every functorial shape retract automatically induces a section when restricting to diagrams extending a fixed diagram \u03c3': \u03d5 \u2192 A' (or, respectively, its image \u03d5 \u2192 A under \u03b1).

#def relativize-is-functorial-shape-retract\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03c7 : \u03c8 \u2192 TOPE)\n( is-fretract-\u03c8-\u03c7 : is-functorial-shape-retract I \u03c8 \u03c7)\n( \u03d5 : \u03c7 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( \u03c3' : \u03d5 \u2192 A')\n  : has-section-family-over-map\n( (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n( (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n( \\ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n      ( \\ \u03c4' t \u2192 \u03b1 (\u03c4' t))\n      ( \\ _ \u03c5' t \u2192 \u03b1 (\u03c5' t))\n  :=\n    ( ( \\ \u03c4' \u2192 first (first (is-fretract-\u03c8-\u03c7 A' A \u03b1)) \u03c4'\n      , \\ \u03c4 \u2192 second (first (is-fretract-\u03c8-\u03c7 A' A \u03b1)) \u03c4\n      )\n    , \\ \u03c4' \u2192 second (is-fretract-\u03c8-\u03c7 A' A \u03b1) \u03c4'\n    )\n
"},{"location":"simplicial-hott/03-extension-types.rzk/","title":"4. Equivalences involving extension types","text":"

These formalisations correspond to Section 3 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#prerequisites","title":"Prerequisites","text":""},{"location":"simplicial-hott/03-extension-types.rzk/#extension-up-to-homotopy","title":"Extension up to homotopy","text":"

For a shape inclusion \u03d5 \u2282 \u03c8 and any type A, we have the inbuilt extension types (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t] (for every \u03c3 : \u03d5 \u2192 A).

We show that these extension types are equivalent to the fibers of the canonical restriction map (\u03c8 \u2192 A) \u2192 (\u03d5 \u2192 A), which we can view as the types of \"extension up to homotopy\".

#section extensions-up-to-homotopy\n#variable I : CUBE\n#variable \u03c8 : I \u2192 TOPE\n#variable \u03d5 : \u03c8 \u2192 TOPE\n#variable A : U\n#def extension-type\n( \u03c3 : \u03d5 \u2192 A)\n  : U\n  :=\n( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t]\n#def homotopy-extension-type\n( \u03c3 : \u03d5 \u2192 A)\n  : U\n  := fib (\u03c8 \u2192 A) (\u03d5 \u2192 A) (\\ \u03c4 t \u2192 \u03c4 t) (\u03c3)\n#def extension-type-weakening-map\n( \u03c3 : \u03d5 \u2192 A)\n  : extension-type \u03c3 \u2192 homotopy-extension-type \u03c3\n  :=\n\\ \u03c4 \u2192 ( \u03c4, refl)\n#def extension-type-weakening-section\n  : ( \u03c3 : \u03d5 \u2192 A) \u2192\n( th : homotopy-extension-type \u03c3) \u2192\n\u03a3 (\u03c4 : extension-type \u03c3), (( \u03c4, refl) =_{homotopy-extension-type \u03c3} th)\n  :=\n    ind-fib (\u03c8 \u2192 A) (\u03d5 \u2192 A) (\\ \u03c4 t \u2192 \u03c4 t)\n( \\ \u03c3 th \u2192\n          \u03a3 (\u03c4 : extension-type \u03c3),\n            ( \u03c4, refl) =_{homotopy-extension-type \u03c3} th)\n( \\ (\u03c4 : \u03c8 \u2192 A) \u2192 (\u03c4, refl))\n#def is-equiv-extension-type-weakening\n( \u03c3 : \u03d5 \u2192 A)\n  : is-equiv (extension-type \u03c3) (homotopy-extension-type \u03c3)\n      (extension-type-weakening-map \u03c3)\n  :=\n    ( ( \\ th \u2192 first (extension-type-weakening-section \u03c3 th),\n\\ _ \u2192 refl),\n      ( \\ th \u2192 ( first (extension-type-weakening-section \u03c3 th)),\n\\ th \u2192 ( second (extension-type-weakening-section \u03c3 th))))\n#def extension-type-weakening\n( \u03c3 : \u03d5 \u2192 A)\n  : Equiv (extension-type \u03c3) (homotopy-extension-type \u03c3)\n  := ( extension-type-weakening-map \u03c3 , is-equiv-extension-type-weakening \u03c3)\n#end extensions-up-to-homotopy\n

This equivalence is functorial in the following sense:

#def extension-type-weakening-functorial\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( \u03c3' : \u03d5 \u2192 A')\n  : Equiv-of-maps\n      ( extension-type I \u03c8 \u03d5 A' \u03c3')\n      ( extension-type I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t)))\n      ( \\ \u03c4' t \u2192 \u03b1 (\u03c4' t))\n      ( homotopy-extension-type I \u03c8 \u03d5 A' \u03c3')\n      ( homotopy-extension-type I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t)))\n      ( \\ (\u03c4', p) \u2192\n          ( \\ t \u2192 \u03b1 (\u03c4' t),\n            ap (\u03d5 \u2192 A') (\u03d5 \u2192 A)\n( \\ (t : \u03d5) \u2192 \u03c4' t)\n( \\ (t : \u03d5) \u2192 \u03c3' t)\n               ( \\ \u03c3'' t \u2192 \u03b1 (\u03c3'' t))\n               ( p)))\n  :=\n    ( ( ( extension-type-weakening-map I \u03c8 \u03d5 A' \u03c3'\n        , extension-type-weakening-map I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t))\n        )\n      , \\ _ \u2192 refl\n      )\n    , ( is-equiv-extension-type-weakening I \u03c8 \u03d5 A' \u03c3'\n      , is-equiv-extension-type-weakening I \u03c8 \u03d5 A (\\ t \u2192 \u03b1 (\u03c3' t))\n      )\n    )\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#commutation-of-arguments-and-currying","title":"Commutation of arguments and currying","text":"RS17, Theorem 4.1
#def flip-ext-fun\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : U)\n( Y : \u03c8 \u2192 X \u2192 U)\n( f : (t : \u03d5) \u2192 (x : X) \u2192 Y t x)\n  : Equiv\n( (t : \u03c8) \u2192 ((x : X) \u2192 Y t x) [\u03d5 t \u21a6 f t])\n( (x : X) \u2192 (t : \u03c8) \u2192 Y t x [\u03d5 t \u21a6 f t x])\n  :=\n    ( \\ g x t \u2192 g t x ,\n      ( ( \\ h t x \u2192 (h x) t ,\n\\ g \u2192 refl) ,\n        ( \\ h t x \u2192 (h x) t ,\n\\ h \u2192 refl)))\n#def flip-ext-fun-inv\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : U)\n( Y : \u03c8 \u2192 X \u2192 U)\n( f : (t : \u03d5) \u2192 (x : X) \u2192 Y t x)\n  : Equiv\n( (x : X) \u2192 (t : \u03c8) \u2192 Y t x [\u03d5 t \u21a6 f t x])\n( (t : \u03c8) \u2192 ((x : X) \u2192 Y t x) [\u03d5 t \u21a6 f t])\n  :=\n    ( \\ h t x \u2192 (h x) t ,\n      ( ( \\ g x t \u2192 g t x ,\n\\ h \u2192 refl) ,\n        ( \\ g x t \u2192 g t x ,\n\\ g \u2192 refl)))\n
RS17, Theorem 4.2
#def curry-uncurry\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n( X : \u03c8 \u2192 \u03b6 \u2192 U)\n( f : ((t , s) : I \u00d7 J | (\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)) \u2192 X t s)\n  : Equiv\n( (t : \u03c8) \u2192\n( (s : \u03b6) \u2192 X t s [\u03c7 s \u21a6 f (t , s)]) [\u03d5 t \u21a6 \\ s \u2192 f (t , s)])\n    ( ((t , s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192\n      X t s [(\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 f (t , s)])\n  :=\n    ( \\ g (t , s) \u2192 (g t) s ,\n      ( ( \\ h t s \u2192 h (t , s) ,\n\\ g \u2192 refl) ,\n        ( \\ h t s \u2192 h (t , s) ,\n\\ h \u2192 refl)))\n#def uncurry-opcurry\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n( X : \u03c8 \u2192 \u03b6 \u2192 U)\n( f : ((t , s) : I \u00d7 J | (\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)) \u2192 X t s)\n  : Equiv\n    ( ((t , s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192\n      X t s [(\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 f (t , s)])\n( ( s : \u03b6) \u2192\n( (t : \u03c8) \u2192 X t s [\u03d5 t \u21a6 f (t , s)]) [\u03c7 s \u21a6 \\ t \u2192 f (t , s)])\n  :=\n    ( \\ h s t \u2192 h (t , s) ,\n      ( ( \\ g (t , s) \u2192 (g s) t ,\n\\ h \u2192 refl) ,\n        ( \\ g (t , s) \u2192 (g s) t ,\n\\ g \u2192 refl)))\n#def fubini\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n( X : \u03c8 \u2192 \u03b6 \u2192 U)\n( f : ((t , s) : I \u00d7 J | (\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s)) \u2192 X t s)\n  : Equiv\n( ( t : \u03c8) \u2192\n( (s : \u03b6) \u2192 X t s [\u03c7 s \u21a6 f (t , s)]) [\u03d5 t \u21a6 \\ s \u2192 f (t , s)])\n( ( s : \u03b6) \u2192\n( (t : \u03c8) \u2192 X t s [\u03d5 t \u21a6 f (t , s)]) [\u03c7 s \u21a6 \\ t \u2192 f (t , s)])\n  :=\n    equiv-comp\n( ( t : \u03c8) \u2192\n( (s : \u03b6) \u2192 X t s [\u03c7 s \u21a6 f (t , s)]) [\u03d5 t \u21a6 \\ s \u2192 f (t , s)])\n      ( ( (t , s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192\n        X t s [(\u03d5 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 f (t , s)])\n( ( s : \u03b6) \u2192\n( (t : \u03c8) \u2192 X t s [\u03d5 t \u21a6 f (t , s)]) [\u03c7 s \u21a6 \\ t \u2192 f (t , s)])\n      ( curry-uncurry I J \u03c8 \u03d5 \u03b6 \u03c7 X f)\n      ( uncurry-opcurry I J \u03c8 \u03d5 \u03b6 \u03c7 X f)\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#extending-into-types-the-non-axiom-of-choice","title":"Extending into \u03a3-types (the non-axiom of choice)","text":"RS17, Theorem 4.3
#def axiom-choice\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : \u03c8 \u2192 U)\n( Y : (t : \u03c8) \u2192 (x : X t) \u2192 U)\n( a : (t : \u03d5) \u2192 X t)\n( b : (t : \u03d5) \u2192 Y t (a t))\n  : Equiv\n( (t : \u03c8) \u2192 (\u03a3 (x : X t) , Y t x) [\u03d5 t \u21a6 (a t , b t)])\n( \u03a3 ( f : ((t : \u03c8) \u2192 X t [\u03d5 t \u21a6 a t])) ,\n( (t : \u03c8) \u2192 Y t (f t) [\u03d5 t \u21a6 b t]))\n    :=\n      ( \\ g \u2192 (\\ t \u2192 (first (g t)) , \\ t \u2192 second (g t)) ,\n        ( ( \\ (f , h) t \u2192 (f t , h t) ,\n\\ _ \u2192 refl) ,\n          ( \\ (f , h) t \u2192 (f t , h t) ,\n\\ _ \u2192 refl)))\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#composites-and-unions-of-cofibrations","title":"Composites and unions of cofibrations","text":"

The original form.

RS17, Theorem 4.4
#def cofibration-composition\n( I : CUBE)\n( \u03c7 : I \u2192 TOPE)\n( \u03c8 : \u03c7 \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( X : \u03c7 \u2192 U)\n( a : (t : \u03d5) \u2192 X t)\n  : Equiv\n( (t : \u03c7) \u2192 X t [\u03d5 t \u21a6 a t])\n( \u03a3 ( f : (t : \u03c8) \u2192 X t [\u03d5 t \u21a6 a t]) ,\n( (t : \u03c7) \u2192 X t [\u03c8 t \u21a6 f t]))\n  :=\n    ( \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t) ,\n      ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n        ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl))))\n#def cofibration-composition-functorial\n( I : CUBE)\n( \u03c7 : I \u2192 TOPE)\n( \u03c8 : \u03c7 \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : \u03c7 \u2192 U)\n( \u03b1 : (t : \u03c7) \u2192 A' t \u2192 A t)\n( \u03c3' : (t : \u03d5) \u2192 A' t)\n  : Equiv-of-maps\n( (t : \u03c7) \u2192 A' t [\u03d5 t \u21a6 \u03c3' t])\n( (t : \u03c7) \u2192 A t [\u03d5 t \u21a6 \u03b1 t (\u03c3' t)])\n     ( \\ \u03c4' t \u2192 \u03b1 t (\u03c4' t))\n( \u03a3 ( \u03c4' : (t : \u03c8) \u2192 A' t [\u03d5 t \u21a6 \u03c3' t]) ,\n( (t : \u03c7) \u2192 A' t [\u03c8 t \u21a6 \u03c4' t]))\n( \u03a3 ( \u03c4 : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 \u03b1 t (\u03c3' t)]) ,\n( (t : \u03c7) \u2192 A t [\u03c8 t \u21a6 \u03c4 t]))\n     ( \\ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 t (\u03c4' t), \\t \u2192 \u03b1 t (\u03c5' t)))\n  :=\n    ( ( ( \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t) , \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t)),\n\\ _ \u2192 refl),\n      ( ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n          ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl))),\n        ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n          ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl)))))\n

A reformulated version via tope disjunction instead of inclusion (see https://github.com/rzk-lang/rzk/issues/8).

RS17, Theorem 4.4
#def cofibration-composition'\n( I : CUBE)\n( \u03c7 \u03c8 \u03d5 : I \u2192 TOPE)\n( X : \u03c7 \u2192 U)\n( a : (t : I | \u03c7 t \u2227 \u03c8 t \u2227 \u03d5 t) \u2192 X t)\n  : Equiv\n( (t : \u03c7) \u2192 X t [\u03c7 t \u2227 \u03c8 t \u2227 \u03d5 t \u21a6 a t])\n( \u03a3 ( f : (t : I | \u03c7 t \u2227 \u03c8 t) \u2192 X t [\u03c7 t \u2227 \u03c8 t \u2227 \u03d5 t \u21a6 a t]) ,\n( (t : \u03c7) \u2192 X t [\u03c7 t \u2227 \u03c8 t \u21a6 f t]))\n  :=\n    ( \\ h \u2192 (\\ t \u2192 h t , \\ t \u2192 h t) ,\n      ( ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl) ,\n        ( \\ (_f , g) t \u2192 g t , \\ h \u2192 refl)))\n
RS17, Theorem 4.5
#def cofibration-union\n( I : CUBE)\n( \u03d5 \u03c8 : I \u2192 TOPE)\n( X : (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 U)\n( a : (t : \u03c8) \u2192 X t)\n  : Equiv\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 X t [\u03c8 t \u21a6 a t])\n( (t : \u03d5) \u2192 X t [\u03d5 t \u2227 \u03c8 t \u21a6 a t])\n  :=\n    (\\ h t \u2192 h t ,\n      ( ( \\ g t \u2192 recOR (\u03d5 t \u21a6 g t , \u03c8 t \u21a6 a t) , \\ _ \u2192 refl) ,\n        ( \\ g t \u2192 recOR (\u03d5 t \u21a6 g t , \u03c8 t \u21a6 a t) , \\ _ \u2192 refl)))\n#def cofibration-union-functorial\n( I : CUBE)\n( \u03d5 \u03c8 : I \u2192 TOPE)\n( A' A : (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 U)\n( \u03b1 : (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A' t \u2192 A t)\n( \u03c4' : (t : \u03c8) \u2192 A' t)\n  : Equiv-of-maps\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A' t [\u03c8 t \u21a6 \u03c4' t])\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A t [\u03c8 t \u21a6 \u03b1 t (\u03c4' t)])\n      ( \\ \u03c5' t \u2192 \u03b1 t (\u03c5' t))\n( (t : \u03d5) \u2192 A' t [\u03d5 t \u2227 \u03c8 t \u21a6 \u03c4' t])\n( (t : \u03d5) \u2192 A t [\u03d5 t \u2227 \u03c8 t \u21a6 \u03b1 t (\u03c4' t)])\n      ( \\ \u03bd' t \u2192 \u03b1 t (\u03bd' t))\n  :=\n     ( ( ( \\ \u03c5' t \u2192 \u03c5' t\n         , \\ \u03c5 t \u2192 \u03c5 t\n         )\n       , \\ _ \u2192 refl\n       )\n     , ( second (cofibration-union I \u03d5 \u03c8 A' \u03c4')\n       ,\nsecond (cofibration-union I \u03d5 \u03c8 A ( \\ t \u2192 \u03b1 t (\u03c4' t)))\n       )\n     )\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#extension-extensionality","title":"Extension extensionality","text":"

There are various equivalent forms of the relative function extensionality axiom for extension types. One form corresponds to the standard weak function extensionality. As suggested by footnote 8, we refer to this as a \"weak extension extensionality\" axiom.

RS17, Axiom 4.6, Weak extension extensionality
#define WeakExtExt\n  : U\n  := ( I : CUBE) \u2192 (\u03c8 : I \u2192 TOPE) \u2192 (\u03d5 : \u03c8 \u2192 TOPE) \u2192 (A : \u03c8 \u2192 U) \u2192\n( is-locally-contr-A : (t : \u03c8) \u2192 is-contr (A t)) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192 is-contr ((t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n

We refer to another form as an \"extension extensionality\" axiom.

#def ext-htpy-eq\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n( p : f = g)\n  : (t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]\n  :=\n    ind-path\n( (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n      ( f)\n( \\ g' p' \u2192 (t : \u03c8) \u2192 (f t = g' t) [\u03d5 t \u21a6 refl])\n      ( \\ t \u2192 refl)\n      ( g)\n      ( p)\n
RS17, Proposition 4.8(ii)
#def ExtExt\n  : U\n  :=\n( I : CUBE) \u2192\n( \u03c8 : I \u2192 TOPE) \u2192\n( \u03d5 : \u03c8 \u2192 TOPE) \u2192\n( A : \u03c8 \u2192 U) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192\n( f  : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n( g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n    is-equiv\n      ( f = g)\n( (t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n      ( ext-htpy-eq I \u03c8 \u03d5 A a f g)\n
The equivalence provided by extension extensionality
#def equiv-ExtExt\n( extext : ExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n  : Equiv (f = g) ((t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n  := (ext-htpy-eq I \u03c8 \u03d5 A a f g , extext I \u03c8 \u03d5 A a f g)\n

For readability of code, it is useful to the function that supplies an equality between terms of an extension type from a pointwise equality extending refl. In fact, sometimes only this weaker form of the axiom is needed.

#def NaiveExtExt\n  : U\n  :=\n( I : CUBE) \u2192\n( \u03c8 : I \u2192 TOPE) \u2192\n( \u03d5 : \u03c8 \u2192 TOPE) \u2192\n( A : \u03c8 \u2192 U) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192\n( f : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n( g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n( (t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]) \u2192\n    ( f = g)\n#def naiveextext-extext\n( extext : ExtExt)\n  : NaiveExtExt\n  :=\n\\ I \u03c8 \u03d5 A a f g \u2192\n      ( first (first (extext I \u03c8 \u03d5 A a f g)))\n

Weak extension extensionality implies extension extensionality; this is the context of RS17 Proposition 4.8 (i). We prove this in a series of lemmas. The ext-projection-temp function is a (hopefully temporary) helper that explicitly cases an extension type to a function type.

#section rs-4-8\n#variable  weakextext : WeakExtExt\n#variable  I : CUBE\n#variable  \u03c8 : I \u2192 TOPE\n#variable  \u03d5 : \u03c8 \u2192 TOPE\n#variable  A : \u03c8 \u2192 U\n#variable  a : (t : \u03d5 ) \u2192 A t\n#variable  f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]\n#define ext-projection-temp uses (I \u03c8 \u03d5 A a f)\n  : ((t : \u03c8 ) \u2192 A t)\n  := f\n#define is-contr-ext-based-paths uses (weakextext f)\n  : is-contr ((t : \u03c8 ) \u2192 (\u03a3 (y : A t) ,\n              ((ext-projection-temp) t = y))[\u03d5 t \u21a6 (a t , refl)])\n  :=\n    weakextext\n    ( I )\n    ( \u03c8 )\n    ( \u03d5 )\n( \\ t \u2192 (\u03a3 (y : A t) , ((ext-projection-temp) t = y)))\n    ( \\ t \u2192\n      is-contr-based-paths (A t ) ((ext-projection-temp) t))\n    ( \\ t \u2192 (a t , refl) )\n#define is-contr-ext-endpoint-based-paths uses (weakextext f)\n  : is-contr\n( ( t : \u03c8) \u2192\n( \u03a3 (y : A t) , (y = ext-projection-temp t)) [ \u03d5 t \u21a6 (a t , refl)])\n  :=\n    weakextext\n    ( I)\n    ( \u03c8)\n    ( \u03d5)\n( \\ t \u2192 (\u03a3 (y : A t) , y = ext-projection-temp t))\n    ( \\ t \u2192 is-contr-endpoint-based-paths (A t) (ext-projection-temp t))\n    ( \\ t \u2192 (a t , refl))\n#define is-contr-based-paths-ext uses (weakextext)\n  : is-contr (\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n(t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n  :=\n    is-contr-equiv-is-contr\n( (t : \u03c8 ) \u2192 (\u03a3 (y : A t),\n                     ((ext-projection-temp ) t = y)) [\u03d5 t \u21a6 (a t , refl)] )\n( \u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n(t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl] )\n    ( axiom-choice\n      ( I )\n      ( \u03c8 )\n      ( \u03d5 )\n      ( A )\n      ( \\ t y \u2192 (ext-projection-temp) t = y)\n      ( a )\n      ( \\t \u2192 refl ))\n    ( is-contr-ext-based-paths)\n#end rs-4-8\n

The map that defines extension extensionality

RS17 4.7
#define extext-weakextext-map\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : ((\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]), (f = g)) \u2192\n\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]))\n  :=\n    total-map\n( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n    ( \\ g \u2192 (f = g))\n( \\ g \u2192 (t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n    ( ext-htpy-eq I \u03c8 \u03d5 A a f)\n

The total bundle version of extension extensionality

#define extext-weakextext-bundle-version\n( weakextext : WeakExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : is-equiv ((\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]), (f = g)))\n(\u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]))\n               (extext-weakextext-map I \u03c8 \u03d5 A a f)\n  :=\n    is-equiv-are-contr\n( \u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]), (f = g)  )\n( \u03a3 (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]))\n( is-contr-based-paths\n      ( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n      ( f ))\n    ( is-contr-based-paths-ext weakextext I \u03c8 \u03d5 A a f)\n    ( extext-weakextext-map I \u03c8 \u03d5 A a f)\n

Finally, using equivalences between families of equivalences and bundles of equivalences we have that weak extension extensionality implies extension extensionality. The following is statement the as proved in RS17.

RS17 Prop 4.8(i) as proved
#define extext-weakextext'\n( weakextext : WeakExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : (g : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]) \u2192\n      is-equiv\n        ( f = g)\n( (t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n        ( ext-htpy-eq I \u03c8 \u03d5 A a f g)\n  := total-equiv-family-of-equiv\n( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t] )\n      ( \\ g \u2192 (f = g) )\n( \\ g \u2192 (t : \u03c8 ) \u2192 (f t = g t) [\u03d5 t \u21a6 refl])\n      ( ext-htpy-eq I \u03c8 \u03d5 A a f)\n      ( extext-weakextext-bundle-version weakextext I \u03c8 \u03d5 A a f)\n

The following is the literal statement of weak extension extensionality implying extension extensionality that we get by extraccting the fiberwise equivalence.

RS17 Proposition 4.8(i)
#define extext-weakextext\n(weakextext : WeakExtExt)\n  :  ExtExt\n  := \\ I \u03c8 \u03d5 A a f g \u2192\n      extext-weakextext' weakextext I \u03c8 \u03d5 A a f g\n
"},{"location":"simplicial-hott/03-extension-types.rzk/#applications-of-extension-extensionality","title":"Applications of extension extensionality","text":"

We now assume extension extensionality and derive a few consequences.

#assume extext : ExtExt\n

In particular, extension extensionality implies that homotopies give rise to identifications. This definition defines eq-ext-htpy to be the retraction to ext-htpy-eq.

#def eq-ext-htpy uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f g : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n  : ((t : \u03c8) \u2192 (f t = g t) [\u03d5 t \u21a6 refl]) \u2192 (f = g)\n  := first (first (extext I \u03c8 \u03d5 A a f g))\n

By extension extensionality, fiberwise equivalences of extension types define equivalences of extension types. For simplicity, we extend from BOT.

#def equiv-extension-equiv-family uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A B : \u03c8 \u2192 U)\n( famequiv : (t : \u03c8) \u2192 (Equiv (A t) (B t)))\n  : Equiv ((t : \u03c8) \u2192 A t) ((t : \u03c8) \u2192 B t)\n  :=\n    ( ( \\ a t \u2192 (first (famequiv t)) (a t)) ,\n      ( ( ( \\ b t \u2192 (first (first (second (famequiv t)))) (b t)) ,\n          ( \\ a \u2192\n            eq-ext-htpy\n              ( I)\n              ( \u03c8)\n              ( \\ t \u2192 BOT)\n              ( A)\n              ( \\ u \u2192 recBOT)\n              ( \\ t \u2192\nfirst (first (second (famequiv t))) (first (famequiv t) (a t)))\n              ( a)\n              ( \\ t \u2192 second (first (second (famequiv t))) (a t)))) ,\n        ( ( \\ b t \u2192 first (second (second (famequiv t))) (b t)) ,\n          ( \\ b \u2192\n            eq-ext-htpy\n              ( I)\n              ( \u03c8)\n              ( \\ t \u2192 BOT)\n              ( B)\n              ( \\ u \u2192 recBOT)\n              ( \\ t \u2192\nfirst (famequiv t) (first (second (second (famequiv t))) (b t)))\n              ( b)\n              ( \\ t \u2192 second (second (second (famequiv t))) (b t))))))\n

We have a homotopy extension property.

The following code is another instantiation of casting, necessary for some arguments below.

#define restrict\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5) \u2192 A t)\n( f : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t])\n  : (t : \u03c8 ) \u2192 A t\n  := f\n

The homotopy extension property has the following signature. We state this separately since below we will will both show that this follows from extension extensionality, but we will also show that extension extensionality follows from the homotopy extension property together with extra hypotheses.

#define HtpyExtProperty\n  : U\n  :=\n( I : CUBE) \u2192\n( \u03c8 : I \u2192 TOPE) \u2192\n( \u03d5 : \u03c8 \u2192 TOPE) \u2192\n( A : \u03c8 \u2192 U) \u2192\n( b : (t : \u03c8) \u2192 A t) \u2192\n( a : (t : \u03d5) \u2192 A t) \u2192\n( e : (t : \u03d5) \u2192 a t = b t) \u2192\n\u03a3 (a' : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8) \u2192 (restrict I \u03c8 \u03d5 A a a' t = b t) [\u03d5 t \u21a6 e t])\n

If we assume weak extension extensionality, then then homotopy extension property follows from a straightforward application of the axiom of choice to the point of contraction for weak extension extensionality.

RS17 Proposition 4.10
#define htpy-ext-property-weakextext\n( weakextext : WeakExtExt)\n  : HtpyExtProperty\n  :=\n\\ I \u03c8 \u03d5 A b a e \u2192\nfirst\n    ( axiom-choice\n      ( I)\n      ( \u03c8)\n      ( \u03d5)\n      ( A)\n      ( \\ t y \u2192 y = b t)\n      ( a)\n      ( e))\n    ( first\n      ( weakextext\n        ( I)\n        ( \u03c8)\n        ( \u03d5)\n( \\ t \u2192 (\u03a3 (y : A t) , y = b t))\n        ( \\ t \u2192 is-contr-endpoint-based-paths\n                ( A t)\n                ( b t))\n        ( \\ t \u2192 ( a t , e t) )))\n
RS17 Proposition 4.10
#define htpy-ext-prop-weakextext\n( weakextext : WeakExtExt)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( b : (t : \u03c8) \u2192 A t)\n( a : (t : \u03d5) \u2192 A t)\n( e : (t : \u03d5) \u2192 a t = b t)\n  : \u03a3 (a' : (t : \u03c8) \u2192 A t [\u03d5 t \u21a6 a t]) ,\n((t : \u03c8) \u2192 (restrict I \u03c8 \u03d5 A a a' t = b t) [\u03d5 t \u21a6 e t])\n  :=\nfirst\n    ( axiom-choice\n      ( I)\n      ( \u03c8)\n      ( \u03d5)\n      ( A)\n      ( \\ t y \u2192 y = b t)\n      ( a)\n      ( e))\n    ( first\n      ( weakextext\n        ( I)\n        ( \u03c8)\n        ( \u03d5)\n( \\ t \u2192 (\u03a3 (y : A t) , y = b t))\n        ( \\ t \u2192 is-contr-endpoint-based-paths\n                ( A t)\n                ( b t))\n        ( \\ t \u2192 ( a t , e t) )))\n

In an extension type of a dependent type that is pointwise contractible, then we have an inhabitant of the extension type witnessing the contraction, at every inhabitant of the base, of each point in the fiber to the center of the fiber. Both directions of this statement will be needed.

#def eq-ext-is-contr\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr ( A t))\n  : (t : \u03d5 ) \u2192 ((first (is-contr-fiberwise-A t)) = a t)\n  :=  \\ t \u2192 ( second (is-contr-fiberwise-A t) (a t))\n#def codomain-eq-ext-is-contr\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr ( A t))\n  : (t : \u03d5 ) \u2192 (a t = first (is-contr-fiberwise-A t))\n  :=  \\ t \u2192\n          rev\n            ( A t )\n            ( first (is-contr-fiberwise-A t) )\n            ( a t)\n            ( second (is-contr-fiberwise-A t) (a t))\n

The below gives us the inhabitant \\((a', e') : \\sum_{\\left\\langle\\prod_{t : I|\\psi} A (t) \\biggr|^\\phi_a\\right\\rangle} \\left\\langle \\prod_{t: I |\\psi} a'(t) = b(t)\\biggr|^\\phi_e \\right\\rangle\\) from the first part of the proof of RS Prop 4.11. It amounts to the fact that parameterized contractibility, i.e. A : \u03c8 \u2192 U such that each A t is contractible, implies the hypotheses of the homotopy extension property are satisfied, and so assuming homotopy extension property, we are entitled to the conclusion.

#define htpy-ext-prop-is-fiberwise-contr\n(htpy-ext-property : HtpyExtProperty)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n(is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr (A t))\n  : \u03a3 (a' : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t]),\n((t : \u03c8 ) \u2192\n            (restrict I \u03c8 \u03d5 A a a' t =\nfirst (is-contr-fiberwise-A t))\n              [\u03d5 t \u21a6 codomain-eq-ext-is-contr I \u03c8 \u03d5 A a is-contr-fiberwise-A t] )\n  :=\n    htpy-ext-property\n    ( I )\n    ( \u03c8 )\n    ( \u03d5 )\n    ( A )\n    (\\ t \u2192  first (is-contr-fiberwise-A t))\n    ( a)\n    ( codomain-eq-ext-is-contr I \u03c8 \u03d5 A a is-contr-fiberwise-A)\n

The expression below give us the inhabitant c : (t : \u03c8) \u2192 f t = a' t used in the proof of RS Proposition 4.11. It follows from a more general statement about the contractibility of identity types, but it is unclear if that generality is needed.

#define RS-4-11-c\n(htpy-ext-prop : HtpyExtProperty)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n(is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr (A t))\n  : (t : \u03c8 ) \u2192 f t = (first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A)) t\n  := \\ t \u2192 eq-is-contr\n              ( A t)\n              ( is-contr-fiberwise-A t)\n              ( f t )\n              ( restrict I \u03c8 \u03d5 A a (first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A)) t)\n

And below proves that c(t) = refl. Again, this is a consequence of a slightly more general statement.

#define RS-4-11-c-is-refl\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-fiberwise-contr : (t : \u03c8 ) \u2192 is-contr (A t))\n( a : (t : \u03d5 ) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n( a' : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n( c : (t : \u03c8 ) \u2192 (f t = a' t))\n  : (t : \u03d5 ) \u2192 (refl =_{f t = a' t} c t)\n  :=  \\ t \u2192\n    all-paths-eq-is-contr\n    ( A t)\n    ( is-fiberwise-contr t)\n    ( f t)\n    ( a' t)\n    ( refl )\n    ( c t )\n

Given the a' produced above, the following gives an inhabitant of \\(\\left \\langle_{t : I |\\psi} f(t) = a'(t) \\biggr|^\\phi_{\\lambda t.refl} \\right\\rangle\\)

#define is-fiberwise-contr-ext-is-fiberwise-contr\n(htpy-ext-prop : HtpyExtProperty)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-contr-fiberwise-A : (t : \u03c8 ) \u2192 is-contr (A t))\n-- ( b : (t : \u03c8) \u2192 A t)\n( a : (t : \u03d5) \u2192 A t)\n( f : (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n  : (t : \u03c8 ) \u2192\n      (f t = (first\n              (htpy-ext-prop-is-fiberwise-contr\n                htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A)) t)[\u03d5 t \u21a6 refl]\n  :=\nfirst(\n    htpy-ext-prop\n    ( I )\n    ( \u03c8 )\n    ( \u03d5 )\n    ( \\ t \u2192 f t = first\n                  (htpy-ext-prop-is-fiberwise-contr\n                    htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A) t)\n    ( RS-4-11-c\n      htpy-ext-prop I \u03c8 \u03d5 A a f is-contr-fiberwise-A)\n    ( \\ t \u2192 refl )\n    ( RS-4-11-c-is-refl\n      ( I)\n      ( \u03c8)\n      ( \u03d5)\n      ( A)\n      ( is-contr-fiberwise-A)\n      ( a )\n      ( f )\n      ( first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A))\n      ( RS-4-11-c\n        ( htpy-ext-prop)\n        ( I)\n        ( \u03c8)\n        ( \u03d5)\n        ( A)\n        ( a)\n        ( f)\n        ( is-contr-fiberwise-A ))))\n#define weak-ext-ext-from-eq-ext-htpy-htpy-ext-property\n(naiveextext : NaiveExtExt)\n(htpy-ext-prop : HtpyExtProperty)\n : WeakExtExt\n  := \\ I \u03c8 \u03d5 A is-contr-fiberwise-A a \u2192\n    (first (htpy-ext-prop-is-fiberwise-contr htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A),\n\\ f \u2192\n      rev\n( (t : \u03c8 ) \u2192 A t [\u03d5 t \u21a6 a t])\n      ( f )\n      ( first (htpy-ext-prop-is-fiberwise-contr\n                htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A))\n      (naiveextext\n      ( I)\n      ( \u03c8 )\n      ( \u03d5 )\n      ( A)\n      ( a)\n      ( f)\n      ( first (htpy-ext-prop-is-fiberwise-contr\n                htpy-ext-prop I \u03c8 \u03d5 A a is-contr-fiberwise-A))\n      ( is-fiberwise-contr-ext-is-fiberwise-contr\n        ( htpy-ext-prop)\n        ( I)\n        ( \u03c8 )\n        ( \u03d5 )\n        ( A)\n        ( is-contr-fiberwise-A)\n        ( a)\n        ( f))))\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/","title":"4a. Right orthogonal fibrations","text":"

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on naive extension extensionality:

#assume naiveextext : NaiveExtExt\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#right-orthogonal-maps-with-respect-to-shapes","title":"Right orthogonal maps with respect to shapes","text":"

For every shape inclusion \u03d5 \u2282 \u03c8, we obtain a fibrancy condition for a map \u03b1 : A' \u2192 A in terms of unique extension along \u03d5 \u2282 \u03c8. This is a relative version of unique extension along \u03d5 \u2282 \u03c8.

We say that \u03b1 : A' \u2192 A is right orthogonal to the shape inclusion \u03d5 \u2282 \u03c8, if the square

(\u03c8 \u2192 A') \u2192 (\u03c8 \u2192 A)\n\n   \u2193          \u2193\n\n(\u03d5 \u2192 A') \u2192 (\u03d5 \u2192 A)\n
is homotopy cartesian.

Equivalently, we can interpret this orthogonality as a cofibrancy condition on the shape inclusion. We say that the shape inclusion \u03d5 \u2282 \u03c8 is left orthogonal to the map \u03b1, if \u03b1 : A' \u2192 A is right orthogonal to \u03d5 \u2282 \u03c8.

BW23, Section 3
#def is-right-orthogonal-to-shape\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE )\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n  : U\n  :=\n    is-homotopy-cartesian\n      ( \u03d5 \u2192 A' ) ( \\ \u03c3' \u2192 (t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n      ( \u03d5 \u2192 A ) ( \\ \u03c3 \u2192 (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n      ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t)) ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-properties-of-left-orthogonal-shape-inclusions","title":"Stability properties of left orthogonal shape inclusions","text":"

We fix a map \u03b1 : A' \u2192 A.

#section left-orthogonal-calculus-1\n#variables A' A : U\n#variable \u03b1 : A' \u2192 A\n
Consider nested shapes \u03d5 \u2282 \u03c7 \u2282 \u03c8 and the three possible right orthogonality conditions.

#variable I : CUBE\n#variable \u03c8 : I \u2192 TOPE\n#variable \u03c7 : \u03c8 \u2192 TOPE\n#variable \u03d5 : \u03c7 \u2192 TOPE\n#variable is-orth-\u03c8-\u03c7 : is-right-orthogonal-to-shape I \u03c8 \u03c7 A' A \u03b1\n#variable is-orth-\u03c7-\u03d5 : is-right-orthogonal-to-shape\n                          I ( \\ t \u2192 \u03c7 t) ( \\ t \u2192 \u03d5 t) A' A \u03b1\n#variable is-orth-\u03c8-\u03d5 : is-right-orthogonal-to-shape I \u03c8 ( \\ t \u2192 \u03d5 t) A' A \u03b1\n-- rzk does not accept these terms after \u03b7-reduction\n

Using the vertical pasting calculus for homotopy cartesian squares, it is not hard to deduce the corresponding composition and cancellation properties for left orthogonality of shape inclusion with respect to \u03b1 : A' \u2192 A.

"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#over-an-intermediate-shape","title":"\u03a3 over an intermediate shape","text":"

The only fact that stops some of these laws from being a direct corollary is that the \u03a3-types appearing in the vertical pasting of the relevant squares (such as \u03a3 (\\ \u03c3 : \u03d5 \u2192 A), ( (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])) are not literally equal to the corresponding extension types (such as \u03c4 \u2192 A). Therefore we have to occasionally go back or forth along the functorial equivalence cofibration-composition-functorial.

#def is-homotopy-cartesian-\u03a3-is-right-orthogonal-to-shape uses (is-orth-\u03c8-\u03d5)\n  : is-homotopy-cartesian\n    ( \u03d5 \u2192 A')\n( \\ \u03c3' \u2192 \u03a3 ( \u03c4' : (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t]), ( t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n    ( \u03d5 \u2192 A)\n( \\ \u03c3 \u2192 \u03a3 ( \u03c4 : (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t]), ( t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n    ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n    ( \\ _ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 (\u03c4' t), \\ t \u2192 \u03b1 (\u03c5' t) ))\n  :=\n( \\ (\u03c3' : \u03d5 \u2192 A') \u2192\n    is-equiv-Equiv-is-equiv'\n( ( t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( ( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n      ( \\ \u03c5' t \u2192 \u03b1 ( \u03c5' t))\n( \u03a3 ( \u03c4' : (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t]),\n( ( t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t]))\n( \u03a3 ( \u03c4 : ( t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)]),\n( ( t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t]))\n      ( \\ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 (\u03c4' t), \\t \u2192 \u03b1 (\u03c5' t)))\n      ( cofibration-composition-functorial I \u03c8 \u03c7 \u03d5\n        ( \\ _ \u2192 A') ( \\ _ \u2192 A) ( \\ _ \u2192 \u03b1) \u03c3')\n      ( is-orth-\u03c8-\u03d5 \u03c3'))\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-under-composition","title":"Stability under composition","text":"

Left orthogonal shape inclusions are preserved under composition.

right-orthogonality for composition of shape inclusions
#def is-right-orthogonal-to-shape-comp uses (is-orth-\u03c8-\u03c7 is-orth-\u03c7-\u03d5)\n  : is-right-orthogonal-to-shape I \u03c8 ( \\ t \u2192 \u03d5 t) A' A \u03b1\n  :=\n\\ \u03c3' \u2192\n      is-equiv-Equiv-is-equiv\n( ( t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( ( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n        ( \\ \u03c5' t \u2192 \u03b1 ( \u03c5' t))\n( \u03a3 ( \u03c4' : (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t]),\n( ( t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t]))\n( \u03a3 ( \u03c4 : ( t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)]),\n( ( t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t]))\n        ( \\ (\u03c4', \u03c5') \u2192 ( \\ t \u2192 \u03b1 (\u03c4' t), \\t \u2192 \u03b1 (\u03c5' t)))\n        ( cofibration-composition-functorial I \u03c8 \u03c7 \u03d5\n          ( \\ _ \u2192 A') ( \\ _ \u2192 A) ( \\ _ \u2192 \u03b1) \u03c3')\n        ( is-homotopy-cartesian-vertical-pasting-from-fibers\n          ( \u03d5 \u2192 A' )\n( \\ \u03c3' \u2192 (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ _ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n          ( \u03d5 \u2192 A )\n( \\ \u03c3 \u2192 (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n( \\ _ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n          ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n          ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n          ( \\ _ _ \u03c5' x \u2192 \u03b1 (\u03c5' x) )\n          is-orth-\u03c7-\u03d5\n          ( \\ _ \u03c4' \u2192 is-orth-\u03c8-\u03c7 \u03c4')\n          \u03c3')\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#cancellation-laws","title":"Cancellation laws","text":"

If \u03d5 \u2282 \u03c7 and \u03d5 \u2282 \u03c8 are left orthogonal to \u03b1 : A' \u2192 A, then so is \u03c7 \u2282 \u03c8.

#def is-right-orthogonal-to-shape-left-cancel uses (is-orth-\u03c7-\u03d5 is-orth-\u03c8-\u03d5)\n  : is-right-orthogonal-to-shape I \u03c8 \u03c7 A' A \u03b1\n  :=\n\\ \u03c4' \u2192\n        is-homotopy-cartesian-lower-cancel-to-fibers\n          ( \u03d5 \u2192 A' )\n( \\ \u03c3' \u2192 (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ _ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n          ( \u03d5 \u2192 A )\n( \\ \u03c3 \u2192 (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n( \\ _ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n          ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n          ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n          ( \\ _ _ \u03c5' x \u2192 \u03b1 (\u03c5' x) )\n          ( is-orth-\u03c7-\u03d5 )\n          (is-homotopy-cartesian-\u03a3-is-right-orthogonal-to-shape)\n( \\ ( t : \u03d5) \u2192 \u03c4' t)\n          \u03c4'\n

If \u03d5 \u2282 \u03c8 is left orthogonal to \u03b1 : A' \u2192 A and \u03c7 \u2282 \u03c8 is a (functorial) shape retract, then \u03d5 \u2282 \u03c8 is left orthogonal to \u03b1 : A' \u2192 A.

#def is-right-orthogonal-to-shape-right-cancel-retract uses (is-orth-\u03c8-\u03d5)\n( is-fretract-\u03c8-\u03c7 : is-functorial-shape-retract I \u03c8 \u03c7)\n  : is-right-orthogonal-to-shape I ( \\ t \u2192 \u03c7 t) ( \\ t \u2192 \u03d5 t) A' A \u03b1\n  :=\n    is-homotopy-cartesian-upper-cancel-with-section\n      ( \u03d5 \u2192 A' )\n( \\ \u03c3' \u2192 (t : \u03c7) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( \\ _ \u03c4' \u2192 (t : \u03c8) \u2192 A' [\u03c7 t \u21a6 \u03c4' t])\n      ( \u03d5 \u2192 A )\n( \\ \u03c3 \u2192 (t : \u03c7) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n( \\ _ \u03c4 \u2192 (t : \u03c8) \u2192 A [\u03c7 t \u21a6 \u03c4 t])\n      ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n      ( \\ _ \u03c4' x \u2192 \u03b1 (\u03c4' x) )\n      ( \\ _ _ \u03c5' x \u2192 \u03b1 (\u03c5' x) )\n      ( relativize-is-functorial-shape-retract I \u03c8 \u03c7 is-fretract-\u03c8-\u03c7 \u03d5 A' A \u03b1)\n      (is-homotopy-cartesian-\u03a3-is-right-orthogonal-to-shape)\n#end left-orthogonal-calculus-1\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-under-exponentiation","title":"Stability under exponentiation","text":"

If \u03d5 \u2282 \u03c8 is left orthogonal to \u03b1 : A' \u2192 A then so is \u03c7 \u00d7 \u03d5 \u2282 \u03c7 \u00d7 \u03c8 for every other shape \u03c7.

The following proof uses a lot of currying and uncurrying and relies on (the naive form of) extension extensionality.

#def is-right-orthogonal-to-shape-\u00d7 uses (naiveextext)\n-- this should be refactored by introducing cofibration-product-functorial\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( J : CUBE)\n( \u03c7 : J \u2192 TOPE)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE )\n( \u03d5 : \u03c8 \u2192 TOPE )\n( is-orth-\u03c8-\u03d5 : is-right-orthogonal-to-shape I \u03c8 \u03d5 A' A \u03b1)\n  : is-right-orthogonal-to-shape\n      ( J \u00d7 I) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03c8 s) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03d5 s) A' A \u03b1\n  :=\n    \\ ( \u03c3' : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03d5 s) \u2192 A') \u2192\n(\n( \\ ( \u03c4 : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A[\u03d5 s \u21a6 \u03b1 (\u03c3' (t,s))])\n            ( t, s) \u2192\n          ( first (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s'))))) ( \\ s' \u2192 \u03c4 (t, s')) s\n        ,\n          \\ ( \u03c4' : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A' [\u03d5 s \u21a6 \u03c3' (t,s)]) \u2192\n            naiveextext\n              ( J \u00d7 I) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03c8 s) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03d5 s)\n              ( \\ _ \u2192 A')\n              ( \\ ( t,s) \u2192 \u03c3' (t,s))\n              ( \\ ( t,s) \u2192\n                ( first (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                  ( \\ s' \u2192 \u03b1 (\u03c4' (t, s'))) s)\n              ( \u03c4')\n              ( \\ ( t,s) \u2192\n                ext-htpy-eq I \u03c8 \u03d5 (\\ _ \u2192 A') ( \\ s' \u2192 \u03c3' (t, s'))\n                  ( ( first (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                    ( \\ s' \u2192 \u03b1 (\u03c4' (t, s'))))\n                  ( \\ s' \u2192 \u03c4' (t, s') )\n                  ( ( second (first (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                    ( \\ s' \u2192 \u03c4' (t, s')))\n                  ( s)\n              )\n        )\n      ,\n( \\ ( \u03c4 : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A [\u03d5 s \u21a6 \u03b1 (\u03c3' (t,s))])\n            ( t, s) \u2192\n          ( first (second (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s'))))) ( \\ s' \u2192 \u03c4 (t, s')) s\n        ,\n          \\ ( \u03c4 : ( (t,s) : J \u00d7 I | \u03c7 t \u2227 \u03c8 s) \u2192 A [\u03d5 s \u21a6 \u03b1 (\u03c3' (t,s))]) \u2192\n            naiveextext\n              ( J \u00d7 I) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03c8 s) ( \\ (t,s) \u2192 \u03c7 t \u2227 \u03d5 s)\n              ( \\ _ \u2192 A)\n              ( \\ (t,s) \u2192 \u03b1 (\u03c3' (t,s)))\n              ( \\ (t,s) \u2192\n                \u03b1 ( ( first ( second ( is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                      ( \\ s' \u2192 \u03c4 (t, s')) s))\n              ( \u03c4)\n              ( \\ ( t,s) \u2192\n                ext-htpy-eq I \u03c8 \u03d5 (\\ _ \u2192 A) ( \\ s' \u2192 \u03b1 (\u03c3' (t, s')))\n                  ( \\ s'' \u2192\n                      \u03b1 ( ( first (second (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                          ( \\ s' \u2192 \u03c4 (t, s'))\n                          (s'')))\n                  ( \\ s' \u2192 \u03c4 (t, s') )\n                  ( ( second ( second (is-orth-\u03c8-\u03d5 (\\ s' \u2192 \u03c3' (t, s')))))\n                    ( \\ s' \u2192 \u03c4 (t, s')))\n                  ( s)\n              )\n        )\n      )\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#stability-under-exact-pushouts","title":"Stability under exact pushouts","text":"

For any two shapes \u03d5, \u03c8 \u2282 I, if \u03d5 \u2229 \u03c8 \u2282 \u03d5 is left orthogonal to \u03b1 : A' \u2192 A, then so is \u03c8 \u2282 \u03d5 \u222a \u03c8.

#def is-right-orthogonal-to-shape-pushout\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( I : CUBE)\n( \u03d5 \u03c8 : I \u2192 TOPE)\n( is-orth-\u03d5-\u03c8\u2227\u03d5 : is-right-orthogonal-to-shape I \u03d5 ( \\ t \u2192 \u03d5 t \u2227 \u03c8 t) A' A \u03b1)\n  : is-right-orthogonal-to-shape I ( \\ t \u2192 \u03d5 t \u2228 \u03c8 t) ( \\ t \u2192 \u03c8 t) A' A \u03b1\n  := \\ ( \u03c4' : \u03c8 \u2192 A') \u2192\n       is-equiv-Equiv-is-equiv\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A' [\u03c8 t \u21a6 \u03c4' t])\n( (t : I | \u03d5 t \u2228 \u03c8 t) \u2192 A [\u03c8 t \u21a6 \u03b1 (\u03c4' t)])\n         ( \\ \u03c5' t \u2192 \u03b1 (\u03c5' t))\n( (t : \u03d5) \u2192 A' [\u03d5 t \u2227 \u03c8 t \u21a6 \u03c4' t])\n( (t : \u03d5) \u2192 A [\u03d5 t \u2227 \u03c8 t \u21a6 \u03b1 (\u03c4' t)])\n         ( \\ \u03bd' t \u2192 \u03b1 (\u03bd' t))\n         ( cofibration-union-functorial I \u03d5 \u03c8 (\\ _ \u2192 A') (\\ _ \u2192 A) (\\ _ \u2192 \u03b1) \u03c4')\n         ( is-orth-\u03d5-\u03c8\u2227\u03d5 ( \\ t \u2192 \u03c4' t))\n
"},{"location":"simplicial-hott/04-right-orthogonal.rzk/#types-with-unique-extension","title":"Types with unique extension","text":"

We say that an type A has unique extensions for a shape inclusion \u03d5 \u2282 \u03c8, if for each \u03c3 : \u03d5 \u2192 A the type of \u03c8-extensions is contractible.

#def has-unique-extensions\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A : U)\n  : U\n  :=\n( \u03c3 : \u03d5 \u2192 A) \u2192 is-contr ( (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t])\n

The property of having unique extension can be pulled back along any right orthogonal map.

#def has-unique-extensions-domain-right-orthogonal-has-unique-extensions-codomain\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( is-orth-\u03c8-\u03d5-\u03b1 : is-right-orthogonal-to-shape I \u03c8 \u03d5 A' A \u03b1)\n  : has-unique-extensions I \u03c8 \u03d5 A \u2192 has-unique-extensions I \u03c8 \u03d5 A'\n  :=\n\\ has-ue-A ( \u03c3' : \u03d5 \u2192 A') \u2192\n      is-contr-equiv-is-contr'\n( ( t : \u03c8) \u2192 A' [\u03d5 t \u21a6 \u03c3' t])\n( ( t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03b1 (\u03c3' t)])\n        ( \\ \u03c4' t \u2192 \u03b1 (\u03c4' t) , is-orth-\u03c8-\u03d5-\u03b1 \u03c3')\n        ( has-ue-A (\\ t \u2192 \u03b1 (\u03c3' t)))\n

Alternatively, we can ask that the canonical restriction map (\u03c8 \u2192 A) \u2192 (\u03d5 \u2192 A) is an equivalence.

#section is-local-type\n#variable I : CUBE\n#variable \u03c8 : I \u2192 TOPE\n#variable \u03d5 : \u03c8 \u2192 TOPE\n#variable A : U\n#def is-local-type\n  : U\n  :=\n    is-equiv (\u03c8 \u2192 A) (\u03d5 \u2192 A) ( \\ \u03c4 t \u2192 \u03c4 t)\n

This follows straightforwardly from the fact that for every \u03c3 : \u03d5 \u2192 A we have an equivalence between the extension type (t : \u03c8) \u2192 A [\u03d5 t \u21a6 \u03c3 t] and the fiber of the restriction map (\u03c8 \u2192 A) \u2192 (\u03d5 \u2192 A).

#def is-local-type-has-unique-extensions\n( has-ue-\u03c8-\u03d5-A : has-unique-extensions I \u03c8 \u03d5 A)\n  : is-local-type\n  :=\n    is-equiv-is-contr-map (\u03c8 \u2192 A) (\u03d5 \u2192 A) ( \\ \u03c4 t \u2192 \u03c4 t)\n( \\ ( \u03c3 : \u03d5 \u2192 A) \u2192\n          is-contr-equiv-is-contr\n            ( extension-type I \u03c8 \u03d5 A \u03c3)\n            ( homotopy-extension-type I \u03c8 \u03d5 A \u03c3)\n            ( extension-type-weakening I \u03c8 \u03d5 A \u03c3)\n            ( has-ue-\u03c8-\u03d5-A \u03c3))\n#def has-unique-extensions-is-local-type\n( is-lt-\u03c8-\u03d5-A : is-local-type)\n  : has-unique-extensions I \u03c8 \u03d5 A\n  :=\n\\ \u03c3 \u2192\n      is-contr-equiv-is-contr'\n        ( extension-type I \u03c8 \u03d5 A \u03c3)\n        ( homotopy-extension-type I \u03c8 \u03d5 A \u03c3)\n        ( extension-type-weakening I \u03c8 \u03d5 A \u03c3)\n        ( is-contr-map-is-equiv\n            ( \u03c8 \u2192 A) (\u03d5 \u2192 A) ( \\ \u03c4 t \u2192 \u03c4 t)\n            ( is-lt-\u03c8-\u03d5-A)\n            ( \u03c3))\n#end is-local-type\n

Since the property of having unique extensions passes from the codomain to the domain of a right orthogonal map, the same is true for locality of types.

#def is-local-type-domain-right-orthogonal-is-local-type-codomain\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03d5 : \u03c8 \u2192 TOPE)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( is-orth-\u03b1 : is-right-orthogonal-to-shape I \u03c8 \u03d5 A' A \u03b1)\n( is-local-A : is-local-type I \u03c8 \u03d5 A)\n  : is-local-type I \u03c8 \u03d5 A'\n  :=\n    is-local-type-has-unique-extensions I \u03c8 \u03d5 A'\n      ( has-unique-extensions-domain-right-orthogonal-has-unique-extensions-codomain\n          I \u03c8 \u03d5 A' A \u03b1 is-orth-\u03b1\n          ( has-unique-extensions-is-local-type I \u03c8 \u03d5 A is-local-A))\n
"},{"location":"simplicial-hott/05-segal-types.rzk/","title":"Segal Types","text":"

These formalisations correspond to Section 5 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume weakextext : WeakExtExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#hom-types","title":"Hom types","text":"

Extension types are used to define the type of arrows between fixed terms:

x y

RS17, Definition 5.1
#def hom\n( A : U)\n( x y : A)\n  : U\n  :=\n( t : \u0394\u00b9) \u2192\n    A [ t \u2261 0\u2082 \u21a6 x ,  -- the left endpoint is exactly x\n        t \u2261 1\u2082 \u21a6 y]   -- the right endpoint is exactly y\n

For each a : A, the total types of the representables \\ z \u2192 hom A a z and \\ z \u2192 hom A z a are called the coslice and slice, respectively.

#def coslice\n( A : U)\n( a : A)\n  : U\n  := \u03a3 ( z : A) , (hom A a z)\n#def slice\n( A : U)\n( a : A)\n  : U\n  := \u03a3 (z : A) , (hom A z a)\n

The types coslice A a and slice A a are functorial in A in the following sense:

#def coslice-fun\n(A B : U)\n(f : A \u2192 B)\n(a : A)\n  : coslice A a \u2192 coslice B (f a)\n  :=\n    \\ (a', g) \u2192 (f a', \\ t \u2192 f (g t))\n#def slice-fun\n(A B : U)\n(f : A \u2192 B)\n(a : A)\n  : slice A a \u2192 slice B (f a)\n  :=\n    \\ (a', g) \u2192 (f a', \\ t \u2192 f (g t))\n

Slices and coslices can also be defined directly as extension types:

#section coslice-as-extension-type\n#variable A : U\n#variable a : A\n#def coslice'\n  : U\n  := ( t : \u0394\u00b9) \u2192 A [t \u2261 0\u2082 \u21a6 a]\n#def coslice'-coslice\n  : coslice A a \u2192 coslice'\n  := \\ (_, f) \u2192 f\n#def coslice-coslice'\n  : coslice' \u2192 coslice A a\n  := \\ f \u2192 ( f 1\u2082 , \\ t \u2192 f t) -- does not typecheck after \u03b7-reduction\n#def is-id-coslice-coslice'-coslice\n  ( (a', f) : coslice A a)\n  : ( coslice-coslice' ( coslice'-coslice (a', f)) = (a', f))\n  :=\n    eq-pair A (hom A a)\n      ( coslice-coslice' ( coslice'-coslice (a', f))) (a', f)\n      (refl, refl)\n#def is-id-coslice'-coslice-coslice'\n( f : coslice')\n  : ( coslice'-coslice ( coslice-coslice' f) = f)\n  :=\nrefl\n#def is-equiv-coslice'-coslice\n  : is-equiv (coslice A a) coslice' coslice'-coslice\n  :=\n    ( ( coslice-coslice', is-id-coslice-coslice'-coslice),\n      ( coslice-coslice', is-id-coslice'-coslice-coslice')\n    )\n#def is-equiv-coslice-coslice'\n  : is-equiv coslice' (coslice A a)  coslice-coslice'\n  :=\n    ( ( coslice'-coslice, is-id-coslice'-coslice-coslice'),\n      ( coslice'-coslice, is-id-coslice-coslice'-coslice)\n    )\n#end coslice-as-extension-type\n#section slice-as-extension-type\n#variable A : U\n#variable a : A\n#def slice'\n  : U\n  := ( t : \u0394\u00b9) \u2192 A[t \u2261 1\u2082 \u21a6 a]\n#def slice'-slice\n  : slice A a \u2192 slice'\n  := \\ (_, f) \u2192 f\n#def slice-slice'\n  : slice' \u2192 slice A a\n  := \\ f \u2192 ( f 0\u2082 , \\ t \u2192 f t) -- does not typecheck after \u03b7-reduction\n#def is-id-slice-slice'-slice\n  ( (a', f) : slice A a)\n  : ( slice-slice' ( slice'-slice (a', f)) = (a', f))\n  :=\n    eq-pair A (\\ a' \u2192 hom A a' a)\n      ( slice-slice' ( slice'-slice (a', f))) (a', f)\n      (refl, refl)\n#def is-id-slice'-slice-slice'\n( f : slice')\n  : ( slice'-slice ( slice-slice' f) = f)\n  :=\nrefl\n#def is-equiv-slice'-slice\n  : is-equiv (slice A a) slice' slice'-slice\n  :=\n    ( ( slice-slice', is-id-slice-slice'-slice),\n      ( slice-slice', is-id-slice'-slice-slice')\n    )\n#def is-equiv-slice-slice'\n  : is-equiv slice' (slice A a)  slice-slice'\n  :=\n    ( ( slice'-slice, is-id-slice'-slice-slice'),\n      ( slice'-slice, is-id-slice-slice'-slice)\n    )\n#end slice-as-extension-type\n

Extension types are also used to define the type of commutative triangles:

x y z f g h

RS17, Definition 5.2
#def hom2\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n  : U\n  :=\n    ( (t\u2081 , t\u2082) : \u0394\u00b2) \u2192\n    A [ t\u2082 \u2261 0\u2082 \u21a6 f t\u2081 ,  -- the top edge is exactly `f`,\n        t\u2081 \u2261 1\u2082 \u21a6 g t\u2082 ,  -- the right edge is exactly `g`, and\n        t\u2082 \u2261 t\u2081 \u21a6 h t\u2082]   -- the diagonal is exactly `h`\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#the-segal-condition","title":"The Segal condition","text":"

A type is Segal if every composable pair of arrows has a unique composite. Note this is a considerable simplification of the usual Segal condition, which also requires homotopical uniqueness of higher-order composites.

RS17, Definition 5.3
#def is-segal\n( A : U)\n  : U\n  :=\n(x : A) \u2192 (y : A) \u2192 (z : A) \u2192\n(f : hom A x y) \u2192 (g : hom A y z) \u2192\n    is-contr (\u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n

Segal types have a composition functor and witnesses to the composition relation. Composition is written in diagrammatic order to match the order of arguments in is-segal.

#def comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : hom A x z\n  := first (first (is-segal-A x y z f g))\n#def witness-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : hom2 A x y z f g (comp-is-segal A is-segal-A x y z f g)\n  := second (first (is-segal-A x y z f g))\n

Composition in a Segal type is unique in the following sense. If there is a witness that an arrow \\(h\\) is a composite of \\(f\\) and \\(g\\), then the specified composite equals \\(h\\).

x y z f g h \u03b1 = x y z f g comp-is-segal witness-comp-is-segal

#def uniqueness-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n( alpha : hom2 A x y z f g h)\n  : ( comp-is-segal A is-segal-A x y z f g) = h\n  :=\n    first-path-\u03a3\n      ( hom A x z)\n      ( hom2 A x y z f g)\n      ( comp-is-segal A is-segal-A x y z f g ,\n        witness-comp-is-segal A is-segal-A x y z f g)\n      ( h , alpha)\n( homotopy-contraction\n        ( \u03a3 (k : hom A x z) , (hom2 A x y z f g k))\n        ( is-segal-A x y z f g)\n        ( h , alpha))\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#characterizing-segal-types","title":"Characterizing Segal types","text":"

Our aim is to prove that a type is Segal if and only if the horn-restriction map, defined below, is an equivalence.

x y z f g

A pair of composable arrows form a horn.

#def horn\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : \u039b \u2192 A\n  :=\n    \\ (t , s) \u2192\nrecOR\n      ( s \u2261 0\u2082 \u21a6 f t ,\n        t \u2261 1\u2082 \u21a6 g s)\n

The underlying horn of a simplex:

#def horn-restriction\n( A : U)\n  : (\u0394\u00b2 \u2192 A) \u2192 (\u039b \u2192 A)\n  := \\ f t \u2192 f t\n

This provides an alternate definition of Segal types as types which are local for the inclusion \u039b \u2282 \u0394\u00b9.

#def is-local-horn-inclusion\n  : U \u2192 U\n  := is-local-type (2 \u00d7 2) \u0394\u00b2 (\\ t \u2192 \u039b t)\n#def is-local-horn-inclusion-unpacked\n( A : U)\n  : is-local-horn-inclusion A = is-equiv (\u0394\u00b2 \u2192 A) (\u039b \u2192 A) (horn-restriction A)\n  := refl\n

Now we prove this definition is equivalent to the original one. Here, we prove the equivalence used in [RS17, Theorem 5.5]. However, we do this by constructing the equivalence directly, instead of using a composition of equivalences, as it is easier to write down and it computes better (we can use refl for the witnesses of the equivalence).

#def compositions-are-horn-fillings\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : Equiv\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n( (t : \u0394\u00b2) \u2192 A [\u039b t \u21a6 horn A x y z f g t])\n  :=\n    ( \\ hh t \u2192 (second hh) t ,\n      ( ( \\ k \u2192 (\\ t \u2192 k (t , t) , \\ (t , s) \u2192 k (t , s)) ,\n\\ hh \u2192 refl) ,\n        ( \\ k \u2192 (\\ t \u2192 k (t , t) , \\ (t , s) \u2192 k (t , s)) ,\n\\ hh \u2192 refl)))\n#def equiv-horn-restriction\n( A : U)\n  : Equiv\n    ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n( \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n            ( hom2 A\n              ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n              ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n              ( h))))\n  :=\n    ( \\ k \u2192\n      ( ( \\ t \u2192 k t) ,\n        ( \\ t \u2192 k (t , t) , \\ t \u2192 k t)) ,\n      ( ( \\ khh t \u2192 (second (second khh)) t , \\ k \u2192 refl) ,\n        ( \\ khh t \u2192 (second (second khh)) t , \\ k \u2192 refl)))\n
RS17, Theorem 5.5 (the hard direction)
#def equiv-horn-restriction-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : Equiv (\u0394\u00b2 \u2192 A) (\u039b \u2192 A)\n  :=\n    equiv-comp\n      ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n( \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n                ( h))))\n      ( \u039b \u2192 A)\n      ( equiv-horn-restriction A)\n      ( projection-total-type\n        ( \u039b \u2192 A)\n( \\ k \u2192\n          \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n            ( hom2 A\n              ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n              ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n              ( h))) ,\n      ( is-equiv-projection-contractible-fibers\n          ( \u039b \u2192 A)\n( \\ k \u2192\n            \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t))\n                ( h)))\n          ( \\ k \u2192\n            is-segal-A\n              ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n              ( \\ t \u2192 k (t , 0\u2082)) (\\ t \u2192 k (1\u2082 , t)))))\n

We verify that the mapping in Segal-equiv-horn-restriction A is-segal-A is exactly horn-restriction A.

#def test-equiv-horn-restriction-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : (first (equiv-horn-restriction-is-segal A is-segal-A)) = (horn-restriction A)\n  := refl\n
Segal types are types that are local at the horn inclusion
#def is-local-horn-inclusion-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : is-local-horn-inclusion A\n  := second (equiv-horn-restriction-is-segal A is-segal-A)\n
Types that are local at the horn inclusion are Segal types
#def is-segal-is-local-horn-inclusion\n( A : U)\n( is-local-horn-inclusion-A : is-local-horn-inclusion A)\n  : is-segal A\n  :=\n\\ x y z f g \u2192\n    contractible-fibers-is-equiv-projection\n      ( \u039b \u2192 A)\n( \\ k \u2192\n        \u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n          ( hom2 A\n            ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n            ( \\ t \u2192 k (t , 0\u2082))\n            ( \\ t \u2192 k (1\u2082 , t))\n            ( h)))\n( second\n        ( equiv-comp\n          ( \u03a3 ( k : \u039b \u2192 A) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n              ( hom2 A\n                ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                ( \\ t \u2192 k (t , 0\u2082))\n                ( \\ t \u2192 k (1\u2082 , t))\n                ( h)))\n          ( \u0394\u00b2 \u2192 A)\n          ( \u039b  \u2192 A)\n          ( inv-equiv\n            ( \u0394\u00b2 \u2192 A)\n( \u03a3 ( k : \u039b \u2192 A) ,\n\u03a3 ( h : hom A (k (0\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))) ,\n                ( hom2 A\n                  ( k (0\u2082 , 0\u2082)) (k (1\u2082 , 0\u2082)) (k (1\u2082 , 1\u2082))\n                  ( \\ t \u2192 k (t , 0\u2082))\n                  ( \\ t \u2192 k (1\u2082 , t))\n                  ( h)))\n            ( equiv-horn-restriction A))\n          ( horn-restriction A , is-local-horn-inclusion-A)))\n    ( horn A x y z f g)\n

We have now proven that both notions of Segal types are logically equivalent.

RS17, Theorem 5.5
#def is-segal-iff-is-local-horn-inclusion\n( A : U)\n  : iff (is-segal A) (is-local-horn-inclusion A)\n  := (is-local-horn-inclusion-is-segal A , is-segal-is-local-horn-inclusion A)\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#segal-function-and-extension-types","title":"Segal function and extension types","text":"

Using the new characterization of Segal types, we can show that the type of functions or extensions into a family of Segal types is again a Segal type. For instance if \\(X\\) is a type and \\(A : X \u2192 U\\) is such that \\(A x\\) is a Segal type for all \\(x\\) then \\((x : X) \u2192 A x\\) is a Segal type.

RS17, Corollary 5.6(i)
#def is-local-horn-inclusion-function-type uses (funext)\n( X : U)\n( A : X \u2192 U)\n( fiberwise-is-segal-A : (x : X) \u2192 is-local-horn-inclusion (A x))\n  : is-local-horn-inclusion ((x : X) \u2192 A x)\n  :=\n    is-equiv-triple-comp\n( \u0394\u00b2 \u2192 ((x : X) \u2192 A x))\n( (x : X) \u2192 \u0394\u00b2 \u2192 A x)\n( (x : X) \u2192 \u039b \u2192 A x)\n( \u039b \u2192 ((x : X) \u2192 A x))\n      ( \\ g x t \u2192 g t x) -- first equivalence\n      ( second (flip-ext-fun\n        ( 2 \u00d7 2)\n        ( \u0394\u00b2)\n        ( \\ t \u2192 BOT)\n        ( X)\n        ( \\ t \u2192 A)\n        ( \\ t \u2192 recBOT)))\n      ( \\ h x t \u2192 h x t) -- second equivalence\n      ( second (equiv-function-equiv-family\n        ( funext)\n        ( X)\n        ( \\ x \u2192 (\u0394\u00b2 \u2192 A x))\n        ( \\ x \u2192 (\u039b \u2192 A x))\n        ( \\ x \u2192 (horn-restriction (A x) , fiberwise-is-segal-A x))))\n      ( \\ h t x \u2192 (h x) t) -- third equivalence\n      ( second (flip-ext-fun-inv\n        ( 2 \u00d7 2)\n        ( \u039b)\n        ( \\ t \u2192 BOT)\n        ( X)\n        ( \\ t \u2192 A)\n        ( \\ t \u2192 recBOT)))\n#def is-segal-function-type uses (funext)\n( X : U)\n( A : X \u2192 U)\n( fiberwise-is-segal-A : (x : X) \u2192 is-segal (A x))\n  : is-segal ((x : X) \u2192 A x)\n  :=\n    is-segal-is-local-horn-inclusion\n( (x : X) \u2192 A x)\n      ( is-local-horn-inclusion-function-type\n        ( X) (A)\n        ( \\ x \u2192 is-local-horn-inclusion-is-segal (A x)(fiberwise-is-segal-A x)))\n

If \\(X\\) is a shape and \\(A : X \u2192 U\\) is such that \\(A x\\) is a Segal type for all \\(x\\) then \\((x : X) \u2192 A x\\) is a Segal type.

RS17, Corollary 5.6(ii)
#def is-local-horn-inclusion-extension-type uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( fiberwise-is-segal-A : (s : \u03c8) \u2192 is-local-horn-inclusion (A s))\n  : is-local-horn-inclusion ((s : \u03c8) \u2192 A s)\n  :=\n    is-equiv-triple-comp\n( \u0394\u00b2 \u2192 (s : \u03c8) \u2192 A s)\n( (s : \u03c8) \u2192 \u0394\u00b2 \u2192 A s)\n( (s : \u03c8) \u2192 \u039b \u2192 A s)\n( \u039b \u2192 (s : \u03c8) \u2192 A s)\n      ( \\ g s t \u2192 g t s)  -- first equivalence\n      ( second\n        ( fubini\n          ( 2 \u00d7 2)\n          ( I)\n          ( \u0394\u00b2)\n          ( \\ t \u2192 BOT)\n          ( \u03c8)\n          ( \\ s \u2192 BOT)\n          ( \\ t s \u2192 A s)\n          ( \\ u \u2192 recBOT)))\n      ( \\ h s t \u2192 h s t) -- second equivalence\n      ( second (equiv-extension-equiv-family extext I \u03c8\n        ( \\ s \u2192 \u0394\u00b2 \u2192 A s)\n        ( \\ s \u2192 \u039b \u2192 A s)\n        ( \\ s \u2192 (horn-restriction (A s) , fiberwise-is-segal-A s))))\n      ( \\ h t s \u2192 (h s) t) -- third equivalence\n      ( second\n        ( fubini\n          ( I)\n          ( 2 \u00d7 2)\n          ( \u03c8)\n          ( \\ s \u2192 BOT)\n          ( \u039b)\n          ( \\ t \u2192 BOT)\n          ( \\ s t \u2192 A s)\n          ( \\ u \u2192 recBOT)))\n#def is-segal-extension-type uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( fiberwise-is-segal-A : (s : \u03c8) \u2192 is-segal (A s))\n  : is-segal ((s : \u03c8) \u2192 A s)\n  :=\n    is-segal-is-local-horn-inclusion\n( (s : \u03c8) \u2192 A s)\n      ( is-local-horn-inclusion-extension-type\n        ( I) (\u03c8) (A)\n        ( \\ s \u2192 is-local-horn-inclusion-is-segal (A s)(fiberwise-is-segal-A s)))\n

In particular, the arrow type of a Segal type is Segal. First, we define the arrow type:

#def arr\n( A : U)\n  : U\n  := \u0394\u00b9 \u2192 A\n

For later use, an equivalent characterization of the arrow type.

#def arr-\u03a3-hom\n( A : U)\n  : ( arr A) \u2192 (\u03a3 (x : A) , (\u03a3 (y : A) , hom A x y))\n  := \\ f \u2192 (f 0\u2082 , (f 1\u2082 , f))\n#def is-equiv-arr-\u03a3-hom\n( A : U)\n  : is-equiv (arr A) (\u03a3 (x : A) , (\u03a3 (y : A) , hom A x y)) (arr-\u03a3-hom A)\n  :=\n    ( ( \\ (x , (y , f)) \u2192 f , \\ f \u2192 refl) ,\n      ( \\ (x , (y , f)) \u2192 f , \\ xyf \u2192 refl))\n#def equiv-arr-\u03a3-hom\n( A : U)\n  : Equiv (arr A) (\u03a3 (x : A) , (\u03a3 (y : A) , hom A x y))\n  := ( arr-\u03a3-hom A , is-equiv-arr-\u03a3-hom A)\n
RS17, Corollary 5.6(ii), special case for locality at the horn inclusion
#def is-local-horn-inclusion-arr uses (extext)\n( A : U)\n( is-segal-A : is-local-horn-inclusion A)\n  : is-local-horn-inclusion (arr A)\n  :=\n    is-local-horn-inclusion-extension-type\n      ( 2)\n      ( \u0394\u00b9)\n      ( \\ _ \u2192 A)\n      ( \\ _ \u2192 is-segal-A)\n
RS17, Corollary 5.6(ii), special case for the Segal condition
#def is-segal-arr uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n  : is-segal (arr A)\n  :=\n    is-segal-extension-type\n      ( 2)\n      ( \u0394\u00b9)\n      ( \\ _ \u2192 A)\n      ( \\ _ \u2192 is-segal-A)\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#identity","title":"Identity","text":"

All types have identity arrows and witnesses to the identity composition law.

x x x

RS17, Definition 5.7
#def id-hom\n( A : U)\n( x : A)\n  : hom A x x\n  := \\ t \u2192 x\n

Witness for the right identity law:

x y y f y f f

RS17, Proposition 5.8a
#def comp-id-witness\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : hom2 A x y y f (id-hom A y) f\n  := \\ (t , s) \u2192 f t\n

Witness for the left identity law:

x x y x f f f

RS17, Proposition 5.8b
#def id-comp-witness\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : hom2 A x x y (id-hom A x) f f\n  := \\ (t , s) \u2192 f s\n

In a Segal type, where composition is unique, it follows that composition with an identity arrow recovers the original arrow. Thus, an identity axiom was not needed in the definition of Segal types.

If A is Segal then the right unit law holds
#def comp-id-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : ( comp-is-segal A is-segal-A x y y f (id-hom A y)) = f\n  :=\n    uniqueness-comp-is-segal\n      ( A)\n      ( is-segal-A)\n      ( x) (y) (y)\n      ( f)\n      ( id-hom A y)\n      ( f)\n      ( comp-id-witness A x y f)\n
If A is Segal then the left unit law holds
#def id-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (comp-is-segal A is-segal-A x x y (id-hom A x) f) =_{hom A x y} f\n  :=\n    uniqueness-comp-is-segal\n      ( A)\n      ( is-segal-A)\n      ( x) (x) (y)\n      ( id-hom A x)\n      ( f)\n      ( f)\n      ( id-comp-witness A x y f)\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#associativity","title":"Associativity","text":"

We now prove that composition in a Segal type is associative, by using the fact that the type of arrows in a Segal type is itself a Segal type.

\u2022 \u2022 \u2022 \u2022

#def unfolding-square\n( A : U)\n( triangle : \u0394\u00b2 \u2192 A)\n  : \u0394\u00b9\u00d7\u0394\u00b9 \u2192 A\n  :=\n    \\ (t , s) \u2192\nrecOR\n      ( t \u2264 s \u21a6 triangle (s , t) ,\n        s \u2264 t \u21a6 triangle (t , s))\n

For use in the proof of associativity:

x y z y f g comp-is-segal g f

#def witness-square-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : \u0394\u00b9\u00d7\u0394\u00b9 \u2192 A\n  := unfolding-square A (witness-comp-is-segal A is-segal-A x y z f g)\n

The witness-square-comp-is-segal as an arrow in the arrow type:

x y z y f g

#def arr-in-arr-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : hom (arr A) f g\n  := \\ t s \u2192 witness-square-comp-is-segal A is-segal-A x y z f g (t , s)\n

w x x y y z f g h

#def witness-asociative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom2 (arr A) f g h\n      (arr-in-arr-is-segal A is-segal-A w x y f g)\n      (arr-in-arr-is-segal A is-segal-A x y z g h)\n      (comp-is-segal (arr A) (is-segal-arr A is-segal-A)\n      f g h\n      (arr-in-arr-is-segal A is-segal-A w x y f g)\n      (arr-in-arr-is-segal A is-segal-A x y z g h))\n  :=\n    witness-comp-is-segal\n      ( arr A)\n      ( is-segal-arr A is-segal-A)\n      f g h\n      ( arr-in-arr-is-segal A is-segal-A w x y f g)\n      ( arr-in-arr-is-segal A is-segal-A x y z g h)\n

w x y z g f h

The witness-associative-is-segal curries to define a diagram \\(\u0394\u00b2\u00d7\u0394\u00b9 \u2192 A\\). The tetrahedron-associative-is-segal is extracted via the middle-simplex map \\(((t , s) , r) \u21a6 ((t , r) , s)\\) from \\(\u0394\u00b3\\) to \\(\u0394\u00b2\u00d7\u0394\u00b9\\).

#def tetrahedron-associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : \u0394\u00b3 \u2192 A\n  :=\n    \\ ((t , s) , r) \u2192\n    (witness-asociative-is-segal A is-segal-A w x y z f g h) (t , r) s\n

w x y z g f h

The diagonal composite of three arrows extracted from the tetrahedron-associative-is-segal.

#def triple-comp-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom A w z\n  :=\n\\ t \u2192\n    tetrahedron-associative-is-segal A is-segal-A w x y z f g h\n      ( (t , t) , t)\n

w x y z g f h

#def left-witness-asociative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom2 A w y z\n    (comp-is-segal A is-segal-A w x y f g)\n    h\n    (triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    \\ (t , s) \u2192\n    tetrahedron-associative-is-segal A is-segal-A w x y z f g h\n      ( (t , t) , s)\n

The front face:

w x y z g f h

#def right-witness-asociative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : hom2 A w x z\n    ( f)\n    ( comp-is-segal A is-segal-A x y z g h)\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    \\ (t , s) \u2192\n    tetrahedron-associative-is-segal A is-segal-A w x y z f g h\n      ( (t , s) , s)\n
#def left-associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : ( comp-is-segal A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h) =\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    uniqueness-comp-is-segal\n      A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h\n      ( triple-comp-is-segal A is-segal-A w x y z f g h)\n      ( left-witness-asociative-is-segal A is-segal-A w x y z f g h)\n#def right-associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : ( comp-is-segal A is-segal-A w x z f (comp-is-segal A is-segal-A x y z g h)) =\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n  :=\n    uniqueness-comp-is-segal\n      ( A) (is-segal-A) (w) (x) (z) (f) (comp-is-segal A is-segal-A x y z g h)\n      ( triple-comp-is-segal A is-segal-A w x y z f g h)\n      ( right-witness-asociative-is-segal A is-segal-A w x y z f g h)\n

We conclude that Segal composition is associative.

RS17, Proposition 5.9
#def associative-is-segal uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( w x y z : A)\n( f : hom A w x)\n( g : hom A x y)\n( h : hom A y z)\n  : ( comp-is-segal A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h) =\n    ( comp-is-segal A is-segal-A w x z f (comp-is-segal A is-segal-A x y z g h))\n  :=\n    zig-zag-concat\n    ( hom A w z)\n    ( comp-is-segal A is-segal-A w y z (comp-is-segal A is-segal-A w x y f g) h)\n    ( triple-comp-is-segal A is-segal-A w x y z f g h)\n    ( comp-is-segal A is-segal-A w x z f (comp-is-segal A is-segal-A x y z g h))\n    ( left-associative-is-segal A is-segal-A w x y z f g h)\n    ( right-associative-is-segal A is-segal-A w x y z f g h)\n#def postcomp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (z : A) \u2192 (hom A z x) \u2192 (hom A z y)\n  := \\ z g \u2192 comp-is-segal A is-segal-A z x y g f\n#def precomp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (z : A) \u2192 (hom A y z) \u2192 (hom A x z)\n  := \\ z \u2192 comp-is-segal A is-segal-A x y z f\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#homotopies","title":"Homotopies","text":"

We may define a \"homotopy\" to be a path between parallel arrows. In a Segal type, homotopies are equivalent to terms in hom2 types involving an identity arrow.

#def map-hom2-homotopy\n( A : U)\n( x y : A)\n( f g : hom A x y)\n  : (f = g) \u2192 (hom2 A x x y (id-hom A x) f g)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192 (hom2 A x x y (id-hom A x) f g'))\n      ( id-comp-witness A x y f)\n      ( g)\n#def map-total-hom2-homotopy\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : ( \u03a3 (g : hom A x y) , (f = g)) \u2192\n( \u03a3 (g : hom A x y) , (hom2 A x x y (id-hom A x) f g))\n  := \\ (g , p) \u2192 (g , map-hom2-homotopy A x y f g p)\n#def is-equiv-map-total-hom2-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : is-equiv\n( \u03a3 (g : hom A x y) , f = g)\n( \u03a3 (g : hom A x y) , (hom2 A x x y (id-hom A x) f g))\n      ( map-total-hom2-homotopy A x y f)\n  :=\n    is-equiv-are-contr\n( \u03a3 (g : hom A x y) , (f = g))\n( \u03a3 (g : hom A x y) , (hom2 A x x y (id-hom A x) f g))\n      ( is-contr-based-paths (hom A x y) f)\n      ( is-segal-A x x y (id-hom A x) f)\n      ( map-total-hom2-homotopy A x y f)\n
RS17, Proposition 5.10
#def equiv-homotopy-hom2-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f h : hom A x y)\n  : Equiv (f = h) (hom2 A x x y (id-hom A x) f h)\n  :=\n    ( ( map-hom2-homotopy A x y f h) ,\n      ( total-equiv-family-of-equiv\n        ( hom A x y)\n        ( \\ k \u2192 (f = k))\n        ( \\ k \u2192 (hom2 A x x y (id-hom A x) f k))\n        ( map-hom2-homotopy A x y f)\n        ( is-equiv-map-total-hom2-homotopy-is-segal A is-segal-A x y f)\n        ( h)))\n

A dual notion of homotopy can be defined similarly.

#def map-hom2-homotopy'\n( A : U)\n( x y : A)\n( f g : hom A x y)\n( p : f = g)\n  : (hom2 A x y y f (id-hom A y) g)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192 (hom2 A x y y f (id-hom A y) g'))\n      ( comp-id-witness A x y f)\n      ( g)\n      ( p)\n#def map-total-hom2-homotopy'\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : ( \u03a3 (g : hom A x y) , (f = g)) \u2192\n( \u03a3 (g : hom A x y) , (hom2 A x y y f (id-hom A y) g))\n  := \\ (g , p) \u2192 (g , map-hom2-homotopy' A x y f g p)\n#def is-equiv-map-total-hom2-homotopy'-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : is-equiv\n( \u03a3 (g : hom A x y) , f = g)\n( \u03a3 (g : hom A x y) , (hom2 A x y y f (id-hom A y) g))\n      ( map-total-hom2-homotopy' A x y f)\n  :=\n    is-equiv-are-contr\n( \u03a3 (g : hom A x y) , (f = g))\n( \u03a3 (g : hom A x y) , (hom2 A x y y f (id-hom A y) g))\n      ( is-contr-based-paths (hom A x y) f)\n      ( is-segal-A x y y f (id-hom A y))\n      ( map-total-hom2-homotopy' A x y f)\n
RS17, Proposition 5.10
#def equiv-homotopy-hom2'-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f h : hom A x y)\n  : Equiv (f = h) (hom2 A x y y f (id-hom A y) h)\n  :=\n    ( ( map-hom2-homotopy' A x y f h) ,\n      ( total-equiv-family-of-equiv\n        ( hom A x y)\n        ( \\ k \u2192 (f = k))\n        ( \\ k \u2192 (hom2 A x y y f (id-hom A y) k))\n        ( map-hom2-homotopy' A x y f)\n        ( is-equiv-map-total-hom2-homotopy'-is-segal A is-segal-A x y f)\n        ( h)))\n

More generally, a homotopy between a composite and another map is equivalent to the data provided by a commutative triangle with that boundary.

#def map-hom2-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n( p : (comp-is-segal A is-segal-A x y z f g) = h)\n  : ( hom2 A x y z f g h)\n  :=\n    ind-path\n      ( hom A x z)\n      ( comp-is-segal A is-segal-A x y z f g)\n      ( \\ h' p' \u2192 hom2 A x y z f g h')\n      ( witness-comp-is-segal A is-segal-A x y z f g)\n      ( h)\n      ( p)\n#def map-total-hom2-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : ( \u03a3 (h : hom A x z) , (comp-is-segal A is-segal-A x y z f g) = h) \u2192\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n  := \\ (h , p) \u2192 (h , map-hom2-eq-is-segal A is-segal-A x y z f g h p)\n#def is-equiv-map-total-hom2-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : is-equiv\n( \u03a3 (h : hom A x z) , (comp-is-segal A is-segal-A x y z f g) = h)\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n      ( map-total-hom2-eq-is-segal A is-segal-A x y z f g)\n  :=\n    is-equiv-are-contr\n( \u03a3 (h : hom A x z) , (comp-is-segal A is-segal-A x y z f g) = h)\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n      ( is-contr-based-paths (hom A x z) (comp-is-segal A is-segal-A x y z f g))\n      ( is-segal-A x y z f g)\n      ( map-total-hom2-eq-is-segal A is-segal-A x y z f g)\n
RS17, Proposition 5.12
#def equiv-hom2-eq-comp-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( k : hom A x z)\n  : Equiv ((comp-is-segal A is-segal-A x y z f g) = k) (hom2 A x y z f g k)\n  :=\n    ( ( map-hom2-eq-is-segal A is-segal-A x y z f g k) ,\n      ( total-equiv-family-of-equiv\n        ( hom A x z)\n        ( \\ m \u2192 (comp-is-segal A is-segal-A x y z f g) = m)\n        ( hom2 A x y z f g)\n        ( map-hom2-eq-is-segal A is-segal-A x y z f g)\n        ( is-equiv-map-total-hom2-eq-is-segal A is-segal-A x y z f g)\n        ( k)))\n

Homotopies form a congruence, meaning that homotopies are respected by composition:

RS17, Proposition 5.13
#def congruence-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f g : hom A x y)\n( h k : hom A y z)\n( p : f = g)\n( q : h = k)\n  : ( comp-is-segal A is-segal-A x y z f h) =\n    ( comp-is-segal A is-segal-A x y z g k)\n  :=\n    ind-path\n      ( hom A y z)\n      ( h)\n      ( \\ k' q' \u2192\n        ( comp-is-segal A is-segal-A x y z f h) =\n        ( comp-is-segal A is-segal-A x y z g k'))\n      ( ind-path\n        ( hom A x y)\n        ( f)\n        ( \\ g' p' \u2192\n          ( comp-is-segal A is-segal-A x y z f h) =\n          ( comp-is-segal A is-segal-A x y z g' h))\n        ( refl)\n        ( g)\n        ( p))\n      ( k)\n      ( q)\n

As a special case of the above:

#def postwhisker-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f g : hom A x y)\n( h : hom A y z)\n( p : f = g)\n  : ( comp-is-segal A is-segal-A x y z f h) = (comp-is-segal A is-segal-A x y z g h)\n  := congruence-homotopy-is-segal A is-segal-A x y z f g h h p refl\n

As a special case of the above:

#def prewhisker-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( w x y : A)\n( k : hom A w x)\n( f g : hom A x y)\n( p : f = g)\n  : ( comp-is-segal A is-segal-A w x y k f) =\n    ( comp-is-segal A is-segal-A w x y k g)\n  := congruence-homotopy-is-segal A is-segal-A w x y k k f g refl p\n
RS17, Proposition 5.14(a)
#def compute-postwhisker-homotopy-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( x y z : A)\n( f g : hom A x y)\n( h : hom A y z)\n( p : f = g)\n  : ( postwhisker-homotopy-is-segal A is-segal-A x y z f g h p) =\n    ( ap (hom A x y) (hom A x z) f g (\\ k \u2192 comp-is-segal A is-segal-A x y z k h) p)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192\n        ( postwhisker-homotopy-is-segal A is-segal-A x y z f g' h p') =\n        ( ap\n          (hom A x y) (hom A x z)\n          (f) (g') (\\ k \u2192 comp-is-segal A is-segal-A x y z k h) (p')))\n      ( refl)\n      ( g)\n      ( p)\n
RS17, Proposition 5.14(b)
#def prewhisker-homotopy-is-ap-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( w x y : A)\n( k : hom A w x)\n( f g : hom A x y)\n( p : f = g)\n  : ( prewhisker-homotopy-is-segal A is-segal-A w x y k f g p) =\n    ( ap (hom A x y) (hom A w y) f g (comp-is-segal A is-segal-A w x y k) p)\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' p' \u2192\n        ( prewhisker-homotopy-is-segal A is-segal-A w x y k f g' p') =\n        ( ap (hom A x y) (hom A w y) f g' (comp-is-segal A is-segal-A w x y k) p'))\n      ( refl)\n      ( g)\n      ( p)\n#section is-segal-Unit\n#def is-contr-Unit : is-contr Unit := (unit , \\ _ \u2192 refl)\n#def is-contr-\u0394\u00b2\u2192Unit uses (extext)\n  : is-contr (\u0394\u00b2 \u2192 Unit)\n  :=\n    ( \\ _ \u2192 unit ,\n\\ k \u2192\n      eq-ext-htpy extext\n        ( 2 \u00d7 2) \u0394\u00b2 (\\ _ \u2192 BOT)\n        ( \\ _ \u2192 Unit) (\\ _ \u2192 recBOT)\n        ( \\ _ \u2192 unit) k\n        ( \\ _ \u2192 refl))\n#def is-segal-Unit uses (extext)\n  : is-segal Unit\n  :=\n\\ x y z f g \u2192\n    is-contr-is-retract-of-is-contr\n( \u03a3 (h : hom Unit x z) , (hom2 Unit x y z f g h))\n      ( \u0394\u00b2 \u2192 Unit)\n      ( ( \\ (_ , k) \u2192 k) ,\n        ( \\ k \u2192 ((\\ t \u2192 k (t , t)) , k) , \\ _ \u2192 refl))\n      ( is-contr-\u0394\u00b2\u2192Unit)\n#end is-segal-Unit\n

Interchange law

#section homotopy-interchange-law\n#variable A : U\n#variable is-segal-A : is-segal A\n#variables x y z : A\n#def homotopy-interchange-law-statement\n( f1 f2 f3 : hom A x y)\n( h1 h2 h3 : hom A y z)\n( p : f1 = f2)\n( q : f2 = f3)\n( p' : h1 = h2)\n( q' : h2 = h3)\n  : U\n  := congruence-homotopy-is-segal A is-segal-A x y z f1 f3 h1 h3\n      ( concat (hom A x y) f1 f2 f3 p q)\n      ( concat (hom A y z) h1 h2 h3 p' q') =\n    concat\n      ( hom A x z)\n      ( comp-is-segal A is-segal-A x y z f1 h1)\n      ( comp-is-segal A is-segal-A x y z f2 h2)\n      ( comp-is-segal A is-segal-A x y z f3 h3)\n      ( congruence-homotopy-is-segal A is-segal-A x y z f1 f2 h1 h2 p p')\n      ( congruence-homotopy-is-segal A is-segal-A x y z f2 f3 h2 h3 q q')\n
RS17, Proposition 5.15
#def homotopy-interchange-law\n( f1 f2 f3 : hom A x y)\n( h1 h2 h3 : hom A y z)\n( p : f1 = f2)\n( q : f2 = f3)\n( p' : h1 = h2)\n( q' : h2 = h3)\n  : homotopy-interchange-law-statement f1 f2 f3 h1 h2 h3 p q p' q'\n  := ind-path\n    ( hom A x y)\n    ( f2)\n    ( \\ f3 q -> homotopy-interchange-law-statement f1 f2 f3 h1 h2 h3 p q p' q')\n    ( ind-path\n      ( hom A x y)\n      ( f1)\n      ( \\ f2 p -> homotopy-interchange-law-statement f1 f2 f2 h1 h2 h3\n          p refl p' q')\n      ( ind-path\n        ( hom A y z)\n        ( h2)\n        ( \\ h3 q' -> homotopy-interchange-law-statement f1 f1 f1 h1 h2 h3\nrefl refl p' q')\n        ( ind-path\n          ( hom A y z)\n          ( h1)\n          ( \\ h2 p' -> homotopy-interchange-law-statement f1 f1 f1 h1 h2 h2\nrefl refl p' refl)\n          ( refl)\n          ( h2)\n          ( p'))\n        ( h3)\n        ( q'))\n      ( f2)\n      ( p))\n    ( f3)\n    ( q)\n#end homotopy-interchange-law\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#inner-anodyne-maps","title":"Inner anodyne maps","text":"RS17, Definition 5.19
#def is-inner-anodyne\n(I : CUBE)\n(\u03c8 : I \u2192 TOPE)\n(\u03a6 : \u03c8 \u2192 TOPE)\n  : U\n  := (A : U) \u2192 is-segal A \u2192 (h : \u03a6 \u2192 A) \u2192 is-contr ((t : \u03c8) \u2192 A[ \u03a6 t \u21a6 h t ])\n

The cofibration \u039b\u00b2\u2081 \u2192 \u0394\u00b2 is inner anodyne

#def is-inner-anodyne-\u039b\u00b2\u2081\n  : is-inner-anodyne (2 \u00d7 2) \u0394\u00b2 \u039b\u00b2\u2081\n  := \\ A is-segal-A h' \u2192\n    equiv-with-contractible-domain-implies-contractible-codomain\n( \u03a3 (h : hom A (h' (0\u2082,0\u2082)) (h' (1\u2082,1\u2082))) ,\n          (hom2 A (h' (0\u2082,0\u2082)) (h' (1\u2082,0\u2082)) (h' (1\u2082,1\u2082))\n          (\\ t \u2192 h' (t,0\u2082)) (\\ s \u2192 h' (1\u2082,s)) h))\n( (t : \u0394\u00b2) \u2192 A [\u039b t \u21a6 h' t])\n      (compositions-are-horn-fillings\n        A (h' (0\u2082,0\u2082)) (h' (1\u2082,0\u2082)) (h' (1\u2082,1\u2082))\n          (\\ t \u2192 h' (t,0\u2082)) (\\ s \u2192 h' (1\u2082,s)))\n      (is-segal-A (h' (0\u2082,0\u2082)) (h' (1\u2082,0\u2082)) (h' (1\u2082,1\u2082))\n          (\\ t \u2192 h' (t,0\u2082)) (\\ s \u2192 h' (1\u2082,s)))\n
RS17, lemma 5.20
#def is-inner-anodyne-pushout-product-left-is-inner-anodyne uses (weakextext)\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03a6 : \u03c8 \u2192 TOPE)\n(is-inner-anodyne-\u03c8-\u03a6 : is-inner-anodyne I \u03c8 \u03a6)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n  : is-inner-anodyne (I \u00d7 J)\n      (\\ (t,s) \u2192 \u03c8 t \u2227 \u03b6 s)\n      (\\ (t,s) \u2192 (\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s))\n  := \\ A is-segal-A h \u2192\n    equiv-with-contractible-codomain-implies-contractible-domain\n      (((t,s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192 A[(\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 h (t,s)])\n( (s : \u03b6) \u2192 ((t : \u03c8) \u2192 A[ \u03a6 t \u21a6 h (t,s)])[ \u03c7 s \u21a6 \\ t \u2192 h (t, s)])\n      (uncurry-opcurry I J \u03c8 \u03a6 \u03b6 \u03c7 (\\ s t \u2192 A) h)\n      (weakextext\n        ( J)\n        ( \u03b6)\n        ( \u03c7)\n( \\ s \u2192 (t : \u03c8) \u2192 A[ \u03a6 t \u21a6 h (t,s)])\n        ( \\ s \u2192 is-inner-anodyne-\u03c8-\u03a6 A is-segal-A (\\ t \u2192 h (t,s)))\n        ( \\ s t \u2192 h (t,s)))\n#def is-inner-anodyne-pushout-product-right-is-inner-anodyne uses (weakextext)\n( I J : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( \u03a6 : \u03c8 \u2192 TOPE)\n( \u03b6 : J \u2192 TOPE)\n( \u03c7 : \u03b6 \u2192 TOPE)\n(is-inner-anodyne-\u03b6-\u03c7 : is-inner-anodyne J \u03b6 \u03c7)\n  : is-inner-anodyne (I \u00d7 J)\n      (\\ (t,s) \u2192 \u03c8 t \u2227 \u03b6 s)\n      (\\ (t,s) \u2192 (\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s))\n  := \\ A is-segal-A h \u2192\n    equiv-with-contractible-domain-implies-contractible-codomain\n( (t : \u03c8) \u2192 ((s : \u03b6) \u2192 A[ \u03c7 s \u21a6 h (t,s)])[ \u03a6 t \u21a6 \\ s \u2192 h (t, s)])\n      (((t,s) : I \u00d7 J | \u03c8 t \u2227 \u03b6 s) \u2192 A[(\u03a6 t \u2227 \u03b6 s) \u2228 (\u03c8 t \u2227 \u03c7 s) \u21a6 h (t,s)])\n      (curry-uncurry I J \u03c8 \u03a6 \u03b6 \u03c7 (\\ s t \u2192 A) h)\n      (weakextext\n        ( I)\n        ( \u03c8)\n        ( \u03a6)\n( \\ t \u2192 (s : \u03b6) \u2192 A[ \u03c7 s \u21a6 h (t,s)])\n        ( \\ t \u2192 is-inner-anodyne-\u03b6-\u03c7 A is-segal-A (\\ s \u2192 h (t,s)))\n        ( \\ s t \u2192 h (s,t)))\n
RS17, lemma 5.21
#section retraction-\u039b\u00b3\u2082-\u0394\u00b3-pushout-product-\u039b\u00b2\u2081-\u0394\u00b2\n-- \u0394\u00b3\u00d7\u039b\u00b2\u2081 \u222a_{\u039b\u00b3\u2082\u00d7\u039b\u00b2\u2081} \u039b\u00b3\u2082\u00d7\u0394\u00b2\n#def pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081\n  : (\u0394\u00b3\u00d7\u0394\u00b2) \u2192 TOPE\n  := shape-pushout-prod (2 \u00d7 2 \u00d7 2) (2 \u00d7 2) \u0394\u00b3 \u039b\u00b3\u2082 \u0394\u00b2 \u039b\u00b2\u2081\n#variable A : U\n#variable h : \u039b\u00b3\u2082 \u2192 A\n#def h^\n  : pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081 \u2192 A\n  := \\ ( ((t1, t2), t3), (s1, s2) ) \u2192\nrecOR\n      ( s1 \u2264 t1 \u2227 t2 \u2264 s2 \u21a6 h ((t1, t2), t3),\n        t1 \u2264 s1 \u2227 t2 \u2264 s2 \u21a6 h ((s1, t2), t3),\n        s1 \u2264 t1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 h ((t1, s2), t3),\n        t1 \u2264 s1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 h ((s1, s2), t3),\n        s1 \u2264 t1 \u2227 s2 \u2264 t3 \u21a6 h ((t1, s2), s2),\n        t1 \u2264 s1 \u2227 s2 \u2264 t3 \u21a6 h ((s1, s2), s2))\n#def extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n  : U\n  := (t : \u0394\u00b3) \u2192 A[ \u039b\u00b3\u2082 t \u21a6 h t ]\n#def extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (h)\n  : U\n  := (x : \u0394\u00b3\u00d7\u0394\u00b2) \u2192 A[ pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081 x \u21a6 h^ x]\n#def retract-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n(f : extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2)\n  : extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n  := \\ ((t1, t2), t3) \u2192 f ( ((t1, t2), t3), (t1, t2) )\n#def section-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n(g : (t : \u0394\u00b3) \u2192 A[ \u039b\u00b3\u2082 t \u21a6 h t ])\n  : (x : \u0394\u00b3\u00d7\u0394\u00b2) \u2192 A[ pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081 x \u21a6 h^ x]\n  :=\n    \\ ( ((t1, t2), t3), (s1, s2) ) \u2192\nrecOR\n      ( s1 \u2264 t1 \u2227 t2 \u2264 s2 \u21a6 g ((t1, t2), t3),\n        t1 \u2264 s1 \u2227 t2 \u2264 s2 \u21a6 g ((s1, t2), t3),\n        s1 \u2264 t1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 g ((t1, s2), t3),\n        t1 \u2264 s1 \u2227 t3 \u2264 s2 \u2227 s2 \u2264 t2 \u21a6 g ((s1, s2), t3),\n        s1 \u2264 t1 \u2227 s2 \u2264 t3 \u21a6 g ((t1, s2), s2),\n        t1 \u2264 s1 \u2227 s2 \u2264 t3 \u21a6 g ((s1, s2), s2))\n#def homotopy-retraction-section-id-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n  : homotopy extend-against-\u039b\u00b3\u2082-\u0394\u00b3 extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n    ( comp\n      ( extend-against-\u039b\u00b3\u2082-\u0394\u00b3)\n      ( extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2)\n      ( extend-against-\u039b\u00b3\u2082-\u0394\u00b3)\n      ( retract-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2)\n      ( section-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2))\n    ( identity extend-against-\u039b\u00b3\u2082-\u0394\u00b3)\n  := \\ t \u2192 refl\n#def is-retract-of-\u0394\u00b3-\u0394\u00b3\u00d7\u0394\u00b2 uses (A h)\n  : is-retract-of\n      extend-against-\u039b\u00b3\u2082-\u0394\u00b3\n      extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2\n  :=\n    ( section-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 ,\n      ( retract-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 ,\n        homotopy-retraction-section-id-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2))\n#end retraction-\u039b\u00b3\u2082-\u0394\u00b3-pushout-product-\u039b\u00b2\u2081-\u0394\u00b2\n#def is-inner-anodyne-\u0394\u00b3-\u039b\u00b3\u2082 uses (weakextext)\n  : is-inner-anodyne (2 \u00d7 2 \u00d7 2) \u0394\u00b3 \u039b\u00b3\u2082\n  :=\n\\ A is-segal-A h \u2192\n    is-contr-is-retract-of-is-contr\n      (extend-against-\u039b\u00b3\u2082-\u0394\u00b3 A h)\n      (extend-against-pushout-prod-\u039b\u00b3\u2082-\u039b\u00b2\u2081-\u0394\u00b3\u00d7\u0394\u00b2 A h)\n      (is-retract-of-\u0394\u00b3-\u0394\u00b3\u00d7\u0394\u00b2 A h)\n      (is-inner-anodyne-pushout-product-right-is-inner-anodyne\n        ( 2 \u00d7 2 \u00d7 2)\n        ( 2 \u00d7 2)\n        ( \u0394\u00b3)\n        ( \u039b\u00b3\u2082)\n        ( \u0394\u00b2)\n        ( \u039b\u00b2\u2081)\n        ( is-inner-anodyne-\u039b\u00b2\u2081)\n        ( A)\n        ( is-segal-A)\n        ( h^ A h))\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#inner-fibrations","title":"Inner fibrations","text":"

An inner fibration is a map \u03b1 : A' \u2192 A which is right orthogonal to \u039b \u2282 \u0394\u00b2. This is the relative notion of a Segal type.

#def is-inner-fibration\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n  : U\n  := is-right-orthogonal-to-shape (2 \u00d7 2) \u0394\u00b2 (\\ t \u2192 \u039b t) A' A \u03b1\n
"},{"location":"simplicial-hott/05-segal-types.rzk/#products-of-segal-types","title":"Products of Segal Types","text":"

This is an additional section which describes morphisms in products of types as products of morphisms. It is implicitly stated in Proposition 8.21.

#section morphisms-of-products-is-products-of-morphisms\n#variables A B : U\n#variable p : ( product A B )\n#variable p' : ( product A B )\n#def morphism-in-product-to-product-of-morphism\n  : hom ( product A B ) p p' \u2192\n    product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) )\n  :=  \\ f \u2192 ( \\ ( t : \u0394\u00b9 ) \u2192 first ( f t ) , \\ ( t : \u0394\u00b9 ) \u2192 second ( f t ) )\n#def product-of-morphism-to-morphism-in-product\n  : product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) ) \u2192\n    hom ( product A B ) p p'\n  := \\ ( f , g ) ( t : \u0394\u00b9 ) \u2192 ( f t , g t )\n#def morphisms-in-product-to-product-of-morphism-to-morphism-in-product-is-id\n  : ( f :  product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) ) ) \u2192\n    ( morphism-in-product-to-product-of-morphism )\n    ( ( product-of-morphism-to-morphism-in-product )\n      f ) = f\n  := \\ f \u2192 refl\n#def product-of-morphism-to-morphisms-in-product-to-product-of-morphism-is-id\n  : ( f :  hom ( product A B ) p p' ) \u2192\n    ( product-of-morphism-to-morphism-in-product )\n    ( ( morphism-in-product-to-product-of-morphism )\n      f ) = f\n  := \\ f \u2192 refl\n#def morphism-in-product-equiv-product-of-morphism\n  : Equiv\n    ( hom ( product A B ) p p' )\n    ( product ( hom A ( first p ) ( first p' ) ) ( hom B ( second p ) ( second p' ) ) )\n  :=\n    ( ( morphism-in-product-to-product-of-morphism ) ,\n      ( ( ( product-of-morphism-to-morphism-in-product ) ,\n          ( product-of-morphism-to-morphisms-in-product-to-product-of-morphism-is-id ) ) ,\n        ( ( product-of-morphism-to-morphism-in-product ) ,\n          ( morphisms-in-product-to-product-of-morphism-to-morphism-in-product-is-id ) ) ) )\n#end morphisms-of-products-is-products-of-morphisms\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/","title":"The 2-category of Segal types","text":"

These formalisations correspond to Section 6 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#functors","title":"Functors","text":"

Functions between types induce an action on hom types, preserving sources and targets. The action is called ap-hom to avoid conflicting with ap.

RS17, Section 6.1
#def ap-hom\n( A B : U)\n( F : A \u2192 B)\n( x y : A)\n( f : hom A x y)\n  : hom B (F x) (F y)\n  := \\ t \u2192 F (f t)\n#def ap-hom2\n( A B : U)\n( F : A \u2192 B)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n(\u03b1 : hom2 A x y z f g h)\n  : hom2 B (F x) (F y) (F z)\n    ( ap-hom A B F x y f) (ap-hom A B F y z g) (ap-hom A B F x z h)\n  := \\ t \u2192 F (\u03b1 t)\n

Functions between types automatically preserve identity arrows. Preservation of identities follows from extension extensionality because these arrows are pointwise equal.

RS17, Proposition 6.1.a
#def functors-pres-id uses (extext)\n( A B : U)\n( F : A \u2192 B)\n( x : A)\n  : ( ap-hom A B F x x (id-hom A x)) = (id-hom B (F x))\n  :=\n    eq-ext-htpy\n      ( extext)\n      ( 2)\n      ( \u0394\u00b9)\n      ( \u2202\u0394\u00b9)\n      ( \\ t \u2192 B)\n      ( \\ t \u2192 recOR (t \u2261 0\u2082 \u21a6 F x , t \u2261 1\u2082 \u21a6 F x))\n      ( ap-hom A B F x x (id-hom A x))\n      ( id-hom B (F x))\n      ( \\ t \u2192 refl)\n

Preservation of composition requires the Segal hypothesis.

RS17, Proposition 6.1.b
#def functors-pres-comp\n( A B : U)\n( is-segal-A : is-segal A)\n( is-segal-B : is-segal B)\n( F : A \u2192 B)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  :\n    ( comp-is-segal B is-segal-B\n      ( F x) (F y) (F z)\n      ( ap-hom A B F x y f)\n      ( ap-hom A B F y z g))\n    =\n    ( ap-hom A B F x z (comp-is-segal A is-segal-A x y z f g))\n  :=\n    uniqueness-comp-is-segal B is-segal-B\n      ( F x) (F y) (F z)\n      ( ap-hom A B F x y f)\n      ( ap-hom A B F y z g)\n      ( ap-hom A B F x z (comp-is-segal A is-segal-A x y z f g))\n      ( ap-hom2 A B F x y z f g\n        ( comp-is-segal A is-segal-A x y z f g)\n        ( witness-comp-is-segal A is-segal-A x y z f g))\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#natural-transformations","title":"Natural transformations","text":"

Given two simplicial maps f g : (x : A) \u2192 B x , a natural transformation from f to g is an arrow \u03b7 : hom ((x : A) \u2192 B x) f g between them.

RS17, Definition 6.2
#def nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : U\n  := hom ((x : A) \u2192 (B x)) f g\n

Equivalently , natural transformations can be determined by their components , i.e. as a family of arrows (x : A) \u2192 hom (B x) (f x) (g x).

#def nat-trans-components\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : U\n  := ( x : A) \u2192 hom (B x) (f x) (g x)\n
#def ev-components-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans A B f g)\n  : nat-trans-components A B f g\n  := \\ x t \u2192 \u03b7 t x\n#def nat-trans-nat-trans-components\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans-components A B f g)\n  : nat-trans A B f g\n  := \\ t x \u2192 \u03b7 x t\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#natural-transformation-extensionality","title":"Natural transformation extensionality","text":"RS17, Proposition 6.3
#def is-equiv-ev-components-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : is-equiv\n      ( nat-trans A B f g)\n      ( nat-trans-components A B f g)\n      ( ev-components-nat-trans A B f g)\n  :=\n    ( ( \\ \u03b7 t x \u2192 \u03b7 x t , \\ _ \u2192 refl) ,\n      ( \\ \u03b7 t x \u2192 \u03b7 x t , \\ _ \u2192 refl))\n#def equiv-components-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f g : (x : A) \u2192 (B x))\n  : Equiv (nat-trans A B f g) (nat-trans-components A B f g)\n  :=\n    ( ev-components-nat-trans A B f g ,\n      is-equiv-ev-components-nat-trans A B f g)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#naturality-square","title":"Naturality square","text":"

Natural transformations are automatically natural when the codomain is a Segal type.

RS17, Proposition 6.6
#section comp-eq-square-is-segal\n#variable A : U\n#variable is-segal-A : is-segal A\n#variable \u03b1 : (\u0394\u00b9\u00d7\u0394\u00b9) \u2192 A\n#def \u03b100 : A := \u03b1 (0\u2082,0\u2082)\n#def \u03b101 : A := \u03b1 (0\u2082,1\u2082)\n#def \u03b110 : A := \u03b1 (1\u2082,0\u2082)\n#def \u03b111 : A := \u03b1 (1\u2082,1\u2082)\n#def \u03b10* : \u0394\u00b9 \u2192 A := \\ t \u2192 \u03b1 (0\u2082,t)\n#def \u03b11* : \u0394\u00b9 \u2192 A := \\ t \u2192 \u03b1 (1\u2082,t)\n#def \u03b1*0 : \u0394\u00b9 \u2192 A := \\ s \u2192 \u03b1 (s,0\u2082)\n#def \u03b1*1 : \u0394\u00b9 \u2192 A := \\ s \u2192 \u03b1 (s,1\u2082)\n#def \u03b1-diag : \u0394\u00b9 \u2192 A := \\ s \u2192 \u03b1 (s,s)\n#def lhs uses (\u03b1) : \u0394\u00b9 \u2192 A := comp-is-segal A is-segal-A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1\n#def rhs uses (\u03b1) : \u0394\u00b9 \u2192 A := comp-is-segal A is-segal-A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11*\n#def lower-triangle-square : hom2 A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1 \u03b1-diag\n  := \\ (s, t) \u2192 \u03b1 (t,s)\n#def upper-triangle-square : hom2 A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11* \u03b1-diag\n  := \\ (s,t) \u2192 \u03b1 (s,t)\n#def comp-eq-square-is-segal uses (\u03b1)\n  : comp-is-segal A is-segal-A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1 =\n    comp-is-segal A is-segal-A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11*\n  :=\n    zig-zag-concat (hom A \u03b100 \u03b111) lhs \u03b1-diag rhs\n    ( uniqueness-comp-is-segal A is-segal-A \u03b100 \u03b101 \u03b111 \u03b10* \u03b1*1 \u03b1-diag\n      ( lower-triangle-square))\n    ( uniqueness-comp-is-segal A is-segal-A \u03b100 \u03b110 \u03b111 \u03b1*0 \u03b11* \u03b1-diag\n      ( upper-triangle-square))\n#end comp-eq-square-is-segal\n

We now extract a naturality square from a natural transformation whose codomain is a Segal type.

RS17, Proposition 6.6
#def naturality-nat-trans-is-segal\n(A B : U)\n(is-segal-B : is-segal B)\n(f g : A \u2192 B)\n(\u03b1 : nat-trans A (\\ _ \u2192 B) f g)\n(x y : A)\n(k : hom A x y)\n  : comp-is-segal B is-segal-B (f x) (f y) (g y)\n    ( ap-hom A B f x y k)\n    ( \\ s \u2192 \u03b1 s y) =\n    comp-is-segal B is-segal-B (f x) (g x) (g y)\n    ( \\ s \u2192 \u03b1 s x)\n    ( ap-hom A B g x y k)\n  := comp-eq-square-is-segal B is-segal-B (\\ (s,t) \u2192 \u03b1 s (k t))\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#vertical-composition","title":"Vertical composition","text":"

We can define vertical composition for natural transformations in families of Segal types.

#def vertical-comp-nat-trans-components\n( A : U)\n( B : A \u2192 U)\n( is-segal-B : (x : A) \u2192 is-segal (B x))\n( f g h : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans-components A B f g)\n( \u03b7' : nat-trans-components A B g h)\n  : nat-trans-components A B f h\n  := \\ x \u2192 comp-is-segal (B x) (is-segal-B x) (f x) (g x) (h x) (\u03b7 x) (\u03b7' x)\n#def vertical-comp-nat-trans\n( A : U)\n( B : A \u2192 U)\n( is-segal-B : (x : A) \u2192 is-segal (B x))\n( f g h : (x : A) \u2192 (B x))\n( \u03b7 : nat-trans A B f g)\n( \u03b7' : nat-trans A B g h)\n  : nat-trans A B f h\n  :=\n\\ t x \u2192\n    vertical-comp-nat-trans-components A B is-segal-B f g h\n      ( \\ x' t' \u2192 \u03b7 t' x')\n      ( \\ x' t' \u2192 \u03b7' t' x')\n      ( x)\n      ( t)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#functoriality-of-evaluation-at-components","title":"Functoriality of evaluation at components","text":"

The components of the identity natural transformation are identity arrows.

RS17, Proposition 6.5(ii)
#def id-arr-components-id-nat-trans\n( A : U)\n( B : A \u2192 U)\n( f : (x : A) \u2192 (B x))\n( a : A)\n  : (ev-components-nat-trans A B f f (id-hom ((x : A) \u2192 B x) f)) a =\n    id-hom (B a) (f a)\n  := refl\n

When the fibers of a family of types B : A \u2192 U are Segal types, the components of the natural transformation defined by composing in the Segal type (x : A) \u2192 B x agree with the components defined by vertical composition.

RS17, Proposition 6.5(i)
#def comp-components-comp-nat-trans-is-segal uses (funext)\n( A : U)\n( B : A \u2192 U)\n( is-segal-B : (x : A) \u2192 is-segal (B x))\n( f g h : (x : A) \u2192 (B x))\n( \u03b1 : nat-trans A B f g)\n( \u03b2 : nat-trans A B g h)\n( a : A)\n  : ( comp-is-segal (B a) (is-segal-B a) (f a) (g a) (h a)\n      ( ev-components-nat-trans A B f g \u03b1 a)\n      ( ev-components-nat-trans A B g h \u03b2 a)) =\n( ev-components-nat-trans A B f h\n      ( comp-is-segal\n        ( (x : A) \u2192 B x) ( is-segal-function-type (funext) (A) (B) (is-segal-B))\n        ( f) (g) (h) (\u03b1) (\u03b2))) a\n  :=\n    functors-pres-comp\n( (x : A) \u2192 (B x)) (B a)\n    ( is-segal-function-type (funext) (A) (B) (is-segal-B)) (is-segal-B a)\n    ( \\ s \u2192 s a) (f) (g) (h) (\u03b1) (\u03b2)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#horizontal-composition","title":"Horizontal composition","text":"

Horizontal composition of natural transformations makes sense over any type. In particular , contrary to what is written in [RS17] we do not need C to be Segal.

#def horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : nat-trans A (\\ _ \u2192 C) (\\ x \u2192 f' (f x)) (\\ x \u2192 g' (g x))\n  := \\ t x \u2192 \u03b7' t (\u03b7 t x)\n#def horizontal-comp-nat-trans-components\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans-components A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans-components B (\\ _ \u2192 C) f' g')\n  : nat-trans-components A (\\ _ \u2192 C) (\\ x \u2192 f' (f x)) (\\ x \u2192 g' (g x))\n  := \\ x t \u2192 \u03b7' (\u03b7 x t) t\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#whiskering","title":"Whiskering","text":"

Whiskering is a special case of horizontal composition when one of the natural transformations is the identity.

#def postwhisker-nat-trans\n( B C D : U)\n( f g : B \u2192 C)\n( h : C \u2192 D)\n( \u03b7 : nat-trans B (\\ _ \u2192 C) f g)\n  : nat-trans B (\\ _ \u2192 D) (comp B C D h f) (comp B C D h g)\n  := horizontal-comp-nat-trans B C D f g h h \u03b7 (id-hom (C \u2192 D) h)\n#def prewhisker-nat-trans\n( A B C : U)\n( k : A \u2192 B)\n( f g : B \u2192 C)\n( \u03b7 : nat-trans B (\\ _ \u2192 C) f g)\n  : nat-trans A (\\ _ \u2192 C) (comp A B C f k) (comp A B C g k)\n  := horizontal-comp-nat-trans A B C k k f g (id-hom (A \u2192 B) k) \u03b7\n#def whisker-nat-trans\n( A B C D : U)\n( k : A \u2192 B)\n( f g : B \u2192 C)\n( h : C \u2192 D)\n( \u03b7 : nat-trans B (\\ _ \u2192 C) f g)\n  : nat-trans A (\\ _ \u2192 D)\n    ( triple-comp A B C D h f k)\n    ( triple-comp A B C D h g k)\n  :=\n    postwhisker-nat-trans A C D (comp A B C f k) (comp A B C g k) h\n    ( prewhisker-nat-trans A B C k f g \u03b7)\n
"},{"location":"simplicial-hott/06-2cat-of-segal-types.rzk/#gray-interchanger","title":"Gray interchanger","text":"

The horizontal composition operation also defines coherence data in the form of the \"Gray interchanger\" built from two commutative triangles.

#def gray-interchanger-horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : \u0394\u00b9\u00d7\u0394\u00b9 \u2192 (A \u2192 C)\n  := \\ (t, s) a \u2192 \u03b7' s (\u03b7 t a)\n#def left-gray-interchanger-horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : hom2 (A \u2192 C) (comp A B C f' f) (comp A B C f' g) (comp A B C g' g)\n    ( postwhisker-nat-trans A B C f g f' \u03b7)\n    ( prewhisker-nat-trans A B C g f' g' \u03b7')\n    ( horizontal-comp-nat-trans A B C f g f' g' \u03b7 \u03b7')\n  := \\ (t, s) a \u2192 \u03b7' s (\u03b7 t a)\n#def right-gray-interchanger-horizontal-comp-nat-trans\n( A B C : U)\n( f g : A \u2192 B)\n( f' g' : B \u2192 C)\n( \u03b7 : nat-trans A (\\ _ \u2192 B) f g)\n( \u03b7' : nat-trans B (\\ _ \u2192 C) f' g')\n  : hom2 (A \u2192 C) (comp A B C f' f) (comp A B C g' f) (comp A B C g' g)\n    ( prewhisker-nat-trans A B C f f' g' \u03b7')\n    ( postwhisker-nat-trans A B C f g g' \u03b7)\n    ( horizontal-comp-nat-trans A B C f g f' g' \u03b7 \u03b7')\n  := \\ (t, s) a \u2192 \u03b7' t (\u03b7 s a)\n
"},{"location":"simplicial-hott/07-discrete.rzk/","title":"Discrete types","text":"

These formalisations correspond to Section 7 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/07-discrete.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/07-discrete.rzk/#the-definition","title":"The definition","text":"

Discrete types are types in which the hom-types are canonically equivalent to identity types.

RS17, Definition 7.1
#def hom-eq\n( A : U)\n( x y : A)\n( p : x = y)\n  : hom A x y\n  := ind-path (A) (x) (\\ y' p' \u2192 hom A x y') ((id-hom A x)) (y) (p)\n#def is-discrete\n( A : U)\n  : U\n  := (x : A) \u2192 (y : A) \u2192 is-equiv (x = y) (hom A x y) (hom-eq A x y)\n
"},{"location":"simplicial-hott/07-discrete.rzk/#families-of-discrete-types","title":"Families of discrete types","text":"

By function extensionality, the dependent function type associated to a family of discrete types is discrete.

#def equiv-hom-eq-function-type-is-discrete uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-discrete-A : (x : X) \u2192 is-discrete (A x))\n( f g : (x : X) \u2192 A x)\n  : Equiv (f = g) (hom ((x : X) \u2192 A x) f g)\n  :=\n    equiv-triple-comp\n      ( f = g)\n( (x : X) \u2192 f x = g x)\n( (x : X) \u2192 hom (A x) (f x) (g x))\n( hom ((x : X) \u2192 A x) f g)\n      ( equiv-FunExt funext X A f g)\n      ( equiv-function-equiv-family funext X\n        ( \\ x \u2192 (f x = g x))\n        ( \\ x \u2192 hom (A x) (f x) (g x))\n        ( \\ x \u2192 (hom-eq (A x) (f x) (g x) , (is-discrete-A x (f x) (g x)))))\n      ( flip-ext-fun-inv\n        ( 2)\n        ( \u0394\u00b9)\n        ( \u2202\u0394\u00b9)\n        ( X)\n        ( \\ t x \u2192 A x)\n        ( \\ t x \u2192 recOR (t \u2261 0\u2082 \u21a6 f x , t \u2261 1\u2082 \u21a6 g x)))\n#def compute-hom-eq-function-type-is-discrete uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-discrete-A : (x : X) \u2192 is-discrete (A x))\n( f g : (x : X) \u2192 A x)\n( h : f = g)\n  : ( hom-eq ((x : X) \u2192 A x) f g h) =\n    ( first (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g)) h\n  :=\n    ind-path\n( (x : X) \u2192 A x)\n      ( f)\n( \\ g' h' \u2192\n        hom-eq ((x : X) \u2192 A x) f g' h' =\n        (first (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g')) h')\n      ( refl)\n      ( g)\n      ( h)\n
RS17, Proposition 7.2
#def is-discrete-function-type uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-discrete-A : (x : X) \u2192 is-discrete (A x))\n  : is-discrete ((x : X) \u2192 A x)\n  :=\n\\ f g \u2192\n    is-equiv-homotopy\n      ( f = g)\n( hom ((x : X) \u2192 A x) f g)\n( hom-eq ((x : X) \u2192 A x) f g)\n      ( first (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g))\n      ( compute-hom-eq-function-type-is-discrete X A is-discrete-A f g)\n      ( second (equiv-hom-eq-function-type-is-discrete X A is-discrete-A f g))\n

By extension extensionality, an extension type into a family of discrete types is discrete. Since equiv-extension-equiv-family considers total extension types only, extending from BOT, that's all we prove here for now.

#def equiv-hom-eq-extension-type-is-discrete uses (extext)\n( I : CUBE)\n( \u03c8 : I \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-discrete-A : (t : \u03c8) \u2192 is-discrete (A t))\n( f g : (t : \u03c8) \u2192 A t)\n  : Equiv (f = g) (hom ((t : \u03c8) \u2192 A t) f g)\n  :=\n    equiv-triple-comp\n      ( f = g)\n( (t : \u03c8) \u2192 f t = g t)\n( (t : \u03c8) \u2192 hom (A t) (f t) (g t))\n( hom ((t : \u03c8) \u2192 A t) f g)\n      ( equiv-ExtExt extext I \u03c8 (\\ _ \u2192 BOT) A (\\ _ \u2192 recBOT) f g)\n      ( equiv-extension-equiv-family\n        ( extext)\n        ( I)\n        ( \u03c8)\n        ( \\ t \u2192 f t = g t)\n        ( \\ t \u2192 hom (A t) (f t) (g t))\n        ( \\ t \u2192 (hom-eq (A t) (f t) (g t) , (is-discrete-A t (f t) (g t)))))\n      ( fubini\n        ( I)\n        ( 2)\n        ( \u03c8)\n        ( \\ t \u2192 BOT)\n        ( \u0394\u00b9)\n        ( \u2202\u0394\u00b9)\n        ( \\ t s \u2192 A t)\n        ( \\ (t , s) \u2192 recOR (s \u2261 0\u2082 \u21a6 f t , s \u2261 1\u2082 \u21a6 g t)))\n#def compute-hom-eq-extension-type-is-discrete uses (extext)\n( I : CUBE)\n( \u03c8 : (t : I) \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-discrete-A : (t : \u03c8) \u2192 is-discrete (A t))\n( f g : (t : \u03c8) \u2192 A t)\n( h : f = g)\n  : ( hom-eq ((t : \u03c8) \u2192 A t) f g h) =\n    ( first (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g)) h\n  :=\n    ind-path\n( (t : \u03c8) \u2192 A t)\n      ( f)\n( \\ g' h' \u2192\n        ( hom-eq ((t : \u03c8) \u2192 A t) f g' h') =\n        ( first (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g') h'))\n      ( refl)\n      ( g)\n      ( h)\n
RS17, Proposition 7.2, for extension types
#def is-discrete-extension-type uses (extext)\n( I : CUBE)\n( \u03c8 : (t : I) \u2192 TOPE)\n( A : \u03c8 \u2192 U)\n( is-discrete-A : (t : \u03c8) \u2192 is-discrete (A t))\n  : is-discrete ((t : \u03c8) \u2192 A t)\n  :=\n\\ f g \u2192\n    is-equiv-homotopy\n      ( f = g)\n( hom ((t : \u03c8) \u2192 A t) f g)\n( hom-eq ((t : \u03c8) \u2192 A t) f g)\n      ( first (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g))\n      ( compute-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g)\n      ( second (equiv-hom-eq-extension-type-is-discrete I \u03c8 A is-discrete-A f g))\n

For instance, the arrow type of a discrete type is discrete.

#def is-discrete-arr uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n  : is-discrete (arr A)\n  := is-discrete-extension-type 2 \u0394\u00b9 (\\ _ \u2192 A) (\\ _ \u2192 is-discrete-A)\n
"},{"location":"simplicial-hott/07-discrete.rzk/#discrete-types-are-segal-types","title":"Discrete types are Segal types","text":"

Discrete types are automatically Segal types.

#section discrete-arr-equivalences\n#variable A : U\n#variable is-discrete-A : is-discrete A\n#variables x y z w : A\n#variable f : hom A x y\n#variable g : hom A z w\n#def is-equiv-hom-eq-discrete uses (extext x y z w)\n  : is-equiv (f =_{arr A} g) (hom (arr A) f g) (hom-eq (arr A) f g)\n  := (is-discrete-arr A is-discrete-A) f g\n#def equiv-hom-eq-discrete uses (extext x y z w)\n  : Equiv (f =_{arr A} g) (hom (arr A) f g)\n  := (hom-eq (arr A) f g , (is-discrete-arr A is-discrete-A) f g)\n#def equiv-square-hom-arr\n  : Equiv\n      ( hom (arr A) f g)\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n              ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n                A [ t \u2261 0\u2082 \u2227 \u0394\u00b9 s \u21a6 f s ,\n                    t \u2261 1\u2082 \u2227 \u0394\u00b9 s \u21a6 g s ,\n                    \u0394\u00b9 t \u2227 s \u2261 0\u2082 \u21a6 h t ,\n                    \u0394\u00b9 t \u2227 s \u2261 1\u2082 \u21a6 k t])))\n  :=\n    ( \\ \u03b1 \u2192\n      ( ( \\ t \u2192 \u03b1 t 0\u2082) ,\n        ( ( \\ t \u2192 \u03b1 t 1\u2082) , (\\ (t , s) \u2192 \u03b1 t s))) ,\n      ( ( ( \\ \u03c3 t s \u2192 (second (second \u03c3)) (t , s)) , (\\ \u03b1 \u2192 refl)) ,\n        ( ( \\ \u03c3 t s \u2192 (second (second \u03c3)) (t , s)) , (\\ \u03c3 \u2192 refl))))\n

The equivalence underlying equiv-arr-\u03a3-hom:

#def fibered-arr-free-arr\n  : (arr A) \u2192 (\u03a3 (u : A) , (\u03a3 (v : A) , hom A u v))\n  := \\ k \u2192 (k 0\u2082 , (k 1\u2082 , k))\n#def is-equiv-fibered-arr-free-arr\n  : is-equiv (arr A) (\u03a3 (u : A) , (\u03a3 (v : A) , hom A u v)) (fibered-arr-free-arr)\n  := is-equiv-arr-\u03a3-hom A\n#def is-equiv-ap-fibered-arr-free-arr uses (w x y z)\n  : is-equiv\n      ( f =_{\u0394\u00b9 \u2192 A} g)\n      ( fibered-arr-free-arr f = fibered-arr-free-arr g)\n      ( ap\n        ( arr A)\n( \u03a3 (u : A) , (\u03a3 (v : A) , (hom A u v)))\n        ( f)\n        ( g)\n        ( fibered-arr-free-arr))\n  :=\n    is-emb-is-equiv\n      ( arr A)\n( \u03a3 (u : A) , (\u03a3 (v : A) , (hom A u v)))\n      ( fibered-arr-free-arr)\n      ( is-equiv-fibered-arr-free-arr)\n      ( f)\n      ( g)\n#def equiv-eq-fibered-arr-eq-free-arr uses (w x y z)\n  : Equiv (f =_{\u0394\u00b9 \u2192 A} g) (fibered-arr-free-arr f = fibered-arr-free-arr g)\n  :=\n    equiv-ap-is-equiv\n      ( arr A)\n( \u03a3 (u : A) , (\u03a3 (v : A) , (hom A u v)))\n      ( fibered-arr-free-arr)\n      ( is-equiv-fibered-arr-free-arr)\n      ( f)\n      ( g)\n#def equiv-sigma-over-product-hom-eq\n  : Equiv\n      ( fibered-arr-free-arr f = fibered-arr-free-arr g)\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n              ( product-transport A A (hom A) x z y w p q f = g)))\n  :=\n    extensionality-\u03a3-over-product\n      ( A) (A)\n      ( hom A)\n      ( fibered-arr-free-arr f)\n      ( fibered-arr-free-arr g)\n#def equiv-square-sigma-over-product uses (extext is-discrete-A)\n  : Equiv\n( \u03a3 ( p : x = z) ,\n( \u03a3 (q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n            ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n  :=\n    equiv-left-cancel\n      ( f =_{\u0394\u00b9 \u2192 A} g)\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n              ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n              ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n                A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                    (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                    (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                    (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n      ( equiv-comp\n        ( f =_{\u0394\u00b9 \u2192 A} g)\n        ( fibered-arr-free-arr f = fibered-arr-free-arr g)\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n                ( product-transport A A (hom A) x z y w p q f = g)))\n        equiv-eq-fibered-arr-eq-free-arr\n        equiv-sigma-over-product-hom-eq)\n      ( equiv-comp\n        ( f =_{\u0394\u00b9 \u2192 A} g)\n        ( hom (arr A) f g)\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n                ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n                  A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                      (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                      (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                      (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n        ( equiv-hom-eq-discrete)\n        ( equiv-square-hom-arr))\n

We close the section so we can use path induction.

#end discrete-arr-equivalences\n
#def fibered-map-square-sigma-over-product\n( A : U)\n( x y z w : A)\n( f : hom A x y)\n( p : x = z)\n( q : y = w)\n  : ( g : hom A z w) \u2192\n    ( product-transport A A (hom A) x z y w p q f = g) \u2192\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 (hom-eq A x z p) t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w q) t])\n  :=\n    ind-path\n      ( A)\n      ( x)\n( \\ z' p' \u2192\n        ( g : hom A z' w) \u2192\n        ( product-transport A A (hom A) x z' y w p' q f = g) \u2192\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 (hom-eq A x z' p') t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w q) t]))\n      ( ind-path\n        ( A)\n        ( y)\n( \\ w' q' \u2192\n          ( g : hom A x w') \u2192\n          ( product-transport A A (hom A) x x y w' refl q' f = g) \u2192\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w' q') t]))\n        ( ind-path\n          ( hom A x y)\n          ( f)\n          ( \\ g' \u03c4' \u2192\n            ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g' s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n          ( \\ (t , s) \u2192 f s))\n        ( w)\n        ( q))\n      ( z)\n      ( p)\n#def square-sigma-over-product\n( A : U)\n( x y z w : A)\n( f : hom A x y)\n( g : hom A z w)\n  ( ( p , (q , \u03c4)) :\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g))))\n  : \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t]))\n  :=\n    ( ( hom-eq A x z p) ,\n      ( ( hom-eq A y w q) ,\n        ( fibered-map-square-sigma-over-product\n          ( A)\n          ( x) (y) (z) (w)\n          ( f) (p) (q) (g)\n          ( \u03c4))))\n#def refl-refl-map-equiv-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f g : hom A x y)\n( \u03c4 : product-transport A A (hom A) x x y y refl refl f = g)\n  : ( first\n      ( equiv-square-sigma-over-product A is-discrete-A x y x y f g)\n      (refl , (refl , \u03c4))) =\n    ( square-sigma-over-product\n      ( A)\n      ( x) (y) (x) (y)\n      ( f) (g)\n      ( refl , (refl , \u03c4)))\n  :=\n    ind-path\n      ( hom A x y)\n      ( f)\n      ( \\ g' \u03c4' \u2192\n        ( first\n          ( equiv-square-sigma-over-product A is-discrete-A x y x y f g')\n          ( refl , (refl , \u03c4'))) =\n        ( square-sigma-over-product\n          ( A)\n          ( x) (y) (x) (y)\n          ( f) (g')\n          ( refl , (refl , \u03c4'))))\n      ( refl)\n      ( g)\n      ( \u03c4)\n#def map-equiv-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z w : A)\n( f : hom A x y)\n( p : x = z)\n( q : y = w)\n  : ( g : hom A z w) \u2192\n( \u03c4 : product-transport A A (hom A) x z y w p q f = g) \u2192\n    ( first\n      ( equiv-square-sigma-over-product A is-discrete-A x y z w f g)\n      ( p , (q , \u03c4))) =\n    ( square-sigma-over-product\n        A x y z w f g (p , (q , \u03c4)))\n  :=\n    ind-path\n      ( A)\n      ( y)\n( \\ w' q' \u2192\n        ( g : hom A z w') \u2192\n( \u03c4 : product-transport A A (hom A) x z y w' p q' f = g) \u2192\n        ( first\n          ( equiv-square-sigma-over-product\n              A is-discrete-A x y z w' f g))\n          ( p , (q' , \u03c4)) =\n        ( square-sigma-over-product A x y z w' f g)\n          ( p , (q' , \u03c4)))\n      ( ind-path\n        ( A)\n        ( x)\n( \\ z' p' \u2192\n          ( g : hom A z' y) \u2192\n( \u03c4 : product-transport A A (hom A) x z' y y p' refl f = g) \u2192\n          ( first\n            ( equiv-square-sigma-over-product A is-discrete-A x y z' y f g)\n            ( p' , (refl , \u03c4))) =\n          ( square-sigma-over-product A x y z' y f g (p' , (refl , \u03c4))))\n        ( refl-refl-map-equiv-square-sigma-over-product\n            ( A) (is-discrete-A) (x) (y) (f))\n        ( z)\n        ( p))\n      ( w)\n      ( q)\n#def is-equiv-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z w : A)\n( f : hom A x y)\n( g : hom A z w)\n  : is-equiv\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n            ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n    ( square-sigma-over-product A x y z w f g)\n  :=\n    is-equiv-rev-homotopy\n( \u03a3 ( p : x = z) ,\n( \u03a3 ( q : y = w) ,\n            ( product-transport A A (hom A) x z y w p q f = g)))\n( \u03a3 ( h : hom A x z) ,\n( \u03a3 ( k : hom A y w) ,\n            ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n              A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                  (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h t ,\n                  (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k t])))\n    ( first (equiv-square-sigma-over-product A is-discrete-A x y z w f g))\n    ( square-sigma-over-product A x y z w f g)\n    ( \\ (p , (q , \u03c4)) \u2192\n      map-equiv-square-sigma-over-product A is-discrete-A x y z w f p q g \u03c4)\n    ( second (equiv-square-sigma-over-product A is-discrete-A x y z w f g))\n#def is-equiv-fibered-map-square-sigma-over-product uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z w : A)\n( f : hom A x y)\n( g : hom A z w)\n( p : x = z)\n( q : y = w)\n  : is-equiv\n    ( product-transport A A (hom A) x z y w p q f = g)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 (hom-eq A x z p) t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 (hom-eq A y w q) t])\n    ( fibered-map-square-sigma-over-product A x y z w f p q g)\n  :=\n    fibered-map-is-equiv-bases-are-equiv-total-map-is-equiv\n      ( x = z)\n      ( hom A x z)\n      ( y = w)\n      ( hom A y w)\n      ( \\ p' q' \u2192 (product-transport A A (hom A) x z y w p' q' f) = g)\n      ( \\ h' k' \u2192\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 h' t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 k' t]))\n      ( hom-eq A x z)\n      ( hom-eq A y w)\n      ( \\ p' q' \u2192\n        fibered-map-square-sigma-over-product\n          ( A)\n          ( x) (y) (z) (w)\n          ( f)\n          ( p')\n          ( q')\n          ( g))\n      ( is-equiv-square-sigma-over-product A is-discrete-A x y z w f g)\n      ( is-discrete-A x z)\n      ( is-discrete-A y w)\n      ( p)\n      ( q)\n#def is-equiv-fibered-map-square-sigma-over-product-refl-refl uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n( g : hom A x y)\n  : is-equiv\n    (f = g)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n    ( fibered-map-square-sigma-over-product\n      A x y x y f refl refl g)\n  :=\n    is-equiv-fibered-map-square-sigma-over-product\n      A is-discrete-A x y x y f g refl refl\n

The previous calculations allow us to establish a family of equivalences:

#def is-equiv-sum-fibered-map-square-sigma-over-product-refl-refl uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : is-equiv\n( \u03a3 ( g : hom A x y) , f = g)\n( \u03a3 ( g : hom A x y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n    ( total-map\n      ( hom A x y)\n      ( \\ g \u2192 f = g)\n      ( \\ g \u2192\n        ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n      ( fibered-map-square-sigma-over-product\n          A x y x y f refl refl))\n  :=\n    family-of-equiv-total-equiv\n      ( hom A x y)\n      ( \\ g \u2192 f = g)\n      ( \\ g \u2192\n        ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n      ( fibered-map-square-sigma-over-product\n          A x y x y f refl refl)\n      ( \\ g \u2192\n        is-equiv-fibered-map-square-sigma-over-product-refl-refl\n          ( A) (is-discrete-A)\n          ( x) (y)\n          ( f) (g))\n#def equiv-sum-fibered-map-square-sigma-over-product-refl-refl uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : Equiv\n( \u03a3 (g : hom A x y) , f = g)\n( \u03a3 (g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  :=\n    ( ( total-map\n        ( hom A x y)\n        ( \\ g \u2192 f = g)\n        ( \\ g \u2192\n          ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n        ( fibered-map-square-sigma-over-product\n            A x y x y f refl refl)) ,\n    is-equiv-sum-fibered-map-square-sigma-over-product-refl-refl\n      A is-discrete-A x y f)\n

Now using the equivalence on total spaces and the contractibility of based path spaces, we conclude that the codomain extension type is contractible.

#def is-contr-horn-refl-refl-extension-type uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : is-contr\n( \u03a3 ( g : hom A x y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  :=\n    is-contr-equiv-is-contr\n( \u03a3 ( g : hom A x y) , f = g)\n( \u03a3 ( g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n      ( equiv-sum-fibered-map-square-sigma-over-product-refl-refl\n          A is-discrete-A x y f)\n      ( is-contr-based-paths (hom A x y) f)\n

The extension types that appear in the Segal condition are retracts of this type --- at least when the second arrow in the composable pair is an identity.

#def triangle-to-square-section\n( A : U)\n( x y : A)\n( f g : hom A x y)\n( \u03b1 : hom2 A x y y f (id-hom A y) g)\n  : ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n    A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n        (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n        (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n        (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]\n  := \\ (t , s) \u2192 recOR (t \u2264 s \u21a6 \u03b1 (s , t) , s \u2264 t \u21a6 g s)\n#def sigma-triangle-to-sigma-square-section\n( A : U)\n( x y : A)\n( f : hom A x y)\n  ( (d , \u03b1) : \u03a3 (d : hom A x y) , hom2 A x y y f (id-hom A y) d)\n  : \u03a3 ( g : hom A x y) ,\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y])\n  := ( d , triangle-to-square-section A x y f d \u03b1)\n#def sigma-square-to-sigma-triangle-retraction\n( A : U)\n( x y : A)\n( f : hom A x y)\n  ( (g , \u03c3) :\n\u03a3 ( g : hom A x y) ,\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  : \u03a3 (d : hom A x y) , (hom2 A x y y f (id-hom A y) d)\n  := ( (\\ t \u2192 \u03c3 (t , t)) , (\\ (t , s) \u2192 \u03c3 (s , t)))\n#def sigma-triangle-to-sigma-square-retract\n( A : U)\n( x y : A)\n( f : hom A x y)\n  : is-retract-of\n( \u03a3 (d : hom A x y) , (hom2 A x y y f (id-hom A y) d))\n( \u03a3 ( g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n  :=\n    ( ( sigma-triangle-to-sigma-square-section A x y f) ,\n      ( ( sigma-square-to-sigma-triangle-retraction A x y f) ,\n        ( \\ d\u03b1 \u2192 refl)))\n

We can now verify the Segal condition in the case of composable pairs in which the second arrow is an identity.

#def is-contr-hom2-with-id-is-discrete uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y : A)\n( f : hom A x y)\n  : is-contr ( \u03a3 (d : hom A x y) , (hom2 A x y y f (id-hom A y) d))\n  :=\n    is-contr-is-retract-of-is-contr\n( \u03a3 ( d : hom A x y) , (hom2 A x y y f (id-hom A y) d))\n( \u03a3 ( g : hom A x y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 f s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 g s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 x ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 y]))\n      ( sigma-triangle-to-sigma-square-retract A x y f)\n      ( is-contr-horn-refl-refl-extension-type A is-discrete-A x y f)\n

But since A is discrete, its hom type family is equivalent to its identity type family, and we can use \"path induction\" over arrows to reduce the general case to the one just proven:

#def is-contr-hom2-is-discrete uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n  : is-contr (\u03a3 (h : hom A x z) , hom2 A x y z f g h)\n  :=\n    ind-based-path\n      ( A)\n      ( y)\n      ( \\ w \u2192 hom A y w)\n      ( \\ w \u2192 hom-eq A y w)\n      ( is-discrete-A y)\n( \\ w d \u2192 is-contr ( \u03a3 (h : hom A x w) , hom2 A x y w f d h))\n      ( is-contr-hom2-with-id-is-discrete A is-discrete-A x y f)\n      ( z)\n      ( g)\n

Finally, we conclude:

RS17, Proposition 7.3
#def is-segal-is-discrete uses (extext)\n( A : U)\n( is-discrete-A : is-discrete A)\n  : is-segal A\n  := is-contr-hom2-is-discrete A is-discrete-A\n
"},{"location":"simplicial-hott/08-covariant.rzk/","title":"Covariant families","text":"

These formalisations correspond to Section 8 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/08-covariant.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on extension extensionality:

#assume extext : ExtExt\n#assume weakfunext : WeakFunExt\n#assume naiveextext : NaiveExtExt\n
"},{"location":"simplicial-hott/08-covariant.rzk/#dependent-hom-types","title":"Dependent hom types","text":"

In a type family over a base type, there is a dependent hom type of arrows that live over a specified arrow in the base type.

RS17, Section 8 Prelim
#def dhom\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( u : C x)\n( v : C y)\n  : U\n  := (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u , t \u2261 1\u2082 \u21a6 v]\n

It will be convenient to collect together dependent hom types with fixed domain but varying codomain.

#def dhom-from\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( u : C x)\n  : U\n  := ( \u03a3 (v : C y) , dhom A x y f C u v)\n

There is also a type of dependent commutative triangles over a base commutative triangle.

#def dhom2\n( A : U)\n( x y z : A)\n( f : hom A x y)\n( g : hom A y z)\n( h : hom A x z)\n( \u03b1 : hom2 A x y z f g h)\n( C : A \u2192 U)\n( u : C x)\n( v : C y)\n( w : C z)\n( ff : dhom A x y f C u v)\n( gg : dhom A y z g C v w)\n( hh : dhom A x z h C u w)\n  : U\n  :=\n    ( (t1 , t2) : \u0394\u00b2) \u2192 C (\u03b1 (t1 , t2)) [\n        t2 \u2261 0\u2082 \u21a6 ff t1 ,\n        t1 \u2261 1\u2082 \u21a6 gg t2 ,\n        t2 \u2261 t1 \u21a6 hh t2\n      ]\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-families_1","title":"Covariant families","text":"

A family of types over a base type is covariant if every arrow in the base has a unique lift with specified domain.

RS17, Definition 8.2
#def is-covariant\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (u : C x) \u2192\n    is-contr (dhom-from A x y f C u)\n
The type of covariant families over a fixed type
#def covariant-family (A : U) : U\n  := ( \u03a3 (C : (A \u2192 U)) , is-covariant A C)\n

The notion of a covariant family is stable under substitution into the base.

RS17, Remark 8.3
#def is-covariant-substitution-is-covariant\n( A B : U)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( g : B \u2192 A)\n  : is-covariant B (\\ b \u2192 C (g b))\n  := \\ x y f u \u2192 is-covariant-C (g x) (g y) (ap-hom B A g x y f) u\n

The notion of having a unique lift with a fixed domain may also be expressed by contractibility of the type of extensions along the domain inclusion into the 1-simplex.

#def has-unique-fixed-domain-lifts\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (u : C x) \u2192\n    is-contr ((t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n

These two notions of covariance are equivalent because the two types of lifts of a base arrow with fixed domain are equivalent. Note that this is not quite an instance of Theorem 4.4 but its proof, with a very small modification, works here.

#def equiv-lifts-with-fixed-domain\n( A : U)\n( C : A \u2192 U)\n( x y : A)\n( f : hom A x y)\n( u : C x)\n  : Equiv\n((t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n      (dhom-from A x y f C u)\n  :=\n    ( \\ h \u2192 (h 1\u2082 , \\ t \u2192 h t) ,\n      ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl) ,\n        ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl))))\n

By the equivalence-invariance of contractibility, this proves the desired logical equivalence

#def is-covariant-has-unique-fixed-domain-lifts\n( A : U)\n( C : A \u2192 U)\n  : (has-unique-fixed-domain-lifts A C) \u2192 ( is-covariant A C)\n  :=\n\\ C-has-unique-lifts x y f u \u2192\n      is-contr-equiv-is-contr\n( (t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n        ( dhom-from A x y f C u)\n        ( equiv-lifts-with-fixed-domain A C x y f u)\n        ( C-has-unique-lifts x y f u)\n#def has-unique-fixed-domain-lifts-is-covariant\n( A : U)\n( C : A \u2192 U)\n  : (is-covariant A C) \u2192 (has-unique-fixed-domain-lifts A C)\n  :=\n\\ is-covariant-C x y f u \u2192\n      is-contr-equiv-is-contr'\n( (t : \u0394\u00b9) \u2192 C (f t) [ t \u2261 0\u2082 \u21a6 u])\n        ( dhom-from A x y f C u)\n        ( equiv-lifts-with-fixed-domain A C x y f u)\n        ( is-covariant-C x y f u)\n
RS17, Proposition 8.4
#def has-unique-fixed-domain-lifts-iff-is-covariant\n( A : U)\n( C : A \u2192 U)\n  : iff\n      ( has-unique-fixed-domain-lifts A C)\n      ( is-covariant A C)\n  :=\n    ( is-covariant-has-unique-fixed-domain-lifts A C,\n      has-unique-fixed-domain-lifts-is-covariant A C)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#naive-left-fibrations","title":"Naive left fibrations","text":"

For any functor p : C\u0302 \u2192 A, we can make a naive definition of what it means to be a left fibration.

#def is-naive-left-fibration\n( A C\u0302 : U)\n( p : C\u0302 \u2192 A)\n  : U\n  :=\n    is-homotopy-cartesian\n      C\u0302 (coslice C\u0302)\n      A (coslice A)\n      p (coslice-fun C\u0302 A p)\n

As a sanity check we unpack the definition of is-naive-left-fibration.

#def is-naive-left-fibration-unpacked\n( A C\u0302 : U)\n( p : C\u0302 \u2192 A)\n  : is-naive-left-fibration A C\u0302 p =\n((c : C\u0302) \u2192 is-equiv (coslice C\u0302 c) (coslice A (p c)) (coslice-fun C\u0302 A p c))\n  := refl\n
"},{"location":"simplicial-hott/08-covariant.rzk/#naive-left-fibrations-are-left-fibrations","title":"Naive left fibrations are left fibrations","text":"

A map \u03b1 : A' \u2192 A is called a left fibration if it is right orthogonal to the shape inclusion {0} \u2282 \u0394\u00b9.

#section is-left-fibration\n#variables A' A : U\n#variable \u03b1 : A' \u2192 A\n#def is-left-fibration\n  : U\n  := is-right-orthogonal-to-shape 2 \u0394\u00b9 ( \\ s \u2192 s \u2261 0\u2082) A' A \u03b1\n

This notion agrees with that of a naive left fibration.

#def is-left-fibration-is-naive-left-fibration\n( is-nlf : is-naive-left-fibration A A' \u03b1)\n  : is-left-fibration\n  :=\n\\ a' \u2192\n      is-equiv-equiv-is-equiv\n        ( coslice' A' (a' 0\u2082)) (coslice' A (\u03b1 (a' 0\u2082)))\n        ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n        ( coslice A' (a' 0\u2082)) (coslice A (\u03b1 (a' 0\u2082)))\n        ( coslice-fun A' A \u03b1 (a' 0\u2082))\n        ( ( coslice-coslice' A' (a' 0\u2082), coslice-coslice' A (\u03b1 (a' 0\u2082))),\n\\ _ \u2192 refl)\n        ( is-equiv-coslice-coslice' A' (a' 0\u2082))\n        ( is-equiv-coslice-coslice' A (\u03b1 (a' 0\u2082)))\n        ( is-nlf (a' 0\u2082))\n#def is-naive-left-fibration-is-left-fibration\n( is-lf : is-left-fibration)\n  : is-naive-left-fibration A A' \u03b1\n  :=\n\\ a' \u2192\n      is-equiv-equiv-is-equiv'\n        ( coslice' A' a') (coslice' A (\u03b1 a'))\n        ( \\ \u03c3' t \u2192 \u03b1 (\u03c3' t))\n        ( coslice A' a') (coslice A (\u03b1 a'))\n        ( coslice-fun A' A \u03b1 a')\n        ( ( coslice-coslice' A' a', coslice-coslice' A (\u03b1 a')),\n\\ _ \u2192 refl)\n        ( is-equiv-coslice-coslice' A' a')\n        ( is-equiv-coslice-coslice' A (\u03b1 a'))\n        ( is-lf (\\ t \u2192 a'))\n#def is-naive-left-fibration-iff-is-left-fibration\n  : iff\n      ( is-naive-left-fibration A A' \u03b1)\n      ( is-left-fibration)\n  :=\n    ( is-left-fibration-is-naive-left-fibration,\n      is-naive-left-fibration-is-left-fibration)\n#end is-left-fibration\n
"},{"location":"simplicial-hott/08-covariant.rzk/#left-fibrations-are-inner-fibrations","title":"Left fibrations are inner fibrations","text":"

Recall that an inner fibration is a map \u03b1 : A' \u2192 A which is right orthogonal to \u039b \u2282 \u0394\u00b2.

We aim to show that every left fibration is an inner fibration. This is a sequence of manipulations where we start with the assumption that {0} \u2282 \u0394\u00b9 is left orthogonal to \u03b1 : A' \u2192 A, i.e.

#section is-inner-fibration-is-left-fibration\n#variables A' A : U\n#variable \u03b1 : A' \u2192 A\n#variable is-left-fib-\u03b1 : is-left-fibration A' A \u03b1\n

and deduce that various other shape inclusions are left orthogonal as well.

The first step is to identify the pair {0} \u2282 \u0394\u00b9 with the pair of subshapes {1} \u2282 right-leg-of-\u039b of \u039b.

#def right-leg-of-\u039b : \u039b \u2192 TOPE\n  := \\ (t, s) \u2192 t \u2261 1\u2082\n#def is-equiv-\u0394\u00b9-to-right-leg-of-\u039b-rel-start\n( B : U)\n( b : B)\n  : is-equiv\n( ( s : \u0394\u00b9) \u2192 B [ s \u2261 0\u2082 \u21a6 b])\n      ( ( (t,s) : right-leg-of-\u039b) \u2192 B [ s \u2261 0\u2082 \u21a6 b])\n      ( \\ \u03c4 (t,s) \u2192 \u03c4 s)\n  :=\n    ( ( \\ \u03c5 s \u2192 \u03c5 (1\u2082, s) , \\ _ \u2192 refl),\n      ( \\ \u03c5 s \u2192 \u03c5 (1\u2082, s) , \\ _ \u2192 refl))\n#def is-right-orthogonal-to-10-1\u00d7\u0394\u00b9-is-inner-fibration uses (is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) (\\ ts \u2192 right-leg-of-\u039b ts) ( \\ (_,s) \u2192 s \u2261 0\u2082) A' A \u03b1\n  :=\n    \\ ( \u03c3' : ( (t,s) : 2 \u00d7 2 | right-leg-of-\u039b (t,s) \u2227 s \u2261 0\u2082) \u2192 A') \u2192\n      is-equiv-Equiv-is-equiv'\n( ( s : \u0394\u00b9) \u2192 A' [s \u2261 0\u2082 \u21a6 \u03c3' (1\u2082, s)])\n( ( s : \u0394\u00b9) \u2192 A [s \u2261 0\u2082 \u21a6 \u03b1 (\u03c3' (1\u2082, s))])\n        ( \\ \u03c4 s \u2192 \u03b1 (\u03c4 s))\n        ( ( (_, s) : right-leg-of-\u039b) \u2192 A' [ s \u2261 0\u2082 \u21a6 \u03c3' (1\u2082,s)])\n        ( ( (_, s) : right-leg-of-\u039b) \u2192 A [ s \u2261 0\u2082 \u21a6 \u03b1 ( \u03c3' (1\u2082,s))])\n        ( \\ \u03c5 ts \u2192 \u03b1 (\u03c5 ts))\n        ( ( ( \\ \u03c4' (t,s) \u2192 \u03c4' s , \\ \u03c4 (t,s) \u2192 \u03c4 s) , \\ _ \u2192 refl),\n          ( is-equiv-\u0394\u00b9-to-right-leg-of-\u039b-rel-start A' ( \u03c3' (1\u2082, 0\u2082))\n          , is-equiv-\u0394\u00b9-to-right-leg-of-\u039b-rel-start A ( \u03b1 ( \u03c3' (1\u2082, 0\u2082)))\n          )\n        )\n( is-left-fib-\u03b1 ( \\ ( s : 2 | \u0394\u00b9 s \u2227 s \u2261 0\u2082) \u2192 \u03c3' (1\u2082,s)))\n

Next we use that \u039b is the pushout of its left leg and its right leg to deduce that the pair left-leg-of-\u039b \u2282 \u039b is left orthogonal.

#def left-leg-of-\u039b : \u039b \u2192 TOPE\n  := \\ (t, s) \u2192 s \u2261 0\u2082\n#def is-right-orthogonal-to-left-leg-of-\u039b-\u039b-is-inner-fibration uses (is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u039b ts) ( \\ ts \u2192 left-leg-of-\u039b ts) A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-pushout A' A \u03b1\n      ( 2 \u00d7 2) ( \\ ts \u2192 right-leg-of-\u039b ts) (\\ ts \u2192 left-leg-of-\u039b ts)\n      ( is-right-orthogonal-to-10-1\u00d7\u0394\u00b9-is-inner-fibration)\n

Furthermore, we observe that the pair left-leg-of-\u0394 \u2282 \u0394\u00b9\u00d7\u0394\u00b9 is the product of \u0394\u00b9 with the left orthogonal pair {0} \u2282 \u0394\u00b9, hence left orthogonal itself.

#def is-right-orthogonal-to-left-leg-of-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration\nuses (naiveextext is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 left-leg-of-\u039b ts) A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-\u00d7 naiveextext A' A \u03b1\n2 \u0394\u00b9 2 \u0394\u00b9 ( \\ s \u2192 s \u2261 0\u2082) is-left-fib-\u03b1\n

Next, we use the left cancellation of left orthogonal shape inclusions to deduce that \u039b \u2282 \u0394\u00b9\u00d7\u0394\u00b9 is left orthogonal to \u03b1 : A' \u2192 A.

#def is-right-orthogonal-to-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration\nuses (naiveextext is-left-fib-\u03b1)\n  : is-right-orthogonal-to-shape\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 \u039b ts) A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-left-cancel A' A \u03b1\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 \u039b ts) ( \\ ts \u2192 left-leg-of-\u039b ts)\n      ( is-right-orthogonal-to-left-leg-of-\u039b-\u039b-is-inner-fibration)\n      ( is-right-orthogonal-to-left-leg-of-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration)\n

Finally, we right cancel the functorial retract \u0394\u00b2 \u2282 \u0394\u00b9\u00d7\u0394\u00b9 to obtain the desired left orthogonal shape inclusion \u039b \u2282 \u0394\u00b2.

#def is-inner-fibration-is-left-fibration uses (naiveextext is-left-fib-\u03b1)\n  : is-inner-fibration A' A \u03b1\n  :=\n    is-right-orthogonal-to-shape-right-cancel-retract A' A \u03b1\n      ( 2 \u00d7 2) ( \\ ts \u2192 \u0394\u00b9\u00d7\u0394\u00b9 ts) ( \\ ts \u2192 \u0394\u00b2 ts) ( \\ ts \u2192 \u039b ts)\n      ( is-right-orthogonal-to-\u039b-\u0394\u00b9\u00d7\u0394\u00b9-is-inner-fibration)\n      ( \u0394\u00b2-is-functorial-retract-\u0394\u00b9\u00d7\u0394\u00b9)\n#end is-inner-fibration-is-left-fibration\n

Since the Segal types are precisely the local types with respect to \u039b \u2282 \u0394\u00b9, we immediately deduce that in any left fibration \u03b1 : A' \u2192 A, if A is a Segal type, then so is A'.

Theorem 8.8, categorical version
#def is-segal-domain-left-fibration-is-segal-codomain uses (naiveextext)\n( A' A : U)\n( \u03b1 : A' \u2192 A)\n( is-left-fib-\u03b1 : is-left-fibration A' A \u03b1)\n( is-segal-A : is-segal A)\n  : is-segal A'\n  :=\n    is-segal-is-local-horn-inclusion A'\n      ( is-local-type-domain-right-orthogonal-is-local-type-codomain\n        ( 2 \u00d7 2) \u0394\u00b2 ( \\ ts \u2192 \u039b ts) A' A \u03b1\n        ( is-inner-fibration-is-left-fibration A' A \u03b1 is-left-fib-\u03b1)\n        ( is-local-horn-inclusion-is-segal A is-segal-A))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#naive-left-fibrations-vs-covariant-families","title":"Naive left fibrations vs. covariant families","text":"

We aim to prove that a type family C : A \u2192 U, is covariant if and only if the projection p : total-type A C \u2192 A is a naive left fibration.

The theorem asserts the logical equivalence of two contractibility statements, one for the types dhom-from A a a' f C c and one for the fibers of the canonical map coslice (total-type A C) (a, c) \u2192 coslice A a; Thus it suffices to show that for each a a' : A, f : hom A a a', c : C a. these two types are equivalent.

We fix the following variables.

#section is-naive-left-fibration-is-covariant-proof\n#variable A : U\n#variable a : A\n#variable C : A \u2192 U\n#variable c : C a\n

Note that we do not fix a' : A and f : hom A a a'. Letting these vary lets us give an easy proof by invoking the induction principle for fibers.

We make some abbreviations to make the proof more readable:

-- We prepend all local names in this section\n-- with the random identifyier temp-b9wX\n-- to avoid cluttering the global name space.\n-- Once rzk supports local variables, these should be renamed.\n#def temp-b9wX-coslice-fun\n  : coslice (total-type A C) (a, c) \u2192 coslice A a\n  := coslice-fun (total-type A C) A (\\ (x, _) \u2192 x) (a, c)\n#def temp-b9wX-fib\n(a' : A)\n(f : hom A a a')\n  : U\n  :=\n    fib (coslice (total-type A C) (a, c))\n        (coslice A a)\n        (temp-b9wX-coslice-fun)\n        (a', f)\n

We construct the forward map; this one is straightforward since it goes from strict extension type to a weak one.

#def temp-b9wX-forward\n( a' : A)\n( f : hom A a a')\n  : dhom-from A a a' f C c \u2192 temp-b9wX-fib a' f\n  :=\n    \\ (c', f\u0302) \u2192 (((a', c'), \\ t \u2192 (f t, f\u0302 t)) , refl)\n

The only non-trivial part is showing that this map has a section. We do this by the following fiber induction.

#def temp-b9wX-has-section'-forward\n  ( (a', f) : coslice A a)\n( u : temp-b9wX-fib a' f)\n  : U\n  := \u03a3 ( v : dhom-from A a a' f C c), ( temp-b9wX-forward a' f v = u)\n#def temp-b9wX-forward-section'\n  : ( (a', f) : coslice A a) \u2192\n( u : temp-b9wX-fib a' f) \u2192\n    temp-b9wX-has-section'-forward (a', f) u\n  :=\n    ind-fib\n      ( coslice (total-type A C) (a, c))\n      ( coslice A a)\n      ( temp-b9wX-coslice-fun)\n      ( temp-b9wX-has-section'-forward)\n      (\\ ((a', c'), g\u0302) \u2192 ((c', \\ t \u2192 second (g\u0302 t)) , refl))\n

We have constructed a section. It is also definitionally a retraction, yielding the desired equivalence.

#def temp-b9wX-has-inverse-forward\n( a' : A)\n( f : hom A a a')\n  : has-inverse\n      (dhom-from A a a' f C c)\n      (temp-b9wX-fib a' f)\n      (temp-b9wX-forward a' f)\n  :=\n    ( \\ u \u2192 first (temp-b9wX-forward-section' (a', f) u),\n    ( \\ _ \u2192 refl,\n\\ u \u2192 second (temp-b9wX-forward-section' (a', f) u)\n    ))\n#def temp-b9wX-the-equivalence\n( a' : A)\n( f : hom A a a')\n  : Equiv\n      (dhom-from A a a' f C c)\n      (temp-b9wX-fib a' f)\n  :=\n    ( (temp-b9wX-forward a' f),\n      is-equiv-has-inverse\n        (dhom-from A a a' f C c)\n        (temp-b9wX-fib a' f)\n        (temp-b9wX-forward a' f)\n        (temp-b9wX-has-inverse-forward a' f)\n    )\n#end is-naive-left-fibration-is-covariant-proof\n

Finally, we deduce the theorem by some straightforward logical bookkeeping.

RS17, Theorem 8.5
#def is-naive-left-fibration-is-covariant\n( A : U)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-naive-left-fibration A (total-type A C) (\\ (a, _) \u2192 a)\n  :=\n    \\ (a, c) \u2192\n      is-equiv-is-contr-map\n        ( coslice (total-type A C) (a, c))\n        ( coslice A a)\n        ( temp-b9wX-coslice-fun A a C c)\n        ( \\ (a', f) \u2192\n          is-contr-equiv-is-contr\n            (dhom-from A a a' f C c)\n            (temp-b9wX-fib A a C c a' f)\n            (temp-b9wX-the-equivalence A a C c a' f)\n            (is-covariant-C a a' f c)\n        )\n#def is-covariant-is-naive-left-fibration\n( A : U)\n( C : A \u2192 U)\n( inlf-\u03a3C : is-naive-left-fibration A (total-type A C) (\\ (a, _) \u2192 a))\n  : is-covariant A C\n  :=\n\\ a a' f c \u2192\n      is-contr-equiv-is-contr'\n        ( dhom-from A a a' f C c)\n        ( temp-b9wX-fib A a C c a' f)\n        ( temp-b9wX-the-equivalence A a C c a' f)\n        ( is-contr-map-is-equiv\n          ( coslice (total-type A C) (a, c))\n          ( coslice A a)\n          ( temp-b9wX-coslice-fun A a C c)\n          ( inlf-\u03a3C (a, c))\n          (a', f)\n        )\n#def is-naive-left-fibration-iff-is-covariant\n( A : U)\n( C : A \u2192 U)\n  :\n    iff\n      (is-covariant A C)\n      (is-naive-left-fibration A (total-type A C) (\\ (a, _) \u2192 a))\n  :=\n    ( is-naive-left-fibration-is-covariant A C,\n      is-covariant-is-naive-left-fibration A C)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#total-space-of-a-covariant-family-over-a-segal-type","title":"Total space of a covariant family over a Segal type","text":"

We prove that the total space of a covariant family over a Segal type is a Segal type. We split the proof into intermediate steps. Let A be a type and a type family C : A \u2192 U.

"},{"location":"simplicial-hott/08-covariant.rzk/#category-theoretic-proof","title":"Category theoretic proof","text":"

For every covariant family C : A \u2192 U, the projection \u03a3 A, C \u2192 A is an left fibration, hence an inner fibration. It immediately follows that if A is Segal, then so is \u03a3 A, C.

RS17, Theorem 8.8
#def is-segal-total-space-covariant-family-is-segal-base uses (naiveextext)\n( A : U)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-segal A \u2192 is-segal (total-type A C)\n  :=\n    is-segal-domain-left-fibration-is-segal-codomain\n      ( total-type A C) A (\\ (a,_) \u2192 a)\n        ( is-left-fibration-is-naive-left-fibration\n            ( total-type A C) A (\\ (a,_) \u2192 a)\n            ( is-naive-left-fibration-is-covariant A C is-covariant-C))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#type-theoretic-proof","title":"Type theoretic proof","text":"

We examine the fibers of the horn restriction on the total space of C. First note we have the equivalences:

#def apply-4-3\n( A : U )\n( C : A \u2192 U )\n  : Equiv\n( \u039b \u2192 (\u03a3 ( a : A ), C a ) )\n( \u03a3 ( f : \u039b \u2192 A ), ( t : \u039b ) \u2192 ( C ( f t ) ) )\n  :=\n    axiom-choice ( 2 \u00d7 2 ) \u039b ( \\ t \u2192 BOT ) ( \\ t \u2192 A )\n    ( \\ t a \u2192 C a ) ( \\ t \u2192 recBOT ) ( \\ t \u2192 recBOT )\n#def apply-4-3-again\n( A : U )\n( C : A \u2192 U )\n  : Equiv\n( \u0394\u00b2 \u2192 (\u03a3 ( a : A ), C a ) )\n( \u03a3 ( f : \u0394\u00b2 \u2192 A ), ( t : \u0394\u00b2 ) \u2192 ( C ( f t ) ) )\n  :=\n    axiom-choice ( 2 \u00d7 2 ) \u0394\u00b2 ( \\ t \u2192 BOT ) ( \\ t \u2192 A )\n    ( \\ t a \u2192 C a ) ( \\ t \u2192 recBOT ) ( \\ t \u2192 recBOT )\n

We show that the induced map between this types is an equivalence. First we exhibit the map:

#def total-inner-horn-restriction\n( A : U )\n( C : A \u2192 U )\n  : ( \u03a3 ( f : \u0394\u00b2 \u2192 A ), ( t : \u0394\u00b2 ) \u2192 ( C ( f t ) ) ) \u2192\n( \u03a3 ( g : \u039b \u2192 A ), ( t : \u039b ) \u2192 ( C ( g t ) ) )\n  := \\ ( f, \u03bc ) \u2192 ( \\ t \u2192 f t , \\ t \u2192 \u03bc t)\n

Next we compute the fibers of this map by showing the equivalence as claimed in the proof of Theorem 8.8 in RS17. The following maps will be packed into some Equiv.

#def map-to-total-inner-horn-restriction-fiber\n( A : U )\n( C : A \u2192 U )\n  ( (g , \u03c6) : ( \u03a3 ( k : \u039b \u2192 A ), ( t : \u039b ) \u2192 C ( k t ) ) )\n  : ( \u03a3 (h : (t : \u0394\u00b2) \u2192 A [ \u039b t \u21a6 g t ] ) ,\n(( t : \u0394\u00b2 ) \u2192 C (h t) [ \u039b t \u21a6 \u03c6 t])) \u2192\n( fib ( \u03a3 ( l : \u0394\u00b2 \u2192 A ), ( t : \u0394\u00b2 ) \u2192 ( C ( l t ) ))\n( \u03a3 ( k : \u039b \u2192 A ), ( t : \u039b ) \u2192 ( C ( k t ) ))\n          ( total-inner-horn-restriction A C )\n          ( g,  \u03c6) )\n  := \\ ( f,\u03bc ) \u2192 ( ( \\ t \u2192 f t, \\ t \u2192 \u03bc t  ), refl )\n
"},{"location":"simplicial-hott/08-covariant.rzk/#representable-covariant-families","title":"Representable covariant families","text":"

If A is a Segal type and a : A is any term, then hom A a defines a covariant family over A, and conversely if this family is covariant for every a : A, then A must be a Segal type. The proof involves a rather lengthy composition of equivalences.

#def dhom-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n( v : hom A a y)\n  : U\n  := dhom A x y f (\\ z \u2192 hom A a z) u v\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n( v : hom A a y)\n  : Equiv\n    ( dhom-representable A a x y f u v)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n  :=\n    curry-uncurry 2 2 \u0394\u00b9 \u2202\u0394\u00b9 \u0394\u00b9 \u2202\u0394\u00b9 (\\ t s \u2192 A)\n    ( \\ (t , s) \u2192\nrecOR\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t))\n#def dhom-from-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : U\n  := dhom-from A x y f (\\ z \u2192 hom A a z) u\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-from-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( v : hom A a y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ v \u2192 dhom-representable A a x y f u v)\n      ( \\ v \u2192\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n      ( \\ v \u2192 uncurried-dhom-representable A a x y f u v)\n#def square-to-hom2-pushout\n( A : U)\n( w x y z : A)\n( u : hom A w x)\n( f : hom A x z)\n( g : hom A w y)\n( v : hom A y z)\n  : ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 g t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) \u2192\n( \u03a3 (d : hom A w z) , product (hom2 A w x z u f d) (hom2 A w y z g v d))\n  :=\n\\ sq \u2192\n    ( ( \\ t \u2192 sq (t , t)) , (\\ (t , s) \u2192 sq (s , t) , \\ (t , s) \u2192 sq (t , s)))\n#def hom2-pushout-to-square\n( A : U)\n( w x y z : A)\n( u : hom A w x)\n( f : hom A x z)\n( g : hom A w y)\n( v : hom A y z)\n  : ( \u03a3 ( d : hom A w z) ,\n        ( product (hom2 A w x z u f d) (hom2 A w y z g v d))) \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 g t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n  :=\n    \\ (d , (\u03b11 , \u03b12)) (t , s) \u2192\nrecOR\n      ( t \u2264 s \u21a6 \u03b11 (s , t) ,\n        s \u2264 t \u21a6 \u03b12 (t , s))\n#def equiv-square-hom2-pushout\n( A : U)\n( w x y z : A)\n( u : hom A w x)\n( f : hom A x z)\n( g : hom A w y)\n( v : hom A y z)\n  : Equiv\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 g t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n( \u03a3 (d : hom A w z) , (product (hom2 A w x z u f d) (hom2 A w y z g v d)))\n  :=\n    ( ( square-to-hom2-pushout A w x y z u f g v) ,\n      ( ( hom2-pushout-to-square A w x y z u f g v , \\ sq \u2192 refl) ,\n        ( hom2-pushout-to-square A w x y z u f g v , \\ \u03b1s \u2192 refl)))\n#def representable-dhom-from-uncurry-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n( \u03a3 (v : hom A a y) ,\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n( \u03a3 ( d : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n  :=\n    total-equiv-family-equiv\n    ( hom A a y)\n    ( \\ v \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \\ v \u2192\n      ( \u03a3 ( d : hom A a y) ,\n          ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n    ( \\ v \u2192 equiv-square-hom2-pushout A a x a y u f (id-hom A a) v)\n#def representable-dhom-from-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n  :=\n    equiv-triple-comp\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( v : hom A a y) ,\n        ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n( \u03a3 ( d : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n( \u03a3 ( d : hom A a y) ,\n( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n    ( uncurried-dhom-from-representable A a x y f u)\n    ( representable-dhom-from-uncurry-hom2 A a x y f u)\n    ( fubini-\u03a3 (hom A a y) (hom A a y)\n      ( \\ v d \u2192 product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d)))\n#def representable-dhom-from-hom2-dist\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , (hom2 A a a y (id-hom A a) v d))))\n  :=\n    equiv-right-cancel\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d)))\n( \u03a3 ( d : hom A a y) ,\n( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n    ( representable-dhom-from-hom2 A a x y f u)\n    ( total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ d \u2192\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , (hom2 A a a y (id-hom A a) v d))))\n( \\ d \u2192\n        ( \u03a3 ( v : hom A a y) ,\n            ( product (hom2 A a x y u f d) (hom2 A a a y (id-hom A a) v d))))\n      ( \\ d \u2192\n        ( distributive-product-\u03a3\n          ( hom2 A a x y u f d)\n          ( hom A a y)\n          ( \\ v \u2192 hom2 A a a y (id-hom A a) v d))))\n

Now we introduce the hypothesis that A is Segal type.

#def representable-dhom-from-path-space-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d))))\n  :=\n    equiv-right-cancel\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( d : hom A a y) ,\n        ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d))))\n( \u03a3 ( d : hom A a y) ,\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d)))\n    ( representable-dhom-from-hom2-dist A a x y f u)\n    ( total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ d \u2192 product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d)))\n      ( \\ d \u2192\n        ( product\n          ( hom2 A a x y u f d)\n( \u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d)))\n      ( \\ d \u2192\n        ( total-equiv-family-equiv\n          ( hom2 A a x y u f d)\n( \\ \u03b1 \u2192 (\u03a3 (v : hom A a y) , (v = d)))\n( \\ \u03b1 \u2192 (\u03a3 (v : hom A a y) , hom2 A a a y (id-hom A a) v d))\n          ( \\ \u03b1 \u2192\n            ( total-equiv-family-equiv\n              ( hom A a y)\n              ( \\ v \u2192 (v = d))\n              ( \\ v \u2192 hom2 A a a y (id-hom A a) v d)\n              ( \\ v \u2192 (equiv-homotopy-hom2-is-segal A is-segal-A a y v d)))))))\n#def codomain-based-paths-contraction\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n( d : hom A a y)\n  : Equiv\n    ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d)))\n    ( hom2 A a x y u f d)\n  :=\n    equiv-projection-contractible-fibers\n      ( hom2 A a x y u f d)\n( \\ \u03b1 \u2192 (\u03a3 (v : hom A a y) , (v = d)))\n      ( \\ \u03b1 \u2192 is-contr-endpoint-based-paths (hom A a y) d)\n#def is-segal-representable-dhom-from-hom2\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 (d : hom A a y) , (hom2 A a x y u f d))\n  :=\n    equiv-comp\n    ( dhom-from-representable A a x y f u)\n( \u03a3 (d : hom A a y) ,\n      ( product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d))))\n( \u03a3 (d : hom A a y) , (hom2 A a x y u f d))\n    ( representable-dhom-from-path-space-is-segal A is-segal-A a x y f u)\n    ( total-equiv-family-equiv\n      ( hom A a y)\n      ( \\ d \u2192 product (hom2 A a x y u f d) (\u03a3 (v : hom A a y) , (v = d)))\n      ( \\ d \u2192 hom2 A a x y u f d)\n      ( \\ d \u2192 codomain-based-paths-contraction A a x y f u d))\n#def is-segal-representable-dhom-from-contractible\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : is-contr (dhom-from-representable A a x y f u)\n  :=\n    is-contr-equiv-is-contr'\n      ( dhom-from-representable A a x y f u)\n( \u03a3 (d : hom A a y) , (hom2 A a x y u f d))\n      ( is-segal-representable-dhom-from-hom2 A is-segal-A a x y f u)\n      ( is-segal-A a x y u f)\n

Finally, we see that covariant hom families in a Segal type are covariant.

RS17, Proposition 8.13(<-)
#def is-covariant-representable-is-segal\n(A : U)\n(is-segal-A : is-segal A)\n(a : A)\n  : is-covariant A (hom A a)\n  := is-segal-representable-dhom-from-contractible A is-segal-A a\n

The proof of the claimed converse result given in the original source is circular - using Proposition 5.10, which holds only for Segal types - so instead we argue as follows:

RS17, Proposition 8.13(\u2192)
#def is-segal-is-covariant-representable\n( A : U)\n( corepresentable-family-is-covariant : (a : A) \u2192\n    is-covariant A (\\ x \u2192 hom A a x))\n  : is-segal A\n  :=\n\\ x y z f g \u2192\n    is-contr-base-is-contr-\u03a3\n( \u03a3 (h : hom A x z) , hom2 A x y z f g h)\n( \\ hk \u2192 \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk))\n    ( \\ hk \u2192 (first hk , \\ (t , s) \u2192 first hk s))\n( is-contr-equiv-is-contr'\n      ( \u03a3 ( hk : \u03a3 (h : hom A x z) , hom2 A x y z f g h) ,\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk)))\n      ( dhom-from-representable A x y z g f)\n      ( inv-equiv\n        ( dhom-from-representable A x y z g f)\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , hom2 A x y z f g h) ,\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk)))\n        ( equiv-comp\n          ( dhom-from-representable A x y z g f)\n( \u03a3 ( h : hom A x z) ,\n              ( product\n                ( hom2 A x y z f g h)\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v h)))\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , hom2 A x y z f g h) ,\n( \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v (first hk)))\n          ( representable-dhom-from-hom2-dist A x y z g f)\n          ( associative-\u03a3\n            ( hom A x z)\n            ( \\ h \u2192 hom2 A x y z f g h)\n( \\ h _ \u2192 \u03a3 (v : hom A x z) , hom2 A x x z (id-hom A x) v h))))\n      ( corepresentable-family-is-covariant x y z g f))\n

While not needed to prove Proposition 8.13, it is interesting to observe that the dependent hom types in a representable family can be understood as extension types as follows.

#def cofibration-union-test\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( ( (t , s) : 2 \u00d7 2 | (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s)) \u2192\n      A [ (t \u2261 1\u2082) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (t \u2261 1\u2082) \u2227 (s \u2261 1\u2082) \u21a6 y])\n  :=\n    cofibration-union\n    ( 2 \u00d7 2)\n    ( \\ (t , s) \u2192 (t \u2261 1\u2082) \u2227 \u0394\u00b9 s)\n    ( \\ (t , s) \u2192\n      ((t \u2261 0\u2082) \u2227 (\u0394\u00b9 s)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 0\u2082)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 1\u2082)))\n    ( \\ (t , s) \u2192 A)\n    ( \\ (t , s) \u2192\nrecOR\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t))\n#def base-hom-rewriting\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : 2 \u00d7 2 | (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s)) \u2192\n      A [ (t \u2261 1\u2082) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (t \u2261 1\u2082) \u2227 (s \u2261 1\u2082) \u21a6 y])\n    ( hom A a y)\n  :=\n    ( ( \\ v \u2192 (\\ r \u2192 v ((1\u2082 , r)))) ,\n      ( ( \\ v (t , s) \u2192 v s , \\ _ \u2192 refl) ,\n        ( \\ v (_ , s) \u2192 v s , \\ _ \u2192 refl)))\n#def base-hom-expansion\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( hom A a y)\n  :=\n    equiv-comp\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( ( (t , s) : 2 \u00d7 2 | (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s)) \u2192\n      A [ (t \u2261 1\u2082) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (t \u2261 1\u2082) \u2227 (s \u2261 1\u2082) \u21a6 y])\n    ( hom A a y)\n    ( cofibration-union-test A a x y f u)\n    ( base-hom-rewriting A a x y f u)\n#def representable-dhom-from-expansion\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    total-equiv-pullback-is-equiv\n    ( ( (t , s) : \u2202\u25a1) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n    ( hom A a y)\n    ( first (base-hom-expansion A a x y f u))\n    ( second (base-hom-expansion A a x y f u))\n    ( \\ v \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n#def representable-dhom-from-composite-expansion\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( dhom-from-representable A a x y f u)\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    equiv-right-cancel\n      ( dhom-from-representable A a x y f u)\n( \u03a3 ( sq :\n            ( (t , s) : \u2202\u25a1) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n( \u03a3 ( v : hom A a y) ,\n          ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n            A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n                (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n                (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n      ( uncurried-dhom-from-representable A a x y f u)\n      ( representable-dhom-from-expansion A a x y f u)\n#def representable-dhom-from-cofibration-composition\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n  :=\n    cofibration-composition (2 \u00d7 2) \u0394\u00b9\u00d7\u0394\u00b9 \u2202\u25a1\n      ( \\ (t , s) \u2192\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 0\u2082)) \u2228 ((\u0394\u00b9 t) \u2227 (s \u2261 1\u2082)))\n      ( \\ ts \u2192 A)\n      ( \\ (t , s) \u2192\nrecOR\n          ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t))\n#def representable-dhom-from-as-extension-type\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A a x)\n  : Equiv\n      ( dhom-from-representable A a x y f u)\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n  :=\n    equiv-right-cancel\n    ( dhom-from-representable A a x y f u)\n    ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t])\n( \u03a3 ( sq :\n          ( (t , s) : \u2202\u25a1) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 (sq (1\u2082 , s)) ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 a ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 f t]))\n    ( representable-dhom-from-composite-expansion A a x y f u)\n    ( representable-dhom-from-cofibration-composition A a x y f u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-lifts-transport-and-uniqueness","title":"Covariant lifts, transport, and uniqueness","text":"

In a covariant family C over a base type A , a term u : C x may be transported along an arrow f : hom A x y to give a term in C y.

RS17, covariant transport from beginning of Section 8.2
#def covariant-transport\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : C y\n  :=\nfirst (center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))\n

For example, if A is a Segal type and a : A, the family C x := hom A a x is covariant as shown above. Transport of an e : C x along an arrow f : hom A x y just yields composition of f with e.

RS17, Example 8.14
#def compute-covariant-transport-of-hom-family-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( e : hom A a x)\n( f : hom A x y)\n  : covariant-transport A x y f\n      (hom A a) (is-covariant-representable-is-segal A is-segal-A a) e =\n    comp-is-segal A is-segal-A a x y e f\n  :=\nrefl\n
RS17, covariant lift from beginning of Section 8.2
#def covariant-lift\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : ( dhom A x y f C u (covariant-transport A x y f C is-covariant-C u))\n  :=\nsecond (center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))\n#def covariant-uniqueness\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n( lift : dhom-from A x y f C u)\n  : ( covariant-transport A x y f C is-covariant-C u) = (first lift)\n  :=\n    first-path-\u03a3\n    ( C y)\n    ( \\ v \u2192 dhom A x y f C u v)\n    ( center-contraction (dhom-from A x y f C u) (is-covariant-C x y f u))\n    ( lift)\n    ( homotopy-contraction (dhom-from A x y f C u) (is-covariant-C x y f u) lift)\n#def covariant-uniqueness-curried\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : ( v : C y)\n  \u2192 ( dhom A x y f C u v)\n  \u2192 ( covariant-transport A x y f C is-covariant-C u) = v\n  :=\n\\ v g \u2192 covariant-uniqueness A x y f C is-covariant-C u (v, g)\n

We show that for each v : C y, the map covariant-uniqueness is an equivalence. This follows from the fact that the total spaces (summed over v : C y) of both sides are contractible.

RS17, Lemma 8.15
#def is-equiv-total-map-covariant-uniqueness-curried\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : is-equiv\n(\u03a3 (v : C y), dhom A x y f C u v)\n(\u03a3 (v : C y), covariant-transport A x y f C is-covariant-C u = v)\n      ( total-map (C y)\n        (dhom A x y f C u)\n        (\\ v \u2192 covariant-transport A x y f C is-covariant-C u = v)\n        (covariant-uniqueness-curried A x y f C is-covariant-C u)\n      )\n  :=\n    is-equiv-are-contr\n(\u03a3 (v : C y), dhom A x y f C u v)\n(\u03a3 (v : C y), covariant-transport A x y f C is-covariant-C u = v)\n      (is-covariant-C x y f u)\n      (is-contr-based-paths (C y) (covariant-transport A x y f C is-covariant-C u))\n      ( total-map (C y)\n        (dhom A x y f C u)\n        (\\ v \u2192 covariant-transport A x y f C is-covariant-C u = v)\n        (covariant-uniqueness-curried A x y f C is-covariant-C u)\n      )\n#def is-equiv-covariant-uniqueness-curried\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n( v : C y)\n  : is-equiv\n      (dhom A x y f C u v)\n      (covariant-transport A x y f C is-covariant-C u = v)\n      (covariant-uniqueness-curried A x y f C is-covariant-C u v)\n  :=\n    total-equiv-family-of-equiv\n      (C y)\n      (dhom A x y f C u)\n      (\\ v' \u2192 covariant-transport A x y f C is-covariant-C u = v')\n      (covariant-uniqueness-curried A x y f C is-covariant-C u)\n      (is-equiv-total-map-covariant-uniqueness-curried A x y f C is-covariant-C u)\n      v\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-functoriality","title":"Covariant functoriality","text":"

The covariant transport operation defines a covariantly functorial action of arrows in the base on terms in the fibers. In particular, there is an identity transport law.

#def id-dhom\n( A : U)\n( x : A)\n( C : A \u2192 U)\n( u : C x)\n  : dhom A x x (id-hom A x) C u u\n  := \\ t \u2192 u\n
RS17, Proposition 8.16, Part 2, Covariant families preserve identities
#def id-arr-covariant-transport\n( A : U)\n( x : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C x)\n  : ( covariant-transport A x x (id-hom A x) C is-covariant-C u) = u\n  :=\n    covariant-uniqueness\n      A x x (id-hom A x) C is-covariant-C u (u , id-dhom A x C u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#natural-transformations","title":"Natural transformations","text":"

A fiberwise map between covariant families is automatically \"natural\" commuting with the covariant lifts.

RS17, Proposition 8.17, Covariant naturality
#def covariant-fiberwise-transformation-application\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( u : C x)\n  : dhom-from A x y f D (\u03d5 x u)\n  :=\n    ( ( \u03d5 y (covariant-transport A x y f C is-covariant-C u)) ,\n      ( \\ t \u2192 \u03d5 (f t) (covariant-lift A x y f C is-covariant-C u t)))\n#def naturality-covariant-fiberwise-transformation\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( u : C x)\n  : ( covariant-transport A x y f D is-covariant-D (\u03d5 x u)) =\n    ( \u03d5 y (covariant-transport A x y f C is-covariant-C u))\n  :=\n    covariant-uniqueness A x y f D is-covariant-D (\u03d5 x u)\n      ( covariant-fiberwise-transformation-application\n          A x y f C D is-covariant-C \u03d5 u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#covariant-equivalence","title":"Covariant equivalence","text":"

A family of types that is equivalent to a covariant family is itself covariant.

To prove this we first show that the corresponding types of lifts with fixed domain are equivalent:

#def equiv-covariant-total-dhom\n( A : U)\n( C : A \u2192 U)\n( x y : A)\n( f : hom A x y)\n  : Equiv\n( (t : \u0394\u00b9) \u2192 C (f t))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n  :=\n    ( ( \\ h \u2192 (h 0\u2082 , \\ t \u2192 h t)) ,\n      ( ( \\ k t \u2192 (second k) t , \\ h \u2192 refl) ,\n        ( ( \\ k t \u2192 (second k) t , \\ h \u2192 refl))))\n
#section dhom-from-equivalence\n#variable A : U\n#variables B C : A \u2192 U\n#variable equiv-BC : (a : A) \u2192 Equiv (B a) (C a)\n#variables x y : A\n#variable f : hom A x y\n#def equiv-total-dhom-equiv uses (A x y)\n  : Equiv ( (t : \u0394\u00b9) \u2192 B (f t)) ((t : \u0394\u00b9) \u2192 C (f t))\n  :=\n    equiv-extension-equiv-family\n      ( extext)\n      ( 2)\n      ( \u0394\u00b9)\n      ( \\ t \u2192 B (f t))\n      ( \\ t \u2192 C (f t))\n      ( \\ t \u2192 equiv-BC (f t))\n#def equiv-total-covariant-dhom-equiv uses (extext equiv-BC)\n  : Equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n  :=\n    equiv-triple-comp\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( (t : \u0394\u00b9) \u2192 B (f t))\n( (t : \u0394\u00b9) \u2192 C (f t))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n( inv-equiv\n      ( (t : \u0394\u00b9) \u2192 B (f t))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n      ( equiv-covariant-total-dhom A B x y f))\n    ( equiv-total-dhom-equiv)\n    ( equiv-covariant-total-dhom A C x y f)\n#def equiv-pullback-total-covariant-dhom-equiv uses (A y)\n  : Equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n  :=\n    total-equiv-pullback-is-equiv\n      ( B x)\n      ( C x)\n      ( first (equiv-BC x))\n      ( second (equiv-BC x))\n( \\ u \u2192 ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n#def is-equiv-to-pullback-total-covariant-dhom-equiv uses (extext A y)\n  : is-equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n    ( \\ (i , h) \u2192 (i , \\ t \u2192 (first (equiv-BC (f t))) (h t)))\n  :=\n    is-equiv-right-factor\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n( \u03a3 (u : C x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 u]))\n    ( \\ (i , h) \u2192 (i , \\ t \u2192 (first (equiv-BC (f t))) (h t)))\n    ( first (equiv-pullback-total-covariant-dhom-equiv))\n    ( second (equiv-pullback-total-covariant-dhom-equiv))\n    ( second (equiv-total-covariant-dhom-equiv))\n#def equiv-to-pullback-total-covariant-dhom-equiv uses (extext A y)\n  : Equiv\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i]))\n( \u03a3 (i : B x) , ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i]))\n  :=\n    ( \\ (i , h) \u2192 (i , \\ t \u2192 (first (equiv-BC (f t))) (h t)) ,\n      is-equiv-to-pullback-total-covariant-dhom-equiv)\n#def family-equiv-dhom-family-equiv uses (extext A y)\n(i : B x)\n  : Equiv\n( (t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i])\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i])\n  :=\n    family-equiv-total-equiv\n    ( B x)\n( \\ ii \u2192 ((t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 ii]))\n( \\ ii \u2192 ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) ii]))\n    ( \\ ii h t \u2192 (first (equiv-BC (f t))) (h t))\n    ( is-equiv-to-pullback-total-covariant-dhom-equiv)\n    ( i)\n#end dhom-from-equivalence\n

Now we introduce the hypothesis that C is covariant in the form of has-unique-fixed-domain-lifts.

#def equiv-has-unique-fixed-domain-lifts uses (extext)\n( A : U)\n( B C : A \u2192 U)\n( equiv-BC : (a : A) \u2192 Equiv (B a) (C a))\n( has-unique-fixed-domain-lifts-C :\n    has-unique-fixed-domain-lifts A C)\n  : has-unique-fixed-domain-lifts A B\n  :=\n\\ x y f i \u2192\n    is-contr-equiv-is-contr'\n( (t : \u0394\u00b9) \u2192 B (f t) [t \u2261 0\u2082 \u21a6 i])\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 0\u2082 \u21a6 (first (equiv-BC x)) i])\n    ( family-equiv-dhom-family-equiv A B C equiv-BC x y f i)\n    ( has-unique-fixed-domain-lifts-C x y f ((first (equiv-BC x)) i))\n#def equiv-is-covariant uses (extext)\n( A : U)\n( B C : A \u2192 U)\n( equiv-BC : (a : A) \u2192 Equiv (B a) (C a))\n( is-covariant-C : is-covariant A C)\n  : is-covariant A B\n  :=\n    ( first (has-unique-fixed-domain-lifts-iff-is-covariant A B))\n      ( equiv-has-unique-fixed-domain-lifts\n        A B C equiv-BC\n        ( (second (has-unique-fixed-domain-lifts-iff-is-covariant A C))\n          is-covariant-C))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-families","title":"Contravariant families","text":"

A family of types over a base type is contravariant if every arrow in the base has a unique lift with specified codomain.

#def dhom-to\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( v : C y)\n  : U\n  := ( \u03a3 (u : C x) , dhom A x y f C u v)\n
RS17, Definition 8.2, dual form
#def is-contravariant\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (v : C y) \u2192\n    is-contr (dhom-to A x y f C v)\n
The type of contravariant families over a fixed type
#def contravariant-family (A : U) : U\n  := ( \u03a3 (C : A \u2192 U) , is-contravariant A C)\n

The notion of a contravariant family is stable under substitution into the base.

RS17, Remark 8.3, dual form
#def is-contravariant-substitution-is-contravariant\n( A B : U)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( g : B \u2192 A)\n  : is-contravariant B (\\ b \u2192 C (g b))\n  := \\ x y f v \u2192 is-contravariant-C (g x) (g y) (ap-hom B A g x y f) v\n

The notion of having a unique lift with a fixed codomain may also be expressed by contractibility of the type of extensions along the codomain inclusion into the 1-simplex.

#def has-unique-fixed-codomain-lifts\n( A : U)\n( C : A \u2192 U)\n  : U\n  :=\n( x : A) \u2192 (y : A) \u2192 (f : hom A x y) \u2192 (v : C y) \u2192\n    is-contr ((t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n

These two notions of covariance are equivalent because the two types of lifts of a base arrow with fixed codomain are equivalent. Note that this is not quite an instance of Theorem 4.4 but its proof, with a very small modification, works here.

#def equiv-lifts-with-fixed-codomain\n( A : U)\n( C : A \u2192 U)\n( x y : A)\n( f : hom A x y)\n( v : C y)\n  : Equiv\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n      ( dhom-to A x y f C v)\n  :=\n    ( ( \\ h \u2192 (h 0\u2082 , \\ t \u2192 h t)) ,\n      ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl) ,\n        ( ( \\ fg t \u2192 (second fg) t , \\ h \u2192 refl))))\n

By the equivalence-invariance of contractibility, this proves the desired logical equivalence

#def is-contravariant-has-unique-fixed-codomain-lifts\n( A : U)\n( C : A \u2192 U)\n  : (has-unique-fixed-codomain-lifts A C) \u2192 ( is-contravariant A C)\n  :=\n\\ C-has-unique-lifts x y f v \u2192\n      is-contr-equiv-is-contr\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n      ( dhom-to A x y f C v)\n      ( equiv-lifts-with-fixed-codomain A C x y f v)\n      ( C-has-unique-lifts x y f v)\n#def has-unique-fixed-codomain-lifts-is-contravariant\n( A : U)\n( C : A \u2192 U)\n  : (is-contravariant A C) \u2192 (has-unique-fixed-codomain-lifts A C)\n  :=\n\\ is-contravariant-C x y f v \u2192\n      is-contr-equiv-is-contr'\n( (t : \u0394\u00b9) \u2192 C (f t) [t \u2261 1\u2082 \u21a6 v])\n      ( dhom-to A x y f C v)\n      ( equiv-lifts-with-fixed-codomain A C x y f v)\n      ( is-contravariant-C x y f v)\n
RS17, Proposition 8.4
#def has-unique-fixed-codomain-lifts-iff-is-contravariant\n( A : U)\n( C : A \u2192 U)\n  : iff\n      ( has-unique-fixed-codomain-lifts A C)\n      ( is-contravariant A C)\n  :=\n    ( is-contravariant-has-unique-fixed-codomain-lifts A C,\n      has-unique-fixed-codomain-lifts-is-contravariant A C)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#representable-contravariant-families","title":"Representable contravariant families","text":"

If A is a Segal type and a : A is any term, then the family \\ x \u2192 hom A x a defines a contravariant family over A , and conversely if this family is contravariant for every a : A , then A must be a Segal type. The proof involves a rather lengthy composition of equivalences.

#def dhom-contra-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A x a)\n( v : hom A y a)\n  : U\n  := dhom A x y f (\\ z \u2192 hom A z a) u v\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-contra-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( u : hom A x a)\n( v : hom A y a)\n  : Equiv\n    ( dhom-contra-representable A a x y f u v)\n    ( ((t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n      A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a])\n  :=\n    curry-uncurry 2 2 \u0394\u00b9 \u2202\u0394\u00b9 \u0394\u00b9 \u2202\u0394\u00b9 (\\ t s \u2192 A)\n      ( \\ (t , s) \u2192\nrecOR\n        ( (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n          (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n          (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a))\n#def dhom-to-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : U\n  := dhom-to A x y f (\\ z \u2192 hom A z a) v\n

By uncurrying (RS 4.2) we have an equivalence:

#def uncurried-dhom-to-representable\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (u : hom A x a) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n  :=\n    total-equiv-family-equiv\n    ( hom A x a)\n    ( \\ u \u2192 dhom-contra-representable A a x y f u v)\n    ( \\ u \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n    ( \\ u \u2192 uncurried-dhom-contra-representable A a x y f u v)\n#def representable-dhom-to-uncurry-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n( \u03a3 ( u : hom A x a) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n( \u03a3 (u : hom A x a) ,\n(\u03a3 (d : hom A x a) ,\n        product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n  :=\n    total-equiv-family-equiv (hom A x a)\n    ( \\ u \u2192\n      ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n        A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n            (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n            (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n( \\ u \u2192\n      \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n    ( \\ u \u2192 equiv-square-hom2-pushout A x a y a u (id-hom A a) f v)\n#def representable-dhom-to-hom2\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) ,\n( \u03a3 (u : hom A x a) ,\n        product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n  :=\n    equiv-triple-comp\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( u : hom A x a) ,\n        ( ( (t , s) : \u0394\u00b9\u00d7\u0394\u00b9) \u2192\n          A [ (t \u2261 0\u2082) \u2227 (\u0394\u00b9 s) \u21a6 u s ,\n              (t \u2261 1\u2082) \u2227 (\u0394\u00b9 s) \u21a6 v s ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 0\u2082) \u21a6 f t ,\n              (\u0394\u00b9 t) \u2227 (s \u2261 1\u2082) \u21a6 a]))\n( \u03a3 ( u : hom A x a) ,\n( \u03a3 ( d : hom A x a) ,\n            ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n    ( uncurried-dhom-to-representable A a x y f v)\n    ( representable-dhom-to-uncurry-hom2 A a x y f v)\n    ( fubini-\u03a3 (hom A x a) (hom A x a)\n      ( \\ u d \u2192 product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n#def representable-dhom-to-hom2-swap\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))))\n  :=\n    equiv-comp\n      ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n              ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 ( u : hom A x a) ,\n              ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))))\n      ( representable-dhom-to-hom2 A a x y f v)\n      ( total-equiv-family-equiv (hom A x a)\n(\\ d \u2192\n          \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d)))\n( \\ d \u2192\n          \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d)))\n        ( \\ d \u2192 total-equiv-family-equiv (hom A x a)\n          ( \\ u \u2192 product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))\n          ( \\ u \u2192 product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))\n          ( \\ u \u2192\n            sym-product (hom2 A x a a u (id-hom A a) d) (hom2 A x y a f v d))))\n#def representable-dhom-to-hom2-dist\n( A : U)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n      ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n          ( product\n            ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d)))\n  :=\n    equiv-right-cancel\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) ,\n        ( product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d)))\n( \u03a3 ( d : hom A x a) ,\n( \u03a3 (u : hom A x a) ,\n          product\n          ( hom2 A x y a f v d)\n          ( hom2 A x a a u (id-hom A a) d)))\n    ( representable-dhom-to-hom2-swap A a x y f v)\n    ( total-equiv-family-equiv (hom A x a)\n      ( \\ d \u2192\n        ( product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d)))\n( \\ d \u2192\n        ( \u03a3 ( u : hom A x a) ,\n            ( product (hom2 A x y a f v d) (hom2 A x a a u (id-hom A a) d))))\n      ( \\ d \u2192\n        ( distributive-product-\u03a3\n          ( hom2 A x y a f v d)\n          ( hom A x a)\n          ( \\ u \u2192 hom2 A x a a u (id-hom A a) d))))\n

Now we introduce the hypothesis that A is Segal type.

#def representable-dhom-to-path-space-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d))))\n  :=\n    equiv-right-cancel\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d))))\n( \u03a3 ( d : hom A x a) ,\n        ( product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , (hom2 A x a a u (id-hom A a) d))))\n    ( representable-dhom-to-hom2-dist A a x y f v)\n    ( total-equiv-family-equiv (hom A x a)\n      ( \\ d \u2192 product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d)))\n      ( \\ d \u2192\n        product\n          ( hom2 A x y a f v d)\n( \u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d))\n      ( \\ d \u2192\n        total-equiv-family-equiv\n          ( hom2 A x y a f v d)\n( \\ \u03b1 \u2192 (\u03a3 (u : hom A x a) , (u = d)))\n( \\ \u03b1 \u2192 (\u03a3 (u : hom A x a) , hom2 A x a a u (id-hom A a) d))\n          ( \\ \u03b1 \u2192\n          ( total-equiv-family-equiv\n            ( hom A x a)\n            ( \\ u \u2192 (u = d))\n            ( \\ u \u2192 hom2 A x a a u (id-hom A a) d)\n            ( \\ u \u2192 equiv-homotopy-hom2'-is-segal A is-segal-A x a u d)))))\n#def is-segal-representable-dhom-to-hom2\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : Equiv\n    ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) , (hom2 A x y a f v d))\n  :=\n    equiv-comp\n    ( dhom-to-representable A a x y f v)\n( \u03a3 ( d : hom A x a) ,\n        ( product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d))))\n( \u03a3 (d : hom A x a) , (hom2 A x y a f v d))\n    ( representable-dhom-to-path-space-is-segal A is-segal-A a x y f v)\n    ( total-equiv-family-equiv\n      ( hom A x a)\n      ( \\ d \u2192 product (hom2 A x y a f v d) (\u03a3 (u : hom A x a) , (u = d)))\n      ( \\ d \u2192 hom2 A x y a f v d)\n      ( \\ d \u2192 codomain-based-paths-contraction A x y a v f d))\n#def is-segal-representable-dhom-to-contractible\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A x y)\n( v : hom A y a)\n  : is-contr (dhom-to-representable A a x y f v)\n  :=\n    is-contr-equiv-is-contr'\n      ( dhom-to-representable A a x y f v)\n( \u03a3 (d : hom A x a) , (hom2 A x y a f v d))\n      ( is-segal-representable-dhom-to-hom2 A is-segal-A a x y f v)\n      ( is-segal-A x y a f v)\n

Finally, we see that contravariant hom families in a Segal type are contravariant.

RS17, Proposition 8.13(<-), dual
#def is-contravariant-representable-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n  : is-contravariant A (\\ x \u2192 hom A x a)\n  := is-segal-representable-dhom-to-contractible A is-segal-A a\n

The proof of the claimed converse result given in the original source is circular - using Proposition 5.10, which holds only for Segal types - so instead we argue as follows:

RS17, Proposition 8.13(\u2192), dual
#def is-segal-is-contravariant-representable\n( A : U)\n( representable-family-is-contravariant : (a : A) \u2192\n    is-contravariant A (\\ x \u2192 hom A x a))\n  : is-segal A\n  :=\n\\ x y z f g \u2192\n      is-contr-base-is-contr-\u03a3\n( \u03a3 (h : hom A x z) , (hom2 A x y z f g h))\n( \\ hk \u2192 \u03a3 (u : hom A x z) , (hom2 A x z z u (id-hom A z) (first hk)))\n      ( \\ hk \u2192 (first hk , \\ (t , s) \u2192 first hk t))\n( is-contr-equiv-is-contr'\n        ( \u03a3 ( hk : \u03a3 (h : hom A x z) , (hom2 A x y z f g h)) ,\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) (first hk)))\n        ( dhom-to-representable A z x y f g)\n        ( inv-equiv\n          ( dhom-to-representable A z x y f g)\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , (hom2 A x y z f g h)) ,\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) (first hk)))\n          ( equiv-comp\n            ( dhom-to-representable A z x y f g)\n( \u03a3 ( h : hom A x z) ,\n                ( product\n                  ( hom2 A x y z f g h)\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) h)))\n( \u03a3 ( hk : \u03a3 (h : hom A x z) , (hom2 A x y z f g h)) ,\n( \u03a3 (u : hom A x z) , hom2 A x z z u (id-hom A z) (first hk)))\n            ( representable-dhom-to-hom2-dist A z x y f g)\n            ( associative-\u03a3\n              ( hom A x z)\n              ( \\ h \u2192 hom2 A x y z f g h)\n( \\ h _ \u2192 \u03a3 (u : hom A x z) , (hom2 A x z z u (id-hom A z) h)))))\n              ( representable-family-is-contravariant z x y f g))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-lifts-transport-and-uniqueness","title":"Contravariant lifts, transport, and uniqueness","text":"

In a contravariant family C over a base type A, a term v : C y may be transported along an arrow f : hom A x y to give a term in C x.

RS17, contravariant transport from beginning of Section 8.2
#def contravariant-transport\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C y)\n  : C x\n  :=\nfirst\n      ( center-contraction (dhom-to A x y f C v) (is-contravariant-C x y f v))\n
RS17, contravariant lift from beginning of Section 8.2
#def contravariant-lift\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C y)\n  : ( dhom A x y f C (contravariant-transport A x y f C is-contravariant-C v) v)\n  :=\nsecond\n      ( center-contraction (dhom-to A x y f C v) (is-contravariant-C x y f v))\n#def contravariant-uniqueness\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C y)\n( lift : dhom-to A x y f C v)\n  : ( contravariant-transport A x y f C is-contravariant-C v) = (first lift)\n  :=\n    first-path-\u03a3\n    ( C x)\n    ( \\ u \u2192 dhom A x y f C u v)\n    ( center-contraction\n      ( dhom-to A x y f C v)\n      ( is-contravariant-C x y f v))\n    ( lift)\n    ( homotopy-contraction\n      ( dhom-to A x y f C v)\n      ( is-contravariant-C x y f v)\n      ( lift))\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-functoriality","title":"Contravariant functoriality","text":"

The contravariant transport operation defines a comtravariantly functorial action of arrows in the base on terms in the fibers. In particular, there is an identity transport law.

RS17, Proposition 8.16, Part 2, dual, Contravariant families preserve identities
#def id-arr-contravariant-transport\n( A : U)\n( x : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( u : C x)\n  : ( contravariant-transport A x x (id-hom A x) C is-contravariant-C u) = u\n  :=\n    contravariant-uniqueness A x x (id-hom A x) C is-contravariant-C u\n      ( u , id-dhom A x C u)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#contravariant-natural-transformations","title":"Contravariant natural transformations","text":"

A fiberwise map between contrvariant families is automatically \"natural\" commuting with the contravariant lifts.

RS17, Proposition 8.17, dual, Contravariant naturality
#def contravariant-fiberwise-transformation-application\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( v : C y)\n  : dhom-to A x y f D (\u03d5 y v)\n  :=\n    ( \u03d5 x (contravariant-transport A x y f C is-contravariant-C v) ,\n\\ t \u2192 \u03d5 (f t) (contravariant-lift A x y f C is-contravariant-C v t))\n#def naturality-contravariant-fiberwise-transformation\n( A : U)\n( x y : A)\n( f : hom A x y)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03d5 : (z : A) \u2192 C z \u2192 D z)\n( v : C y)\n  : ( contravariant-transport A x y f D is-contravariant-D (\u03d5 y v)) =\n    ( \u03d5 x (contravariant-transport A x y f C is-contravariant-C v))\n  :=\n    contravariant-uniqueness A x y f D is-contravariant-D (\u03d5 y v)\n    ( contravariant-fiberwise-transformation-application\n        A x y f C D is-contravariant-C \u03d5 v)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#two-sided-discrete-fibrations","title":"Two sided discrete fibrations","text":"RS17, Definition 8.28
#def is-two-sided-discrete\n( A B : U)\n( C : A \u2192 B \u2192 U)\n  : U\n  :=\n    product\n( (a : A) \u2192 is-covariant B (\\b \u2192 C a b))\n( (b : B) \u2192 is-contravariant A (\\ a \u2192 C a b))\n
RS17, Proposition 8.29
#def is-two-sided-discrete-hom-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n  : is-two-sided-discrete A A (hom A)\n  :=\n    ( is-covariant-representable-is-segal A is-segal-A ,\n      is-contravariant-representable-is-segal A is-segal-A)\n
"},{"location":"simplicial-hott/08-covariant.rzk/#closure-properties-of-covariance","title":"Closure properties of covariance","text":"RS17, Theorem 8.30
#def is-covariant-is-locally-covariant uses (weakfunext)\n( A B : U)\n( C : A \u2192 B \u2192 U)\n( is-locally-covariant : (b : B) \u2192 is-covariant A ( \\ a \u2192 C a b ) )\n  : is-covariant A ( \\ a \u2192 (( b : B ) \u2192 (C a b)))\n  :=\n    is-covariant-has-unique-fixed-domain-lifts\n      ( A)\n( \\ a \u2192 ( b : B ) \u2192 (C a b) )\n( \\ x y f g \u2192\n        equiv-with-contractible-codomain-implies-contractible-domain\n          ( (t : \u0394\u00b9) \u2192 ((b : B) \u2192 C (f t) b) [  t \u2261 0\u2082 \u21a6 g ])\n( (b : B) \u2192 (t : \u0394\u00b9) \u2192 C (f t) b [ t \u2261 0\u2082 \u21a6 g b])\n          ( flip-ext-fun 2 \u0394\u00b9 (\\ t \u2192 t \u2261 0\u2082) B ( \\ t \u2192  C (f t)) ( \\ t \u2192 g))\n( weakfunext B\n            ( \\ b \u2192 ( (t : \u0394\u00b9) \u2192 C (f t) b [ t \u2261 0\u2082 \u21a6 g b] ) )\n            ( \\ b \u2192\n              ( has-unique-fixed-domain-lifts-is-covariant\n                ( A)\n                ( \\ a  \u2192 (C a b))\n                ( is-locally-covariant b))\n             x y f (g b))))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/","title":"The Yoneda lemma","text":"

These formalisations correspond to Section 9 of the RS17 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#prerequisites","title":"Prerequisites","text":"

Some of the definitions in this file rely on function extensionality and extension extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#natural-transformations-involving-a-representable-functor","title":"Natural transformations involving a representable functor","text":"

Fix a Segal type A and a term a : A. The Yoneda lemma characterizes natural transformations from the representable type family hom A a : A \u2192 U to a covariant type family C : A \u2192 U.

Ordinarily, such a natural transformation would involve a family of maps

\u03d5 : (z : A) \u2192 hom A a z \u2192 C z

together with a proof of naturality of these components, but by naturality-covariant-fiberwise-transformation naturality is automatic.

#def naturality-covariant-fiberwise-representable-transformation\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A a x)\n( g : hom A x y)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n  : (covariant-transport A x y g C is-covariant-C (\u03d5 x f)) =\n    (\u03d5 y (comp-is-segal A is-segal-A a x y f g))\n  :=\n    naturality-covariant-fiberwise-transformation A x y g\n      (\\ z \u2192 hom A a z)\n      ( C)\n      ( is-covariant-representable-is-segal A is-segal-A a)\n      ( is-covariant-C)\n      ( \u03d5)\n      ( f)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#the-yoneda-maps","title":"The Yoneda maps","text":"

For any Segal type A and term a : A, the Yoneda lemma provides an equivalence between the type (z : A) \u2192 hom A a z \u2192 C z of natural transformations out of the functor hom A a and values in an arbitrary covariant family C and the type C a.

One of the maps in this equivalence is evaluation at the identity. The inverse map makes use of the covariant transport operation.

The following map, evid, evaluates a natural transformation out of a representable functor at the identity arrow.

#def evid\n( A : U)\n( a : A)\n( C : A \u2192 U)\n  : ( (z : A) \u2192 hom A a z \u2192 C z) \u2192 C a\n  := \\ \u03d5 \u2192 \u03d5 a (id-hom A a)\n

The inverse map only exists for Segal types.

#def yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : C a \u2192 ( (z : A) \u2192 hom A a z \u2192 C z)\n  := \\ u x f \u2192 covariant-transport A a x f C is-covariant-C u\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#the-yoneda-composites","title":"The Yoneda composites","text":"

It remains to show that the Yoneda maps are inverses. One retraction is straightforward:

#def evid-yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( u : C a)\n  : ( evid A a C) ((yon A is-segal-A a C is-covariant-C) u) = u\n  := id-arr-covariant-transport A a C is-covariant-C u\n

The other composite carries \u03d5 to an a priori distinct natural transformation. We first show that these are pointwise equal at all x : A and f : hom A a x in two steps.

#section yon-evid\n#variable A : U\n#variable is-segal-A : is-segal A\n#variable a : A\n#variable C : A \u2192 U\n#variable is-covariant-C : is-covariant A C\n

The composite yon-evid of \u03d5 equals \u03d5 at all x : A and f : hom A a x.

#def yon-evid-twice-pointwise\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n( x : A)\n( f : hom A a x)\n  : ( (yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x f = \u03d5 x f\n  :=\n    concat\n      ( C x)\n      ( ((yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x f)\n      ( \u03d5 x (comp-is-segal A is-segal-A a a x (id-hom A a) f))\n      ( \u03d5 x f)\n      ( naturality-covariant-fiberwise-representable-transformation\n        A is-segal-A a a x (id-hom A a) f C is-covariant-C \u03d5)\n      ( ap\n        ( hom A a x)\n        ( C x)\n        ( comp-is-segal A is-segal-A a a x (id-hom A a) f)\n        ( f)\n        ( \u03d5 x)\n        ( id-comp-is-segal A is-segal-A a x f))\n

By funext, these are equals as functions of f pointwise in x.

#def yon-evid-once-pointwise uses (funext)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n( x : A)\n  : ( (yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x = \u03d5 x\n  :=\n    eq-htpy funext\n      ( hom A a x)\n      ( \\ f \u2192 C x)\n      ( \\ f \u2192 ((yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x f)\n      ( \\ f \u2192 (\u03d5 x f))\n      ( \\ f \u2192 yon-evid-twice-pointwise \u03d5 x f)\n

By funext again, these are equal as functions of x and f.

#def yon-evid uses (funext)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n  : ( (yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) = \u03d5\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 (hom A a x \u2192 C x))\n      ( \\ x \u2192 ((yon A is-segal-A a C is-covariant-C) ((evid A a C) \u03d5)) x)\n      ( \\ x \u2192 (\u03d5 x))\n      ( \\ x \u2192 yon-evid-once-pointwise \u03d5 x)\n#end yon-evid\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#the-yoneda-lemma_1","title":"The Yoneda lemma","text":"

The Yoneda lemma says that evaluation at the identity defines an equivalence. This is proven combining the previous steps.

RS17, Theorem 9.1
#def yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-equiv ((z : A) \u2192 hom A a z \u2192 C z) (C a) (evid A a C)\n  :=\n    ( ( ( yon A is-segal-A a C is-covariant-C) ,\n        ( yon-evid A is-segal-A a C is-covariant-C)) ,\n      ( ( yon A is-segal-A a C is-covariant-C) ,\n        ( evid-yon A is-segal-A a C is-covariant-C)))\n

For later use, we observe that the same proof shows that the inverse map is an equivalence.

#def inv-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-equiv (C a) ((z : A) \u2192 hom A a z \u2192 C z)\n      ( yon A is-segal-A a C is-covariant-C)\n  :=\n    ( ( ( evid A a C) ,\n        ( evid-yon A is-segal-A a C is-covariant-C)) ,\n      ( ( evid A a C) ,\n        ( yon-evid A is-segal-A a C is-covariant-C)))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#naturality","title":"Naturality","text":"

The equivalence of the Yoneda lemma is natural in both a : A and C : A \u2192 U.

Naturality in a follows from the fact that the maps evid and yon are fiberwise equivalences between covariant families over A, though it requires some work to prove that the domain is covariant.

#def is-covariant-yoneda-domain uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-covariant A (\\ a \u2192 (z : A) \u2192 hom A a z \u2192 C z)\n  :=\n    equiv-is-covariant\n    ( extext)\n    ( A)\n( \\ a -> (z : A) \u2192 hom A a z \u2192 C z)\n    ( C)\n    ( \\ a -> (evid A a C , yoneda-lemma A is-segal-A a C is-covariant-C))\n    ( is-covariant-C)\n#def is-natural-in-object-evid uses (funext extext)\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( f : hom A a b)\n( C : A -> U)\n( is-covariant-C : is-covariant A C)\n( \u03d5 : (z : A) \u2192 hom A a z \u2192 C z)\n  : ( covariant-transport A a b f C is-covariant-C (evid A a C \u03d5)) =\n( evid A b C\n\n      ( covariant-transport A a b f\n        ( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n        ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C) \u03d5))\n  :=\n    naturality-covariant-fiberwise-transformation\n    ( A)\n    ( a)\n    ( b)\n    ( f)\n( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n    ( C)\n    ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C)\n    ( is-covariant-C)\n    ( \\ x -> evid A x C)\n    ( \u03d5)\n#def is-natural-in-object-yon uses (funext extext)\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( f : hom A a b)\n( C : A -> U)\n( is-covariant-C : is-covariant A C)\n( u : C a)\n  : ( covariant-transport\n      A a b f\n      ( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n      ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C)\n      ( yon A is-segal-A a C is-covariant-C u)) =\n    ( yon A is-segal-A b C is-covariant-C\n      ( covariant-transport A a b f C is-covariant-C u))\n  :=\n    naturality-covariant-fiberwise-transformation\n    ( A)\n    ( a)\n    ( b)\n    ( f)\n    ( C)\n( \\ x -> (z : A) \u2192 hom A x z \u2192 C z)\n    ( is-covariant-C)\n    ( is-covariant-yoneda-domain A is-segal-A C is-covariant-C)\n    ( \\ x -> yon A is-segal-A x C is-covariant-C)\n    ( u)\n

Naturality in C is not automatic but can be proven easily:

RS17, Lemma 9.2(i)
#def is-natural-in-family-evid\n( A : U)\n( a : A)\n( C D : A \u2192 U)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( \u03c6 : (z : A) \u2192 hom A a z \u2192 C z)\n  : ( comp ((z : A) \u2192 hom A a z \u2192 C z) (C a) (D a) (\u03c8 a) (evid A a C)) \u03c6 =\n( comp ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z) (D a)\n    ( evid A a D) ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))) \u03c6\n  := refl\n
RS17, Lemma 9.2(ii)
#def is-natural-in-family-yon-twice-pointwise\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n( f : hom A a x)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x f =\n    ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x f\n  :=\n    naturality-covariant-fiberwise-transformation\n      A a x f C D is-covariant-C is-covariant-D \u03c8 u\n#def is-natural-in-family-yon-once-pointwise uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x =\n    ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x\n  :=\n    eq-htpy funext\n      ( hom A a x)\n      ( \\ f \u2192 D x)\n      ( \\ f \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n          ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x f)\n      ( \\ f \u2192\n        ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x f)\n      ( \\ f \u2192\n        is-natural-in-family-yon-twice-pointwise\n          A is-segal-A a C D is-covariant-C is-covariant-D \u03c8 u x f)\n#def is-natural-in-family-yon uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( is-covariant-D : is-covariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u =\n    ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 hom A a x \u2192 D x)\n      ( \\ x \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A a z \u2192 D z)\n          ( yon A is-segal-A a D is-covariant-D) (\u03c8 a)) u x)\n      ( \\ x \u2192\n        ( comp (C a) ((z : A) \u2192 hom A a z \u2192 C z) ((z : A) \u2192 hom A a z \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g)) (yon A is-segal-A a C is-covariant-C)) u x)\n      ( \\ x \u2192\n        is-natural-in-family-yon-once-pointwise\n          A is-segal-A a C D is-covariant-C is-covariant-D \u03c8 u x)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#yoneda-for-contravariant-families","title":"Yoneda for contravariant families","text":"

Dually, the Yoneda lemma for contravariant type families characterizes natural transformations from the contravariant family represented by a term a : A in a Segal type to a contravariant type family C : A \u2192 U.

By naturality-contravariant-fiberwise-transformation naturality is again automatic.

#def naturality-contravariant-fiberwise-representable-transformation\n( A : U)\n( is-segal-A : is-segal A)\n( a x y : A)\n( f : hom A y a)\n( g : hom A x y)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n  : ( contravariant-transport A x y g C is-contravariant-C (\u03d5 y f)) =\n    ( \u03d5 x (comp-is-segal A is-segal-A x y a g f))\n  :=\n    naturality-contravariant-fiberwise-transformation A x y g\n      ( \\ z \u2192 hom A z a) C\n      ( is-contravariant-representable-is-segal A is-segal-A a)\n      ( is-contravariant-C)\n      ( \u03d5)\n      ( f)\n

For any Segal type A and term a : A, the contravariant Yoneda lemma provides an equivalence between the type (z : A) \u2192 hom A z a \u2192 C z of natural transformations out of the functor \\ z \u2192 hom A z a and valued in an arbitrary contravariant family C and the type C a.

One of the maps in this equivalence is evaluation at the identity. The inverse map makes use of the contravariant transport operation.

The following map, contra-evid evaluates a natural transformation out of a representable functor at the identity arrow.

#def contra-evid\n( A : U)\n( a : A)\n( C : A \u2192 U)\n  : ( (z : A) \u2192 hom A z a \u2192 C z) \u2192 C a\n  := \\ \u03d5 \u2192 \u03d5 a (id-hom A a)\n

The inverse map only exists for Segal types and contravariant families.

#def contra-yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : C a \u2192 ((z : A) \u2192 hom A z a \u2192 C z)\n  := \\ v z f \u2192 contravariant-transport A z a f C is-contravariant-C v\n

It remains to show that the Yoneda maps are inverses. One retraction is straightforward:

#def contra-evid-yon\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( v : C a)\n  : contra-evid A a C ((contra-yon A is-segal-A a C is-contravariant-C) v) = v\n  := id-arr-contravariant-transport A a C is-contravariant-C v\n

The other composite carries \u03d5 to an a priori distinct natural transformation. We first show that these are pointwise equal at all x : A and f : hom A x a in two steps.

#section contra-yon-evid\n#variable A : U\n#variable is-segal-A : is-segal A\n#variable a : A\n#variable C : A \u2192 U\n#variable is-contravariant-C : is-contravariant A C\n

The composite contra-yon-evid of \u03d5 equals \u03d5 at all x : A and f : hom A x a.

#def contra-yon-evid-twice-pointwise\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n( x : A)\n( f : hom A x a)\n  : ( (contra-yon A is-segal-A a C is-contravariant-C)\n        ((contra-evid A a C) \u03d5)) x f = \u03d5 x f\n  :=\n    concat\n      ( C x)\n      ( ((contra-yon A is-segal-A a C is-contravariant-C)\n            ((contra-evid A a C) \u03d5)) x f)\n      ( \u03d5 x (comp-is-segal A is-segal-A x a a f (id-hom A a)))\n      ( \u03d5 x f)\n      ( naturality-contravariant-fiberwise-representable-transformation\n          A is-segal-A a x a (id-hom A a) f C is-contravariant-C \u03d5)\n      ( ap\n        ( hom A x a)\n        ( C x)\n        ( comp-is-segal A is-segal-A x a a f (id-hom A a))\n        ( f)\n        ( \u03d5 x)\n        ( comp-id-is-segal A is-segal-A x a f))\n

By funext, these are equals as functions of f pointwise in x.

#def contra-yon-evid-once-pointwise uses (funext)\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n( x : A)\n  : ( (contra-yon A is-segal-A a C is-contravariant-C)\n        ( (contra-evid A a C) \u03d5)) x = \u03d5 x\n  :=\n    eq-htpy funext\n      ( hom A x a)\n      ( \\ f \u2192 C x)\n      ( \\ f \u2192\n        ( (contra-yon A is-segal-A a C is-contravariant-C)\n          ( (contra-evid A a C) \u03d5)) x f)\n      ( \\ f \u2192 (\u03d5 x f))\n      ( \\ f \u2192 contra-yon-evid-twice-pointwise \u03d5 x f)\n

By funext again, these are equal as functions of x and f.

#def contra-yon-evid uses (funext)\n( \u03d5 : (z : A) \u2192 hom A z a \u2192 C z)\n  : contra-yon A is-segal-A a C is-contravariant-C (contra-evid A a C \u03d5) = \u03d5\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 (hom A x a \u2192 C x))\n      ( contra-yon A is-segal-A a C is-contravariant-C (contra-evid A a C \u03d5))\n      ( \u03d5)\n      ( contra-yon-evid-once-pointwise \u03d5)\n#end contra-yon-evid\n

The contravariant Yoneda lemma says that evaluation at the identity defines an equivalence.

#def contra-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : is-equiv ((z : A) \u2192 hom A z a \u2192 C z) (C a) (contra-evid A a C)\n  :=\n    ( ( ( contra-yon A is-segal-A a C is-contravariant-C) ,\n        ( contra-yon-evid A is-segal-A a C is-contravariant-C)) ,\n      ( ( contra-yon A is-segal-A a C is-contravariant-C) ,\n        ( contra-evid-yon A is-segal-A a C is-contravariant-C)))\n

For later use, we observe that the same proof shows that the inverse map is an equivalence.

#def inv-contra-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : is-equiv (C a) ((z : A) \u2192 hom A z a \u2192 C z)\n      ( contra-yon A is-segal-A a C is-contravariant-C)\n  :=\n    ( ( ( contra-evid A a C) ,\n        ( contra-evid-yon A is-segal-A a C is-contravariant-C)) ,\n      ( ( contra-evid A a C) ,\n        ( contra-yon-evid A is-segal-A a C is-contravariant-C)))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#contravariant-naturality","title":"Contravariant Naturality","text":"

The equivalence of the Yoneda lemma is natural in both a : A and C : A \u2192 U.

Naturality in a follows from the fact that the maps evid and yon are fiberwise equivalences between contravariant families over A, though it requires some work, which has not yet been formalized, to prove that the domain is contravariant.

Naturality in C is not automatic but can be proven easily:

RS17, Lemma 9.2(i), dual
#def is-natural-in-family-contra-evid\n( A : U)\n( a : A)\n( C D : A \u2192 U)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( \u03c6 : (z : A) \u2192 hom A z a \u2192 C z)\n  : ( comp ((z : A) \u2192 hom A z a \u2192 C z) (C a) (D a)\n      ( \u03c8 a) (contra-evid A a C)) \u03c6 =\n( comp ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z) (D a)\n      ( contra-evid A a D) ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))) \u03c6\n  := refl\n
RS17, Lemma 9.2(ii), dual
#def is-natural-in-family-contra-yon-twice-pointwise\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n( f : hom A x a)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x f =\n    ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n      ( contra-yon A is-segal-A a C is-contravariant-C)) u x f\n  :=\n    naturality-contravariant-fiberwise-transformation\n      A x a f C D is-contravariant-C is-contravariant-D \u03c8 u\n#def is-natural-in-family-contra-yon-once-pointwise uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n( x : A)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n      (contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x =\n    ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n      (\\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n      (contra-yon A is-segal-A a C is-contravariant-C)) u x\n  :=\n    eq-htpy funext\n      ( hom A x a)\n      ( \\ f \u2192 D x)\n      ( \\ f \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n          ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x f)\n      ( \\ f \u2192\n        ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n        ( contra-yon A is-segal-A a C is-contravariant-C)) u x f)\n      ( \\ f \u2192\n        is-natural-in-family-contra-yon-twice-pointwise\n          A is-segal-A a C D is-contravariant-C is-contravariant-D \u03c8 u x f)\n#def is-natural-in-family-contra-yon uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C D : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n( is-contravariant-D : is-contravariant A D)\n( \u03c8 : (z : A) \u2192 C z \u2192 D z)\n( u : C a)\n  : ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u =\n    ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n      ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n      ( contra-yon A is-segal-A a C is-contravariant-C)) u\n  :=\n    eq-htpy funext\n      ( A)\n      ( \\ x \u2192 hom A x a \u2192 D x)\n      ( \\ x \u2192\n        ( comp (C a) (D a) ((z : A) \u2192 hom A z a \u2192 D z)\n          ( contra-yon A is-segal-A a D is-contravariant-D) (\u03c8 a)) u x)\n      ( \\ x \u2192\n        ( comp (C a) ((z : A) \u2192 hom A z a \u2192 C z) ((z : A) \u2192 hom A z a \u2192 D z)\n        ( \\ \u03b1 z g \u2192 \u03c8 z (\u03b1 z g))\n        ( contra-yon A is-segal-A a C is-contravariant-C)) u x)\n      ( \\ x \u2192\n        is-natural-in-family-contra-yon-once-pointwise\n          A is-segal-A a C D is-contravariant-C is-contravariant-D \u03c8 u x)\n

From a type-theoretic perspective, the Yoneda lemma is a \u201cdirected\u201d version of the \u201ctransport\u201d operation for identity types. This suggests a \u201cdependently typed\u201d generalization of the Yoneda lemma, analogous to the full induction principle for identity types. We prove this as a special case of a result about covariant families over a type with an initial object.

"},{"location":"simplicial-hott/09-yoneda.rzk/#initial-objects","title":"Initial objects","text":"

A term a in a type A is initial if all of its mapping-out hom types are contractible.

RS17, Definition 9.6
#def is-initial\n( A : U)\n( a : A)\n  : U\n  := ( x : A) \u2192 is-contr (hom A a x)\n

Initial objects satisfy an induction principle relative to covariant families.

#section initial-evaluation-equivalence\n#variable A : U\n#variable a : A\n#variable is-initial-a : is-initial A a\n#variable C : A \u2192 U\n#variable is-covariant-C : is-covariant A C\n#def arrows-from-initial\n( x : A)\n  : hom A a x\n  := center-contraction (hom A a x) (is-initial-a x)\n#def identity-component-arrows-from-initial\n  : arrows-from-initial a = id-hom A a\n  := homotopy-contraction (hom A a a) (is-initial-a a) (id-hom A a)\n#def ind-initial uses (is-initial-a)\n( u : C a)\n  : ( x : A) \u2192 C x\n  :=\n\\ x \u2192 covariant-transport A a x (arrows-from-initial x) C is-covariant-C u\n#def has-cov-section-ev-pt uses (is-initial-a)\n  : has-section ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ind-initial) ,\n      ( \\ u \u2192\n        concat\n          ( C a)\n          ( covariant-transport A a a\n            ( arrows-from-initial a) C is-covariant-C u)\n          ( covariant-transport A a a\n            ( id-hom A a) C is-covariant-C u)\n          ( u)\n          ( ap\n            ( hom A a a)\n            ( C a)\n            ( arrows-from-initial a)\n            ( id-hom A a)\n            ( \\ f \u2192\n              covariant-transport A a a f C is-covariant-C u)\n            ( identity-component-arrows-from-initial))\n          ( id-arr-covariant-transport A a C is-covariant-C u)))\n#def ind-initial-ev-pt-pointwise uses (is-initial-a)\n( s : (x : A) \u2192 C x)\n( b : A)\n  : ind-initial (ev-pt A a C s) b = s b\n  :=\n    covariant-uniqueness\n      ( A)\n      ( a)\n      ( b)\n      ( arrows-from-initial b)\n      ( C)\n      ( is-covariant-C)\n      ( ev-pt A a C s)\n      ( ( s b , \\ t \u2192 s (arrows-from-initial b t)))\n#end initial-evaluation-equivalence\n

We now prove that induction from an initial element in the base of a covariant family defines an inverse equivalence to evaluation at the element.

RS17, Theorem 9.7
#def is-equiv-covariant-ev-initial uses (funext)\n( A : U)\n( a : A)\n( is-initial-a : is-initial A a)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n  : is-equiv ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ( ind-initial A a is-initial-a C is-covariant-C) ,\n        ( \\ s \u2192 eq-htpy\n                  funext\n                    ( A)\n                    ( C)\n                    ( ind-initial\n                        A a is-initial-a C is-covariant-C (ev-pt A a C s))\n                    ( s)\n                    ( ind-initial-ev-pt-pointwise\n                        A a is-initial-a C is-covariant-C s))) ,\n      ( has-cov-section-ev-pt A a is-initial-a C is-covariant-C))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#initial-objects-in-slice-categories","title":"Initial objects in slice categories","text":"

Recall that the type coslice A a is the type of arrows in A with domain a.

We now show that the coslice under a in a Segal type A has an initial object given by the identity arrow at a. This makes use of the following equivalence.

#def equiv-hom-in-coslice\n( A : U)\n( a x : A)\n( f : hom A a x)\n  : Equiv\n    ( hom (coslice A a) (a , id-hom A a) (x , f))\n( (t : \u0394\u00b9) \u2192 hom A a (f t) [t \u2261 0\u2082 \u21a6 id-hom A a])\n  :=\n    ( \\ h t s \u2192 (second (h s)) t ,\n      (( \\ k s \u2192 ( k 1\u2082 s , \\ t \u2192 k t s) ,\n\\ h \u2192 refl) ,\n      ( \\ k s \u2192 ( k 1\u2082 s , \\ t \u2192 k t s) ,\n\\ k \u2192 refl)))\n

Since hom A a is covariant when A is Segal, this latter type is contractible.

#def is-contr-is-segal-hom-in-coslice\n( A : U)\n( is-segal-A : is-segal A)\n( a x : A)\n( f : hom A a x)\n  : is-contr ( (t : \u0394\u00b9) \u2192 hom A a (f t) [t \u2261 0\u2082 \u21a6 id-hom A a])\n  :=\n    ( second (has-unique-fixed-domain-lifts-iff-is-covariant\n                A (\\ z \u2192 hom A a z)))\n      ( is-covariant-representable-is-segal A is-segal-A a)\n      ( a)\n      ( x)\n      ( f)\n      ( id-hom A a)\n

This proves the initiality of identity arrows in the coslice of a Segal type.

RS17, Lemma 9.8
#def is-initial-id-hom-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n  : is-initial (coslice A a) (a , id-hom A a)\n  :=\n    \\ (x , f) \u2192\n    is-contr-equiv-is-contr'\n      ( hom (coslice A a) (a , id-hom A a) (x , f))\n( (t : \u0394\u00b9) \u2192 hom A a (f t) [t \u2261 0\u2082 \u21a6 id-hom A a])\n      ( equiv-hom-in-coslice A a x f)\n      ( is-contr-is-segal-hom-in-coslice A is-segal-A a x f)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#dependent-yoneda-lemma","title":"Dependent Yoneda lemma","text":"

The dependent Yoneda lemma now follows by specializing these results.

#def dependent-evid\n( A : U)\n( a : A)\n( C : (coslice A a) \u2192 U)\n  : ( (p : coslice A a) \u2192 C p) \u2192 C (a , id-hom A a)\n  := \\ s \u2192 s (a , id-hom A a)\n#def dependent-yoneda-lemma' uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (coslice A a) \u2192 U)\n( is-covariant-C : is-covariant (coslice A a) C)\n  : is-equiv\n( (p : coslice A a) \u2192 C p)\n      ( C (a , id-hom A a))\n      ( dependent-evid A a C)\n  :=\n    is-equiv-covariant-ev-initial\n      ( coslice A a)\n      ( (a , id-hom A a))\n      ( is-initial-id-hom-is-segal A is-segal-A a)\n      ( C)\n      ( is-covariant-C)\n

The actual dependent Yoneda is equivalent to the result just proven, just with an equivalent type in the domain of the evaluation map.

RS17, Theorem 9.5
#def dependent-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (coslice A a) \u2192 U)\n( is-covariant-C : is-covariant (coslice A a) C)\n  : is-equiv\n( (x : A) \u2192 (f : hom A a x) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( \\ s \u2192 s a (id-hom A a))\n  :=\n    is-equiv-left-factor\n( (p : coslice A a) \u2192 C p)\n( (x : A) \u2192 (f : hom A a x) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( first (equiv-dependent-curry A (\\ z \u2192 hom A a z) (\\ x f \u2192 C (x , f))))\n      ( second (equiv-dependent-curry A (\\ z \u2192 hom A a z) (\\ x f \u2192 C (x , f))))\n      ( \\ s \u2192 s a (id-hom A a))\n      ( dependent-yoneda-lemma' A is-segal-A a C is-covariant-C)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#final-objects","title":"Final objects","text":"

A term a in a type A is initial if all of its mapping-out hom types are contractible.

#def is-final\n( A : U)\n( a : A)\n  : U\n  := (x : A) \u2192 is-contr (hom A x a)\n

Final objects satisfy an induction principle relative to contravariant families.

#section final-evaluation-equivalence\n#variable A : U\n#variable a : A\n#variable is-final-a : is-final A a\n#variable C : A \u2192 U\n#variable is-contravariant-C : is-contravariant A C\n#def arrows-to-final\n( x : A)\n  : hom A x a\n  := center-contraction (hom A x a) (is-final-a x)\n#def identity-component-arrows-to-final\n  : arrows-to-final a = id-hom A a\n  := homotopy-contraction (hom A a a) (is-final-a a) (id-hom A a)\n#def ind-final uses (is-final-a)\n( u : C a)\n  : ( x : A) \u2192 C x\n  :=\n\\ x \u2192\n    contravariant-transport A x a (arrows-to-final x) C is-contravariant-C u\n#def has-contra-section-ev-pt uses (is-final-a)\n  : has-section ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ind-final) ,\n      ( \\ u \u2192\n        concat\n          ( C a)\n          ( contravariant-transport A a a\n            ( arrows-to-final a) C is-contravariant-C u)\n          ( contravariant-transport A a a\n            ( id-hom A a) C is-contravariant-C u)\n          ( u)\n          ( ap\n            ( hom A a a)\n            ( C a)\n            ( arrows-to-final a)\n            ( id-hom A a)\n            ( \\ f \u2192\n              contravariant-transport A a a f C is-contravariant-C u)\n            ( identity-component-arrows-to-final))\n          ( id-arr-contravariant-transport A a C is-contravariant-C u)))\n#def ind-final-ev-pt-pointwise uses (is-final-a)\n( s : (x : A) \u2192 C x)\n( b : A)\n  : ind-final (ev-pt A a C s) b = s b\n  :=\n    contravariant-uniqueness\n      ( A)\n      ( b)\n      ( a)\n      ( arrows-to-final b)\n      ( C)\n      ( is-contravariant-C)\n      ( ev-pt A a C s)\n      ( ( s b , \\ t \u2192 s (arrows-to-final b t)))\n#end final-evaluation-equivalence\n

We now prove that induction from a final element in the base of a contravariant family defines an inverse equivalence to evaluation at the element.

RS17, Theorem 9.7, dual
#def is-equiv-contravariant-ev-final uses (funext)\n( A : U)\n( a : A)\n( is-final-a : is-final A a)\n( C : A \u2192 U)\n( is-contravariant-C : is-contravariant A C)\n  : is-equiv ((x : A) \u2192 C x) (C a) (ev-pt A a C)\n  :=\n    ( ( ( ind-final A a is-final-a C is-contravariant-C) ,\n        ( \\ s \u2192 eq-htpy\n                  funext\n                    ( A)\n                    ( C)\n                    ( ind-final\n                        A a is-final-a C is-contravariant-C (ev-pt A a C s))\n                    ( s)\n                    ( ind-final-ev-pt-pointwise\n                        A a is-final-a C is-contravariant-C s))) ,\n      ( has-contra-section-ev-pt A a is-final-a C is-contravariant-C))\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#final-objects-in-slice-categories","title":"Final objects in slice categories","text":"

Recall that the type slice A a is the type of arrows in A with codomain a.

We now show that the slice over a in a Segal type A has a final object given by the identity arrow at a. This makes use of the following equivalence.

#def equiv-hom-in-slice\n( A : U)\n( a x : A)\n( f : hom A x a)\n  : Equiv\n    ( hom (slice A a) (x , f) (a , id-hom A a))\n( (t : \u0394\u00b9) \u2192 hom A (f t) a [t \u2261 1\u2082 \u21a6 id-hom A a])\n  :=\n    ( \\ h t s \u2192 (second (h s)) t ,\n      (( \\ k s \u2192 ( k 0\u2082 s , \\ t \u2192 k t s) ,\n\\ h \u2192 refl) ,\n      ( \\ k s \u2192 ( k 0\u2082 s , \\ t \u2192 k t s) ,\n\\ k \u2192 refl)))\n

Since \\ z \u2192 hom A z a is contravariant when A is Segal, this latter type is contractible.

#def is-contr-is-segal-hom-in-slice\n( A : U)\n( is-segal-A : is-segal A)\n( a x : A)\n( f : hom A x a)\n  : is-contr ( (t : \u0394\u00b9) \u2192 hom A (f t) a [t \u2261 1\u2082 \u21a6 id-hom A a])\n  :=\n    ( second (has-unique-fixed-codomain-lifts-iff-is-contravariant\n                A (\\ z \u2192 hom A z a)))\n      ( is-contravariant-representable-is-segal A is-segal-A a)\n      ( x)\n      ( a)\n      ( f)\n      ( id-hom A a)\n

This proves the finality of identity arrows in the slice of a Segal type.

RS17, Lemma 9.8, dual
#def is-final-id-hom-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n  : is-final (slice A a) (a , id-hom A a)\n  :=\n    \\ (x , f) \u2192\n    is-contr-equiv-is-contr'\n      ( hom (slice A a) (x , f) (a , id-hom A a))\n( (t : \u0394\u00b9) \u2192 hom A (f t) a [t \u2261 1\u2082 \u21a6 id-hom A a])\n      ( equiv-hom-in-slice A a x f)\n      ( is-contr-is-segal-hom-in-slice A is-segal-A a x f)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#contravariant-dependent-yoneda-lemma","title":"Contravariant Dependent Yoneda lemma","text":"

The contravariant version of the dependent Yoneda lemma now follows by specializing these results.

#def contra-dependent-evid\n( A : U)\n( a : A)\n( C : (slice A a) \u2192 U)\n  : ((p : slice A a) \u2192 C p) \u2192 C (a , id-hom A a)\n  := \\ s \u2192 s (a , id-hom A a)\n#def contra-dependent-yoneda-lemma' uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (slice A a) \u2192 U)\n( is-contravariant-C : is-contravariant (slice A a) C)\n  : is-equiv\n( (p : slice A a) \u2192 C p)\n      ( C (a , id-hom A a))\n      ( contra-dependent-evid A a C)\n  :=\n    is-equiv-contravariant-ev-final\n      ( slice A a)\n      ( (a , id-hom A a))\n      ( is-final-id-hom-is-segal A is-segal-A a)\n      ( C)\n      ( is-contravariant-C)\n

The actual contravariant dependent Yoneda is equivalent to the result just proven, just with an equivalent type in the domain of the evaluation map.

RS17, Theorem 9.5, dual
#def contra-dependent-yoneda-lemma uses (funext)\n( A : U)\n( is-segal-A : is-segal A)\n( a : A)\n( C : (slice A a) \u2192 U)\n( is-contravariant-C : is-contravariant (slice A a) C)\n  : is-equiv\n( (x : A) \u2192 (f : hom A x a) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( \\ s \u2192 s a (id-hom A a))\n  :=\n    is-equiv-left-factor\n( (p : slice A a) \u2192 C p)\n( (x : A) \u2192 (f : hom A x a) \u2192 C (x , f))\n      ( C (a , id-hom A a))\n      ( first (equiv-dependent-curry A (\\ z \u2192 hom A z a) (\\ x f \u2192 C (x , f))))\n      ( second (equiv-dependent-curry A (\\ z \u2192 hom A z a) (\\ x f \u2192 C (x , f))))\n      ( \\ s \u2192 s a (id-hom A a))\n      ( contra-dependent-yoneda-lemma'\n          A is-segal-A a C is-contravariant-C)\n
"},{"location":"simplicial-hott/09-yoneda.rzk/#representable-families","title":"Representable Families","text":"

A covariant family is representable if it is fiberweise equivalent to covariant homs. In order to check if this is the case, it is not necessary to know if the family is covariant or not.

#def is-representable-family\n( A : U)\n( C : A \u2192 U)\n  : U\n  := \u03a3 (a : A) , (x : A) \u2192 (Equiv (hom A a x) (C x))\n

The definition makes it slightly awkward to access the actual equivalence, so we give a helper function.

#def equiv-for-is-representable-family\n( A : U)\n( C : A \u2192 U)\n( is-rep-C : is-representable-family A C)\n  : (x : A) \u2192 (hom A (first is-rep-C) x) \u2192 (C x)\n  := \\ x \u2192 first((second (is-rep-C)) x)\n

RS Proposition 9.10 gives an if and only if condition for a covariant family C : A \u2192 U to be representable. The condition is that the type \u03a3 (x : A) , C x has an initial object. For convenience, we give this condition a name.

#def has-initial-tot\n( A : U)\n( C : A \u2192 U)\n  : U\n  := \u03a3 ((a , u) : \u03a3 (x : A) , (C x))\n      , is-initial (\u03a3 (x : A) , (C x)) (a , u)\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/","title":"Rezk types","text":"

This is a literate rzk file:

#lang rzk-1\n

Some of the definitions in this file rely on function extensionality, extension extensionality and weak function extensionality:

#assume funext : FunExt\n#assume extext : ExtExt\n#assume weakfunext : WeakFunExt\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#isomorphisms","title":"Isomorphisms","text":"
#def has-retraction-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n  : U\n  := ( comp-is-segal A is-segal-A x y x f g) =_{hom A x x} (id-hom A x)\n#def Retraction-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : U\n  := \u03a3 ( g : hom A y x) , ( has-retraction-arrow A is-segal-A x y f g)\n#def has-section-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( h : hom A y x)\n  : U\n  := ( comp-is-segal A is-segal-A y x y h f) =_{hom A y y} (id-hom A y)\n#def Section-arrow\n(A : U)\n(is-segal-A : is-segal A)\n(x y : A)\n(f : hom A x y)\n  : U\n  := \u03a3 (h : hom A y x) , (has-section-arrow A is-segal-A x y f h)\n#def is-iso-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : U\n  :=\n    product\n    ( Retraction-arrow A is-segal-A x y f)\n    ( Section-arrow A is-segal-A x y f)\n#def Iso\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n  : U\n  := \u03a3 ( f : hom A x y) , is-iso-arrow A is-segal-A x y f\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#invertible-arrows","title":"Invertible arrows","text":"

We now show that f : hom A a x is an isomorphism if and only if it is invertible, meaning f has a two-sided composition inverse g : hom A x a.

#def has-inverse-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : U\n  :=\n\u03a3 ( g : hom A y x) ,\n      product\n      ( has-retraction-arrow A is-segal-A x y f g)\n      ( has-section-arrow A is-segal-A x y f g)\n#def is-iso-arrow-has-inverse-arrow\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : ( has-inverse-arrow A is-segal-A x y f) \u2192 (is-iso-arrow A is-segal-A x y f)\n  :=\n    ( \\ (g , (p , q)) \u2192 ((g , p) , (g , q)))\n#def has-inverse-arrow-is-iso-arrow uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (is-iso-arrow A is-segal-A x y f) \u2192 (has-inverse-arrow A is-segal-A x y f)\n  :=\n    ( \\ ((g , p) , (h , q)) \u2192\n      ( g ,\n        ( p ,\n          ( concat\n            ( hom A y y)\n            ( comp-is-segal A is-segal-A y x y g f)\n            ( comp-is-segal A is-segal-A y x y h f)\n            ( id-hom A y)\n            ( postwhisker-homotopy-is-segal A is-segal-A y x y g h f\n              ( alternating-quintuple-concat\n                ( hom A y x)\n                ( g)\n                ( comp-is-segal A is-segal-A y y x (id-hom A y) g)\n                ( rev\n                  ( hom A y x)\n                  ( comp-is-segal A is-segal-A y y x (id-hom A y) g)\n                  ( g)\n                  ( id-comp-is-segal A is-segal-A y x g))\n                ( comp-is-segal A is-segal-A y y x\n                  ( comp-is-segal A is-segal-A y x y h f) ( g))\n                ( postwhisker-homotopy-is-segal A is-segal-A y y x\n                  ( id-hom A y)\n                  ( comp-is-segal A is-segal-A y x y h f)\n                  ( g)\n                  ( rev\n                    ( hom A y y)\n                    ( comp-is-segal A is-segal-A y x y h f)\n                    ( id-hom A y)\n                    ( q)))\n                ( comp-is-segal A is-segal-A y x x\n                  ( h)\n                  ( comp-is-segal A is-segal-A x y x f g))\n                ( associative-is-segal extext A is-segal-A y x y x h f g)\n                ( comp-is-segal A is-segal-A y x x h (id-hom A x))\n                ( prewhisker-homotopy-is-segal A is-segal-A y x x h\n                  ( comp-is-segal A is-segal-A x y x f g)\n                  ( id-hom A x) p)\n                ( h)\n                ( comp-id-is-segal A is-segal-A y x h)))\n            ( q)))))\n
RS17, Proposition 10.1
#def inverse-iff-iso-arrow uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : iff (has-inverse-arrow A is-segal-A x y f) (is-iso-arrow A is-segal-A x y f)\n  :=\n    ( is-iso-arrow-has-inverse-arrow A is-segal-A x y f ,\n      has-inverse-arrow-is-iso-arrow A is-segal-A x y f)\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#being-an-isomorphism-is-a-proposition","title":"Being an isomorphism is a proposition","text":"

The predicate is-iso-arrow is a proposition.

#def has-retraction-postcomp-has-retraction uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n  : ( z : A) \u2192\n    has-retraction (hom A z x) (hom A z y)\n      ( postcomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( postcomp-is-segal A is-segal-A y x g z) ,\n\\ k \u2192\n      ( triple-concat\n        ( hom A z x)\n        ( comp-is-segal A is-segal-A z y x\n          ( comp-is-segal A is-segal-A z x y k f) g)\n        ( comp-is-segal A is-segal-A z x x\n          k ( comp-is-segal A is-segal-A x y x f g))\n        ( comp-is-segal A is-segal-A z x x k (id-hom A x))\n        ( k)\n        ( associative-is-segal extext A is-segal-A z x y x k f g)\n        ( prewhisker-homotopy-is-segal A is-segal-A z x x k\n          ( comp-is-segal A is-segal-A x y x f g) (id-hom A x) gg)\n        ( comp-id-is-segal A is-segal-A z x k)))\n#def has-section-postcomp-has-section uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : ( z : A) \u2192\n    has-section (hom A z x) (hom A z y) (postcomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( postcomp-is-segal A is-segal-A y x h z) ,\n\\ k \u2192\n        ( triple-concat\n          ( hom A z y)\n          ( comp-is-segal A is-segal-A z x y\n            ( comp-is-segal A is-segal-A z y x k h) f)\n          ( comp-is-segal A is-segal-A z y y\n            k (comp-is-segal A is-segal-A y x y h f))\n          ( comp-is-segal A is-segal-A z y y k (id-hom A y))\n          ( k)\n          ( associative-is-segal extext A is-segal-A z y x y k h f)\n          ( prewhisker-homotopy-is-segal A is-segal-A z y y k\n            ( comp-is-segal A is-segal-A y x y h f) (id-hom A y) hh)\n          ( comp-id-is-segal A is-segal-A z y k)))\n#def is-equiv-postcomp-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : (z : A) \u2192\n    is-equiv (hom A z x) (hom A z y) (postcomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( has-retraction-postcomp-has-retraction A is-segal-A x y f g gg z) ,\n      ( has-section-postcomp-has-section A is-segal-A x y f h hh z))\n#def has-retraction-precomp-has-section uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : (z : A) \u2192\n    has-retraction (hom A y z) (hom A x z)\n      ( precomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( precomp-is-segal A is-segal-A y x h z) ,\n\\ k \u2192\n        ( triple-concat\n          ( hom A y z)\n          ( comp-is-segal A is-segal-A y x z\n            h (comp-is-segal A is-segal-A x y z f k))\n          ( comp-is-segal A is-segal-A y y z\n            ( comp-is-segal A is-segal-A y x y h f) k)\n          ( comp-is-segal A is-segal-A y y z (id-hom A y) k)\n          ( k)\n          ( rev\n            ( hom A y z)\n            ( comp-is-segal A is-segal-A y y z\n              ( comp-is-segal A is-segal-A y x y h f) k)\n            ( comp-is-segal A is-segal-A y x z\n              h (comp-is-segal A is-segal-A x y z f k))\n            ( associative-is-segal extext A is-segal-A y x y z h f k))\n          ( postwhisker-homotopy-is-segal A is-segal-A y y z\n            ( comp-is-segal A is-segal-A y x y h f)\n            ( id-hom A y) k hh)\n          ( id-comp-is-segal A is-segal-A y z k)\n        )\n    )\n#def has-section-precomp-has-retraction uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n  : (z : A) \u2192\n    has-section (hom A y z) (hom A x z) (precomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n    ( ( precomp-is-segal A is-segal-A y x g z) ,\n\\ k \u2192\n        ( triple-concat\n          ( hom A x z)\n          ( comp-is-segal A is-segal-A x y z\n            f (comp-is-segal A is-segal-A y x z g k))\n          ( comp-is-segal A is-segal-A x x z\n            ( comp-is-segal A is-segal-A x y x f g) k)\n          ( comp-is-segal A is-segal-A x x z\n            ( id-hom A x) k)\n          ( k)\n          ( rev\n            ( hom A x z)\n            ( comp-is-segal A is-segal-A x x z\n              ( comp-is-segal A is-segal-A x y x f g) k)\n            ( comp-is-segal A is-segal-A x y z\n              f (comp-is-segal A is-segal-A y x z g k))\n            ( associative-is-segal extext A is-segal-A x y x z f g k))\n          ( postwhisker-homotopy-is-segal A is-segal-A x x z\n            ( comp-is-segal A is-segal-A x y x f g)\n            ( id-hom A x)\n            ( k)\n            ( gg))\n          ( id-comp-is-segal A is-segal-A x z k)))\n#def is-equiv-precomp-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : (z : A) \u2192\n    is-equiv (hom A y z) (hom A x z) (precomp-is-segal A is-segal-A x y f z)\n  :=\n\\ z \u2192\n      ( ( has-retraction-precomp-has-section A is-segal-A x y f h hh z) ,\n        ( has-section-precomp-has-retraction A is-segal-A x y f g gg z))\n#def is-contr-Retraction-arrow-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : is-contr (Retraction-arrow A is-segal-A x y f)\n  :=\n    ( is-contr-map-is-equiv\n      ( hom A y x)\n      ( hom A x x)\n      ( precomp-is-segal A is-segal-A x y f x)\n      ( is-equiv-precomp-is-iso A is-segal-A x y f g gg h hh x))\n    ( id-hom A x)\n#def is-contr-Section-arrow-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : is-contr (Section-arrow A is-segal-A x y f)\n  :=\n    ( is-contr-map-is-equiv\n      ( hom A y x)\n      ( hom A y y)\n      ( postcomp-is-segal A is-segal-A x y f y)\n      ( is-equiv-postcomp-is-iso A is-segal-A x y f g gg h hh y))\n    ( id-hom A y)\n#def is-contr-is-iso-arrow-is-iso uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n( g : hom A y x)\n( gg : has-retraction-arrow A is-segal-A x y f g)\n( h : hom A y x)\n( hh : has-section-arrow A is-segal-A x y f h)\n  : is-contr (is-iso-arrow A is-segal-A x y f)\n  :=\n    ( is-contr-product\n      ( Retraction-arrow A is-segal-A x y f)\n      ( Section-arrow A is-segal-A x y f)\n      ( is-contr-Retraction-arrow-is-iso A is-segal-A x y f g gg h hh)\n      ( is-contr-Section-arrow-is-iso A is-segal-A x y f g gg h hh))\n
RS17, Proposition 10.2
#def is-prop-is-iso-arrow uses (extext)\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n( f : hom A x y)\n  : (is-prop (is-iso-arrow A is-segal-A x y f))\n  :=\n    ( is-prop-is-contr-is-inhabited\n      ( is-iso-arrow A is-segal-A x y f)\n      ( \\ is-isof \u2192\n        ( is-contr-is-iso-arrow-is-iso A is-segal-A x y f\n          ( first (first is-isof))\n          ( second (first is-isof))\n          ( first (second is-isof))\n          ( second (second is-isof)))))\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#isomorphism-extensionality","title":"Isomorphism extensionality","text":"RS17, Proposition 10.3
#def ev-components-nat-trans-preserves-iso uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : ( is-iso-arrow\n      ( (x : X) \u2192 A x)\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1) \u2192\n( x : X) \u2192\n    ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n      ( ev-components-nat-trans X A f g \u03b1 x))\n  :=\n    \\ ((\u03b2 , p) , (\u03b3 , q)) \u2192\n\\ x \u2192\n    ( ( ( ev-components-nat-trans X A g f \u03b2 x) ,\n        ( triple-concat\n          ( hom (A x) (f x) (f x))\n          ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n            ( ev-components-nat-trans X A f g \u03b1 x)\n            ( ev-components-nat-trans X A g f \u03b2 x))\n( ev-components-nat-trans X A f f\n            ( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) f g f \u03b1 \u03b2)\n            ( x))\n( ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 (A x')) f) x)\n          ( id-hom (A x) (f x))\n          ( comp-components-comp-nat-trans-is-segal\n            funext X A is-segal-A f g f \u03b1 \u03b2 x)\n          ( ap\n            ( nat-trans X A f f)\n            ( hom (A x) (f x) (f x))\n( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) f g f \u03b1 \u03b2)\n( id-hom ((x' : X) \u2192 (A x')) f)\n            (\\ \u03b1' \u2192 ev-components-nat-trans X A f f \u03b1' x)\n            ( p))\n          ( id-arr-components-id-nat-trans X A f x))) ,\n      ( ( ev-components-nat-trans X A g f \u03b3 x) ,\n        ( triple-concat\n          (hom (A x) (g x) (g x))\n          ( comp-is-segal (A x) (is-segal-A x) (g x) (f x) (g x)\n            ( ev-components-nat-trans X A g f \u03b3 x)\n            ( ev-components-nat-trans X A f g \u03b1 x))\n( ev-components-nat-trans X A g g\n            ( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) g f g \u03b3 \u03b1)\n            ( x))\n( ev-components-nat-trans X A g g (id-hom ((x' : X) \u2192 (A x')) g) x)\n          ( id-hom (A x) (g x))\n          ( comp-components-comp-nat-trans-is-segal\n            funext X A is-segal-A g f g \u03b3 \u03b1 x)\n          ( ap\n            ( nat-trans X A g g)\n            ( hom (A x) (g x) (g x))\n( comp-is-segal\n              ( (x' : X) \u2192 (A x'))\n              ( is-segal-function-type funext X A is-segal-A) g f g \u03b3 \u03b1)\n( id-hom ((x' : X) \u2192 (A x')) g)\n            ( \\ \u03b1' \u2192 ev-components-nat-trans X A g g \u03b1' x)\n            ( q))\n          ( id-arr-components-id-nat-trans X A g x))))\n#def nat-trans-nat-trans-components-preserves-iso-helper uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n( \u03b2 : nat-trans X A g f)\n  : ( ( x : X) \u2192\n      ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n        ( ev-components-nat-trans X A f g \u03b1 x)\n        ( ev-components-nat-trans X A g f \u03b2 x)) =\n      (id-hom (A x) (f x))) \u2192\n( comp-is-segal\n      ( (x' : X) \u2192 A x')\n      ( is-segal-function-type funext X A is-segal-A)\n      f g f \u03b1 \u03b2) =\n(id-hom ((x' : X) \u2192 A x') f)\n  :=\n\\ H \u2192\n    ap\n      ( nat-trans-components X A f f)\n      ( nat-trans X A f f)\n( \\ x \u2192\n        ev-components-nat-trans X A f f\n          ( comp-is-segal\n            ( (x' : X) \u2192 A x')\n            ( is-segal-function-type funext X A is-segal-A)\n            f g f \u03b1 \u03b2)\n          ( x))\n( \\ x \u2192 ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 A x') f) x)\n( first\n        ( has-inverse-is-equiv\n          ( hom ((x' : X) \u2192 A x') f f)\n( (x : X) \u2192 hom (A x) (f x) (f x))\n          ( ev-components-nat-trans X A f f)\n          ( is-equiv-ev-components-nat-trans X A f f)))\n      ( eq-htpy funext X\n        ( \\ x \u2192 (hom (A x) (f x) (f x)))\n( \\ x \u2192\n          ( ev-components-nat-trans X A f f\n            ( comp-is-segal\n              ( (x' : X) \u2192 A x')\n              ( is-segal-function-type funext X A is-segal-A)\n              f g f \u03b1 \u03b2)\n            ( x)))\n        ( \\ x \u2192 (id-hom (A x) (f x)))\n        ( \\ x \u2192\n          ( triple-concat\n            ( hom (A x) (f x) (f x))\n( ev-components-nat-trans X A f f\n              ( comp-is-segal\n                ( (x' : X) \u2192 A x')\n                ( is-segal-function-type funext X A is-segal-A)\n                f g f \u03b1 \u03b2)\n              ( x))\n            ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n              ( ev-components-nat-trans X A f g \u03b1 x)\n              ( ev-components-nat-trans X A g f \u03b2 x))\n            ( id-hom (A x) (f x))\n( ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 A x') f) x)\n            ( rev\n              (hom (A x) (f x) (f x))\n              ( comp-is-segal (A x) (is-segal-A x) (f x) (g x) (f x)\n                ( ev-components-nat-trans X A f g \u03b1 x)\n                ( ev-components-nat-trans X A g f \u03b2 x))\n( ev-components-nat-trans X A f f\n                ( comp-is-segal\n                  ( (x' : X) \u2192 A x')\n                  ( is-segal-function-type funext X A is-segal-A)\n                  f g f \u03b1 \u03b2)\n                ( x))\n              ( comp-components-comp-nat-trans-is-segal\n                funext X A is-segal-A f g f \u03b1 \u03b2 x))\n            ( H x)\n            ( rev\n              ( hom (A x) (f x) (f x))\n( ev-components-nat-trans X A f f (id-hom ((x' : X) \u2192 A x') f) x)\n              ( id-hom (A x) (f x))\n              ( id-arr-components-id-nat-trans X A f x)))))\n#def nat-trans-nat-trans-components-preserves-iso uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : ( ( x : X) \u2192\n      ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n        ( ev-components-nat-trans X A f g \u03b1 x))) \u2192\n( is-iso-arrow\n      ( (x' : X) \u2192 A x')\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n  :=\n\\ H \u2192\n    ( ( \\ t x \u2192 (first (first (H x))) t ,\n        nat-trans-nat-trans-components-preserves-iso-helper X A is-segal-A f g\n          ( \u03b1)\n          ( \\ t x \u2192 (first (first (H x))) t)\n          ( \\ x \u2192 (second (first (H x))))) ,\n      ( \\ t x \u2192 (first (second (H x))) t ,\n        nat-trans-nat-trans-components-preserves-iso-helper X A is-segal-A g f\n          ( \\ t x \u2192 (first (second (H x))) t)\n          ( \u03b1)\n          ( \\ x \u2192 (second (second (H x))))))\n#def iff-is-iso-pointwise-is-iso uses (funext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : iff\n( is-iso-arrow\n      ( (x : X) \u2192 A x)\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n( ( x : X) \u2192\n        ( is-iso-arrow\n          ( A x)\n          ( is-segal-A x)\n          ( f x)\n          ( g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n  :=\n    ( ev-components-nat-trans-preserves-iso X A is-segal-A f g \u03b1,\n      nat-trans-nat-trans-components-preserves-iso X A is-segal-A f g \u03b1)\n#def equiv-is-iso-pointwise-is-iso uses (extext funext weakfunext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n( \u03b1 : nat-trans X A f g)\n  : Equiv\n( is-iso-arrow\n      ( (x : X) \u2192 A x)\n      ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n( ( x : X) \u2192\n        ( is-iso-arrow\n          ( A x)\n          ( is-segal-A x)\n          ( f x)\n          ( g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n  :=\n    equiv-iff-is-prop-is-prop\n( is-iso-arrow\n        ( (x : X) \u2192 A x)\n        ( is-segal-function-type funext X A is-segal-A) f g \u03b1)\n( ( x : X) \u2192\n        ( is-iso-arrow\n          ( A x)\n          ( is-segal-A x)\n          ( f x)\n          ( g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n( is-prop-is-iso-arrow\n        ( (x : X) \u2192 A x)\n        ( is-segal-function-type funext X A is-segal-A)\n        ( f)\n        ( g)\n        ( \u03b1))\n      ( is-prop-fiberwise-prop funext weakfunext\n        ( X)\n        ( \\ x \u2192\n          ( is-iso-arrow\n            ( A x)\n            ( is-segal-A x)\n            ( f x)\n            ( g x)\n            ( ev-components-nat-trans X A f g \u03b1 x)))\n        ( \\ x \u2192\n          is-prop-is-iso-arrow\n            ( A x)\n            ( is-segal-A x)\n            ( f x)\n            ( g x)\n            ( ev-components-nat-trans X A f g \u03b1 x)))\n      ( iff-is-iso-pointwise-is-iso X A is-segal-A f g \u03b1)\n
RS17, Corollary 10.4
#def iso-extensionality uses (extext funext weakfunext)\n( X : U)\n( A : X \u2192 U)\n( is-segal-A : (x : X) \u2192 is-segal (A x))\n( f g : (x : X) \u2192 A x)\n  : Equiv\n( Iso ((x : X) \u2192 A x) (is-segal-function-type funext X A is-segal-A) f g)\n( ( x : X) \u2192 Iso (A x) (is-segal-A x) (f x) (g x))\n  :=\n    equiv-triple-comp\n( Iso ((x : X) \u2192 A x) (is-segal-function-type funext X A is-segal-A) f g)\n( \u03a3 ( \u03b1 : nat-trans X A f g) ,\n( x : X) \u2192\n        ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n          ( ev-components-nat-trans X A f g \u03b1 x)))\n( \u03a3 ( \u03b1' : nat-trans-components X A f g) ,\n( x : X) \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) (\u03b1' x))\n( (x : X) \u2192 Iso (A x) (is-segal-A x) (f x) (g x))\n      ( total-equiv-family-equiv\n        ( nat-trans X A f g)\n( \\ \u03b1 \u2192\n          ( is-iso-arrow\n            ( (x : X) \u2192 A x)\n            ( is-segal-function-type funext X A is-segal-A)\n            f g \u03b1))\n( \\ \u03b1 \u2192\n          ( x : X) \u2192\n          ( is-iso-arrow (A x) (is-segal-A x) (f x) (g x)\n            ( ev-components-nat-trans X A f g \u03b1 x)))\n        ( \\ \u03b1 \u2192 equiv-is-iso-pointwise-is-iso X A is-segal-A f g \u03b1))\n      ( total-equiv-pullback-is-equiv\n        ( nat-trans X A f g)\n        ( nat-trans-components X A f g)\n        ( ev-components-nat-trans X A f g)\n        ( is-equiv-ev-components-nat-trans X A f g)\n( \\ \u03b1' \u2192\n          ( x : X) \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) (\u03b1' x)))\n( inv-equiv\n        ( (x : X) \u2192 Iso (A x) (is-segal-A x) (f x) (g x))\n( \u03a3 ( \u03b1' : nat-trans-components X A f g) ,\n( x : X) \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) (\u03b1' x))\n        ( equiv-choice X\n          ( \\ x \u2192 hom (A x) (f x) (g x))\n          ( \\ x \u03b1\u2093 \u2192 is-iso-arrow (A x) (is-segal-A x) (f x) (g x) \u03b1\u2093)))\n
"},{"location":"simplicial-hott/10-rezk-types.rzk/#rezk-types_1","title":"Rezk types","text":"

A Segal type \\(A\\) is a Rezk type just when, for all x y : A, the natural map from x = y to Iso A is-segal-A x y is an equivalence.

#def iso-id-arrow\n(A : U)\n(is-segal-A : is-segal A)\n  : (x : A) \u2192 Iso A is-segal-A x x\n  :=\n\\ x \u2192\n    (\n    (id-hom A x) ,\n    (\n    (\n      (id-hom A x) ,\n      (id-comp-is-segal A is-segal-A x x (id-hom A x))\n    ) ,\n    (\n      (id-hom A x) ,\n      (id-comp-is-segal A is-segal-A x x (id-hom A x))\n    )\n      )\n  )\n#def iso-eq\n( A : U)\n( is-segal-A : is-segal A)\n( x y : A)\n  : (x = y) \u2192 Iso A is-segal-A x y\n  :=\n\\ p \u2192\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' p' \u2192 Iso A is-segal-A x y')\n      ( iso-id-arrow A is-segal-A x)\n      ( y)\n      ( p)\n
RS17, Definition 10.6
#def is-rezk\n( A : U)\n  : U\n  :=\n\u03a3 ( is-segal-A : is-segal A) ,\n(x : A) \u2192 (y : A) \u2192\n        is-equiv (x = y) (Iso A is-segal-A x y) (iso-eq A is-segal-A x y)\n

The following results show how iso-eq mediates between the type-theoretic operations on paths and the category-theoretic operations on arrows.

RS17, Lemma 10.7
#def compute-covariant-transport-of-hom-family-iso-eq-is-segal\n( A : U)\n( is-segal-A : is-segal A)\n( C : A \u2192 U)\n( is-covariant-C : is-covariant A C)\n( x y : A)\n( e : x = y)\n( u : C x)\n  : covariant-transport\n      ( A)\n      ( x)\n      ( y)\n      ( first (iso-eq A is-segal-A x y e))\n      ( C)\n      ( is-covariant-C)\n      ( u)\n    = transport A C x y e u\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' e' \u2192\n        covariant-transport\n          ( A)\n          ( x)\n          ( y')\n          ( first (iso-eq A is-segal-A x y' e'))\n          ( C)\n          ( is-covariant-C)\n          ( u)\n        = transport A C x y' e' u)\n      ( id-arr-covariant-transport A x C is-covariant-C u)\n      ( y)\n      ( e)\n
RS17, Lemma 10.8
#def compute-ap-hom-of-iso-eq\n( A B : U)\n( is-segal-A : is-segal A)\n( is-segal-B : is-segal B)\n( f : A \u2192 B)\n( x y : A)\n( e : x = y)\n  : ( ap-hom A B f x y (first (iso-eq A is-segal-A x y e))) =\n    ( first ( iso-eq B is-segal-B (f x) (f y) (ap A B x y f e)))\n  :=\n    ind-path\n      ( A)\n      ( x)\n      ( \\ y' e' \u2192\n        ( ap-hom A B f x y' (first (iso-eq A is-segal-A x y' e'))) =\n        ( first (iso-eq B is-segal-B (f x) (f y') (ap A B x y' f e'))))\n      ( refl)\n      ( y)\n      ( e)\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/","title":"Adjunctions","text":"

This is a literate rzk file:

#lang rzk-1\n

Some of the definitions in this file rely on function extensionality:

#assume funext : FunExt\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#transposing-adjunctions","title":"Transposing adjunctions","text":"

Transposing adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A together with a family of \"transposing equivalences\" between appropriate hom types.

RS17, Definition 11.1
#def is-transposing-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  := (a : A) \u2192 (b : B) \u2192 Equiv (hom B (f a) b) (hom A a (u b))\n#def transposing-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), is-transposing-adj A B f u\n

A functor f : A \u2192 B is a transposing left adjoint if it has a transposing right adjoint. Later we will show that the type is-transposing-left-adj A B f is a proposition when A is Rezk and B is Segal.

#def is-transposing-left-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), is-transposing-adj A B f u\n#def is-transposing-right-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), is-transposing-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#quasi-diagrammatic-adjunctions","title":"Quasi-diagrammatic adjunctions","text":"

Quasi-diagrammatic adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A, unit and counit natural transformations, and a pair of witnesses to the triangle identities.

RS17, Definition 11.2
#def has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  :=\n\u03a3 (\u03b7 : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)),\n\u03a3 (\u03f5 : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)),\n    product\n      ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n        ( id-hom (B \u2192 A) u))\n      ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n#def quasi-diagrammatic-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), has-quasi-diagrammatic-adj A B f u\n

Quasi-diagrammatic adjunctions have left and right adjoints, but being the left or right adjoint part of a quasi-diagrammatic adjunction is not a proposition. Thus, we assign slightly different names to the following types.

#def has-quasi-diagrammatic-right-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), has-quasi-diagrammatic-adj A B f u\n#def has-quasi-diagrammatic-left-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), has-quasi-diagrammatic-adj A B f u\n

The following projection functions extract the core data of a quasi-diagrammatic adjunction.

#def unit-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)\n  := first (has-quasi-diagrammatic-adj-fu)\n#def counit-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)\n  := first (second (has-quasi-diagrammatic-adj-fu))\n#def right-adj-triangle-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n    ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f)\n      ( unit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u\n      ( counit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( id-hom (B \u2192 A) u)\n  := first (second (second (has-quasi-diagrammatic-adj-fu)))\n#def left-adj-triangle-has-quasi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n( has-quasi-diagrammatic-adj-fu : has-quasi-diagrammatic-adj A B f u)\n  : hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n    ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f\n      ( unit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B)\n      ( counit-has-quasi-diagrammatic-adj A B f u\n        ( has-quasi-diagrammatic-adj-fu)))\n    ( id-hom (A \u2192 B) f)\n  := second (second (second (has-quasi-diagrammatic-adj-fu)))\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#half-adjoint-diagrammatic-adjunctions","title":"Half-adjoint diagrammatic adjunctions","text":"

A half-adjoint diagrammatic adjunction extends a quasi-diagrammatic adjunction with higher coherence data that makes the specified witnesses to the triangle identities coherent. This extra coherence data involves a pair of 3-simplices belonging to a hom3 type we now define.

Unlike the convention used by the arguments of hom2, we introduce the boundary data of a 3-simplex in lexicographic order.

#def hom3\n( A : U)\n( w x y z : A)\n( f : hom A w x)\n( gf : hom A w y)\n( hgf : hom A w z)\n( g : hom A x y)\n( hg : hom A x z)\n( h : hom A y z)\n( \u03b1\u2083 : hom2 A w x y f g gf)\n( \u03b1\u2082 : hom2 A w x z f hg hgf)\n( \u03b1\u2081 : hom2 A w y z gf h hgf)\n( \u03b1\u2080 : hom2 A x y z g h hg)\n  : U\n  :=\n    ( ((t\u2081 , t\u2082 ) , t\u2083 ) : \u0394\u00b3) \u2192\n    A [ t\u2083 \u2261 0\u2082 \u21a6 \u03b1\u2083 (t\u2081 , t\u2082 ),\n        t\u2082 \u2261 t\u2083 \u21a6 \u03b1\u2082 (t\u2081 , t\u2083 ),\n        t\u2081 \u2261 t\u2082 \u21a6 \u03b1\u2081 (t\u2081 , t\u2083 ),\n        t\u2081 \u2261 1\u2082 \u21a6 \u03b1\u2080 (t\u2082 , t\u2083 )]\n
RS17, Definition 11.3
#def is-half-adjoint-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  :=\n\u03a3 ( (\u03b7 , (\u03f5 , (\u03b1 , \u03b2))) : has-quasi-diagrammatic-adj A B f u),\n\u03a3 ( \u03bc : hom2\n            ( B \u2192 B)\n            ( comp B A B f u)\n            ( quadruple-comp B A B A B f u f u)\n            ( identity B)\n            ( whisker-nat-trans B A A B u (identity A) (comp A B A u f) f \u03b7)\n            ( horizontal-comp-nat-trans B B B\n              ( comp B A B f u) (identity B) (comp B A B f u) (identity B)\n              ( \u03f5) ( \u03f5))\n            ( \u03f5)),\n    product\n    ( hom3 (B \u2192 B)\n      ( comp B A B f u)\n      ( quadruple-comp B A B A B f u f u)\n      ( comp B A B f u)\n      ( identity B)\n      ( whisker-nat-trans B A A B u (identity A) (comp A B A u f) f \u03b7)\n      ( id-hom (B \u2192 B) (comp B A B f u))\n      ( \u03f5)\n      ( postwhisker-nat-trans B B B\n        ( comp B A B f u) (identity B) (comp B A B f u) \u03f5)\n      ( horizontal-comp-nat-trans B B B\n              ( comp B A B f u) (identity B) (comp B A B f u) (identity B)\n              ( \u03f5) ( \u03f5))\n      ( \u03f5)\n      ( \\ t a \u2192 f (\u03b1 t a))\n      ( \u03bc)\n      ( id-comp-witness (B \u2192 B) (comp B A B f u) (identity B) \u03f5)\n      ( left-gray-interchanger-horizontal-comp-nat-trans B B B\n        ( comp B A B f u) (identity B) ( comp B A B f u) (identity B)\n        ( \u03f5)\n        ( \u03f5)))\n    ( hom3\n      ( B \u2192 B)\n      ( comp B A B f u)\n      ( quadruple-comp B A B A B f u f u)\n      ( comp B A B f u)\n      ( identity B)\n      ( whisker-nat-trans B A A B u (identity A) (comp A B A u f) f \u03b7)\n      ( id-hom (B \u2192 B) (comp B A B f u))\n      ( \u03f5)\n      ( prewhisker-nat-trans B B B\n        ( comp B A B f u) (comp B A B f u) (identity B) \u03f5)\n      ( horizontal-comp-nat-trans B B B\n              ( comp B A B f u) (identity B) (comp B A B f u) (identity B)\n              ( \u03f5) ( \u03f5))\n      ( \u03f5)\n      ( \\ t b \u2192 \u03b2 t (u b))\n      ( \u03bc)\n      ( id-comp-witness (B \u2192 B) (comp B A B f u) (identity B) \u03f5)\n      ( right-gray-interchanger-horizontal-comp-nat-trans B B B\n        ( comp B A B f u) (identity B) ( comp B A B f u) (identity B)\n        ( \u03f5)\n        ( \u03f5)))\n#def half-adjoint-diagrammatic-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), is-half-adjoint-diagrammatic-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#bi-diagrammatic-adjunction","title":"Bi-diagrammatic adjunction","text":"

Bi-diagrammatic adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A, a unit natural transformation \u03b7, two counit natural transformations \u03f5 and \u03f5', and a pair of witnesses to the triangle identities, one involving each counit.

RS17, Definition 11.6
#def is-bi-diagrammatic-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  :=\n\u03a3 (\u03b7 : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)),\n\u03a3 (\u03f5 : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)),\n\u03a3 (\u03f5' : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)),\n    product\n      ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n        ( id-hom (B \u2192 A) u))\n      ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5' )\n        ( id-hom (A \u2192 B) f))\n#def bi-diagrammatic-adj\n(A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), is-bi-diagrammatic-adj A B f u\n#def is-bi-diagrammatic-left-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), is-bi-diagrammatic-adj A B f u\n#def is-bi-diagrammatic-right-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), is-bi-diagrammatic-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#quasi-transposing-adjunction","title":"Quasi-transposing adjunction","text":"

Quasi-transposing adjunctions are defined by opposing functors f : A \u2192 B and u : B \u2192 A together with a family of \"transposing quasi-equivalences\" where \"quasi-equivalence\" is another name for \"invertible map.\"

RS17, Definition 11.7
#def has-quasi-transposing-adj\n( A B : U)\n( f : A \u2192 B)\n( u : B \u2192 A)\n  : U\n  := (a : A) \u2192 (b : B) \u2192\n\u03a3 (\u03d5 : (hom B (f a) b) \u2192 (hom A a (u b))),\n      has-inverse (hom B (f a) b) (hom A a (u b)) \u03d5\n#def quasi-transposing-adj\n( A B : U)\n  : U\n  := \u03a3 (f : A \u2192 B), \u03a3 (u : B \u2192 A), has-quasi-transposing-adj A B f u\n#def has-quasi-transposing-right-adj\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (u : B \u2192 A), has-quasi-transposing-adj A B f u\n#def has-quasi-transposing-left-adj\n( A B : U)\n( u : B \u2192 A)\n  : U\n  := \u03a3 (f : A \u2192 B), has-quasi-transposing-adj A B f u\n
"},{"location":"simplicial-hott/11-adjunctions.rzk/#equivalence-of-quasi-transposing-and-quasi-diagrammatic-adjunctions","title":"Equivalence of quasi-transposing and quasi-diagrammatic adjunctions","text":"

When A and B are Segal types, quasi-transposing-adj A B and quasi-diagrammatic-adj A B are equivalent.

We first connect the components of the unit and counit to the transposition maps in the usual way, as an application of the Yoneda lemma.

#section unit-counit-transposition\n#variables A B : U\n#variable is-segal-A : is-segal A\n#variable is-segal-B : is-segal B\n#variable f : A \u2192 B\n#variable u : B \u2192 A\n#def equiv-transposition-unit-component uses (funext)\n(a : A)\n  : Equiv ((b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b))) (hom A a (u (f a)))\n  :=\n    ( evid B (f a) (\\ b \u2192 hom A a (u b)) ,\n      yoneda-lemma\n        ( funext)\n        ( B)\n        ( is-segal-B)\n        ( f a)\n        ( \\ b \u2192 hom A a (u b))\n        ( is-covariant-substitution-is-covariant\n          ( A)\n          ( B)\n          ( hom A a)\n          ( is-covariant-representable-is-segal A is-segal-A a)\n          ( u)))\n#def equiv-unit-components\n  : Equiv\n( (a : A) \u2192 hom A a (u (f a)))\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n  :=\n    inv-equiv\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n( (a : A) \u2192 hom A a (u (f a)))\n    ( equiv-components-nat-trans\n      ( A)\n      ( \\ _ \u2192 A)\n      ( identity A)\n      ( comp A B A u f))\n#def equiv-transposition-unit uses (is-segal-A is-segal-B funext)\n  : Equiv\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n  :=\n    equiv-comp\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n( (a : A) \u2192 hom A a (u (f a)))\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n    ( equiv-function-equiv-family\n      ( funext)\n      ( A)\n( \\ a \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n      ( \\ a \u2192 hom A a (u (f a)))\n      ( equiv-transposition-unit-component))\n    ( equiv-unit-components)\n

We now reverse direction of the equivalence and extract the explicit map defining the transposition function associated to a unit natural transformation.

#def is-equiv-unit-component-transposition uses (funext)\n(a : A)\n  : is-equiv (hom A a (u (f a))) ((b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( \\ \u03b7a b k \u2192\n      comp-is-segal A is-segal-A a (u (f a)) (u b) \u03b7a (ap-hom B A u (f a) b k))\n  :=\n    inv-yoneda-lemma\n        ( funext)\n        ( B)\n        ( is-segal-B)\n        ( f a)\n        ( \\ b \u2192 hom A a (u b))\n        ( is-covariant-substitution-is-covariant\n          ( A)\n          ( B)\n          ( hom A a)\n          ( is-covariant-representable-is-segal A is-segal-A a)\n          ( u))\n#def is-equiv-unit-transposition uses (is-segal-A is-segal-B funext)\n  : is-equiv\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( \\ \u03b7 a b k \u2192\n      comp-is-segal A is-segal-A a (u (f a)) (u b)\n      ( \\ t -> \u03b7 t a)\n      ( ap-hom B A u (f a) b k))\n  :=\n    is-equiv-comp\n    ( nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n( (a : A) \u2192 hom A a (u (f a)))\n( (a : A) \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n    ( ev-components-nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f))\n    ( is-equiv-ev-components-nat-trans A (\\ _ \u2192 A)(identity A)(comp A B A u f))\n    ( \\ \u03b7 a b k \u2192\n      comp-is-segal A is-segal-A a (u (f a)) (u b)\n      ( \\ t -> \u03b7 a t)\n      ( ap-hom B A u (f a) b k))\n    ( is-equiv-function-is-equiv-family\n      ( funext)\n      ( A)\n      ( \\ a \u2192 hom A a (u (f a)))\n( \\ a \u2192 (b : B) \u2192 (hom B (f a) b) \u2192 (hom A a (u b)))\n      ( \\ a \u03b7a b k \u2192\n        comp-is-segal A is-segal-A a (u (f a)) (u b)\n        ( \u03b7a)\n        ( ap-hom B A u (f a) b k))\n      ( is-equiv-unit-component-transposition))\n

The results for counits are dual.

#def equiv-transposition-counit-component uses (funext)\n(b : B)\n  : Equiv ((a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b)) (hom B (f (u b)) b)\n  :=\n    ( contra-evid A (u b) (\\ a \u2192 hom B (f a) b) ,\n      contra-yoneda-lemma\n        ( funext)\n        ( A)\n        ( is-segal-A)\n        ( u b)\n        ( \\ a \u2192 hom B (f a) b)\n        ( is-contravariant-substitution-is-contravariant\n          ( B)\n          ( A)\n          ( \\ x -> hom B x b)\n          ( is-contravariant-representable-is-segal B is-segal-B b)\n          ( f)))\n#def equiv-counit-components\n  : Equiv\n( (b : B) \u2192 hom B (f (u b)) b)\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n  :=\n    inv-equiv\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n( (b : B) \u2192 hom B (f (u b)) b)\n    ( equiv-components-nat-trans\n      ( B)\n      ( \\ _ \u2192 B)\n      ( comp B A B f u)\n      ( identity B))\n#def equiv-transposition-counit uses (is-segal-A is-segal-B funext)\n  : Equiv\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n  :=\n    equiv-comp\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n( (b : B) \u2192 hom B (f (u b)) b)\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n    ( equiv-function-equiv-family\n      ( funext)\n      ( B)\n( \\ b \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n      ( \\ b \u2192 hom B (f (u b)) b)\n      ( equiv-transposition-counit-component))\n    ( equiv-counit-components)\n

We again reverse direction of the equivalence and extract the explicit map defining the transposition function associated to a counit natural transformation.

#def is-equiv-counit-component-transposition uses (funext)\n(b : B)\n  : is-equiv (hom B (f (u b)) b) ((a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( \\ \u03f5b a k \u2192\n      comp-is-segal B is-segal-B (f a) (f (u b)) b (ap-hom A B f a (u b) k) \u03f5b)\n  :=\n    inv-contra-yoneda-lemma\n        ( funext)\n        ( A)\n        ( is-segal-A)\n        ( u b)\n        ( \\ a \u2192 hom B (f a) b)\n        ( is-contravariant-substitution-is-contravariant\n          ( B)\n          ( A)\n          ( \\ z \u2192 hom B z b)\n          ( is-contravariant-representable-is-segal B is-segal-B b)\n          ( f))\n#def is-equiv-counit-transposition uses (is-segal-A is-segal-B funext)\n  : is-equiv\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( \\ \u03f5 b a k \u2192\n      comp-is-segal B is-segal-B (f a) (f (u b)) b\n      ( ap-hom A B f a (u b) k)\n      ( \\ t -> \u03f5 t b))\n  :=\n    is-equiv-comp\n    ( nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n( (b : B) \u2192 hom B (f (u b)) b)\n( (b : B) \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n    ( ev-components-nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B))\n    ( is-equiv-ev-components-nat-trans B (\\ _ \u2192 B)(comp B A B f u) (identity B))\n    ( \\ \u03f5 b a k \u2192\n      comp-is-segal B is-segal-B (f a) (f (u b)) b\n      ( ap-hom A B f a (u b) k)\n      ( \\ t -> \u03f5 b t))\n    ( is-equiv-function-is-equiv-family\n      ( funext)\n      ( B)\n      ( \\ b \u2192 hom B (f (u b)) b)\n( \\ b \u2192 (a : A) \u2192 (hom A a (u b)) \u2192 (hom B (f a) b))\n      ( \\ b \u03f5b a k \u2192\n        comp-is-segal B is-segal-B (f a) (f (u b)) b\n        ( ap-hom A B f a (u b) k)\n        ( \u03f5b))\n      ( is-equiv-counit-component-transposition))\n#end unit-counit-transposition\n

We next connect the triangle identity witnesses to the usual triangle identities as an application of the dependent Yoneda lemma.

#section triangle-identities\n#variables A B : U\n#variable is-segal-A : is-segal A\n#variable is-segal-B : is-segal B\n#variable f : A \u2192 B\n#variable u : B \u2192 A\n#variable \u03b7 : nat-trans A (\\ _ \u2192 A) (identity A) (comp A B A u f)\n#variable \u03f5 : nat-trans B (\\ _ \u2192 B) (comp B A B f u) (identity B)\n#def equiv-radj-triangle uses (funext)\n  : Equiv\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n  :=\n    inv-equiv\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n    ( equiv-hom2-eq-comp-is-segal\n      ( B \u2192 A)\n      ( is-segal-function-type\n        ( funext)\n        ( B)\n        ( \\ _ \u2192 A)\n        ( \\ _ \u2192 is-segal-A ))\n      ( u)\n      (triple-comp B A B A u f u)\n      ( u)\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n#def equiv-ev-components-radj-triangle\n  : Equiv\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n        ( comp-is-segal\n          ( B \u2192 A)\n          ( is-segal-function-type\n            ( funext)\n            ( B)\n            ( \\ _ \u2192 A)\n            ( \\ _ \u2192 is-segal-A ))\n          ( u)\n          (triple-comp B A B A u f u)\n          ( u)\n          ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n          ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))) =\n      ( \\ b \u2192 id-hom A ( u b)))\n  :=\n    equiv-ap-is-equiv\n    ( nat-trans B (\\ _ \u2192 A) u u)\n    ( nat-trans-components B (\\ _ \u2192 A) u u)\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u)\n    ( is-equiv-ev-components-nat-trans B (\\ _ \u2192 A) u u)\n    ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n    ( id-hom (B \u2192 A) u)\n#def equiv-components-radj-triangle-funext uses (funext)\n  : Equiv\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n        ( comp-is-segal\n          ( B \u2192 A)\n          ( is-segal-function-type\n            ( funext)\n            ( B)\n            ( \\ _ \u2192 A)\n            ( \\ _ \u2192 is-segal-A ))\n          ( u)\n          (triple-comp B A B A u f u)\n          ( u)\n          ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n          ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))) =\n      ( \\ b \u2192 id-hom A ( u b)))\n( ( b : B) \u2192\n      ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n        ( id-hom A ( u b))))\n  :=\n    equiv-FunExt\n    ( funext)\n    ( B)\n    ( \\ b \u2192 (hom A (u b) (u b)))\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n      ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )))\n    ( \\ b \u2192 id-hom A (u b))\n#def eq-ladj-triangle-comp-components-comp-nat-trans-is-segal uses (funext)\n(b : B)\n  : ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n      ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type (funext) (B) (\\ _ \u2192 A) (\\ _ \u2192 is-segal-A))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n      ( b))\n  :=\n    comp-components-comp-nat-trans-is-segal\n    ( funext)\n    ( B)\n    ( \\ _ \u2192 A)\n    ( \\ _ \u2192 is-segal-A)\n    ( u)\n    (triple-comp B A B A u f u)\n    ( u)\n    ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n    ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n    ( b)\n#def equiv-preconcat-radj-triangle uses (funext)\n(b : B)\n  : Equiv\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n      ( id-hom A ( u b)))\n    ( ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n  :=\n    equiv-preconcat\n    ( hom A (u b) (u b))\n    ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b)))\n    ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n      ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type (funext) (B) (\\ _ \u2192 A) (\\ _ \u2192 is-segal-A))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n      ( b))\n      ( id-hom A (u b))\n      (eq-ladj-triangle-comp-components-comp-nat-trans-is-segal b)\n#def equiv-component-comp-segal-comp-radj-triangle uses (funext)\n  : Equiv\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n  :=\n    equiv-triple-comp\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n    ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n        ( comp-is-segal\n          ( B \u2192 A)\n          ( is-segal-function-type\n            ( funext)\n            ( B)\n            ( \\ _ \u2192 A)\n            ( \\ _ \u2192 is-segal-A ))\n          ( u)\n          (triple-comp B A B A u f u)\n          ( u)\n          ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n          ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))) =\n      ( \\ b \u2192 id-hom A ( u b)))\n( ( b : B) \u2192\n      ( ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n        ( id-hom A ( u b))))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n    ( equiv-ev-components-radj-triangle)\n    ( equiv-components-radj-triangle-funext)\n    ( equiv-function-equiv-family\n      ( funext)\n      ( B)\n      ( \\ b \u2192\n        ( ev-components-nat-trans B (\\ _ \u2192 A) u u\n          ( comp-is-segal\n            ( B \u2192 A)\n            ( is-segal-function-type\n              ( funext)\n              ( B)\n              ( \\ _ \u2192 A)\n              ( \\ _ \u2192 is-segal-A ))\n            ( u)\n            (triple-comp B A B A u f u)\n            ( u)\n            ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n            ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 ))\n          ( b)) =\n        ( id-hom A ( u b)))\n      ( \\ b \u2192\n        ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n          ( \\ t \u2192 \u03b7 t (u b) )\n          ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n        ( id-hom A ( u b)))\n      ( equiv-preconcat-radj-triangle))\n

We finally arrive at the desired equivalence.

#def equiv-components-radj-triangle uses (funext)\n  : Equiv\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n  :=\n    equiv-comp\n    ( hom2 (B \u2192 A) u (triple-comp B A B A u f u) u\n      ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n      ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )\n      ( id-hom (B \u2192 A) u))\n    ( ( comp-is-segal\n        ( B \u2192 A)\n        ( is-segal-function-type\n          ( funext)\n          ( B)\n          ( \\ _ \u2192 A)\n          ( \\ _ \u2192 is-segal-A ))\n        ( u)\n        (triple-comp B A B A u f u)\n        ( u)\n        ( prewhisker-nat-trans B A A u (identity A) (comp A B A u f) \u03b7 )\n        ( postwhisker-nat-trans B B A (comp B A B f u) (identity B) u \u03f5 )) =\n      ( id-hom (B \u2192 A) u))\n( ( b : B) \u2192\n      ( comp-is-segal A is-segal-A (u b) (u (f (u b))) (u b)\n      ( \\ t \u2192 \u03b7 t (u b) )\n      ( ap-hom B A u (f (u b)) b (\\ t \u2192 \u03f5 t b))) =\n      ( id-hom A ( u b)))\n    ( equiv-radj-triangle)\n    ( equiv-component-comp-segal-comp-radj-triangle)\n

The calculation for the other triangle identity is dual.

#def equiv-ladj-triangle uses (funext)\n  : Equiv\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ a \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n  :=\n    inv-equiv\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n    ( equiv-hom2-eq-comp-is-segal\n      ( A \u2192 B)\n      ( is-segal-function-type\n        ( funext)\n        ( A)\n        ( \\ _ \u2192 B)\n        ( \\ _ \u2192 is-segal-B ))\n      ( f)\n      (triple-comp A B A B f u f)\n      ( f)\n      ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n      ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n      ( id-hom (A \u2192 B) f))\n#def equiv-ev-components-ladj-triangle\n  : Equiv\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n        ( comp-is-segal\n          ( A \u2192 B)\n          ( is-segal-function-type\n            ( funext)\n            ( A)\n            ( \\ _ \u2192 B)\n            ( \\ _ \u2192 is-segal-B ))\n          ( f)\n          (triple-comp A B A B f u f)\n          ( f)\n          ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n          ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))) =\n      ( \\ a \u2192 id-hom B ( f a)))\n  :=\n    equiv-ap-is-equiv\n    ( nat-trans A (\\ _ \u2192 B) f f)\n    ( nat-trans-components A (\\ _ \u2192 B) f f)\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f)\n    ( is-equiv-ev-components-nat-trans A (\\ _ \u2192 B) f f)\n    ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n    ( id-hom (A \u2192 B) f)\n#def equiv-components-ladj-triangle-funext uses (funext)\n  : Equiv\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n        ( comp-is-segal\n          ( A \u2192 B)\n          ( is-segal-function-type\n            ( funext)\n            ( A)\n            ( \\ _ \u2192 B)\n            ( \\ _ \u2192 is-segal-B ))\n          ( f)\n          (triple-comp A B A B f u f)\n          ( f)\n          ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n          ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))) =\n      ( \\ a \u2192 id-hom B ( f a)))\n( ( a : A) \u2192\n      ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a))))\n  :=\n    equiv-FunExt\n    ( funext)\n    ( A)\n    ( \\ a \u2192 (hom B (f a) (f a)))\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n      ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )))\n    ( \\ a \u2192 id-hom B (f a))\n#def eq-radj-triangle-comp-components-comp-nat-trans-is-segal uses (funext)\n(a : A)\n  : ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n      ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n      ( \\ t \u2192 \u03f5 t (f a))) =\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n      ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type (funext) (A) (\\ _ \u2192 B) (\\ _ \u2192 is-segal-B))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n      ( a))\n  :=\n    comp-components-comp-nat-trans-is-segal\n    ( funext)\n    ( A)\n    ( \\ _ \u2192 B)\n    ( \\ _ \u2192 is-segal-B)\n    ( f)\n    (triple-comp A B A B f u f)\n    ( f)\n    ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n    ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n    ( a)\n#def equiv-preconcat-ladj-triangle uses (funext)\n(a : A)\n  : Equiv\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a)))\n    ( ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n  :=\n    equiv-preconcat\n    ( hom B (f a) (f a))\n    ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n      ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n      ( \\ t \u2192 \u03f5 t (f a)))\n    ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n      ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n      ( a))\n    ( id-hom B (f a))\n    (eq-radj-triangle-comp-components-comp-nat-trans-is-segal a)\n#def equiv-component-comp-segal-comp-ladj-triangle uses (funext)\n  : Equiv\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n  :=\n    equiv-triple-comp\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n    ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n        ( comp-is-segal\n          ( A \u2192 B)\n          ( is-segal-function-type\n            ( funext)\n            ( A)\n            ( \\ _ \u2192 B)\n            ( \\ _ \u2192 is-segal-B ))\n          ( f)\n          (triple-comp A B A B f u f)\n          ( f)\n          ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n          ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))) =\n      ( \\ a \u2192 id-hom B ( f a)))\n( ( a : A) \u2192\n      ( ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a))))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n    ( equiv-ev-components-ladj-triangle)\n    ( equiv-components-ladj-triangle-funext)\n    ( equiv-function-equiv-family\n      ( funext)\n      ( A)\n      ( \\ a \u2192\n        ( ev-components-nat-trans A (\\ _ \u2192 B) f f\n          ( comp-is-segal\n            ( A \u2192 B)\n            ( is-segal-function-type\n              ( funext)\n              ( A)\n              ( \\ _ \u2192 B)\n              ( \\ _ \u2192 is-segal-B ))\n            ( f)\n            (triple-comp A B A B f u f)\n            ( f)\n            ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n            ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 ))\n          ( a)) =\n        ( id-hom B ( f a)))\n      ( \\ a \u2192\n        ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n          ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n          ( \\ t \u2192 \u03f5 t (f a))) =\n        ( id-hom B ( f a)))\n      ( equiv-preconcat-ladj-triangle))\n#def equiv-components-ladj-triangle uses (funext)\n  : Equiv\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n  :=\n    equiv-comp\n    ( hom2 (A \u2192 B) f (triple-comp A B A B f u f) f\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )\n        ( id-hom (A \u2192 B) f))\n    ( ( comp-is-segal\n        ( A \u2192 B)\n        ( is-segal-function-type\n          ( funext)\n          ( A)\n          ( \\ _ \u2192 B)\n          ( \\ _ \u2192 is-segal-B ))\n        ( f)\n        (triple-comp A B A B f u f)\n        ( f)\n        ( postwhisker-nat-trans A A B (identity A) (comp A B A u f) f \u03b7 )\n        ( prewhisker-nat-trans A B B f (comp B A B f u) (identity B) \u03f5 )) =\n      ( id-hom (A \u2192 B) f))\n( ( a : A) \u2192\n      ( comp-is-segal B is-segal-B (f a) (f (u (f a))) (f a)\n        ( ap-hom A B f a (u (f a)) (\\ t \u2192 \u03b7 t a))\n        ( \\ t \u2192 \u03f5 t (f a))) =\n      ( id-hom B ( f a)))\n    ( equiv-ladj-triangle)\n    ( equiv-component-comp-segal-comp-ladj-triangle)\n#end triangle-identities\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/","title":"Cocartesian families","text":"

These formalizations capture cocartesian families as treated in BW23.

The goal, for now, is not to give a general structural account as in the paper but rather to provide the definitions and results that are necessary to prove the cocartesian Yoneda Lemma.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#prerequisites","title":"Prerequisites","text":""},{"location":"simplicial-hott/12-cocartesian.rzk/#iso-inner-families","title":"(Iso-)Inner families","text":"

This is a (tentative and redundant) definition of (iso-)inner families. In the future, hopefully, these can be replaced by instances of orthogonal and LARI families.

#def is-inner-family\n( B : U)\n( P : B \u2192 U)\n  : U\n  :=\n    product\n    ( product (is-segal B) (is-segal (\u03a3 (b : B) , P b)))\n( (b : B) \u2192 (is-segal (P b)))\n#def is-isoinner-family\n( B : U)\n( P : B \u2192 U)\n  : U\n  :=\n    product\n    ( product (is-rezk B) (is-rezk (\u03a3 (b : B) , P b)))\n( (b : B) \u2192 (is-rezk (P b)))\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#cocartesian-arrows","title":"Cocartesian arrows","text":"

Here we define the proposition that a dependent arrow in a family is cocartesian. This is an alternative version using unpacked extension types, as this is preferred for usage.

BW23, Definition 5.1.1
#def is-cocartesian-arrow\n( B : U)\n( b b' : B)\n( u : hom B b b')\n( P : B \u2192 U)\n( e : P b)\n( e' : P b')\n( f : dhom B b b' u P e e')\n  : U\n  :=\n(b'' : B) \u2192 (v : hom B b' b'') \u2192 (w : hom B b b'') \u2192\n(sigma : hom2 B b b' b'' u v w) \u2192 (e'' : P b'') \u2192\n(h : dhom B b b'' w P e e'') \u2192\n      is-contr\n( \u03a3 ( g : dhom B b' b'' v P e' e'') ,\n          ( dhom2 B b b' b'' u v w sigma P e e' e'' f g h))\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#cocartesian-lifts","title":"Cocartesian lifts","text":"

The following is the type of cocartesian lifts of a fixed arrow in the base with a given starting point in the fiber.

BW23, Definition 5.1.2
#def cocartesian-lift\n( B : U)\n( b b' : B)\n( u : hom B b b')\n( P : B \u2192 U)\n( e : P b)\n  : U\n  :=\n\u03a3 (e' : P b') ,\n\u03a3 (f : dhom B b b' u P e e') , is-cocartesian-arrow B b b' u P e e' f\n
"},{"location":"simplicial-hott/12-cocartesian.rzk/#cocartesian-family","title":"Cocartesian family","text":"

A family over cocartesian if it is isoinner and any arrow in the has a cocartesian lift, given a point in the fiber over the domain.

BW23, Definition 5.2.1
#def has-cocartesian-lifts\n( B : U)\n( P : B \u2192 U)\n  : U\n  :=\n( b : B) \u2192 ( b' : B) \u2192 ( u : hom B b b') \u2192\n( e : P b) \u2192 ( \u03a3 (e' : P b'),\n( \u03a3 (f : dhom B b b' u P e e'), is-cocartesian-arrow B b b' u P e e' f))\n
BW23, Definition 5.2.2
#def is-cocartesian-family\n( B : U)\n( P : B \u2192 U)\n  : U\n  := product (is-isoinner-family B P) (has-cocartesian-lifts B P)\n
"},{"location":"simplicial-hott/13-limits.rzk/","title":"13. Limits and colimits","text":"

These formalisations correspond in part to Section 3 of the BM22 paper.

This is a literate rzk file:

#lang rzk-1\n
"},{"location":"simplicial-hott/13-limits.rzk/#definition-limits-and-colimits","title":"Definition limits and colimits","text":"

Given a function f : A \u2192 B and b:B we define the type of cones over f.

#def cone\n( A B : U )\n( f : A \u2192 B )\n  : U\n  := \u03a3 (b : B), hom (A \u2192 B) (constant A B b) f\n

Given a function f : A \u2192 B and b:B we define the type of cocones under f.

#def cocone\n( A B : U )\n( f : A \u2192 B )\n  : U\n  := \u03a3 (b : B), hom ( A \u2192 B) f (constant A B b)\n
We define a colimit for f : A \u2192 B as an initial cocone under f.

#def colimit\n( A B : U )\n( f : A \u2192 B )\n  : U\n  := \u03a3 ( x : cocone A B f ) , is-initial (cocone A B f) x\n

We define a limit of f : A \u2192 B as a terminal cone over f.

#def limit\n( A B : U )\n( f : A \u2192 B )\n  : U\n  :=  \u03a3 ( x : cone A B f ) , is-final (cone A B f) x\n
We give a second definition of limits, we eventually want to prove both definitions coincide. Define cone as a family.

#def cone2\n(A B : U)\n  : (A \u2192 B) \u2192 (B) \u2192 U\n  := \\ f \u2192 \\ b \u2192 (hom (A \u2192 B) (constant A B b) f)\n
#def constant-nat-trans\n(A B : U)\n( x y : B )\n( k : hom B x y)\n  : hom (A \u2192 B) (constant A B x) (constant A B y)\n  := \\ t a \u2192 ( constant A ( hom B x y ) k ) a t\n

#def cone-precomposition\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B )\n( b x : B )\n( k : hom B b x)\n  : (cone2 A B f x) \u2192  (cone2 A B f b)\n  := \\ \u03b1 \u2192 vertical-comp-nat-trans\n              ( A)\n              ( \\ a \u2192 B)\n              ( \\ a \u2192 is-segal-B)\n              ( constant A B b)\n              ( constant A B x)\n              (f)\n              ( constant-nat-trans A B b x k )\n              ( \u03b1)\n
Another definition of limit.

#def limit2\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (b : B),\n\u03a3 ( c : cone2 A B f b ),\n( x : B) \u2192 ( k : hom B b x)\n      \u2192 is-equiv (cone2 A B f x) (cone2 A B f b) (cone-precomposition A B is-segal-B f b x k )\n

We give a second definition of colimits, we eventually want to prove both definitions coincide. Define cocone as a family.

#def cocone2\n(A B : U)\n  : (A \u2192 B) \u2192 (B) \u2192 U\n  := \\ f \u2192 \\ b \u2192 (hom (A \u2192 B) f (constant A B b))\n

#def cocone-postcomposition\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B )\n( x b : B )\n( k : hom B x b)\n  : (cocone2 A B f x) \u2192 (cocone2 A B f b)\n  := \\ \u03b1 \u2192 vertical-comp-nat-trans\n              ( A)\n              ( \\ a \u2192 B)\n              ( \\ a \u2192 is-segal-B)\n              (f)\n              ( constant A B x)\n              ( constant A B b)\n              ( \u03b1)\n              ( constant-nat-trans A B x b k )\n
Another definition of colimit.

#def colimit2\n( A B : U)\n( is-segal-B : is-segal B)\n( f : A \u2192 B)\n  : U\n  := \u03a3 (b : B),\n\u03a3 ( c : cocone2 A B f b ),\n( x : B) \u2192 ( k : hom B x b)\n      \u2192 is-equiv (cocone2 A B f x) (cocone2 A B f b) (cocone-postcomposition A B is-segal-B f x b k )\n
The following alternative definition does not require a Segalness condition. When is-segal B then definitions 1 and 3 coincide.

#def limit3\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 ( b : B),(x : B) \u2192 Equiv (hom B b x ) (cone2 A B f x)\n
#def colimit3\n( A B : U)\n( f : A \u2192 B)\n  : U\n  := \u03a3 ( b : B),(x : B) \u2192 Equiv (hom B x b ) (cocone2 A B f x)\n

"},{"location":"simplicial-hott/13-limits.rzk/#uniqueness-of-initial-and-final-objects","title":"Uniqueness of initial and final objects.","text":"

In a Segal type, initial objects are isomorphic.

#def iso-initial\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( is-initial-a : is-initial A a)\n( is-initial-b : is-initial A b)\n  : Iso A is-segal-A a b\n  :=\n    ( first (is-initial-a b) ,\n      ( ( first (is-initial-b a) ,\n          eq-is-contr\n            ( hom A a a)\n            ( is-initial-a a)\n            ( comp-is-segal A is-segal-A a b a\n              ( first (is-initial-a b))\n              ( first (is-initial-b a)))\n            ( id-hom A a)) ,\n        ( first (is-initial-b a) ,\n          eq-is-contr\n            ( hom A b b)\n            ( is-initial-b b)\n            ( comp-is-segal A is-segal-A b a b\n              ( first (is-initial-b a))\n              ( first (is-initial-a b)))\n            ( id-hom A b))))\n

In a Segal type, final objects are isomorphic.

#def iso-final\n( A : U)\n( is-segal-A : is-segal A)\n( a b : A)\n( is-final-a : is-final A a)\n( is-final-b : is-final A b)\n( iso : Iso A is-segal-A a b)\n  : Iso A is-segal-A a b\n  :=\n    ( first (is-final-b a) ,\n      ( ( first (is-final-a b) ,\n          eq-is-contr\n            ( hom A a a)\n            ( is-final-a a)\n            ( comp-is-segal A is-segal-A a b a\n              ( first (is-final-b a))\n              ( first (is-final-a b)))\n            ( id-hom A a)) ,\n        ( first (is-final-a b) ,\n          eq-is-contr\n            ( hom A b b)\n            ( is-final-b b)\n            ( comp-is-segal A is-segal-A b a b\n              ( first (is-final-a b))\n              ( first (is-final-b a)))\n            ( id-hom A b))))\n
"},{"location":"simplicial-hott/13-limits.rzk/#uniqueness-up-to-isomophism-of-colimits","title":"Uniqueness up to isomophism of (co)limits","text":""}]} \ No newline at end of file diff --git a/simplicial-hott/09-yoneda.rzk/index.html b/simplicial-hott/09-yoneda.rzk/index.html index e23c98fd..d3a78567 100644 --- a/simplicial-hott/09-yoneda.rzk/index.html +++ b/simplicial-hott/09-yoneda.rzk/index.html @@ -957,6 +957,13 @@ Contravariant Dependent Yoneda lemma + + +
  • + + Representable Families + +
  • @@ -1177,6 +1184,13 @@ Contravariant Dependent Yoneda lemma + + +
  • + + Representable Families + +
  • @@ -2204,6 +2218,36 @@

    Contravariant Dependent Yoneda lem ( contra-dependent-yoneda-lemma' A is-segal-A a C is-contravariant-C) +

    Representable Families

    +

    A covariant family is representable if it is fiberweise equivalent to covariant +homs. In order to check if this is the case, it is not necessary to know if the +family is covariant or not.

    +
    #def is-representable-family
    +  ( A : U)
    +  ( C : A → U)
    +  : U
    +  := Σ (a : A) , (x : A) → (Equiv (hom A a x) (C x))
    +
    +

    The definition makes it slightly awkward to access the actual equivalence, so we +give a helper function.

    +
    #def equiv-for-is-representable-family
    +  ( A : U)
    +  ( C : A → U)
    +  ( is-rep-C : is-representable-family A C)
    +  : (x : A) → (hom A (first is-rep-C) x) → (C x)
    +  := \ x first((second (is-rep-C)) x)
    +
    +

    RS Proposition 9.10 gives an if and only if condition for a covariant family +C : A → U to be representable. The condition is that the type +Σ (x : A) , C x has an initial object. For convenience, we give this +condition a name.

    +
    #def has-initial-tot
    +  ( A : U)
    +  ( C : A → U)
    +  : U
    +  := Σ ((a , u) : Σ (x : A) , (C x))
    +      , is-initial (Σ (x : A) , (C x)) (a , u)
    +
    diff --git a/sitemap.xml.gz b/sitemap.xml.gz index a6d7a8d5..ec8e7ae6 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ