(* 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 Formel - Calculus of Inductive Constructions V5.10        *)
(*****************************************************************************)
(*									     *)
(*	            Relations between UA and Adjunctions      		     *)
(*									     *)
(*****************************************************************************)
(*									     *)
(*                     A. SAIBI	  May 95                  		     *)
(*									     *)
(*****************************************************************************)
Require Export CoUniversalArrow.
Require Export Adjunction.
Set Implicit Arguments.
Unset Strict Implicit.
(* extraction d'un UA et d'un coUA a` partir d'un adjonction *)
Section adj_to_ua.
Variables (C D : Category) (F : Functor D C) (G : Functor C D) (ad : Adj F G).
Variable d : D.
(* Prouver que pour tout d, <F(d),phi(Id(F(d)))> est UA de d vers G *)
Definition Unit_ob := F d.
Definition Unit_arrow := ApAphi ad (Id (F d)).
Definition Unit_arrow_diese (c : C) (f : d --> G c) := ApAphi_inv ad f.
(* qq c:C. qq f:d->Gc. f=phi<d,Fd>(Id(Fd)) o G(phi-1<d,c>(f)) (@) *)
(* remarquons que phi<d,c>(Id(Fd) o phi-1<d,c>(f)) = f *)
(* donc (@) est une instance de Adj_eq3 *)

(* Specifications: *)
Lemma Unit_UAlaw1 : UA_law1 Unit_arrow Unit_arrow_diese.
(* qq c1:C. qq f:d->Gc1. qq f':Fd->c1. *)
(* phi<d,Fd>(Id(Fd)) o G(f') = f (@) *)
(* => f'=phi-1<d,c1>(f) *)
(* appliquer phi-1<d,c1> aux 2 membres de (@) *)
(* En appliquant Adj_eq5, on obtient le re'sultat souhaite' *)
Lemma Unit_UAlaw2 : UA_law2 Unit_arrow Unit_arrow_diese.
Canonical Structure Unit' := Build_IsUA Unit_UAlaw1 Unit_UAlaw2.