Algebra in Geometric Proof of Quadratic Reciprocity I am trying to understand the proof of quadratic reciprocity form the George Andrews textbook on number theory (this proof follows geometry and Eisenstein's thinking). I understand what is happening conceptually, but the finer points of inequality algebra are not obvious to me. We are given sets $\mu_1=\{q,2q,\cdots,\frac{1}{2}(p-1)q\}$ and $\mu_2=\{p,2p,\cdots,\frac{1}{2}(q-1)p\}$, with $\mu_1$ representing the negative least residues mod $p$ and $\mu_2$ representing the negative least residues mod $q$. Ultimately the proof shows $\mu_1+\mu_2$ is odd if and only if $p\equiv q\equiv3\pmod{4}$.
The author illustrates this by considering a hexagon $H$ with vertices $ABCDEF$ that lies within a rectangle $AGDJ$ (drawn in Quadrant $I$) that is bounded by $x=p/2$ and $y=q/2$. The attached picture provides additional information about the components of the rectangle.
For a point $(x,y)$ to lie in $H$, it must satisfy, $0<x<p/2$, $0<y<q/2$, $y<\frac{q}{p}x+\frac{1}{2}$, and $y>\frac{q}{p}x-\frac{q}{2p}$. The next step remarks that if $(m,n)$ is some lattice point in $H$, then so is $(\frac{p+1}{2}-m,\frac{q+1}{2}-n)$, where these two points are $equal$. This is verified by substituting "these coordinates" into the four inequalities above.
I'm not sure what is meant by "these coordinates." I assumed it meant $(m,n)$, so this is what I tried.
$\frac{q}{p}x-\frac{q}{2p}<y<\frac{q}{p}x+\frac{1}{2}\Rightarrow \frac{q}{p}m-\frac{q}{2p}<n<\frac{q}{p}m+\frac{1}{2} \Rightarrow qm-\frac{q}{2}<py<qm+\frac{p}{2}$
$\Rightarrow 2qm-q<2py<2qx+p$.
Any assistance would be appreciated.

 A: (Previous) Comments:
For "these coordinates", it appears that it just means that if $(m,n)$ satisfies the set of inequalities, then so does $((p+1)/2-m,(q+1)/2-n))$. However, it seems that you omit some information about "where these two points are equal". By looking at the picture, you see that $((p+1)/4,(q+1)/4)$ is the fixed point of of the involution $$(m,n)\mapsto ((p+1)/2-m,(q+1)/2-n).$$ This already gives the idea about counting the lattice points in the hexagon. Clearly if there is a fixed point  with integer coordinates if and only if both $p$ and $q$ are congruent to $3$ mod $4$ if and only if the number of lattice points in the hexagon is odd.
[Edit] The verification of the above fact is straightforward. Note that an interior point $(x,y)\in H$ satisfies $$\begin{array}{c}0<x<\frac p 2,\\ 0<y<\frac q 2~{\rm and~}\\
\frac q px-\frac q{2p}<y<\frac q p x+\frac 1 2.\end{array}\qquad (1)$$
If $(m,n)\in H$ is a lattice point, one needs to show that $\left(\frac{p+1}2-m,\frac{q+1}2-n\right)\in H.$
To do this, assume that $(m,n)\in H$ is a lattice point, i.e. $m,n$ are integers satisfying $$\begin{array}{c}0<m<\frac p 2,\\ 0<n<\frac q 2~{\rm and}\\ \frac{qm}p-\frac q {2p}<n<\frac{qm}p+\frac 1 2.\end{array}\qquad (2)$$ One needs to show that $\left(\frac{p+1}2-m,\frac{q+1}2-n\right)=\left(\left(\frac p 2-m\right)+\frac 1 2,\left(\frac q 2-n\right)+\frac 1 2\right)\in H,$ i.e. $$\begin{array}{c}0<\left(\frac p 2-m\right)+\frac 1 2<\frac p 2,\\ 0<\left(\frac q 2-n\right)+\frac 1 2<\frac q 2~{\rm and}\\ 
\frac q p\left[\left(\frac p 2-m\right)+\frac 1 2\right]-\frac q {2p}<\left(\frac q 2-n\right)+\frac 1 2 <\frac q p\left[\left(\frac p 2-m\right)+\frac 1 2\right]+\frac 1 2.\end{array}\qquad (3)$$ The first two inequalities in (3) are obvious from (2) and the fact that $m,n$ are positive integers. It remains to show the third inequality in (3) as follows: $$\frac q p\left[\left(\frac p 2-m\right)+\frac 1 2\right]-\frac q {2p}<\left(\frac q 2-n\right)+\frac 1 2 <\frac q p\left[\left(\frac p 2-m\right)+\frac 1 2\right]+\frac 1 2$$
$$\Leftrightarrow \frac q 2-\frac{qm}p<\frac q 2-n+\frac 1 2<\frac q 2-\frac{qm}p+\frac q {2p}+\frac 1 2$$
$$\Leftrightarrow -\frac{qm}p<-n+\frac 1 2<-\frac{qm}p+\frac q{2p}+\frac 1 2$$
$$\Leftrightarrow -\frac{qm}p-\frac 1 2<-n<-\frac{qm}p+\frac q{2p}$$
$$\Leftrightarrow \frac {qm}p-\frac q{2p}<n<\frac{qm}p+\frac 1 2,$$ which is true by the third inequality of (2). QED
A: After lots of questions and lots of attempts, here is the definitive algebra justifying the claim from this proof:
Consider the algebraic justification for $(m,n)=\left(\frac{p+1}{2}-m,\frac{q+1}{2}-n\right)$. Let $(m,n)$ be some lattice point within $H$, and let $(u,v)=\left(\frac{p+1}{2}-m,\frac{q+1}{2}-n\right)$ be some coordinate pair within $H$. To show the equality between forms, we must show $0<u<\frac{p}{2}, 0<v<\frac{q}{2}, v<\frac{q}{p}u+\frac{1}{2},$ and $v>\frac{q}{p}u-\frac{q}{2p}$. Call these Cases $1-4$, respectively.

