(* ---------------------------------------------------------- *)

Ltac use_binder f x :=
  pick fresh x and apply f;
  unfold open_tm_wrt_tm; simpl; simpl_env; eauto;
  match goal with
    [ |- Typing ?ctx ?a ?A ] =>
    assert (Ctx ctx); [econstructor; eauto|idtac]
  end.

(* Specifications: *)
Lemma E_App_intro : forall (G : context) (b : tm) (a B A C : tm), Typing G b (a_Pi Rel A B) -> (open_tm_wrt_tm B a) = C -> Typing G a A -> Typing G (a_App b Rel a) C.
Lemma E_IApp_intro : forall (G : context) (b : tm) (a B A C : tm), Typing G b (a_Pi Irrel A B) -> (open_tm_wrt_tm B a) = C -> Typing G a A -> Typing G (a_App b Irrel a_Bullet) C.
Lemma FixTy_erase : Typing nil (erase_tm FixTy) a_Star.
Lemma FixDef_FixTy_erase : Typing nil (erase_tm FixDef) (erase_tm FixTy).
Lemma Sig_toplevel: Sig toplevel.