Bicategories in Univalent Foundations

We develop bicategory theory in univalent foundations. Guided by the notion of univalence for (1-)categories studied by Ahrens, Kapulkin, and Shulman, we define and study univalent bicategories. To construct examples of univalent bicategories in a modular fashion, we develop displayed bicategories, an analog of displayed 1-categories introduced by Ahrens and Lumsdaine. We demonstrate the applicability of this notion, and prove that several bicategories of interest are univalent. Among these are the bicategory of univalent categories with families and the bicategory of pseudofunctors between univalent bicategories. Furthermore, we show that every bicategory with univalent hom-categories is weakly equivalent to a univalent bicategory. All of our work is formalized in Coq as part of the UniMath library of univalent mathematics.


Introduction
Category theory (by which we mean 1-category theory) is established as a convenient language to structure and discuss mathematical objects and morphisms between them. To axiomatize the fundamental objects of category theory itself-categories, functors, and natural transformations-the theory of 1-categories is not enough. Instead, category-like structures allowing for "morphisms between morphisms" were developed to account for the natural transformations. Among those structures are bicategories. Bicategory theory was originally developed by Bénabou [9] in set-theoretic foundations. The goal of our work is to develop bicategory theory in univalent foundations. Specifically, we give a notion of a univalent bicategory and show that some bicategories of interest are univalent, with examples from algebra and type theory. To this end, we generalize (univalent) displayed categories of Ahrens and Lumsdaine [3] to the bicategorical setting, and prove that the total bicategory generated by a displayed bicategory is univalent, if the constituent pieces are. In addition, we show how to embed any bicategory with univalent hom-categories into a univalent bicategory via the Yoneda lemma, and we show how to use displayed machinery to construct biequivalences between total bicategories.
In the simplicial set model, univalent categories (just called "categories" in [2]) correspond to truncated complete Segal spaces, which in turn are equivalent to ordinary (set-theoretic) categories. In this respect, univalent categories are "the right" notion of categories in univalent foundations: they correspond exactly to the traditional set-theoretic notion of category. Similarly, the notion of univalent bicategory, studied in this paper, provides the correct notion of bicategory in univalent foundations-see, e.g., [6,Example 9.1]. In this work, we provide results for showing, modularly, that certain bicategories are univalent.
Throughout this article, we work in type theory with function extensionality. We explicitly mention any use of the univalence axiom. We use the notation standardized in [35]; a significantly shorter overview of the setting we work in is given in [2]. As a reference for 1-category theory in univalent foundations, we refer to [2], which follows a path suggested by Hofmann and Streicher [19,Section 5.5].
Motivation: bicategories for type theory One of the motivations for this work stems from several particular (classes of) bicategories that come up in our work on the semantics of type theories and Higher Inductive Types (HITs).
Firstly, we are interested in the "categories with structure" that have been used in the model theory of type theories. The purpose of the various categorical structures is to model context extension and substitution. Prominent such notions are categories with families (see, e.g., [13,15]), categories with attributes (see, e.g., [31]), and categories with display maps (see, e.g., [34,30]). Each notion of "categorical structure" gives rise to a bicategory whose objects are categories equipped with such a structure. In the present work, we provide machinery that can be used to show, in a modular way, that these bicategories are univalent; we exemplify the machinery with categories with families.
Secondly, Dybjer and Moeneclaey define a notion of signature for 1-HITs and study algebras of those signatures [16]. These algebras are groupoids equipped with extra structure according to the signature. In the present work, we give general methods for constructing bicategories of such algebras and we demonstrate the usage of those methods by constructing the bicategory of monads internal to a given bicategory. We then construct a bicategory of Kleisli triples (an alternative presentation of monads 1 ), and show that it is equivalent to the bicategory of monads. We also show that the resulting bicategory of monads internal to the bicategory of univalent categories is biequivalent to the bicategory of Kleisli triples.
Technical contribution: displayed bicategories In this work, we develop the notion of displayed bicategory in analogy to the 1-categorical notion of displayed category introduced in [3]. Intuitively, a displayed bicategory D over a bicategory B represents data and properties to be added to B to form a new bicategory: D gives rise to the total bicategory D. Its cells are pairs (b, d) where d in D is a "displayed cell" over b in B. Univalence of D can be shown from univalence of B and "displayed univalence" of D. The latter two conditions are easier to show, sometimes significantly easier.
Two features make the displayed point of view particularly useful: firstly, displayed structures can be iterated, making it possible to build bicategories of very complicated objects layerwise. Secondly, displayed "building blocks" can be provided, for which univalence is proved once and for all. These building blocks, e.g., cartesian product, can be used like LEGO ™ pieces to modularly build bicategories of large structures that are automatically accompanied by a proof of univalence.
In Section 2, we define the notion of biequivalence of bicategories, the "correct" notion of sameness for bicategories. We construct a biequivalence between 1-types and univalent groupoids. In Section 3, we present an induction principle for invertible 2-cells in a locally univalent bicategory and an induction principle for adjoint equivalences in a globally univalent bicategory. We put these principles to work in a number of examples. Section 4 is new. In there, we propose a definition of 2-category and of strict bicategory, and we show that these are equivalent. Section 5 is new. In there, we show that any bicategory embeds into a univalent one via the Yoneda embedding. This construction is reminiscent of the Rezk completion for categories. In Section 6, we give the definition of the displayed bicategory of monads internal to a given bicategory and the displayed bicategory of Kleisli triples . The bicategory of monads on a bicategory B is univalent whenever B is univalent, which is proved in Section 9.2. Section 8 is new. In there, we introduce the notion of displayed biequivalence. Using this notion, we show that the biequivalence between 1-types and univalent groupoids extends to a biequivalence between their pointed variants. We also construct a biequivalence between the bicategory of Kleisli triples and the bicategory of monads internal to the bicategory of univalent categories. Section 10 is new. Following a suggestion by an anonymous referee, we generalize the constructions in Sections 9.2 and 9.3 using displayed inserters.

Bicategories and Some Examples
Bicategories were introduced by Bénabou [9], encompassing monoidal categories, 2-categories (in particular, the 2-category of categories), and other examples. He (and later many other authors) defines bicategories in the style of "categories weakly enriched in categories". That is, the hom-objects B 1 (a, b) of a bicategory B are taken to be (1-)categories, and composition is given by a functor B 1 (a, b) × B 1 (b, c) → B 1 (a, c). This presentation of bicategories is concise and convenient for communication between mathematicians.
In this article, we use a different, more unfolded definition of bicategories, which is inspired by Bénabou [9, Section 1.3] and [29, Section 'Details']. One the one hand, it is more verbose than the definition via weak enrichment. On the other hand, it is better suited for our purposes, in particular, it is suitable for defining displayed bicategories, cf. Section 6. θ : B 2 (f, g) and γ : B 2 (g, h); 8. a left whiskering f θ : B 2 (f · g, f · h) for all 1-cells f : B 1 (a, b) and g, h : B 1 (b, c) and 2-cells θ : B 2 (g, h); 9. a right whiskering θ h : B 2 (f · h, g · h) for all 1-cells f, g : B 1 (a, b) and h : B 1 (b, c) and 2-cells θ : B 2 (f, g); 10. a left unitor λ(f ) : B 2 (id 1 (a) · f, f ) and its inverse λ(f ) −1 : , and h : B 1 (c, d) such that, for all suitable objects, 1-cells, and 2-cells, A bicategory is a prebicategory whose types of 2-cells B 2 (f, g) are sets for all a, b : B 0 and f, g : B 1 (a, b).
We write a → b for B 1 (a, b) and f ⇒ g for B 2 (f, g). Mitchell Riley formalized a definition of bicategories as "categories weakly enriched in categories" in UniMath, based on work by Peter LeFanu Lumsdaine. We do not reproduce this definition here; it is available as prebicategory. That definition is equivalent to our definition, in the following sense:

Proposition 2.2 (weq_bicat_prebicategory). The type of bicategories defined in Definition 2.1 is equivalent to the type of bicategories in terms of weak enrichment.
For this result, one needs to show that each B 1 (a, b) forms a category whose morphisms are 2-cells. Let us introduce this formally.

Definition 2.3 (hom)
. Let B be a bicategory and a, b : B 0 objects of B. Then we define the hom-category B 1 (a, b) to be the category whose objects are 1-cells f : a → b and whose morphisms from f to g are 2-cells α : f ⇒ g of B. The identity morphisms are identity 2-cells and the composition is vertical composition of 2-cells.
Recall that our goal is to study univalence of bicategories, which is a property that relates equivalence and equality. For this reason, we study the two analogs of the 1-categorical notion of isomorphism. The corresponding notion for 2-cells is that of invertible 2-cells.
An invertible 2-cell consists of a 2-cell and a proof that it is invertible, and inv2cell(f, g) is the type of invertible 2-cells from f to g.
Since 2-cells form a set and inverses are unique, being an invertible 2-cell is a proposition. In addition, id 2 (f ) is invertible, and we write id 2 (f ) : inv2cell(f, f ) for this invertible 2-cell.
The bicategorical analog of isomorphisms for 1-cells is the notion of adjoint equivalence.
Definition 2.5 (adjoint_equivalence). An adjoint equivalence structure on a 1-cell f : a → b consists of a 1-cell g : b → a and invertible 2-cells η : id 1 (a) ⇒ f · g and ε : g · f ⇒ id 1 (b) such that the following two diagrams commute An adjoint equivalence consists of a 1-cell f together with an adjoint equivalence structure on f . The type AdjEquiv(a, b) consists of all adjoint equivalences from a to b.
We call η and ε the unit and counit of the adjoint equivalence, and we call g the right adjoint. The prime example of an adjoint equivalence is the identity 1-cell id 1 (a) and we denote it by id 1 (a) : AdjEquiv(a, a). Sometimes, we write a b for AdjEquiv(a, b).
Before we start our study of univalence, we present some examples of bicategories and preliminary notions from bicategory theory. Example 2.6 (fundamental_bigroupoid). Let X be a 2-type. Then we define the fundamental bigroupoid π(X) to be the bicategory whose 0-cells are inhabitants of X, 1-cells from x to y are paths x = y, and 2-cells from p to q are higher-order paths p = q. The operations, such as composition and whiskering, are defined using path induction. Every 1-cell is an adjoint equivalence and every 2-cell is invertible. Example 2.7 (one_types). Let U be a universe. The objects of the bicategory 1-Type U are 1-truncated types of the universe U, the 1-cells are functions between the underlying types, and the 2-cells are homotopies between functions. The 1-cells id 1 (X) and f · g are defined as the identity and composition of functions, respectively. The 2-cell id 2 (f ) is refl, the 2-cell p • q is the concatenation of paths. The unitors and associators are defined as identity paths. Every 2-cell is invertible, and adjoint equivalences from X to Y are the same as equivalences of types from X to Y . Example 2.8 (bicat_of_univ_cats). We define the bicategory Cat of univalent categories as the bicategory whose 0-cells are univalent categories, 1-cells are functors, and 2-cells are natural transformations. The identity 1-cells are identity functors, the composition and whiskering operations are composition of functors and whiskering of functors and transformations, respectively. Invertible 2-cells are natural isomorphisms, and adjoint equivalences are external adjoint equivalences of categories. Example 2.9 (op1_bicat). Let B be a bicategory. Then we define B op to be the bicategory whose objects are objects in B, 1-cells from x to y are 1-cells y → x in B, and the 2-cells from f to g are 2-cells f ⇒ g in B.
Definition 2.10 (fullsubbicat). Let B be a bicategory and P : B 0 → hProp a predicate on the 0-cells of B. We define the full subbicategory of B with 0-cells satisfying P as the bicategory whose objects are pairs (a, p a ) : (x:B0) P (x), 1-cells from (a, p a ) to (b, p b ) are 1-cells a → b in B, and 2-cells are as in B. In Example 6.5 we present a construction of this bicategory using displayed bicategories. Example 2.11 (grpds). We define the bicategory Grpd as the full subbicategory of Cat in which every object is a groupoid. For 1-categories the "correct" notion of equality is not isomorphism of categories, but equivalence of categories. Similarly, the right notion of equality for bicategories is biequivalence.
To talk about biequivalences we need to introduce pseudofunctors.
; For each f : B 1 (a, b) and g : and such that the following diagrams commute (where all free variables should be taken to be universally quantified): We write B → C for the type of pseudofunctors from B to C.
In the remainder of the paper, we sometimes write F (a) instead of F 0 (a), and we use the same convention for F 1 and F 2 . We call the 2-cells F i and F c the identitor and compositor, respectively. From each pseudofunctor F : B → C we can assemble functors ) between the hom-categories.
We write F ⇒ G for the type of pseudotransformations from F to G. Definition 2.14 (modification). Let B and C be bicategories, F, G : B → C be pseudofunctors, and η, θ : F ⇒ G be pseudotransformations. A modification Γ from η to θ consists of 2-cells Γ(a) : η(a) ⇒ θ(a) for each a : B such that commutes for any a, b : B and f : B 1 (a, b). We write η θ for the type of modifications from η to θ.
To illustrate these three definitions, we look at some examples. Example 2.15. Let X and Y be 2-types. (ap_psfunctor) Each function f : X → Y induces a pseudofunctor f : π(X) → π(Y ), which sends objects x : X to f (x), 1-cells p : x = y to ap f p, and 2-cells h : p = q to ap (ap f ) h.
(ap_pstrans) Suppose we have f, g : X → Y and e : x:X f (x) = g(x). Then we obtain a pseudotransformation e : f ⇒ g whose component at x is e(x), and whose actions on 1-cells are given by path induction.
Note that we have a bicategory Pseudo(B, C) of pseudofunctors, pseudotransformations, and modifications. We construct this bicategory in Section 9.1 using displayed bicategories, and then we define invertible modifications to be invertible 2-cells in this bicategory. With all this in place, we can define biequivalences.
Usually, the notion of biequivalence is not sufficient, and instead biadjoint biequivalences are used. The latter notion has an extra requirement, namely that L and R form a pseudoadjunction [22]. Note that this is similar to the situation in types (see, e.g., [35,Section 4]) and categories (see, e.g., [26,Section IV.4]), where one also considers coherent notions of equivalence. However, we restrict our attention to biequivalences, because every biequivalence can be refined to a biadjoint biequivalence [18, Theorem 3.1].

