(* * Copyright (c) 2009 Robert Dockins and Aquinas Hobor. * *)
(* Coq development: using indirection theory to model types in l-calculus *)
(* Typing rules *)
Fixpoint gamma_sub (G G':etype) {struct G} : Prop :=
match G, G' with
| nil, nil => True
| x::xs, y::ys => TT |-- y >=> x /\ gamma_sub xs ys
| _, _ => False
end.
Definition prim (f:nat -> value) : expr -> expr :=
Prim (val_to_exp oo f).
(* Bounded Universal Quantification *)
Definition AllBnd (T:pred world) (X:pred world -> pred world)
:= ALL tau:pred world, !!(TT |-- tau >=> T) --> X tau.

Lemma sub_AllBnd : forall T1 T2 (X1 X2:pred world -> pred world),
TT |-- T2 >=> T1 ->
(forall x, TT |-- x >=> T2 -> TT |-- X1 x >=> X2 x) ->
TT |-- AllBnd T1 X1 >=> AllBnd T2 X2.