Definition of iterated integral Single Integral
I've come to dislike the standard integral notation
$$
\int_a^b f(x) dx
$$
It is useful for calculation, and helpful I think for people first learning calculus, but I don't love it when thinking about a "pure math" style definition of integration. For that I prefer notation like
$$
\int_D f
$$
With the idea being that the integral a sort of function with two inputs: One indicating the function (as an element of some set of functions from one set to another) and the second indicating the subset of the domain over which the integral is to be calculated. The advantage of ths notatation is it removes the $(x)$ and $dx$ which, for a single integral, are entirely superfluous.
In more detail suppose we have two sets $A$ and $B$. We can consider the set of functions from $A$ to $B$ which I'll call $F(A, B)$. We also have the set of all subset of $A$: $\mathcal{P}(A)$. If we ignore technicalities about whether certain functions or regions are  valid for integration, then we can define the integral as a function:
\begin{align}
S: F(A, B) \times \mathcal{P}(A) &\to B\\
S(f, D) &\mapsto \int_D f
\end{align}
Where the integral on the right hand side is defined as usual (as a Reimann, or Lebesgue integral or whatever you like).
I think this is all fine and some books even use the notation above for integration. If we wanted to be more careful we would define something like $F_I(A, B) \subset F(A, B)$ and $\mathcal{P}_I(A)\subset \mathcal{P}(A)$, which are functions and integration regions that are "valid" or "integrable" and these would be the domain of the integration functions $S$
Iterated Integrals
The above is fine for single integrals, but it breaks down for iterated integrals. For example, in calculus or physics we often must calculate integrals like
$$
\int_{x_0}^{x_f} \left(\int_{y_0}^{y_f} \left(\int_{z_0}^{z_f} f(x, y, z) dz\right) dy\right) dx
$$
These integrals are of a different sort than the ones above, and it seems we can't as easily dispense with the $dx$ notation.
Look at the inner integral
$$
\int_{z_0}^{z_f} f(x, y, z) dz
$$
In the notation above we have that
$$
f: A\times A \times A \to B
$$
First, This integral, instead of returning an element of $B$ instead returns a new function whose domain is now $A\times A$ into $B$. This would require a different definition than the one I have given above.
Second, in this case the $(x, y, z)$ which follows $f$, along with the pattern $dzdydx$ appearing at the end of the integral encode important information about which component should be integrated over in each integral.
The Questions
I have sort of two questions.

*

*Is it possible to come up with a notation like $\int_D f$ which will generalize for multiple integrals?

and/or


*Is it possible to give a rigorous (i.e. set theoretic?) definition of something like $\int_{z_0}^{z_f} f(x, y, z) dz$ which captures the facts that (a) this overall expression is actually a function rather than a real number, (b) if a latter integral is performed then x corresponds to the 1st component and y the second.

Further Speculation
The latter point is kind of funny to me. It feels to my like the $dzdydz$ at the end of the integral is indicating which component should be integrated, but it is doing by using the name of the component rather than the number. Then, the $(x, y, z)$ is like a dictionary that maps these names to numbered coordinates.
For example I could write
$$
\int_{x_0}^{x_f} \left(\int_{y_0}^{y_f}\left(\int_{z_0}^{z_f} f(y, x, z) dz\right) dy \right) dx
$$
In this case the first integral would be over the third component of $f(y, x, z)$ resulting in a new function $g(y, x)$. The second integral, of $dy$, would then be an integration of the FIRST coordinate of $g(y, x)$ (and this information had to somehow be communicated from the first to the second integral) resulting in a new function $h(x)$. The final integral would then be over the first coordinate.
When I first started writing this question I was imagining an answer where you would have some notation like
$$
\left(\int_D\right)_i
$$
which would perform an integration of the $i^{th}$ coordinate of the function involved. Such an integral could be defined by defining partial function of $f$, holding all components constant except the one being integrated over. But in the case above we would need to write
$$
\left(\int_{D_x}\right)_1\left(\left(\int_{D_y}\right)_1\left(\left(\int_{D_z}\right)_3 f\right)\right)
$$
This is unfortunate because this $(3, 1, 1)$ pattern is not as intuitive as $f(y, x, z) dz dy dx$.
My question boils down to: Is there a rigorous way to define iterated integrals that captures all of the details I raise above?
 A: One possible answer was suggested in the original question. Let $X = X_1 \times \ldots \times X_n$. Let $F(X, Y)$ be the set of functions from $X$ into $Y$. Suppose $f \in F(X, Y)$ so that
