From QuickChick.stlc Require Import lambda.
Open Scope coq_nat.
(* Note : Some tactic automation would improve our proofs *)

(* This could be turned into a more generic lemma, but for now it works *)
Lemma vars_with_type_shift:
forall e x tau n,
In (Id (S x))
(map (fun p : type * var => Id (snd p))
(filter
(fun p : type * nat =>
proj1_sig (Sumbool.bool_of_sumbool (type_eq_dec tau (fst p))))
(combine e (seq (S n) (length e))))) <->
In (Id x)
(map (fun p : type * var => Id (snd p))
(filter
(fun p : type * nat =>
proj1_sig (Sumbool.bool_of_sumbool (type_eq_dec tau (fst p))))
(combine e (seq n (length e))))).