<<

CONNECTIVES IN OF

JONATHAN STERLING

Abstract. Some expository notes on the semantics of inductive types in Awodey’s nat- ural models [Awo18]. Many of the ideas explained are drawn from the work of Awodey [Awo18], Streicher [Str14], Gratzer, Kavvos, Nuyts, and Birkedal [Gra+20], and Sterling, Angiuli, and Gratzer [SAG20].

When is a model of type theory (i.e. a natural model) closed under a particular connec- tive? And what is a general notion of connective? Le‹ing C be a small category with a terminal object and E = Pr(C) be its logos1 of presheaves, a natural model is a representable natural transformation TÛ τ T : E [Awo18]. j Connectives that commute with the Yoneda embedding C E (such as dependent product and sum) may be speci€ed in a particularly simple way. → F → (1) First, one de€nes an endofunctor Ecart Ecart taking a family (viewed as a uni- verse) to the generic family for that connective. ‘e intuition for this family is that the upstairs part carries the data of its introduction rule, and the downstairs part carries the data of its formation rule. For instance, one may take F to be the endofunctor that takes a f to the functorial action of the polynomial endofunctor Pf on f itself. In this case, one has the notion of a dependent product type. (2) ‘en, one requires a cartesian mapF(τ) τ, i.e. a pullback square of the following kind: Û ∂0(F(τ)) T

F(τ) τ

∂1(F(τ)) T In the case of our example, the downstairs map becomes a code for the depen- dent product type, and the upstairs map becomes a constructor for λ-abstraction. ‘e universal property of the pullback implements the elimination form (applica- tion) together with its computation and uniqueness rules.

1. Inductive types in the semantics of type theory ‘e account above, which works for essentially all connectives that can be understood by means of mapping-in universal properties, does not extend to either strict or weak inductive types; it is most common in the literature to account for these by means of in- ternal orthogonality conditions and stable li‰ing structures respectively [Awo18; Gra+20; SAG20].

1I am following the convention of Anel and Joyal [AJ19] in referring to the formal algebraic dual of a topos as a logos, by analogy with frames and locales. 1 2 JONATHAN STERLING

1.1. Example: the empty coproduct. Let us €rst gain some intuitions for why the na¨ıve approach would fail to express the closure of TÛ τ T under strict coproducts; it will suce to consider the empty coproduct. We begin by de€ning an endofunctor F∅ on the → f cartesian arrow category Ecart. We will have F∅ take a map A B to the universal map g α F∅(f ) = ∅E 1E; €xing C D and a cartesian square f g, we take F∅(α) to the following cartesian square:

∅E ∅E

1E 1E Na¨ıvely, we might assume that the right thing to do next is ask for a cartesian map α τ F∅(τ) τ. But we can see that such a thing cannot exist; because TÛ T is a repre- sentable map, the top-le‰ corner of the following diagram must be representable: ∂ (α) 0 Û ∅E T

τ

j(1C)  1E T ∂1(α) But the initial object of E = Pr(C) cannot be representable: E is the free cocomple- tion. Generally speaking, for this approach to work, we would need the endofunctor F to preserve representable maps, which F∅ clearly does not. We will show, however, an appropriate way to express the closure of TÛ τ T under a strict empty type using orthog- onality. α (1) First, we demand a code 1E T (the formation rule). (2) ‘en, we consider the following canonical (but not cartesian) square: Û ∅E T

τ

1 T E α ‘e cartesian gap map of this square is the homomorphism of spans induced by the actual pullback of τ along α [Ane+17]:

∅E

Û Û T ×T 1E T

α ∗τ τ

1 T E α CONNECTIVES IN SEMANTICS OF TYPE THEORY 3

(3) ‘en, we require that the cartesian gap map ∅E τ[α] shall be internally le‡ orthogonal to TÛ τ T in E. ‘is means, for each Z : E, a unique €ller to any square of the following shape:

Û Z × ∅E T

Z × ! ∃! τ

Û Z × T ×T 1E T

Û A We have required a unique of each type Z × T ×T 1E T; blowing up Z into a colimit of representables j(Zi ), we obtain exactly the intended notion: a unique element of any type in each inconsistent context.

→ F → 1.2. Strict connectives via orthogonality. We €x an endofunctor Ecart Ecart; we will now describe what it takes for TÛ τ T to be closed under the corresponding strict connective. For notational expediency, we will use the language of the €bration E→ ∂1 E rather than taking pullbacks in E. (1) First, we demand a commuting square F(τ) α τ : E→, not necessarily cartesian. Here, ∂1(α) is the “formation rule” and ∂0(α) is the “introduction rule”. What remains is to express the elimination rule (and its computation and uniqueness principles). (2) We form the cartesian gap map for the diagram above:

