Formal Notation of Functions Say I have a function $f$ with the following signature: $f: S \times S \to S$ and I wanted to formally represent that this function was idempotent and reflexive. How would i do right this? 
For example I wanted to say the function was commutative I could do something like:
$\forall x,y : S | x f y = y f x $ and for associativity i could say $\forall x,y,z : S| x f (y f z) = (x f y) f z$.
How would I do the same for idempotence and reflexivity?
 A: I don't know how you define "reflexivity" for a binary function. Reflexivity is defined for binary relations. All functions are relations, but they are relations of one higher degree - a unary function $S\to S$ can be represented as a binary relation - a subset of $S\times S$. A binary function $S\times S\to S$ can be represented as a ternary relation - a subset of $S\times S\times S$. As far as I've ever heard, there is no definition of a "reflexive" ternary relationships. 
Given a binary function $f:S\times S\to S$, we say $a\in S$ is an idempotent under $f$ if $afa = a$. The binary function is called idempotent if every $a\in S$ is an idempotent under $f$.  
The prototypical idempotent binary operations is $\max$ and $\min$ in a linear order. Let $(S,\leq)$ be a linear order and define $m(a,b)=a\text{ if } a\leq b \text{ and } b \text{ otherwise}$. Then $m$ is an idempotent binary operation that is associative and commutative. Similar if $M(a,b)$ is defined as the maximum.
Related idempotent operators are the $\gcd$ and $\text{lcm}$ operators on the natural numbers. These are also commutative and associative.
Another example is the simple "average" operator - let $S=\mathbb Q$, the set of rational numbers. Define the binary operator $f(a,b)=\frac{a+b}{2}$. This is commutative and idempotent, but not associative.
