# Trouble plotting an ImplicitRegion

I have an implicit region:

R = ImplicitRegion[-Sqrt[-1 + 1/4 (x + 1/(x + I y) + I y)^2] +
1/2 (x + 1/(x + I y) + I y) == x + I y, {x, y}]


I tried plotting it with RegionPlot:

RegionPlot[R, PlotRange -> {{-2.5, 2.5}, {-2.5, 2.5}}]


but got an error message,

RegionPlot::invplotreg: {ImplicitRegion[-Sqrt[-1+Times[<<2>>]]+1/2 (x+1/Plus[<<2>>]+I y)==x+I y,{x,y}]} is not a valid region to plot. >>

Manually executing RegionPlot seems to work:

RegionPlot[-Sqrt[-1 + 1/4 (x + 1/(x + I y) + I y)^2] +
1/2 (x + 1/(x + I y) + I y) == x + I y, {x, -2, 2}, {y, -2, 2}]


which produces

Similarly, I tried to discretize the region:

DiscretizeRegion[R, {{-2.5, 2.5}, {-2.5, 2.5}}]


but got an error message:

DiscretizeRegion::drf: DiscretizeRegion was unable to discretize the region ImplicitRegion[<<2>>]. >>

Any ideas as to where I am going wrong?

## Edit

Algohi has suggested that the problem might have to do with the fact that the truth statement is an equality of complex quantities, which might confuse ImplicitRegion into thinking that it's dummy variables are meant to be taken over the complex numbers, which contradicts the Documentation's stipulation that the values are in $\mathbb R^n$. Unfortunately, this is not the case, as the following counterexample shows:

R = ImplicitRegion[y + I x == y - I x, {x, y}]
RegionPlot[R]


which correctly produces:

• To the downvoter: what part of my question was unclear? I would appreciate feedback if my question needs to be reworked. – DumpsterDoofus Oct 11 '14 at 17:21
• I don't think your lase example is a valid one. y + I x == y - I x // Simplify results in x == 0. Try some example where (I) can't be factored out. – Basheer Algohi Oct 12 '14 at 19:24
• @Algohi: Hmm, trying some other nontrivial examples gives errors. Still, it makes no sense. My expression is a well-defined map $f:\mathbb{R}^2\rightarrow\{0,1\}$. The fact that the internal arithmetic uses complex numbers does not alter the function signature, which is a map of the real plane to truth values, so I can't understand why ImplicitRegion cannot handle it. – DumpsterDoofus Oct 12 '14 at 19:51

I believe the problem stands in ImplicitRegion. A workaround is to use Reduce as done below. Also, you should impose explicitly that x and y are Reals.

R = Reduce[-Sqrt[-1 + 1/4 (x + 1/(x + I y) + I y)^2] + 1/2 (x + 1/(x + I y) + I y) == x + I y && x \[Element] Reals && y \[Element] Reals, {x, y}]
RegionPlot[R, {x, -2.5, 2.5}, {y, -2.5, 2.5}]


I am not sure about this but it looks like ImplicitRegion works only with real domain.

• Thanks for the answer. However, the plotting region I have used is real-valued (see the examples I provided). It is only the expression itself that is complex-valued (or rather, it is boolean-valued, but is an equality of complex expressions); the variables x and y are being plotted over a real region, so I'm not sure this answers my question. – DumpsterDoofus Oct 11 '14 at 21:33
• I don't understand when you say your region is real valued. I see an imaginary number (I) in you expression. – Basheer Algohi Oct 12 '14 at 2:11
• No, the region is real-valued; the expression is Boolean-valued and is comprised of an Equal statement which contains an I in one of it's sub-branches. That does not make the region real-valued. As further proof, I appended a counterexample to my question, which shows that ImplicitRegion is capable of handling complex-valued expressions. – DumpsterDoofus Oct 12 '14 at 13:50
ℛ = -Sqrt[-1 + 1/4 (x + 1/(x + I y) + I y)^2] +
1/2 (x + 1/(x + I y) + I y) == x + I y


RegionPlot[ℛ, {x, -2.5, 2.5}, {y, -2.5, 2.5}]


• Hmm, I'm confused. OP already showed this can be done. – RunnyKine Oct 11 '14 at 16:30
• Yeah, I already showed that a direct application of RegionPlot on the expression works properly in my question, but that's not what my question was asking. My question was twofold: why does RegionPlot fail on the equivalent ImplicitRegion, and why does DiscretizeRegion also fail on the ImplicitRegion? – DumpsterDoofus Oct 11 '14 at 16:44
• @RunnyKine: Any idea what my problem could be? My question seems to be getting downvoted, and I'm not sure if I've just done something silly. – DumpsterDoofus Oct 11 '14 at 17:23
• @DumpsterDoofus. Your question is perfectly valid. The only thing I can say is ImplicitRegion is not ready for primetime. I've experienced a lot of problems with it. – RunnyKine Oct 11 '14 at 17:35