*

*$0<u<\frac{p}{2}$
Assume $0<m<\frac{p}{2}\Rightarrow -\frac{p}{2}<-m<0$. Clearly $\frac{p+1}{2}-\frac{p}{2}=\frac{1}{2}<\frac{p+1}{2}-m<\frac{p+1}{2}$. Now,$\frac{p+1}{2}-m=\frac{p}{2}\Rightarrow m=\frac{1}{2}$, but $m$ is an integer, so $0<\frac{p+1}{2}-m<\frac{p}{2}$, i.e., $0<u<\frac{p}{2}$.


*$0<s<\frac{q}{2}$
Assume $0<n<\frac{q}{2}\Rightarrow -\frac{q}{2}<-n<0$. Clearly $\frac{q+1}{2}-\frac{q}{2}=\frac{1}{2}<\frac{q+1}{2}-n<\frac{q+1}{2}$. Now,$\frac{q+1}{2}-n=\frac{q}{2}\Rightarrow n=\frac{1}{2}$, but $n$ is an integer, so $0<\frac{q+1}{2}-n<\frac{q}{2}$, i.e., $0<v<\frac{q}{2}$.
For the remaining cases, let $n<\frac{q}{p}m+\frac{1}{2}$ and let $n>\frac{q}{p}m-\frac{q}{2p}$.


*$v<\frac{q}{p}u+\frac{1}{2}$
Consider $\frac{q+1}{2}-n<\frac{q}{p}\left(\frac{p+1}{2}-m\right)+\frac{1}{2}$. It is clear $\frac{q}{p}\left(\frac{p+1}{2}-m\right)+\frac{1}{2}$ $=\frac{q(p+1)}{2p}-\frac{q}{p}m+\frac{1}{2}=\frac{q}{2}+\frac{q}{2p}-\frac{q}{p}m+\frac{1}{2}=\frac{q+1}{2}-\left(\frac{q}{p}m-\frac{q}{2p}\right)$
$>v=\frac{q+1}{2}-n\left(\text{this follows from } n>\frac{q}{p}m-\frac{q}{2p}\right)$.


