diff --git a/src/CwF.lagda.md b/src/CwF.lagda.md index da18714..b089992 100644 --- a/src/CwF.lagda.md +++ b/src/CwF.lagda.md @@ -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 ``` + +# 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 ฯƒ + ``` \ No newline at end of file diff --git a/src/Fams.lagda.md b/src/Fams.lagda.md index 24dd591..a72eccc 100644 --- a/src/Fams.lagda.md +++ b/src/Fams.lagda.md @@ -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