The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V16. Normed spaces and functional analysis

Mathlib.Analysis.Convex.Deriv

106 declarations. Mathlib docs · Source

Convexity of functions and derivatives

Here we relate convexity of functions ℝ → ℝ to properties of their derivatives.

Main results

  • MonotoneOn.convexOn_of_deriv, convexOn_of_deriv2_nonneg : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex.
  • ConvexOn.monotoneOn_deriv: if a function is convex and differentiable, then its derivative is monotone.

Monotonicity of f' implies convexity of f

Convexity of f implies monotonicity of f'

In this section we prove inequalities relating derivatives of convex functions to slopes of secant lines, and deduce that if f is convex then its derivative is monotone (and similarly for strict convexity / strict monotonicity).

Left and right derivative of a convex function in the interior of the set

Convex functions, derivative at left endpoint of secant

Convex functions, derivative at right endpoint of secant

Convex functions, monotonicity of derivative

Strict convex functions, derivative at left endpoint of secant

Strict convex functions, derivative at right endpoint of secant

Strict convex functions, strict monotonicity of derivative

Concave functions, derivative at left endpoint of secant

Concave functions, derivative at right endpoint of secant

Concave functions, anti-monotonicity of derivative

Strict concave functions, derivative at left endpoint of secant

Strict concave functions, derivative at right endpoint of secant

Strict concave functions, anti-monotonicity of derivative

theorem MonotoneOn.convexOn_of_deriv E3 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f : ℝ → ℝ},
      ContinuousOn f D → DifferentiableOn ℝ f (interior D) → MonotoneOn (deriv f) (interior D) → ConvexOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, is differentiable on its interior, and f' is monotone on the interior, then f is convex on D.

theorem AntitoneOn.concaveOn_of_deriv E1 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f : ℝ → ℝ},
      ContinuousOn f D → DifferentiableOn ℝ f (interior D) → AntitoneOn (deriv f) (interior D) → ConcaveOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, is differentiable on its interior, and f' is antitone on the interior, then f is concave on D.

theorem StrictMonoOn.exists_slope_lt_deriv_aux E0 #

∀ {x y : ℝ} {f : ℝ → ℝ},
  ContinuousOn f (Set.Icc x y) →
    x < y →
      StrictMonoOn (deriv f) (Set.Ioo x y) →
        (∀ w ∈ Set.Ioo x y, deriv f w ≠ 0) → ∃ a ∈ Set.Ioo x y, (f y - f x) / (y - x) < deriv f a

theorem StrictMonoOn.exists_slope_lt_deriv E1 #

∀ {x y : ℝ} {f : ℝ → ℝ},
  ContinuousOn f (Set.Icc x y) →
    x < y → StrictMonoOn (deriv f) (Set.Ioo x y) → ∃ a ∈ Set.Ioo x y, (f y - f x) / (y - x) < deriv f a

theorem StrictMonoOn.exists_deriv_lt_slope_aux E0 #

∀ {x y : ℝ} {f : ℝ → ℝ},
  ContinuousOn f (Set.Icc x y) →
    x < y →
      StrictMonoOn (deriv f) (Set.Ioo x y) →
        (∀ w ∈ Set.Ioo x y, deriv f w ≠ 0) → ∃ a ∈ Set.Ioo x y, deriv f a < (f y - f x) / (y - x)

theorem StrictMonoOn.exists_deriv_lt_slope E1 #

∀ {x y : ℝ} {f : ℝ → ℝ},
  ContinuousOn f (Set.Icc x y) →
    x < y → StrictMonoOn (deriv f) (Set.Ioo x y) → ∃ a ∈ Set.Ioo x y, deriv f a < (f y - f x) / (y - x)

theorem StrictMonoOn.strictConvexOn_of_deriv E1 #

∀ {D : Set ℝ}, Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → StrictMonoOn (deriv f) (interior D) → StrictConvexOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, and f' is strictly monotone on the interior, then f is strictly convex on D. Note that we don't require differentiability, since it is guaranteed at all but at most one point by the strict monotonicity of f'.

