Skip to content

Commit 2c247c9

Browse files
Factored out a couple more [has_homsets]
1 parent 84c2f28 commit 2c247c9

File tree

3 files changed

+39
-55
lines changed

3 files changed

+39
-55
lines changed

TypeTheory/Auxiliary/CategoryTheory.v

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Proof.
148148
apply is_iso_counit_over_id, axioms_of_equiv_over_id.
149149
Defined.
150150

151-
(* Notes towards some possible improvements in UniMath’s treatment of adjunctions, equivalences (and a few other unrelated things in the library):
151+
(* TODO: Notes towards some possible improvements in UniMath’s treatment of adjunctions, equivalences (and a few other unrelated things in the library):
152152
153153
One really confusing point is having
154154
[adj_equivalence_of_precats] for the property of (or structure on) a functor,
@@ -185,7 +185,6 @@ Defined.
185185
Unrelated:
186186
187187
- improve stuff on nat isos? Move from current location to a more core one, and give good access functions, e.g. use it in lemmase like [functor_iso_from_pointwise_iso]?
188-
- consolidated things with a “has_homsets” argument to have a “category” argument instead
189188
190189
- Rename “transportb_transpose_right”.
191190

TypeTheory/Categories/ess_and_gen_alg_cats.v

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ Open Scope cat_deprecated.
2727

2828
(** * From generalized algebraic precategories to essentially algebraic ones.*)
2929

30-
(** We need extra assumption that the gen. alg. precategory has hom-sets *)
30+
(** We need extra assumption that the gen. alg. precategory is a category, i.e. has hom-sets *)
3131

3232
Section ess_alg_from_gen_alg.
3333

34-
Variable C : precategory.
35-
Variable hs : has_homsets C.
34+
Variable C : category.
3635
Variable H : isaset C.
3736

3837
(* TODO: now we are writing compositional in diagrammatic order,
@@ -125,7 +124,7 @@ Proof.
125124
- split.
126125
+ apply H.
127126
+ apply isaset_total2. apply isaset_dirprod; try assumption.
128-
intro x; apply hs.
127+
intro x; apply homset_property.
129128
Qed.
130129

131130
End ess_alg_from_gen_alg.
@@ -206,4 +205,4 @@ Qed.
206205
Definition precategory_from_ess_alg_cat : precategory :=
207206
(_,,is_precategory_precategory_data_from_ess_alg_cat).
208207

209-
End gen_alg_from_ess_alg.
208+
End gen_alg_from_ess_alg.

TypeTheory/OtherDefs/CwF_1.v

Lines changed: 34 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,12 @@ Definition comp_law_4 {CC : precategory} {C : tt_reindx_type_struct CC}
274274

275275

276276

277-
278-
Definition cwf_laws {CC : precategory}(C : tt_reindx_type_struct CC)
277+
(* Note: the restriction now from categories to precategories is deliberate — we are insisting that cwf’s have hom-sets. *)
278+
Definition cwf_laws {CC : category} (C : tt_reindx_type_struct CC)
279279
:=
280280
(∑ T : reindx_laws C,
281281
(comp_laws_1_2 T × comp_law_3 T × comp_law_4 T)) ×
282-
(has_homsets CC × (*∏ Γ, isaset (C⟨Γ⟩) × *) ∏ Γ (A : C⟨Γ⟩), isaset (C⟨Γ⊢ A⟩)).
282+
(∏ Γ (A : C⟨Γ⟩), isaset (C⟨Γ⊢ A⟩)).
283283

284284
(** * Definition of precategory with families *)
285285
(** A precategory with families [pre_cwf] is
@@ -292,52 +292,51 @@ Definition cwf_laws {CC : precategory}(C : tt_reindx_type_struct CC)
292292
*)
293293

294294

295-
Definition cwf_struct (CC : precategory) : UU
295+
Definition cwf_struct (CC : category) : UU
296296
:= ∑ C : tt_reindx_type_struct CC, cwf_laws C.
297297

298298
(** * Various access functions to the components *)
299299
(** Also a few generalizations are proved, providing variants with
300300
generalized proofs of identity of types, terms (which form hsets)
301301
*)
302302

303-
Coercion cwf_data_from_cwf_struct (CC : precategory) (C : cwf_struct CC) : _ CC := pr1 C.
304-
Coercion cwf_laws_from_cwf_struct (CC : precategory) (C : cwf_struct CC) : cwf_laws C := pr2 C.
303+
Coercion cwf_data_from_cwf_struct (CC : category) (C : cwf_struct CC)
304+
: tt_reindx_type_struct CC
305+
:= pr1 C.
305306

307+
Coercion cwf_laws_from_cwf_struct (CC : category) (C : cwf_struct CC)
308+
: cwf_laws C
309+
:= pr2 C.
306310

307-
Coercion reindx_laws_from_cwf_struct (CC : precategory) (C : cwf_struct CC)
311+
Coercion reindx_laws_from_cwf_struct (CC : category) (C : cwf_struct CC)
308312
: reindx_laws C
309313
:= pr1 (pr1 (pr2 C)).
310314

311-
312-
Definition cwf_comp_laws {CC : precategory} (C : cwf_struct CC)
315+
Definition cwf_comp_laws {CC : category} (C : cwf_struct CC)
313316
: (comp_laws_1_2 C × comp_law_3 C × comp_law_4 C)
314317
:= pr2 (pr1 (pr2 C)).
315318

316-
317-
Definition has_homsets_cwf {CC : precategory} (C : cwf_struct CC) : has_homsets CC
318-
:= pr1 (pr2 (pr2 C)).
319-
320-
Definition cwf_types_isaset {CC : precategory} (C : cwf_struct CC) Γ : isaset (C⟨Γ⟩)
319+
Definition cwf_types_isaset {CC : category} (C : cwf_struct CC) Γ : isaset (C⟨Γ⟩)
321320
:= setproperty (C⟨Γ⟩).
322321

323-
Definition cwf_terms_isaset {CC : precategory} (C : cwf_struct CC) : ∏ Γ A, isaset (C⟨Γ ⊢ A⟩)
324-
:= (pr2 (pr2 (pr2 C))).
322+
Definition cwf_terms_isaset {CC : category} (C : cwf_struct CC) : ∏ Γ A, isaset (C⟨Γ ⊢ A⟩)
323+
:= (pr2 (pr2 C)).
325324

326325

327-
Definition cwf_law_1 {CC : precategory} (C : cwf_struct CC)
326+
Definition cwf_law_1 {CC : category} (C : cwf_struct CC)
328327
Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩)
329328
: (γ ♯ a) ;; (π _) = γ
330329
:= pr1 (pr1 (cwf_comp_laws C) Γ A Γ' γ a).
331330

332-
Definition cwf_law_2 {CC : precategory} (C : cwf_struct CC)
331+
Definition cwf_law_2 {CC : category} (C : cwf_struct CC)
333332
Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩)
334333
: transportf (λ ι, C⟨Γ'⊢ A [[ι]]⟩) (cwf_law_1 C Γ A Γ' γ a)
335334
(transportf (λ B, C⟨Γ'⊢ B⟩) (!reindx_type_comp (π _)(γ ♯ a) _ )
336335
((ν A) ⟦γ ♯ a⟧))
337336
= a
338337
:= pr2 ((pr1 (cwf_comp_laws C)) Γ A Γ' γ a).
339338

340-
Definition cwf_law_2_gen {CC : precategory} (C : cwf_struct CC)
339+
Definition cwf_law_2_gen {CC : category} (C : cwf_struct CC)
341340
Γ (A : C ⟨Γ⟩) Γ' (γ : Γ' --> Γ) (a : C⟨Γ'⊢ A[[γ]]⟩)
342341
: ∏ (p : (A [[π A]]) [[γ ♯ a]] = A [[γ ♯ a;; π A]]) (p0 : γ ♯ a;; π A = γ),
343342
transportf (λ ι : Γ' --> Γ, C ⟨ Γ' ⊢ A [[ι]] ⟩) p0
@@ -346,17 +345,17 @@ Proof.
346345
intros p p'.
347346
etrans; [ | apply cwf_law_2].
348347
match goal with | [ |- _ = transportf _ ?p1 _ ] => assert (T : p' = p1) end.
349-
{ apply (has_homsets_cwf C). }
348+
{ apply homset_property. }
350349
rewrite T; clear T. apply maponpaths.
351350
match goal with | [ |- _ = transportf _ ?p1 _ ] => assert (T : p = p1) end.
352351
{ apply (cwf_types_isaset C). }
353352
rewrite T; apply idpath.
354353
Qed.
355354

356-
Definition cwf_law_3 {CC : precategory} (C : cwf_struct CC) : comp_law_3 C
355+
Definition cwf_law_3 {CC : category} (C : cwf_struct CC) : comp_law_3 C
357356
:= pr1 (pr2 (cwf_comp_laws C)).
358357

359-
Definition cwf_law_3_gen {CC : precategory} (C : cwf_struct CC)
358+
Definition cwf_law_3_gen {CC : category} (C : cwf_struct CC)
360359
(Γ : CC) (A : C ⟨ Γ ⟩) (Γ' Γ'' : CC) (γ : Γ' --> Γ) (γ' : Γ'' --> Γ')
361360
(a : C ⟨ Γ' ⊢ A [[γ]] ⟩) (p : (A [[γ]]) [[γ']] = A [[γ';; γ]]):
362361
γ';; γ ♯ a =
@@ -369,15 +368,12 @@ Proof.
369368
rewrite T; apply idpath.
370369
Qed.
371370

372-
Definition cwf_law_4 {CC : precategory} (C : cwf_struct CC) : comp_law_4 C
371+
Definition cwf_law_4 {CC : category} (C : cwf_struct CC) : comp_law_4 C
373372
:= pr2 (pr2 (cwf_comp_laws C)).
374373

375-
376-
377374
Ltac imp := apply impred; intro.
378375

379-
380-
Lemma isPredicate_cwf_laws (CC : precategory)
376+
Lemma isPredicate_cwf_laws (CC : category)
381377
: isPredicate (@cwf_laws CC).
382378
Proof.
383379
intros T.
@@ -386,26 +382,17 @@ Proof.
386382
set (X:= tpair _ T H : cwf_struct CC).
387383
apply (isofhleveltotal2).
388384
- apply isofhleveltotal2.
389-
+ apply isofhleveltotal2.
390-
* intros.
391-
do 3 imp. apply (cwf_terms_isaset X).
392-
* intros.
393-
do 7 imp. apply (cwf_terms_isaset X).
385+
+ apply isofhleveltotal2;
386+
intros; repeat imp; apply (cwf_terms_isaset X).
394387
+ intros.
395-
repeat (apply isofhleveldirprod).
396-
*
397-
{
398-
do 5 imp.
399-
apply (isofhleveltotal2 1).
400-
- apply (has_homsets_cwf X).
401-
- intros. apply (cwf_terms_isaset X).
402-
}
403-
* do 7 imp. apply (has_homsets_cwf X).
404-
* do 2 imp. apply (has_homsets_cwf X).
388+
repeat (apply isofhleveldirprod); repeat imp;
389+
try apply homset_property.
390+
apply (isofhleveltotal2 1).
391+
* apply homset_property.
392+
* intros. apply (cwf_terms_isaset X).
405393
- intros.
406394
repeat (apply isofhleveldirprod).
407-
+ apply isaprop_has_homsets.
408-
+ do 2 imp. apply isapropisaset.
395+
do 2 imp. apply isapropisaset.
409396
Qed.
410397

411398

@@ -686,7 +673,7 @@ Proof.
686673
apply idpath.
687674
Qed.
688675

689-
Definition dpr_q_pbpairing_precwf_unique (hs : has_homsets CC)
676+
Definition dpr_q_pbpairing_precwf_unique
690677
{Γ} (A : C⟨Γ⟩)
691678
{Γ'} (f : Γ' --> Γ)
692679
{X} (h : X --> Γ ∙ A) (k : X --> Γ') (H : h ;; π A = k ;; f)
@@ -697,10 +684,10 @@ Proof.
697684
destruct t as [hk [e2 e1] ].
698685
unshelve refine (@total2_paths_f _ _ (tpair _ hk (tpair _ e2 e1)) _
699686
(dpr_q_pbpairing_precwf_mapunique A f H hk e2 e1) _).
700-
unshelve refine (total2_paths_f _ _); apply hs.
687+
unshelve refine (total2_paths_f _ _); apply homset_property.
701688
Qed.
702689

703-
Lemma is_pullback_reindx_cwf (hs : has_homsets CC) : ∏ (Γ : CC) (A : C⟨Γ⟩) (Γ' : CC)
690+
Lemma is_pullback_reindx_cwf : ∏ (Γ : CC) (A : C⟨Γ⟩) (Γ' : CC)
704691
(f : Γ' --> Γ),
705692
isPullback (dpr_q_precwf A f).
706693
Proof.
@@ -709,7 +696,6 @@ Proof.
709696
intros e h k H.
710697
exists (dpr_q_pbpairing_precwf _ _ h k H).
711698
apply dpr_q_pbpairing_precwf_unique.
712-
assumption.
713699
Defined.
714700

715701
End CwF_lemmas.

0 commit comments

Comments
 (0)