I have an elaborate context called "FiniteSolutionSets". In this context, I can make something like

Formula("1,2");

And the student can enter any of these things as the answer:

1,2

{1,2}

x = 1 or 2

x = 1 or x = 2

x = 1, 2

and other reasonable things. "x" can be whatever the context's first variable is.

The context setup starts out by copying the Interval context. That choice was made because the Set creator works well there, and that is part of how I get the behavior I want. Assuming I don't need to start over, is there an easy way to make it so that complex numbers can appear in the sets as well? So for example,

{1, i, -1, -i}

or

{1/2 + i sqrt(3)/2, 1/2 - i sqrt(3)/2}

could work just as well as I have it working with real numbers?

I've tried simple things like adding "i" as a constant defined by Complex(i), but that doesn't work.

Note I would be content if I just get "i" and basic arithmetic operations. I don't need the complications like redefining functions like sqrt() etc so that they can accept complex/negative input. I also don't need polar form, if that makes it easier.