theorem StrictAntiOn.strictConcaveOn_of_deriv E1 #

∀ {D : Set ℝ},
  Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → StrictAntiOn (deriv f) (interior D) → StrictConcaveOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ and f' is strictly antitone on the interior, then f is strictly concave on D. Note that we don't require differentiability, since it is guaranteed at all but at most one point by the strict antitonicity of f'.

theorem Monotone.convexOn_univ_of_deriv E1 #

∀ {f : ℝ → ℝ}, Differentiable ℝ f → Monotone (deriv f) → ConvexOn ℝ Set.univ f

If a function f is differentiable and f' is monotone on ℝ then f is convex.

theorem Antitone.concaveOn_univ_of_deriv E1 #

∀ {f : ℝ → ℝ}, Differentiable ℝ f → Antitone (deriv f) → ConcaveOn ℝ Set.univ f

If a function f is differentiable and f' is antitone on ℝ then f is concave.

theorem StrictMono.strictConvexOn_univ_of_deriv E1 #

∀ {f : ℝ → ℝ}, Continuous f → StrictMono (deriv f) → StrictConvexOn ℝ Set.univ f

If a function f is continuous and f' is strictly monotone on ℝ then f is strictly convex. Note that we don't require differentiability, since it is guaranteed at all but at most one point by the strict monotonicity of f'.

theorem StrictAnti.strictConcaveOn_univ_of_deriv E1 #

∀ {f : ℝ → ℝ}, Continuous f → StrictAnti (deriv f) → StrictConcaveOn ℝ Set.univ f

If a function f is continuous and f' is strictly antitone on ℝ then f is strictly concave. Note that we don't require differentiability, since it is guaranteed at all but at most one point by the strict antitonicity of f'.

theorem convexOn_of_deriv2_nonneg E3 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f : ℝ → ℝ},
      ContinuousOn f D →
        DifferentiableOn ℝ f (interior D) →
          DifferentiableOn ℝ (deriv f) (interior D) → (∀ x ∈ interior D, 0 ≤ deriv^[2] f x) → ConvexOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, is twice differentiable on its interior, and f'' is nonnegative on the interior, then f is convex on D.

theorem concaveOn_of_deriv2_nonpos E1 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f : ℝ → ℝ},
      ContinuousOn f D →
        DifferentiableOn ℝ f (interior D) →
          DifferentiableOn ℝ (deriv f) (interior D) → (∀ x ∈ interior D, deriv^[2] f x ≤ 0) → ConcaveOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, is twice differentiable on its interior, and f'' is nonpositive on the interior, then f is concave on D.

