Here's what we did in class :
$f(z)=z^n-1$ has all of the $n$ $n^{th}$ roots of $1$ as it's zeroes. Let's say that $\alpha_1=e^{\iota(2\pi/n)}$ and $\alpha_j=(\alpha_1)^j$ for $j\in[1,n-1]$. So $1,\alpha_1,\alpha_2,...,\alpha_{n-1}$ are the said $n$ roots. This implies that :
$$z^n-1=(z-1)(z-\alpha_1)(z-\alpha_2)...(z-\alpha_{n-1})$$ $$\implies \dfrac{z^n-1}{z-1}=(z-\alpha_1)(z-\alpha_2)...(z-\alpha_{n-1})\overset{\text{def}}{=}P_n(z),\text{where }z\neq1$$
And as $\dfrac{z^n-1}{z-1}$ denotes the sum of the first $n$ terms of a geometric progression with the first term as $1$ and the common ratio as $z$, we can say that $\dfrac{z^n-1}{z-1}=1+z+z^2+...+z^{n-1}$, again for $z\neq 1$
From this, it can be said that :
$$P_n(z)=1+z+z^2+...+z^{n-1},\text{for }z\neq1~~~~~~~~~~~~~~...(1)$$
What our teacher did next was write $(1-\alpha_1)(1-\alpha_2)...(1-\alpha_{n-1})$ as $P_n(1)$ and equate it to $1+1+1^2+...+1^{n-1}=n$, from relation $(1)$, even though it forbids $z$ being $1$, claiming that $(1)$ was an identity and was applicable to $\Bbb C$.
I'm really confused about this. We derived it with the assumption that $z\neq1$ and I don't see why it shouldn't be taken into account.
Thank you!