The Divergence Theorem in 1 dimension and $0$-dimensional manifolds I am currently studying about the divergence theorem in a vector-calculus class. This is a pure-mathematics class but we do not study the relevant concepts in the fully generalized differential-geometry setting. The way the divergence theorem was presented to us is as follows: 
Given a "smooth" open set $U\subseteq \mathbb{R}^n$ (a set where we can define an outwards-pointing normal vector on the boundary), and a vector field $F$ defined on $U$, then:
$$\int_{\partial U}outwardFlux(F)=\int_Udiv(F)$$
In addition, we were told that this can be thought of as a generalization of the fundamental theorem of calculus when $n=1$, since in that case, $div(F)=F'$, and the left-side integral simply becomes $F(b)-F(a)$ when $U=(a,b)$. However, this requires a definition of an integral on a $0$-dimensional manifold, which isn't something we defined properly (we only defined integral on $1,...,n-1$ dimensional manifolds using charts). 
I know that a $0$-dimensional manifold is simply a discrete set. How can an integral be defined on such a set? Is there a general definition of an integral on a manifold that can generalize nicely into $0$-dimensional manifolds? I am asking because I want to understand how the divergence theorem is a generalization of the fundamental theorem of calculus.
 A: When you integrate on an $n$-dimensional manifold, choosing local coordinates (i.e., a parameterization) is what allows you to look at the integral as an $(n+1)$-volume beneath a graph in $\mathbb{R}^{n+1}$, which represents your function in those coordinates:
$$\int_Mf=\int_{a_n}^{b_n}\cdots\int_{a_1}^{b_1}f(x_1,\ldots,x_n)dx_1\cdots dx_n$$
For example, for a $2$-manifold, you get a volume in $\mathbb{R}^3$; and for a $1$-manifold, you get the area (i.e., the volume-$2$) beneath a curve in $\mathbb{R}^2$.
On a $0$-manifold, you don't even have a choice of local coordinates to make and, at each point $p$ of that manifold, your graph is just $f(p)$ above the origin in $\mathbb{R}^1$. And what is the volume-$1$ of that (i.e., the length)? Clearly, it's just $f(p)$.
Now notice that, in every dimension, you have a choice of sign to make:
$$\int_a^bf(x)dx=-\int_b^af(x)dx$$
depending on which direction you perform the integral, and always have this choice, regardless of the dimension of your manifold:
$$\int_{a_1}^{b_1}\int_{a_2}^{b_2}f\,dxdy=-\int_{b_1}^{a_1}\int_{a_2}^{b_2}f\,dxdy=-\int_{a_1}^{b_1}\int_{b_2}^{a_2}f\,dxdy=\int_{b_1}^{a_1}\int_{b_2}^{a_2}f\,dxdy$$
 This is related to a choice of $\textit{orientation}$ and it's only natural that you allow yourself to do this aswell in $0$-dimensions by just picking a sign for each point.
So, for the signs to match, these theorems (Stokes, Divergence, etc) need to tell you what orientations to pick. And that's what they're doing when you see stuff like "$\textit{outward}$ flux" or "$\textit{anticlockwise}$ path".
Now, I don't think it really makes much sense to try and bring the concept of "outward flux" to the boundary of a $1$-manifold. But you do have to pick orientations at these points and the correct orientations are: positive at the upper bound of the coordinate that you chose for your $1$-manifold and negative at the lower bound.
I hope this helps.
A: Yes, you first need to generalize integration to mean something more than you see in, e.g., Riemann integration of a function on an interval.
Let's try and motivate why we are doing this.  The naive way of thinking about integration on $\mathbb{R}$ is that, for every interval $[a,b]$, there is some map $\int_a^b$ that takes an integrable (we will not restrict ourselves to specific integration theories here) function $f\colon [a,b]\to\mathbb{R}$, and outputs a real number $\int_a^b f$.  There are various laws this satisfies, such as additivity, multiplication by constant, monotone.  There are two important conditions here for later generalizations


*

*integrating the constant function $1$ gives $\int_a^b 1=b-a$ is the length, or 1-dimensional volume of $[a,b]$.

*you have $\int_a^c f+\int_c^b f=\int_a^b f$ if $a<c<b$.  To generalize this to all $a,b,c$ means you have to define, for $a>b$, $\int_a^b=-\int_b^a$.  So thinking of $[a,b]$ as positively oriented if $b>a$, and negatively oriented if $b<a$, we have:



Integration on $\mathbb{R}$ takes an oriented interval $[a,b]$ and an integrable function $f$ to give a number $\int_a^b f$.

(There are further generalizations you could make, e.g. we take all linear combinations of intervals instead of just $\pm 1$ of a single interval in algebraic topology, but that is another topic for another day.)
Now we generalize this notion to higher dimensions.  On rectangles (in general, cuboids): integration on an oriented $n$-cuboid $[a_1,b_1]\times\dots\times[a_n,b_n]$ takes "integrable functions" to a number satisfying, in particular, the $n$-dimensional volume
$$
\operatorname{volume}([a_1,b_1]\times\dots\times[a_n,b_n])=\int_{[a_1,b_1]\times\dots\times[a_n,b_n]}1=\prod_{i=1}^n(b_i-a_i).
$$
Now what about $n=0$?  This formula says
$$
\operatorname{volume}\left(\prod_{i\in\varnothing}[a_i,b_i]\right)=\prod_{i\in\varnothing}(b_i-a_i)
$$
and empty product of real numbers is conventionally defined to be $1$ (one justification: $\prod_{i\in I\amalg J}a_i=\prod_{i\in I}a_i\times\prod_{i\in j}a_i$ has to make sense even when $J=\varnothing$), and empty product of sets is a single point.  So integration on a $0$-dimensional cuboid (i.e., a single point) is then the sign from orientation multiplied by the function value at the point.
A: Let $M$ be a compact $0$-dimensional manifold. Then $M$ is just a finite set, $$M=\{p_1,\ldots,p_n\}.$$ An orientation on $M$ is a choice of sign for each point in $M$. In other words, an orientation is a function $$O:M\to\{-1,1\}.$$ Given a function $f$ on $M$, the integral of $f$ with respect to the orientation $O$ is defined by $$\int_Mf:=\sum_{i=1}^nO(p_i)f(p_i).$$
For example, consider an interval $[a,b]\subset\mathbb{R}$ with the standard orientation. The boundary is the compact, $0$-dimensional manifold $$\partial[a,b]=\{a,b\}$$ with the induced orientation $$O(a)=-1,\qquad O(b)=1.$$ For a function $f:[a,b]\to\mathbb{R}$, its integral on the boundary is thus given by $$\int_{\partial[a,b]}f=f(b)-f(a).$$
