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

Lemma vars_with_type_le:
forall e x tau n,
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))))) -> n <= x.