Skip to content

Commit affbb3a

Browse files
committed
WildCat/Induced: add and use intros_of_type tactic
1 parent c7e4eaa commit affbb3a

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

theories/WildCat/Induced.v

+25-29
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Require Import WildCat.Equiv.
1010
1111
This needs to be separate from Core because of HasEquivs usage. We don't make these definitions Global Instances because we only want to apply them manually, but we make them Local Instances so that subsequent ones can pick up the previous ones automatically. *)
1212

13+
(** In most of the proofs, we only want to use [intro] on variables of type [A], so this will be handy. *)
14+
Ltac intros_of_type A :=
15+
repeat match goal with |- forall (a : A), _ => intro a end.
16+
1317
Section Induced_category.
1418
Context {A B : Type} (f : A -> B).
1519

@@ -22,60 +26,52 @@ Section Induced_category.
2226

2327
Local Instance is01cat_induced `{Is01Cat B} : Is01Cat A.
2428
Proof.
25-
nrapply Build_Is01Cat.
26-
+ intro a; cbn.
27-
exact (Id (f a)).
28-
+ intros a b c; cbn. apply cat_comp.
29+
nrapply Build_Is01Cat; intros_of_type A; cbn.
30+
+ apply Id.
31+
+ apply cat_comp.
2932
Defined.
3033

3134
Local Instance is0gpd_induced `{Is0Gpd B} : Is0Gpd A.
3235
Proof.
33-
nrapply Build_Is0Gpd.
34-
intros a b; cbn. apply gpd_rev.
36+
nrapply Build_Is0Gpd; intros_of_type A; cbn.
37+
apply gpd_rev.
3538
Defined.
3639

3740
(** The structure map along which we induce the category structure becomes a functor with respect to the induced structure. *)
3841
Local Instance is0functor_induced `{IsGraph B} : Is0Functor f.
3942
Proof.
40-
nrapply Build_Is0Functor.
41-
intros a b; cbn. exact idmap.
43+
nrapply Build_Is0Functor; intros_of_type A; cbn.
44+
exact idmap.
4245
Defined.
4346

4447
Local Instance is2graph_induced `{Is2Graph B} : Is2Graph A.
4548
Proof.
46-
intros a b; cbn. apply isgraph_hom.
49+
constructor; cbn. apply isgraph_hom.
4750
Defined.
4851

4952
Local Instance is1cat_induced `{Is1Cat B} : Is1Cat A.
5053
Proof.
51-
snrapply Build_Is1Cat; cbn.
52-
+ intros a b.
53-
rapply is01cat_hom.
54-
+ intros a b.
55-
nrapply is0gpd_hom.
56-
+ intros a b c.
57-
rapply is0functor_postcomp.
58-
+ intros a b c.
59-
rapply is0functor_precomp.
60-
+ intros a b c d.
61-
nrapply cat_assoc.
62-
+ intros a b.
63-
nrapply cat_idl.
64-
+ intros a b.
65-
nrapply cat_idr.
54+
snrapply Build_Is1Cat; intros_of_type A; cbn.
55+
+ rapply is01cat_hom.
56+
+ nrapply is0gpd_hom.
57+
+ rapply is0functor_postcomp.
58+
+ rapply is0functor_precomp.
59+
+ rapply cat_assoc.
60+
+ rapply cat_idl.
61+
+ rapply cat_idr.
6662
Defined.
6763

6864
Local Instance is1functor_induced `{Is1Cat B} : Is1Functor f.
6965
Proof.
70-
srapply Build_Is1Functor; cbn.
71-
+ intros a b g h. exact idmap.
72-
+ intros a. exact (Id _).
73-
+ intros a b c g h. exact (Id _).
66+
srapply Build_Is1Functor; intros_of_type A; cbn.
67+
+ intros g h. exact idmap.
68+
+ exact (Id _).
69+
+ intros g h. exact (Id _).
7470
Defined.
7571

7672
Instance hasmorext_induced `{HasMorExt B} : HasMorExt A.
7773
Proof.
78-
constructor. intros a b; cbn. rapply isequiv_Htpy_path.
74+
constructor. intros_of_type A; cbn. rapply isequiv_Htpy_path.
7975
Defined.
8076

8177
Definition hasequivs_induced `{HasEquivs B} : HasEquivs A.

0 commit comments

Comments
 (0)