# Documentation

Mathlib.Analysis.Convex.Cone.Basic

# Convex cones #

In a π-module E, we define a convex cone as a set s such that a β’ x + b β’ y β s whenever x, y β s and a, b > 0. We prove that convex cones form a CompleteLattice, and define their images (ConvexCone.map) and preimages (ConvexCone.comap) under linear maps.

We define pointed, blunt, flat and salient cones, and prove the correspondence between convex cones and ordered modules.

We define Convex.toCone to be the minimal cone that includes a given convex set.

## Main statements #

We prove two extension theorems:

• riesz_extension: M. Riesz extension theorem says that if s is a convex cone in a real vector space E, p is a submodule of E such that p + s = E, and f is a linear function p β β which is nonnegative on p β© s, then there exists a globally defined linear function g : E β β that agrees with f on p, and is nonnegative on s.
• exists_extension_of_le_sublinear: Hahn-Banach theorem: if N : E β β is a sublinear map, f is a linear map defined on a subspace of E, and f x β€ N x for all x in the domain of f, then f can be extended to the whole space to a linear map g such that g x β€ N x for all x

In Mathlib/Analysis/Convex/Cone/Dual.lean, we prove the following theorems:

• ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem: This variant of the hyperplane separation theorem states that given a nonempty, closed, convex cone K in a complete, real inner product space H and a point b disjoint from it, there is a vector y which separates b from K in the sense that for all points x in K, 0 β€ βͺx, yβ«_β and βͺy, bβ«_β < 0. This is also a geometric interpretation of the Farkas lemma.
• ConvexCone.inner_dual_cone_of_inner_dual_cone_eq_self:

## Implementation notes #

While Convex π is a predicate on sets, ConvexCone π E is a bundled convex cone.

## References #

• https://en.wikipedia.org/wiki/Convex_cone
• [Stephen P. Boyd and Lieven Vandenberghe, Convex Optimization][boydVandenberghe2004]
• [Emo Welzl and Bernd GΓ€rtner, Cone Programming][welzl_garter]

### Definition of ConvexCone and basic properties #

