Skip to content

Commit 29746f6

Browse files
committed
SetoidRewrite: style fixes; mention examples in HomologicalAlgebra.v
1 parent 8fb0c56 commit 29746f6

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

test/WildCat/SetoidRewrite.v

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ From HoTT.WildCat Require Import Core NatTrans Equiv SetoidRewrite.
77

88
(** ** Examples of setoid rewriting *)
99

10+
(** See theories/WildCat/HomologicalAlgebra.v for many more examples of setoid rewriting. *)
11+
1012
(** Rewriting works in hypotheses. *)
11-
Proposition IsEpic_HasSection {A} `{Is1Cat A}
13+
Proposition epic_sectionof {A} `{Is1Cat A}
1214
{a b : A} (f : a $-> b) :
1315
SectionOf f -> Epic f.
1416
Proof.
@@ -19,7 +21,7 @@ Proof.
1921
Defined.
2022

2123
(** A different approach, working in the goal. *)
22-
Proposition IsMonic_HasRetraction {A} `{Is1Cat A}
24+
Proposition monic_retractionof {A} `{Is1Cat A}
2325
{b c : A} (f : b $-> c) :
2426
RetractionOf f -> Monic f.
2527
Proof.
@@ -30,7 +32,7 @@ Proof.
3032
exact (_ $@L eq_fg_fh).
3133
Defined.
3234

33-
Proposition nat_equiv_faithful {A B : Type}
35+
Proposition faithful_nat_equiv_faithful {A B : Type}
3436
{F G : A -> B} `{Is1Functor _ _ F}
3537
`{!Is0Functor G, !Is1Functor G}
3638
`{!HasEquivs B} (tau : NatEquiv F G)
@@ -46,35 +48,37 @@ Defined.
4648
(** ** Tests of setoid rewriting *)
4749

4850
Section SetoidRewriteTests.
51+
4952
Goal forall (A : Type) `(H : Is0Gpd A) (a b c : A),
5053
a $== b -> b $== c -> a $== c.
5154
Proof.
5255
intros A ? ? ? a b c eq_ab eq_bc.
53-
rewrite eq_ab, <- eq_bc.
56+
by rewrite eq_ab, <- eq_bc.
5457
Abort.
58+
5559
Goal forall (A : Type) `(H : Is0Gpd A) (a b c : A),
5660
a $== b -> b $== c -> a $== c.
5761
Proof.
5862
intros A ? ? ? a b c eq_ab eq_bc.
5963
symmetry.
6064
rewrite eq_ab, <- eq_bc.
6165
rewrite eq_bc.
62-
rewrite <- eq_bc.
66+
by rewrite <- eq_bc.
6367
Abort.
6468

6569
Goal forall (A B : Type) (F : A -> B) `{Is1Functor _ _ F} (a b : A) (f g : a $-> b), f $== g -> fmap F f $== fmap F g.
6670
Proof.
6771
do 17 intro.
6872
intro eq_fg.
69-
rewrite eq_fg.
73+
by rewrite eq_fg.
7074
Abort.
7175

7276
Goal forall (A : Type) `{Is1Cat A} (a b c : A) (f1 f2 : a $-> b) (g : b $-> c), f1 $== f2 -> g $o f1 $== g $o f2.
7377
Proof.
7478
do 11 intro.
7579
intro eq.
7680
rewrite <- eq.
77-
rewrite eq.
81+
by rewrite eq.
7882
Abort.
7983

8084
Goal forall (A : Type) `{Is1Cat A} (a b c : A) (f : a $-> b) (g1 g2 : b $-> c), g1 $== g2 -> g1 $o f $== g2 $o f.
@@ -83,7 +87,7 @@ Section SetoidRewriteTests.
8387
intro eq.
8488
rewrite <- eq.
8589
rewrite eq.
86-
rewrite <- eq.
90+
by rewrite <- eq.
8791
Abort.
8892

8993
Goal forall (A : Type) `{Is1Cat A} (a b c : A) (f1 f2 : a $-> b) (g1 g2 : b $-> c), g1 $== g2 -> f1 $== f2 -> g1 $o f1 $== g2 $o f2.
@@ -93,6 +97,7 @@ Section SetoidRewriteTests.
9397
rewrite eq_g.
9498
rewrite <- eq_f.
9599
rewrite eq_f.
96-
rewrite <- eq_g.
100+
by rewrite <- eq_g.
97101
Abort.
102+
98103
End SetoidRewriteTests.

theories/WildCat/SetoidRewrite.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(** * Typeclass instances to allow rewriting in wild categories *)
22

3-
(** This file uses the setoid rewriting machinery from the Coq standard library to allow rewriting in wild-categories. Examples are given in test/WildCat/SetoidRewrite.v. *)
3+
(** This file uses the setoid rewriting machinery from the Coq standard library to allow rewriting in wild-categories. Examples are given in test/WildCat/SetoidRewrite.v and theories/WildCat/HomologicalAlgebra.v. *)
44

55
(** Init.Tactics contains the definition of the Coq stdlib typeclass_inferences database. With Coq 8.x, it must be imported before Basics.Overture. Otherwise, the typeclasses hintdb is cleared, breaking typeclass inference. Because of this, this file also needs to be the first file Require'd in any file that uses it. Moreover, if Foo Requires this file, then Foo must also be the first file Require'd in any file that Requires Foo, and so on. Once we assume Rocq 9.0 as our minimum, these comments can be removed. *)
66

0 commit comments

Comments
 (0)