I have a function f2 I'd like to code into Mathematica with the property that it takes in two lists, treats those lists as unordered, and maps to a symbolic value.
If I were instead using a function f1 that takes in a single unordered list, then I would use...
SetAttributes[f1, Orderless];
and Mathematica would correctly recognize (for example) f1[a,b] = f1[b,a] and correctly simplify expressions as such. What I'd like is some means by which I can ensure Mathematica recognizes (for example) f2[a,b][c,d] = f2[b,a][c,d] = f2[a,b][d,c] = f2[b,a][d,c]. The resulting symbolic expressions will eventually have a,b,c,d and so-on set to non-negative integers. My specific application requires variable list lengths.
Q: Is there a way to symmetrize both input channels of the function? Or perhaps by instead writing
f2[{a,b}][{c,d}]
or
f2[{a,b},{c,d}]
is there a way to tell Mathematica that it should treat the inputs as unordered lists?
Thank you for your time. Best wishes.
...
Edit (for further clarity): As a concrete example, I want a means by which I can write out something like...
f2[{a,b},{c,d}] * g1[x] + f2[{a,b},{d,c}] * g2[x] + f2[{b,a},{c,d}] * g3[x]
that Mathematica correctly reduces to,
f2[{a,b},{c,d}] * ( g1[x] + g2[x] + g3[x] )
Much in the style of how I might manipulate the f1[...] described above.