Re: Define an antisymmetric function
- To: mathgroup at smc.vnet.net
- Subject: [mg107440] Re: Define an antisymmetric function
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Fri, 12 Feb 2010 04:45:25 -0500 (EST)
- References: <hl0r36$uu$1@smc.vnet.net>
Hi, > I'd like to define an antisymmetric function by giving its value on a > set of known objects. I'm having trouble enforcing antisymmetry. Say I > want to define G[_, _] on the objects {a, b, c}: > > G[a, b] := f[a, b] > G[a, c] := g[a, c] > G[b, c] := h[b, c] > > If I now enforce antisymmetry simply by > > G[x_, y_] := -G[y, x] > > then it mostly works (e.g., G[b, a] evaluates to -f[a, b]). But if I > apply G to something that is not in {a, b, c}, then I run into an > infinite loop: G[a, f[b]] yields "$RecursionLimit::reclim: Recursion > depth of 256 exceeded." > > Ideally, I would like applications to unknown input to stay unevaluated > (e.g., G[a, f[b]] just yields G[a, f[b]]). How can I achieve that while > also enforcing antisymmetry? I think your problem is that G[x_, y_] := -G[y, x] will result in a infinit recursion, since part of the right hand side will match the left hand side no matter what arguments you give. To enforce antisymmetry you could do this, so the pattern will match only when the arguments are not in canonicial order: g[b_, a_] /; Not[OrderedQ[{b, a}]] := -g[a, b] hth, albert