I'm trying to implement conditional probability distribution when the events of two RVs are sets. If I try to extrapolate concepts from real or categorical variables to sets things become confusing for me. In the usual scenario, for some pair of discrete RVs, $X,Y$, we can compute the conditional probability of two "punctual" events by using the Bayes theorem: $$P(Y=y|X=x)=\frac{P(X=x|Y=y)P(Y=y)}{\sum_{y'\in\mathcal{Y}}P(X=x|Y=y')P(Y=y')}=\frac{f(x,y)}{\sum_{y'\in\mathcal{Y}}f(x,y')},$$ where $f(x,y)=\sum_{(x',y')\in (\mathcal{X},\mathcal{Y})}\chi(x'=x,y'=y)$ is an accumulator function giving the total number of times the specific joint event $x,y$ is observed in the sample space (i.e. the indicator function $\chi(x'=x,y'=y)$ equals one when $x'=x,y'=y$ holds). I'd like to compute such probability when events drawn by $X,Y$ are sets $\boldsymbol{x},\boldsymbol{y}$, respectively. So, how to define the corresponding $f(\boldsymbol{x},\boldsymbol{y})$?
I've tried with two main options: $$(1)\hspace{10mm}f(\boldsymbol{x},\boldsymbol{y})=\sum_{(\boldsymbol{x}',\boldsymbol{y}')\in(\mathcal{X},\mathcal{Y})}|(\boldsymbol{x}\cap\boldsymbol{y})\cap(\boldsymbol{x}'\cap\boldsymbol{y}')|,$$ and $$(2)\hspace{10mm}f(\boldsymbol{x},\boldsymbol{y})=\sum_{(\boldsymbol{x}',\boldsymbol{y}')\in(\mathcal{X},\mathcal{Y})}|(\boldsymbol{x}\cap\boldsymbol{y})\cap \boldsymbol{x}'\cup(\boldsymbol{x}\cap\boldsymbol{y})\cap \boldsymbol{y}'|,$$
On the one hand, the motivation behind $(1)$ is that $\boldsymbol{x}\cap\boldsymbol{y}$ provides a measure of how the attributes of both sets should be observed jointly (such as any intersection event). In turn intersecting this intersection event against other intersection events $\boldsymbol{x}'\cap\boldsymbol{y}'$ should provide the measure of how much the joint attributes are observed through the sample space. On the other hand, the motivation behind $(2)$ is that in order to compute $f(\boldsymbol{x},\boldsymbol{y})$ we need to look for $\boldsymbol{x}\cap\boldsymbol{y}$'s attributes in each event of the sample space, without building new events.
However, I'm not sure which one of these analogies is correct (or none at all) with respect to the usual notion of observing the joint event in a sample space. Please, some one can help me to clarify/fix/prove this?
Thank you in advance