NatTrans.NatIso.
Local Open Scope isomorphism_scope.
Local Open Scope morphism_scope.
Local Open Scope object_scope.
(** If two categories are isomorphic, then so are their duals. *)
Section Opposite_Cat_Iso.
Context {C D : Category} (I : C ≃≃ D ::> Cat).
Program Definition Opposite_Cat_Iso :
(C^op)%category ≃≃ (D^op)%category ::> Cat
:=
{|
iso_morphism := ((iso_morphism I)^op)%functor;
inverse_morphism := ((inverse_morphism I)^op)%functor
|}.
Next Obligation.
change (I ⁻¹ ^op ∘ (iso_morphism I) ^op)%functor
with (((inverse_morphism I) ∘ (iso_morphism I))^op)%functor.
cbn_rewrite (left_inverse I).
trivial.
Qed.
Next Obligation.
change ((iso_morphism I) ^op ∘ I ⁻¹ ^op)%functor
with (((iso_morphism I) ∘ (inverse_morphism I))^op)%functor.
cbn_rewrite (right_inverse I).
trivial.
Qed.
End Opposite_Cat_Iso.
(** Conversion from a category to another isomorphic category. *)
Section Cat_IConv.
Context {C D : Category} (I : C ≃≃ D ::> Cat).
(** Object conversion through an isomorphism and its inverse isomorphism gives back the same object. *)
Definition Cat_Iso_Obj_conv (c : C) :
c = (((inverse_morphism I) _o) (((iso_morphism I) _o) c))%object.
(** Homomorphism types remain the smae after object conversion through an isomorphism and its inverse isomorphism. *)
Definition Cat_Iso_Hom_conv (c c' : C) :
((((inverse_morphism I) _o) (((iso_morphism I) _o) c))
–≻
(((inverse_morphism I) _o) (((iso_morphism I) _o) c')))%morphism
= (c –≻ c').
(** Type conversion to the original hom type after conversion with the inverse of an isomorphism and that isomorphism. *)
Definition Cat_Iso_conv {c c' : C} (h : c –≻ c') :
(((inverse_morphism I) _o) (((iso_morphism I) _o) c))
–≻ (((inverse_morphism I) _o) (((iso_morphism I) _o) c'))
:=
match eq_sym (Cat_Iso_Hom_conv c c') in _ = Y return Y with
eq_refl => h
end.

(** Conversion once through an isomrphism and its inverse and once through its inverse and it gives back the same arrow as we strated with. *)
Theorem Cat_Iso_conv_inv_Cat_Iso_conv {c c' : C} (h : c –≻ c')
: Cat_Iso_conv_inv (Cat_Iso_conv h) = h.