What are sufficient conditions on $f, g : \mathbb{R}^n \to \mathbb{R}$ such that $\{x : f(x) \geq t \} \cup \{ x : g(x) \geq u\}$ has piecewise-smooth boundary?

Some remarks:

I don't mind if the conditions are stronger than necessary. In my application, $f$ and $g$ will be extremely nice functions anyway. My dream is just to have a simple-to-state condition backed up by a citation.

Feel free to assume $f$ and $g$ are nonnegative, compactly supported, and $0 < t < \|f\|_\infty$, $0 < u < \|g\|_\infty$. I imagine you'll want them to be smooth, too :)

To be honest, I'm naive enough that I don't even know sufficient conditions on $f$ such that $\{x : f(x) = t\}$ is a piecewise-smooth $(n-1)$-dimensional hypersurface. Maybe it's enough that $f$ is smooth and $\nabla f$ has only finitely many zeros?

Perhaps it depends on the definition of "piecewise"? At first I thought that if $\{x : f(x) \geq t \}$ and $\{ x : g(x) \geq u\}$ both had piecewise-smooth boundary then their union would too. But now that looks to me like it could be wrong. E.g., for $n = 2$ the set of points $\{(x,y) : -1 \leq x \leq 1, y \leq \exp(-1/x^2) \sin(1/x)\}$ has piecewise smooth boundary. If we take its union with $\{(x,y) : -1 \leq x \leq 1, y \leq 0\}$, then the "top part" of the resulting set's boundary is the curve $\max(\exp(-1/x^2) \sin(1/x), 0)$. Is that a piecewise-smooth curve? Seems like you need to break it into a (countably) infinite number of pieces to get all pieces smooth. On the other hand, perhaps one could/should (nonstandardly?) define "piecewise-smooth" to allow for countably many pieces.

Why do I even

*want*the surface to be "piecewise-smooth"? Well, I want to apply a (higher-dimensional) version of the Cauchy-Crofton formula to it. In the textbooks I've looked at (e.g., Santalo) they usually assume that their surfaces are piecewise-$\mathcal{C}^1$. So really, I only need that, but I'm happy to require piecewise-smoothness if that makes things simpler. What I'd prefer*not*to have to do is to investigate what weaker conditions suffice for these Cauchy-Crofton-type formulas (e.g., is it okay for "piecewise" to allow for countably many pieces?).

Thanks very much, sorry for my naivete!