Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
Zhangir Azerbayev
squashed?
4365a98
raw
history blame
7.81 kB
/-
Copyright (c) 2021 YaΓ«l Dillies. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: YaΓ«l Dillies
-/
import analysis.convex.function
/-!
# Quasiconvex and quasiconcave functions
This file defines quasiconvexity, quasiconcavity and quasilinearity of functions, which are
generalizations of unimodality and monotonicity. Convexity implies quasiconvexity, concavity implies
quasiconcavity, and monotonicity implies quasilinearity.
## Main declarations
* `quasiconvex_on π•œ s f`: Quasiconvexity of the function `f` on the set `s` with scalars `π•œ`. This
means that, for all `r`, `{x ∈ s | f x ≀ r}` is `π•œ`-convex.
* `quasiconcave_on π•œ s f`: Quasiconcavity of the function `f` on the set `s` with scalars `π•œ`. This
means that, for all `r`, `{x ∈ s | r ≀ f x}` is `π•œ`-convex.
* `quasilinear_on π•œ s f`: Quasilinearity of the function `f` on the set `s` with scalars `π•œ`. This
means that `f` is both quasiconvex and quasiconcave.
## TODO
Prove that a quasilinear function between two linear orders is either monotone or antitone. This is
not hard but quite a pain to go about as there are many cases to consider.
## References
* https://en.wikipedia.org/wiki/Quasiconvex_function
-/
open function order_dual set
variables {π•œ E F Ξ² : Type*}
section ordered_semiring
variables [ordered_semiring π•œ]
section add_comm_monoid
variables [add_comm_monoid E] [add_comm_monoid F]
section ordered_add_comm_monoid
variables (π•œ) [ordered_add_comm_monoid Ξ²] [has_smul π•œ E] (s : set E) (f : E β†’ Ξ²)
/-- A function is quasiconvex if all its sublevels are convex.
This means that, for all `r`, `{x ∈ s | f x ≀ r}` is `π•œ`-convex. -/
def quasiconvex_on : Prop :=
βˆ€ r, convex π•œ {x ∈ s | f x ≀ r}
/-- A function is quasiconcave if all its superlevels are convex.
This means that, for all `r`, `{x ∈ s | r ≀ f x}` is `π•œ`-convex. -/
def quasiconcave_on : Prop :=
βˆ€ r, convex π•œ {x ∈ s | r ≀ f x}
/-- A function is quasilinear if it is both quasiconvex and quasiconcave.
This means that, for all `r`,
the sets `{x ∈ s | f x ≀ r}` and `{x ∈ s | r ≀ f x}` are `π•œ`-convex. -/
def quasilinear_on : Prop :=
quasiconvex_on π•œ s f ∧ quasiconcave_on π•œ s f
variables {π•œ s f}
lemma quasiconvex_on.dual : quasiconvex_on π•œ s f β†’ quasiconcave_on π•œ s (to_dual ∘ f) := id
lemma quasiconcave_on.dual : quasiconcave_on π•œ s f β†’ quasiconvex_on π•œ s (to_dual ∘ f) := id
lemma quasilinear_on.dual : quasilinear_on π•œ s f β†’ quasilinear_on π•œ s (to_dual ∘ f) := and.swap
lemma convex.quasiconvex_on_of_convex_le (hs : convex π•œ s) (h : βˆ€ r, convex π•œ {x | f x ≀ r}) :
quasiconvex_on π•œ s f :=
Ξ» r, hs.inter (h r)
lemma convex.quasiconcave_on_of_convex_ge (hs : convex π•œ s) (h : βˆ€ r, convex π•œ {x | r ≀ f x}) :
quasiconcave_on π•œ s f :=
@convex.quasiconvex_on_of_convex_le π•œ E Ξ²α΅’α΅ˆ _ _ _ _ _ _ hs h
lemma quasiconvex_on.convex [is_directed Ξ² (≀)] (hf : quasiconvex_on π•œ s f) : convex π•œ s :=
Ξ» x y hx hy a b ha hb hab,
let ⟨z, hxz, hyz⟩ := exists_ge_ge (f x) (f y) in (hf _ ⟨hx, hxz⟩ ⟨hy, hyz⟩ ha hb hab).1
lemma quasiconcave_on.convex [is_directed Ξ² (β‰₯)] (hf : quasiconcave_on π•œ s f) : convex π•œ s :=
hf.dual.convex
end ordered_add_comm_monoid
section linear_ordered_add_comm_monoid
variables [linear_ordered_add_comm_monoid Ξ²]
section has_smul
variables [has_smul π•œ E] {s : set E} {f g : E β†’ Ξ²}
lemma quasiconvex_on.sup (hf : quasiconvex_on π•œ s f) (hg : quasiconvex_on π•œ s g) :
quasiconvex_on π•œ s (f βŠ” g) :=
begin
intro r,
simp_rw [pi.sup_def, sup_le_iff, ←set.sep_inter_sep],
exact (hf r).inter (hg r),
end
lemma quasiconcave_on.inf (hf : quasiconcave_on π•œ s f) (hg : quasiconcave_on π•œ s g) :
quasiconcave_on π•œ s (f βŠ“ g) :=
hf.dual.sup hg
lemma quasiconvex_on_iff_le_max :
quasiconvex_on π•œ s f ↔ convex π•œ s ∧
βˆ€ ⦃x y : E⦄, x ∈ s β†’ y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’
f (a β€’ x + b β€’ y) ≀ max (f x) (f y) :=
⟨λ hf, ⟨hf.convex, λ x y hx hy a b ha hb hab,
(hf _ ⟨hx, le_max_left _ _⟩ ⟨hy, le_max_right _ _⟩ ha hb hab).2⟩,
Ξ» hf r x y hx hy a b ha hb hab,
⟨hf.1 hx.1 hy.1 ha hb hab, (hf.2 hx.1 hy.1 ha hb hab).trans $ max_le hx.2 hy.2⟩⟩
lemma quasiconcave_on_iff_min_le :
quasiconcave_on π•œ s f ↔ convex π•œ s ∧
βˆ€ ⦃x y : E⦄, x ∈ s β†’ y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’
min (f x) (f y) ≀ f (a β€’ x + b β€’ y) :=
@quasiconvex_on_iff_le_max π•œ E Ξ²α΅’α΅ˆ _ _ _ _ _ _
lemma quasilinear_on_iff_mem_interval :
quasilinear_on π•œ s f ↔ convex π•œ s ∧
βˆ€ ⦃x y : E⦄, x ∈ s β†’ y ∈ s β†’ βˆ€ ⦃a b : π•œβ¦„, 0 ≀ a β†’ 0 ≀ b β†’ a + b = 1 β†’
f (a β€’ x + b β€’ y) ∈ interval (f x) (f y) :=
begin
rw [quasilinear_on, quasiconvex_on_iff_le_max, quasiconcave_on_iff_min_le, and_and_and_comm,
and_self],
apply and_congr_right',
simp_rw [←forall_and_distrib, interval, mem_Icc, and_comm],
end
lemma quasiconvex_on.convex_lt (hf : quasiconvex_on π•œ s f) (r : Ξ²) : convex π•œ {x ∈ s | f x < r} :=
begin
refine Ξ» x y hx hy a b ha hb hab, _,
have h := hf _ ⟨hx.1, le_max_left _ _⟩ ⟨hy.1, le_max_right _ _⟩ ha hb hab,
exact ⟨h.1, h.2.trans_lt $ max_lt hx.2 hy.2⟩,
end
lemma quasiconcave_on.convex_gt (hf : quasiconcave_on π•œ s f) (r : Ξ²) : convex π•œ {x ∈ s | r < f x} :=
hf.dual.convex_lt r
end has_smul
section ordered_smul
variables [has_smul π•œ E] [module π•œ Ξ²] [ordered_smul π•œ Ξ²] {s : set E} {f : E β†’ Ξ²}
lemma convex_on.quasiconvex_on (hf : convex_on π•œ s f) : quasiconvex_on π•œ s f :=
hf.convex_le
lemma concave_on.quasiconcave_on (hf : concave_on π•œ s f) : quasiconcave_on π•œ s f :=
hf.convex_ge
end ordered_smul
end linear_ordered_add_comm_monoid
end add_comm_monoid
section linear_ordered_add_comm_monoid
variables [linear_ordered_add_comm_monoid E] [ordered_add_comm_monoid Ξ²] [module π•œ E]
[ordered_smul π•œ E] {s : set E} {f : E β†’ Ξ²}
lemma monotone_on.quasiconvex_on (hf : monotone_on f s) (hs : convex π•œ s) : quasiconvex_on π•œ s f :=
hf.convex_le hs
lemma monotone_on.quasiconcave_on (hf : monotone_on f s) (hs : convex π•œ s) :
quasiconcave_on π•œ s f :=
hf.convex_ge hs
lemma monotone_on.quasilinear_on (hf : monotone_on f s) (hs : convex π•œ s) : quasilinear_on π•œ s f :=
⟨hf.quasiconvex_on hs, hf.quasiconcave_on hs⟩
lemma antitone_on.quasiconvex_on (hf : antitone_on f s) (hs : convex π•œ s) : quasiconvex_on π•œ s f :=
hf.convex_le hs
lemma antitone_on.quasiconcave_on (hf : antitone_on f s) (hs : convex π•œ s) :
quasiconcave_on π•œ s f :=
hf.convex_ge hs
lemma antitone_on.quasilinear_on (hf : antitone_on f s) (hs : convex π•œ s) : quasilinear_on π•œ s f :=
⟨hf.quasiconvex_on hs, hf.quasiconcave_on hs⟩
lemma monotone.quasiconvex_on (hf : monotone f) : quasiconvex_on π•œ univ f :=
(hf.monotone_on _).quasiconvex_on convex_univ
lemma monotone.quasiconcave_on (hf : monotone f) : quasiconcave_on π•œ univ f :=
(hf.monotone_on _).quasiconcave_on convex_univ
lemma monotone.quasilinear_on (hf : monotone f) : quasilinear_on π•œ univ f :=
⟨hf.quasiconvex_on, hf.quasiconcave_on⟩
lemma antitone.quasiconvex_on (hf : antitone f) : quasiconvex_on π•œ univ f :=
(hf.antitone_on _).quasiconvex_on convex_univ
lemma antitone.quasiconcave_on (hf : antitone f) : quasiconcave_on π•œ univ f :=
(hf.antitone_on _).quasiconcave_on convex_univ
lemma antitone.quasilinear_on (hf : antitone f) : quasilinear_on π•œ univ f :=
⟨hf.quasiconvex_on, hf.quasiconcave_on⟩
end linear_ordered_add_comm_monoid
end ordered_semiring