How does this proof concerning the farey sequence work exacty? In Hardy and Wright, sixth edition we have theorem 28 which states that if $\dfrac{h}{k}$ and $\dfrac{h'}{k'}$ are two consecutive terms in a Farey sequence:
$$kh'-hk'=1$$
and theorem 29 states that, if $\dfrac{h}{k}$, $\dfrac{h'}{k'}$ and $\dfrac{h''}{k''}$ are three consecutive terms in a Farey sequence:
$$\dfrac{h''}{k''}=\dfrac{h+h'}{k+k'}$$
Later, they prove that those two theorems are equivalent. First they prove that theorem 28 implies theorem 29 as follows:

The thing I don't understand is why $kh''-hk''=1$ since theorem 28 only states that $kh'-hk'=1$. Also I'm not entirely sure about how they would have solved those equations to get to the part where they say:
$$h''(kh'-hk')=h+h',\ k''(kh'-hk')=k+k'$$
 A: You have the misstated the hypothesis of Theorem 29. The terms are in a different order than you write.
Theorem 28 is a statement about adjacent terms in the sequence. Under the hypothesis of Theorem 29, $h/k$ and $h''/k''$ are adjacent terms, and $h''/k''$ and $h'/k'$ are adjacent terms, and Theorem 28 can be applied to either pair.

Further information added after OP’s comment:

I’m not sure what you changed. Your question still says “if $\dfrac{h}{k}, \dfrac{h'}{k'},$ and $\dfrac{h''}{k''}$ are three consecutive terms” which is not the correct hypothesis. Under the correct hypothesis ($\dfrac{h''}{k''}$ is the middle term), the equations follow from Theorem 28 applied to consecutive terms.
Regarding the second part of your question, assume that $kh''-hk''=1$ and $k''h'-h''k'=1$. Solve the first equation for $h''$ to obtain
$$h''=\frac{1+hk''}k,$$ then substitute this into the second equation.
$$k''h'-\frac{1+hk''}k\cdot k'=1$$
$$k''h'k-(1+hk'')k'=k$$
$$k''(h'k-hk')=k+k'$$ as claimed. The second equation can be obtained by solving for $k''$ first.
A: I think there is another way to prove that these two expressions are equivalent.
$$
\frac{\text{h}}{\text{k}},\frac{\text{h''}}{\text{k''}}\frac{\text{h'}}{\text{k'}}\,\,\text{are three consecutive terms in a farey sequence}
\\
\text{Statement A: h''k}-\text{hk''}=\text{1, h'k''}-\text{h''k'}=1
\\
\text{Statement B: }\frac{\text{h''}}{\text{k''}}=\frac{\text{h}+\text{h'}}{\text{k}+\text{k'}}
\\
\text{A implies B: Suppose  h''k}-\text{hk''}=\text{1, h'k''}-\text{h''k'}=\text{1, then}
\\
\text{h''k}-\text{hk''}=\text{h'k''}-\text{h''k'}\Rightarrow \text{h''}\left( \text{k}+\text{k'} \right) =\text{k''}\left( \text{h}+\text{h'} \right) \Rightarrow \frac{\text{h''}}{\text{k''}}=\frac{\text{h}+\text{h'}}{\text{k}+\text{k'}}
\\
\text{B implies A: Suppose }\frac{\text{h''}}{\text{k''}}=\frac{\text{h}+\text{h'}}{\text{k}+\text{k'}}, \text{then}
\\
\text{h''}\left( \text{k}+\text{k'} \right) =\text{k''}\left( \text{h}+\text{h'} \right) \Rightarrow \text{h''k}-\text{hk''}=\text{h'k''}-\text{h''k'}
\\
\text{Apply h''k}-\text{hk''}=\text{h'k''}-\text{h''k' for every term in the sequence,i.e. }\frac{0}{1},\frac{\text{h}_0}{\text{k}_0},\frac{\text{h}_1}{\text{k}_1},...
\\
\text{h}_{\text{i}}\text{k}_{\text{i}-1}-\text{h}_{\text{i}-1}\text{k}_{\text{i}}=\text{h}_{\text{i}-1}\text{k}_{\text{i}-2}-\text{h}_{\text{i}-2}\text{k}_{\text{i}-1}=\text{h}_{\text{i}=2}\text{k}_{\text{i}-3}-\text{h}_{\text{i}-3}\text{k}_{\text{i}-2}=...=\text{h}_0-0=\text{1, as h}_0\,\,\text{must be }1.
\\
\text{So h''k}-\text{hk''}=\text{1, h'k''}-\text{h''k'}=1
$$
