Categories
Math

Algebra of Color Mixing

We consider how we can do algebra with colors. In other words, if we take the set of all colors, what algebraic structures can it be endowed with? In this post, we look at the algebra of color mixing: what is the structure of the algebra that is induced by the operation of color mixing? (What properties does color mixing satisfy?)

First, let’s assign a symbol (say plus) to the operation of mixing two colors, then what standard algebraic properties does this satisfy?

We can say that it’s commutative, a + b = b + a, since the mixing of two colors doesn’t depend on the order in which we state the colors. (We implicitly assume equal “proportions” of colors, e.g. equal amounts of paint of each color.) This justifies the use of the plus symbol, keeping in mind standard notation for commutative operations.

We can also say that it’s idempotent, a + a = a, since mixing a color with itself produces the same color. In fact, we can say a “strong” version of idempotency: if c \neq a then a + c would be different from a, thus a + c = a \rightarrow c = a. Hence, we can say that a + c = a if and only if c = a.

This disproves existence of identity, since then there would need to exist a color I such that a + I = I + a = a for all a, but in that case we’d have I = a and the existence of identity requires that I isn’t dependent on a.

What about the cancellative property, a + b = a + c \rightarrow b = c? We could argue as follows: if b \neq c, then a + b would need to have some variation from a + c (even if slight), so b \neq c \rightarrow a + b \neq a + c, which is equivalent to the cancellative property.

Going further than the cancellative property, even without identity is there a way to simulate inverses? For example, can we say something like: for any a,b, there exists a unique c such that a + c = b? (Note because of commutativity that “left subtraction” versus “right subtraction” would have no distinction. Also, because of the cancellative property, existence of c automatically guarantees unique existence.) Intuitively, this seems like it should be true. Actually, hold that thought: if b is black or white (think complete black or white), then c can’t exist (unless a is black or white, respectively.) This is because mixing any color with any non-black and non-white color can’t produce complete black or white; there’d still be some “opposite hue.”

OK, let’s then phrase the question excluding these two colors. Let’s designate two constants: let B stand for black and W stand for white. We can ask: given a,b with b \neq B and b \neq W, then does there exist c such that a + c = b?

I think that to answer this it’d probably be best to start modeling colors via a standard model like RGB. I’m working on another exploration concerning color models that I will hopefully also publish soon. But independent of that post, let’s say that colors were defined via say the RGB model, where each of R, G, and B has a real number value from 0 to 1, inclusive. In other words, the set of colors is basically \lbrack 0,1\rbrack^{3}. (If we used the CMY model instead, we’d reach the same destination of the set of colors being \lbrack 0,1\rbrack^{3}. In general, let’s say for now that this is the set of colors.) Then, what would color mixing be?

Probably just average / arithmetic mean? Need to check if that satisfies the axioms above, as a sanity check.

Given that we have two constants now, we might be reminded of some of the standard properties of abstract Boolean algebras. Does color mixing satisfy some of these?

In fact, it’s looking like color mixing seems to resemble an abstract Boolean algebra more than say a group, since we have idempotency. But in an abstract Boolean algebra we have two operations, which we don’t have here. And, actually, the constants are identities for the operations in an abstract Boolean algebra, which they are not here (since an identity can’t exist.) Nevertheless, what other one-operation abstract Boolean algebra axioms does color mixing satisfy?

Judging from Wikipedia, the only abstract Boolean algebra one-binary-operation axiom that isn’t also a group/ring/field axiom is idempotency, which we already know. We already know commutativity, but it remains to consider associativity. Is it true that (a + b) + c = a + (b + c)?

Let’s say for example that c = a. Then, (a + b) + c = (a + b) + a, but I’m not sure now if we can simplify this further. Actually, hold that thought: this seems to disprove associativity. For (a + b) + a = (b + a) + a, and if associativity were true we’d have this be equal to b + (a + a) = b + a. But (b + a) + a can’t be equal to b + a, unless a = b + a, or unless a = b. Thus, associativity isn’t true. In fact, we could probably produce a “strong anti-associativity property” — we could say something like: if (a + b) + c = a + (b + c), then a = b = c. Can we prove this?

Let’s try a counterexample, say c = a + b, so (a + b) + c = a + b. Then, for this to be equal to a + (b + c), we’d need b = b + c \rightarrow b = c. Then, c = a + c \rightarrow c = a, and a = b = c. So that’s not a counterexample.

All these proofs seem anyway to follow logically from strong idempotency and the cancellative property — in fact, our demonstration of the failure of associativity is not informal but rather a theorem that follows from strong idempotency. In fact, it seems hard to informally derive a property in the relative realm of associativity given the presence of three colors (not sure how to intuit about that.) Thus, anyway this discussion wouldn’t be about a fundamental axiomatic property, but just a theorem from existing properties. Hence, we don’t need to consider this further with regards to determining the fundamental (axiomatic) properties. Let’s focus on axiomatic properties first, and then maybe later we can prove some kind of “strong anti-associativity” as a theorem.