theorem convexOn_of_hasDerivWithinAt2_nonneg E1 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f f' f'' : ℝ → ℝ},
      ContinuousOn f D →
        (∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x) →
          (∀ x ∈ interior D, HasDerivWithinAt f' (f'' x) (interior D) x) →
            (∀ x ∈ interior D, 0 ≤ f'' x) → ConvexOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, is twice differentiable on its interior, and f'' is nonnegative on the interior, then f is convex on D.

theorem concaveOn_of_hasDerivWithinAt2_nonpos E1 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f f' f'' : ℝ → ℝ},
      ContinuousOn f D →
        (∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x) →
          (∀ x ∈ interior D, HasDerivWithinAt f' (f'' x) (interior D) x) →
            (∀ x ∈ interior D, f'' x ≤ 0) → ConcaveOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ, is twice differentiable on its interior, and f'' is nonpositive on the interior, then f is concave on D.

theorem strictConvexOn_of_deriv2_pos E1 #

∀ {D : Set ℝ},
  Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → (∀ x ∈ interior D, 0 < deriv^[2] f x) → StrictConvexOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ and f'' is strictly positive on the interior, then f is strictly convex on D. Note that we don't require twice differentiability explicitly as it is already implied by the second derivative being strictly positive, except at at most one point.

theorem strictConcaveOn_of_deriv2_neg E1 #

∀ {D : Set ℝ},
  Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → (∀ x ∈ interior D, deriv^[2] f x < 0) → StrictConcaveOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ and f'' is strictly negative on the interior, then f is strictly concave on D. Note that we don't require twice differentiability explicitly as it already implied by the second derivative being strictly negative, except at at most one point.

theorem convexOn_of_deriv2_nonneg' E1 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f : ℝ → ℝ},
      DifferentiableOn ℝ f D → DifferentiableOn ℝ (deriv f) D → (∀ x ∈ D, 0 ≤ deriv^[2] f x) → ConvexOn ℝ D f

If a function f is twice differentiable on an open convex set D ⊆ ℝ and f'' is nonnegative on D, then f is convex on D.

theorem concaveOn_of_deriv2_nonpos' E1 #

∀ {D : Set ℝ},
  Convex ℝ D →
    ∀ {f : ℝ → ℝ},
      DifferentiableOn ℝ f D → DifferentiableOn ℝ (deriv f) D → (∀ x ∈ D, deriv^[2] f x ≤ 0) → ConcaveOn ℝ D f

If a function f is twice differentiable on an open convex set D ⊆ ℝ and f'' is nonpositive on D, then f is concave on D.

theorem strictConvexOn_of_deriv2_pos' E1 #

∀ {D : Set ℝ}, Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → (∀ x ∈ D, 0 < deriv^[2] f x) → StrictConvexOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ and f'' is strictly positive on D, then f is strictly convex on D. Note that we don't require twice differentiability explicitly as it is already implied by the second derivative being strictly positive, except at at most one point.

theorem strictConcaveOn_of_deriv2_neg' E1 #

∀ {D : Set ℝ}, Convex ℝ D → ∀ {f : ℝ → ℝ}, ContinuousOn f D → (∀ x ∈ D, deriv^[2] f x < 0) → StrictConcaveOn ℝ D f

If a function f is continuous on a convex set D ⊆ ℝ and f'' is strictly negative on D, then f is strictly concave on D. Note that we don't require twice differentiability explicitly as it is already implied by the second derivative being strictly negative, except at at most one point.

theorem convexOn_univ_of_deriv2_nonneg E1 #

∀ {f : ℝ → ℝ}, Differentiable ℝ f → Differentiable ℝ (deriv f) → (∀ (x : ℝ), 0 ≤ deriv^[2] f x) → ConvexOn ℝ Set.univ f

If a function f is twice differentiable on ℝ, and f'' is nonnegative on ℝ, then f is convex on ℝ.

theorem concaveOn_univ_of_deriv2_nonpos E1 #

∀ {f : ℝ → ℝ}, Differentiable ℝ f → Differentiable ℝ (deriv f) → (∀ (x : ℝ), deriv^[2] f x ≤ 0) → ConcaveOn ℝ Set.univ f

If a function f is twice differentiable on ℝ, and f'' is nonpositive on ℝ, then f is concave on ℝ.

theorem strictConvexOn_univ_of_deriv2_pos E1 #

∀ {f : ℝ → ℝ}, Continuous f → (∀ (x : ℝ), 0 < deriv^[2] f x) → StrictConvexOn ℝ Set.univ f

If a function f is continuous on ℝ, and f'' is strictly positive on ℝ, then f is strictly convex on ℝ. Note that we don't require twice differentiability explicitly as it is already implied by the second derivative being strictly positive, except at at most one point.

theorem strictConcaveOn_univ_of_deriv2_neg E1 #

∀ {f : ℝ → ℝ}, Continuous f → (∀ (x : ℝ), deriv^[2] f x < 0) → StrictConcaveOn ℝ Set.univ f

If a function f is continuous on ℝ, and f'' is strictly negative on ℝ, then f is strictly concave on ℝ. Note that we don't require twice differentiability explicitly as it is already implied by the second derivative being strictly negative, except at at most one point.

theorem ConvexOn.slope_mono E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜},
  ConvexOn 𝕜 s f → x ∈ s → MonotoneOn (slope f x) (s \ {x})

If f : 𝕜 → 𝕜 is convex on s, then for any point x ∈ s the slope of the secant line of f through x is monotone on s \ {x}.

theorem ConvexOn.monotoneOn_slope_gt E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜},
  ConvexOn 𝕜 s f → x ∈ s → MonotoneOn (slope f x) {y | y ∈ s ∧ x < y}

