Documentation

Books.ConvexAnalysis_Rockafellar_1970.Chapters.Chap01.section04_part1

def epigraph {n : } (S : Set (Fin n)) (f : (Fin n)EReal) :
Set ((Fin n) × )

Definition 4.1: Let f be a function with values in R union {plus or minus infinity} whose domain is a subset S of R^n. The set {(x, mu) | x in S, mu in R, mu >= f x} is called the epigraph of f, denoted epi f.

Equations
Instances For
    def ConvexFunctionOn {n : } (S : Set (Fin n)) (f : (Fin n)EReal) :

    Definition 4.2: A function f on S is a convex function if epi f is convex as a subset of R^{n+1}.

    Equations
    Instances For
      theorem epigraph_mem_of_le_aux {n : } {S : Set (Fin n)} {f : (Fin n)EReal} {x : Fin n} {μ : } (hx : x S) ( : f x μ) :
      (x, μ) epigraph S f

      If x ∈ S and f x ≤ μ, then (x, μ) belongs to the epigraph.

      theorem convex_combo_mem_epigraph_aux {n : } {S : Set (Fin n)} {f : (Fin n)EReal} {x y : Fin n} {μ v t : } (hconv : Convex (epigraph S f)) (hx : (x, μ) epigraph S f) (hy : (y, v) epigraph S f) (ht0 : 0 t) (ht1 : t 1) :
      (1 - t) (x, μ) + t (y, v) epigraph S f

      Convexity of the epigraph yields convex combinations of its points.

      theorem epigraph_combo_proj_aux {n : } {S : Set (Fin n)} {f : (Fin n)EReal} {x y : Fin n} {μ v t : } :
      (1 - t) (x, μ) + t (y, v) epigraph S f → (1 - t) x + t y S f ((1 - t) x + t y) ↑((1 - t) * μ + t * v)

      Unpack epigraph membership of a convex combination.

      theorem epigraph_combo_ineq_aux {n : } {S : Set (Fin n)} {f : (Fin n)EReal} {x y : Fin n} {μ v t : } (hconv : Convex (epigraph S f)) (hx : x S) (hy : y S) ( : f x μ) (hv : f y v) (ht0 : 0 t) (ht1 : t 1) :
      f ((1 - t) x + t y) ↑((1 - t) * μ + t * v)

      Convexity of the epigraph gives a real upper bound along segments.

      theorem convexFunctionOn_iff_segment_inequality {n : } {C : Set (Fin n)} {f : (Fin n)EReal} (hC : Convex C) (hnotbot : xC, f x ) :
      ConvexFunctionOn C f xC, yC, ∀ (t : ), 0 < tt < 1f ((1 - t) x + t y) ↑(1 - t) * f x + t * f y

      Theorem 4.1: Let f be a function from C to (-∞, +∞], where C is convex. Then f is convex on C iff f ((1 - λ) • x + λ • y) ≤ (1 - λ) * f x + λ * f y for 0 < λ < 1, for every x and y in C.

      theorem ereal_exists_real_between_of_lt {u : EReal} {α : } (h : u < α) :
      ∃ (μ : ), u μ μ < α

      Choose a real bound between an EReal value and a real upper bound.

      theorem ereal_convex_combo_lt_of_lt {μ α v β t : } ( : μ < α) (hv : v < β) (ht0 : 0 < t) (ht1 : t < 1) :
      ↑(1 - t) * μ + t * v < ↑(1 - t) * α + t * β

      Strict inequality for convex combinations of real bounds in EReal.

      theorem segment_inequality_le_of_strict {n : } {f : (Fin n)EReal} (hstrict : ∀ (x y : Fin n) (α β t : ), f x < αf y < β0 < tt < 1f ((1 - t) x + t y) < ↑(1 - t) * α + t * β) (x y : Fin n) (μ v t : ) :
      f x μf y v0 < tt < 1f ((1 - t) x + t y) ↑((1 - t) * μ + t * v)

      Strict segment bounds yield a non-strict bound with real upper bounds.

      theorem convexFunctionOn_univ_iff_strict_inequality {n : } {f : (Fin n)EReal} :
      ConvexFunctionOn Set.univ f ∀ (x y : Fin n) (α β t : ), f x < αf y < β0 < tt < 1f ((1 - t) x + t y) < ↑(1 - t) * α + t * β

      Theorem 4.2: Let f be a function from ℝ^n to [-∞, +∞]. Then f is convex iff f ((1 - λ) • x + λ • y) < (1 - λ) * α + λ * β for 0 < λ < 1, whenever f x < α and f y < β.

      theorem EReal.mul_sum_of_nonneg_of_ne_top {α : Type u_1} {s : Finset α} {a : EReal} (ha : 0 a) (ha_top : a ) (f : αEReal) :
      a * s.sum f = is, a * f i

      Distribute a finite nonnegative scalar over a finite EReal sum.

      theorem tail_weights_zero_of_head_eq_one {m : } {w : Fin (m + 1)} (hw : ∀ (i : Fin (m + 1)), 0 w i) (hsum : i : Fin (m + 1), w i = 1) (h0 : w 0 = 1) (i : Fin m) :
      w i.succ = 0

      If nonnegative weights sum to one and the head weight is one, all tail weights vanish.

      theorem jensen_inequality_of_convexFunctionOn_univ {n : } {f : (Fin n)EReal} (hf : ConvexFunctionOn Set.univ f) (hnotbot : ∀ (x : Fin n), f x ) (m : ) (w : Fin m) (x : Fin mFin n) :
      (∀ (i : Fin m), 0 w i)i : Fin m, w i = 1f (∑ i : Fin m, w i x i) i : Fin m, (w i) * f (x i)

      Jensen inequality from convexity on the whole space.

      theorem segment_inequality_of_jensen {n : } {f : (Fin n)EReal} (hjensen : ∀ (m : ) (w : Fin m) (x : Fin mFin n), (∀ (i : Fin m), 0 w i)i : Fin m, w i = 1f (∑ i : Fin m, w i x i) i : Fin m, (w i) * f (x i)) (x y : Fin n) (t : ) :
      0 < tt < 1f ((1 - t) x + t y) ↑(1 - t) * f x + t * f y

      Jensen inequality for m = 2 yields the segment inequality.

      theorem convexFunctionOn_univ_iff_jensen_inequality {n : } (f : (Fin n)EReal) (hnotbot : ∀ (x : Fin n), f x ) :
      ConvexFunctionOn Set.univ f ∀ (m : ) (w : Fin m) (x : Fin mFin n), (∀ (i : Fin m), 0 w i)i : Fin m, w i = 1f (∑ i : Fin m, w i x i) i : Fin m, (w i) * f (x i)

      Theorem 4.3 (Jensen's Inequality): Let f be a function from R^n to (-∞, +∞]. Then f is convex iff f (lambda_1 x_1 + ... + lambda_m x_m) ≤ lambda_1 f x_1 + ... + lambda_m f x_m whenever lambda_1, ..., lambda_m ≥ 0 and lambda_1 + ... + lambda_m = 1.

      def AffineFunctionOn {n : } (S : Set (Fin n)) (f : (Fin n)EReal) :

      Definition 4.3: An affine function on S is a function which is finite, convex, and concave.

      Equations
      Instances For
        theorem derivWithin_Ioo_eq_deriv {g : } {α β x : } (hx : x Set.Ioo α β) :
        derivWithin g (Set.Ioo α β) x = deriv g x

        On an open interval, the derivative within equals the usual derivative.

        theorem convexOn_Ioo_of_second_deriv_nonneg {f : } {α β : } (hcont : ContDiffOn 2 f (Set.Ioo α β)) (hderiv2 : xSet.Ioo α β, 0 deriv (deriv f) x) :
        ConvexOn (Set.Ioo α β) f

        Nonnegative second derivative implies convexity on an open interval.

        theorem second_deriv_nonneg_of_convexOn_Ioo {f : } {α β : } (hcont : ContDiffOn 2 f (Set.Ioo α β)) (hconv : ConvexOn (Set.Ioo α β) f) (x : ) :
        x Set.Ioo α β0 deriv (deriv f) x

        Convexity on an open interval forces a nonnegative second derivative.

        theorem convexOn_interval_iff_second_deriv_nonneg {f : } {α β : } (hcont : ContDiffOn 2 f (Set.Ioo α β)) :
        ConvexOn (Set.Ioo α β) f xSet.Ioo α β, 0 deriv (deriv f) x

        Theorem 4.4: Let f be a twice continuously differentiable real-valued function on an open interval (α, β). Then f is convex iff its second derivative f'' is nonnegative throughout (α, β).

        theorem contDiffOn_line_restrict {n : } {C : Set (Fin n)} {f : (Fin n)} (hcont : ContDiffOn 2 f C) {y z : Fin n} {a b : } (hmem : tSet.Ioo a b, y + t z C) :
        ContDiffOn 2 (fun (t : ) => f (y + t z)) (Set.Ioo a b)

        Restricting a C^2 function to a line is C^2 on any interval contained in C.

        theorem exists_line_interval_subset {n : } {C : Set (Fin n)} (hopen : IsOpen C) {x : Fin n} (hx : x C) (z : Fin n) :
        ∃ (ε : ), 0 < ε tSet.Ioo (-ε) ε, x + t z C

        An open set contains a small open interval of a line through any point.

        theorem convexOn_line_restrict {n : } {C : Set (Fin n)} {f : (Fin n)} (hconv : ConvexOn C f) {y z : Fin n} {a b : } (hmem : tSet.Ioo a b, y + t z C) :
        ConvexOn (Set.Ioo a b) fun (t : ) => f (y + t z)

        Convexity of a function on C implies convexity of its restriction to any line segment in C.

        noncomputable def hessianMatrix {n : } (f : (Fin n)) (x : Fin n) :
        Matrix (Fin n) (Fin n)

        The Hessian matrix defined by iterated coordinate derivatives.

        Equations
        Instances For
          theorem posSemidef_iff_real {n : } (M : Matrix (Fin n) (Fin n) ) :
          M.PosSemidef M.IsHermitian ∀ (x : Fin n), 0 x ⬝ᵥ M.mulVec x

          Over , the quadratic form in Matrix.PosSemidef uses no conjugation.

          theorem line_deriv_eq_fderiv {n : } {f : (Fin n)} {y z : Fin n} {t : } (hderiv : DifferentiableAt f (y + t z)) :
          deriv (fun (s : ) => f (y + s z)) t = (fderiv f (y + t z)) z

          Derivative along a line equals the Fréchet derivative applied to the direction.

          theorem hessian_entry_eq_fderiv {n : } {f : (Fin n)} {x : Fin n} (hcont : ContDiffAt 2 f x) (i j : Fin n) :
          hessianMatrix f x i j = ((fderiv (fderiv f) x) (Pi.single i 1)) (Pi.single j 1)

          Coordinate second derivatives match the second Fréchet derivative on basis vectors.

          theorem line_second_deriv_eq_quadratic_form {n : } {C : Set (Fin n)} {f : (Fin n)} (hopen : IsOpen C) (hcont : ContDiffOn 2 f C) {y z : Fin n} {t : } (ht : y + t z C) :
          deriv (deriv fun (s : ) => f (y + s z)) t = star z ⬝ᵥ (hessianMatrix f (y + t z)).mulVec z

          Second derivatives along lines are given by the Hessian quadratic form.

          theorem hessian_symm {n : } {C : Set (Fin n)} {f : (Fin n)} (hopen : IsOpen C) (hcont : ContDiffOn 2 f C) {x : Fin n} (hx : x C) :

          The Hessian matrix is Hermitian at points of an open C^2 set.

          theorem hessian_posSemidef_of_convexOn {n : } {C : Set (Fin n)} {f : (Fin n)} (hopen : IsOpen C) (hcont : ContDiffOn 2 f C) (hconv : ConvexOn C f) (x : Fin n) :

          Convexity implies positive semidefiniteness of the Hessian.

          theorem convexOn_of_hessian_posSemidef {n : } {C : Set (Fin n)} {f : (Fin n)} (hC : Convex C) (hopen : IsOpen C) (hcont : ContDiffOn 2 f C) (hpos : xC, (hessianMatrix f x).PosSemidef) :

          Positive semidefinite Hessian implies convexity.

          theorem convexOn_iff_hessian_posSemidef {n : } {C : Set (Fin n)} {f : (Fin n)} (hC : Convex C) (hopen : IsOpen C) (hcont : ContDiffOn 2 f C) :
          ConvexOn C f xC, Matrix.PosSemidef fun (i j : Fin n) => deriv (fun (t : ) => deriv (fun (s : ) => f (x + s Pi.single i 1 + t Pi.single j 1)) 0) 0

          Theorem 4.5: Let f be a twice continuously differentiable real-valued function on an open convex set C in ℝ^n. Then f is convex on C iff its Hessian matrix Q_x = (q_ij(x)) with q_ij(x) = ∂^2 f / ∂ ξ_i ∂ ξ_j (x) is positive semidefinite for every x ∈ C.

          theorem convexFunctionOn_of_convexOn_real {n : } {S : Set (Fin n)} {g : (Fin n)} (hg : ConvexOn S g) :
          ConvexFunctionOn S fun (x : Fin n) => (g x)

          Lift real convexity to ConvexFunctionOn for finite-valued functions.

          theorem convexFunctionOn_univ_if_top {n : } {C : Set (Fin n)} {g : (Fin n)} (hg : ConvexOn C g) :
          ConvexFunctionOn Set.univ fun (x : Fin n) => if x C then (g x) else

          Extending by outside a convex domain preserves convexity on Set.univ.

          theorem convexOn_comp_proj {s : Set } {f : } (hf : ConvexOn s f) :
          ConvexOn ((LinearMap.proj 0) ⁻¹' s) fun (x : Fin 1) => f (x 0)

          Pull back convexity along the coordinate projection on Fin 1.

          theorem convexOn_rpow_Ioi_of_nonpos {p : } (hp : p 0) :
          ConvexOn (Set.Ioi 0) fun (x : ) => x ^ p

          x ↦ x^p is convex on (0, ∞) for p ≤ 0.

          theorem antitoneOn_rpow_Ioi_of_nonpos {p : } (hp : p 0) :
          AntitoneOn (fun (x : ) => x ^ p) (Set.Ioi 0)

          x ↦ x^p is antitone on (0, ∞) for p ≤ 0.

          theorem concaveOn_sub_sq_Ioo (a : ) :
          ConcaveOn (Set.Ioo (-a) a) fun (x : ) => a ^ 2 - x ^ 2

          x ↦ a^2 - x^2 is concave on (-a, a).

          theorem image_sub_sq_Ioo {a : } (ha : 0 < a) :
          (fun (x : ) => a ^ 2 - x ^ 2) '' Set.Ioo (-a) a = Set.Ioc 0 (a ^ 2)

          Image of x ↦ a^2 - x^2 on (-a, a) is (0, a^2].

          theorem convexFunctionOn_example_functions :
          (∀ (a : ), ConvexFunctionOn Set.univ fun (x : Fin 1) => (Real.exp (a * x 0))) (∀ (p : ), 1 pConvexFunctionOn Set.univ fun (x : Fin 1) => if 0 x 0 then ((x 0).rpow p) else ) (∀ (p : ), 0 pp 1ConvexFunctionOn Set.univ fun (x : Fin 1) => if 0 x 0 then ↑(-(x 0).rpow p) else ) (∀ p0, ConvexFunctionOn Set.univ fun (x : Fin 1) => if 0 < x 0 then ((x 0).rpow p) else ) (∀ (a : ), 0 < aConvexFunctionOn Set.univ fun (x : Fin 1) => if |x 0| < a then ((a ^ 2 - x 0 ^ 2).rpow (-(1 / 2))) else ) ConvexFunctionOn Set.univ fun (x : Fin 1) => if 0 < x 0 then ↑(-Real.log (x 0)) else

          Example 4.4.1: Here are some functions on Real whose convexity is a consequence of Theorem 4.4: (i) f(x) = exp(alpha * x) for -infty < alpha < infty; (ii) f(x) = x^p if x >= 0, f(x) = infty if x < 0, where 1 <= p < infty; (iii) f(x) = -x^p if x >= 0, f(x) = infty if x < 0, where 0 <= p <= 1; (iv) f(x) = x^p if x > 0, f(x) = infty if x <= 0, where -infty < p <= 0; (v) f(x) = (alpha^2 - x^2)^(-1/2) if |x| < alpha, f(x) = infty if |x| >= alpha, where alpha > 0; (vi) f(x) = -log x if x > 0, f(x) = infty if x <= 0.

          def effectiveDomain {n : } (S : Set (Fin n)) (f : (Fin n)EReal) :
          Set (Fin n)

          Definition 4.4: The effective domain of a convex function f on S, denoted dom f, is the projection of epi f onto R^n; equivalently, dom f = {x | ∃ μ, (x, μ) ∈ epi f} = {x | f x < +infty}.

          Equations
          Instances For
            theorem effectiveDomain_eq {n : } (S : Set (Fin n)) (f : (Fin n)EReal) :
            effectiveDomain S f = {x : Fin n | x S f x < }
            theorem effectiveDomain_eq_image_fst {n : } (S : Set (Fin n)) (f : (Fin n)EReal) :

            The effective domain is the projection of the epigraph onto the first coordinate.

            theorem convex_image_fst_epigraph {n : } {S : Set (Fin n)} {f : (Fin n)EReal} (hf : ConvexFunctionOn S f) :

            The image of the epigraph under the first projection is convex.