(* 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        *)
(*****************************************************************************)
(*									     *)
(*	   Limits  cones(c,F) iso C(c,limF)                		     *)
(*									     *)
(*****************************************************************************)
(*									     *)
(*                     A. SAIBI	  May 95                  		     *)
(*									     *)
(*****************************************************************************)

Require Export SET.
Require Export Limit.
Require Export Map0_dup1.

Set Implicit Arguments.
Unset Strict Implicit.

(* cones(c,F) iso C(c,limF) *)


Section iso_cone.

Variables (J C : Category) (F : Functor J C) (l : Limit F) (c : C).

(* Map cones(c,F) vers C(c,limF) *)

Definition PhiCone_fun (tau : Cones c F) := Lim_diese l tau.

Lemma PhiCone_map_law : Map_law''0 PhiCone_fun.
Proof.
(* Goal: @Map_law''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_fun *)
unfold Map_law''0, PhiCone_fun in |- *; simpl in |- *.
(* Goal: forall (x y : @NT J C (@Const J C c) F) (_ : @Equal_NT J C (@Const J C c) F x y), @Equal (@Hom C c (@Lim J C F l)) (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c x) (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c y) *)
intros T1 T2 H.
(* Goal: @Equal (@Hom C c (@Lim J C F l)) (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c T1) (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c T2) *)
apply (Ldiese_map l); trivial.
Qed.

Canonical Structure PhiCone_map := Build_Map''0 PhiCone_map_law.

(* Map C(c,limF) vers cones(c,F) *)

 Section phicone_1_fun_def.

 Variable f : c --> Lim l.

 Definition PhiCone_1_fun_tau (i : J) := f o Limiting_cone l i.

 Lemma PhiCone_1_fun_cone_law : Cone_law PhiCone_1_fun_tau.
 Proof.
(* Goal: @Cone_law J C c F PhiCone_1_fun_tau *)
 unfold Cone_law, PhiCone_1_fun_tau in |- *; simpl in |- *.
(* Goal: forall (i j : Ob J) (g : Carrier (@Hom J i j)), @Equal (@Hom C c (@FOb J C F j)) (@Comp C c (@Lim J C F l) (@FOb J C F j) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) j)) (@Comp C c (@FOb J C F i) (@FOb J C F j) (@Comp C c (@Lim J C F l) (@FOb J C F i) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (@FMor J C F i j g)) *)
 intros i j g.
(* Goal: @Equal (@Hom C c (@FOb J C F j)) (@Comp C c (@Lim J C F l) (@FOb J C F j) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) j)) (@Comp C c (@FOb J C F i) (@FOb J C F j) (@Comp C c (@Lim J C F l) (@FOb J C F i) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (@FMor J C F i j g)) *)
 (* *) apply Trans with (f o Limiting_cone l i o FMor F g).
