In order for two linear lines to be perpendicular, the product of their gradient must be -1.
Let's take y = x + b and y = -x + b
This is already in the form: y = mx + b, where m is 1 and -1 respectively.
Since the product of their gradient is -1, they are said to be perpendicular.