theorem ConvexOn.monotoneOn_slope_lt E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜},
  ConvexOn 𝕜 s f → x ∈ s → MonotoneOn (slope f x) {y | y ∈ s ∧ y < x}

theorem ConcaveOn.slope_anti E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜},
  ConcaveOn 𝕜 s f → x ∈ s → AntitoneOn (slope f x) (s \ {x})

If f : 𝕜 → 𝕜 is concave on s, then for any point x ∈ s the slope of the secant line of f through x is antitone on s \ {x}.

theorem ConcaveOn.antitoneOn_slope_gt E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜},
  ConcaveOn 𝕜 s f → x ∈ s → AntitoneOn (slope f x) {y | y ∈ s ∧ x < y}

theorem ConcaveOn.antitoneOn_slope_lt E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜},
  ConcaveOn 𝕜 s f → x ∈ s → AntitoneOn (slope f x) {y | y ∈ s ∧ y < x}

theorem bddBelow_slope_lt_of_mem_interior E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜}
  [inst_3 : TopologicalSpace 𝕜] [OrderTopology 𝕜],
  ConvexOn 𝕜 s f → x ∈ interior s → BddBelow (slope f x '' {y | y ∈ s ∧ x < y})

theorem bddAbove_slope_gt_of_mem_interior E1 #

∀ {𝕜 : Type u_1} [inst : Field 𝕜] [inst_1 : LinearOrder 𝕜] [IsStrictOrderedRing 𝕜] {s : Set 𝕜} {f : 𝕜 → 𝕜} {x : 𝕜}
  [inst_3 : TopologicalSpace 𝕜] [OrderTopology 𝕜],
  ConvexOn 𝕜 s f → x ∈ interior s → BddAbove (slope f x '' {y | y ∈ s ∧ y < x})

theorem ConvexOn.hasDerivWithinAt_sInf_slope_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → HasDerivWithinAt f (sInf (slope f x '' {y | y ∈ S ∧ x < y})) (Set.Ioi x) x

theorem ConvexOn.hasDerivWithinAt_sSup_slope_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → HasDerivWithinAt f (sSup (slope f x '' {y | y ∈ S ∧ y < x})) (Set.Iio x) x

theorem ConvexOn.differentiableWithinAt_Ioi_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ}, ConvexOn ℝ S f → x ∈ interior S → DifferentiableWithinAt ℝ f (Set.Ioi x) x

theorem ConvexOn.differentiableWithinAt_Iio_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ}, ConvexOn ℝ S f → x ∈ interior S → DifferentiableWithinAt ℝ f (Set.Iio x) x

theorem ConvexOn.hasDerivWithinAt_rightDeriv_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → HasDerivWithinAt f (derivWithin f (Set.Ioi x) x) (Set.Ioi x) x

theorem ConvexOn.hasDerivWithinAt_leftDeriv_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → HasDerivWithinAt f (derivWithin f (Set.Iio x) x) (Set.Iio x) x

theorem ConvexOn.rightDeriv_eq_sInf_slope_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → derivWithin f (Set.Ioi x) x = sInf (slope f x '' {y | y ∈ S ∧ x < y})

theorem ConvexOn.leftDeriv_eq_sSup_slope_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → derivWithin f (Set.Iio x) x = sSup (slope f x '' {y | y ∈ S ∧ y < x})

theorem ConvexOn.monotoneOn_rightDeriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, ConvexOn ℝ S f → MonotoneOn (fun x ↦ derivWithin f (Set.Ioi x) x) (interior S)

theorem ConvexOn.monotoneOn_leftDeriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, ConvexOn ℝ S f → MonotoneOn (fun x ↦ derivWithin f (Set.Iio x) x) (interior S)

