# mathlibdocumentation

analysis.convex.slope

# Slopes of convex functions #

This file relates convexity/concavity of functions in a linearly ordered field and the monotonicity of their slopes.

The main use is to show convexity/concavity from monotonicity of the derivative.

theorem convex_on.slope_mono_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hf : convex_on π s f) {x y z : π} (hx : x β s) (hz : z β s) (hxy : x < y) (hyz : y < z) :
(f y - f x) / (y - x) β€ (f z - f y) / (z - y)

If f : π β π is convex, then for any three points x < y < z the slope of the secant line of f on [x, y] is less than the slope of the secant line of f on [x, z].

theorem concave_on.slope_anti_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hf : concave_on π s f) {x y z : π} (hx : x β s) (hz : z β s) (hxy : x < y) (hyz : y < z) :
(f z - f y) / (z - y) β€ (f y - f x) / (y - x)

If f : π β π is concave, then for any three points x < y < z the slope of the secant line of f on [x, y] is greater than the slope of the secant line of f on [x, z].

theorem strict_convex_on.slope_strict_mono_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hf : strict_convex_on π s f) {x y z : π} (hx : x β s) (hz : z β s) (hxy : x < y) (hyz : y < z) :
(f y - f x) / (y - x) < (f z - f y) / (z - y)

If f : π β π is strictly convex, then for any three points x < y < z the slope of the secant line of f on [x, y] is strictly less than the slope of the secant line of f on [x, z].

theorem strict_concave_on.slope_anti_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hf : s f) {x y z : π} (hx : x β s) (hz : z β s) (hxy : x < y) (hyz : y < z) :
(f z - f y) / (z - y) < (f y - f x) / (y - x)

If f : π β π is strictly concave, then for any three points x < y < z the slope of the secant line of f on [x, y] is strictly greater than the slope of the secant line of f on [x, z].

theorem convex_on_of_slope_mono_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hs : convex π s) (hf : β {x y z : π}, x β s β z β s β x < y β y < z β (f y - f x) / (y - x) β€ (f z - f y) / (z - y)) :
convex_on π s f

If for any three points x < y < z, the slope of the secant line of f : π β π on [x, y] is less than the slope of the secant line of f on [x, z], then f is convex.

theorem concave_on_of_slope_anti_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hs : convex π s) (hf : β {x y z : π}, x β s β z β s β x < y β y < z β (f z - f y) / (z - y) β€ (f y - f x) / (y - x)) :
concave_on π s f

If for any three points x < y < z, the slope of the secant line of f : π β π on [x, y] is greater than the slope of the secant line of f on [x, z], then f is concave.

theorem strict_convex_on_of_slope_strict_mono_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hs : convex π s) (hf : β {x y z : π}, x β s β z β s β x < y β y < z β (f y - f x) / (y - x) < (f z - f y) / (z - y)) :
strict_convex_on π s f

If for any three points x < y < z, the slope of the secant line of f : π β π on [x, y] is strictly less than the slope of the secant line of f on [x, z], then f is strictly convex.

theorem strict_concave_on_of_slope_strict_anti_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} (hs : convex π s) (hf : β {x y z : π}, x β s β z β s β x < y β y < z β (f z - f y) / (z - y) < (f y - f x) / (y - x)) :
s f

If for any three points x < y < z, the slope of the secant line of f : π β π on [x, y] is strictly greater than the slope of the secant line of f on [x, z], then f is strictly concave.

theorem convex_on_iff_slope_mono_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} :
convex_on π s f β convex π s β§ β β¦x y z : πβ¦, x β s β z β s β x < y β y < z β (f y - f x) / (y - x) β€ (f z - f y) / (z - y)

A function f : π β π is convex iff for any three points x < y < z the slope of the secant line of f on [x, y] is less than the slope of the secant line of f on [x, z].

theorem concave_on_iff_slope_anti_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} :
concave_on π s f β convex π s β§ β β¦x y z : πβ¦, x β s β z β s β x < y β y < z β (f z - f y) / (z - y) β€ (f y - f x) / (y - x)

A function f : π β π is concave iff for any three points x < y < z the slope of the secant line of f on [x, y] is greater than the slope of the secant line of f on [x, z].

theorem strict_convex_on_iff_slope_strict_mono_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} :
strict_convex_on π s f β convex π s β§ β β¦x y z : πβ¦, x β s β z β s β x < y β y < z β (f y - f x) / (y - x) < (f z - f y) / (z - y)

A function f : π β π is strictly convex iff for any three points x < y < z the slope of the secant line of f on [x, y] is strictly less than the slope of the secant line of f on [x, z].

theorem strict_concave_on_iff_slope_strict_anti_adjacent {π : Type u_1} [linear_ordered_field π] {s : set π} {f : π β π} :
s f β convex π s β§ β β¦x y z : πβ¦, x β s β z β s β x < y β y < z β (f z - f y) / (z - y) < (f y - f x) / (y - x)

A function f : π β π is strictly concave iff for any three points x < y < z the slope of the secant line of f on [x, y] is strictly greater than the slope of the secant line of f on [x, z].