Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more opposite tests #1961

Merged
merged 2 commits into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions test/WildCat/Opposite.v
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From HoTT Require Import Basics WildCat.Core WildCat.Opposite WildCat.Equiv.

(** * Opposites are definitionally involutive. *)
From HoTT Require Import Basics WildCat.Core WildCat.Opposite WildCat.Equiv
WildCat.NatTrans WildCat.Bifunctor.

(** Opposites are definitionally involutive. *)
Definition test1 A : A = (A^op)^op :> Type := 1.
Definition test2 A `{x : IsGraph A} : x = @isgraph_op A^op (@isgraph_op A x) := 1.
Definition test3 A `{x : Is01Cat A} : x = @is01cat_op A^op _ (@is01cat_op A _ x) := 1.
Definition test4 A `{x : Is2Graph A} : x = @is2graph_op A^op _ (@is2graph_op A _ x) := 1.
Definition test5 A `{x : Is1Cat A} : x = @is1cat_op A^op _ _ _ (@is1cat_op A _ _ _ x) := 1.

(** * [core] only partially commutes with taking the opposite category. *)
(** [core] only partially commutes with taking the opposite category. *)
Definition core1 A `{HasEquivs A} : (core A)^op = core A^op :> Type := 1.
Definition core2 A `{HasEquivs A} : isgraph_op (A:=core A) = isgraph_core (A:=A^op) := 1.
Definition core3 A `{HasEquivs A} : is01cat_op (A:=core A) = is01cat_core (A:=A^op) := 1.
Expand All @@ -17,3 +17,26 @@ Definition core4 A `{HasEquivs A} : is2graph_op (A:=core A) = is2graph_core (A:=
(** The Opaque line reduces the time from 0.3s to 0.07s. *)
Opaque compose_catie_isretr.
Definition core5 A `{HasEquivs A} : is1cat_op (A:=core A) = is1cat_core (A:=A^op) := 1.

(** Opposite functors are definitionally involutive. *)
Definition test6 A B (F : A -> B) `{x : Is0Functor A B F}
: @is0functor_op _ _ F _ _ (@is0functor_op _ _ F _ _ x) = x
:= 1.
Definition test7 A B (F : A -> B) `{x : Is1Functor A B F}
: @is1functor_op _ _ F _ _ _ _ _ _ _ _ _ (@is1functor_op _ _ F _ _ _ _ _ _ _ _ _ x) = x
:= 1.

(** Opposite bifunctors are definitionally involutive. *)
Definition test8 A B C (F : A -> B -> C) `{x : Is0Bifunctor A B C F}
: @is0bifunctor_op _ _ _ F _ _ _ (@is0bifunctor_op _ _ _ F _ _ _ x) = x
:= 1.
Definition test9 A B C (F : A -> B -> C) `{x : Is1Bifunctor A B C F}
: @is1bifunctor_op _ _ _ F _ _ _ _ _ _ _ _ _ _ _ _ _
(@is1bifunctor_op _ _ _ F _ _ _ _ _ _ _ _ _ _ _ _ _ x) = x
:= 1.

(** Opposite natural transformations are *not* definitionally involutive. *)
Fail Definition test10 A `{Is01Cat A} B `{Is1Cat B} (F G : A -> B)
`{!Is0Functor F, !Is0Functor G} (n : NatTrans F G)
: nattrans_op (nattrans_op n) = n
:= 1.
Loading