# Triangles, squares, and discontinuous complex functions

Is there some onto function $f:$ $\mathbb{C}$ $\rightarrow$ $\mathbb{C}$ such that for each triangle $T$ (with its interior), $f(T)$ is a square (with interior, too) ? I would have the same question for triangles and squares without interior, respectively.

-
Is it easy to come up with such a function without the onto restriction? –  Tony Huynh Mar 19 '10 at 17:32
Yes. Just pick a single square and then make sure that the image of every open set is equal to that square -- which can be done in many ways. –  gowers Mar 19 '10 at 18:32

With interior: yes. Fix a sequence of squares $Q_1\subset Q_2\subset\dots$ whose union is the entire plane. Then arrange a map $g:\mathbb R\to\mathbb R^2$ such that, for every nontrivial segment $[a,b]\subset\mathbb R$, its image is one of the squares $Q_i$. To do that, construct countably many disjoint Cantor sets so that every nontrivial interval contains at least one of them. Then send every Cantor set $K$ bijectively onto $Q_n$ where $n$ is the minimum number such that $K\cap [-n,n]\ne\emptyset$. Send the complements of these Cantor sets to a fixed point inside $Q_1$. Then define $f(x,y)=g(y)$.

(This is a detailed version of gowers' answer.)

UPDATE

Without interior: no. Take any triangle $T$ and consider its image $Q$ with vertices $ABCD$. There is a side $I$ of $T$ whose image has infinitely many points on (at least) two sides of $Q$. If these are opposite sides, say $AB$ and $CD$, the image of any triangle containing $I$ must stay within the strip bounded by the lines $AB$ and $CD$. And if these are two adjacent sides of $Q$, say $AB$ and $AD$, the image of any triangle containing $I$ stays within the quarter of the plane bounded by the rays $AB$ and $AD$. In both cases, the images of the triangles containing $I$ do not cover the plane, hence the map is not onto.

-

I think this works but haven't checked. I'm pretty sure that for any open set it's easy to find a map that takes any open subset of that set to all of $\mathbb{C}$, or to all of a square, or to whatever single set you feel like. So now for each n choose a map that takes every open subset of the annulus $\{z: n < |z| \leq n+1\}$ to the square that consists of all points with real and imaginary parts less than or equal to n. Now, given any triangle, there will be a maximum n such that it belongs to the nth annulus, and it will intersect that annulus in an open set and therefore map to a square.

-
Incidentally, it's a nice exercise to find a map from the reals to the reals that takes every value in every open interval. Using that it isn't hard to find a map of the kind I'm claiming exists. –  gowers Mar 19 '10 at 18:41
Such a "locally surjective" map $f$ may be obtained as follows. Let {$1$} $\cup$ { $b_{t};t\in\mathbb{R}$ } be a Hamel basis of $\mathbb{R}$ over $\mathbb{Q}$, and let us define the $\mathbb{Q}$ - linear map $f:$ $\mathbb{R}$ $\rightarrow$ $\mathbb{R}$ by $f(1):=0$ , and $f\left(b_{t}\right)=t$ $\left(t\in\mathbb{R}\right)$. –  Ady Mar 19 '10 at 19:48
I don't want to spoil anyone else's fun, but it's not giving too much away to say that it can also be done without the axiom of choice. In fact, when I've set this question I've tended to get about as many constructions as people who seriously attempted the question. –  gowers Mar 19 '10 at 20:02