Section EagerSampling.
Variable v_firstn : forall n1 n2, Bvector (n1 + n2)%nat -> Bvector n1.
Variable v_skipn : forall n1 n2, Bvector (n1 + n2)%nat -> Bvector n2.
Hypothesis v_firstn_correct : forall n1 n2 v1 v2,  (v_firstn n1 n2 (VectorDef.append v1 v2)) = v1.
Hypothesis v_skipn_correct : forall n1 n2 v1 v2,  (v_skipn n1 n2 (VectorDef.append v1 v2)) = v2.
Hypothesis firstn_skipn_correct : forall n1 n2 (v : Bvector (n1 + n2)), v = (VectorDef.append (v_firstn n1 n2 v) (v_skipn n1 n2 v)).
intuition.
eapply det_eq_impl_dist_sem_eq;
wftac.
unfold DetSem.evalDet_equiv.
intuition.
Admitted.
Admitted.

Lemma eager_sampling : forall (A : Set)(eqd : EqDec A)(c : Comp A),
well_formed_comp c ->
forall d,
exists t (f : Bvector t -> A),
(forall a,
| evalDist (v <- {0, 1}^t; ret (f v)) a - evalDist c a | <= d) /\
(forall a,
In a (getSupport (v <- {0, 1}^t; ret (f v))) -> In a (getSupport c)).