# How to compare ImplicitRegion with empty region?

I have the following function using ImplicitRegion:

Region222[a_] :=
ImplicitRegion[
Sqrt[x^2 + y^2 - a^2] >= 9, {{x, a, a + 2}, {y, a, a + 1}}]
Region222Reduced[a_] :=
MapAt[Reduce, Region222[a], 1]
Function12[a_] := If[Region222Reduced[a] == EmptyRegion[2], 0, 222]


Function12 should compare ImplicitRegion with the empty region and return 0 if they coincide and 222 if they don't coincide. But it does not work properly for the case when the region does not coincide with EmptyRegion[2].

Could you please tell me what I do incorrectly?

Perhaps you can use one of the following predicates instead:

predicate1[region_] := RegionDimension[region]<0
predicate2[region_] := RegionMeasure[region] == 0


region = Region222[3]
predicate1[region]
predicate2[region]


ImplicitRegion[ Sqrt[-9 + x^2 + y^2] >= 9 && 3 <= x <= 5 && 3 <= y <= 4, {x, y}]

True

True

And a non-empty region:

region = Region222[10]
predicate1[region]
predicate2[region]


ImplicitRegion[ Sqrt[-100 + x^2 + y^2] >= 9 && 10 <= x <= 12 && 10 <= y <= 11, {x, y}]

False

False

You can use RegionEqual for this.

RegionEqual[Region222[3], EmptyRegion[2]]

True

RegionEqual[Region222[10], EmptyRegion[2]]

False

RegionEqual[Region222[a], EmptyRegion[2]]

-9 < a <= -5 || 0 <= a < -3 + Sqrt[85]

• RegionEqual doesn't work so well for inexact regions, as in the OP's previous queston. – Carl Woll Oct 9 '18 at 18:49
• I think this is a common problem with a lot of the region functions. In[24]:= predicate3[region_] := RegionEqual[region, EmptyRegion[2]] In[25]:= Through[{predicate1, predicate2, predicate3}[ Region222[#[-3 + Sqrt[85]]]]] & /@ {Identity, N} Out[25]= {{False, False, False}, {True, True, True}} – Chip Hurst Oct 9 '18 at 21:35