structure ConvexCone (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [] [SMul π E] :
Type u_2
• carrier : Set E
• smul_mem' : β β¦c : πβ¦, 0 < c β β β¦x : Eβ¦, x β s.carrier β c β’ x β s.carrier
• add_mem' : β β¦x : Eβ¦, x β s.carrier β β β¦y : Eβ¦, y β s.carrier β x + y β s.carrier

A convex cone is a subset s of a π-module such that a β’ x + b β’ y β s whenever a, b > 0 and x, y β s.

Instances For
instance ConvexCone.instSetLikeConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
SetLike (ConvexCone π E) E
@[simp]
theorem ConvexCone.coe_mk {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {s : Set E} {hβ : β β¦c : πβ¦, 0 < c β β β¦x : Eβ¦, x β s β c β’ x β s} {hβ : β β¦x : Eβ¦, x β s β β β¦y : Eβ¦, y β s β x + y β s} :
β{ carrier := s, smul_mem' := hβ, add_mem' := hβ } = s
@[simp]
theorem ConvexCone.mem_mk {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {s : Set E} {hβ : β β¦c : πβ¦, 0 < c β β β¦x : Eβ¦, x β s β c β’ x β s} {hβ : β β¦x : Eβ¦, x β s β β β¦y : Eβ¦, y β s β x + y β s} {x : E} :
x β { carrier := s, smul_mem' := hβ, add_mem' := hβ } β x β s
theorem ConvexCone.ext {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} {T : ConvexCone π E} (h : β (x : E), x β S β x β T) :
S = T

Two ConvexCones are equal if they have the same elements.

theorem ConvexCone.smul_mem {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) {c : π} {x : E} (hc : 0 < c) (hx : x β S) :
theorem ConvexCone.add_mem {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) β¦x : Eβ¦ (hx : x β S) β¦y : Eβ¦ (hy : y β S) :
x + y β S
instance ConvexCone.instInfConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
Inf (ConvexCone π E)
@[simp]
theorem ConvexCone.coe_inf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) (T : ConvexCone π E) :
β(S β T) = βS β© βT
theorem ConvexCone.mem_inf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) (T : ConvexCone π E) {x : E} :
instance ConvexCone.instInfSetConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
InfSet (ConvexCone π E)
@[simp]
theorem ConvexCone.coe_sInf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : Set (ConvexCone π E)) :
β(sInf S) = β (s : ConvexCone π E) (_ : s β S), βs
theorem ConvexCone.mem_sInf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {x : E} {S : Set (ConvexCone π E)} :
x β sInf S β β (s : ConvexCone π E), s β S β x β s
@[simp]
theorem ConvexCone.coe_iInf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {ΞΉ : Sort u_5} (f : ΞΉ β ConvexCone π E) :
β(iInf f) = β (i : ΞΉ), β(f i)
theorem ConvexCone.mem_iInf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {ΞΉ : Sort u_5} {x : E} {f : ΞΉ β ConvexCone π E} :
x β iInf f β β (i : ΞΉ), x β f i
instance ConvexCone.instBotConvexCone (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
Bot (ConvexCone π E)
theorem ConvexCone.mem_bot (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (x : E) :
() = False
@[simp]
theorem ConvexCone.coe_bot (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
instance ConvexCone.instTopConvexCone (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
Top (ConvexCone π E)
theorem ConvexCone.mem_top (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (x : E) :
@[simp]
theorem ConvexCone.coe_top (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
ββ€ = Set.univ
instance ConvexCone.instCompleteLatticeConvexCone (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
instance ConvexCone.instInhabitedConvexCone (π : Type u_1) {E : Type u_2} [OrderedSemiring π] [] [SMul π E] :
Inhabited (ConvexCone π E)
theorem ConvexCone.convex {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] (S : ConvexCone π E) :
Convex π βS
theorem ConvexCone.smul_mem_iff {π : Type u_1} {E : Type u_2} [] [] [MulAction π E] (S : ConvexCone π E) {c : π} (hc : 0 < c) {x : E} :
def ConvexCone.map {π : Type u_1} {E : Type u_2} {F : Type u_3} [] [] [] [Module π E] [Module π F] (f : E ββ[π] F) (S : ConvexCone π E) :
ConvexCone π F

The image of a convex cone under a π-linear map is a convex cone.

Instances For
@[simp]
theorem ConvexCone.mem_map {π : Type u_1} {E : Type u_2} {F : Type u_3} [] [] [] [Module π E] [Module π F] {f : E ββ[π] F} {S : ConvexCone π E} {y : F} :
y β β β x, x β S β§ βf x = y
theorem ConvexCone.map_map {π : Type u_1} {E : Type u_2} {F : Type u_3} {G : Type u_4} [] [] [] [] [Module π E] [Module π F] [Module π G] (g : F ββ[π] G) (f : E ββ[π] F) (S : ConvexCone π E) :
@[simp]
theorem ConvexCone.map_id {π : Type u_1} {E : Type u_2} [] [] [Module π E] (S : ConvexCone π E) :
ConvexCone.map LinearMap.id S = S
def ConvexCone.comap {π : Type u_1} {E : Type u_2} {F : Type u_3} [] [] [] [Module π E] [Module π F] (f : E ββ[π] F) (S : ConvexCone π F) :
ConvexCone π E

The preimage of a convex cone under a π-linear map is a convex cone.

Instances For
@[simp]
theorem ConvexCone.coe_comap {π : Type u_1} {E : Type u_2} {F : Type u_3} [] [] [] [Module π E] [Module π F] (f : E ββ[π] F) (S : ConvexCone π F) :
β() = βf β»ΒΉ' βS
@[simp]
theorem ConvexCone.comap_id {π : Type u_1} {E : Type u_2} [] [] [Module π E] (S : ConvexCone π E) :
ConvexCone.comap LinearMap.id S = S
theorem ConvexCone.comap_comap {π : Type u_1} {E : Type u_2} {F : Type u_3} {G : Type u_4} [] [] [] [] [Module π E] [Module π F] [Module π G] (g : F ββ[π] G) (f : E ββ[π] F) (S : ConvexCone π G) :
=
@[simp]
theorem ConvexCone.mem_comap {π : Type u_1} {E : Type u_2} {F : Type u_3} [] [] [] [Module π E] [Module π F] {f : E ββ[π] F} {S : ConvexCone π F} {x : E} :
x β β βf x β S
theorem ConvexCone.to_orderedSMul {π : Type u_1} {E : Type u_2} [] [Module π E] (S : ConvexCone π E) (h : β (x y : E), x β€ y β y - x β S) :
OrderedSMul π E

Constructs an ordered module given an OrderedAddCommGroup, a cone, and a proof that the order relation is the one defined by the cone.

### Convex cones with extra properties #

def ConvexCone.Pointed {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :

A convex cone is pointed if it includes 0.

Instances For
def ConvexCone.Blunt {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :

A convex cone is blunt if it doesn't include 0.

Instances For
theorem ConvexCone.pointed_iff_not_blunt {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :
theorem ConvexCone.blunt_iff_not_pointed {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :
theorem ConvexCone.Pointed.mono {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} {T : ConvexCone π E} (h : S β€ T) :
theorem ConvexCone.Blunt.anti {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} {T : ConvexCone π E} (h : T β€ S) :
def ConvexCone.Flat {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :

A convex cone is flat if it contains some nonzero vector x and its opposite -x.

Instances For
def ConvexCone.Salient {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :

A convex cone is salient if it doesn't include x and -x for any nonzero x.

Instances For
theorem ConvexCone.salient_iff_not_flat {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) :
theorem ConvexCone.Flat.mono {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} {T : ConvexCone π E} (h : S β€ T) :
theorem ConvexCone.Salient.anti {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} {T : ConvexCone π E} (h : T β€ S) :
theorem ConvexCone.Flat.pointed {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} (hS : ) :

A flat cone is always pointed (contains 0).

theorem ConvexCone.Blunt.salient {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] {S : ConvexCone π E} :

A blunt cone (one not containing 0) is always salient.

def ConvexCone.toPreorder {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) (hβ : ) :

A pointed convex cone defines a preorder.

Instances For
def ConvexCone.toPartialOrder {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) (hβ : ) (hβ : ) :

A pointed and salient cone defines a partial order.

Instances For
def ConvexCone.toOrderedAddCommGroup {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [SMul π E] (S : ConvexCone π E) (hβ : ) (hβ : ) :

A pointed and salient cone defines an OrderedAddCommGroup.

Instances For
@[simp]
theorem ConvexCone.mem_zero {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] (x : E) :
x β 0 β x = 0
@[simp]
theorem ConvexCone.coe_zero {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :
β0 = 0
theorem ConvexCone.pointed_zero {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :
instance ConvexCone.instAdd {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :
@[simp]
theorem ConvexCone.mem_add {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] {Kβ : ConvexCone π E} {Kβ : ConvexCone π E} {a : E} :
a β Kβ + Kβ β β x y, x β Kβ β§ y β Kβ β§ x + y = a
instance ConvexCone.instAddZeroClass {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :
instance ConvexCone.instAddCommSemigroup {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :

### Submodules are cones #

def Submodule.toConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] (S : Submodule π E) :
ConvexCone π E

Every submodule is trivially a convex cone.

Instances For
@[simp]
theorem Submodule.coe_toConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] (S : Submodule π E) :
β() = βS
@[simp]
theorem Submodule.mem_toConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] {x : E} {S : Submodule π E} :
@[simp]
theorem Submodule.toConvexCone_le_iff {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] {S : Submodule π E} {T : Submodule π E} :
@[simp]
theorem Submodule.toConvexCone_bot {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :
@[simp]
theorem Submodule.toConvexCone_top {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] :
@[simp]
theorem Submodule.toConvexCone_inf {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] (S : Submodule π E) (T : Submodule π E) :
@[simp]
theorem Submodule.pointed_toConvexCone {π : Type u_1} {E : Type u_2} [OrderedSemiring π] [] [Module π E] (S : Submodule π E) :

### Positive cone of an ordered module #

def ConvexCone.positive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :
ConvexCone π E

The positive cone is the convex cone formed by the set of nonnegative elements in an ordered module.

Instances For
@[simp]
theorem ConvexCone.mem_positive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] {x : E} :
@[simp]
theorem ConvexCone.coe_positive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :
β(ConvexCone.positive π E) =
theorem ConvexCone.salient_positive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :

The positive cone of an ordered module is always salient.

theorem ConvexCone.pointed_positive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :

The positive cone of an ordered module is always pointed.

def ConvexCone.strictlyPositive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :
ConvexCone π E

The cone of strictly positive elements.

Note that this naming diverges from the mathlib convention of pos and nonneg due to "positive cone" (ConvexCone.positive) being established terminology for the non-negative elements.

Instances For
@[simp]
theorem ConvexCone.mem_strictlyPositive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] {x : E} :
@[simp]
theorem ConvexCone.coe_strictlyPositive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :
β() =
theorem ConvexCone.positive_le_strictlyPositive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :
theorem ConvexCone.salient_strictlyPositive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :

The strictly positive cone of an ordered module is always salient.

theorem ConvexCone.blunt_strictlyPositive (π : Type u_1) (E : Type u_2) [OrderedSemiring π] [Module π E] [OrderedSMul π E] :

The strictly positive cone of an ordered module is always blunt.

### Cone over a convex set #

def Convex.toCone {π : Type u_1} {E : Type u_2} [] [] [Module π E] (s : Set E) (hs : Convex π s) :
ConvexCone π E

The set of vectors proportional to those in a convex set forms a convex cone.

Instances For
theorem Convex.mem_toCone {π : Type u_1} {E : Type u_2} [] [] [Module π E] {s : Set E} (hs : Convex π s) {x : E} :
x β β β c, 0 < c β§ β y, y β s β§ c β’ y = x
theorem Convex.mem_toCone' {π : Type u_1} {E : Type u_2} [] [] [Module π E] {s : Set E} (hs : Convex π s) {x : E} :
x β β β c, 0 < c β§ c β’ x β s
theorem Convex.subset_toCone {π : Type u_1} {E : Type u_2} [] [] [Module π E] {s : Set E} (hs : Convex π s) :
s β β()
theorem Convex.toCone_isLeast {π : Type u_1} {E : Type u_2} [] [] [Module π E] {s : Set E} (hs : Convex π s) :
IsLeast {t | s β βt} ()

hs.toCone s is the least cone that includes s.

theorem Convex.toCone_eq_sInf {π : Type u_1} {E : Type u_2} [] [] [Module π E] {s : Set E} (hs : Convex π s) :
= sInf {t | s β βt}
theorem convexHull_toCone_isLeast {π : Type u_1} {E : Type u_2} [] [] [Module π E] (s : Set E) :
IsLeast {t | s β βt} (Convex.toCone (β(convexHull π) s) (_ : Convex π (β(convexHull π) s)))
theorem convexHull_toCone_eq_sInf {π : Type u_1} {E : Type u_2} [] [] [Module π E] (s : Set E) :
Convex.toCone (β(convexHull π) s) (_ : Convex π (β(convexHull π) s)) = sInf {t | s β βt}

### M. Riesz extension theorem #

Given a convex cone s in a vector space E, a submodule p, and a linear f : p β β, assume that f is nonnegative on p β© s and p + s = E. Then there exists a globally defined linear function g : E β β that agrees with f on p, and is nonnegative on s.

We prove this theorem using Zorn's lemma. RieszExtension.step is the main part of the proof. It says that if the domain p of f is not the whole space, then f can be extended to a larger subspace p β span β {y} without breaking the non-negativity condition.

In RieszExtension.exists_top we use Zorn's lemma to prove that we can extend f to a linear map g on β€ : Submodule E. Mathematically this is the same as a linear map on E but in Lean β€ : Submodule E is isomorphic but is not equal to E. In riesz_extension we use this isomorphism to prove the theorem.

theorem RieszExtension.step {E : Type u_2} [] [] (s : ) (f : ) (nonneg : β (x : { x // x β f.domain }), βx β s β 0 β€ βf x) (dense : β (y : E), β x, βx + y β s) (hdom : f.domain β  β€) :
β g, f < g β§ β (x : { x // x β g.domain }), βx β s β 0 β€ βg x

Induction step in M. Riesz extension theorem. Given a convex cone s in a vector space E, a partially defined linear map f : f.domain β β, assume that f is nonnegative on f.domain β© p and p + s = E. If f is not defined on the whole E, then we can extend it to a larger submodule without breaking the non-negativity condition.

theorem RieszExtension.exists_top {E : Type u_2} [] [] (s : ) (p : ) (hp_nonneg : β (x : { x // x β p.domain }), βx β s β 0 β€ βp x) (hp_dense : β (y : E), β x, βx + y β s) :
β q, q β₯ p β§ q.domain = β€ β§ β (x : { x // x β q.domain }), βx β s β 0 β€ βq x
theorem riesz_extension {E : Type u_2} [] [] (s : ) (f : ) (nonneg : β (x : { x // x β f.domain }), βx β s β 0 β€ βf x) (dense : β (y : E), β x, βx + y β s) :
β g, (β (x : { x // x β f.domain }), βg βx = βf x) β§ β (x : E), x β s β 0 β€ βg x

M. Riesz extension theorem: given a convex cone s in a vector space E, a submodule p, and a linear f : p β β, assume that f is nonnegative on p β© s and p + s = E. Then there exists a globally defined linear function g : E β β that agrees with f on p, and is nonnegative on s.

theorem exists_extension_of_le_sublinear {E : Type u_2} [] [] (f : ) (N : E β β) (N_hom : β (c : β), 0 < c β β (x : E), N (c β’ x) = c * N x) (N_add : β (x y : E), N (x + y) β€ N x + N y) (hf : β (x : { x // x β f.domain }), βf x β€ N βx) :
β g, (β (x : { x // x β f.domain }), βg βx = βf x) β§ β (x : E), βg x β€ N x

Hahn-Banach theorem: if N : E β β is a sublinear map, f is a linear map defined on a subspace of E, and f x β€ N x for all x in the domain of f, then f can be extended to the whole space to a linear map g such that g x β€ N x for all x.