Example 2.18 (biequiv_path_groupoid).
We construct a biequivalence between 1-types and univalent groupoids. We only show how the involved pseudofunctors are defined.
(path_groupoid) Define a pseudofunctor PathGrpd : 1-Type → Grpd. It sends a 1-type X to the groupoid PathGrpd(X) whose objects are X and morphisms from x to y are paths x = y.
(objects_of_grpd) Define a pseudofunctor Ob : Grpd → 1-Type. It sends a groupoid G to the 1-type Ob(G) whose inhabitants are objects of G. Note that this is a 1-truncated type, because G is univalent.

Univalent Bicategories
Recall that a (1-)category C (called 'precategory' in [2]) is called univalent if, for every two objects a, b : C 0 , the function idtoiso a,b : (a = b) → Iso(a, b) mapping the constant path to the identity isomorphism is an equivalence. For bicategories, where we have one more layer of structure, univalence can be imposed both locally and globally.
Univalence for bicategories is defined as follows: 1. Let a, b : B 0 and f, g : B 1 (a, b) be objects and morphisms of B; by path induction we define a function idtoiso 2,1 f,g : f = g → inv2cell(f, g) which sends refl(f ) to id 2 (f ). A bicategory B is locally univalent if, for every two objects a, b : B 0 and two 1-cells f, g : B 1 (a, b), the function idtoiso 2,1 f,g is an equivalence. 2. Let a, b : B 0 be objects of B; using path induction we define idtoiso 2,0 a,b : a = b → AdjEquiv(a, b) sending refl(a) to id 1 (a). A bicategory B is globally univalent if, for every two objects a, b : B 0 , the canonical function idtoiso 2,0 a,b is an equivalence. 3. (is_univalent_2) We say that B is univalent if B is both locally and globally univalent.
Local univalence can be characterized via the hom-categories. More precisely, it is equivalent to all hom-categories being univalent.  If B and C are locally univalent and F is a pseudofunctor from B to C, then the identity and compositions are preserved up to a path instead of just an invertible 2-cell. However, this does not mean such pseudofunctors should be considered as strict, because these are not paths between elements of a set.
Univalent bicategories satisfy a variant of the elimination principle of path induction. More precisely, there are two such principles: a local one for invertible 2-cells and a global one for adjoint equivalences. We start with the induction principle associated to invertible 2-cells:

Proposition 3.4 (J_2_1). Let B be a locally univalent bicategory. Given a type family Y and a function y with types
there is a function In particular, in order to prove a predicate over all invertible 2-cells in a given locally univalent bicategory, it suffices to prove it for all identity 2-cells. Next, we present the induction principle associated to adjoint equivalences: . Let B be a globally univalent bicategory. Given a type family Y and a function y with types Y : there is a function In particular, in order to prove a predicate over all adjoint equivalences in a given globally univalent bicategory, it suffices to prove it for all identity 1-cells. Notice that in both induction principles the computation rules hold only up to propositional equality. Next, we present some usage examples of how to use Propositions 3.4 and 3.5. The constructions described in Example 3.6 and Proposition 3.9 work for arbitrary bicategories, not just globally/locally univalent ones. Nevertheless, these constructions are considerably simpler if the involved bicategories satisfy certain univalence assumptions.  and θ : inv2cell(f, g). If f is an adjoint equivalence, then g is an adjoint equivalence as well. While this result generally holds in any bicategory B, it is particularly simple to prove when B is locally univalent. Applying Proposition 3.4, we are left to prove the statement with θ as the identity 2-cell. In that statement, f and g are definitionally equal, and hence the statement is trivially true.

