TITLE: smooth functional to detect whether a function has a zero
QUESTION [11 upvotes]: Does there exist a function $F : C^\infty(\mathbb{R}, [0, \infty)) \to \mathbb{R}$ with the following properties:

$F(f) = 0$ if and only if there exists an $x \in [0,1]$ such that $f(x) = 0$.
$F$ is smooth in the following sense:  if $f(x,t) \in C^\infty(\mathbb{R} \times \mathbb{R}, [0,\infty))$ and $F$ is applied to $f$ in the $x$ variable, the function of $t$ that results is smooth ($C^\infty$).

The second question is whether the following candidate satisfies the smoothness property.  For $f \in C^\infty(\mathbb{R}, [0, \infty))$, define $G(f)$ to be
$$
    \left( \int_0^1 \frac{1}{f(x)} \, dx \right)^{-2}
$$
if $f$ has no zeros in $[0,1]$, and $0$ otherwise.
Then $G$ satisfies the first condition by definition,
and one can show that when $f$ is a function of $x$ and $t$ as above, $G(f)$ is (continuous and) differentiable as a function of $t$.  Is it smooth?
Edit: Willie Wong answered the second question in the negative.  So let's instead define $G(f)$ to be
$$
    \exp \left( -\int_0^1 \frac{1}{f(x)} \, dx \right)
$$
if $f$ has no zeros in $[0,1]$, and $0$ otherwise.
Is this $G$ smooth?

REPLY [4 votes]: A functional that works is
$$
  F(f)=\begin{cases} \exp(-\exp(\int_0^1 \frac{1}{f(x)}dx)), & \textrm{if $f(x)>0$ for all $x \in [0,1]$} \\
                     0,                                      & \textrm{otherwise}.
       \end{cases}
$$
The idea to use this formula and a sketch of the proof that it works are both due to Chengjie Yu.  The proof is in the appendix of a paper I wrote with Enxin Wu, Smooth classifying spaces, http://arxiv.org/abs/1709.10517
I don't know whether the functional described in the question, $G(f) = \exp(-\int_0^1 \frac{1}{f(x)} dx)$, works.