started work on defining a CwF

master
Rachel Lambda Samuelsson 2022-10-06 20:39:10 +02:00
parent f1644f56c7
commit 710bdc21c2
2 changed files with 54 additions and 6 deletions

View File

@ -1,11 +1,57 @@
# Category with family
---
references:
- type: article-journal
id: abd2008
editor:
- family: Jacques Carrigue
- family: Manuel V. Hermengildo
author:
- family: Andreas Abel
- family: Thierry Coquand
- family: Peter Dybjer
issued:
date-parts:
- - 2008
title: 'On the Algebraic Foundation of Proof Assistants for Intuitionistic Type Theory'
journal: "Lecture Notes in Computer Science"
volume: 4989
url: http://link.springer.com/10.1007/978-3-540-78969-7_2
page: 3-13
language: en-GB
citation-style: ieee
---
```
module CwF where
open import Cat.Prelude
open import Fams
module CwF where
```
<!---
TODO: write more about what a CwF actually is and how one should think abut it.
--->
# Categories with families
This file defines a CwF, as well as type formers for pi types, sigma types, identity types and universes. Here CwFs are defined as a GAT (generalised algebraic theory), as is presented in a paper by Abel, Coquand and Dybjer. [@abd2008]
A CwF is a category $\mathcal C$ equipped with a functor $\mathcal F : \mathcal C \to \mathcal Fam$, fufilling the rules of the GAT.
```
open import Fams
record CwF (o h f : Level) : Type (lsuc (o ⊔ h ⊔ f)) where
field
𝓒 : Precategory o h
𝓕 : Functor 𝓒 (Fams f)
```
Two functions, $Ty$ and $Tm$ are defined, respectively giving the set of syntactic types, and terms in a context.
```
open Precategory
open Functor
Ty : 𝓒 .Ob → Set f
Ty Γ = 𝓕 .F₀ Γ .fst
Tr : (Γ : 𝓒 .Ob) → Ty Γ → Set f
Tr Γ σ = 𝓕 .F₀ Γ .snd σ
```

View File

@ -3,7 +3,9 @@ open import Cat.Prelude
module Fams where
```
# The category of families (of sets)
# The category of families of sets
This file defines the category $\mathcal Fam$ of families of sets.
Given a universe level there is a category $\mathcal Fam$ of the families of sets of that level.
```
@ -37,7 +39,7 @@ Composition follows from regular function composition for $(f \circ g)^0$, and f
(Fams o ∘ (f⁰ , f¹)) (g⁰ , g¹) .snd b x = f¹ (g⁰ b) (g¹ b x)
```
This computes nicely.
Since composition is defined using regular function composition it computes nicely.
```
Fams o .idr f = refl
Fams o .idl f = refl