\begin{align}
f: X_1\times\ldots\times X_n &\to Y\\
f(x_1, \ldots, x_n) \mapsto y
\end{align}
We define the "$i^{th}$ partialization of $f$" as
\begin{align}
f_{i, (x_1, \ldots, x_{i-1}, x_{i+1}, \ldots x_n)}: X_i &\to Y\\
f_{i, (x_1, \ldots, x_{i-1}, x_{i+1}, \ldots x_n)}(x_i) &\mapsto f(x_1, \ldots, x_n)
\end{align}
With this we can define integration over the $i^{th}$ component of $f$:
\begin{align}
S_i: F(X_1\times\ldots\times X_n, Y)\times \mathcal{P}(X_i) &\to F(X_1\times\ldots \times X_{i-1} \times X_{i+1} \times \ldots \times X_n, Y)\\
\end{align}
defined by
\begin{align}
S_i(f, D)(x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n) &= S(f_{i, (x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n)}, D)
\end{align}
Where $S(f_{i, (x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n)}, D)$ is the normal single integral
$$
S(f_{i, (x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n)}, D) = \int_D f_{i, (x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n)}
$$
We can introduce notation
$$
S_i(f, D)(x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n) = \int_D^{(i)} f
$$
An integral like
$$
\int_{x_0}^{x_f}\left(\int_{y_0}^{y_f}\left(\int_{z_0}^{z_f} f(y, x, z) dz\right) dy\right)dx
$$
Can then be rewritten with $D_1 = [z_0, z_f]$, $D_2 = [y_0, y_f]$, $D_3 = [x_0, x_f]$ as
$$
\int_{D_3}^{(1)}\left(\int_{D_2}^{(1)}\left(\int_{D_1}^{(3)} f\right)\right)
$$
One thing I find slightly confusing about this approaching (specifying the numerical value of the coordinate over which the integral is taken) is the following. In the example above the $x$ coordinate was the second coordinate in the first integral, the second coordinate in the second integral, but the first coordinate in the third integral. That is, the index of the coordinate might change if coordinates lower indices are integrated before coordinates of higher indices.
A speculative further approach.
One approach to alleviate this would be to use a notation like
$$
\int_{D_3}^{(1)}\left(\int_{D_2}^{(1)}\left(\int_{D_1}^{(3)} f\right)\right) = \int_{D_3}^{(x)}\left(\int_{D_2}^{(y)}\left(\int_{D_1}^{(z)} f(y, x, z)\right)\right)
$$
Note that this has no essential difference with the usual notation for iterated integrals. However, for this we need some added structure. In particular I think we need to add in an ordered list of variable names along with the name of the variable to be integrated as function arguments to the integral "function" and the integral function must return a new list of variable names. This is because if we look at the object
$$
\int_{D_1}^{(z)} f(y, x, z)
$$
on its own we know it needs to return a function of two variables, but furthermore, the information that the first variable is named $y$ and the second variable is named $x$ needs to be "passed forward" so that the subsequent integrals integrate over the appropriate variables.
Something like:
$$
S((f, (y, x, z)), D, z) = (S_3(f, D), (y, x))
$$
Here I've introduced a new type of object, maybe the "named coordinate function" which looks like $(f, (y, x, z))$ where the first element is a function and the second is an ordered list of names for the coordinates.
If we introduce the shorthand that
$$
(f, (y, x, z)) = f(y, x, z)
$$
We recover something close to the usual iterated integral notation. Unfortunately it's a little bit of an abuse of notation since $f(y, x, z)$ would normally stand for the element of $Y$ (the range) that the element (y, x, z) gets mapped to.
If this were python I would know how to write a function that looks at
$$
\int_{D_1}^{(z)} f(y, x, z)
$$
and pattern matches the $(z)$ up top to the third element of $(y, x, z)$ and therefore integrates over the third variable in $f$ and pops $z$ from the list to keep and return $(y, x)$, but in set theory I don't know how to write that definition down.
Notes
On the point of trying to fully formalize these concepts I'll point out that I don't really know how to fully formalize (in language of first order logic, or set theory, for example) the "$i^{th}$ partialization of $f$". That is, how do I write the function that takes in a tuple like $(X_1, \ldots, X_n)$ and returns the same tuple with the $i^{th}$ element omitted? similar barriers to formalization persist throughout these definitions.
