Skip to content

Commit

Permalink
succinct definition of a simple category with families
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsnew authored and stschaef committed Jul 5, 2023
1 parent 7ffb926 commit 821d2db
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Cubical/Categories/Instances/Sets/More.agda
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ module Cubical.Categories.Instances.Sets.More where

open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Structure
open import Cubical.Data.Sigma

open import Cubical.Categories.Category
open import Cubical.Categories.Functor
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Constructions.BinProduct

private
variable
Expand All @@ -20,3 +24,8 @@ LiftF .F-hom f x = lift (f (x .lower))
LiftF .F-id = refl
LiftF .F-seq f g = funExt λ x refl

×Sets : Functor (SET ℓ ×C SET ℓ) (SET ℓ)
×Sets .F-ob (A , B) = ⟨ A ⟩ × ⟨ B ⟩ , isSet× (A .snd) (B .snd)
×Sets .F-hom (f , g) (x , y) = (f x) , (g y)
×Sets .F-id = refl
×Sets .F-seq f g = refl
28 changes: 28 additions & 0 deletions NaturalModels/SimpleCwF.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module NaturalModels.SimpleCwF where

open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category
open import Cubical.Categories.Functor
open import Cubical.Data.Sigma
open import Cubical.Categories.Constructions.BinProduct
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Instances.Sets.More
open import Cubical.Categories.Limits.Terminal
open import Cubical.Categories.Presheaf
open import Cubical.Categories.Presheaf.Representable

open Category
SCwF : (ℓ ℓ' ℓ'' ℓ''' : Level)
Type (ℓ-max (ℓ-max (ℓ-max (ℓ-suc ℓ) (ℓ-suc ℓ')) (ℓ-suc ℓ'')) (ℓ-suc ℓ'''))
SCwF ℓ ℓ' ℓ'' ℓ''' =
-- The category of contexts and substitutions
Σ[ C ∈ Category ℓ ℓ' ]
-- With a terminal object (empty context)
Terminal C ×
-- A type of syntactic types
(Σ[ Ty ∈ Type ℓ'' ]
-- A presheaf of terms for each type
Σ[ Tm ∈ ( (A : Ty) Presheaf C ℓ''') ]
-- Such that the base category has products with terms (context extension)
(: C .ob) (A : Ty)
UnivElt C (×Sets ∘F (LiftF {ℓ' = ℓ'''} ∘F ((C [-, Γ ])) ,F LiftF {ℓ' = ℓ'} ∘F Tm A))))

0 comments on commit 821d2db

Please sign in to comment.