# TransformedRegion with piecewise function

Is it possible to use TransformedRegion with a Piecewise defined function?

I tried the following, but it doesn't work and I don't understand why.

V[{x_, y_}] = Piecewise[{{{2 x , y}, x < .5 }, {{.5 x , y}, x >=  .5}}];
Region[
TransformedRegion[Rectangle[], V]
]


EDIT: How does TranformedRegion transform a region? Why does it not work with simple discontinuous or non-differentiable transformations?

• What happens if you use Region[TransformedRegion[Rectangle[], {Piecewise[{{2 Indexed[#, 1], Indexed[#, 1] < 1/2}, {Indexed[#, 1]/2, Indexed[#, 1] >= 1/2}}], Indexed[#, 2]} &]]? – J. M.'s torpor May 2 '20 at 11:14

## 1 Answer

The map under consideration is discontinuous on Rectangle[] . I have doubts whether TransformedRegion works with such maps. The command

Region[TransformedRegion[Rectangle[], Function[p, {Piecewise[{{2*p[], p[] < 1/2},
{1/2*p[], p[] >= 1/2}}], p[]}]]]


crashes the kernel on my comp and the command

Region[TransformedRegion[Rectangle[], Function[p, {Piecewise[{{2*p[], p[] < 1/2},

{3*p[] - 1/2,p[] >= 1/2}}], p[]}]]]


, where the map is continuous, works well.

Addition. The answer to your question can be done in such a way.

r1 = TransformedRegion[Rectangle[{0, 0}, {1/2, 1}],Function[p, {2*p[], p[]}]]
(*Rectangle[{0, 0}, {1, 1}]*)
r2 = TransformedRegion[Rectangle[{1/2, 0},{1, 1}],Function[p, {1/2*p[],p[]}]]
(*Rectangle[{1/4, 0}, {1/2, 1}]*)
RegionUnion[r1, r2]
(*Rectangle[{0, 0}, {1, 1}]*)

• Thanks. I had already figured out that TransformedRegion does not work well with discontinuous functions. I guess what I wanted to ask was why? How does TransformedRegion work? I like to understand the reason behind this limitation. – Cantor May 20 '20 at 6:57
• @Cantor: Your question "How does TransformedRegion work? I like to understand the reason behind this limitation" should be addressed to Mathematica developers. As I was informed by Maple developers, the analogous command of Maple finds the image of the boundary of a transformed region and then fills its interior. If a map is discontinuous, then the image of the boundary as a rule consists of several pieces and the command of Maple does not work. Don't hesitate to ask for further explanation in need. – user64494 May 20 '20 at 9:23