F(τ) α

α¯

∗ † → ∂1(α) τ ∂1(α) τ τ E

∂1(F(τ)) T E ∂1(α)

(3) For the elimination rule, we require that the gap map α¯ be internally le‰ orthogonal ∗ ∂1(F(τ)) τ in the slice category C/∂1(F(τ)). (4) A large elimination may additionally be accomodated by requiring the gap map ∗ α¯ be internally le‰ orthogonal to ∂1(F(τ)) (T 1E) in C/∂1(F(τ)).

→ F → Û τ De€nition 1.1. Let Ecart Ecart be a functor, and T T a natural model over C, writing E for Pr(C).A strict F-structure for TÛ τ T is a commuting square F(τ) α τ : → α¯ ∗ E such that the cartesian gap map F(τ) ∂1(α) τ is is internally le‰ orthogonal to ∗ ∂1(F(τ)) τ in C/∂1(F(τ)). k

→ F⊕ → Example 1.2 (Strict coproducts). We de€ne an endofunctor Ecart Ecart capturing the f generic binary coproduct situation for a given family. Given A B, we let ∂1(F⊕(f )) = ∗ ∗ B × B, to de€ne the rest of the family F⊕(f ) to be the coproduct π2 f + π1 f in E/B×B . 4 JONATHAN STERLING

g Next, we €x C D and a cartesian square f α g; we must exhibit a cartesian square F⊕(α) F⊕(f ) F⊕(g):

∂0(F⊕(f )) ∂0(F⊕(g))

∗ ∗ ∗ ∗ π2 f + π1 f π2g + π1g

B × B C × C

h Let B × B D × D be the obvious map ∂1(α) × ∂1(α); rephrasing into the language of the codomain €bration, we may investigate the cartesian li‰ of this map:

∗ ∗ ∗ ∗ ∗ h (π2g + π1g) π2g + π1g

B × B D × D h By the universality of colimits, we may commute the pullback h∗ into the coproduct:

∗ ∗ ∗ ∗ ∗ ∗ h π2g + h π1g π2g + π1g

B × B D × D h ∗ ∗ ∗ It remains to show that h πi g  πi f . Because πi ◦ h = ∂1(α) ◦ πi , we may factor the ∗ ∗ cartesian map h πi g g into the following composite of cartesian maps:

∗ ∗ ∗ πi f  h πi g f g

B × B B D

D × D

→ F⊕ → Û τ We have now de€ned the endofunctor Ecart Ecart; given a natural model T T, a strict F⊕-structure F⊕(τ) τ equips τ with a coproduct connective, suitable introduction rules, and an elimination rule equipped with computation and uniqueness principles. k 1.3. Comparing strict F-structures and cartesian squares.

→ F → α Lemma 1.3. Let Ecart Ecart be a functor, and let F(τ) τ be a cartesian map: then α is also a strict F-structure for TÛ τ T.

Proof. Fixing Z : E/∂1(F(τ)), we must check that squares of the following kind have unique li‰s: a ∗ Û Z × F(τ) ∂1(F(τ)) T

∗ Z × α¯ ∃! ∂1(F(τ)) τ

∗ ∗ Z × ∂1(α) τ ∂1(F(τ)) T A CONNECTIVES IN SEMANTICS OF TYPE THEORY 5

Because α is cartesian, the vertical gap map α¯ is an isomorphism. ‘erefore, Z × α¯ is also an isomorphism:

a ∗ Û Z × F(τ) ∂1(F(τ)) T

× β (F( ))∗ β Z α¯ a ◦ ∂1 τ τ

∗ ∗ Z × ∂1(α) τ ∂1(F(τ)) T  A

Lemma 1.4 (Caution). It is not necessarily the case that, supposing F(τ) is a representable map and α is a strict F-structure for τ, then α is cartesian.

Proof. Suppose this were the case.

(1) Let C be a small category, and let TÛ τ T : E be a representable natural transfor- mation, writing E for Pr(C). → (2) Let F∅ be the constant endofunctor on Ecart from our earlier example, sending any family to ∅E 1E. α τ (3) Suppose that F∅(τ) τ is a strict F-structure for TÛ T. → (4) De€ne Fj(∅) to be the constant endofunctor on Pr(E)cart sending any family to j(∅E) j(1E). (5) j(τ) is obviously a representable map in Pr(E) and so is Fj(∅)(j(τ)). α j(α) Û τ (6) ‘eF∅-structureF∅(τ) τ li‰s to aFj(∅)-structureFj(∅)(j(τ)) j(τ) for T T, using the fact that the Yoneda embedding is dense and fully faithful. (7) ‘en, under our assumption, j(α) must be cartesian. (8) But the Yoneda embedding reƒects limits, so this would imply that α is cartesian in E, which we have already argued cannot be. 

