A fundamental construction in a first course on manifolds is to build a smooth function $\psi\colon \mathbb{R} \to \mathbb{R}$ with the property that for some $0<\delta<\epsilon$ we have


* $\psi(x)=1$ for $|x|\leq\delta$;
* $\psi(x)=0$ for $|x|\geq\epsilon$.


Using this "bump function", one can do all sorts of "gluing" tricks: for example, if $f\colon \mathbb{R}^n \to \mathbb{R}^n$ is any smooth map and $\epsilon>0$ is such that $|f(x)|<\epsilon$ for all $|x|\leq\delta$, then we can build a smooth map $F\colon \mathbb{R}^n\to \mathbb{R}^n$ such that


* $F(x) = f(x)$ for $|x|\leq\delta$;
* $F(x) = x$ for $|x|\geq\epsilon$.


However, the map we obtain in this manner does not necessarily preserve all the nice properties of $f$. For example, if $f$ is a local diffeomorphism, it does not immediately follow from the above construction that $F$ can also be taken to be a local diffeomorphism. 


Intuitively, it seems clear that this is (usually) the case:


* For linear maps with $n=1$, it's just a matter of drawing a smooth curve that starts on the line $y=\lambda x$ and goes to the line $y=x$ without ever having a horizontal tangent. (Of course we must take $\lambda>0$ for this.)
* For linear maps with $n=2$, the image of a small ball is an ellipse, so by smoothly deforming the ellipse into a ball, rotating so that the map is a multiple of the identity, and then using the trick from $n=1$ to make the eigenvalues equal to $1$, we can find a smooth homotopy $f\_t$ such that $f\_0=f$ and $f\_1$ is the identity, and furthermore, setting $F(x) = f\_t(x)$ for $|x| = \delta + t(\epsilon - \delta)$ makes $F$ a diffeomorphism.
* Since linear maps approximate arbitrary maps, the above procedure ought to generalise. (Modulo the restriction that $Df(0)$ should have positive determinant.)


I expect that there's a general result along these lines, and that it is quite standard and well-known. But I don't know it (and I'd rather re-invent the wheel as few times as possible). Can someone help me out with a statement of a general theorem, and ideally a reference?


**Edit**: Since that was kind of rambling, here's the specific question. Let $B(r)$ denote the (open) ball of radius $r$ in $\mathbb{R}^n$ centred at the origin. Suppose $f\colon B(\delta) \to \mathbb{R}^n$ is a diffeomorphism onto its image, and suppose $\overline{f(B(\delta))} \subset B(\epsilon)$. Let $\delta' < \delta$. Does there necessarily exist a diffeomorphism $F\colon \mathbb{R}^n \to \mathbb{R}^n$ that agrees with $f$ on $B(\delta')$ and is the identity map outside of $B(\epsilon)$?


I think we need to require that $Df(0)$ have positive determinant. Are there any other obstructions? If there are, can they be removed (for a given $f$) by decreasing $\delta$ so that $f$ is close to being a linear map? Is there a general theorem from which all this follows?



Gluing two diffeomorphisms together
The group $GL(n,R)$ has an affine structure, coming from the coefficients of the group.
It has an easily described and fairly large convex neighborhoods of the identity, satisfying that for no vector $V \ne 0$ is $A(V)$ negative real multiple of $V$ (*i.e.*, no negative real eigenvalues).


The first derivative of a convex combinations of two diffeomorphisms, the first derivative is the convex combination of derivatives, plus a correction term of the difference of derivatives applied to the gradient of the convex coefficient. Convex combinations of more terms are similar. In any case, if you bound the maximal gradient of a partition of unity, you can get an explicit bound for collections of first derivatives of local diffeomorphisms guaranteeing that there compostion is diffeomorphism.


I think a bigger issue to watch for is the difficulty in practice to give an actually valid atlas for an abstract manifold that doesn't start life already embedded in $\mathbb R^m$. For two overlapping charts, an approximate diffeomorphism is fine. However, when three charts overlap, in principle the overlaps must satisfy a cocycle condition. In practice, there aren't many good choices of classes of gluing maps that are simply described and have reasonable group laws; note in particular that convex combinations disrupt relationships of compositions.


One solution is, to define how an intersection of $m$ charts patch together, work in the product of the collection of local coordinates, $\mathbb R^{nm}$. Build the graph of the relation among all the charts at once, rather than doing it pair by pair. Consistency is straightforward to arrange using partitions of unity on the graphs. Even for an overlap of two charts, rather than specify a diffeomorphism which may be hard to invert explicitly, specify the graph of a diffeomorphism, which is trivial to invert.


For the specific question of extending a diffeomorphism defined on a small ball: there is a standard technique that works if you use one of Goodwillie's suggested modifications.
The set of differentiable embeddings of a ball in $\R^n$ retracts to the set of linear embeddings by conjugating with a family of contractions, $\phi\_t(x) = \phi((1-t) x)/(1-t)$.
The set of linear maps retracts to orthogonal maps, using a parametrized Gramm-Schmidt process. Every orhtogonal map is homotopic to either the identity, or some chosen reflection. Then, apply the isotopy extension theorem to make all of $\R^n$ move along with the moving embedding. You can compress everything that happens into the unit ball.


You could also do this in another way: For any neighborhood $U$ of the identity in $GL(n,R)$, any diffeomorphism that is isotopic to the identity can be expressed as the composition of elements in the small ball (and conversely). You can make a sequence of overlapping annular coordinate charts, where in the main part of each one you use an initial segment of the composition. The overlap maps is now in a small neighborhood where the convex combination principle works.


One more remark: in the particular case of dimension 2, if you define a lift of the derivatives to the universal cover of SL(2,R), then there is an averaging process for derviatives that always works, using complex logarithmic coordinates for the plane minus the origin. In the particular case of dimension 3, the universal cover of $SO(3)$ is the group of unit quaternions, homeomorphic to $S^3$, so there is an averaging procedure in that group (and by quadratic form manipulation, in $SL(3,R)$ which works much better than averaging in the obvious coordinates. Among other things, this is very useful for motion control. We used to get workable mathematical specifications for segments of the video *Outside In*. [``We'' primarily means the actual implementers---I especially recall discussions about the difficulties and solutions with my son Nathaniel Thurston].


