$\sigma(z_1\cdots z_d) \sigma(F({\ensuremath{\mathbf{z}}},t))$ on the left hand side of Equation contains a negative power of at least one variable in any term of its expansion.

With this in mind, for an element $A({\ensuremath{\mathbf{z}}},t) \in \mathbb{Q}[z_1,{\ensuremath{\overline{z}}}_1,\dots,z_d,{\ensuremath{\overline{z}}}_d][\![t]\!]$ we let $[z_k^{\geq}]A({\ensuremath{\mathbf{z}}},t)$ denote the sum of all terms of $A({\ensuremath{\mathbf{z}}},t)$ which contain only non-negative powers of $z_k$. Lemma \[thm:pospart\] then follows from the identity $$\sum_{\sigma \in \mathcal{G}}{\operatorname{sgn}}(\sigma)\cdot \sigma(z_1\cdots z_d) = (z_1-{\ensuremath{\overline{z}}}_1)\cdots(z_d-{\ensuremath{\overline{z}}}_d),$$ which can be proven by induction.

\[thm:pospart\] Let $F({\ensuremath{\mathbf{z}}},t)$ be the generating function counting the number of walks of length $n$ with marked endpoint. Then $$F({\ensuremath{\mathbf{z}}},t) = [z_1^{\geq}]\cdots[z_d^{\geq}]R({\ensuremath{\mathbf{z}}},t), \label{eq:pospart}$$ where $$R({\ensuremath{\mathbf{z}}},t) = \frac{(z_1-{\ensuremath{\overline{z}}}_1)\cdots(z_d-{\ensuremath{\overline{z}}}_d)}{(z_1\cdots z_d)(1-tS({\ensuremath{\mathbf{z}}})) }.$$

Since the class of D-finite functions is closed under positive series extraction – as shown in [@Li89] – an immediate consequence is the following.

\[cor:Dfinite\] Under the above conditions on [$\mathcal{S}$]{}, the generating functions $F({\ensuremath{\mathbf{z}}}, t)$ and (thus) $F({\ensuremath{\mathbf{1}}}, t)$ are D-finite functions.

The generating function as a diagonal
-------------------------------------

Given an element $$B({\ensuremath{\mathbf{z}}},t) = \sum_{n \geq 0}\left(\sum_{{\ensuremath{\mathbf{i}}}\in \mathbb{Z}^d} b_{{\ensuremath{\mathbf{i}}}}(n)z_1^{i_1}\cdots z_d^{i_d}\right)t^n  \in \mathbb{Q}[z_1,{\ensuremath{\overline{z}}}_1,\dots,z_d,{\ensuremath{\overline{z}}}_d][\![t]\!],$$ we let $\Delta$ denote the (complete) diagonal operator $$\Delta B({\ensuremath{\mathbf{z}}},t) := \sum_{n \geq 0} b_{n,\dots,n}(n) t^n.$$

There is a natural correspondence between the diagonal operator and extracting the positive part of a multivariate power series, 