4. Given that the equation of line $l$ is $y=\frac{1}{2} x+1$, and a line $P Q \perp l$ is drawn through point $P(1,1)$, with $Q$ being the foot of the perpendicular. Then the equation of line $P Q$ is ( ).
(A) $y=-\frac{1}{2} x+3$
(B) $y=-\frac{1}{2} x+4$
(C) $y=-2 x+3$
(D) $y=-2 x+4$
4. C.

Let the equation of line $P Q$ be $y=k x+b$.
Since $P Q \perp l$, we know $k=-2$.
Substituting $P(1,1)$, we get $b=3$.
Therefore, the equation of line $P Q$ is $y=-2 x+3$.