(* * Copyright (c) 2009-2010, Andrew Appel, Robert Dockins and Aquinas Hobor. * *)
(** This library reexports portions of the Coq standard libraries used throughtout the proof.  It also defines some convenience tactics. *)
Require Export VST.msl.Extensionality.
Require Export Coq.Lists.List.
Require Export Coq.Bool.Bool.
Require Export Coq.Relations.Relations.
Require Export Omega.
Definition compose (A B C:Type) (g:B -> C) (f:A -> B) := fun x => g (f x).
Arguments compose [A B C] _ _ _.
Infix "oo" := compose (at level 54, right associativity).

(* Specifications: *)
Lemma compose_assoc (A B C D:Type) (h:C->D) (g:B->C) (f:A->B) :
(h oo g) oo f = h oo g oo f.
Lemma compose_rewr {A B C} (f : B -> C) (g : A -> B) x : f (g x) = (f oo g) x.
Definition id (A:Type) := fun x:A => x.
Lemma id_unit1 : forall A B (f:A->B), f oo id A = f.
Lemma id_unit2 : forall A B (f:A->B), id B oo f = f.
Record bijection (A B:Type) : Type := Bijection {
bij_f: A -> B;
bij_g: B -> A;
bij_fg: forall x, bij_f (bij_g x) = x;
bij_gf: forall x, bij_g (bij_f x) = x
}.
Lemma bij_f_inj {A} {B} (bij: bijection A B):
forall x y, bij_f _ _ bij x = bij_f _ _ bij y -> x=y.
Lemma bij_g_inj {A} {B} (bij: bijection A B):
forall x y, bij_g _ _ bij x = bij_g _ _ bij y -> x=y.
Lemma bij_fg_id: forall {A B} (f: bijection A B),
(bij_f _ _ f) oo (bij_g _ _ f) = id _.
Lemma bij_gf_id: forall {A B} (f: bijection A B),
(bij_g _ _ f) oo (bij_f _ _ f) = id _.