(* --------------------------------------------------------- *)
(* Invert an "interesting" assumption in the typing context *)
Ltac ann_invert_clear :=
match goal with
| H : AnnTyping _ a_Star _ |- _ => inversion H; subst; clear H
| H : AnnTyping _ (_ _) _ |- _ =>  inversion H; subst; clear H
| H : AnnPropWff _ _ |- _ => inversion H; subst; clear H
| H : AnnIso _ _ (_ _) _ _ |- _ => inversion H; subst; clear H
| H : AnnDefEq _ _ (_ _) _ _  |- _ => inversion H; subst; clear H
| H : AnnCtx ([(_,_)] ++ _) |- _ => inversion H; subst; clear H
| H : AnnCtx (_ :: _) |- _ => inversion H; subst; clear H
end.
(* ----------------------------- *)
(* By default, swaps apply to tm variables. *)

Lemma lc_swap : forall x x0 a,
x `notin` fv_tm_tm_tm a ->
lc_tm (open_tm_wrt_tm a (a_Var_f x)) ->
lc_tm (open_tm_wrt_tm a (a_Var_f x0)).