Analytic Proof of Wilson's Theorem I'm trying to find a reference for the following (analytic) proof of Wilson's Theorem. I would appreciate it immensely if some of you knew and told me the person who first came up with it. Here is the proof:
We start by considering the Maclaurin series of the function $f(x)=\ln \left( \frac{1}{1-x} \right)$, that is,
$\displaystyle \ln \left( \frac{1}{1-x} \right)= \sum_{n=1}^{\infty} \frac{x^n}{n} \tag*{}$
for $x \in [-1, 1).$
By simply using the definition of $\ln$ on the equation above, we get
$\displaystyle e^{x+\frac{x^2}{2}+\frac{x^3}{3}+ \cdots}=\frac{1}{1-x}=1+x+x^{2}+ \cdots + x^{p} + \cdots \tag{1}$
We can then rewrite the leftmost side of $(1)$ as
$\displaystyle \begin{align} e^{x+\frac{x^2}{2}+\frac{x^3}{3}+…} & = e^{x}e^{\frac{x^2}{2}}e^{\frac{x^3}{3}} \cdots \\ & = \prod_{n=1}^{\infty} e^{\frac{x^n}{n}} \\ & = \prod_{n=1}^{\infty} \sum_{k=0}^{\infty} \frac{\left( \frac{x^n}{n} \right)^k}{k!} \\ & = \left( 1+\frac{x}{1!}+\frac{x^2}{2!}+ \cdots \right) \cdot \left( 1+\frac{x^{2}/2}{1!}+\frac{(x^{2}/2)^2}{2!} + \cdots \right) \cdots \left(1+\frac{x^{p}/p}{1!}+\frac{(x^{p}/p)^2}{2!}+ \cdots \right) \cdots \\ & = 1+\frac{x}{1!}+x^{2} \left( \frac{1}{2!} + \frac{1}{2}\right)+x^{3} \left( \frac{1}{3!} + \frac{1}{1!} \frac{1/2}{1!} + \frac{1/3}{1!} \right) + \cdots + x^{p} \left( \frac{1}{p!} + \frac{1}{(p-2)!} \frac{1/2}{1!} + \cdots + \frac{1/p}{1!} \right)+ \cdots \end{align} \tag{2}$
Combining the rightmost sides of $(1)$ and $(2)$ together gives us
$\displaystyle 1+x+x^{2}+ x^{3}+ \cdots + x^{p} + \cdots= 1+\frac{x}{1!}+x^{2} \left( \frac{1}{2!} + \frac{1}{2}\right)+x^{3} \left( \frac{1}{3!} + \frac{1}{1!} \frac{1/2}{1!} + \frac{1/3}{1!} \right) + \cdots + x^{p} \left( \frac{1}{p!} + \frac{1}{(p-2)!} \frac{1/2}{1!} + \cdots + \frac{1/p}{1!} \right)+ \cdots , \tag{3}$
from which follows that the coefficient of $x^{p}$ on the RHS of $(3)$ is $1$. That is,
$\displaystyle \frac{1}{p!}+\frac{1}{(p-2)!} \frac{1/2}{1!}+ \cdots + \frac{1/p}{1!} = 1. \tag{4}$
Notice that such a coefficient is of the form $\frac{1}{p!}+\frac{r}{s}+\frac{1}{p}$, where $\frac{r}{s}$ is the sum of a finite number of rationals, none of which has the factor $p$ in its denominator. Therefore, if $\frac{r}{s}$ is irreducible, then $p$ doesn’t divide $s$. We then proceed by rewriting $(4)$ as
$\displaystyle \frac{1}{p!}+\frac{r}{s}+\frac{1}{p}=1. \tag*{}$
Equivalently,
$\displaystyle 1-\frac{r}{s}=\frac{1}{p!}+\frac{1}{p}=\frac{1+(p-1)!}{p!}, \tag*{}$
and
$\displaystyle (s-r) \cdot (p-1)! = \frac{s(1+(p-1)!)}{p}. \tag*{}$
Hence, $\frac{s(1+(p-1)!)}{p}$ is an integer. Moreover, since $p$ doesn’t divide $s$, $\frac{1+(p-1)!}{p}$ is also an integer. Equivalently, $(p-1)! \equiv -1 \text{ (mod } p)$, as desired.

An alternative viewpoint.

*

*Analytic part

In $\Bbb{Q}[[x]]$ we have
$$\frac1{1-x}=\prod_{n=1}^{\infty} \sum_{k=0}^{\infty} \frac{x^{nk}}{n^k k!}$$

*

*Algebraic part

Let $R=\Bbb{Z}_{(p)}[x,x^p/p]+x^{p+1}\Bbb{Q}[[x]]$ the subring of formal series such that $p$ doesn't divide the denominator of the coefficients of $x^m,m<p$ and $p^2$ doesn't divide the denominator of the coefficient of $x^p$.
In the quotient ring $$R/(p,x,x^{p+1}\Bbb{Q}[[x]])\cong \Bbb{F}_p+\frac{x^p}p\Bbb{F}_p$$ we get
$$1=\frac1{1-x}=\prod_{n=1}^{\infty} \sum_{k=0}^{\infty} \frac{x^{nk}}{n^k k!}=(1+\frac{x^p}p)(1+\frac{x^p}{p!})=1+(1+\frac{1}{(p-1)!}) \frac{x^p}p$$
And hence $$1+\frac{1}{(p-1)!}=0\bmod p$$
