Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
(** * Typeclass instances to allow rewriting in wild categories *)(** 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. *)(** 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. *)#[warnings="-deprecated-from-Coq"]
From Coq Require Init.Tactics.
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
[Loading ML file tauto_plugin.cmxs (using legacy method) ... done]
[Loading ML file cc_plugin.cmxs (using legacy method) ... done]
[Loading ML file firstorder_plugin.cmxs (using legacy method) ... done]
Import CMorphisms.ProperNotations.From HoTT Require Import WildCat.Core.#[export] Instancereflexive_proper_proxy {A : Type}
{R : Relation A} `(Reflexive A R) (x : A)
: CMorphisms.ProperProxy R x := reflexivity x.(** forall (x y : A), x $== y -> forall (a b : A), a $== b -> y $== b -> x $==a *)
(* Add the next line to the start of any proof to see what it means: *)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A
forallxy : A,
x $== y ->
forallx0y0 : A, x0 $== y0 -> y $== y0 -> x $== x0
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $== y a, b: A eq_ab: a $== b eq_yb: y $== b
x $== a
exact (transitivity eq_xy (transitivity eq_yb
(symmetry _ _ eq_ab))).(* We could also just write: exact (eq_xy $@ eq_yb $@ eq_ab^$). The advantage of the above proof is that it works for other transitive and symmetric relations. *)Defined.(** forall (x y : A), x $== y -> forall (a b : A), a $== b -> x $== a -> y $== b *)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $== y a, b: A eq_ab: a $== b eq_xa: x $== a
y $== b
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $== y a, b: A eq_ab: a $== b eq_xa: x $== a
y $== a
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $== y a, b: A eq_ab: a $== b eq_xa: x $== a
y $== x
exact (symmetry _ _ eq_xy).Defined.(** forall a x y : A, x $== y -> a $== x -> a $== y *)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A a: A
CMorphisms.Proper (GpdHom ==> CRelationClasses.arrow)
(GpdHom a)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A a: A
CMorphisms.Proper (GpdHom ==> CRelationClasses.arrow)
(GpdHom a)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A a, x, y: A eq_xy: x $== y eq_ax: a $== x
a $== y
bytransitivity x.Defined.(** forall a x y : A, x $== y -> a $== y -> a $== x *)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A a: A
CMorphisms.Proper
(GpdHom ==>
CRelationClasses.flip CRelationClasses.arrow)
(GpdHom a)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A a: A
CMorphisms.Proper
(GpdHom ==>
CRelationClasses.flip CRelationClasses.arrow)
(GpdHom a)
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A a, x, y: A eq_xy: x $== y eq_ay: a $== y
a $== x
exact (transitivity eq_ay (symmetry _ _ eq_xy)).Defined.Open Scope signatureT_scope.(** If [R] is symmetric and [R x y -> R' (f x) (f y)], then [R y x -> R' (f x) (f y)]. *)
A, B: Type f: A -> B R: Relation A R': Relation B H: Symmetric R H0: CMorphisms.Proper (R ==> R') f
CMorphisms.Proper (R --> R') f
A, B: Type f: A -> B R: Relation A R': Relation B H: Symmetric R H0: CMorphisms.Proper (R ==> R') f
CMorphisms.Proper (R --> R') f
A, B: Type f: A -> B R: Relation A R': Relation B H: Symmetric R H0: CMorphisms.Proper (R ==> R') f a, b: A Rba: R b a
R' (f a) (f b)
A, B: Type f: A -> B R: Relation A R': Relation B H: Symmetric R H0: CMorphisms.Proper (R ==> R') f a, b: A Rba: R b a
R a b
A, B: Type f: A -> B R: Relation A R': Relation B H: Symmetric R H0: CMorphisms.Proper (R ==> R') f a, b: A Rba: R b a
R b a
exact Rba.Defined.(** If [R'] is symmetric and [R x y -> R' x' y' -> R'' (f x x') (f y y')], then [R x y -> R' y' x' -> R'' (f x x') (f y y')]. *)
A, B, C: Type R: Relation A R': Relation B R'': Relation C H: Symmetric R' f: A -> B -> C H1: CMorphisms.Proper (R ==> R' ==> R'') f
CMorphisms.Proper (R ==> R' --> R'') f
A, B, C: Type R: Relation A R': Relation B R'': Relation C H: Symmetric R' f: A -> B -> C H1: CMorphisms.Proper (R ==> R' ==> R'') f
CMorphisms.Proper (R ==> R' --> R'') f
A, B, C: Type R: Relation A R': Relation B R'': Relation C H: Symmetric R' f: A -> B -> C H1: CMorphisms.Proper (R ==> R' ==> R'') f a, b: A Rab: R a b x, y: B R'yx: CRelationClasses.flip R' x y
R'' (f a x) (f b y)
apply H1; [ assumption | symmetry; assumption ].Defined.#[export] InstanceIsProper_fmap {AB : Type}
(F : A -> B) `{Is1Functor _ _ F} (a b : A)
: CMorphisms.Proper (GpdHom ==> GpdHom) (@fmap _ _ _ _ F _ a b)
:= fun__ => fmap2 F.#[export] InstanceIsProper_catcomp_g {A : Type} `{Is1Cat A}
{a b c : A} (g : b $-> c)
: CMorphisms.Proper (GpdHom ==> GpdHom) (@cat_comp _ _ _ a b c g)
:= fun__ => cat_postwhisker g.
A: Type IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A a, b, c: A
A: Type IsGraph0: IsGraph A Is2Graph0: Is2Graph A Is01Cat0: Is01Cat A H: Is1Cat A a, b, c: A g1, g2: b $-> c eq_g: g1 $== g2 f1, f2: a $-> b eq_f: f1 $== f2
g1 $o f1 $== g2 $o f2
exact (cat_comp2 eq_f eq_g).Defined.
A, B: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A R: Relation B F: A -> B H2: CMorphisms.Proper (GpdHom ==> R) F
CMorphisms.Proper (Hom ==> R) F
A, B: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A R: Relation B F: A -> B H2: CMorphisms.Proper (GpdHom ==> R) F
CMorphisms.Proper (Hom ==> R) F
intros a b eq_ab; apply H2; exact eq_ab.Defined.
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A
CMorphisms.Proper
(Hom ==> Hom ==> CRelationClasses.arrow) Hom
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A
CMorphisms.Proper
(Hom ==> Hom ==> CRelationClasses.arrow) Hom
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $-> y a, b: A eq_ab: a $-> b f: x $-> a
y $-> b
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $-> y a, b: A eq_ab: a $-> b f: x $-> a
y $-> a
A: Type H: IsGraph A H0: Is01Cat A H1: Is0Gpd A x, y: A eq_xy: x $-> y a, b: A eq_ab: a $-> b f: x $-> a