Documentation

ConvexAnalysis.ClarkeDeriv

Clarke's generalized directional derivative #

For a function f : E → ℝ on a real normed space, Clarke's generalized directional derivative is f°(x; v) = limsup_{y → x, t → 0⁺} (f (y + t • v) - f y) / t. For f Lipschitz near x it is finite, positively homogeneous and subadditive in v, hence a convex function of v, and Lipschitz with the constant of f. This file proves its calculus: scaling, the sum and chain rules as inequalities, the strictly differentiable and convex cases, upper semicontinuity in x, and Lebourg's mean value theorem in terms of f°. Only a normed space is needed; Clarke's generalized gradient, built from f°, is in ClarkeBanach.lean (in the dual space) and in Clarke.lean (in a real inner product space).

Main definitions #

Main statements #

Implementation notes #

f°(x; v) is the upper limit in EReal along the filter 𝓝 x ×ˢ 𝓝[>] 0, so it is defined for every f, with no junk value: an upper limit in ℝ would take a junk value for unbounded quotients.

References #

Tags #

Clarke generalized directional derivative, locally Lipschitz function, nonsmooth analysis, Lebourg's mean value theorem, chain rule

noncomputable def ConvexAnalysis.clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (x v : E) :

Clarke's generalized directional derivative f°(x; v): the upper limit of the difference quotients (f (y + t • v) - f y) / t as y → x and t → 0⁺ Clarke, Chapter 2, Clarke1980, Section 2. Clarke defines it for f locally Lipschitz; here it is defined for every f, with values in EReal, and for f Lipschitz near x it is finite (coe_toReal_clarkeDeriv).

