Consider a binary operator \$*\$ that operates on a set \$S\$. For simplicity's sake, we'll assume that \$*\$ is closed, meaning that its inputs and outputs are always members of \$S\$. This means that \$(*, S)\$ is a magma
Let's define some basic terms describing the properties of \$*\$. We can say that \$*\$ can have any of these properties, if they hold for all \$a,b,c \in S\$:
- Commutative: \$a*b \equiv b*a\$
- Associative: \$(a*b)*c \equiv a*(b*c)\$
- Distributive: \$a*(b+c) \equiv (a*b)+(a*c)\$, for some binary operator \$+\$ on \$S\$
We can also define 3 related properties, for a unary operation \$-\$ on \$S\$:
- Anti-commutative: \$a*b \equiv -(b*a)\$
- Anti-associative: \$(a*b)*c \equiv -(a*(b*c))\$
- Anti-distributive: \$a*(b+c) \equiv -((a*b)+(a*c))\$
Finally, we define 3 more, that only describe \$*\$ if the complete statement is true for \$a,b,c \in S\$:
- Non-commutative: There exists \$a, b\$ such that \$a*b \not\equiv b*a\$ and \$a*b \not\equiv -(b*a)\$
- Non-associative: There exists \$a, b, c\$ such that \$(a*b)*c \not\equiv a*(b*c)\$ and \$(a*b)*c \not\equiv -(a*(b*c))\$
- Non-distributive: These exists \$a,b,c\$ such that \$a*(b+c) \not\equiv (a*b)+(a*c)\$ and \$a*(b+c) \not\equiv -((a*b)+(a*c))\$
We now have 9 distinct properties a binary operator can have: commutativity, non-commutativity, anti-commutativity, associativity, non-associativity, anti-associativity, distributivity, non-distributivity and anti-distributivity.
This does require two operators (\$-\$ and \$+\$) to be defined on \$S\$ as well. For this challenge we'll use standard integer negation and addition for these two, and will be using \$S = \mathbb Z\$.
Obviously, any given binary operator can only meet a maximum of 3 of these 9 properties, as it cannot be e.g. both non-associative and anti-associative. However, it is possible to create a function that is, for example, neither commutative, anti-commutative or non-commutative, by creating an operator \$*\$ such that \$a*b = b*a\$ for some inputs and \$a*b = -b*a\$ for others. Therefore, it is possible to create an operator that meets fewer than 3 of these properties.
Your task is to write 9 programs (either full programs or functions. You may "mix and match" if you wish).
Each of these 9 programs will:
take two integers, in any reasonable format and method
output one integer, in the same format as the input and in any reasonable method
be a surjection \$\mathbb Z^2 \to \mathbb Z\$ (takes two integers as input and outputs one integer). This means that for any distinct output, there is at least one input that yields that output
uniquely exhibit one of the 9 properties described above.
This means that, of your nine programs, one should be commutative, one associative, one distributive over addition, one anti-commutative, one anti-associative, one anti-distributive, one non-commutative, one non-associative and one non-distributive.
Your programs must each exhibit exactly 1 of these 9 behaviours, and violate the other 8. For example, multiplication would be banned, as it is commutative, associative and distributive. However, this also means that 6 of your programs must not be e.g. any of commutative, anti-commutative or non-commutative. How you reconcile this is up to you.
This is code-golf; the combined lengths of all 9 of your programs is your score, and you should aim to minimise this.
Additionally, you should include some form of proof that your programs do indeed have the required properties and do not satisfy the other properties. Answers without these are not considered valid.
Alternatively, your answer may be in the form of a proof of impossibility. If this is the case, you must prove that there are no such operators that are valid answers to this. You do not have to show that all 9 properties are impossible to exhibit - only one - in this proof. In this case, there can only be one answer, which, by default, will be the winner.