Elegant notation for partial intersections in cartesian products?

22 Views Asked by At

Let

  1. $A⊆X×Y$
  2. $A$ be a multi-set over $X×Y$
  3. $A∈⋃_{n∈ℕ}(X×Y)^n$

Anyway, $A$ is a collection of tuples $(x, y)$, potentially with duplicates in cases (2) and (3). Given $F⊆X$, I am looking for an elegant notation for

  1. The set $B≔\{x∈F∣∃y∈Y:(x, y)∈A\}$, i.e. the intersection on the $x$-component.
  2. The multiset $B$ over $X$ obtained by selecting the $x$-component from all items in $A$ whose $x$-component is in $F$.
  3. The element $B∈⋃_{n∈ℕ}X^n$ obtained by selecting the $x$-component from all rows of $A$ whose $x$-component is in $F$.

In all 3 cases, given a function $f:X→Y$, I want to express the set/multiset/array obtained by broadcasting $f$ over $B$.

1

There are 1 best solutions below

0
On

This seems a lot like you may wanna use relational algebra as your "natural language" to describe your sets:

  1. this is the intersection between B and the projection of A onto the first component so maybe $B = F \cap \Pi_X(A)$
  2. You already formulated this as a selection, so it's something like $B = \sigma_{X \in F}(A)$
  3. I'd probably also use a projection here; something like $B = \Pi_{\bigcup_{n \in \mathbb{N}} X^n}(A)$

For cases (1) and (2) your broadcasting should just be the image of the function so $f(B)$; for (3) it's a bit tricky and requires some more thinking: for broadcasting of $f$ to a function $X^n \to Y$ I'd maybe use something like $f^{\times n}$ (mirroring the tensor power notation) but since your domain is quite "ugly" this doesn't translate all that well. I'd maybe use notation referring to the categorical coproduct here (without knowing any category theory so please correct me if this absolutely butchers the concept) and use $\coprod_{n \in \mathbb{N}} f^{\times n}$ for your broadcasted function. This also emphasized that the union of your $(X \times Y)^n$ is really a disjoint union.

All that said: you might also be better off by either

  • just writing what you mean in prose and using $f(B)$ in all cases; or drawing some commutative diagrams for your functions. It's a little abuse of notation but I don't think it's entirely unwarranted here.
  • considering all your cases as arrays (potentially with two additional functions that map your arrays into sets / multisets) and describing your functions on elements of those
  • or by switching to a more categorical language; I think your function broadcasting can be described way easier and more naturally using lifts and / or (applicative) functors. Maybe this can give your some further inspiration https://en.wikipedia.org/wiki/Applicative_functor