‘ere are, however, plenty of cases where strict F-structures are necessarily cartesian. For instance, the F that takes τ to the “generic binary product” family for τ will have this property.

→ F× → f Construction 1.5. Let Ecart Ecart be the endofunctor taking each A B to the generic 2 2 f 2 binary product family F×(f ) = A B .

α → Lemma 1.6. Let F×(τ) τ : E be a strict F×-structure; then α is cartesian.

2 ⊗ Proof. We will write T T for ∂1(α). It suces to show that the cartesian gap map α¯ ∗ F×(τ) ⊗ τ : E/T2 is an isomorphism. We will explicitly compute an inverse to α¯ using the strict F×-structure. 2 ∗ We will write A, B for the two generic elements of (T ) T in E/T2 ; we will also suppress the weakening re-indexings, writing TÛ for (T2)∗TÛ . In this type theoretic style, it is appro- ∗ priate to write τ[A] × τ[B] for F×(TÛ ), and τ[A ⊗ B] for ⊗ τ. ‘e orthogonality condition for α ensures, by transpose along the adjunction • × 2 a 2, • , a unique li‰ for the following n o 6 JONATHAN STERLING square in E/T2 :

q × q τ[A] × τ[B] TÛ × TÛ

α¯ j τ × τ

τ[A ⊗ B] h T × T

Bi ! 1 hA,

 ‘e map j induces a unique map τ[A ⊗ B] ˜ τ[A] × τ[B]

τ[A ⊗ B] j

˜

τ[A] × τ[B] TÛ × TÛ ! τ × τ

1 T × T hA, Bi

We must check that ˜is a full inverse to α¯; the following triangle commutes immediately using the universal property of the product, proving that ˜ is a retraction of α¯:

α¯ τ[A] × τ[B] τ[A ⊗ B]

id ˜

τ[A] × τ[B]

‘at ˜ is a section of α¯ will follow from the uniqueness of li‰s; we are trying to check that the following triangle commutes:

˜ τ[A ⊗ B] τ[A] × τ[B]

id α¯

τ[A ⊗ B] 7

q Û Because τ[A ⊗ B] T is a monomorphism in E/T2 , it suces to check that the follow- ing triangle commutes: ˜ τ[A ⊗ B] τ[A] × τ[B]

q α¯;q

TÛ By the uniqueness of li‰s, it suces to check that all the triangles below commute: α¯;q α¯;q τ[A] × τ[B] TÛ τ[A] × τ[B] TÛ

¯;q α¯ q τ α¯ ˜; α τ

τ[A ⊗ B] T τ[A ⊗ B] T !; A ⊗ B !; A ⊗ B ‘e €rst diagram commutes trivially, and the second commutes because ˜ is a retraction of α¯. 

References [AJ19] Mathieu Anel and Andre´ Joyal. Topo-logie. Preprint. Mar. 2019. url: http: //mathieu.anel.free.fr/mat/doc/Anel-Joyal-Topo-logie.pdf (cit. on p. 1). [Ane+17] Mathieu Anel, Georg Biedermann, Eric Finster, and Andre´ Joyal. A Generalized Blakers-Massey Œeorem. 2017. arXiv: 1703.09050 (cit. on p. 2). [Awo18] Steve Awodey. “Natural models of homotopy type theory”. In: Mathematical Structures in Computer Science 28.2 (2018), pp. 241–286. doi: 10.1017/S0960 129516000268 (cit. on p. 1). [Gra+20] Daniel Gratzer, G.A. Kavvos, Andreas Nuyts, and Lars Birkedal. “Multimodal Dependent Type ‘eory”. Unpublished dra‰. 2020 (cit. on p. 1). [SAG20] Jonathan Sterling, Carlo Angiuli, and Daniel Gratzer. “A cubical language for Bishop sets”. In preparation. 2020 (cit. on p. 1). [Str14] ‘omas Streicher. Semantics of Type Œeory Formulated in Terms of Repre- sentability. Feb. 2014. url: https://www2.mathematik.tu-darmstadt.de/ ∼streicher/FIBR/natmod.pdf (cit. on p. 1).