# Removing an element from an associative product

For a binary associative operator $$\circ$$ on a set S, I'm finding a way to "erase" an element in S from an associative product of elements in S.

For example: $$f(a_{1} \circ a_{2} \circ \cdots \circ a_{n}, a_{i}) = a_{1} \circ \cdots \circ a_{i-1} \circ a_{i+1} \circ \cdots \circ a_{n}$$

(for $$f(a_{1} \circ \cdots \circ a_{n}, K)$$, let's say it is guaranteed that $$K \in \{a_{1}, \cdots, a_{n}\}$$)

I'm a programmer so I don't need so-unrealistic abstract mathematical objects, but I want to cover at least the following cases with a single general rule (which should be inferred from only $$\circ$$ and S):

• integer/real/complex valued scalars and addition/multiplication
• sets and set intersection/union operation
• strings and concatenation operation
• real or complex-valued matrices and matrix multiplication operation

Is there a way to do so?

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Jul 14, 2022 at 9:33
• In lots of cases such "function" $f$ will not be well-defined. For instance $f(A\cup B,A)=B$ but also $f(A\cup B,A)=f(A\cup(B-A),A)=B-A$. Jul 14, 2022 at 9:45

You can only do so generally when you know much more about the operation, for example if it is also commutative and $$a_i$$ has an inverse, then

$$a_1\circ\ldots\circ \,a_{i-1}\circ a_{i+1}\circ\ldots\circ a_n = (a_1\circ\ldots\circ a_n) \circ a_i^{-1}.$$

That covers your first bullet point positively.

For the second and third bullet point, it should be easy to see that it is impossible generally. For an intersection of sets, if you know the intersection of all sets and the specific set $$a_i$$, you have no way of knowing what points the intersection of all the other sets might contain, because

$$a_1\circ\ldots\circ a_n \subseteq a_i$$

There is no info available about any points outside of $$a_i$$, which might be part of $$a_1\circ\ldots\circ \,a_{i-1}\circ a_{i+1}\circ\ldots\circ a_n$$.

For string concatenation, if you know that

$$a_1\circ\ldots\circ a_n=\text{"abc"}, a_i=\text{"b"},$$

then you can conclude that $$a_1\circ\ldots\circ \,a_{i-1}\circ a_{i+1}\circ\ldots\circ a_n=\text{"ac"}.$$

But if

$$a_1\circ\ldots\circ a_n=\text{"abcabc"}, a_i=\text{"b"},$$

then there are two possibilities, so there are multiple possible solutions:

$$a_1\circ\ldots\circ \,a_{i-1}\circ a_{i+1}\circ\ldots\circ a_n=\text{"abcac" or "acabc"} .$$

For matrix multiplication, your fourth bullet point, the answer is I think also negative, even if you have a non-singular $$a_i$$, but I can't find a proof either way, so this is just a conjecture.

• What if all $a_{i}$s are distinct? Jul 14, 2022 at 10:00
• That doesn't help (much). For example, the string concatenation example with 2 possible solutions still has them both when $n$ isn't too high (if $n$ gets large, then there have to be empty strings among the $a_i$). I guess you have a specific problem and hoped to find a general solution, but if the operation isn't special (like addition/multiplaction of numbers), it's likely not possible in the majority of cases. Jul 14, 2022 at 10:05