% Corrected following referee suggestions; sent to Jerry 8/22,2000
% Submitted to Top. Appl. 10/1/99, resubmitted 5/16/00
%%%%%%%%%%%%%%%%%%%%%%%%%
\documentstyle%[12pt]%
{article}

%\headheight=0in
%\headsep = 0in
%\topmargin=0in
%\textheight=%8in
%8.8in
%\textwidth=%5in
%6.5in
%\oddsidemargin=0in
%\evensidemargin=0in
%\parindent=0.2in

\title{Between continuous and uniformly continuous functions on $\real^n$
\thanks{Work partially supported by the
NATO Collaborative Research Grant CRG~950347.
%research projects 60\% and 40\% of the Italian Ministero dell'
%Universit\`{a} e della Ricerca Scientifica e Tecnologica.
%\\ {\it Key words:}
\endgraf AMS classification
numbers: Primary  54C30, 41A30; %\endgraf
Secondary 54E35, 54B30, 26A15. \endgraf
Key words and phrases:
{\it metric spaces, uniformly continuous maps,
uniform approachability, truncation, Cantor function.} }}
\author{
Krzysztof Ciesielski \\
{\footnotesize
Department of Mathematics, West Virginia University,} \\
{\footnotesize  Morgantown, WV 26506-6310} \\
{\footnotesize  K\_Cies@math.wvu.edu}\\
{\footnotesize web page: {\tt http://www.math.wvu.edu/homepages/kcies}}
\and Dikran Dikranjan \\
{\footnotesize Dipartimento di Matematica e Informatica,
Universit\`{a} di Udine} \\
{\footnotesize Via delle Scienze 206, 33100 Udine, Italy} \\
{\footnotesize  dikranja@dimi.uniud.it}
}
\date{}
%*****************theorems and such
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{problem}[theorem]{Problem}

\newtheorem{em-example}[theorem]{Example}     % example (auxiliary)
\newtheorem{em-def}[theorem]{Definition}      % definition (auxiliary)
\newtheorem{em-remark}[theorem]{Remark}       % remark (auxiliary)
\newtheorem{em-question}[theorem]{Question}

\newenvironment{example}{\begin{em-example} \em }{ \end{em-example}}
\newenvironment{definition}{\begin{em-def} \em  }{ \end{em-def}}
\newenvironment{remark}{\begin{em-remark} \em }{\end{em-remark}}
\newenvironment{question}{\begin{em-question}
\em }{\end{em-question}}
\newenvironment{proof}{\noindent{\sc Proof.}}{QED \smallskip}
\newenvironment{claim}{\underline{Claim}: \em}{\medskip}

%commonly used newcommands
%*********boolean connectives********
\newcommand{\club}{{\bf N.B.}}
\newcommand{\limplies}{\mathrel{\rightarrow}}  % Logical Implication
\newcommand{\liff}{\mathrel{\leftrightarrow}}   % Logical IFF Symbol
\newcommand{\bigor}{\bigvee}                           %big or
\newcommand{\bigand}{\bigwedge}                    %big and
\newcommand{\false}{\bot}    % false propositional constant
\newcommand{\true}{\top}    % true propositional constant
\newcommand{\metaimplies}{\Rightarrow} %implication in the metatheory
\newcommand{\metaimplied}{\Leftarrow} %reverse impl. in metatheory
\newcommand{\metaiff}{\Longleftrightarrow}      %iff in metatheory
\newcommand{\metaand}{\mbox{and \ }} %can be used in math. mode
\newcommand{\metaor}{\mbox{or \ }}

\newcommand{\bi}{{\bf b}}
\newcommand{\metanot}{\mbox{not }}

%***********set operations and relations*******************
\newcommand{\union}{\cup}                           %set union
\newcommand{\diam}{{\rm diam}}
\newcommand{\included}{\subseteq}
\newcommand{\includes}{\supseteq}
\newcommand{\contains}{\supseteq}       %set inclusions
\newcommand{\intersect}{\cap}
\newcommand{\nin}{\notin} %negated membership
 \newcommand{\iu}{{\bf i}}
%*******other commands in alphabetical order**************
\newcommand{\composed}{\circ}      %function composition
\newcommand{\gn}[1]{\lceil #1 \rceil} %Godel number
\newcommand{\Image}{\mbox{Image}}
\newcommand{\map}{\mapsto} %arrow for functions
\newcommand{\proves}{\vdash} %provability sign
\newcommand{\st}{\; | \;}
\newcommand{\summation}[2]{{\sum_{#1}#2}} %summation
\newcommand{\ov}[1]{\overline{#1}}
\newcommand{\Un}{\mbox{\bf Unif}}
\newcommand{\R}{{\bf R}}
\newcommand{\N}{{\bf N}}
\newcommand{\C}{{\bf C}}
\newcommand{\Q}{{\bf Q}}
\newcommand{\Z}{{\bf Z}}
%\newcommand{\restricted}[1]{_{| #1}}
\newcommand{\restricted}[1]{{| #1}}
\newcommand{\restriction}{\restricted}
\newcommand{\sq}{\subseteq}
\newcommand{\Reals}{{\bf R}}
\newcommand{\rational}{{\bf Q}}
\newcommand{\reals}{{\bf R}}
\newcommand{\real}{\Reals}
\newcommand{\im}{\mbox{Im}}
\newcommand{\re}{\mbox{Re}}
\newcommand{\pr}{{\rm pr}}
\newcommand{\la}{\langle}
\newcommand{\ra}{\rangle}
\newcommand{\nbd}{neighbourhood}

\newcommand{\inter}{{\rm int}}
\newcommand{\cl}{{\rm cl}}
\newcommand{\bd}{{\rm bd}}
\newcommand{\osc}{{\rm osc}}
\newcommand{\e}{\varepsilon}
\newcommand{\continuum}{{\bf c}}
%single equivalence
   \newcommand{\equi}{\leftrightarrow}
\newcommand{\NB}{}


\begin{document}

\maketitle

\begin{abstract}
We study classes of continuous functions on $\R^n$
that can be approximated in various degree by uniformly
continuous ones (uniformly approachable functions).
It was proved in~\cite{BDP1} that
no polynomial function can distinguish between them.
We construct examples that distinguish these classes
(answering a question from~\cite{BDP1}) and we offer
appropriate forms of uniform approachability that enable
us to obtain a general theorem on coincidence
in the class of {\em all\/} continuous functions.
\end{abstract}

%\vspace{-4mm}
\section{Introduction}

%\vspace{-2mm}

Our set theoretical and topological notations are standard and
follow~\cite{Ci} and~\cite{E}, respectively.
Given a metric space $X$ we denote by $C(X)$ (or simply $C$) the set of
continuous
functions $f\colon X \to\R$. We use the abbreviation ``u.c.'' for
``uniformly continuous.'' The class of uniformly continuous functions
(from currently considered space $X$ into $\R$) will be denoted by $UC$.
The main classes studied in this paper are the following.

\begin{definition}\label{UAfunctions} \cite{BD} Let $X$ be a
metric (or, more generally, uniform)
space, $f \colon X \to \R$, $K \subseteq X$, and $M \subseteq X$.
\begin{enumerate}
\item $g \colon X \to \R$ is a {\em $\la K,M\ra$-approximation\/}
of $f$ if $g$ is
u.c., $g[M]\subseteq f[M]$, and $g(x)=f(x)$ for each $x\in K$.

\item $f$ is {\it uniformly approachable\/} (briefly, $UA$) if
$f$ has a $\la K,M\ra$-approximation for
each compact $K \subseteq X$ and each $M\subseteq X$.

\item $f$ is {\it weakly uniformly approachable\/} (briefly, $WUA$) if
$f$ has an $\la x,M\ra$-approximation (that is, more formally,
$\la \{x\},M\ra$-approximation) for
each $x \in X$ and for each $M\subseteq X$.
\end{enumerate}
\end{definition}
Clearly every u.c. function is $UA$, and $WUA$ is a special case of
$UA$ when the compact set $K$
reduces to a point $x$. It is also not difficult to
check that every $WUA$ function is continuous~\cite[fact~2.2]{BD}.
Thus $UC\to UA\to WUA\to C$. This justifies the title of the paper.

Is should be also mentioned here that for the functions from $\R$ to $\R$
three of the above notions coincide, that is, $UA\equi WUA\equi C$.
(See \cite[prop.~3.5]{BD}.)
However Maxim R. Burke noticed \cite[example~3.3]{BD}
that on $\R^2$ there are continuous non-$WUA$ functions.
(In fact, $f\colon\real^2\to\R$, $f(x,y)=xy$, is such a function.)
Let us recall that $WUA$ functions were introduced in \cite{DP}
under the name ``uniformly approachable functions"
(see also \cite{B}). They provided an easy and elegant solution
of the problem of whether the uniform continuity can be characterized
(in appropriate sense) by means of closure operators in the sense
of \cite{DT} (since $WUA$ functions are easily seen to be
continuous with respect to every closure operator).

It is easy to see that if the set $M$
is empty then $\la K,M\ra$-approximations
always exist and the notion is uninteresting.
(For $K\neq\emptyset$ any u.c. extension $g$ of
$f\restriction K$ to a u.c. function, which exists by Kat\v etov extension
theorem,
is a $\la K,\emptyset\ra$-approximation of $f$.)
However, if $M$ is properly chosen, then
the condition
$g[M] \subseteq f[M]$ is much stronger than it could be expected. In fact,
it has been proved in \cite[thm.~8.5]{BD} that, under the continuum
hypothesis CH, for every separable metric space $X$
there exists a set $M\subset X$, called a {\it magic set}, such that
any $\la \emptyset,M\ra$-approximation $g$ of a nowhere constant function
$f$ must be a {\em truncation} of $f$, that is,
$g$ must be constant on each connected component of $\{x\in X \colon f(x) \neq
g(x)\}$.
This motivates the introduction of the class $TUA$ of {\em truncation-$UA$\/}
functions, that is, functions $f \in C(X)$ such that
for every compact set $K \subseteq X$ there is a u.c.
truncation $g$ of $f$ which coincides with $f$ on $K$.
%uniformly continuous
Clearly $TUA\to C$ for every locally compact space $X$.
The result quoted above shows that, under CH, $UA\to TUA$ for
nowhere constant functions on
every separable metric space $X$. (Take a
$\la K,M\ra$-approximation of the constant function $f$ with
respect to a magic set $M$.) Since the $TUA$ functions have a simpler
geometrical description, this stimulated the
 further study of the magic sets and their
properties and lead to a deep investigation of
the question whether the existence of magic sets
 can be proved without the assumption of CH (\cite[Question 14.1]{BD}).
After some preliminary negative results
(see \cite{BC,BCL}),  Shelah and the first named
author showed that this cannot be done even for the reals $\R$ \cite{CS}.

In the comparison of
$TUA$ and $UA$ in separable metric spaces
(and in particular, in $\R^n$),
Berarducci, Pelant and the second named
author \cite{BDP1}
 noticed recently that uniform approachability
provides also a good connection to properties of the functions
 related to fibers. A function $f\colon \R^n\to \R$ has {\em distant
connected components} of fibers (briefly, $DCF$)
if any two connected components
of distinct fibers $f^{-1}(x)$ and $f^{-1}(y)$ are at positive distance.
They
proved \cite[cor.~6.20]{BDP1} that for the functions
on $\R^n$ one has
 $$UA\to WUA\to TUA\equi DCF.$$
They also proved that $UA\equi WUA\equi TUA$ for all polynomial
functions from $\R^n$ to $\R$ and, more generally, for all functions
with  fibers having finitely many connected components.
The following question was left open in \cite[Question 8.2(1)]{BDP1}:

\begin{question}\label{MainQues}
Do the properties $UA$, $WUA$, and $TUA$  coincide for {\em all} continuous
functions $\R^n\to \R$?
\end{question}

Also, the strength of the condition $g[M] \subseteq f[M]$
suggested that the difference between $UA$ and $WUA$
is very small. In fact, the following open problem was raised in~\cite{BD}:

\begin{question}\label{UA=WUA}
Let $X$ be a connected metric space and let  $f\colon X\to \real$ be a $WUA$
function. Is then $f$ also~$UA$?
\end{question}

In this paper we will answer negatively these questions. More precisely,
we give contributions mainly in three directions:

\begin{itemize}
\item[(1)]  We answer negatively Question~\ref{MainQues} by constructing a
function $f\in C(\R^2)$ which shows that, in $\R^n$ with $n\geq 2$,
$TUA$ does not imply even $WUA$.
\par
This shows that $UA$ and $WUA$
are too strong conditions to participate in a set of equivalent conditions
containing $TU$A and $DCF$.  This motivated us to introduce here the
following weaker version of $UA$:
  a function $f\colon X\to\reals$ is $UA_d$ ({\em densely uniformly
approachable\/}) if it admits uniform
  $\la K,M\ra$-approximations for every {\em dense\/} set $M$ and for every
compact set $K$. One can define analogously $WUA_d$.
Let us mention here, that all known examples of
non-$UA$ (respectively, non-$WUA$) spaces
(constructed in~\cite{BD}, \cite{BDP1}, and~\cite{BDP2}) are actually non-$UA_d$
(respectively, non-$WUA_d$). As a corollary to Theorems~\ref{Main_Example}
and~\ref{BigThm}  we see that $UA$ does not coincide with $UA_d$
for $f\in C(\R^n)$. In the last part (section~\ref{secUAd}) we show that
 the example from Theorem~\ref{Main_Example} may serve also to distinguishing
$WUA_d$ from $WUA$. (This requires a much more careful choice of the set $M$
witnessing non-$WUA$.)
\item[(2)] In a certain sense we improve the main result of~\cite{BDP1}
by showing that $TUA=DCF=WUA_d=UA_d$ for functions on $\R^n$.
(See Theorem \ref{BigThm}.) This is also the first
general theorem on coincidence of (a form of) $UA$ with (a form of) $WUA$.
(See Question~\ref{UA=WUA}.)

\item[(3)] In Theorem \ref{WUAnonUA} we answer negatively
Question~\ref{UA=WUA} by
proving that the restriction to a connected subspace
of the function $f\colon\R^2\to \R$
constructed in Theorem~\ref{Main_Example} is both $WUA$ and $UA_d$.
The proof of Theorem \ref{Main_Example} shows that this restriction is
not $UA$, hence our example shows that even the implication
$(WUA\ \&\ UA_d)\Rightarrow UA$
may fail for continuous functions on a connected subspace of $\R^2$.
\end{itemize}

We leave open the last part of Question~\ref{MainQues}.
(See also~\cite[question 8.3]{BDP1}.)

\begin{problem}\label{UA>WUA}
Does $WUA$ imply $UA$ in $C(\R^n)$? What about $C(\R^2)$?
\end{problem}

In the diagram below we summarize, for reader's convenience,
our results and the open question (invertibility of (1)):

%\vskip-100pt
\begin{center}
\begin{picture}(300,75)
%\begin{picture}(362,100)
%(341,86)
%\put(25,26){\vector(1,1){40}}
\put(80,30){\vector(0,1){35}}
\put(98,72){\vector(1,0){40}}
\put(95,17){\vector(1,0){45}}

\put(174,72){\vector(1,0){38}}
\put(172,17){\vector(1,0){38}}

\put(154,60){\vector(0,-1){35}}
\put(154,25){\vector(0,1){35}}
\put(210,72){\vector(-1,0){37}}
\put(210,17){\vector(-1,0){40}}
\put(220,30){\vector(0,1){30}}
\put(220,60){\vector(0,-1){30}}
\put(140,5){\makebox(30,15)[t]{$UA_d$}}
\put(105,-2){\makebox(30,15)[t]{(3)}}
\put(105,55){\makebox(30,15)[t]{(2)}}
\put(140,60){\makebox(30,15)[t]{$WUA_d$}}
\put(65,60){\makebox(30,15)[t]{$WUA$}}
\put(65,5){\makebox(30,15)[t]{$UA$}}
\put(75,35){\makebox(30,15)[t]{(1)}}
\put(210,60){\makebox(30,15)[t]{$DCF$}}
\put(212,5){\makebox(20,15)[t]{$TUA$}}
\end{picture}
\end{center}

%\vskip-10pt


The equivalences in the right hand square are proved in Theorem~\ref{BigThm}.
The implication (1) is trivial. The properness of the implication (2) is
proved by the example given in
Theorem~\ref{Main_Example}.
(For the proof see section~\ref{sec5}.) This proves also properness of the
implication (3) established directly in Theorem~\ref{Main_Example}.

%\vspace{-4mm}
\subsection{Preliminaries on truncations and
approximations}\label{Preliminaries}

%\vspace{-2mm}

The interior, closure, boundary, and diameter of a set $A$ in a metric
space $X$ are
denoted by
$\inter(A)$, $\cl(A)$, $\bd(A)$, and $\diam(A)$, respectively.
In what follows for $x,y\in\R^n$, $n=1,2,3,\cdots$, we will write
$||x-y||$ for the Euclidean distance between $x$ and~$y$.

For $f\in C(X)$ and $a,b \in \R$ with $a<b$ define the {\em
$(a,b)$-truncation} $g$ of $f$ by putting
$g(x)=f(x)$  when $f(x)\in [a,b]$, $g(x)=b$ when $f(x)\geq b$, and $g(x)=a$
when $f(x)\leq a$.
For $f,g\in C(X)$ we will write $[f=g]$ and $[f\neq g]$
for the sets $\{x\in X\colon f(x)=g(x)\}$ and $\{x\in X\colon f(x)\neq
g(x)\}$, respectively.


We give here several easy properties of truncations that will be
frequently used in the sequel.

%\begin{itemize}\end{itemize} \end{lemma}

\begin{lemma}\label{newRem} Let $X$ be a locally connected space and $f,g, h\in
C(X)$.
\begin{itemize}
  \item[(a)] If $g$ is a truncation of $f$ and ${ U}$ is a connected
component of $[f\ne g]$, then $g$ is constant on $\cl(U)$ and $g=f$ on
$\bd(U)$.
     \item[(b)] If $g$ is a truncation of $f$ and $Y\sq X$, then also
$g\restriction Y$ is a truncation of~$f\restriction Y$.
     \item[(c)] If $f$ is constant and $g$ is a truncation of $ f$, then $g$ is
                 locally constant.
     \item[(d)]  %if and only
     If $g$ is locally constant on $[f\neq g]$, then $g$ is a truncation of
$f$.
     \item[(e)] If $h$ is a truncation of $g$ and $g$ is a truncation of $f$,
                then $h$ is a truncation of $f$.
\end{itemize}
\end{lemma}
\begin{proof}
 (a) is proved in \cite[Lemma 5.3]{BDP1}, while (b) and (d) are obvious.

(c) Let $x\in X$ and $W$ be the connected component of $x$ in $X$.
Then $W$ is open since $X$ is locally connected. Thus it suffices to
 show that $g$ is constant on $W$.
If $f$ and $g$ agree on $W$ then there is nothing to prove.
So assume that $W\cap[f\neq g]\neq\emptyset$.
Let $U\subset W$ be a connected component of $W\cap[f\neq g]$.
By (b) $g\restriction W$ is a truncation of~$f\restriction W$,
hence $g$ is already constant on $W$  when $U=W$. Let us see now that
the case $U\ne W$ cannot occur. Indeed, by (a), $g$ is constant
on $\cl(U)$ and $g = f$ on
$\bd(U)$. Since $W$ is connected and $U\ne W$, the set $\bd(U)$ is
non-empty, so that
these two constants coincide. Hence $g\restriction{U}=f\restriction{U}$, a
contradiction.

(e) Let $x\in [h\ne f]\sq [h\ne g]\cup[g\ne f]$. If $x\in [h\ne g]$ then
$h$ is constant on some \nbd{} of $x$ since $h$ is a truncation of  $g$.
Suppose
$ x\in [g\ne f]$.
Then  there exists a connected \nbd{} $U$ of $x$ such that $g$ is constant
on $U$. By (b)
$h\restriction U$ is a truncation of  $g\restriction U$ so (c) yields that
$h\restriction U$ is constant. This proves that
$h$ is locally constant on $[h\ne f]$. Therefore, by (d), $h$ is a
truncation of $f$.
\end{proof}

\begin{lemma}\label{lem:1}
Let $g\in C(\R^n)$ be a truncation of $f\in C(\R^n)$.
If $\delta>0$ and $\e>0$ are such that
\begin{equation}\label{eq1}
\mbox{for every $x,y\in \R^n$ if $||x-y||<\delta$ then $|f(x)-f(y)|<\e$}
\end{equation}
then
\begin{equation}\label{eq2}
\mbox{for every $x,y\in \R^n$  condition
$||x-y||<\delta$ implies $|g(x)-g(y)|<\e$.}
\end{equation}
In particular, if $f\colon \R^n\to\real$ is u.c.
then so is every its truncation.
\end{lemma}

\begin{proof}
Let $\delta>0$ and $\e>0$ be such that (\ref{eq1}) holds
and by way of contradiction assume that
(\ref{eq2}) fails. Then there are
$x,y\in \R^n$ such that $||x-y||<\delta$ while $|g(x)-g(y)|\geq\e$.
Thus $x$ and $y$ cannot belong to the same
component of $[f\neq g]$. Let $I$ be a straight interval
connecting $x$ and $y$. Then there are $x',y'\in I$
such that $f(x')=g(x')=g(x)$ and  $f(y')=g(y')=g(y)$.
But this implies that
$|f(x')-f(y')|=|g(x)-g(y)|\geq\e$ while
$||x'-y'||\leq ||x-y||<\delta$, contradicting (\ref{eq1}).
\end{proof}

\begin{lemma}\label{lem:2} If $f\colon \R^n\to\real$ is $TUA$ and
$g\colon \R^n\to\real$ is a truncation of $f$ then $g$ is also $TUA$.
\end{lemma}

\begin{proof}
Recall \cite[cor.~6.20]{BDP1} that $h\in C(\R^n)$ is $TUA$
if and only if $h$ has $DCF$. So, assume that $f$ is $TUA$. Then $f$ has $DCF$.
It is enough to show that $g$ has $DCF$.
So, take different $y,z\in g[\R^n]$ and let
$U$ and $V$ be connected components of
$g^{-1}(y)$ and $g^{-1}(z)$, respectively. Since the boundary ${\rm bd}(U)$
separates $V$ from the interior
$\inter(U)$ of $U$ there is a connected component
$S$ of ${\rm bd}(U)$ which separates $V$ from $\inter(U)$. (This follows
from the unicoherence of
$\R^n$, cf. \cite[lemma~4.11]{BDP1}.)
 Similarly, there is a component $T$ of ${\rm bd}(V)$
which separates $U$ from the interior $\inter(V)$.
Now, for every $x\in U$ and $y\in V$ there are $x'\in S$ and $y'\in T$
such that $||x-y||\geq ||x'-y'||$. So, ${\rm dist}(U,V)={\rm dist}(S,T)$.
But $f\restriction{S\cup T}=g\restriction{S\cup T}$,
and $S$ and $T$ are subsets of different connected components
of fibers $f^{-1}(y)$ and $f^{-1}(z)$ of $f$.
Thus ${\rm dist}(U,V)={\rm dist}(S,T)>0$, since $f$ has $DCF$.
\end{proof}

\begin{remark}\label{general}
Note that $\R^n$ cannot be replaced by $\R\setminus \{0\}$ in
either Lemma~\ref{lem:1} or Lemma~\ref{lem:2}.
Indeed, here the identity function from $\R\setminus \{0\}$ to
$\R\setminus \{0\}$ has truncations that are not $TUA$.
\end{remark}

\begin{lemma}\label{lem:3}
Let $h\colon X\to\real$ be a truncation of
$f\colon X\to\real$ and let ${\cal V}$ be a family of some components of
$[f\neq h]$.
For every $V\in{\cal V}$ let $g_V\colon\cl(V)\to\real$
be some truncation of $f\restriction{\cl(V)}$, and define
$g\colon X\to\real$ by putting $g(x)=g_V(x)$ if $x\in \cl(V)$
for some $V\in{\cal V}$, and $g(x)=h(x)$ for all other $x\in X$.
Then $g$ is a truncation of~$f$.
\end{lemma}

\begin{proof}
First note that $[h=f]\sq [g=f]$, so that $[g\ne f]\sq [h\ne f]$. Let $C$ be a
connected component of $[g\ne f]$. Then there exists a connected component
$W$ of
$[h\ne f]$ such that $C\subset W$. If $W\notin{\cal V}$ then
$g\restriction W=h\restriction W$ and $h\restriction W$ is constant,
so $g\restriction C$ is constant.
If, on the other hand, $W\in{\cal V}$ then $g\restriction C=g_V\restriction C$
is again constant.
\end{proof}

$\la K,M\ra$-approximations are  easy to build via Kat\v etov's extension
theorem when $K$
is far from $M$:

\begin{lemma}\label{Kat} {\rm \cite{BD}}
Let $X$ be a metric space, $M\sq X$, and $K$ a compact subset of $X$ such that
$\cl(M)\cap K= \emptyset$. Then every $f\in C(X)$ admits a $\la
K,M\ra$-approximation.
\end{lemma}

This gives the following easy criterion for building $\la
x,M\ra$-approximations.

\begin{corollary}\label{KA}
Let $X$ be a metric space, $f\in C(X)$, and $M\sq X$
such that $f[M]$ is closed (in particular, finite) in $\R$. Then there exists
an $\la x,M\ra$-approximation of $f$ for every point $x\in X$.
\end{corollary}

\begin{proof}
Indeed, if $f(x)\in f[M]$ then it suffices to take the constant function
with value $f(x)$ as
an $\la x,M\ra$-approximation. If $f(x)\not \in f[M]=\cl(f[M])$, then
$x\not\in\cl(M)$. Now Lemma~\ref{Kat} applies to give an
$\la x,M\ra$-approximation of $f$.
\end{proof}

%\vspace{-4mm}
\section{A function that is $TUA$ but not $UA$}

%\vspace{-2mm}

\begin{theorem}\label{Main_Example}
There exists a $TUA$ function $f\colon\reals ^2 \to \R$ that is not $UA$.
\end{theorem}

\begin{proof}
Let $h\colon [0,1]\to[0,1]$ be the classical Cantor increasing function
locally constant on an open and dense subset $U$ of $(0,1)$.
We assume also that $h[U]\subset(0,1)$.

Let
$g\colon\real^2\to\real$ be such that $g(x,y)=h(x)$ for $x\in[0,1]$ and
$g(x,y)=x$ otherwise. Function $f$ is a modification of
$g$ obtained in the following way.

For every $n<\omega$ choose a finite set $S_n\subset U\times\{n\}$
such that $[0,1]\times\{n\}$ contains no interval of length $2^{-n}$
disjoint with $S_n$. For each
$s=\la t,n\ra\in S_n$ choose a closed disk
$D(s)$ centered at $s$  on which the function $g$ is constant.
We will also assume that the disks are
pairwise disjoint. It will be helpful to note also that all these disks are far
from the boarder of the rectangle $K_n:=[-n,n]\times [-(2n+1)/2,(2n+1)/2]$.

The function $f$ is obtained by modifying $g$ on each disk $D(s)$, with $s$
 from $S=\bigcup_{n<\omega}S_n$,
by putting $f(s)=1$, $f(x)=g(x)$ for every boundary point $x$ of $D(s)$,
and extending it to the rest of $D(s)$ to get a cone. (In fact, any continuous
extension would do.)
The function $f$ is as desired.

Indeed, first note that $f$ is $TUA$.
Every compact $K\subset\real^2$ is contained in some $K_n$, so it
suffices to argue with $K=K_n$. Note that the set $[f\ne g]$
(union of disks $D(s)$)
is far from the boarder of $K_n$. Now leaving $f$ unchanged on $K_n$, and
giving value $k(x)=g(x)$ for points $x$ outside of $K_n$ gives a u.c.
truncation $k$ of $f$ that agrees with $f$ on $K$. Indeed, $k$
differs from $g$,
which is $UC$, only on a compact set: the finite union of disks $D(s)$
contained in $K_n$.

To see that $f$ is not $UA$ let $M$ be a union of lines $L_0=\{0\}\times\real$,
$L_1=\{1\}\times\real$, and the set $S$
of all centers $s$ of disks $D(s)$. Thus $f[M]=\{0,1\}$.
Let $K=\{0,1\}\times\{0\}$ and by way of contradiction assume that there is
a $UC$ function $k$
agreeing with $f$ on $K$ and such that $k[M]\subset f[M]=\{0,1\}$.
Note that $k[\{\la 0,0\ra\}]=k[L_0]=\{0\}$, since
$L_0\subset M$
and $k(0,0)=f(0,0)=0$. Similarly  $k[\{\la 1,0\ra\}]=k[L_1]=\{1\}$.
Now, since $k$ is $UC$ there exists an $n<\omega$ such that
for every $x,y\in \real^2$ if $||x-y||<2^{-n}$ then $|k(x)-k(y)|<1$.
Let $\{s_0,\ldots,s_p\}$ be an increasing enumeration of
$S_n\cup\{\la 0,n\ra,\la 1,n\ra\}$.
Then $||s_i - s_{i+1}||<2^{-n}$ for every $i<p$.
Thus  $|k(s_i) - k(s_{i+1})|<1$ for every $i<p$.
But $k(s_i)\in f[M]=\{0,1\}$ for every $i\leq p$.
Thus, $k(s_i)=k(s_{i+1})$ for every $i<p$.
However this is impossible, since $k(s_0)=k(0,n)=0$
and $k(s_p)=k(1,n)=1$. This finishes the proof.
\end{proof}

\begin{remark} We will show in section~\ref{sec5} that the above example is
actually even non-$WUA$. But we prefer to give Theorem~\ref{Main_Example}
in this form since the verification that $f$ is not $UA$ is much easier
due to the relatively simple form of the set $M$, or more precisely,
the fact that $f[M]$ is just a doubleton. According to Corollary~\ref{KA}
such a set cannot witness $WUA$
for any singleton $K=\{x\}$. So, in section~\ref{sec5} we will have the
change the set~$M$.
\end{remark}

%\vspace{-4mm}
\subsection{$WUA\ \&\ TUA\ \&\ UA_d$ does not imply $UA$ on connected
subspaces of the plane}\label{subsec21}

%\vspace{-2mm}

The proof of Theorem~\ref{Main_Example} shows that actually the
restriction $f\restriction A$ of the function $f$ to the ``ladder space"
$A=L_0\cup L_1\cup ([0,1]\times \Z)$ is not $UA$, since both $M$ and $K$
are contained in $A$. Now we show that this restriction is also both
$WUA$ and $UA_d$. Obviously it is also $TUA$ since, $f$ is $TUA$.

\begin{theorem}\label{WUAnonUA}
The restriction $f\restriction A$ is both $WUA$ and $UA_d$.
\end{theorem}

\noindent {\sc Proof.} In the sequel we work only on the space $A$ and
accordingly we write simply $f$ instead of $f\restriction A$.
We start by proving a property stronger than just $UA_d$. Namely, we prove that
for every $M\sq A$ such that $f[M]$ is dense in $[0,1]$ one can build a
$\la K,M\ra$-approximation for every compact $K\sq A$. It will suffice to
find a $\la K_n\cap A,M\ra$-approximation for
$K_n$ as defined in the proof Theorem~\ref{Main_Example}.
Let $U=\bigcup_{t=1}^\infty U_t$, where each $U_t$ is an open subinterval
of $[0,1]$
and $U$ is the open set as in the proof of Theorem~\ref{Main_Example} on which
the Cantor function $h\colon[0,1]\to [0,1]$ is locally constant.
For every
$k\in\N$ with $k>n$  truncate $f$ on every set
$V_t^{(k)}=U_t\times \{k\}$,
$t\in \N$, at a level $f(m)$, where $m\in M$ is such that $h[U_t]\leq
f(m)<h[U_t]+1/k$.
For each
$x=\la x_1,x_2\ra\in A$ with either $x_1\notin U$ or $|x_2|\leq (2n+1)/2$
we leave $f(x)$ unchanged.
The function obtained that way (which, by Lemma~\ref{lem:3}, is a
truncation of $f$) will be denoted by $f_1$. Note that
$f_1$ coincides with $f$ on $K_n\cap A$. Moreover, for  $B_k=[0,1]\times
\{k\}$ with $|k|>n$
the oscillation $\osc_{B_k}(f_1-g)$ of $f_1-g$ on the set $B_k$ is at most
$1/n$, where
$g$ is the function from the proof of Theorem~\ref{Main_Example}.
Thus, we have also $\osc_{A\setminus K_n}(f_1-g)\leq 1/n$.

Let us see that $f_1$ is u.c. Take an $\varepsilon>0$
and choose a $k\in\N$ with $4/k<\varepsilon$. By the compactness of
$K_{k+1}$ there exists a $\delta\in(0,1)$ such that
$|f_1(x)-f_1(y)|<\varepsilon/2$
for every $x,y\in K_{k+1}$  with $||x-y||<\delta$.
Since $g$ is u.c. we can assume, decreasing $\delta$ if necessary, that
$$
|g(x)-g(y)|<\varepsilon/2\mbox{ for all }x,y\in A\mbox{ with }||x-y||<\delta.
$$
Now we show that this $\delta$ works for $f_1$ as well. Indeed, for
$x,y\in A$  with $||x-y||<\delta$ one has
either $x,y\in K_{k+1}$ (and then $|f_1(x)-f_1(y)|<\varepsilon/2$),
or one of the points $x$ and $y$, say $x$, does not belong to
$K_{k+1}$. Then $\delta < 1$ implies  that $x,y \nin K_k$.
This yields $|f_1(x)-g(x)|\leq 1/k$ and $|f_1(y)-g(y)|\leq 1/k$. Hence
$|f_1(x)-f_1(y)|\leq |g(x)-g(y)|+2/k\leq
\varepsilon/2+\varepsilon/2=\varepsilon.$
This proves that $f\restriction A$ is  $UA_d$.

To see that $f\restriction A$ is $WUA$ fix $x\in A$ and $M\sq A$.
We  will find a u.c. $\la x,M\ra$-approximation of $f\restriction A$.
Since for each $k\in \Z$ one has $f[B_k]=[0,1]$, it follows from the above
argument
that $f\restriction A$ has an $\la x,M\ra$-approximation for every $x\in A$
and every $M\sq A$ that is
dense in some $B_k$. Thus we will assume that for every $k\in \Z$
the set $M$ avoids
the closure of some open non-empty subinterval
$\Delta_k=(a_k,b_k)\times \{k\}$
of $B_k$.

An $\la x,M\ra$-approximation is easy to build via Lemma~\ref{Kat} when
$x\nin\cl(M)$. When $f(x)\in f[M]$ it is easy again: use the constant
function with value $f(x)$.
The last case shows that when $x\in L_0$
it makes sense to assume $0=f(x)\notin f[M]$ and, consequently, that $M\cap
L_0=\emptyset$.
Analogously, for  $x\in L_1$ we will concentrate on the case when $M\cap
L_1=\emptyset$.

Here is the main trick that will allow us to build $\la
x,M\ra$-approximation for all essential pairs $\la x,M\ra$.
Suppose that $x$ has an open bounded \nbd \ $V_x$ such that
the closure of $M'=M\setminus V_x$ is disjoint with $\cl(V_x)$.
Since $\cl(V_x)$ is compact, the distance between $M'$ and $V_x$ is positive.
Therefore, Kat\v etov's extension theorem applies to the u.c.
function $\rho$ from $Y=\cl(V_x) \cup \cl(M')$
to $[0,1]$, where $\rho\restriction \cl(V_x)=f\restriction \cl(V_x)$ and
$\rho\restriction \cl(M')$ is any constant with value in $f[M]$. The
uniform continuity of $\rho$ is granted by
the uniform continuity of both restrictions and
the positive distance between $M'$ and $V_x$.
Since $M\sq Y$ and $\rho[M]\sq f[M]$,
any u.c. extension $\ov{\rho}$ of $\rho$ will be an $\la
x,M\ra$-approximation of $f$.
In the sequel we aim to find such an open \nbd \ $V_x$ of $x$.
The argument splits into the following cases.

\begin{itemize}
\item[(a)] If $x\in L_0$ then $x\in \cl(M)$ and  $M\cap L_0=\emptyset$
imply $x=\la 0,n\ra$ for some $n\in \Z$. Now
disjointness of $M$ with $\Delta_n$ permits to take as $V_x$ the open
$T$-shaped set
$(\{0\}\times (n-1/2,n+1/2))\cup [0,a_n)\times \{n\}$.
Analogous argument works for $x\in L_1$.
   \item[(b)] So assume that $x=\la x_1,n\ra\in B_n\setminus (L_0\cup L_1)$
for some $n$. Since $M\cap \Delta_n=\emptyset$
and $x\in\cl(M)$ we have $x\not\in\Delta_n$ and
$x_1\in(0,1)\setminus(a_n,b_n)$.
We assume that $b_n\leq x_1<1$,
the case $0<x_1\leq a_n$ being analogous. We have two cases.
%and $x\in\cl(M)$ we have $x\not\in \Delta_n$, so that $b_n\leq x_1<1$.
%(The case $0<x_1\leq a_n$ is analogous.) We have two cases.
\begin{itemize}
   \item[(b1)] $M$ is not dense in $[x_1,1]\times \{n\}$.
Then there is an open subinterval $(c_n,d_n)$ of
$[x_1,1]$ such that $((c_n,d_n)\times \{n\})\cap M=\emptyset$.
Now take $V_x=(b_n,c_n)\times
\{n\}$ and use the trick described above.
   \item[(b2)] $M$ is dense in $[x_1,1]\times \{n\}$.
Here we have again two cases.
    \par (i) $1\nin f[M]$. This means of course that $M$ does not meet $L_1$.
         Now take $V_x=(b_n,1)\times \{n\}$ and repeat the trick.
    \par (ii) $1\in f[M]$. Consider the function $\rho\colon A\to \R$ that
    coincides with $f$ on $[b_n,1]\times \{n\}$,
    takes value $1$ on the complement of $[a_n,1]\times \{n\}$ in $A$
    and $\rho$ is linear on $\Delta_n$. Clearly ${\rho}$ is u.c. and is
the desired $\la x,M\ra$-approximation of $f$. QED
\end{itemize}
\end{itemize}

\begin{remark}
The above function $f\in C(A)$ is $TUA$, $WUA$, $UA_d$ but not $UA$.
This should be compared with the function $g\in C(A)$ constructed in
\cite{BD} that is non-$WUA$. Actually, that function has countable fibers
and has no uniformly continuous non-constant truncations, so that its
non-$WUA$-ness was established in \cite{BD}
by the existence of a magic set $M_g$ of $g$ that forces all
$\la x,M_g\ra$-approximations of $g$ to be truncations of $g$. Obviously such
a function $g$ is $DCF$.\footnote{Every
{\em light\/} function (i.e., with totally disconnected fibers) is $DCF$.}
Since $M_g$ must be dense, this
proves actually that $g$ is not even $WUA_d$. This should be compared with
Theorem~\ref{BigThm} where we prove that $DCF=WUA_d$ for $C(\R^n)$.
\end{remark}

%\vspace{-4mm}
\section{$TUA$ implies $UA_d$}

%\vspace{-2mm}

\begin{theorem}\label{TUA>UA_d}
$TUA$ implies $UA_d$ in $C(\R^k)$.
\end{theorem}

\noindent{\sc Sketch of the proof.} Let $f\colon \real^k\to\real$ be $TUA$,
$K\subset \real^k$ be compact, and $M$ be a dense subset of $\real^k$.
We will construct a u.c function $h\colon \real^k\to\real$ such that
$h\restriction{K}=f\restriction{K}$ and
\begin{equation}\label{eq3}
h[M]\subseteq f[M].
\end{equation}
It seems natural to take  a u.c. truncation $h_0$ of $f$
that  agrees with $f$ on $K$. But then (\ref{eq3}) need not
be satisfied. The main difficulty to overcome is to ensure the
inclusion (\ref{eq3}). Our plan is to define a sequence $\la h_n\colon
n<\omega\ra$
of u.c. functions from $\real^k$ into $\real$ that modify $h_0$ and
approximate $f$
by means of a sequence
$\la g_n\colon n<\omega\ra$ of truncations of $f$ (hence, by Lemma~\ref{lem:2},
of $TUA$ functions) starting with
$g_0=f$ and such that each $g_n$
satisfies $g_n[M]\sq f[M]$, and
agrees with $h_{n-1}$ on $K_{n-1}$,
where $K_{n-1}$ is the closed ball with radius $n$ and center $0$.
With this assumption the common limit $h$ of the sequences $g_n$ and $h_n$
is u.c., agrees with $f$ on $K$, and satisfies (\ref{eq3}).

\medskip\medskip

\noindent{\sc Detailed description of the construction.} We construct the
sequences $\la g_n\colon n<\omega\ra$ and
$\la h_n\colon n<\omega\ra$ by induction on $n<\omega$.
It makes no harm to think that our original compact set $K$ is contained in
$K_0$. (Otherwise the induction should start from some $n_0<\omega$.)

To carry out the (much easier) {\em $h$-part of the construction\/} note that
if $g_n$ is a $TUA$ function, imitating the first step with $h_0$, we
can more generally define at each step $n<\omega$ a function $h_n$ such that:
\begin{equation}\label{H_n}
h_n\mbox{ is a u.c. truncation of }g_n\mbox{ and }
{h_n}\restriction{K_n}={g_n}\restriction{K_n}.
\end{equation}
The existence of such a truncation $h_n$ is an immediate
consequence of the definition of $TUA$.
The following fact will be used in the sequel.

\begin{lemma}\label{claim1}
If $V$ is a component of $[g_n\neq f]$ intersecting $K_n$ then
it is also a component of $[h_n\neq f]$ and
${g_n}\restriction{V}={h_n}\restriction{V}$.
\end{lemma}
\begin{proof}
Let $x\in V\cap K_n$. Then $f(x)\ne g_n(x)=h_n(x)$, thus
$x\in [h_n\ne f]$. Clearly $g_n[V]=\{g_n(x)\}$.
Thus $h_n\restriction V$ is a truncation of
the constant function $g_n\restriction V$ (Lemma \ref{newRem} (b)),
so it is constant (Lemma \ref{newRem} (c)), since
$V$ is connected and locally connected.
Therefore $g_n[V]=\{g_n(x)\}=\{h_n(x)\}=h_n[V]$
and so the functions $h_n$, $g_n$, and $f$ agree on the boundary of $V$.
Thus, $V$ is a component of $[h_n\neq f]$.
\end{proof}

\medskip

Next we describe the more complicated {\em $g$-part of our construction}.
We shall build a function $g_{n+1}$ with properties $G_n$(i)--$G_n$(iv)
given below under the
assumption that for some $n<\omega$ the
functions $h_n$ and $g_n$ are already constructed with
the properties $G_{n-1}$(i)--$G_{n-1}$(iv).

\begin{description}
\item[{\rm G$_n$(i):}]
${g_{n+1}}\restriction{K_n}={g_{n}}\restriction{K_n}$. (Hence
${g_{n+1}}\restriction{K_n}={g_{n}}\restriction{K_n}={h_n}\restriction{K_n}$.)
\item[{\rm G$_n$(ii):}] $g_{n+1}$ is a truncation of $f$ (so a $TUA$
function) such that
             $|g_{n+1}(x)-h_n(x)|<2^{-n}$ for every $x\in \real^k$.
\item[{\rm G$_n$(iii):}] If $V$ is a component of $[g_n\neq f]$
intersecting $K_n$ then
           it is also a component of $[g_{n+1}\neq f]$ and
           ${g_n}\restriction{V}={g_{n+1}}\restriction{V}$.
\item[{\rm G$_n$(iv):}] $g_{n+1}[M]\sq f[M]$.
\end{description}

\noindent{\sc Definition of the truncation  $g_{n+1}$ of $f$.}
Define $g_{n+1}(x)=h_n(x)$ on $[h_n=f]$. To extend $g_{n+1}$
on $[h_n\ne f]$ note that since $h_n$ is a truncation of $g_n$
and $g_n$ is a truncation of $f$ we can conclude
by Lemma~\ref{newRem}(e) that
$h_n$ is a truncation of $f$. For every component $U$ of
$[h_n\neq f]$ we define the restriction
$g_U$ of $g_{n+1}$ on $\cl(U)$ as follows.

We don't change $h_n$ on $\cl(U)$, i.e., we leave $g_U=
h_n\restriction{\cl(U)}$
if $U$ intersects $K_n$.
Otherwise, setting $\{z\}=h_n[U]$,  we choose $a\in(z-2^{-n},z] \cap f[M]$ and
$b\in[z,z+2^{-n})\cap f[M]$. Such $a$ and $b$ exist by the density of
$f[M]$ in $f[\R^k]$,
which follows from the density of $M$ in $\R^k$.
In this case let $g_U\colon {\rm cl}(U) \to[a,b]$ be the $(a,b)$-truncation
of $f\restriction{\cl(U)}$.

\begin{lemma}
$g_{n+1}$  satisfies {\rm G$_n$(i)--G$_n$(iv)}.
\end{lemma}
 \begin{proof}
{G$_n$(i):} Take an $x\in K_n$ and note that $h_n(x)=g_n(x)$. If $h_n(x)=f(x)$
then $g_{n+1}(x)=h_n(x)=g_n(x)$. On the other hand if $h_n(x)\ne f(x)$ then
take the
connected component $U$ of $[h_n\ne f]$ containing $x$ and notice that
$x\in K_n\cap U$. So
$g_{n+1}(x)=g_U(x)=h_n(x)=g_n(x)$.
This proves G$_n$(i).

{G$_n$(ii):} $g_{n+1}$ is a truncation of $f$ by Lemma~\ref{lem:3}
and consequently $g_{n+1}$ is $TUA$ by Lemma~\ref{lem:2}, since $f$ is $TUA$.
The rest of the condition G$_n$(ii) is clear from the definition.

{G$_n$(iii):}  Let $V$ be  a connected component  of $[g_n\neq f]$
intersecting $K_n$.
Then, by Lemma \ref{claim1}, it is also a connected component of
$[h_{n}\neq f]$. So
$V\cap K_n\ne \emptyset$ implies
$g_{n+1}\restriction\cl(V)=g_V=h_n\restriction\cl(V)$.
In particular $g_{n+1}\restriction\bd(V)=h_n\restriction\bd(V)$ and we can
also conclude that
$g_{n+1}\restriction\bd(V)=f\restriction\bd(V)$. This proves that $V$ is
also a component of
$[g_{n+1}\neq f]$ and
${g_n}\restriction{V}={g_{n+1}}\restriction{V}$.

{G$_n$(iv):} Let $m\in M$. If $m\in [g_{n+1}=f]$ then obviously
$g_{n+1}(m)\in f[M]$.
Therefore assume that $m\in  [g_{n+1}\neq f]$ and let $V$ be the component of
$[g_{n+1}\neq f]$ containing $m$.
Since by the definition of $g_{n+1}$ we have $[g_{n+1}\ne f]\sq [h_n\ne f]$, it
is clear that such a connected component $V$ must be contained in a
connected component $U$ of
$[h_n\ne f]$.

If $U$ intersects $K_n$ then $g_{n+1}$ coincides with $h_n$ on $U$.
Therefore $U=V$.
Choose an $x\in K_n\cap U$. Then $g_n(x)=h_n(x)\ne f(x)$, so $x$ belongs to
a connected component $W$ of $[g_n\ne f]$. By Lemma \ref{claim1} $W$ is also a
connected component of $[h_n\ne f]$, hence  $W=V$. As $V=W=U$ turned out
to be a connected component of $[g_n\ne f]$ that intersects $K_n$, condition
G$_n$(iii) and the inductive hypothesis G$_{n-1}$(iv)
imply that $g_{n+1}(m)=g_n(m)\in f[M]$. Hence $G_n$(iv) is satisfied in
this case.

Now assume that $U$ does not intersect $K_n$.
Then let $a$ and $b$ be as
described above in the definition of $g_{n+1}$.
We have now necessarily $g_{n+1}(m)\in f[M]$ as $g_{n+1}$ is
an $(a,b)$-truncation of $f$ and $g_{n+1}(m)$, being distinct from $f(m)$,
must coincide with
$a$ or $b$.
\end{proof}

This finishes the inductive construction.

Now, by conditions G$_n$(i), for every $x\in \real^k$ the sequence
$\la g_n(x)\colon n<\omega\ra$ is eventually constant.
Let $g(x)=\lim_{n\to\infty} g_n(x)$. Note that
\begin{equation}\label{eq4}
g\restriction{K_n}=g_n\restriction{K_n}.
\end{equation}


\begin{lemma} $g$ is u.c. and $g[M]\sq f[M]$. \end{lemma}

\begin{proof} Inclusion $g[M]\sq f[M]$ follows directly from condition
G$_n$(iv) and the
definition of $g$. We will next show that $g$ is u.c.

So, fix an $\e>0$. We will find a $\delta>0$ such that
\[
\mbox{if $||x-y||<\delta$ then $|g(x)-g(y)|<\e$.}
\]
For this first find an $n<\omega$ such that
$\sum_{m=n}^\infty 2^{-m}<\e/3$.
Since $h_n$ is u.c. we can find
$\delta>0$ such that
\[
\mbox{if $||x-y||<\delta$ then $|h_n(x)-h_n(y)|<\e/3$.}
\]
So, by
G$_n$(ii), if $||x-y||<\delta$ then
\[
|g_{n+1}(x)-g_{n+1}(y)|\leq |h_n(x)-h_n(y)|+2\cdot 2^{-n}<\e/3+2\cdot 2^{-n}
\]
and, by Lemma~\ref{lem:1}, since $h_{n+1}$ is a truncation of $g_{n+1}$,
\[
\mbox{if $||x-y||<\delta$ then
$|h_{n+1}(x)-h_{n+1}(y)|<\e/3+2\cdot 2^{-n}$.}
\]
Continuing by induction we show that
for every $0<k<\omega$ if $||x-y||<\delta$ then
\[
|h_{n+k}(x)-h_{n+k}(y)|<\e/3+2\cdot \sum_{i=0}^{k-1} 2^{-(n+i)}<\e/3+2\e/3=\e.
\]
Since for every $x,y\in \real^k$ there is an $m>n$ such that
$g(x)=h_m(x)$ and $g(y)=h_m(y)$,
the above condition implies that for this fixed $\delta$
\[
\mbox{if $||x-y||<\delta$ then $|g(x)-g(y)|<\e$.}
\]
Thus $g$ is u.c. \end{proof}

This finishes the proof of Theorem~\ref{TUA>UA_d}
since $g$ is a $\la K,M\ra$-approximation of $f$ (as $g$ coincides with $f$
on $K$ by (\ref{eq4})).

\begin{remark}\begin{itemize}
   \item[(a)] $g$ is a truncation of $f$. For this let $U$ be
a connected open subset of $[f\ne g]$.
We will see that $g$ is locally constant of $U$.
Indeed, the connectedness of $U$
yields that $g$ is constant on $U$. Also, by (\ref{eq4}) we have
$[f\ne g]\sq \bigcup_n (K_n\cap [f\ne g_n])$. So every $x\in U$
has an open \nbd\ $V$ with  compact closure such that $V\sq K_n$ for some $n$.
Then $V\sq K_n \cap [f\ne g_n]$. As $g_n$ is a truncation of $f$ it follows that
$g_n$ is constant on $V$. By (\ref{eq4}) again this means that $g$ is
constant on $V$ too.
      \item[(b)] The above proof uses the density of $f[M]$ in $f[\R^k]$
rather than the density of $M$ in $\R^k$.
      \item[(c)] The implication $TUA \Rightarrow UA_d$ is not always true,
so that the choice of $\R^n$ plays
an important role. An example of a metric space $X$ and a continuous $TUA$
function $f\colon X\to \R$ that is not even $WUA_d$ is given in~\cite{BDP2}.
(Actually,
$X$ is the Hedgehog space with ${\bf b}$ many spikes; the
function $f$ admits a magic set $M_f$ with $f(0)\nin f[M_f]$
and has no uniformly continuous truncations $g$ with $g(0)=f(0)$;
therefore $f$ has no $\la x,M_f\ra$-approximation and so $f$ is
non-$WUA$. One can easily check that such a magic set must be necessarily dense,
hence we get automatically $f\not \in WUA_d$.)
    \item[(d)] The proof of Theorem \ref{WUAnonUA}
 shows that it is possible to replace $\R^n$ by other
nice spaces -- for example the
ladder space $A$ from section~\ref{subsec21}.
For a proof in a more general setting
 one needs more general forms of Lemmas
\ref{lem:1}--\ref{lem:3}. While Lemma~\ref{lem:3} works in a general
situation, we are not aware if this is
possible with Lemmas~\ref{lem:1} and \ref{lem:2}.  (See Remark~\ref{general}.)
\end{itemize}
\end{remark}

%--------------------- SECTION 4 ---------------------

%\vspace{-4mm}
\section{$UA_d \equi WUA_d \equi TUA \equi DCF$ in $\R^n$}\label{secUAd}

%\vspace{-2mm}

We already know that $DCF \equi TUA \to UA_d \to WUA_d$ in $\R^n$:
the equivalence $DCF \equi TUA$ was proved in~\cite[cor.~6.20]{BDP1},
the implication $TUA \to UA_d$ is a restatement of
Theorem~\ref{TUA>UA_d}, and
$UA_d \to WUA_d$ follows immediately from the definition. Thus it is enough
to prove that
$WUA_d\to DCF$ in $\R^n$. The argument is essentially the same as for
\cite[cor.~6.10]{BDP1} that $WUA\to DCF$ in $\R^n$.
In particular the proof of the next theorem is similar to that of
\cite[thm~6.8]{BDP1} --
we only need to show that by taking additional care the set $M$
witnessing non-$WUA$ can be chosen to be dense, in order to witness also
non-$WUA_d$.

\begin{theorem}\label{n.WUA}
Let $X$ be a separable metric
space and suppose that there is an uncountable set $Y \subseteq\R$
and for each $y \in Y$ a connected component $C^y$ of $f^{-1}(y)$
such that for some $z \in Y$
\[
\mbox{the distance between $C^y$ and $C^z$ is equal to $0$ for every $y \in
Y$.}
\]
Then $f$ is not $WUA_d$. \end{theorem}

\begin{proof}
Let $N = \bigcup_{y \in Y} C^y$. Since $N \subseteq X$ and
$X$ is a separable metric space, $N$ is separable.
Let $Y_0$ be the set of all $y\in Y$ for which
either $C^y$ has a non-empty interior in $N$ or
$f^{-1}(y)$ has a non-empty interior in $X$.
Since $Y_0$ is at most countable, we can pick $u\in Y\setminus Y_0$, $u\ne z$.  
Then the set $N\setminus C^u$ is not closed in $N$
and therefore there is a countable subset $\{y_n\colon n<\omega\}$
of
$Y\setminus\{u\}$ and for each $n<\omega$ a point $x_n\in C^{y_n}$
such that the sequence $\la x_n\ra$ converges to an $x\in C^u$.
Note that $f(x) \nin f[M_0]$, where
$M_0= \bigcup_n C^{y_n} \subseteq N \setminus C^u$.
Since, by the choice of $u$, the complement of the set $f^{-1}(u)$ is dense
in $X$
we can choose a dense countable subset $M_1$ of $X$ that does not meet
$f^{-1}(u)$. Hence
$f(x)\nin  f[M_1]$.
Therefore the set $M=M_0\cup M_1\cup C^z$ 
is dense in $X$ and $f(x)\nin f[M]$.
We show now that $f$ is not $WUA_d$. Suppose for a contradiction that
there is an $\la x, M\ra$-approximation $g\in C(X)$ of $f$.
Then $g[M]\subseteq f[M]$ is
countable, hence totally disconnected. So $g$ restricted to each
of the connected set
$C^{y_n}$ must be constant. In particular $g$ is constant on
$C^z$. Since $g$ is u.c.
and the distance between each $C^{y_n}$ and $C^z$ is equal $0$,
$g$ must be constant on the entire $M_0$, and so also on its
closure
$\cl(M_0)$. Since
$x \in\cl(M_0)$, $g$ has the constant
value $g(x) = f(x)$ on
$\cl(M_0)$. This however contradicts the inclusion $g[M] \subseteq
f[M]$ since $f(x)$ does not belong to the latter set.
\end{proof}

\begin{corollary}\label{lala}  If a  function $f \in C(\R^n)$ is $WUA_d$,
then it is $DCF$. \end{corollary}

\begin{proof} It was proved in \cite[thm~6.9]{BDP1} that if $f \in
C(\R^n)$ has two connected components $A, B$ of distinct
fibers at distance zero, then it has a family,
of cardinality of the continuum, of connected components of
distinct fibers such that each member of the family has distance
zero from both $A$ and $B$. Combined with Theorem~\ref{n.WUA}, this
shows that a function with two connected components of distinct
fibers at distance zero is not $WUA_d$.
\end{proof}

Corollary~\ref{lala} and the above discussion imply immediately the
following theorem.

\begin{theorem}\label{BigThm} $UA_d \equi WUA_d \equi TUA \equi DCF$ in $\R^n$.
\end{theorem}

The next corollary is valid also for the larger class of
semialgebraic functions, but we give it here for polynomial ones.
It follows immediately from Theorem~\ref{BigThm} and~\cite[lemma~6.21]{BDP1}.

\begin{corollary}
$UA \equi WUA \equi UA_d \equi WUA_d \equi TUA \equi DCF \equi DF$%
\footnote{$f$ is $DF$ ({\em has distant fibers}) if any distinct fibers
$f^{-1}(x)$ and $f^{-1}(y)$ are of positive
distance.} for polynomial functions $f\colon\reals ^n \to \reals$.
\end{corollary}

This corollary shows  in particular that for polynomial
functions $f\colon\reals^n \to \reals$
$UA$ coincides with $UA_d$ and $WUA$ coincides with $WUA_d$. The
example from Theorem~\ref{Main_Example}
along with Theorem~\ref{TUA>UA_d} shows that $UA$ does not coincide with
$UA_d$ in $C(\R^n)$.
Therefore the next objective will be to clarify whether $WUA$ coincides with
$WUA_d$. According to the above corollary, it suffices to check the
implication $TUA\to WUA$.

%\vspace{-4mm}
\section{$TUA$ does not imply $WUA$}\label{sec5}

%\vspace{-2mm}

We will show that the function $f$ from Theorem~\ref{Main_Example}
is not even $WUA$. This will be shown with $K$ being the singleton point
$x=\la 0,0\ra$ and a set $M$ constructed below.
We will use here the same notation as in the theorem.

Consider the intervals $I_n=(-2^{-n},-2^{-n-1})$, let
$J=\bigcup_{n<\omega}I_{2n+1}$, and put $P=(J\setminus\rational)\times\real$.
In what follows we will find an $M^0\subset P$
such that for every continuous function $h$ with $h(0,0)=0$
\begin{description}
\item{($\star$)} if $h[M^0]\subset f[M^0]\cup\{1\}$ then $h$ is constant on
$L_0$.
\end{description}

Let us see first how the proof will proceed once such an $M^0$ is found.
For this we define $M=M^0\cup S\cup L_1$
and by way of contradiction assume that there exists a u.c. function
$k\colon\real^2\to\real$ such that $k(0,0)=0$ and $k[M]\subset f[M]$.
Note that $f[M]\subset (J\setminus\rational)\cup\{1\}$,
so $f[M]$ is totally disconnected. Thus $k[L_1]=\{c\}\subset f[M]$ for some
$c\neq 0$ and, by ($\star$), $k[L_0]=\{0\}$. By the definition of
$P$,
between $0$ and $c$ there exists a nonempty open interval $I$
(one of of the intervals $I_{2n}$, if $c<0$, and $(0,1)$ if $c=1$)
which is disjoint with $f[M]$. Let $\e>0$ be the length of $I$. By the
uniform continuity
of $k$ there exists a $\delta>0$ such that for every $x,y\in\real^2$
if $||x-y||<\delta$ then
$|k(x)-k(y)|<\e$.
Choose an $n<\omega$ such that $2^{-n}<\delta$ and
let $\{s_0,\ldots,s_p\}$ be an increasing enumeration of
$S_n\cup\{\la 0,n\ra,\la 1,n\ra\}$.
Then $||s_i - s_{i+1}||<2^{-n}<\delta$ for every $i<p$.
Thus  $|k(s_i) - k(s_{i+1})|<\e$ for every $i<p$.
In particular $k(s_i)$ and $k(s_{i+1})$ stay on the same side of
$I$ for every $i<p$. But this implies that all
$k(s_i)$, with $i\leq p$, stay of the on the same side of
$I$. However this contradicts the fact that $k(s_0)=0$ and $k(s_p)=c$
are on the opposite sides of $I$. This contradiction shows that $f$ is not
$WUA$.


In order to construct $M^0$ satisfying ($\star$) let
$\la h_\xi\colon\xi<\continuum\ra$ be an enumeration of
all continuous functions $h\colon\real^2\to\real$ such that $h(0,0)=0$
and $h[L_0]\neq\{0\}$. We will construct by induction on $\xi<\continuum$ a
sequence
$\la m_\xi\colon\xi<\continuum\ra$
of elements of $P$ aiming for $M^0=\{m_\xi\colon\xi<\continuum\}$.
At stage $\xi$ we assume that all $m_\gamma$ with $\gamma<\xi$ are chosen
and let $M_\xi=\{m_\gamma\colon\gamma<\xi\}$.
We will add to $M^0$ a point $m_\xi\in P$ aiming for
\begin{equation}\label{eqA}
h_\xi(m_\xi)\not\subset f[M^0]\cup\{1\}.
\end{equation}
Clearly (\ref{eqA}) will imply ($\star$). To have
(\ref{eqA}) it is enough to choose an $m_\xi\in P$ such that
\begin{description}
\item{(a)} $h_\xi(m_\xi)\neq f(m_\xi)$,
\item{(b)} $h_\xi(m_\xi)\notin f[M_\xi]$, and
\item{(c)} $f(m_\xi)\neq h_\gamma(m_\gamma)$ for all $\gamma <\xi$.
\end{description}
For this note that since
$h_\xi$ is not identically $0$ on $L_0$, there exists a point $p=\la
0,y\ra\in L_0$ such that
$h_\xi(p)\neq 0=h_\xi(0,0)$.
So, there is an $a<0$ such that
\begin{equation}\label{eqB}
h_\xi[(a,0)\times\{0\}]\cap h_\xi[(a,0)\times\{y\}]=\emptyset.
\end{equation}
Since $f$ restricted to $(a,0)\times\{0\}$ is one-to-one
we can find an $x\in(a,0)\cap(J\setminus\rational)$ for which
$f(x,0)\neq h_\gamma(m_\gamma)$ for all $\gamma <\xi$.
Since we will choose $m_\xi$ as $\la x,z\ra$ for some $z$, this guarantees
satisfaction of (c).
Now, let $I^0$ be an interval (in $\real$) with endpoints $0$ and $y$
and let $I^1=\{x\}\times I^0$.
Note that, by (\ref{eqB}), $h_\xi$ has different values on the endpoints of
$I^1$. Thus $h_\xi[I^1]$ has cardinality continuum.
Therefore it is easy to choose $m_\xi\in I^1$
for which (b) holds and $h_\xi(m_\xi)\neq f(x,0)=f(m_\xi)$.
This finishes the construction and the proof of the theorem.

\begin{thebibliography}{Bare99}

\bibitem[BD]{BD} A. Berarducci,  D. Dikranjan, {\it Uniformly
approachable functions and $UA$ spaces},
Rend. Ist. Matematico Univ.  di Trieste {\bf 25} (1993), 23--56.

\bibitem[BDP1]{BDP1} A. Berarducci,  D. Dikranjan, and J. Pelant,
{\it Functions with distant fibers and uniform continuity},
 Topology Appl., to appear.

\bibitem[BDP2]{BDP2} A. Berarducci, D. Dikranjan, and J. Pelant,
{\it Uniform quasi components, thin spaces and compact separation}, 
submitted. Preprint available at
http://www.math.wvu.edu/homepages/kcies/STA/STA.html

\bibitem[B]{B} M.~R.~Burke,
{\it Characterizing uniform continuity with closure operations},
Topology Appl. {\bf 59} (1994), 245--259.

\bibitem[BC1]{BC} M.~R.~Burke, K.~Ciesielski, {\em Sets on which
measurable functions are determined by their range},
Canad. J. Math.  {\bf 49}(6) (1997), 1089--1116.

\bibitem[BC2]{BCL} M.~R.~Burke,  K.~Ciesielski,  {\em Sets of range
uniqueness for classes of continuous functions}, Proc. Amer. Math. Soc.
 {\bf 127} (1999), 3295--3304.

\bibitem[Ci]{Ci} K.~Ciesielski,
{\it Set Theory for the Working Mathematician},
London Math. Soc. Student Texts {\bf 39}, Cambridge Univ. Press 1997.

\bibitem[CD]{CD} K.~Ciesielski, D.~Dikranjan, {\em Uniformly
approachable maps}, Topology Proc. {\bf 20} (1995) 75--89.

\bibitem[CS]{CS} K. Ciesielski, S. Shelah, {\it Model with no
magic set}, J. Symbolic Logic {\bf 64}(4) (1999), 1467--1490.

\bibitem[DPR]{DPR} H.~G.~Diamond, C.~Pomerance, and L.~Rubel, {\em
Sets on which an entire function is determined by its range}, Math. Z.
{\bf 176} (1981), 383--398.

\bibitem[DP]{DP} D. Dikranjan, J. Pelant, {\it The impact of
closure operators on the structure of a concrete category},
Quaestiones Math. {\bf 18} (1995), 381--396.

\bibitem[DT]{DT} D. Dikranjan, W. Tholen, {\it Categorical
Structure of Closure operators with Applications to Topology,
Algebra and Discrete Mathematics},  Mathematics
and its Applications, Kluwer Academic Publishers, Dordrecht 1995.

\bibitem[E]{E} R. Engelking, {\it General Topology, Revised and
Completed Edition}, Sigma Series in Pure Mathematics, vol. {\bf
6}, Heldermann Verlag, Berlin, 1989.
\end{thebibliography}

%\noindent{\footnotesize Department of Mathematics,
%West Virginia University,
%Morgantown, WV 26506-6310 (KCies@wvnvms.wvnet.edu)}

%\noindent{\footnotesize Dipartimento di Matematica e Informatica,
%Universit\`{a} di Udine,
%(dikranja@dimi.uniud.it)}



\end{document}