Proof. Lengthy but straightforward.
If B is globally univalent and C is locally univalent, the above statement can be proved very easily. Proposition 3.9 (psfunctor_preserves_adjequiv). If B is globally univalent and C is locally univalent, then every pseudofunctor F : B → C preserves adjoint equivalences.
Proof. Applying Proposition 3.5 on f , we are left to prove that F 1 (id 1 (a)) is an adjoint equivalence. Since F is a pseudofunctor, there exists an invertible 2-cell F i (a) : id 1 (F 0 (a)) ⇒ F 1 (id 1 (a)). Therefore, by Example 3.7 and the fact that id 1 (F 0 (a)) is an adjoint equivalence, we conclude that F 1 (id 1 (a)) is an adjoint equivalence as well.
Another consequence is that biequivalences between univalent bicategories gives rise to equivalences on the level of objects. Proposition 3.10 (biequivalence_to_object_equivalence). Given univalent bicategories B and C, and a biequivalence F from B to C, then we get an equivalence of types While right adjoints are only unique up to isomorphism in general, they are unique up to identity if the bicategory is locally univalent: Then having an adjoint equivalence structure on a 1-cell in B is a proposition.
As a consequence of this proposition we get the following: Proposition 3.11 has another important use: to prove global univalence of a bicategory, we need to show that idtoiso 2,0 a,b is an equivalence. Often we do that by constructing a function in the other direction and showing these two are inverses. This requires comparing adjoint equivalences, which is done with the help of Proposition 3.11.
Local univalence is also relevant when one discusses bicategorical analogues of limits and colimits. To exemplify this, we look at biinitial objects, and we note that a similar discussion can be given for bifinal objects (bifinal_unique). We start by defining biinitiality structures. Definition 3.13 (is_biinitial). Let B be a bicategory and let a be an object in B. Then a biinitiality structure on a consists of an external adjoint equivalence structure on the canonical functor from B(a, b) to the unit category for each b : B. A biinitial object is an object a : B together with a biinitiality structure on a.
In general, adjoint equivalence structures are not necessarily unique, but they are if the bicategory is locally univalent. As such, having a biinitiality structure is not necessarily a proposition, and instead, it should be viewed as a structure on the objects. If the bicategory is locally univalent, however, then we can use Proposition 3.11 to show that biinitiality structures form a proposition.
Example 3.17. Note that both 1-Type and Cat have a biinitial object. (biinitial_1_types) The empty type is a biinitial object in 1-Type. (biinitial_cats) The empty category is a biinitial object in Cat. Now let us prove that some examples from Section 2 are univalent.
Example 3.18. The following bicategories are univalent: The bicategory of 1-types of a universe U is locally univalent; this is a consequence of function extensionality. If we assume the univalence axiom for U, then 1-types form a univalent bicategory. To show that, we factor idtoiso 2,0 as follows.
The left function is an equivalence by univalence, and the right function is an equivalence by the characterization of adjoint equivalences in Example 2.7. The fact that this diagram commutes follows from Proposition 3.11. 3. (FullSub.v, If B is univalent and P is a predicate on B, then so is the full subbicategory of B with those objects satisfying P . It is more difficult to prove that the bicategory of univalent categories is univalent, and we only give a brief sketch of this proof. Local univalence follows from the fact that the functor category [C, D] is univalent if D is. For global univalence, we use that the type of identities on categories is equivalent to the type of adjoint equivalences between categories [2, Theorem 6.17]. The proof proceeds by factoring idtoiso 2,0 as a chain of equivalences (C = D) To our knowledge, a proof of global univalence was first computer-formalized by Rafaël Bocquet 2 .
In the previous examples, we proved univalence directly. However, in many complicated bicategories such proofs are not feasible. An example of such a bicategory is the bicategory Pseudo(B, C) of pseudofunctors from B to C, pseudotransformations, and modifications [25] (for a univalent bicategory C). Even in the 1-categorical case, proving the univalence of the category [C, D] of functors from C to D, and natural transformations between them, is tedious. In Section 7, we develop some machinery to prove the following theorem.

Bicategories and 2-Categories
In this section, we propose a definition of 2-category, and compare 2-categories to bicategories. We start by defining strict bicategories.

Proposition 4.2 (isaprop_is_strict_bicat). Being a 1-strict bicategory is a proposition.
Now let us look at an example of a 1-strict bicategory.

Example 4.3 (strict_bicat_of_strict_cats).
Recall that a category is called strict if its objects form a set. Define Cat S to be the bicategory whose objects are strict categories, 1-cells are functors, and 2-cells are natural transformations. Then Cat S is a 1-strict bicategory.
The bicategory Cat of univalent categories is not 1-strict. This is because functors between two categories do not necessarily form a set.  One can show that the additional coherence conditions are unique and automatic when the bicategory under consideration is locally strict or locally univalent. Furthermore, when the bicategory is locally univalent, the type of coherent strictness structures on it is contractible (unique_strictness_structure_is_univalent_2_1).
Next we look at 2-categories. These are defined as 1-categories with additional structure and properties. Definition 4.6 (two_cat). A 2-category C consists of a category C 0 ; for each x, y : C 0 and f, g : a, b) and h : C 1 (b, c) and 2-cells θ : C 2 (f, g); such that, for all suitable objects, 1-cells, and 2-cells, is defined by path induction, sending the identity path to the identity 2-cell. The paths idleft(f ), idright(g), and assoc(f, g, h) are those given by the categorical axioms for C 0 .
We call 0-cells of a 2-category C the objects of C 0 , and 1-cells the morphisms of the category C 0 . In particular, the 1-cells between every two 0-cells of a 2-category always form a set.
Remark 4.7. The last few axioms of a 2-category could, equivalently, be stated using transport along a categorical equality axiom (e.g., along idleft(f )), instead of using idto2cell.
The type of 1-strict bicategories is equivalent to that of 2-categories.  . In one direction, suppose C is a 2-category. We associate to C the following bicategory: 1. 0-cells, 1-cells, and 2-cells are those of C; 2. composition and identity of 1-cells and 2-cells are those of C, respectively; 3. whiskering is given by the whiskering of C; 4. left and right unitors, and associators, are 2-cells induced by the corresponding equality axioms via idto2cell. The bicategorical axioms are then easily shown, using compatibility, in a suitable sense, of idto2cell with composition of paths (which corresponds to composition of 2-cells) and functions on paths (which corresponds to whiskering). The resulting bicategory is 1-strict.
In the other direction, suppose B is a 1-strict bicategory. We associate the following 2-category to B: 1. 0-cells, 1-cells, and 2-cells are those of B, respectively; 2. composition, identities, and whiskering are given by the corresponding operations of B; 3. the equality axioms for composition of 1-cells are proved using the strictness properties of B; 4. the remaining axioms are proved using suitable compatibility results about idto2cell.
The two functions are easily shown to be inverse to each other, thus forming an equivalence of types.

The Yoneda Embedding
In this section, we show that any locally univalent bicategory naturally embeds into a univalent one, via the Yoneda embedding. This construction is similar to the Rezk completion for categories [2,Theorem 8.5] and it makes use of the Yoneda lemma. We start by discussing representable pseudofunctors, pseudotransformations, and modifications. These are used to define the desired embedding.
(representable) Given an object a : B, we define the representable pseudofunctor Rep 0 (a) from B op (see Example 2.9) to Cat. It sends objects b to the category B 1 (b, a) and   (yoneda_counit) A natural isomorphism from G · F to the identity. We only discuss the data of the involved functors. The functor F sends pseudotransformations τ to τ (a)(id 1 (a)) and modifications m to m(a)(id 1 (a))(a). In the other direction, G sends objects z : P (a) to the pseudotransformation whose components are P (f )(z) with b : B op and f : b → a. Now let us use the bicategorical Yoneda lemma to construct for each locally univalent bicategory a weakly equivalent univalent bicategory. We follow the construction of the Rezk completion by Ahrens, Kapulkin, and Shulman [2], and take the image of the Yoneda embedding to be the univalent completion.
First, we define weak equivalences of bicategories.
Definition 5.5. Let B and C be bicategories and let F : B → C be a pseudofunctor. We say (local_equivalence) F is a local equivalence if for each x, y : B the functor from B 1 (x, y) to C 1 (F (x), F (y)) induced by F is an adjoint equivalence.
(essentially_surjective) F is essentially surjective if for each y : C there merely exists an x : B and an adjoint equivalence from F (x) to y.
(weak_equivalence) F is a weak equivalence if F is both a local equivalence and essentially surjective.
The notion of weak equivalence has already been studied in classical mathematics where, using the axiom of choice, it was shown to be equivalent to the usual notion of equivalence [23,25]. However, these notions are generally not equivalent in a constructive setting, but we conjecture that they are for univalent bicategories.
Furthermore, the notion of weak equivalence can be weakened by requiring that the pseudofunctor only induces a weak equivalence of categories on the hom-categories. Such a weaker notion would be useful if one desires to find a univalent completion of arbitrary bicategories instead of just locally univalent ones. To do so, we anticipate a two-step process: first, a local completion, which embeds bicategories in locally univalent ones, followed by, second, the construction described in this section. More concretely, for any bicategory B we expect to be able to construct pseudofunctors as in the following diagram. Weak equivalences between univalent categories are actually equivalences [2, Lemma 6.8]. We conjecture that the same is possible for bicategories.

Conjecture 5.7. Every weak equivalence between univalent bicategories is a biequivalence.
From the Yoneda lemma we know that y is a local equivalence:

Corollary 5.8 (yoneda_mor_is_equivalence). The pseudofunctor y is a local equivalence.
However, y is not essentially surjective: the bicategory Pseudo(B op , Cat) contains nonrepresentable presheaves. To make y essentially surjective we restrict the bicategory of presheaves to the full image of the Yoneda embedding.     Cat). Since the codomain of y is univalent by Theorem 3.20, the image is univalent as well by Proposition 5.10. Note that the corestriction gives rise to a pseudofunctor y : B → RC(B). It is essentially surjective by construction. Furthermore, y is a local equivalence by Corollary 5.8, and local equivalences are preserved by corestriction. Hence, y is indeed a weak equivalence.
Note that Construction 5.13 raises universe levels: the bicategory RC(B) lives in a higher universe than B itself, for the same reasons as in the 1-categorical case; see [2,Remark 8.6].

