# Explicit description of a left adjoint to the forgetful functor from Unif to Top

Let $$\newcommand\Unif{\mathrm{Unif}}\Unif$$ denote the category of uniform spaces and uniformly continuous functions and $$\newcommand\Top{\mathrm{Top}}\Top$$ the category of topological spaces and continuous functions. We have a forgetful functor $$\Unif\to\Top$$ which sends every uniform space to the topological spaces whose topology is induced by the uniformity.

Since the forgeful functor $$\Unif\to\Top$$ preserves initial sources, it has a left adjoint $$\Top\to\Unif$$. Thus to every topological space is associated a canonical uniformity compatible with its topology.

Is possible to give an explicit costruction of this uniformity?

I try to consider as set of entourages the set of the neighbourhoods of the diagonal, but I'm failed to show that every entourage $$U$$ contains $$V\circ V$$ form some entourage $$V$$.

It does not follow from the existence of a left adjoint $$F\colon \mathsf{Top}\to \mathsf{Unif}$$ that every topological space has a canonical uniformity compatible with its topology. There's no reason to expect that $$F(X)$$ is homeomorphic to $$X$$.
It turns out that a topological space admits a uniformity compatible with its topology if and only if it is completely regular. A completely regular space admits a finest uniformity compatible with its topology, called the fine uniformity, and the functor $$\mathsf{CReg}\to \mathsf{Unif}$$ which assigns to each completely regular space its fine uniformity is left adjoint to the forgetful functor $$\mathsf{Unif}\to \mathsf{CReg}$$. See the wikipedia article on Uniformizable space. See here for a concrete description of the fine uniformity in terms of covers (thanks to Henno Brandsma for the reference and nice answer).
To get the desired left adjoint $$\mathsf{Top}\to \mathsf{Unif}$$, one just needs to compose the fine uniformity functor with the complete regularization functor $$\mathsf{Top}\to \mathsf{CReg}$$ (which is left adjoint to the forgetful functor $$\mathsf{CReg}\to \mathsf{Top}$$). This functor takes a topological space $$X$$ and replaces the topology on $$X$$ by the one generated by the cozero sets (i.e. with basis consisting of the sets $$Y_f = \{x\in X\mid f(x)\neq 0\}$$, for all continuous functions $$f\colon X\to \mathbb{R}$$). This is described in the wikipedia article on Tychonoff space.