(* Goal: @Equal (@Hom C c (@FOb J C F j)) (@Comp C c (@Lim J C F l) (@FOb J C F j) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) j)) (@Comp C c (@Lim J C F l) (@FOb J C F j) f (@Comp C (@FOb J C (@Const J C (@Lim J C F l)) i) (@FOb J C F i) (@FOb J C F j) (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i) (@FMor J C F i j g))) *)
(* Goal: @Equal (@Hom C c (@FOb J C F j)) (@Comp C c (@Lim J C F l) (@FOb J C F j) f (@Comp C (@FOb J C (@Const J C (@Lim J C F l)) i) (@FOb J C F i) (@FOb J C F j) (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i) (@FMor J C F i j g))) (@Comp C c (@FOb J C F i) (@FOb J C F j) (@Comp C c (@Lim J C F l) (@FOb J C F i) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (@FMor J C F i j g)) *)
 apply Comp_l; apply (EqC (Limiting_cone l) g).
(* Goal: @Equal (@Hom C c (@FOb J C F j)) (@Comp C c (@Lim J C F l) (@FOb J C F j) f (@Comp C (@FOb J C (@Const J C (@Lim J C F l)) i) (@FOb J C F i) (@FOb J C F j) (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i) (@FMor J C F i j g))) (@Comp C c (@FOb J C F i) (@FOb J C F j) (@Comp C c (@Lim J C F l) (@FOb J C F i) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (@FMor J C F i j g)) *)
 apply Ass.
 Qed.

 Canonical Structure PhiCone_1_fun : Cones c F := PhiCone_1_fun_cone_law.

 End phicone_1_fun_def. 

Lemma PhiCone_1_map_law : Map_law0'' PhiCone_1_fun.
Proof.
(* Goal: @Map_law0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_fun *)
unfold Map_law0'', PhiCone_1_fun in |- *. 
(* Goal: forall (x y : Carrier (@Hom C c (@Lim J C F l))) (_ : @Equal (@Hom C c (@Lim J C F l)) x y), @Equal'' (@Cones J C c F) (@Build_NT J C (@Const J C c) F (PhiCone_1_fun_tau x) (@Prf_Cone_nt_law J C c F (PhiCone_1_fun_tau x) (@PhiCone_1_fun_cone_law x))) (@Build_NT J C (@Const J C c) F (PhiCone_1_fun_tau y) (@Prf_Cone_nt_law J C c F (PhiCone_1_fun_tau y) (@PhiCone_1_fun_cone_law y))) *)
intros f g H; simpl in |- *.
(* Goal: @Equal_NT J C (@Const J C c) F (@Build_NT J C (@Const J C c) F (PhiCone_1_fun_tau f) (@Prf_Cone_nt_law J C c F (PhiCone_1_fun_tau f) (@PhiCone_1_fun_cone_law f))) (@Build_NT J C (@Const J C c) F (PhiCone_1_fun_tau g) (@Prf_Cone_nt_law J C c F (PhiCone_1_fun_tau g) (@PhiCone_1_fun_cone_law g))) *)
unfold Equal_NT in |- *; simpl in |- *.
(* Goal: forall a : Ob J, @Equal (@Hom C (@Const_ob J C c a) (@FOb J C F a)) (PhiCone_1_fun_tau f a) (PhiCone_1_fun_tau g a) *)
unfold PhiCone_1_fun_tau in |- *; intro i.
(* Goal: @Equal (@Hom C (@Const_ob J C c i) (@FOb J C F i)) (@Comp C c (@Lim J C F l) (@FOb J C F i) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (@Comp C c (@Lim J C F l) (@FOb J C F i) g (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) *)
apply Comp_r; trivial.
Qed.

Canonical Structure PhiCone_1_map : Map0'' (c --> Lim l) (Cones c F) :=
  PhiCone_1_map_law.

(* phi et PhiCone_1 sont iso *)

Lemma Lim_areIso : AreBij0'' PhiCone_1_map PhiCone_map.
Proof.
(* Goal: @AreBij0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map PhiCone_map *)
unfold AreBij0'' in |- *; split.
(* Goal: forall a : Carrier (@Hom C c (@Lim J C F l)), @Equal (@Hom C c (@Lim J C F l)) (@Ap''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_map (@Ap0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map a)) a *)
(* Goal: forall b : Carrier'' (@Cones J C c F), @Equal'' (@Cones J C c F) (@Ap0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map (@Ap''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_map b)) b *)
intro f; simpl in |- *; unfold PhiCone_fun in |- *.
(* Goal: @Equal (@Hom C c (@Lim J C F l)) (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c (PhiCone_1_fun f)) f *)
(* Goal: forall b : Carrier'' (@Cones J C c F), @Equal'' (@Cones J C c F) (@Ap0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map (@Ap''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_map b)) b *)
apply Sym; apply (Prf_limit2 l).
(* Goal: @Limit_eq J C F (@Lim J C F l) (@Limiting_cone J C F l) c (PhiCone_1_fun f) f *)
(* Goal: forall b : Carrier'' (@Cones J C c F), @Equal'' (@Cones J C c F) (@Ap0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map (@Ap''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_map b)) b *)
unfold Limit_eq, PhiCone_1_fun in |- *; simpl in |- *.
(* Goal: forall i : Ob J, @Equal (@Hom C c (@FOb J C F i)) (@Comp C c (@Lim J C F l) (@FOb J C F i) f (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (PhiCone_1_fun_tau f i) *)
(* Goal: forall b : Carrier'' (@Cones J C c F), @Equal'' (@Cones J C c F) (@Ap0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map (@Ap''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_map b)) b *)
intro i; apply Refl.
(* Goal: forall b : Carrier'' (@Cones J C c F), @Equal'' (@Cones J C c F) (@Ap0'' (@Hom C c (@Lim J C F l)) (@Cones J C c F) PhiCone_1_map (@Ap''0 (@Cones J C c F) (@Hom C c (@Lim J C F l)) PhiCone_map b)) b *)
intro tau; simpl in |- *; unfold Equal_NT in |- *.
(* Goal: forall a : Ob J, @Equal (@Hom C (@FOb J C (@Const J C c) a) (@FOb J C F a)) (@ApNT J C (@Const J C c) F (PhiCone_1_fun (PhiCone_fun tau)) a) (@ApNT J C (@Const J C c) F tau a) *)
unfold PhiCone_1_fun, PhiCone_fun in |- *; simpl in |- *.
(* Goal: forall a : Ob J, @Equal (@Hom C (@Const_ob J C c a) (@FOb J C F a)) (PhiCone_1_fun_tau (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c tau) a) (@ApNT J C (@Const J C c) F tau a) *)
intro i; unfold PhiCone_1_fun_tau in |- *.
(* Goal: @Equal (@Hom C (@Const_ob J C c i) (@FOb J C F i)) (@Comp C c (@Lim J C F l) (@FOb J C F i) (@Lim_diese J C F (@Lim J C F l) (@Limiting_cone J C F l) (@Prf_Islimit J C F l) c tau) (@ApNT J C (@Const J C (@Lim J C F l)) F (@Limiting_cone J C F l) i)) (@ApNT J C (@Const J C c) F tau i) *)
apply (Prf_limit1 l tau i).
Qed.

End iso_cone.

