(*************************************************************)
(** ** Exercises                                             *)
(*************************************************************)
(** *** Recommended Exercise: [swap] properties  Prove the following properties about swapping, either explicitly (by destructing [x == y]) or automatically (using [default_simp]).  *)

(* Specifications: *)
Lemma swap_symmetric : forall t x y,
swap x y t = swap y x t.
Lemma swap_involutive : forall t x y,
swap x y (swap x y t) = t.
(** *** Challenge exercise: equivariance  Equivariance is the property that all functions and relations are preserved under swapping. (Hint: [default_simp] will be slow on some of these properties, and sometimes won't be able to do them automatically.)  *)
Lemma swap_var_equivariance : forall v x y z w,
swap_var x y (swap_var z w v) =
swap_var (swap_var x y z) (swap_var x y w) (swap_var x y v).
Lemma swap_equivariance : forall t x y z w,
swap x y (swap z w t) = swap (swap_var x y z) (swap_var x y w) (swap x y t).
Lemma notin_fv_nom_equivariance : forall x0 x y t ,
x0 `notin` fv_nom t ->
swap_var x y x0  `notin` fv_nom (swap x y t).