(**  A generic wrapper type  **)

#[universes(template)]
Structure wrapped T := Wrap {unwrap : T}.(**  A generic wrapper type  **)

#[universes(template)]
Structure wrapped T := Wrap {unwrap : T}.(**  A generic wrapper type  **)

#[universes(template)]
Structure wrapped T := Wrap {unwrap : T}.Canonical wrap T x := @Wrap T x.(**  Notations for argument transpose  **)
Notation "f ^~ y" := (fun x => f x y) : function_scope.Notation "@^~ x" := (fun f => f x) : function_scope.(**
 Definitions and notation for explicit functions with simplification,
 i.e., which simpl and /= beta expand (this is complementary to nosimpl).  **)

#[universes(template)]
Variant simpl_fun (aT rT : Type) := SimplFun of aT -> rT.(**
 Definitions and notation for explicit functions with simplification,
 i.e., which simpl and /= beta expand (this is complementary to nosimpl).  **)

#[universes(template)]
Variant simpl_fun (aT rT : Type) := SimplFun of aT -> rT.Definition fun_of_simpl (f : simpl_fun aT rT) := fun x => let: SimplFun lam := f in lam x.Notation "[ 'fun' : T => E ]" := (SimplFun (fun _ : T => E)) : function_scope.Notation "[ 'fun' x => E ]" := (SimplFun (fun x => E)) : function_scope.Notation "[ 'fun' x y => E ]" := (fun x => [fun y => E]) : function_scope.Notation "[ 'fun' x : T => E ]" := (SimplFun (fun x : T => E))
  (only parsing) : function_scope.Notation "[ 'fun' x y : T => E ]" := (fun x : T => [fun y : T => E])
  (only parsing) : function_scope.Notation "[ 'fun' ( x : T ) y => E ]" := (fun x : T => [fun y => E])
  (only parsing) : function_scope.Notation "[ 'fun' x ( y : T ) => E ]" := (fun x => [fun y : T => E])
  (only parsing) : function_scope.Notation "[ 'fun' ( x : T ) ( y : U ) => E ]" := (fun x : T => [fun y : U => E])
  (only parsing) : function_scope.(**  For delta functions in eqtype.v.  **)
Definition SimplFunDelta aT rT (f : aT -> aT -> rT) := [fun z => f z z].Definition eqfun (f g : B -> A) : Prop := forall x, f x = g x.Definition eqrel (r s : C -> B -> A) : Prop := forall x y, r x y = s x y.

Lemma ftrans f g h : eqfun f g -> eqfun g h -> eqfun f h.