Displayed Bicategories
Now let us study how to construct more complicated univalent bicategories. To that end, we introduce displayed bicategories, the bicategorical analog to the notion of displayed category developed in [3]. A displayed (1-)category D over a given (base) category C consists of a family of objects over objects in C and a family of morphisms over morphisms in C together with suitable displayed operations of composition and identity. A category D is then constructed, the objects and morphisms of which are pairs of objects and morphisms from C and D, respectively. Properties of D, in particular univalence, can be shown from analogous, but simpler, conditions on C and D.
A prototypical example is the following displayed category over C :≡ Set: an object over a set X is a group structure on X, and a morphism over a function f : X → X from group structure G (on X) to group structure G (on X ) is a proof of the fact that f is compatible with G and G . The total category is the category of groups, and its univalence follows from univalence of Set and a univalence property of the displayed data.
Just like in 1-category theory, many examples of bicategories are obtained by endowing previously considered bicategories with additional structure. An example is the bicategory of pointed 1-types in U. The objects in this bicategory are pairs of a 1-type A and an inhabitant a : A. The morphisms are pairs of a morphism f of 1-types and a path witnessing that f preserves the selected points. Similarly, the 2-cells are pairs of a homotopy p and a proof that this p commutes with the point preservation proofs. Thus, this bicategory is obtained from 1-Type U by endowing the cells on each level with additional structure.
Of course, the structure should be added in such a way that we are guaranteed to obtain a bicategory at the end. Now let us give the formal definition of displayed bicategories. f Note that we use the same notation for the displayed and the non-displayed operations. These operations are subject to laws, which are derived systematically from the nondisplayed version. Just as for displayed 1-categories, the laws of displayed bicategories are heterogeneous, because they are transported along the analogous law in the base bicategory. For instance, the displayed left-unitary law for identity reads as id 2 (f ) •θ = eθ , where e is the corresponding identity of Item 13 in Definition 2.1.

id
The purpose of displayed bicategories is to give rise to a total bicategory together with a projection pseudofunctor. They are defined as follows: We also have a projection pseudofunctor π D : D → B.
As mentioned before, the bicategory of pointed 1-types is the total bicategory of the following displayed bicategory.  For a groupoid G, the objects over G are objects of G. For a functor F : G 1 → G 2 between groupoids G 1 and G 2 , the displayed 1-cells over F from x to y are isomorphisms F (a) ∼ = b. Given two functors F 1 , F 2 : G 1 → G 2 , a natural transformation n : F 1 ⇒ F 2 , two points x : G 1 and y : G 2 , and isomorphisms q 1 : F 1 (x) ∼ = y and q 2 : F 2 (x) = y, the displayed 2-cells over n are paths p(a) • q g = q f . The bicategory of pointed groupoids is the total bicategory of this displayed bicategory.  Now let us discuss two more examples of bicategories obtained from displayed bicategories: firstly, monads internal to an arbitrary bicategory and secondly, Kleisli triples. In Construction 8.14, we construct a biequivalence between the bicategory of Kleisli triples and the bicategory of monads internal to Cat.

Definition 6.7 (monad). Let B be a bicategory. Then we define a displayed bicategory M(B) over B such that
The displayed objects over a : B are monad structures on a. A monad structure on a consists of a 1-cell m a : a → a and 2-cells η a : id 1 (a) ⇒ m and µ a : m · m ⇒ m such that the following diagrams commute The displayed 1-cells over f : a → b from (m a , η a , µ a ) to (m b , η b , µ b ) consist of invertible 2-cells n f : m a · f ⇒ f · m b such that the following two diagrams commute The displayed 2-cells over x : f ⇒ g from n f to n g are proofs that the following diagrams The total bicategory of M(B) is the bicategory of monads internal to B.
Next, we define a bicategory of Kleisli triples (also known as extension systems [28]). In addition, two laws reminiscent of those in Definition 2.5 need to be satisfied. A displayed adjoint equivalence over the adjoint equivalence A is a pair of a displayed 1-cellf over f together with a displayed adjoint equivalence structure onf . The type of displayed adjoint equivalences fromā tob over f is denoted byā fb .
The displayed 1-cell id 1 (ā) is a displayed adjoint equivalence over id 1 (a).
Using these definitions, we define univalence of displayed bicategories similarly to univalence for ordinary bicategories. Again we separate it in a local and global condition. D be a displayed bicategory over B.  1. Let a, b : B, andā : D a ,b : D b . Let f, g : a → b, let p : f = g, and letf andḡ be displayed morphisms over f and g respectively. Then we define a function sending refl to the identity displayed isomorphism. We say that D is locally univalent if the function disp_idtoiso 2,1 p,f ,ḡ is an equivalence for each p,f , andḡ. sending refl to the identity displayed adjoint equivalence. We say that D is globally univalent if the function disp_idtoiso 2,0 p,ā,b is an equivalence for each p,ā, andb.

(disp_univalent_2) We call D univalent if it is both locally and globally univalent.
The following result states that univalence of the total bicategory can be proved from univalence of the base and of the displayed part. This is the bicategorical version of the analogous result for 1-categories shown in [3,Theorem 7.4], which in turn generalizes the Structure Identity Principle [35, Theorem 9.8.2]. Proof. The main idea behind the proof is to characterize invertible 2-cells in the total bicategory as pairs of an invertible 2-cell p in the base bicategory, and a displayed invertible 2-cell over p. Concretely, for the local univalence of D, we factor idtoiso 2,1 as a composition of the following equivalences: The function w 1 is just a characterization of paths in a sigma type. The function w 2 turns equalities into (displayed) invertible 2-cells, and it is an equivalence by local univalence of B and displayed local univalence of D. Finally, the function w 3 characterizes invertible 2-cells in the total bicategory.
The proof is similar in the case of global univalence. The most important step is the characterization of adjoint equivalences in the total bicategory. To check displayed univalence, it suffices to prove the condition in the case where p is reflexivity. This step, done by path induction, simplifies some proofs of displayed univalence.

Proposition 7.5. Given a displayed bicategory D over B, then D is univalent if the following functions are equivalences:
(fiberwise_ local_ univalent_ is_ univalent_ 2_ 1 ) For the sigma construction, we give two conditions for the univalence of the total bicategory. If we have univalent displayed bicategories D 1 and D 2 over B and D 1 respectively, then we can either show the univalence of ( D1 D 2 ) directly or we can show the displayed univalence of D1 D 2 . Note that the second property could be necessary as an intermediate step for proving the univalence of a more complicated bicategory. For the proof of displayed univalence of D1 D 2 , we need two assumptions on both displayed bicategories.  2 ). 2. If D 1 and D 2 are locally propositional and groupoidal, then D1 D 2 is displayed univalent (sigma_ disp_ univalent_ 2_ with_ props ) . We are not sure whether Item 2 of Proposition 7.9 is as strong as it can be-it might be possible to weaken the assumptions of D 1 and D 2 being locally propositional and groupoidal. However, this would make the proof significantly more complicated. In our examples these assumptions are satisfied, and thus the statement of Proposition 7.9, Item 2 is sufficient for our purposes.
Lastly, we give a condition for when a locally chaotic displayed bicategory is univalent. a : B, the type D a is a set, and for anyā : D a ,b : D b , f : a → b, the typē a f − →b is a proposition. Then D is univalent if we have a function in the opposite direction of disp_idtoiso 2,0 .