*$v>\frac{q}{p}u-\frac{q}{2p}$
Consider $\frac{q+1}{2}-n>\frac{q}{p}\left(\frac{p+1}{2}-m\right)-\frac{q}{2p}$. It is clear $\frac{q}{p}\left(\frac{p+1}{2}-m\right)-\frac{q}{2p}$ $=\frac{q(p+1)}{2p}-\frac{q}{p}m-\frac{q}{2p}=\frac{q}{2}+\frac{q}{2p}-\frac{q}{p}m-\frac{q}{2p}=\frac{q}{2}-\frac{q}{p}m=\frac{q+1}{2}-\left(\frac{q}{p}m+\frac{1}{2}\right)<v=\frac{q+1}{2}-n$ $\left(\text{this follows from } n<\frac{q}{p}m+\frac{1}{2}\right)$.
A: [Suggested changes: To be deleted]
After lots of questions and lots of attempts, here is the definitive algebra justifying the claim from this proof:
For a lattice point $(m,n)$ in $H$, we need to prove that the point $(u,v):=\left(\frac{p+1}{2}-m,\frac{q+1}{2}-n\right)$ also lies in $H$. Note that the assumption $(m,n)\in H$ means that $$0<m<\frac{p}{2}, 0<n<\frac{q}{2}, n<\frac{q}{p}m+\frac{1}{2},~{\rm and~}n>\frac{q}{p}m-\frac{q}{2p}.$$ To show that $(u,v)$ lies in $H$, we need to show that $$0<u<\frac{p}{2}, 0<v<\frac{q}{2}, v<\frac{q}{p}u+\frac{1}{2},~{\rm and~}v>\frac{q}{p}u-\frac{q}{2p}.\qquad (*)$$
Call these Cases in ($*$) $1-4$, respectively.

*

*$0<u<\frac{p}{2}$
Note that $0<m<\frac{p}{2}\Rightarrow -\frac{p}{2}<-m<0$. This implies $0<\frac 1 2=\frac{p+1}{2}-\frac{p}{2}<\frac{p+1}{2}-m<\frac{p+1}{2}$. Now,$\frac{p+1}{2}-m<\frac{p+1}{2}\Rightarrow \frac{p+1}{2}-m\leq\frac{p+1}{2}-1<\frac p 2,$ since $m$ is an integer. It follows that $0<\frac{p+1}{2}-m<\frac{p}{2}$, i.e., $0<u<\frac{p}{2}$.


*$0<v<\frac{q}{2}$
Similar to Case 1, $0<n<\frac{q}{2}\Rightarrow -\frac{q}{2}<-n<0$. This implies $0<\frac 1 2=\frac{q+1}{2}-\frac{q}{2}<\frac{q+1}{2}-n<\frac{q+1}{2}$. Now,$\frac{q+1}{2}-n<\frac{q+1}{2}\Rightarrow \frac{q+1}{2}-n\leq\frac{q+1}{2}-1<\frac q 2$, since $n$ is an integer. It follows that $0<\frac{q+1}{2}-n<\frac{q}{2}$, i.e., $0<v<\frac{q}{2}$.


*$v<\frac{q}{p}u+\frac{1}{2}$
It is equivalent to showing that that $\frac{q+1}{2}-n<\frac{q}{p}\left(\frac{p+1}{2}-m\right)+\frac{1}{2}$. For this, we have $\frac{q}{p}\left(\frac{p+1}{2}-m\right)+\frac{1}{2}$ $=\frac{q(p+1)}{2p}-\frac{q}{p}m+\frac{1}{2}=\frac{q}{2}+\frac{q}{2p}-\frac{q}{p}m+\frac{1}{2}=\frac{q+1}{2}-\left(\frac{q}{p}m-\frac{q}{2p}\right)$
$>\frac{q+1}{2}-n,$ where the last inequality follows from $n>\frac{q}{p}m-\frac{q}{2p}.$


*$v>\frac{q}{p}u-\frac{q}{2p}$
It is equivalent to showing that $\frac{q+1}{2}-n>\frac{q}{p}\left(\frac{p+1}{2}-m\right)-\frac{q}{2p}$. For this, we have $\frac{q}{p}\left(\frac{p+1}{2}-m\right)-\frac{q}{2p}$ $=\frac{q(p+1)}{2p}-\frac{q}{p}m-\frac{q}{2p}=\frac{q}{2}+\frac{q}{2p}-\frac{q}{p}m-\frac{q}{2p}=\frac{q}{2}-\frac{q}{p}m=\frac{q+1}{2}-\left(\frac{q}{p}m+\frac{1}{2}\right)<\frac{q+1}{2}-n,$ where the last inequality follows from $n<\frac{q}{p}m+\frac{1}{2}.$
