(* ********************************************************************** *)
(** ** Narrowing and transitivity (3) *)

Definition transitivity_on Q := forall E S T,
  sub E S Q -> sub E Q T -> sub E S T.

(* Specifications: *)
Lemma sub_transitivity : forall Q, transitivity_on Q.
Lemma typing_weakening : forall E F G e T, typing (G ++ E) e T -> wf_env (G ++ F ++ E) -> typing (G ++ F ++ E) e T.
Lemma typing_inv_inl : forall E e1 T, typing E (exp_inl e1) T -> forall U1 U2, sub E T (typ_sum U1 U2) -> exists S1, typing E e1 S1 /\ sub E S1 U1.
Lemma typing_inv_inr : forall E e1 T, typing E (exp_inr e1) T -> forall U1 U2, sub E T (typ_sum U1 U2) -> exists S1, typing E e1 S1 /\ sub E S1 U2.
Lemma preservation : forall E e e' T, typing E e T -> red e e' -> typing E e' T.
Lemma canonical_form_abs : forall e U1 U2, value e -> typing empty e (typ_arrow U1 U2) -> exists V, exists e1, e = exp_abs V e1.
Lemma canonical_form_tabs : forall e U1 U2, value e -> typing empty e (typ_all U1 U2) -> exists V, exists e1, e = exp_tabs V e1.
Lemma canonical_form_sum : forall e T1 T2, value e -> typing empty e (typ_sum T1 T2) -> exists e1, e = exp_inl e1 \/ e = exp_inr e1.
Lemma progress : forall e T, typing empty e T -> value e \/ exists e', red e e'.