Properties of Binary Functions Many important topics in abstract algebra involve a binary function acting on a set. A number of properties of such functions have been defined in the investigation of such topics.
Your challenge will be to determine whether a given binary function on a given domain possesses five of these properties.
Properties
Closure
A binary function is closed if every possible output is in the domain.
Associativity
A binary function is associative if the order in which the function is applied to a series of inputs doesn't affect the result. That is, $ is associative if (a $ b) $ c always equals a $ (b $ c). Note that since the value (a $ b) is used as an input, associative functions must be closed.
Commutativity
A binary function is commutative if swapping the order of the inputs doesn't change the result. In other words, if a $ b always equals b $ a.
Identity
A binary function has an identity element if there exists some element e in the domain such that a $ e = a = e $ a for all a in the domain.
Idempotence
A binary function is idempotent if applying it to two identical inputs gives that number as the output. In other words, if a $ a = a for all a in the domain.
Input
You will be given a function in the form of a matrix, and the domain of the function will be the numbers 0 ... n-1, where n is the side length of the matrix.
The value (a $ b) is encoded in the matrix as the ath row's bth element. If the input matrix is Q, then a $ b = Q[a][b]
For example, the exponentiation function (** in Python) on the domain [0, 1, 2] is encoded as:
[[1, 0, 0]
 [1, 1, 1]
 [1, 2, 4]]

The left and right domains are the same, so the matrix will always be square.
You may use any convenient matrix format as input, such as a list of lists, a single list in row- or column- major order, your language's native matrix object, etc. However, you may not take a function directly as input.
For simplicity, the matrix entries will all be integers. You may assume that they fit in your language's native integer type.
Output
You may indicate which of the above properties hold in any format you choose, including a list of booleans, a string with a different character for each property, etc. However, there must be a distinct, unique output for each of the 24 possible subsets of the properties. This output must be easily human-readable.
Examples
The maximum function on domain n=4:
[[0, 1, 2, 3]
 [1, 1, 2, 3]
 [2, 2, 2, 3]
 [3, 3, 3, 3]]

This function has the properties of closure, associativity, commutativity, identity and idempotence.
The exponentiation function on domain n=3:
[[1, 0, 0]
 [1, 1, 1]
 [1, 2, 4]]

This function has none of the above properties.
The addition function on domain n=3:
[[0, 1, 2]
 [1, 2, 3]
 [2, 3, 4]]

This function has the properties of commutativity and identity.
The K combinator on domain n=3:
[[0, 0, 0]
 [1, 1, 1]
 [2, 2, 2]]

This function has the properties of closure, associativity and idempotence.
The absolute difference function on domain n=3:
[[0, 1, 2]
 [1, 0, 1]
 [2, 1, 0]]

This function has the properties of closure, commutativity and identity.
The average function, rounding towards even, on domain n=3:
[[0, 0, 1]
 [0, 1, 2]
 [1, 2, 2]]

This function has the properties of closure, commutativity, identity and idempotence.
The equality function on domain n=3:
[[1, 0, 0]
 [0, 1, 0]
 [0, 0, 1]]

This function has the properties of closure and commutativity.
Challenge
This is code golf. Standard loopholes apply. Least bytes wins.
Haskell, 178 171 bytes

import Data.List
f x=[c,c&amp;&amp;and[(m%n)%o==m%(n%o)|m&lt;-b,n&lt;-b,o&lt;-b],x==t,all(elem b)[x,t],b==[i%i|i&lt;-b]]where c=all(l&gt;)(id=&lt;&lt;x);b=[0..l-1];a%b=x!!a!!b;l=length x;t=transpose x


Returns a list with five booleans, which are in order closure, associativity, commutativity, identity and idempotence.

Usage example: f [[1, 0, 0],[0, 1, 0],[0, 0, 1]] -> [True,False,True,False,False].

How it works:

f x=[
  c,                         -- closure (see below)
  c&amp;&amp;and[(m%n)%o==m%(n%o)|   -- assoc: make sure it's closed, then check the
          m&lt;-b,n&lt;-b,o&lt;-b],   --        assoc rule for all possible combinations
  x==t,                      -- comm: x must equal it's transposition
  all(elem b)[x,t],          -- identity: b must be a row and a column
  b==[i%i|i&lt;-b]              -- idemp: element at (i,i) must equal i
  ]
  where                      -- some helper functions
  c=all(l&gt;)(id=&lt;&lt;x);         -- closure: all elements of the input must be &lt; l 
  b=[0..l-1];                -- a list with the numbers from 0 to l-1
  a%b=x!!a!!b;               -- % is an access function for index (a,b)
  l=length x;                -- l is the number of rows of the input matrix
  t=transpose x


Edit @xnor found some bytes to save. Thanks!