Skip to content

Commit 4616cd8

Browse files
Brought documentation of precats vs. cats up to date with code (wherever I found discrepancies)
1 parent 79b312a commit 4616cd8

File tree

8 files changed

+80
-79
lines changed

8 files changed

+80
-79
lines changed

TypeTheory/ALV1/CwF_SplitTypeCat_Defs.v

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
99
In this file, we give the definitions of _split type-categories_ (originally due to Cartmell, here following a version given by Pitts) and _categories with families_ (originally due to Dybjer, here following a formulation given by Fiore).
1010
11-
To facilitate comparing them afterwards, we split up their definitions in a slightly unusual way, starting with the part they share. The key definitions of this file are therefore (all over a fixed base (pre)category [C]):
11+
To facilitate comparing them afterwards, we split up their definitions in a slightly unusual way, starting with the part they share. The key definitions of this file are therefore (all over a fixed base category [C]):
1212
1313
- _object-extension structures_, [obj_ext_structure], the common core of CwF’s and split type-categories;
1414
- (_functional) term structures_, [term_fun_structure], the rest of the structure of a CwF on [C];
15-
- _cwf-structures_, [cwf_structure], the full structure of a CwF on a precategory [C];
15+
- _cwf-structures_, [cwf_structure], the full structure of a CwF on a category [C];
1616
- _CwF’s_, [cwf];
1717
- _q-morphism structures_, [qq_morphism_structure], for rest of the structure of a split type-category on [C];
1818
- _split type-cat structures_, [split_typecat_structure], the full structure of a split type-category on [C].
1919
- _split type-categories_, [split_typecat].
2020
21-
NB: we follow the convention that _category_ does not include an assumption of saturation/univalence, i.e. means what is sometimes called _precategory_.
21+
NB: we follow UniMath’s convention that _category_ does not assume saturation/univalence, i.e. means what is sometimes called _precategory_ in the literature.
2222
*)
2323

2424

@@ -526,9 +526,7 @@ End Families_Structures.
526526

527527
Section qq_Morphism_Structures.
528528

529-
(* NOTE: most of this section does not require the [homset_property] for [C]. If the few lemmas that do require it were moved out of the section, e.g. [isaprop_qq_morphism_axioms], then would could take [C] as just a [precategory] here. Perhaps worth doing so?
530-
531-
(Another alternative would be adding an extra argument of type [has_homsets C] to [isaprop_qq_morphism_axioms], but that’s less convenient for later use than just having [C] be a [category] in those lemmas.) *)
529+
(* NOTE: most of this section does not require the [homset_property] for [C]. If the few lemmas that do require it were moved out of the section, e.g. [isaprop_qq_morphism_axioms], then would could take [C] as just a [precategory] here. Perhaps worth doing so? Would mainly be relevant if we wanted to generalise to bicategories. *)
532530

533531
Context {C : category} {X : obj_ext_structure C}.
534532

TypeTheory/ALV1/TypeCat.v

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Contents:
77
8-
- Definition of type-categories and split type-categories
8+
- Definition of type-(pre)categories and split type-categories
99
- A few convenience lemmas
1010
*)
1111

@@ -34,13 +34,12 @@ However, that definition includes two _strictness conditions_;
3434
we follow van den Berg and Garner, _Topological and simplicial models_, Def 2.2.1 #(<a href="http://arxiv.org/abs/1007.4638">arXiv</a>)#
3535
in separating these out from the rest of the definition.
3636
37-
An element of [type_precat], as we define it below, is thus exactly a type-category according
38-
to the definition of van den Berg and Garner; and an element of [split_type_precat] is a split type-category
39-
according to van den Berg and Garner, or a plain type-category in the sense of Pitts
40-
(modulo, in either case, the question of equality on objects of the category).
41-
37+
An element of [typecat], as we define it below, is thus exactly a type-category according
38+
to the definition of van den Berg and Garner (except with an underlying _precategory_, i.e. hom-types not assumed sets); and an element of [split_typecat] is a split type-category
39+
according to van den Berg and Garner, or a plain type-category in the sense of Pitts.
40+
4241
In order to avoid the nested sigma-types getting too deep,
43-
we split up the structure into two stages: [type_precat_structure1] and [type_precat_structure2]. *)
42+
we split up the structure into two stages: [typecat_structure1] and [typecat_structure2]. *)
4443