Displayed Constructions
The idea of building bicategories by layering displayed bicategories does not only allow for modular proofs of univalence, but also for the modular construction of maps between bicategories, e.g., pseudofunctors and biequivalences. In this section, we introduce the notions of displayed pseudofunctor and biequivalence, and use them to build biequivalences. The first example we look at, extends the biequivalence between 1-types and univalent groupoids in Example 2.18 to their pointed variants (Example 6.3 and Example 6.4).

Problem 8.1. To construct a biequivalence between pointed 1-types and pointed groupoids.
To construct the desired biequivalence, we first define displayed biequivalences over a given biequivalence in the base and we show that it gives rise to a total biequivalence on the total bicategories. Since biequivalences are defined using pseudofunctors, pseudotransformations, and invertible modifications, we first need to define displayed analogues of these. = ==== ⇒F 1 (f ·ḡ). In addition, several laws similar to those in Definition 2.12 need to hold. They are just dependent variants of them and they hold over the corresponding non-dependent law. Since the required laws are obtained in the same way as in Definition 6.1, we do not show them here and instead refer the interested reader to the formalization. We denote the type of displayed pseudofunctors from D 1 to D 2 over F by D 1

Definition 8.3 (disp_pstrans)
. Suppose that we have bicategories B and C, pseudofunctors F, G : B → C, and a pseudotransformation η : F ⇒ G. Suppose furthermore that we have displayed bicategories D 1 and D 2 over B and C, respectively, and displayed pseudofunctorsF andḠ from D 1 to D 2 over F and G, respectively. Then a displayed pseudotransformationη over η fromF toḠ is given by For all 1-cells f : x → y, displayed objectsx : D 1 (x) andȳ : D 1 (y) and displayed 1-cells Again laws similar to those in Definition 2.13 need to hold and again they are derived similar to those in Definition 6.1. We denote the type of displayed pseudotransformations fromF tō G over η byF η = ⇒Ḡ. ===⇒θ 0 (x) for each x : B andx : D 1 (x). In addition, the dependent version of the law in Definition 2.14 needs to hold. We denote the type of displayed modifications fromη toθ over m byη m * 4θ .
In order to formulate displayed biequivalence, we need an invertible version of Definition 8.4.

Definition 8.5 (disp_invmodification). A displayed invertible modification over
an invertible modification m : η θ is a displayed modificationm :η m * 4θ such that is invertible for each x : B andx : D 1 (x).
Each of the discussed notions also has a total version. These are constructed similarly to how the total bicategory is constructed in Definition 6.2.  To define displayed biequivalences, we need composition and identity of displayed pseudofunctors and pseudotransformations: Definition 8.8. Suppose that B 1 , B 2 , and B 3 are bicategories and that D 1 , D 2 , and D 3 are displayed bicategories over B 1 , B 2 , and B 3 , respectively. In addition, let F : B 1 → B 2 and G : B 2 → B 3 be pseudofunctors and suppose we have displayed pseudofunctorsF from D 1 to D 2 andḠ from D 2 to D 3 over F and G, respectively.
Displayed invertible modifications Note that the total variant of each example in Definition 8.9 is its non-displayed analogue. Displayed biequivalences give rise to total biequivalences between their associated total bicategories.  Note that to construct a displayed biequivalence, one must show several laws and construct multiple displayed invertible 2-cells. If the involved displayed bicategories are locally groupoidal (Definition 7.7) and locally propositional (Definition 7.8), then constructing a displayed biequivalence is simpler. This is because all the necessary laws follow immediately from local propositionality and all the involved displayed 2-cells are invertible. With all this in place, we finally show how to construct the desired biequivalence in Problem 8.1 with displayed machinery. Construction 8.12 (for Problem 8.1; disp_biequiv_data_unit_counit_path_pgroupoid). By Problem 8.10 it suffices to construct a displayed biequivalence. We only show how to construct the required displayed pseudofunctor from points on 1-types to points on groupoids.
Given a 1-type X and a point x : X, we need to give an object of PathGrpd(X), for which we take x.
If we have 1-types X and Y with points x : X and y : Y , and a function f : X → Y with a path p f : f (x) = y, then we need to construct an isomorphism between f (x) and y in PathGrpd(X). It is given by p f . Suppose we have 1-types X and Y with points x : X and y : Y . Furthermore, suppose we have a homotopy s : f ∼ g between functions f, g : X → Y , paths p f : f (x) = y and p g : g(x) = y, and a path h : p f = s(x) • p g . Then the required displayed 2-cell is the inverse of h. The compositor and the identitor are both the reflexivity path.
As a final example, we construct a biequivalence between the bicategory of monads internal to Cat and the bicategory of Kleisli triples.

Problem 8.13. To construct a biequivalence between monads and Kleisli triples.
Construction 8.14 (for Problem 8.13; Monad_biequiv_Ktriple). Note that the bicategory of monads and Kleisli triples are defined as the total bicategories of Definition 6.7 and Definition 6.8, respectively. Hence, by Problem 8.10, it is sufficient to construct a displayed biequivalence between the respective displayed bicategories. For the details on this construction, we refer the reader to the formalization.

9
Univalence of Complicated Bicategories In this section, we demonstrate the power of displayed bicategories on a number of complicated examples. We show the univalence of the bicategory of pseudofunctors between univalent bicategories and of univalent categories with families. In addition, we give two constructions to define univalent bicategories of algebras.

Pseudofunctors
As promised, we use displayed bicategories to prove Theorem 3.20. For the remainder, fix bicategories B and C such that C is univalent. Recall that a pseudofunctor consists of an action on 0-cells, 1-cells, 2-cells, a family of 2-cells witnessing the preservation of composition and identity 1-cells, such that a number of laws are satisfied.
To construct the bicategory Pseudo(B, C) of pseudofunctors, we start with a base bicategory whose objects are functions from B 0 to C 0 . Then we add structure to the base bicategory in several layers. Each layer is given as a displayed bicategory over the total bicategory of the preceding one. The first layer consists of actions of the pseudofunctors on 1-cells. On its total bicategory, we define three displayed bicategories: one for the compositor, one for the identitor, and one for the action on 2-cells. We take the total bicategory of the product of these three displayed bicategories. Finally, we take the full subbicategory of that total bicategory on those objects that satisfy the axioms of a pseudofunctor. To show its univalence, we show the base and each layer are univalent. Now let us look at the formal definitions.

Definition 9.3 (identitor_disp_cat).
We define a displayed bicategory MapId(B, C) over Map1(B, C) as follows: The displayed objects over (F 0 , F 1 ) are identitors The displayed morphisms over (η 0 , η 1 ) from F i to G i are equalities

