Skip to main content
1 of 3
Zev Chonoles
  • 6.8k
  • 4
  • 54
  • 92

I imagine the only useful way of interpreting a rectangle with negative w and/or h should just be as a rectangle with positive width and height, only starting at a different point (it's lower left vertex, it seems?).

With either union or intersection as the operation, you're going to run into a couple of problems if you want the structure to be a group. The only possible choice for the identity under intersection is the entire plane (which, if you are parametrizing the rectangles in the plane using (x,y,w,h), would require you to allow x=y= $-\infty$, w,h=$\infty$), and the only possible choice for the identity under union is an "empty" rectangle (i.e., w=h=0, though you'll also have the problem that there is one of these at each x and y). Of course, given any rectangle which is not the entire plane, you can't take an intersection of it with something and get the entire plane, and similarly, given any rectangle which is non-empty, you can't take the union of it with something and get an empty rectangle - that is, there won't be inverses. However, as you guessed in the title, you still do get a commutative monoid.

You can make a group (and even ring) structure, similar to what you are describing, out of the collection of all subsets of the plane (or any set), as described here, but you'd have to give up your restriction to only rectangles if you want to use this one.

Zev Chonoles
  • 6.8k
  • 4
  • 54
  • 92