theorem ConvexOn.leftDeriv_le_rightDeriv_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → derivWithin f (Set.Iio x) x ≤ derivWithin f (Set.Ioi x) x

theorem ConvexOn.le_slope_of_hasDerivWithinAt_Ioi E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Ioi x) x → f' ≤ slope f x y

If f : ℝ → ℝ is convex on S and right-differentiable at x ∈ S, then the slope of any secant line with left endpoint at x is bounded below by the right derivative of f at x.

theorem ConvexOn.rightDeriv_le_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Ioi x) x → derivWithin f (Set.Ioi x) x ≤ slope f x y

Reformulation of ConvexOn.le_slope_of_hasDerivWithinAt_Ioi using derivWithin.

theorem ConvexOn.rightDeriv_le_slope_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → ∀ {y : ℝ}, x ∈ interior S → y ∈ S → x < y → derivWithin f (Set.Ioi x) x ≤ slope f x y

theorem ConvexOn.le_slope_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S x → f' ≤ slope f x y

If f : ℝ → ℝ is convex on S and differentiable within S at x, then the slope of any secant line with left endpoint at x is bounded below by the derivative of f within S at x.

This is fractionally weaker than ConvexOn.le_slope_of_hasDerivWithinAt_Ioi but simpler to apply under a DifferentiableOn S hypothesis.

theorem ConvexOn.derivWithin_le_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S x → derivWithin f S x ≤ slope f x y

Reformulation of ConvexOn.le_slope_of_hasDerivWithinAt using derivWithin.

theorem ConvexOn.le_slope_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ}, ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' x → f' ≤ slope f x y

If f : ℝ → ℝ is convex on S and differentiable at x ∈ S, then the slope of any secant line with left endpoint at x is bounded below by the derivative of f at x.

theorem ConvexOn.deriv_le_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f x → deriv f x ≤ slope f x y

Reformulation of ConvexOn.le_slope_of_hasDerivAt using deriv

theorem ConvexOn.slope_le_of_hasDerivWithinAt_Iio E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Iio y) y → slope f x y ≤ f'

If f : ℝ → ℝ is convex on S and left-differentiable at y ∈ S, then the slope of any secant line with right endpoint at y is bounded above by the left derivative of f at y.

theorem ConvexOn.slope_le_leftDeriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Iio y) y → slope f x y ≤ derivWithin f (Set.Iio y) y

Reformulation of ConvexOn.slope_le_of_hasDerivWithinAt_Iio using derivWithin.

theorem ConvexOn.slope_le_leftDeriv_of_mem_interior E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ interior S → x < y → slope f x y ≤ derivWithin f (Set.Iio y) y

theorem ConvexOn.slope_le_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S y → slope f x y ≤ f'

If f : ℝ → ℝ is convex on S and differentiable within S at y, then the slope of any secant line with right endpoint at y is bounded above by the derivative of f within S at y.

This is fractionally weaker than ConvexOn.slope_le_of_hasDerivWithinAt_Iio but simpler to apply under a DifferentiableOn S hypothesis.

theorem ConvexOn.slope_le_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S y → slope f x y ≤ derivWithin f S y

Reformulation of ConvexOn.slope_le_of_hasDerivWithinAt using derivWithin.

theorem ConvexOn.slope_le_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ}, ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' y → slope f x y ≤ f'

If f : ℝ → ℝ is convex on S and differentiable at y ∈ S, then the slope of any secant line with right endpoint at y is bounded above by the derivative of f at y.

theorem ConvexOn.slope_le_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f y → slope f x y ≤ deriv f y

Reformulation of ConvexOn.slope_le_of_hasDerivAt using deriv.

theorem ConvexOn.monotoneOn_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, ConvexOn ℝ S f → DifferentiableOn ℝ f S → MonotoneOn (derivWithin f S) S

If f is convex on S and differentiable on S, then its derivative within S is monotone on S.

theorem ConvexOn.monotoneOn_deriv E3 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, ConvexOn ℝ S f → (∀ x ∈ S, DifferentiableAt ℝ f x) → MonotoneOn (deriv f) S

