Functions over difference sets

116 Views Asked by At

First of all, I already posted my question on TCS SE (here) but with little resonance, thus I'm trying another community. Secondly, I'm not a mathematician so would appreciate answers in plain English (which could obviously lead to more formal explanation :-) and also please accept my apologies if the question is constructed in an awkward way.

The question (part 1):

Let's assume we have two finite sets of random real numbers $I_1 = \{ 0, 1, 2, 3 \}$ and $I_2 = \{ 0, 1, 2, 3, 4, 5 \}$, and for the sake of simplicity of the question let also assume that $I_1 \subset I_2$. We can calculate difference:

$I_{2-1} = \{ 4, 5 \}$

I'm looking for a set/function theory which would help me understand why some functions can use the difference set to calculate the new value, whereas others cannot.

For example, let's consider $sum$:

$\begin{align} sum(I_1) & = 6 \\ sum(I_{2-1}) & = 9 \\ 15 = sum(I_2) & \equiv sum(sum(I_1), sum(I_{2-1})) = 15 \end{align}$

Obviously, that's true iff $I_{1-2} = \varnothing$ but let's hope that the theory can address the other case, too.

Yet, no matter what, this approach does not work for $mean$:

$\begin{align} mean(I_1) & = 1.5 \\ mean(I_{1-2}) & = 0 \\ mean(I_{2-1}) & = 4.5 \\ 2.5 = mean(I_2) & \neq mean(mean(I_1), mean(I_{2-1})) = 3 \end{align} $

And, interestingly, for some other functions like $min$ or $max$ it works but only sometimes: $\begin{align} min(I_1) & = 0 \\ min(I_{2-1}) & = 0 \\ 0 = min(I_2) & \equiv min(min(I_1), min(I_{2-1})) = 0 \end{align}$

which is true iff $I_{1-2} = \varnothing$ or $min(I_{1-2}) > min(I_1)$, e.g. consider $I_3 = \{ 2, 3, 4, 5, 6 \}$.

Any references to books, papers, lectures, etc. would be greatly appreciated.

The question (part 2):

Let us consider two sets of pairs $J_1 = \{(A, 1), (B, 2), (C, 3), (A, 4), (C, 5)\}$ and $J_2 = \{(A, 2), (B, 2), (C, 3), (C, 7)\}$

From these we can calculate two difference sets:

$\begin{align} J_{1-2} & = \{(A, 1), (A, 4), (C, 5) \} \\ J_{2-1} & = \{(A, 2), (C, 7) \} \end{align}$

Now, let's consider function $filter(Set, Key)$ which picks out pairs with the given Key:

$\begin{align} filter(J_1, A) & = \{ (A, 1), (A, 4) \} \\ filter(J_2, A) & = \{ (A, 2) \} \end{align}$

why this works:

$filter(J_2, A) \equiv filter(J_1, A) \cup filter(J_{2-1}, A) \backslash filter(J_{1-2}, A)$

but it does not for function like $merge(Set, Key)$ which combines pairs like $(Key_1+Key_2, Value_1+Value_2)$:

$\begin{align} merge(J_1, A) &= \{ (AB, 3), (AC, 4), (AA, 5), (AC, 6), (AB, 6), (AC, 7), (AC, 9) \} \\ merge(J_2, A) &= \{ (AB, 4), (AC, 5), (AC, 9) \} \end{align}$

as:

$merge(J_2, A) \neq merge(J_1, A) \cup merge(J_{2-1}, A) \backslash merge(J_{1-2}, A)$

To reiterate the question: why some functions can work on a difference between input sets whereas others cannot? Are there any formal criteria which a function must adhere to? Is there any theory behind this?

1

There are 1 best solutions below

2
On BEST ANSWER

Giving it a second go. This question can in some way be translated into abstract algebra where I work. Let $\mathbb{N}_n=\{0,1,2,3,\ldots,n\}$, next consider $S=\mathcal{P}(\mathbb{N}_n)$, that is the powerset of our $\mathbb{N}_n$ which is the set of all subsets (including the empty set). From this we can form what is called a semigroup under the operation of union, that is $(S,\cup)$. Your functions are functions from $(S,\cup)$ to $\mathbb{Q}_{0\le}$ and your questions then becomes "Why are not all of them homomorphisms", that is if your mean function is $f$ then why isn't $f(A\cup B)=f(A)+f(B)$.

As I explained before it is about how the functions are defined. For two sets $A$ and $B$, there exists $|B|^{|A|}$ possible functions from $A$ to $B$. Even for small sets this number gets unweildingly large. If both cardinalities are $5$ then the number of functions is $3125$. However as we are dealing with the powerset so that means the cardinality of $\mathcal{P}(\mathbb{N}_n)=2^n$ which makes the amount of functions skyrocket even further. However not all of these possibilities will pay any respect to an operation we apply to the corresponding set, those are a tiny subset of all functions in $B^A$. That is why distinctions of functions are made, we call them homomorphisms when they do respect imposed operations on our sets, a function is continuous if the pre-image of an open set is open, and so on. The maount of functions is simply far too large (even for small set) for all of them to respect or have certain properties beyond being a function.

Ultimately it boils down to how they are defined in their mapping.