Sorry for a silly question,
I am trying to prove the fact of intersection of two segments on the plane.
For example, $(d_1,d_2)$ is the first segment, where $d_1$ and $d_2$ are endpoint of the segment, and $(d_3,d_4)$ is the second segment.
One of the ways to show the existence of intersection is to show that $d_1$ and $d_2$ are placed on the different sides of the line $l(d_3,d_4)$ and $d_3$, $d_4$ on the different sides of $l(d_1,d_2)$.
It's very intuitive statement and obviously this should be true, but how to prove this.
How to prove that if endpoints of the one segment are located on the different sides of the another segment and vice versa show there is a intersection of segments.
Thanks!
WLOG (we can translate, rotate and scale), we can assume that $d_1 = (0,0)$ and $d_2 = (1,0)$. Define $\gamma(t) = d_3 + t (d_4 - d_3)$.
If $d_3$ and $d_4$ are on the same side of the line $l(d_1,d_2)$, eg. if they both have positive y-coordinate, then for $t\in[0,1]$, the y-coordinate of $\gamma(t)$ will be positive and there will be no intersection. By symmetry, if $d_1,d_2$ are on the same side of $l(d_3,d_4)$ there will be no intersection either.
Now if all the points are on different sides of the respective lines, then by the mean value theorem there is a $t_0$ st. the y-coordinate of $\gamma(t_0)$ is zero (it takes positive and negative values and it is obviously continuous). Since $d_1,d_2$ are on different sides of the line $l(d_3,d_4)$, $\gamma(t_0)$ must be between $d_1$ and $d_2$, therefore there is an intersection.