If f is convex on S and differentiable at all points of S, then its derivative is monotone on S.

theorem ConvexOn.isMinOn_of_leftDeriv_nonpos_of_rightDeriv_nonneg E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ},
  ConvexOn ℝ S f → x ∈ interior S → derivWithin f (Set.Iio x) x ≤ 0 → 0 ≤ derivWithin f (Set.Ioi x) x → IsMinOn f S x

theorem ConvexOn.isMinOn_of_rightDeriv_eq_zero E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ}, ConvexOn ℝ S f → x ∈ interior S → derivWithin f (Set.Ioi x) x = 0 → IsMinOn f S x

theorem ConvexOn.isMinOn_of_leftDeriv_eq_zero E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x : ℝ}, ConvexOn ℝ S f → x ∈ interior S → derivWithin f (Set.Iio x) x = 0 → IsMinOn f S x

theorem StrictConvexOn.lt_slope_of_hasDerivWithinAt_Ioi E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Ioi x) x → f' < slope f x y

If f : ℝ → ℝ is strictly convex on S and right-differentiable at x ∈ S, then the slope of any secant line with left endpoint at x is strictly greater than the right derivative of f at x.

theorem StrictConvexOn.rightDeriv_lt_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConvexOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Ioi x) x → derivWithin f (Set.Ioi x) x < slope f x y

theorem StrictConvexOn.lt_slope_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S x → f' < slope f x y

If f : ℝ → ℝ is strictly convex on S and differentiable within S at x ∈ S, then the slope of any secant line with left endpoint at x is strictly greater than the derivative of f within S at x.

This is fractionally weaker than StrictConvexOn.lt_slope_of_hasDerivWithinAt_Ioi but simpler to apply under a DifferentiableOn S hypothesis.

theorem StrictConvexOn.derivWithin_lt_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S x → derivWithin f S x < slope f x y

theorem StrictConvexOn.lt_slope_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' x → f' < slope f x y

If f : ℝ → ℝ is strictly convex on S and differentiable at x ∈ S, then the slope of any secant line with left endpoint at x is strictly greater than the derivative of f at x.

theorem StrictConvexOn.deriv_lt_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f x → deriv f x < slope f x y

theorem StrictConvexOn.slope_lt_of_hasDerivWithinAt_Iio E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Iio y) y → slope f x y < f'

If f : ℝ → ℝ is strictly convex on S and differentiable at y ∈ S, then the slope of any secant line with right endpoint at y is strictly less than the left derivative at y.

theorem StrictConvexOn.slope_lt_leftDeriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConvexOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Iio y) y → slope f x y < derivWithin f (Set.Iio y) y

theorem StrictConvexOn.slope_lt_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S y → slope f x y < f'

If f : ℝ → ℝ is strictly convex on S and differentiable within S at y ∈ S, then the slope of any secant line with right endpoint at y is strictly less than the derivative of f within S at y.

This is fractionally weaker than StrictConvexOn.slope_lt_of_hasDerivWithinAt_Iio but simpler to apply under a DifferentiableOn S hypothesis.

theorem StrictConvexOn.slope_lt_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S y → slope f x y < derivWithin f S y

theorem StrictConvexOn.slope_lt_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' y → slope f x y < f'

If f : ℝ → ℝ is strictly convex on S and differentiable at y ∈ S, then the slope of any secant line with right endpoint at y is strictly less than the derivative of f at y.

theorem StrictConvexOn.slope_lt_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConvexOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f y → slope f x y < deriv f y

theorem StrictConvexOn.strictMonoOn_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, StrictConvexOn ℝ S f → DifferentiableOn ℝ f S → StrictMonoOn (derivWithin f S) S

If f is convex on S and differentiable on S, then its derivative within S is monotone on S.

theorem StrictConvexOn.strictMonoOn_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, StrictConvexOn ℝ S f → (∀ x ∈ S, DifferentiableAt ℝ f x) → StrictMonoOn (deriv f) S

