Assume that $U$ is an open set in the plane and $X$ is a non vanishing vector field on $U$. Is there a non vanishing vector field $Y$ on $U$ such that the pair $\{X,Y \}$ plays the role of an orthonormal frame for a flat Riemannian metric on $U$?

1$\begingroup$ For simply connected domains the answer should be "yes"; if needed I could try to make a formal proof. I suspect that the answer is "yes" in general but this case is more tricky. Very good question  thank you. $\endgroup$ – Anton Petrunin Aug 16 '17 at 19:41

$\begingroup$ @AntonPetrunin Very great. thank you. i would appreciate if you give a proof. $\endgroup$ – Ali Taghavi Aug 17 '17 at 9:57
Take the $r$ rotation of angle $\pi/2$, and write $Y=r(X)$.

3$\begingroup$ This frame is orthonormal for the metric that is the conformal rescaling of the Euclidean metric by the factor $\X\$. This metric is not flat in general. $\endgroup$ – Bertram Arnold Aug 7 '17 at 12:35

$\begingroup$ @BertramArnold Exactly. For example this gives us the poincare metric for $X= y\partial_x$ on the upper half plane $\endgroup$ – Ali Taghavi Aug 7 '17 at 12:55
This is by no means a complete proof, but I will try at least to describe an approach. The main idea is to look at integral curves, as suggested by Tom Goodwillie in the comments. We will construct the desired metric by perturbing $U$ together with $X$ in such a way that the $X$trajectories will have constant velocity $1$. This will guarantee that $X$ has norm $1$. Then $Y$ can be defined simply by rotating $X$ by $90$ degrees. I will assume that the vector field is bounded from above, by rescaling let us assume that $X<\varepsilon$. Also I assume that $U$ can be covered by small 'eyes' that look like
$X$ flows upwards.
For a point $x\in U$ denote by $\Phi_t(x)$ the trajectory of $x$ flowing along $X$ so that $\Phi_0(x)=x$. Assume a point $a$ on the lower side of the eye ends up in time $t(a)$ on another side of the eye. Then the whole eye is parametrized by pairs $(a,s)$ such that $a$ is a point on the lower side of the eye and $0\leq s\leq t(a)$. Suppose I construct a different flow inside the eye, call it $\Psi_t(x)$ such that $\Psi_{t(a)}(a)=\Phi_{t(a)}(a)$ and such that velocity of a point flowing along $\Psi$ is $1$. Then we can define an isomorphism from the eye to itself by $\alpha \Phi_s(a) = \Psi_s(a)$. Then we define a metric inside the eye by pulling back the standard metric via $\alpha$. The pullbacks of the trajectories of $\Psi$ will be the trajectories of $X$, so $X$ will have unit length. How do we construct such a flow? Note that $$ \Phi_{t(a)}(a)a\leq \varepsilon t(a). $$ We can assume that the projection of $X$ on the vertical direction is at least $\varepsilon'$ so we have $$ t(a)\leq \frac{1}{\varepsilon'} \Phi_{t(a)}(a)a. $$ So we can move from $a$ to $\Phi_{t(a)}(a)$ by following a zigzag line as shown on the picture, so that the length of the zigzag line is $t(a)$. I think it is possible to organize the zigzags for different points $a$ into a smooth flow. Also we may assume that each zig zag follows $X$ for a little while in its beginning and in the end. Then close to the boundary of the eye $\alpha$ is just stretching in the $X$ direction, so that the maps $\alpha$ for different eyes glue together nicely. Also there can be a problem to make $\alpha$ smooth.

$\begingroup$ Thank you for your answer and your comment. According to your comment, my question is equivalent to "Gving a flat metric such that $X$# would be of unit length. Yes it is equivalent to my question. regarding your answer, I think that your argument works locally, not globally. Yes? So why we do not use simply the flow box theorem for a local argument? $\endgroup$ – Ali Taghavi Aug 19 '17 at 7:46

1$\begingroup$ In general it isn't clear why several flat structures defined locally can be assembled into a global one. Here I stress that the flat structure is defined by pullback of the standard one via a globally defined map, and the maps on the eyes assemble to a global map because on the boundary of each eye it is the identity map. $\endgroup$ – Anton Mellit Aug 19 '17 at 8:40
Change coordinates on $U$ in such a way that $X = \partial_x$. Then $Y = \partial_y$.

5$\begingroup$ That will work locally, but when we change the choice of local coordinates, how do we patch together a global $Y$? $\endgroup$ – Ben McKay Aug 7 '17 at 13:31

$\begingroup$ I don't think one can solve the OP problem globally, in general. $\endgroup$ – Raziel Aug 7 '17 at 13:39

$\begingroup$ Well, if $U = \mathbb{R}^n$, it seems to me that the OP problem has a solution iff X is a complete vector field and, in this case, it is of the form of this answer. $\endgroup$ – Raziel Aug 7 '17 at 15:01

$\begingroup$ @BenMcKay Yes exactly. My question is about global situation on $U$. $\endgroup$ – Ali Taghavi Aug 7 '17 at 20:47

2$\begingroup$ @AliTaghavi I don't understand the questions, let me try to explain what I understand. Your original question is equivalent to the following: Does there exist a flat metric such that $X$ has everywhere norm $1$? Indeed if such a metric exists, then you can simply pick $Y$ to be the vector field orthogonal to $X$ of norm $1$. Choices of $Y$ correspond to choices of the orientation. Since $U$ is orientable, such $Y$ exists. Note that we do not require $X$ to be flat. But if you require $X$ to be flat, then integral curves for $X$ must be geodesics, and nearby geodesics must have same lengths $\endgroup$ – Anton Mellit Aug 17 '17 at 11:11