Definition 9.4 (compositor_disp_cat).
We define a displayed bicategory MapC(B, C) over Map1(B, C) as follows: The displayed objects over (F 0 , F 1 ) are compositors The displayed morphisms over (η 0 , η 1 ) from F c to G c consists of equalities for all X, Y, Z : B 0 , f : B 1 (X, Y ) and g : B 1 (Y, Z).
Definition 9.5 (map2cells_disp_cat). We define a displayed bicategory Map2D(B, C) over Map1(B, C) as follows: The displayed objects over (F 0 , F 1 ) are The displayed morphisms over (η 0 , η 1 ) from F 2 to G 2 consist of equalities We denote the total category of the product of Map2D(B, C), MapId(B, C), and MapC(B, C) by RawPseudo(B, C). Note that its objects are of the form ((F 0 , F 1 ), (F 2 , F i , F c )), its 1-cells are pseudotransformations, and its 2-cells are modifications. However, its objects are not yet pseudofunctors, because those also need to satisfy the laws in Definition 2.12. Definition 9.6 (psfunctor_bicat). We define the bicategory Pseudo(B, C) as the full subbicategory of RawPseudo(B, C) where the objects satisfy the following laws F 2 (id 2 (f )) = id 2 (F 1 (f )) and Note that the objects, 1-cells, and 2-cells of the resulting bicategory correspond to pseudofunctors (Definition 2.12), pseudotransformations (Definition 2.13), and modifications (Definition 2.14) respectively. Each displayed layer in this construction is univalent. In addition, if C is univalent, then so is Base(B, C). All in all, the results of this subsection can be summarized as follows.
Definition 9.7. Given bicategories B and C, we define a bicategory Pseudo(B, C) whose objects are pseudofunctors, 1-cells are pseudotransformations, and 2-cells are modifications.
Theorem 9.8. If C is univalent, then so is Pseudo(B, C).

Algebraic Examples
Next, we show how to use displayed bicategories to construct univalent bicategories of algebras for some signature. We consider signatures that specify operations, equations, and coherencies on those equations. More specifically, a signature consists of a pseudofunctor F (specifying the operations), a finite set of pairs of pseudotransformations l i and r i (specifying the equations), and a proposition P (specifying the coherencies) which can refer to F and the l i and r i . An algebra on such a signature consists of an object X, a 1-cell h : F (X) → X, 2-cells l i (X) ⇒ r i (X), such that the predicate P is satisfied by all this data.
To define the bicategory of algebras on a signature, we define three displayed bicategories which add the operations, equations, and coherencies. Since the equations can make use of the operations and the coherencies can refer to the equations, the displayed bicategories must be layered suitably. More specifically, starting with a bicategory B and a pseudofunctor F : B → B, we first define a displayed bicategory whose displayed objects are algebras on F . On top of its total bicategory, we give a displayed bicategory which adds 2-cells (modeling equations) to the structure. This gives rise to another total bicategory. Finally, we consider the full subbicategory of the latter total bicategory consisting of all objects satisfying the desired coherencies. The objects of the resulting total bicategory are models for the signature we started with.
To illustrate our approach, we show how to define the bicategory of monads internal to a bicategory, as discussed in Definition 6.7. A monad internal to a bicategory B consists of, among others, a 0-cell X : B and 1-cell X → X as an "operation". Such structure is encapsulated by algebras for a pseudofunctor and pseudomorphisms between those algebras. Definition 9.9 (disp_alg_bicat). Let B be a bicategory and let F : B → B be a pseudofunctor. We define a displayed bicategory Alg D (F ).
The objects over a : B are 1-cells F 0 (a) → a. The 1-cells over f : Given f, g : B 1 (a, b), algebras h a : F 0 (a) → a and h b : F 0 (b) → b, and h f and h g over f and g respectively, a 2-cell over θ : f ⇒ g is a commuting square We write Alg(F ) for the total category of Alg D (F ).  Returning to the example of monads, define M 1 to be Alg(id(B)). Objects of M 1 consist of an X : B 0 and a 1-cell X → X. To refine this further, we need to add 2-cells corresponding to the unit and the multiplication. We do this by defining two displayed bicategories over M 1 .
In general, the construction for building algebras with 2-cells (which model "equations") looks as follows. Suppose that we have a displayed bicategory D over some B. Our goal is to define a displayed bicategory over D where the displayed 0-cells are certain 2-cells in B. The endpoints for these 2-cells are choices of 1-cells that are natural in objects, thus they are given by pseudotransformations l, r. The source of the endpoints is π D · S for some S : B → B, and the target is π D · id(B) where π D is the projection from D to B. The source pseudofunctor S : B → B determines the shape of the free variables that occur in the endpoints. Note that the target of the endpoint is π D · id(B), instead of π D , which is symmetric to the source π D · S. This allows us to construct such transformations by composing them.
Thus, pseudotransformations l, r : π D · S → π D · id(B) give 1-cells l(a, h a ), r(a, h a ) : B 1 (S(a), a) for each (a, h a ) : D. By allowing l and r to depend not only on the 0-cell a : B, but also on the displayed cell h a : D(a), the endpoints can refer to the operations that were added as part of algebras in Definition 9.9. Formally, the construction that adds 2-cells from l(a) to r(a) is defined as the following displayed bicategory. Definition 9.12 (add_cell_disp_cat). Suppose that D is a displayed bicategory over B. Let S : B → B be a pseudofunctor and let l, r : π D · S → π D · id(B) be pseudotransformations. We define a displayed bicategory Add2Cell(D, l, r) over D as a locally chaotic displayed bicategory (c.f. Item 4 in Definition 6.6).
The objects over (a, h a ) are 2-cells l(a, h a ) ⇒ r(a, h a ).
Returning to the example of monads, let us use Definition 9.12 to add the unit and the multiplication 2-cells to the structure of M 1 . We can add the unit and the multiplication separately, as two displayed bicategories. For the unit, we pick the source pseudofunctor S(a) = a and the endpoints are defined as l(a, f : a → a) = id 0 (a) and r(a, f : a → a) = f . For the multiplication, we use the same source pseudofunctor and the same right endpoint, but we pick the left endpoint to be l(a, f : a → a) = f · f .
Let M 2 be the product of these two displayed bicategories, displayed over M 1 . We use the sigma construction (c.f. Item 2 in Definition 6.6) to obtain a displayed bicategory M 2 over B. It is almost the bicategory of monads internal to B. To finalize the construction, we need to require the structures in M 2 to satisfy the monadic laws: for each object (f, η, µ) in M 2 the diagrams from Definition 6.7 need to commute. We construct the final bicategory M(B) (as in Definition 6.7) as the full subbicategory of M 2 with respect to these laws. Again to guarantee that M(B) is displayed over B, we use the sigma construction. From Proposition 7.9, Theorems 9.10 and 9.13, and Example 7.6 we conclude: Theorem 9.14 (bigmonad_is_univalent_2). If B is univalent, then so is M(B).

