Suppose I have a word $\{1,2\}$, then $l(\{1,2\}) = \{[1,2]\} = \{1,2\} - \{2,1\}:=12-21$ and for the word with length $3$, (I will omit bracket), the $l$-operation is defined as $ l(1,2,3) = [[1,2],3] = [12-21,3]=123-312-213+321$ thus for general $n$ word $l(1,2,3,4,5,\cdots n) = [[[1,2],3],4] \cdots, n]$ How one can implement through mathematica?
Similar way, I can define $r-$operation as $r(1,2,3,\cdots, n) = [1,[2,[3,\cdots, [n-1,n]\cdots ]]]$
For small number, I can do by hand but for large number, I mean for given arbitrary array, Is there a way to implement commutators?