If f is convex on S and differentiable at all points of S, then its derivative is monotone on S.

theorem ConcaveOn.slope_le_of_hasDerivWithinAt_Ioi E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Ioi x) x → slope f x y ≤ f'

theorem ConcaveOn.slope_le_rightDeriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConcaveOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Ioi x) x → slope f x y ≤ derivWithin f (Set.Ioi x) x

theorem ConcaveOn.slope_le_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S x → slope f x y ≤ f'

theorem ConcaveOn.slope_le_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S x → slope f x y ≤ derivWithin f S x

theorem ConcaveOn.slope_le_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ}, ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' x → slope f x y ≤ f'

theorem ConcaveOn.slope_le_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f x → slope f x y ≤ deriv f x

theorem ConcaveOn.le_slope_of_hasDerivWithinAt_Iio E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Iio y) y → f' ≤ slope f x y

theorem ConcaveOn.leftDeriv_le_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConcaveOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Iio y) y → derivWithin f (Set.Iio y) y ≤ slope f x y

theorem ConcaveOn.le_slope_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S y → f' ≤ slope f x y

theorem ConcaveOn.derivWithin_le_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S y → derivWithin f S y ≤ slope f x y

theorem ConcaveOn.le_slope_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ}, ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' y → f' ≤ slope f x y

theorem ConcaveOn.deriv_le_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  ConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f y → deriv f y ≤ slope f x y

theorem ConcaveOn.antitoneOn_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, ConcaveOn ℝ S f → DifferentiableOn ℝ f S → AntitoneOn (derivWithin f S) S

theorem ConcaveOn.antitoneOn_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, ConcaveOn ℝ S f → (∀ x ∈ S, DifferentiableAt ℝ f x) → AntitoneOn (deriv f) S

If f is concave on S and differentiable at all points of S, then its derivative is antitone (monotone decreasing) on S.

theorem StrictConcaveOn.slope_lt_of_hasDerivWithinAt_Ioi E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Ioi x) x → slope f x y < f'

theorem StrictConcaveOn.slope_lt_rightDeriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConcaveOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Ioi x) x → slope f x y < derivWithin f (Set.Ioi x) x

theorem StrictConcaveOn.slope_lt_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S x → slope f x y < f'

theorem StrictConcaveOn.slope_lt_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S x → slope f x y < derivWithin f S x

theorem StrictConcaveOn.slope_lt_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' x → slope f x y < f'

theorem StrictConcaveOn.slope_lt_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f x → slope f x y < deriv f x

theorem StrictConcaveOn.lt_slope_of_hasDerivWithinAt_Iio E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' (Set.Iio y) y → f' < slope f x y

theorem StrictConcaveOn.leftDeriv_lt_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConcaveOn ℝ S f →
    x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f (Set.Iio y) y → derivWithin f (Set.Iio y) y < slope f x y

theorem StrictConcaveOn.lt_slope_of_hasDerivWithinAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivWithinAt f f' S y → f' < slope f x y

theorem StrictConcaveOn.derivWithin_lt_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableWithinAt ℝ f S y → derivWithin f S y < slope f x y

theorem StrictConcaveOn.lt_slope_of_hasDerivAt E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y f' : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → HasDerivAt f f' y → f' < slope f x y

theorem StrictConcaveOn.deriv_lt_slope E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ} {x y : ℝ},
  StrictConcaveOn ℝ S f → x ∈ S → y ∈ S → x < y → DifferentiableAt ℝ f y → deriv f y < slope f x y

theorem StrictConcaveOn.strictAntiOn_derivWithin E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, StrictConcaveOn ℝ S f → DifferentiableOn ℝ f S → StrictAntiOn (derivWithin f S) S

theorem StrictConcaveOn.strictAntiOn_deriv E1 #

∀ {S : Set ℝ} {f : ℝ → ℝ}, StrictConcaveOn ℝ S f → (∀ x ∈ S, DifferentiableAt ℝ f x) → StrictAntiOn (deriv f) S