Categories with Families
Finally, we discuss the last example: the bicategory of (univalent) categories with families (CwFs) [15]. We follow the formulation by Fiore (described as "dependent context structures" in [17]) and Awodey [8,Section 1], which is already formalized in UniMath [4]: a CwF consists of a category C, two presheaves Ty and Tm on C, a morphism p : Tm → Ty, and a representation structure for p.
However, rather than defining CwFs in one step, we use a stratified construction yielding the sought bicategory as the total bicategory of iterated displayed layers. The base bicategory is Cat (cf. Example 2.8). The second layer of data consists of two presheaves, each described by the following construction. Denote by CwF 1 the total category of the product of PShD with itself. An object in CwF 1 consists of a category C and two presheaves Ty, Tm : C op → Set.
The next piece of data in a CwF is a natural transformation from Tm to Ty: Definition 9.16 (morphisms_of_presheaves_display). We define a displayed bicategory dCwF 2 on CwF 1 as the locally chaotic displayed bicategory (Item 4 in Definition 6.6) such that The objects over (C, (Ty, Tm)) are natural transformations from Tm to Ty. Suppose we have two objects (C, (Ty, Tm)) and (C , (Ty , Tm )), two natural transformations p : Tm ⇒ Ty and p : Tm ⇒ Ty , and suppose we have a 1-cell f from (C, (Ty, Tm)) to (C , (Ty , Tm )). Note that f consists of a functor F : C → C and two transformations β : Ty ⇒ F op • Ty and β : Tm ⇒ F op • Tm . Then a 1-cell over f is an equality With dCwF 2 and the sigma construction from Item 2 in Definition 6.6, we get a displayed bicategory over Cat and we denote its total bicategory by CwF 2 . As the last piece of data, we add the representation structure for the morphism p of presheaves.
Definition 9.17 (cwf_representation). Given a category C together with functors Ty, Tm : C op → Set and a natural transformation p : Tm ⇒ Ty, we say isCwF(C, Ty, Tm, p) if for each Γ : C and A : Ty(Γ), we have a representation of the fiber of p over A.
A detailed definition can be found in [4,Definition 3.1]. Since C is univalent, the type isCwF(C, Ty, Tm, p) is a proposition, and thus we define CwF as a full subbicategory of CwF 2 .

Displayed (2-)Inserters
In this section, we study two general constructions which have been suggested by an anonymous referee. Both the constructions and their name were suggested by the referee. We already saw instances of them, namely in Sections 9.2 and 9.3. The first one, called the displayed inserter, constructs a displayed bicategory whose total bicategory represents the inserter of two pseudofunctors. A similar construction, namely inserters of 1-cells in bicategories, has already been studied in the literature. Lambek defined subequalizers of functors [24], and these are inserters in the bicategory of categories. These inserters are also known as dialgebras, and they have been used to study the semantics of inductive-inductive types [7]. Power and Robison defined PIE-limits (products, inserters, equaifiers) in 2-categories and showed that they can be used to construct a general class of limits [32]. In addition, it has been shown that bicategories of algebras are closed under inserters [10,36]. Note that the terminology "displayed inserter" has also been used for the inserter of displayed functors [11], which is different from what we look at.
The remaining properties are readily shown; we refer to the formalization for details.
Example 10.2. Definitions 9.9 and 9.15 are-almost-instances of Definition 10.1. Specifically, Definition 9.9 is obtained as the displayed inserter with F the identity pseudofunctor and with G the pseudofunctor F of Definition 9.9. However, this does not yet give the correct displayed 1-cells; we furthermore need to take the full sub-bicategory of invertible displayed 1-cells (cf. disp_sub1cell_bicat). Definition 9.15 is obtained by taking F to be the identity on Cat and G to be the functor that is constantly Set op .
Note that this is slightly different than in Definition 9.15, corresponding to the two ways to represent a contravariant functor H : A → B in terms of a covariant one-as a functor H : A op → B or a functor H : A → B op . While Definition 9.15 uses the former, this is not possible here: domain and codomain of the inserter are specified by pseudofunctors, but the function (_) op : Cat 0 → Cat 0 on categories does not extend to a pseudofunctor Cat → Cat that could take the place of the pseudofunctor F above. Instead, here we have to represent contravariant functors by taking the opposite of the target category, and thus consider the constant pseudofunctor returning the category Set op . Next we look at displayed 2-inserters. These are quite similar to displayed inserter, but with one main difference: instead 1-cells, 2-cells are added to the structure. More precisely, given two pseudotransformations α and β, the displayed 2-inserter gives a displayed bicategory of maps from α(x) to β(x) for every x.
Example 10.5. The displayed bicategory of Definition 9.12 is immediately a displayed 2-inserter.
The displayed bicategory of Definition 9.16 can be obtained as the following displayed 2-inserter: consider the functors F, G : CwF 1 → Cat given by F (C, Ty, Tm) :≡ C and G(_) :≡ Set op . As pseudotransformations, we take the projections α :≡ Tm and β :≡ Ty, respectively. As in Example 10.2, we have to put the oppositization into the target pseudofunctor G, that is, take presheaves on C to be functors C → Set op instead of C op → Set.

Conclusions and Open Questions
In the present work, we studied univalent bicategories. Showing that a bicategory is univalent can be challenging; to simplify this task, we introduced displayed bicategories, which provide a way to modularly reason about involved bicategorical constructions. We then demonstrated the usefulness of displayed bicategories by using them to show that certain complicated bicategories are univalent. The same approach is useful for many other basic notions and constructions such as pseudofunctors, pseudotransformations, modifications, and biequivalences: the displayed machinery allows one to stratify their presentation and thus eases reasoning on such objects. Veltri and Van der Weide [36] used the techniques described in the present paper to construct univalent bicategories of algebras for a class of signatures. In addition, they defined displayed biadjunctions, and those were used to construct biadjunctions between bicategories of algebras.
For the practical mechanization of mathematics in a computer proof assistant, two issues may arise when building an elaborate bicategory as the total bicategory of iterated displayed bicategories. Firstly, the structures may not be parenthesized as desired. This problem can be avoided or at least alleviated through a suitable use of the sigma construction of displayed bicategories (Item 2 in Definition 6.6). Secondly, "meaningless" terms of unit type may occur in the cells of this bicategory. We are not aware of a way of avoiding these occurrences while still using displayed bicategories. However, both issues can be addressed through the definition of a suitable "interface" to the structures, in form of "builder" and projection functions, which build, or project a component out of, an instance of the structure. The interface hides the implementation details of the structure, and thus provides a welcome separation of concerns between mathematical and foundational aspects.
We have only started, in the present work, the development of bicategory theory in univalent foundations and its formalization. There are some important questions that we have left open, such as proving the universal property of the Rezk completion. Furthermore, the precise relationship to the bicategories studied in [6, Example 9.1] should be established; those bicategories are defined, in particular, using relations instead of functions. It seems reasonable to hope for our univalent bicategories to coincide (in the sense of an equivalence of types) with the univalent bicategories of [6, Example 9.1]; a construction of such an equivalence is outside the scope of this work. We also anticipate that the displayed machinery can be usefully employed for extending the comparison of different categorical structures for type theories started by Ahrens, Lumsdaine, and Voevodsky [4] to the bicategorical setting.