First of all, please let me admit that my math is very rusty so that I may not understand some basic concepts.
I'm reading Boyd & Vandenberghe's Convex Optimization. In the book, the authors state that:
A function is convex if and only if it is convex when restricted to any line that intersects its domain.
Honestly speaking, I have no idea what that line means. I know that restriction of the function is the identical function with smaller domain but not sure how it is applicable to the current situation.
I do some searching and feel that the application of above statement is to select 2 random points in the domain and check if they are convex. Hence, the "brute force" way to prove convexity is to keep doing that.
Can anyone verify that what I guess is true and, if it is, explain the connection between the "brute force" way and the statement made by the authors?
The function $f(x,y) = x^2 + y^2$ is convex and especially convex on the line $y = a x$ $f(x,ax) = (1+a^2)x^2$.
So what they mean is that $\Rightarrow$ if the function is convex, it is convex on any such line and $\Leftarrow$ if the function is convex on any line, it is convex on the entire domain.
They are using the word line here because convexity implies $f(tx + (1-t)y) \leq t f(x) + (1-t)f(y), \forall(x,y) \in\Omega, t \in [0,1]$, i.e. the line segment connecting $x$ and $y$ is of importance.