Equations
Instances For

    The filter (y, t) → (x, 0⁺) #

    The filter (y, t) → (x, 0⁺) of Clarke's directional derivative is finer than 𝓝 (x, 0).

    theorem ConvexAnalysis.tendsto_add_smul {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (x v : E) :
    Filter.Tendsto (fun (p : E × ℝ) => p.1 + p.2 • v) (nhds x ×ˢ nhdsWithin 0 (Set.Ioi 0)) (nhds x)

    As (y, t) → (x, 0⁺), the points y + t • v of the difference quotients tend to x.

    Basic properties of f° #

    @[simp]
    theorem ConvexAnalysis.clarkeDeriv_zero {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (x : E) :
    clarkeDeriv f x 0 = 0

    f°(x; 0) = 0.

    @[simp]
    theorem ConvexAnalysis.clarkeDeriv_const {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (c : ℝ) (x v : E) :
    clarkeDeriv (fun (x : E) => c) x v = 0

    The directional derivative of a constant function is 0.

    theorem ConvexAnalysis.clarkeDeriv_le {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v : E) :
    clarkeDeriv f x v ≤ ↑(↑K * ‖v‖)

    The upper bound f°(x; v) ≤ K ‖v‖ for f Lipschitz with constant K near x.

    theorem ConvexAnalysis.neg_le_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v : E) :
    ↑(-(↑K * ‖v‖)) ≤ clarkeDeriv f x v

    The lower bound -(K ‖v‖) ≤ f°(x; v) for f Lipschitz with constant K near x.

    theorem ConvexAnalysis.clarkeDeriv_ne_top {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v : E) :

    For f Lipschitz near x, f°(x; v) ≠ ⊤.

    theorem ConvexAnalysis.clarkeDeriv_ne_bot {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v : E) :

    For f Lipschitz near x, f°(x; v) ≠ ⊥.

    theorem ConvexAnalysis.coe_toReal_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v : E) :
    ↑(clarkeDeriv f x v).toReal = clarkeDeriv f x v

    For f Lipschitz near x, f°(x; v) is a real number (Clarke1980, Section 2).

    theorem ConvexAnalysis.abs_toReal_clarkeDeriv_le {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v : E) :

    For f Lipschitz with constant K near x, |f°(x; v)| ≤ K ‖v‖.

    theorem ConvexAnalysis.clarkeDeriv_smul {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (x v : E) {c : ℝ} (hc : 0 ≤ c) :
    clarkeDeriv f x (c • v) = ↑c * clarkeDeriv f x v

    Positive homogeneity: f°(x; c • v) = c f°(x; v) for c ≥ 0 (Clarke1980, Section 2). No hypothesis on f is needed.

    theorem ConvexAnalysis.clarkeDeriv_neg {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (x v : E) :
    clarkeDeriv (-f) x v = clarkeDeriv f x (-v)

    (-f)°(x; v) = f°(x; -v). No hypothesis on f is needed.

    theorem ConvexAnalysis.clarkeDeriv_add_le_add {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v w : E) :
    clarkeDeriv f x (v + w) ≤ clarkeDeriv f x v + clarkeDeriv f x w

    Subadditivity: f°(x; v + w) ≤ f°(x; v) + f°(x; w) for f Lipschitz near x (Clarke1980, Section 2).

    theorem ConvexAnalysis.clarkeDeriv_eq_coe_toReal {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) :
    clarkeDeriv f x = fun (v : E) => ↑(clarkeDeriv f x v).toReal

    v ↦ f°(x; v) is the real valued function v ↦ (f°(x; v)).toReal, for f Lipschitz near x.

    theorem ConvexAnalysis.convexFun_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) :

    For f Lipschitz near x, v ↦ f°(x; v) is convex: it is positively homogeneous and subadditive Clarke, Chapter 2, Clarke1980, Section 2.

    theorem ConvexAnalysis.clarkeDeriv_le_add {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) (v w : E) :
    clarkeDeriv f x v ≤ clarkeDeriv f x w + ↑(↑K * ‖v - w‖)

    f°(x; v) ≤ f°(x; w) + K ‖v - w‖ for f Lipschitz with constant K near x.

    theorem ConvexAnalysis.lipschitzWith_toReal_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) :
    LipschitzWith K fun (v : E) => (clarkeDeriv f x v).toReal

    For f Lipschitz with constant K near x, v ↦ f°(x; v) is Lipschitz with constant K.

    theorem ConvexAnalysis.continuous_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hf : LipschitzOnWith K f U) :

    For f Lipschitz near x, v ↦ f°(x; v) is continuous.

    theorem ConvexAnalysis.limsup_le_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (x v : E) :
    Filter.limsup (fun (t : ℝ) => ↑((f (x + t • v) - f x) / t)) (nhdsWithin 0 (Set.Ioi 0)) ≤ clarkeDeriv f x v

    The upper Dini derivative limsup_{t → 0⁺} (f (x + t • v) - f x) / t is at most f°(x; v).

    theorem ConvexAnalysis.clarkeDeriv_nonneg_of_isLocalMin {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} (h : IsLocalMin f x) (v : E) :

    At a local minimum, f°(x; v) ≥ 0 for every v.

    theorem ConvexAnalysis.clarkeDeriv_const_smul {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (x v : E) {c : ℝ} (hc : 0 ≤ c) :
    clarkeDeriv (c • f) x v = ↑c * clarkeDeriv f x v

    (c f)°(x; v) = c f°(x; v) for c ≥ 0. No hypothesis on f is needed; for c = 0 both sides are 0, since 0 * ⊤ = 0 * ⊥ = 0 in EReal.

    theorem ConvexAnalysis.clarkeDeriv_add_le {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {x : E} {K : NNReal} {U : Set E} (hU : U ∈ nhds x) (hg : LipschitzOnWith K g U) (v : E) :
    clarkeDeriv (f + g) x v ≤ clarkeDeriv f x v + clarkeDeriv g x v

    (f + g)°(x; v) ≤ f°(x; v) + g°(x; v) if g is Lipschitz near x; nothing is assumed on f.

    theorem ConvexAnalysis.le_clarkeDeriv_of_hasFDerivAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {f' : E →L[ℝ] ℝ} {x : E} (hf : HasFDerivAt f f' x) (v : E) :
    ↑(f' v) ≤ clarkeDeriv f x v

    A Fréchet derivative is below Clarke's directional derivative (no Lipschitz hypothesis).

    theorem ConvexAnalysis.tendsto_comp_sub_div_of_hasStrictFDerivAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace ℝ F] {f : F → ℝ} {G : E → F} {G' : E →L[ℝ] F} {x : E} (hG : HasStrictFDerivAt G G' x) {U : Set F} {K : NNReal} (hU : U ∈ nhds (G x)) (hf : LipschitzOnWith K f U) (v : E) :
    Filter.Tendsto (fun (p : E × ℝ) => (f (G (p.1 + p.2 • v)) - f (G p.1 + p.2 • G' v)) / p.2) (nhds x ×ˢ nhdsWithin 0 (Set.Ioi 0)) (nhds 0)

    For G strictly differentiable at x and f Lipschitz near G x, replacing f (G (y + t • v)) by f (G y + t • G' v) in the difference quotients of f ∘ G changes them by a term that tends to 0 as (y, t) → (x, 0⁺).

    theorem ConvexAnalysis.clarkeDeriv_comp_eq_limsup_of_hasStrictFDerivAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace ℝ F] {f : F → ℝ} {G : E → F} {G' : E →L[ℝ] F} {x : E} (hG : HasStrictFDerivAt G G' x) {U : Set F} {K : NNReal} (hU : U ∈ nhds (G x)) (hf : LipschitzOnWith K f U) (v : E) :
    clarkeDeriv (f ∘ G) x v = Filter.limsup (fun (p : E × ℝ) => ↑((f (G p.1 + p.2 • G' v) - f (G p.1)) / p.2)) (nhds x ×ˢ nhdsWithin 0 (Set.Ioi 0))

    (f ∘ G)°(x; v) is the upper limit of (f (G y + t • G' v) - f (G y)) / t as (y, t) → (x, 0⁺), for G strictly differentiable at x and f Lipschitz near G x.

    theorem ConvexAnalysis.clarkeDeriv_comp_le_of_hasStrictFDerivAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace ℝ F] {f : F → ℝ} {G : E → F} {G' : E →L[ℝ] F} {x : E} (hG : HasStrictFDerivAt G G' x) {U : Set F} {K : NNReal} (hU : U ∈ nhds (G x)) (hf : LipschitzOnWith K f U) (v : E) :
    clarkeDeriv (f ∘ G) x v ≤ clarkeDeriv f (G x) (G' v)

    (f ∘ G)°(x; v) ≤ f°(G x; G' v) for G strictly differentiable at x and f Lipschitz near G x Clarke, Chapter 2.

    theorem ConvexAnalysis.clarkeDeriv_comp_eq_of_surjective {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace E] [CompleteSpace F] {f : F → ℝ} {G : E → F} {G' : E →L[ℝ] F} {x : E} (hG : HasStrictFDerivAt G G' x) (hG' : Function.Surjective ⇑G') {U : Set F} {K : NNReal} (hU : U ∈ nhds (G x)) (hf : LipschitzOnWith K f U) (v : E) :
    clarkeDeriv (f ∘ G) x v = clarkeDeriv f (G x) (G' v)

    Chain rule with equality for a strictly differentiable G with surjective derivative Clarke, Chapter 2: (f ∘ G)°(x; v) = f°(G x; G' v) for f Lipschitz near G x, in Banach spaces. Here G maps the neighbourhoods of x onto neighbourhoods of G x (HasStrictFDerivAt.map_nhds_eq_of_surj), so the points G y exhaust a neighbourhood of G x.

    theorem ConvexAnalysis.clarkeDeriv_eq_of_hasStrictFDerivAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : E →L[ℝ] ℝ} (hf : HasStrictFDerivAt f f' x) (v : E) :
    clarkeDeriv f x v = ↑(f' v)

    For a strictly differentiable f, f°(x; v) = f' v Clarke, Chapter 2.

    theorem ConvexAnalysis.clarkeDeriv_add_of_hasStrictFDerivAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {x : E} {g' : E →L[ℝ] ℝ} (hg : HasStrictFDerivAt g g' x) (v : E) :
    clarkeDeriv (f + g) x v = clarkeDeriv f x v + ↑(g' v)

    (f + g)°(x; v) = f°(x; v) + g' v for g strictly differentiable at x; nothing is assumed on f.

    theorem ConvexAnalysis.clarkeDeriv_le_sub_of_convexOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} (hf : ConvexOn ℝ Set.univ f) (hfc : ContinuousAt f x) (v : E) :
    clarkeDeriv f x v ≤ ↑(f (x + v) - f x)

    For a convex f : E → ℝ continuous at x, f°(x; v) ≤ f (x + v) - f x: by convexity the difference quotients (f (y + t • v) - f y) / t are at most f (y + v) - f y for t ≤ 1, and f is continuous.

    theorem ConvexAnalysis.exists_mem_openSegment_le_clarkeDeriv {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x y : E} (hf : ∀ z ∈ segment ℝ x y, ∃ (K : NNReal), ∃ U ∈ nhds z, LipschitzOnWith K f U) :
    ∃ z ∈ openSegment ℝ x y, ↑(f y - f x) ≤ clarkeDeriv f z (y - x) ∧ ↑(f x - f y) ≤ clarkeDeriv f z (x - y)

    Lebourg's mean value theorem in terms of f° (Lebourg; Clarke, Chapter 2): if f is Lipschitz near every point of the segment [x, y], then at some point z of the open segment f y - f x ≤ f°(z; y - x) and f x - f y ≤ f°(z; x - y). The proof applies Fermat's rule to t ↦ f (x + t • (y - x)) + t (f x - f y) at an extremum in (0, 1), and the chain rule along the line.

    Semicontinuity, convex functions and linear maps #

    y ↦ f°(y; v) is upper semicontinuous, for every f and v Clarke, Chapter 2.

    theorem ConvexAnalysis.tendsto_clarkeDeriv_of_convexOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} (hf : ConvexOn ℝ Set.univ f) (hfc : ContinuousAt f x) (v : E) :
    Filter.Tendsto (fun (t : ℝ) => ↑((f (x + t • v) - f x) / t)) (nhdsWithin 0 (Set.Ioi 0)) (nhds (clarkeDeriv f x v))

    A convex function continuous at x is regular: the one-sided directional derivative exists and equals f°(x; v) Clarke, Chapter 2.

    theorem ConvexAnalysis.clarkeDeriv_comp_continuousLinearMap_le {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace ℝ F] (f : F → ℝ) (A : E →L[ℝ] F) (x v : E) :
    clarkeDeriv (f ∘ ⇑A) x v ≤ clarkeDeriv f (A x) (A v)

    Composition with a bounded linear map: (f ∘ A)°(x; v) ≤ f°(A x; A v), no hypothesis.