If is such a manifold of dimension , and if is a compactly-supported -form, then as usual we can use a partition of unity to break up the form into pieces, each of which is supported within the image of an orientation-preserving singular -cube. For each singular cube , either the image is contained totally within the interior of , or it runs up against the boundary. In the latter case, without loss of generality, we can assume that is exactly the face of where the th coordinate is zero.
In the first case, our work is easy:
since is zero everywhere along the image of , and along .
In the other case, the vector fields — in order — give positively-oriented basss of the tangent spaces of the standard -cube. As is orientation, preserving, the ordered collection gives positively-oriented bases of the tangent spaces of the image of . The basis is positively-oriented if and only if is even, since we have to pull the th vector past others, picking up a negative sign for each one. But for a point with , we see that
for all . That is, these image vectors are all within the tangent space of the boundary, and in this order. And since is outward-pointing, this means that is orientation-preserving if and only if is even.
Now we can calculate
where we use the fact that integrals over orientation-reversing singular cubes pick up negative signs, along with the sign that comes attached to the face of a singular -cube to cancel each other off.
So in general we find
The last sum is finite, since on of the support of all but finitely many of the are constantly zero, meaning that their differentials are zero as well. Since the sum is (locally) finite, we have no problem pulling it all the way inside:
so the sum cancels off, leaving just the integral, as we’d expect. That is, under these circumstances,
which is Stokes’ theorem on manifolds.
Let’s take a manifold with boundary and give it an orientation. In particular, for each we can classify any ordered basis as either positive or negative with respect to our orientation. It turns out that this gives rise to an orientation on the boundary .
Now, if is a boundary point, we’ve seen that we can define the tangent space , which contains — as an -dimensional subspace — . This subspace cuts the tangent space into two pieces, which we can distinguish as follows: if is a coordinate patch around with , then the image of near is a chunk of the hyperplane . The inside of corresponds to the area where , while the outside corresponds to .
And so the map sends a vector to a vector in , which either points up into the positive half-space, along the hyperplane, or down into the negative half-space. Accordingly, we say that is “inward-pointing” if lands in the first category, and “outward-pointing” if if lands in the last. We can tell the difference by measuring the th component — the value . If this value is positive the vector is inward-pointing, while if it’s positive the vector is outward-pointing.
This definition may seem to depend on our choice of coordinate patch, but the division of into halves is entirely geometric. The only role the coordinate map plays is in giving a handy test to see which half a vector lies in.
Now we are in a position to give an orientation to the boundary , which we do by specifying which bases of are “positively oriented” and which are “negatively oriented”. Specifically, if is a basis of $ then we say it’s positively oriented if for any outward-pointing the basis is positively oriented as a basis of , and similarly for negatively oriented bases.
We must check that this choice does define an orientation on . Specifically, if is another coordinate patch with , then we can set up the same definitions and come up with an orientation on each point of . If and are compatibly oriented, then and must be compatible as well.
So we assume that the Jacobian of is everywhere positive on . That is
We can break down and to strip off their last components. That is, we write , and similarly for . The important thing here is that when we restrict to the boundary the work as a coordinate map, as do the . So if we set and vary any of the other , the result of remains at zero. And thus we can expand the determinant above:
The determinant is therefore the determinant of the upper-left submatrix — which is the Jacobian determinant of the transition function on the intersection — times the value in the lower right.
If the orientations induced by those on and are to be compatible, then this Jacobian determinant on the boundary must be everywhere positive. Since the overall determinant is everywhere positive, this is equivalent to the lower-right component being everywhere positive on the boundary. That is:
But this asks how the th component of changes as the th component of increases; as we move away from the boundary. But, at least where we start on the boundary, can do nothing but increase! And thus this partial derivative must be positive, which proves our assertion.