Let’s summarize the properties we’ve collected for color mixing (presumably axiomatic, although there isn’t a proof of independence so far):

  1. Commutativity: a + b = b + a.
  2. “Strong” idempotency: a + b = a if and only if a = b. (This implies failure of associativity and identity existence.)
  3. Cancellative property: a + b = a + c \rightarrow b = c.

Actually, these properties seem to be quite constrictive — can we show that there is only one model of these axioms (up to isomorphism)? That would be incredible. In other words, if we have two algebras S,T in which these axioms are satisfied, must S,T necessarily be isomorphic (with respect to the + operation?) What about if it’s given that S,T are in bijection?

Let’s try a counterexample of \left\{ 0,1 \right\}. What would + look like?

\displaystyle 0 + 0 = 0

\displaystyle 1 + 1 = 1

What is 0 + 1? If 0 + 1 = 0, then 1 = 0; the same conclusion is true for 0 + 1 = 1. Thus, \left\{ 0,1 \right\} can’t be a model for these axioms.

What about \mathbb{Z}_{n}? Can we show that any model of these axioms must be infinite? That would be incredible and awesome.

So let’s consider what x + y must be for x,y \in \mathbb{Z}_{n} and x \neq y. Our hope is to use the Pigeonhole Principle to show that there must be some case of x + y = x, in which case we’d have a contradiction. So how many pairs (x,y) do we have with x \neq y? We can count this with complementary counting: it is n^{2} - n. So we have n^{2} - n “balls,” and n “buckets” (where the bucket is the corresponding value of x + y.) The Pigeonhole Principle tells us that some bucket must have a certain number of balls in it; the higher lower bound we can prove, the greater we have a chance of our desired result. The Pigeonhole Principle says that if we have kn + 1 balls and n buckets, some bucket must have k + 1 balls in it. In this case, we want to choose k as large as possible such that kn + 1 \leq n^{2} - n. If we set k = n - 1, then kn + 1 is barely greater than n^{2} - n, invalidating the application of Pigeonhole, but if we set k = n - 2 then we have the desired inequality. (If we write it out, that inequality is n^{2} - 2n + 1 \leq n^{2} - n, which is immediately seen to be true because the LHS is (n - 1)^{2}.) Thus, we have: there must be (n - 2) + 1 = n - 1 “balls” in a bucket. In other words, there must exist some z \in \mathbb{Z}_{n} such that there are at least n - 1 pairs of (x,y) with x \neq y and x + y = z. Is this possible? How many possible pairs of (x,y) are there with x \neq y and x \neq z,y \neq z? It’s (n - 1)^{2} - (n - 1), if we just count the pairs of different coordinates in the subset excluding z. Is this less than n - 1? Alas, it is not for general n. In fact, for which n is it less (i.e., for which n does this argument work?) We’d need (n - 1)^{2} - (n - 1) < n - 1 \rightarrow n - 1 < 2 \rightarrow n < 3. So, unfortunately, this logic particularly doesn’t scale to anything beyond \mathbb{Z}_{2}.

Can we find a model of these axioms with universe \mathbb{Z}_{3}?

\displaystyle 0 + 0 = 0

\displaystyle 0 + 1 = 2

\displaystyle 0 + 2 = 1

\displaystyle 1 + 0 = 2

So we can keep going, but the essential thing we notice here is that for (x,y) with x \neq y, we have that x + y must be the only other element. So there is one unique model for the strong idempotency property.

But so far that’s the only property we’ve been using. What about the other properties?

Well, commutativity is immediate from satisfying strong idempotency, since x + y and y + x must both be the unique element other than x and y, and thus be the same. (In fact, can we prove commutativity from strong idempotency in general? I’m not sure actually, since the “unique other element” part isn’t true beyond \mathbb{Z}_{3}.)

What about the cancellative property? Let’s say x + y = x + z in this model. Assume for the sake of contradiction that y \neq z. If x = z, then x + z = z x + y = z + y, so z = z + y, contradicting y \neq z. If x \neq z, then since x \neq z and y \neq z we’d have x + y = z, but then z = x + z \rightarrow x = z, contradiction. Thus, this model satisfies the cancellative property too! Hence, it is a model for all the axioms we listed before. In particular, this disproves our infinite-model conjecture, as well as our unique-model conjecture, since both the infinite spectrum of visible colors and this model satisfy the axioms.

It remains to continue this.

First written March 18, 2021, and revised in February 2023.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.