Equivalence definitions of hyperelliptic curves I'm reading Fulton's algebraic curves book and on page 111, he defines hyperelliptic curves. For him an hyperelliptic curve $C$ is a curve which has a hyperelliptic weierstrass point $P$, i.e., $2$ is not a gap at $P\in C$.
So my question is, I didn't understand why this definition (I found in Yang's complex algebraic geometry book) is equivalent of Fulton's definition of hyperelliptic curves:

Anyone could help to clarify why this equivalence is true?
For example if there exists $f\in k(C)$ such that $(f)_{\infty}=P+P'+P''$, this point $P$ is hyperelliptic according to Fulton's definition but it's not according to Yang's definition.
Thanks
 A: First consider Fulton's definition. For the definition to make sense, we should have $g$ at least two. The point $P$ is a hyperelliptic Weierstrass point if $2$ is (not) a gap value at $P$. That means that:
$$\dim L(P) = 1,  \quad \dim L(2P) = 2.$$
Equivalently, $L(P)$, which already includes the constant functions $\mathbf{C}$, consists precisely  of constants, whereas there exists a non-constant function $f \in L(2P)$ which has a pole of order at most $2$ at $P$ and no poles anywhere else. Since $L(P) = \mathbf{C}$, we see that $f$ has a pole of order exactly $2$ at $P$, and so
$$(f) = (R) + (Q) - 2(P),  \quad R,Q \ne P$$
Note that $f$ has degree $2$, because it has two zeros and two poles. Conversely, suppose that there exists a non-constant function $f$ such that $(f) = (R) + (Q) - 2 (P)$. Then $L(2P)$ has dimension at least two. The space $L(P) = \mathbf{C}$ for any curve of genus $g \ge 1$, because otherwise a non-trivial element of $L(P)$ would give a degree one map to projective space which will be an isomorphism.
Now consider the other definition, namely, that we have a function $h$ on $X$ of degree two. It must have a divisor of the form:
$$(h) = (T) + (S) - (R) - (Q).$$
Since the degree of $h$ is two, both $T$ and $S$ are distinct from $R$ and $Q$. If $T = S$ then we win, because we can take $P = S$ and $f = h^{-1}$ above. One way to try to achieve this is to modify $h$ by adding a constant, note that:
$$(h') = (h + \lambda) = (T') + (S') - (R) - (Q),$$
That is, the zeros change, but the poles do not. The function $h'$ defines a map:
$$h': X \rightarrow \mathbf{P}^1$$
of degree two. By the Riemann-Hurwitz formula, we have
$$2g - 2 = 2(0 - 2) + \sum (e_P - 1)$$
where the sum is over  the ramification points of $h'$. In particular, since the degree is two, the ramification index $e_P$ is at most $2$ for any $P$, and we deduce from this that there are exactly $2g + 2$ ramification points. Note also that adding a constant to $h$ doesn't change the ramification points. Let $P$ be such a ramification point. The function $h$ has some value at $P$, choose $\lambda$ so that $h'$ vanishes at $P$.  We now have:
$$(h') = (P)+ (S) - (R) - (Q),$$
and that $h'$ is ramified at $P$. However, if $h'$ vanished to order $1$ at $P$, then $h'$ would be a local isomorphism at $P$. Hence we must have $S = P$, and so 
$$(h') = 2(P) - (R) - (Q),$$
and we are done. This argument also shows that if $X$ is hyperelliptic there are exactly $2g+2$ Weierstrass points.
