2018-02-02 13:47:33 +00:00
|
|
|
|
module Cat.CwF where
|
|
|
|
|
|
|
|
|
|
open import Agda.Primitive
|
|
|
|
|
open import Data.Product
|
|
|
|
|
|
|
|
|
|
open import Cat.Category
|
|
|
|
|
open import Cat.Functor
|
|
|
|
|
open import Cat.Categories.Fam
|
|
|
|
|
|
|
|
|
|
open Category
|
|
|
|
|
open Functor
|
|
|
|
|
|
|
|
|
|
module _ {ℓa ℓb : Level} where
|
|
|
|
|
record CwF : Set (lsuc (ℓa ⊔ ℓb)) where
|
|
|
|
|
-- "A category with families consists of"
|
|
|
|
|
field
|
|
|
|
|
-- "A base category"
|
|
|
|
|
ℂ : Category ℓa ℓb
|
|
|
|
|
-- It's objects are called contexts
|
2018-02-05 11:21:39 +00:00
|
|
|
|
Contexts = Object ℂ
|
2018-02-02 13:47:33 +00:00
|
|
|
|
-- It's arrows are called substitutions
|
2018-02-05 11:21:39 +00:00
|
|
|
|
Substitutions = Arrow ℂ
|
2018-02-02 13:47:33 +00:00
|
|
|
|
field
|
|
|
|
|
-- A functor T
|
|
|
|
|
T : Functor (Opposite ℂ) (Fam ℓa ℓb)
|
|
|
|
|
-- Empty context
|
|
|
|
|
[] : Terminal ℂ
|
2018-02-05 11:21:39 +00:00
|
|
|
|
Type : (Γ : Object ℂ) → Set ℓa
|
2018-02-02 13:47:33 +00:00
|
|
|
|
Type Γ = proj₁ (T .func* Γ)
|
|
|
|
|
|
2018-02-05 11:21:39 +00:00
|
|
|
|
module _ {Γ : Object ℂ} {A : Type Γ} where
|
2018-02-02 13:47:33 +00:00
|
|
|
|
|
2018-02-05 11:21:39 +00:00
|
|
|
|
module _ {A B : Object ℂ} {γ : ℂ [ A , B ]} where
|
2018-02-02 13:47:33 +00:00
|
|
|
|
k : Σ (proj₁ (func* T B) → proj₁ (func* T A))
|
|
|
|
|
(λ f →
|
|
|
|
|
{x : proj₁ (func* T B)} →
|
|
|
|
|
proj₂ (func* T B) x → proj₂ (func* T A) (f x))
|
|
|
|
|
k = T .func→ γ
|
|
|
|
|
k₁ : proj₁ (func* T B) → proj₁ (func* T A)
|
|
|
|
|
k₁ = proj₁ k
|
|
|
|
|
k₂ : ({x : proj₁ (func* T B)} →
|
|
|
|
|
proj₂ (func* T B) x → proj₂ (func* T A) (k₁ x))
|
|
|
|
|
k₂ = proj₂ k
|
|
|
|
|
|
|
|
|
|
record ContextComprehension : Set (ℓa ⊔ ℓb) where
|
|
|
|
|
field
|
2018-02-05 11:21:39 +00:00
|
|
|
|
Γ&A : Object ℂ
|
|
|
|
|
proj1 : ℂ [ Γ&A , Γ ]
|
2018-02-02 13:47:33 +00:00
|
|
|
|
-- proj2 : ????
|
|
|
|
|
|
|
|
|
|
-- if γ : ℂ [ A , B ]
|
|
|
|
|
-- then T .func→ γ (written T[γ]) interpret substitutions in types and terms respectively.
|
|
|
|
|
-- field
|
|
|
|
|
-- ump : {Δ : ℂ .Object} → (γ : ℂ [ Δ , Γ ])
|
|
|
|
|
-- → (a : {!!}) → {!!}
|