(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)


(*****************************************************************************)
(*          Projet Coq - Calculus of Inductive Constructions V5.10           *)
(*****************************************************************************)
(*                                                                           *)
(*          Category Theory : Dual Functor                                   *)
(*                                                                           *)
(*          Amokrane Saibi May 1994                                          *)
(*                                                                           *)
(*****************************************************************************)

Require Export Dual.
Require Export Functor.

Set Implicit Arguments.
Unset Strict Implicit.

Section dfunctor_def.

Variables (A B : Category) (F : Functor A B).

Definition DFunctor_ob : Dual A -> Dual B := fun a : A => F a.

Definition DFunctor_map (b a : A) := FMap F a b.

Lemma DFunctor_comp_law : Fcomp_law (FOb:=DFunctor_ob) DFunctor_map.
Proof.
(* Goal: @Fcomp_law (Dual A) (Dual B) DFunctor_ob DFunctor_map *)
unfold Fcomp_law in |- *; simpl in |- *.
(* Goal: forall (a b c : Ob A) (f : Carrier (@DHom A a b)) (g : Carrier (@DHom A b c)), @Equal (@DHom B (DFunctor_ob a) (DFunctor_ob c)) (@Ap (@DHom A a c) (@DHom B (DFunctor_ob a) (DFunctor_ob c)) (DFunctor_map a c) (@Comp (Dual A) a b c f g)) (@Comp (Dual B) (DFunctor_ob a) (DFunctor_ob b) (DFunctor_ob c) (@Ap (@DHom A a b) (@DHom B (DFunctor_ob a) (DFunctor_ob b)) (DFunctor_map a b) f) (@Ap (@DHom A b c) (@DHom B (DFunctor_ob b) (DFunctor_ob c)) (DFunctor_map b c) g)) *)
intros a b c f g.
(* Goal: @Equal (@DHom B (DFunctor_ob a) (DFunctor_ob c)) (@Ap (@DHom A a c) (@DHom B (DFunctor_ob a) (DFunctor_ob c)) (DFunctor_map a c) (@Comp (Dual A) a b c f g)) (@Comp (Dual B) (DFunctor_ob a) (DFunctor_ob b) (DFunctor_ob c) (@Ap (@DHom A a b) (@DHom B (DFunctor_ob a) (DFunctor_ob b)) (DFunctor_map a b) f) (@Ap (@DHom A b c) (@DHom B (DFunctor_ob b) (DFunctor_ob c)) (DFunctor_map b c) g)) *)
exact (Prf_Fcomp_law F g f).  
Qed.

Lemma DFunctor_id_law : Fid_law (FOb:=DFunctor_ob) DFunctor_map.
Proof.
(* Goal: @Fid_law (Dual A) (Dual B) DFunctor_ob DFunctor_map *)
unfold Fid_law in |- *; simpl in |- *.
(* Goal: forall a : Ob A, @Equal (@DHom B (DFunctor_ob a) (DFunctor_ob a)) (@Ap (@DHom A a a) (@DHom B (DFunctor_ob a) (DFunctor_ob a)) (DFunctor_map a a) (@Id A a)) (@Id B (DFunctor_ob a)) *)
intro a; exact (Prf_Fid_law F a).     
Qed.

Canonical Structure Dfunctor :=
  Build_Functor DFunctor_comp_law DFunctor_id_law.

End dfunctor_def.