4544
(** * A "preview" of the definition *)
4645

@@ -174,8 +173,8 @@ Definition is_type_saturated_typecat {CC : precategory} (C : typecat_structure C
174173

175174
(** * Splitness *)
176175

177-
(** A type-precategory [C] is _split_ if each collection of types [C Γ] is a set, reindexing is strictly functorial, and the [q] maps satisfy the evident functoriality axioms *)
178-
Definition is_split_typecat {CC : precategory} (C : typecat_structure CC)
176+
(** A type-precategory [C] is _split_ if it is a category (i.e. has hom-sets); each collection of types [C Γ] is a set, reindexing is strictly functorial; and the [q] maps satisfy the evident functoriality axioms *)
177+
Definition is_split_typecat {CC : category} (C : typecat_structure CC)
179178
:= (∏ Γ:CC, isaset (C Γ))
180179
× (∑ (reind_id : ∏ Γ (A : C Γ), A {{identity Γ}} = A),
181180
∏ Γ (A : C Γ), q_typecat A (identity Γ)
@@ -210,14 +209,14 @@ Definition split_typecat := ∑ (C : typecat), (is_split_typecat C).
210209
Coercion typecat_of_split_typecat (C : split_typecat) := pr1 C.
211210
Coercion split_typecat_is_split (C : split_typecat) := pr2 C.
212211

213-
Definition split_typecat_structure (CC : precategory) : UU
212+
Definition split_typecat_structure (CC : category) : UU
214213
:= ∑ C : typecat_structure CC, is_split_typecat C.
215214

216-
Coercion typecat_from_split (CC : precategory) (C : split_typecat_structure CC)
215+
Coercion typecat_from_split (CC : category) (C : split_typecat_structure CC)
217216
: typecat_structure _
218217
:= pr1 C.
219218

220-
Coercion is_split_from_split_typecat (CC : precategory) (C : split_typecat_structure CC)
219+
Coercion is_split_from_split_typecat (CC : category) (C : split_typecat_structure CC)
221220
: is_split_typecat C
222221
:= pr2 C.
223222

TypeTheory/Categories/ess_alg_categories.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
(** (Pre)-categories in essentially algebraic style *)
2+
(** Categories in essentially algebraic style *)
33

4-
(** Such a (pre-)category is given by
4+
(** Such a category is given by
55
- a type (set) of objects
66
- a type (set) of morphisms
77
- source and target maps
@@ -208,4 +208,4 @@ Proof.
208208
exact (pr2 (pr2 (pr1 (pr2 (pr2 C))))).
209209
Qed.
210210

211-
End access_functions.
211+
End access_functions.

TypeTheory/OtherDefs/CwF_1.v

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Contents:
77
8-
- Definition of a precategory with families
8+
- Definition of a category with families
99
- Proof that reindexing forms a pullback
1010
1111
The definition is based on Pitts, *Nominal Presentations of the Cubical Sets
@@ -36,8 +36,8 @@ Reserved Notation "'π' A" (at level 20).
3636
Reserved Notation "'ν' A" (at level 15).
3737
Reserved Notation "γ ♯ a" (at level 25).
3838
(*
39-
Record precwf_record : Type := {
40-
C : precategory ;
39+
Record cwf_record : Type := {
40+
C : category ;
4141
Ty : functor C HSET where "C ⟨ Γ ⟩" := (Ty Γ) ;
4242
term : ∏ Γ : C, pr1hSet (Ty Γ) → UU where "C ⟨ Γ ⊢ A ⟩" := (term Γ A) ;
4343
(* rtype : ∏ {Γ Γ' : C} (A : pr1hSet (Ty Γ)) (γ : Γ' --> Γ), pr1hSetC⟨Γ'⟩ where "A [[ γ ]]" := (rtype A γ) ; *)
@@ -61,12 +61,12 @@ Record precwf_record : Type := {
6161
gen_element : ∏ Γ (A : C⟨Γ⟩), C⟨Γ∙A ⊢ A[[π _ ]]⟩ where "'ν' A" := (gen_element _ A) ;
6262
pairing : ∏ Γ (A : C⟨Γ⟩) Γ' (γ : Γ' --> Γ)(a : C⟨Γ'⊢ A[[γ]]⟩), Γ' --> Γ∙A
6363
where "γ ♯ a" := (pairing _ _ _ γ a) ;
64-
pre_cwf_law_1 : ∏ Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩),
64+
cwf_law_1 : ∏ Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩),
6565
(γ ♯ a) ;; (π _)
6666
=
6767
γ ;
68-
pre_cwf_law_2 : ∏ Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩),
69-
transportf (λ ι, C⟨Γ'⊢ A [[ι]]⟩) (pre_cwf_law_1 Γ A Γ' γ a)
68+
cwf_law_2 : ∏ Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩),
69+
transportf (λ ι, C⟨Γ'⊢ A [[ι]]⟩) (cwf_law_1 Γ A Γ' γ a)
7070
(transportf (λ B, C⟨Γ'⊢ B⟩) (!reindx_type_comp (π _ )(γ ♯ a) _ )
7171
((ν A) ⟦γ ♯ a⟧))
7272
=
@@ -77,11 +77,15 @@ End Record_Preview.
7777

7878

7979
(** * Type and terms of a [CwF] *)
80+
81+
(* Note: in the end, we define not pre-cwfs but cwfs, assuming an underlying _category_ with homsets. But for the “data” stages of the definition, we just take an underlying precategory. *)
82+
8083
(**
81-
A [tt_precategory] comes with a types, written [C⟨Γ⟩],
84+
A [cwf] comes with types, written [C⟨Γ⟩],
8285
and terms [C⟨Γ ⊢ A⟩]
8386
*)
8487

88+
8589
Definition tt_structure (C : precategory) :=
8690
∑ f : functor C^op HSET, ∏ c : C, pr1hSet (f c) → UU.
8791

@@ -281,9 +285,9 @@ Definition cwf_laws {CC : category} (C : tt_reindx_type_struct CC)
281285
(comp_laws_1_2 T × comp_law_3 T × comp_law_4 T)) ×
282286
(∏ Γ (A : C⟨Γ⟩), isaset (C⟨Γ⊢ A⟩)).
283287

284-
(** * Definition of precategory with families *)
285-
(** A precategory with families [pre_cwf] is
286-
- a precategory
288+
(** * Definition of category with families *)
289+
(** A category with families [cwf] is
290+
- a category
287291
- with type-and-term structure
288292
- with reindexing
289293
- with comprehension structure
@@ -403,7 +407,7 @@ Section CwF_lemmas.
403407
Generalizable Variable CC.
404408
Context `{C : cwf_struct CC}.
405409

406-
Lemma map_to_comp_as_pair_precwf {Γ} {A : C⟨Γ⟩} {Γ'} (f : Γ' --> Γ∙A)
410+
Lemma map_to_comp_as_pair_cwf {Γ} {A : C⟨Γ⟩} {Γ'} (f : Γ' --> Γ∙A)
407411
: (f ;; π A) ♯ (transportb _ (reindx_type_comp _ _ _) ((gen_elem A)⟦f⟧))
408412
=
409413
f.
@@ -503,8 +507,8 @@ Proof.
503507
apply idpath.
504508
Qed.
505509

506-
(* TODO: consider giving this instead of current [pre_cwf_law_2] ? *)
507-
Definition pre_cwf_law_2' Γ (A : C ⟨ Γ ⟩) Γ' (γ : Γ' --> Γ) (a : C ⟨ Γ' ⊢ A[[γ]] ⟩)
510+
(* TODO: consider giving this instead of current [cwf_law_2] ? *)
511+
Definition cwf_law_2' Γ (A : C ⟨ Γ ⟩) Γ' (γ : Γ' --> Γ) (a : C ⟨ Γ' ⊢ A[[γ]] ⟩)
508512
: (ν A) ⟦γ ♯ a⟧
509513
= transportf _ (reindx_type_comp _ _ _)
510514
(transportb _ (maponpaths (fun g => A[[g]]) (cwf_law_1 _ _ _ _ _ _))
@@ -530,7 +534,7 @@ Proof.
530534
apply id_right.
531535
Defined.
532536

533-
Definition q_precwf {Γ} (A : C ⟨ Γ ⟩ ) {Γ'} (f : Γ' --> Γ)
537+
Definition q_cwf {Γ} (A : C ⟨ Γ ⟩ ) {Γ'} (f : Γ' --> Γ)
534538
: (comp_obj Γ' (A[[f]])) --> (Γ ∙ A).
535539
Proof.
536540
set (T:= @pairing _ C).
@@ -539,28 +543,28 @@ Proof.
539543
apply gen_elem.
540544
Defined.
541545

542-
Definition dpr_q_precwf
546+
Definition dpr_q_cwf
543547
{Γ} (A : C ⟨ Γ ⟩)
544548
{Γ'} (f : Γ' --> Γ)
545-
: (q_precwf A f) ;; (π A) = (π (A[[f]])) ;; f.
549+
: (q_cwf A f) ;; (π A) = (π (A[[f]])) ;; f.
546550
Proof.
547-
unfold q_precwf.
551+
unfold q_cwf.
548552
apply cwf_law_1.
549553
Qed.
550554

551555

552556
Lemma rterm_univ {Γ} {A : C ⟨ Γ ⟩} {Γ'} (f : Γ' --> Γ)
553557
: ν (A[[f]])
554558
= transportf _ (reindx_type_comp _ _ _)
555-
(transportf _ (maponpaths (fun g => A[[g]]) (dpr_q_precwf A f))
559+
(transportf _ (maponpaths (fun g => A[[g]]) (dpr_q_cwf A f))
556560
(transportb _ (reindx_type_comp _ _ _)
557-
((ν A)⟦q_precwf A f⟧))).
561+
((ν A)⟦q_cwf A f⟧))).
558562
Proof.
559563
sym.
560564
rew_trans_@.
561565
etrans.
562566
- apply maponpaths.
563-
apply pre_cwf_law_2'.
567+
apply cwf_law_2'.
564568
- rew_trans_@.
565569
apply term_typeeq_transport_lemma_2.
566570
apply idpath.
@@ -576,7 +580,7 @@ We split this up into several lemmas:
576580
577581
*)
578582

579-
Definition dpr_q_pbpairing_precwf_aux
583+
Definition dpr_q_pbpairing_cwf_aux
580584
{Γ} (A : C ⟨ Γ ⟩)
581585
{Γ'} (f : Γ' --> Γ)
582586
{X} (h : X --> Γ ∙ A) (k : X --> Γ') (H : h ;; π A = k ;; f)
@@ -590,16 +594,16 @@ Definition dpr_q_pbpairing_commutes
590594
{Γ} (A : C ⟨ Γ ⟩)
591595
{Γ'} (f : Γ' --> Γ)
592596
{X} (h : X --> Γ ∙ A) (k : X --> Γ') (H : h ;; π A = k ;; f)
593-
(hk := @pairing _ C Γ' (A[[f]]) X k (dpr_q_pbpairing_precwf_aux A f h k H))
594-
: (hk ;; q_precwf A f = h) × (hk ;; π (A[[f]]) = k).
597+
(hk := @pairing _ C Γ' (A[[f]]) X k (dpr_q_pbpairing_cwf_aux A f h k H))
598+
: (hk ;; q_cwf A f = h) × (hk ;; π (A[[f]]) = k).
595599
Proof.
596600
split. 2: { apply cwf_law_1. }
597-
unfold q_precwf.
601+
unfold q_cwf.
598602
etrans.
599-
2: { apply map_to_comp_as_pair_precwf. }
603+
2: { apply map_to_comp_as_pair_cwf. }
600604
etrans.
601605
apply cwf_law_3.
602-
assert ((k ♯ (dpr_q_pbpairing_precwf_aux A f h k H)) ;; (π (A [[f]]) ;; f)
606+
assert ((k ♯ (dpr_q_pbpairing_cwf_aux A f h k H)) ;; (π (A [[f]]) ;; f)
603607
= h ;; π A) as e1.
604608
eapply pathscomp0. apply assoc.
605609
refine (_ @ !H).
@@ -610,38 +614,38 @@ Proof.
610614
eapply pathscomp0. apply transport_f_f.
611615
eapply pathscomp0. apply maponpaths. refine (! rterm_typeeq _ _ _).
612616
eapply pathscomp0. apply transport_f_f.
613-
eapply pathscomp0. apply maponpaths, pre_cwf_law_2'.
617+
eapply pathscomp0. apply maponpaths, cwf_law_2'.
614618
rew_trans_@.
615619
eapply pathscomp0. apply maponpaths, transportf_rtype_mapeq.
616620
repeat (eapply pathscomp0; [ apply transport_f_f | ]).
617621
refine (maponpaths (fun e => transportf _ e _) _).
618622
apply cwf_types_isaset.
619623
Qed.
620624

621-
Definition dpr_q_pbpairing_precwf
625+
Definition dpr_q_pbpairing_cwf
622626
{Γ} (A : C ⟨ Γ ⟩)
623627
{Γ'} (f : Γ' --> Γ)
624628
{X} (h : X --> Γ ∙ A) (k : X --> Γ') (H : h ;; π A = k ;; f)
625629
: ∑ (hk : X --> Γ' ∙ (A[[f]])),
626-
( hk ;; q_precwf A f = h
630+
( hk ;; q_cwf A f = h
627631
× hk ;; π (A[[f]]) = k).
628632
Proof.
629-
exists (@pairing _ C Γ' (A[[f]]) X k (dpr_q_pbpairing_precwf_aux A f h k H)).
633+
exists (@pairing _ C Γ' (A[[f]]) X k (dpr_q_pbpairing_cwf_aux A f h k H)).
630634
apply dpr_q_pbpairing_commutes.
631635
Defined.
632636

633637

634-
Definition dpr_q_pbpairing_precwf_mapunique
638+
Definition dpr_q_pbpairing_cwf_mapunique
635639
{Γ} (A : C⟨Γ⟩)
636640
{Γ'} (f : Γ' --> Γ)
637641
{X} {h : X --> Γ ∙ A} {k : X --> Γ'} (H : h ;; π A = k ;; f)
638642
(hk : X --> Γ' ∙ (A [[f]]))
639-
(e2 : hk ;; q_precwf A f = h)
643+
(e2 : hk ;; q_cwf A f = h)
640644
(e1 : hk ;; π (A[[f]]) = k)
641-
: hk = pr1 (dpr_q_pbpairing_precwf A f h k H).
645+
: hk = pr1 (dpr_q_pbpairing_cwf A f h k H).
642646
Proof.
643647
eapply pathscomp0.
644-
eapply pathsinv0. apply map_to_comp_as_pair_precwf.
648+
eapply pathsinv0. apply map_to_comp_as_pair_cwf.
645649
eapply pathscomp0.
646650
apply (pairing_mapeq _ _ e1 _).
647651
simpl. apply maponpaths.
@@ -673,29 +677,29 @@ Proof.
673677
apply idpath.
674678
Qed.
675679

676-
Definition dpr_q_pbpairing_precwf_unique
680+
Definition dpr_q_pbpairing_cwf_unique
677681
{Γ} (A : C⟨Γ⟩)
678682
{Γ'} (f : Γ' --> Γ)
679683
{X} (h : X --> Γ ∙ A) (k : X --> Γ') (H : h ;; π A = k ;; f)
680684
(t : ∑ hk : X --> Γ' ∙ (A [[f]]),
681-
(hk ;; q_precwf A f = h) × (hk ;; π (A[[f]]) = k))
682-
: t = dpr_q_pbpairing_precwf A f h k H.
685+
(hk ;; q_cwf A f = h) × (hk ;; π (A[[f]]) = k))
686+
: t = dpr_q_pbpairing_cwf A f h k H.
683687
Proof.
684688
destruct t as [hk [e2 e1] ].
685689
unshelve refine (@total2_paths_f _ _ (tpair _ hk (tpair _ e2 e1)) _
686-
(dpr_q_pbpairing_precwf_mapunique A f H hk e2 e1) _).
690+
(dpr_q_pbpairing_cwf_mapunique A f H hk e2 e1) _).
687691
unshelve refine (total2_paths_f _ _); apply homset_property.
688692
Qed.
689693

690694
Lemma is_pullback_reindx_cwf : ∏ (Γ : CC) (A : C⟨Γ⟩) (Γ' : CC)
691695
(f : Γ' --> Γ),
692-
isPullback (dpr_q_precwf A f).
696+
isPullback (dpr_q_cwf A f).
693697
Proof.
694698
intros.
695699
apply make_isPullback; try assumption.
696700
intros e h k H.
697-
exists (dpr_q_pbpairing_precwf _ _ h k H).
698-
apply dpr_q_pbpairing_precwf_unique.
701+
exists (dpr_q_pbpairing_cwf _ _ h k H).
702+
apply dpr_q_pbpairing_cwf_unique.
699703
Defined.
700704

701705
End CwF_lemmas.

0 commit comments

Comments
 (0)