solution verification – Proving DFT can determine Fourier coefficients

I’m trying to prove (not in a strictly formal sense) that the discrete Fourier transform can be used to find the coefficients of a Fourier series describing discretely sampled data. I wrote how to do this here on StackOverflow, but now I need to prove this for my dissertation.

Thanks to the similar questions feature, I’m aware of the proof given here that is exactly what I’ve been looking for, but I’m interesting in knowing if my approach is also valid.

Here’s what I have so far:

The Fourier series is defined as:
$f(phi) = frac{a_0}{2} + sum_{n = 1}^{N}{left(a_n cos{frac{2pi nphi}{P}} + b_n sin{frac{2pi nphi}{P}}right)}tag{1}$
with $a_n$ and $b_n$ defined by:

$a_n = frac{2}{P}int{f(phi) cos{(2pi nphi)}~dphi}tag{2a}$
$b_n = frac{2}{P}int{f(phi) sin{(2pi nphi)}~dphi}tag{2b}$

The discrete Fourier transform meanwhile is defined as:

$X_n = sum_{j = 0}^{N – 1}{x_j e^{-frac{2pi injphi}{N}}}tag{3}$

which, after using Euler’s identity, is:

$X_n = sum_{j = 0}^{N – 1}{left(x_jleft(cos{frac{2pi njphi}{N} – isin{frac{2pi njphi}{N}}}right)right)}tag{4}$

All of this is trivial and nothing I have issues with. However, now I start to do things I’m less certain of. If we let $N to infty$ to transform Equation 4 into an integral, we get:

$X_n = int{x_j(cos{(2pi nphi)} – isin{(2pi nphi)})~dphi}tag{5}$

Comparing Equations 2a and 2b to Equation 5 shows some pretty obvious similarities, but so do Equations 1 and 5. Based on this latter parallel, I take $P = N$ (this is the leap I’m least certain about) and so, from Equations 2a, 2b, and 5, and assuming $x_j$ is a representation of $f(phi)$, we get:

$X_n = c_n = frac{N}{2}(a_n – ib_n)tag{6}$

which is the desired result. Now, is this correct or have I committed a mathematical error?