analysis.convex.cone.proper
β·
Mathlib.Analysis.Convex.Cone.Proper
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
We add the theorem hyperplane_separation
which is a relative version of convex_cone.hyperplane_separation_of_nonempty_of_is_closed_of_nmem. This is the most general form of Farkas' lemma (that I know of) for convex cones.
We also add proper_cone.comap
and a few theorems about it.
Co-authored-by: Apurva Nakade <apurvnakade@gmail.com@>
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-/
import analysis.convex.cone.dual
+import analysis.inner_product_space.adjoint
/-!
# Proper cones
@@ -17,8 +18,6 @@ linear programs, the results from this file can be used to prove duality theorem
## TODO
The next steps are:
-- Prove the cone version of Farkas' lemma (2.3.4 in the reference).
-- Add comap, adjoint
- Add convex_cone_class that extends set_like and replace the below instance
- Define the positive cone as a proper cone.
- Define primal and dual cone programs and prove weak duality.
@@ -33,6 +32,8 @@ The next steps are:
-/
+open continuous_linear_map filter set
+
namespace convex_cone
variables {π : Type*} [ordered_semiring π]
@@ -118,12 +119,13 @@ section inner_product_space
variables {E : Type*} [normed_add_comm_group E] [inner_product_space β E]
variables {F : Type*} [normed_add_comm_group F] [inner_product_space β F]
+variables {G : Type*} [normed_add_comm_group G] [inner_product_space β G]
protected lemma pointed (K : proper_cone β E) : (K : convex_cone β E).pointed :=
(K : convex_cone β E).pointed_of_nonempty_of_is_closed K.nonempty K.is_closed
/-- The closure of image of a proper cone under a continuous `β`-linear map is a proper cone. We
-use continuous maps here so that the adjoint of f is also a map between proper cones. -/
+use continuous maps here so that the comap of f is also a map between proper cones. -/
noncomputable def map (f : E βL[β] F) (K : proper_cone β E) : proper_cone β F :=
{ to_convex_cone := convex_cone.closure (convex_cone.map (f : E ββ[β] F) βK),
nonempty' := β¨ 0, subset_closure $ set_like.mem_coe.2 $ convex_cone.mem_map.2
@@ -152,18 +154,90 @@ lemma coe_dual (K : proper_cone β E) : β(dual K) = (K : set E).inner_dual_co
y β dual K β β β¦xβ¦, x β K β 0 β€ βͺx, yβ«_β :=
by {rw [β mem_coe, coe_dual, mem_inner_dual_cone _ _], refl}
--- TODO: add comap, adjoint
+/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
+noncomputable def comap (f : E βL[β] F) (S : proper_cone β F) : proper_cone β E :=
+{ to_convex_cone := convex_cone.comap (f : E ββ[β] F) S,
+ nonempty' := β¨ 0,
+ begin
+ simp only [convex_cone.comap, mem_preimage, map_zero, set_like.mem_coe, mem_coe],
+ apply proper_cone.pointed,
+ end β©,
+ is_closed' :=
+ begin
+ simp only [convex_cone.comap, continuous_linear_map.coe_coe],
+ apply is_closed.preimage f.2 S.is_closed,
+ end }
+
+@[simp] lemma coe_comap (f : E βL[β] F) (S : proper_cone β F) : (S.comap f : set E) = f β»ΒΉ' S :=
+rfl
+
+@[simp] lemma comap_id (S : convex_cone β E) : S.comap linear_map.id = S :=
+set_like.coe_injective preimage_id
+
+lemma comap_comap (g : F βL[β] G) (f : E βL[β] F) (S : proper_cone β G) :
+ (S.comap g).comap f = S.comap (g.comp f) :=
+set_like.coe_injective $ preimage_comp.symm
+
+@[simp] lemma mem_comap {f : E βL[β] F} {S : proper_cone β F} {x : E} : x β S.comap f β f x β S :=
+iff.rfl
end inner_product_space
section complete_space
variables {E : Type*} [normed_add_comm_group E] [inner_product_space β E] [complete_space E]
+variables {F : Type*} [normed_add_comm_group F] [inner_product_space β F] [complete_space F]
/-- The dual of the dual of a proper cone is itself. -/
@[simp] theorem dual_dual (K : proper_cone β E) : K.dual.dual = K := proper_cone.ext' $
(K : convex_cone β E).inner_dual_cone_of_inner_dual_cone_eq_self K.nonempty K.is_closed
+/-- This is a relative version of
+`convex_cone.hyperplane_separation_of_nonempty_of_is_closed_of_nmem`, which we recover by setting
+`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
+stated using proper cones. -/
+theorem hyperplane_separation (K : proper_cone β E) {f : E βL[β] F} {b : F} :
+ b β K.map f β β y : F, (adjoint f y) β K.dual β 0 β€ βͺy, bβ«_β := iff.intro
+begin
+ -- suppose `b β K.map f`
+ simp only [proper_cone.mem_map, proper_cone.mem_dual, adjoint_inner_right,
+ convex_cone.mem_closure, mem_closure_iff_seq_limit],
+
+ -- there is a sequence `seq : β β F` in the image of `f` that converges to `b`
+ rintros β¨seq, hmem, htendsβ© y hinner,
+
+ suffices h : β n, 0 β€ βͺy, seq nβ«_β, from ge_of_tendsto' (continuous.seq_continuous
+ (continuous.inner (@continuous_const _ _ _ _ y) continuous_id) htends) h,
+
+ intro n,
+ obtain β¨_, h, hseqβ© := hmem n,
+ simpa only [β hseq, real_inner_comm] using (hinner h),
+end
+begin
+ -- proof by contradiction
+ -- suppose `b β K.map f`
+ intro h,
+ contrapose! h,
+
+ -- as `b β K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
+ obtain β¨y, hxy, hybβ© := convex_cone.hyperplane_separation_of_nonempty_of_is_closed_of_nmem _
+ (K.map f).nonempty (K.map f).is_closed h,
+
+ -- the rest of the proof is a straightforward algebraic manipulation
+ refine β¨y, _, hybβ©,
+ simp_rw [proper_cone.mem_dual, adjoint_inner_right],
+ intros x hxK,
+ apply hxy (f x),
+ rw [to_convex_cone_eq_coe, proper_cone.coe_map],
+ apply subset_closure,
+ rw [set_like.mem_coe, convex_cone.mem_map],
+ use β¨x, hxK, rflβ©,
+end
+
+theorem hyperplane_separation_of_nmem (K : proper_cone β E) {f : E βL[β] F} {b : F}
+ (disj : b β K.map f) : β y : F, (adjoint f y) β K.dual β§ βͺy, bβ«_β < 0 :=
+by { contrapose! disj, rwa K.hyperplane_separation }
+
end complete_space
end proper_cone
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -3,7 +3,7 @@ Copyright (c) 2022 Apurva Nakade All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-/
-import Analysis.Convex.Cone.Dual
+import Analysis.Convex.Cone.InnerDual
import Analysis.InnerProductSpace.Adjoint
#align_import analysis.convex.cone.proper from "leanprover-community/mathlib"@"728ef9dbb281241906f25cbeb30f90d83e0bb451"
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -110,17 +110,17 @@ theorem toConvexCone_eq_coe (K : ProperCone π E) : K.toConvexCone = K :=
rfl
#align proper_cone.to_convex_cone_eq_coe ProperCone.toConvexCone_eq_coe
-#print ProperCone.ext' /-
-theorem ext' : Function.Injective (coe : ProperCone π E β ConvexCone π E) := fun S T h => by
- cases S <;> cases T <;> congr
-#align proper_cone.ext' ProperCone.ext'
+#print ProperCone.toPointedCone_injective /-
+theorem toPointedCone_injective : Function.Injective (coe : ProperCone π E β ConvexCone π E) :=
+ fun S T h => by cases S <;> cases T <;> congr
+#align proper_cone.ext' ProperCone.toPointedCone_injective
-/
-- TODO: add convex_cone_class that extends set_like and replace the below instance
instance : SetLike (ProperCone π E) E
where
coe K := K.carrier
- coe_injective' _ _ h := ProperCone.ext' (SetLike.coe_injective h)
+ coe_injective' _ _ h := ProperCone.toPointedCone_injective (SetLike.coe_injective h)
#print ProperCone.ext /-
@[ext]
@@ -230,7 +230,7 @@ theorem mem_map {f : E βL[β] F} {K : ProperCone β E} {y : F} :
#print ProperCone.map_id /-
@[simp]
theorem map_id (K : ProperCone β E) : K.map (ContinuousLinearMap.id β E) = K :=
- ProperCone.ext' <| by simpa using IsClosed.closure_eq K.is_closed
+ ProperCone.toPointedCone_injective <| by simpa using IsClosed.closure_eq K.is_closed
#align proper_cone.map_id ProperCone.map_id
-/
@@ -313,7 +313,7 @@ variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F] [Complete
/-- The dual of the dual of a proper cone is itself. -/
@[simp]
theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
- ProperCone.ext' <|
+ ProperCone.toPointedCone_injective <|
(K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.Nonempty K.IsClosed
#align proper_cone.dual_dual ProperCone.dual_dual
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2022 Apurva Nakade All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-/
-import Mathbin.Analysis.Convex.Cone.Dual
-import Mathbin.Analysis.InnerProductSpace.Adjoint
+import Analysis.Convex.Cone.Dual
+import Analysis.InnerProductSpace.Adjoint
#align_import analysis.convex.cone.proper from "leanprover-community/mathlib"@"728ef9dbb281241906f25cbeb30f90d83e0bb451"
mathlib commit https://github.com/leanprover-community/mathlib/commit/63721b2c3eba6c325ecf8ae8cca27155a4f6306f
@@ -358,7 +358,7 @@ theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F}
rw [to_convex_cone_eq_coe, ProperCone.coe_map]
apply subset_closure
rw [SetLike.mem_coe, ConvexCone.mem_map]
- use β¨x, hxK, rflβ©)
+ useβ¨x, hxK, rflβ©)
#align proper_cone.hyperplane_separation ProperCone.hyperplane_separation
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2022 Apurva Nakade All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-
-! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 728ef9dbb281241906f25cbeb30f90d83e0bb451
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Analysis.Convex.Cone.Dual
import Mathbin.Analysis.InnerProductSpace.Adjoint
+#align_import analysis.convex.cone.proper from "leanprover-community/mathlib"@"728ef9dbb281241906f25cbeb30f90d83e0bb451"
+
/-!
# Proper cones
mathlib commit https://github.com/leanprover-community/mathlib/commit/728ef9dbb281241906f25cbeb30f90d83e0bb451
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 147b294346843885f952c5171e9606616a8fd869
+! leanprover-community/mathlib commit 728ef9dbb281241906f25cbeb30f90d83e0bb451
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.InnerProductSpace.Adjoint
/-!
# Proper cones
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
We define a proper cone as a nonempty, closed, convex cone. Proper cones are used in defining conic
programs which generalize linear programs. A linear program is a conic program for the positive
cone. We then prove Farkas' lemma for conic programs following the proof in the reference below.
mathlib commit https://github.com/leanprover-community/mathlib/commit/9240e8be927a0955b9a82c6c85ef499ee3a626b8
@@ -258,6 +258,7 @@ theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦,
#align proper_cone.mem_dual ProperCone.mem_dual
-/
+#print ProperCone.comap /-
/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E
where
@@ -270,26 +271,35 @@ noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone
simp only [ConvexCone.comap, ContinuousLinearMap.coe_coe]
apply IsClosed.preimage f.2 S.is_closed
#align proper_cone.comap ProperCone.comap
+-/
+#print ProperCone.coe_comap /-
@[simp]
theorem coe_comap (f : E βL[β] F) (S : ProperCone β F) : (S.comap f : Set E) = f β»ΒΉ' S :=
rfl
#align proper_cone.coe_comap ProperCone.coe_comap
+-/
+#print ProperCone.comap_id /-
@[simp]
theorem comap_id (S : ConvexCone β E) : S.comap LinearMap.id = S :=
SetLike.coe_injective preimage_id
#align proper_cone.comap_id ProperCone.comap_id
+-/
+#print ProperCone.comap_comap /-
theorem comap_comap (g : F βL[β] G) (f : E βL[β] F) (S : ProperCone β G) :
(S.comap g).comap f = S.comap (g.comp f) :=
SetLike.coe_injective <| preimage_comp.symm
#align proper_cone.comap_comap ProperCone.comap_comap
+-/
+#print ProperCone.mem_comap /-
@[simp]
theorem mem_comap {f : E βL[β] F} {S : ProperCone β F} {x : E} : x β S.comap f β f x β S :=
Iff.rfl
#align proper_cone.mem_comap ProperCone.mem_comap
+-/
end InnerProductSpace
@@ -308,6 +318,7 @@ theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
#align proper_cone.dual_dual ProperCone.dual_dual
-/
+#print ProperCone.hyperplane_separation /-
/-- This is a relative version of
`convex_cone.hyperplane_separation_of_nonempty_of_is_closed_of_nmem`, which we recover by setting
`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
@@ -349,11 +360,14 @@ theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F}
rw [SetLike.mem_coe, ConvexCone.mem_map]
use β¨x, hxK, rflβ©)
#align proper_cone.hyperplane_separation ProperCone.hyperplane_separation
+-/
+#print ProperCone.hyperplane_separation_of_nmem /-
theorem hyperplane_separation_of_nmem (K : ProperCone β E) {f : E βL[β] F} {b : F}
(disj : b β K.map f) : β y : F, adjoint f y β K.dual β§ βͺy, bβ«_β < 0 := by contrapose! disj;
rwa [K.hyperplane_separation]
#align proper_cone.hyperplane_separation_of_nmem ProperCone.hyperplane_separation_of_nmem
+-/
end CompleteSpace
mathlib commit https://github.com/leanprover-community/mathlib/commit/9240e8be927a0955b9a82c6c85ef499ee3a626b8
@@ -47,6 +47,7 @@ variable {π : Type _} [OrderedSemiring π]
variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [ContinuousAdd E] [SMul π E]
[ContinuousConstSMul π E]
+#print ConvexCone.closure /-
/-- The closure of a convex cone inside a topological space as a convex cone. This
construction is mainly used for defining maps between proper cones. -/
protected def closure (K : ConvexCone π E) : ConvexCone π E
@@ -56,25 +57,33 @@ protected def closure (K : ConvexCone π E) : ConvexCone π E
map_mem_closure (continuous_id'.const_smul c) hβ fun _ hβ => K.smul_mem hc hβ
add_mem' _ hβ _ hβ := map_mem_closureβ continuous_add hβ hβ K.add_mem
#align convex_cone.closure ConvexCone.closure
+-/
+#print ConvexCone.coe_closure /-
@[simp, norm_cast]
theorem coe_closure (K : ConvexCone π E) : (K.closure : Set E) = closure K :=
rfl
#align convex_cone.coe_closure ConvexCone.coe_closure
+-/
+#print ConvexCone.mem_closure /-
@[simp]
protected theorem mem_closure {K : ConvexCone π E} {a : E} :
a β K.closure β a β closure (K : Set E) :=
Iff.rfl
#align convex_cone.mem_closure ConvexCone.mem_closure
+-/
+#print ConvexCone.closure_eq /-
@[simp]
theorem closure_eq {K L : ConvexCone π E} : K.closure = L β closure (K : Set E) = L :=
SetLike.ext'_iff
#align convex_cone.closure_eq ConvexCone.closure_eq
+-/
end ConvexCone
+#print ProperCone /-
/-- A proper cone is a convex cone `K` that is nonempty and closed. Proper cones have the nice
property that the dual of the dual of a proper cone is itself. This makes them useful for defining
cone programs and proving duality theorems. -/
@@ -83,6 +92,7 @@ structure ProperCone (π : Type _) (E : Type _) [OrderedSemiring π] [AddCom
nonempty' : (carrier : Set E).Nonempty
is_closed' : IsClosed (carrier : Set E)
#align proper_cone ProperCone
+-/
namespace ProperCone
@@ -100,9 +110,11 @@ theorem toConvexCone_eq_coe (K : ProperCone π E) : K.toConvexCone = K :=
rfl
#align proper_cone.to_convex_cone_eq_coe ProperCone.toConvexCone_eq_coe
+#print ProperCone.ext' /-
theorem ext' : Function.Injective (coe : ProperCone π E β ConvexCone π E) := fun S T h => by
cases S <;> cases T <;> congr
#align proper_cone.ext' ProperCone.ext'
+-/
-- TODO: add convex_cone_class that extends set_like and replace the below instance
instance : SetLike (ProperCone π E) E
@@ -110,23 +122,31 @@ instance : SetLike (ProperCone π E) E
coe K := K.carrier
coe_injective' _ _ h := ProperCone.ext' (SetLike.coe_injective h)
+#print ProperCone.ext /-
@[ext]
theorem ext {S T : ProperCone π E} (h : β x, x β S β x β T) : S = T :=
SetLike.ext h
#align proper_cone.ext ProperCone.ext
+-/
+#print ProperCone.mem_coe /-
@[simp]
theorem mem_coe {x : E} {K : ProperCone π E} : x β (K : ConvexCone π E) β x β K :=
Iff.rfl
#align proper_cone.mem_coe ProperCone.mem_coe
+-/
+#print ProperCone.nonempty /-
protected theorem nonempty (K : ProperCone π E) : (K : Set E).Nonempty :=
K.nonempty'
#align proper_cone.nonempty ProperCone.nonempty
+-/
+#print ProperCone.isClosed /-
protected theorem isClosed (K : ProperCone π E) : IsClosed (K : Set E) :=
K.is_closed'
#align proper_cone.is_closed ProperCone.isClosed
+-/
end SMul
@@ -144,18 +164,24 @@ instance : Zero (ProperCone π E) :=
instance : Inhabited (ProperCone π E) :=
β¨0β©
+#print ProperCone.mem_zero /-
@[simp]
theorem mem_zero (x : E) : x β (0 : ProperCone π E) β x = 0 :=
Iff.rfl
#align proper_cone.mem_zero ProperCone.mem_zero
+-/
+#print ProperCone.coe_zero /-
@[simp, norm_cast]
theorem coe_zero : β(0 : ProperCone π E) = (0 : ConvexCone π E) :=
rfl
#align proper_cone.coe_zero ProperCone.coe_zero
+-/
+#print ProperCone.pointed_zero /-
theorem pointed_zero : (0 : ProperCone π E).Pointed := by simp [ConvexCone.pointed_zero]
#align proper_cone.pointed_zero ProperCone.pointed_zero
+-/
end Module
@@ -167,10 +193,13 @@ variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F]
variable {G : Type _} [NormedAddCommGroup G] [InnerProductSpace β G]
+#print ProperCone.pointed /-
protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
(K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.Nonempty K.IsClosed
#align proper_cone.pointed ProperCone.pointed
+-/
+#print ProperCone.map /-
/-- The closure of image of a proper cone under a continuous `β`-linear map is a proper cone. We
use continuous maps here so that the comap of f is also a map between proper cones. -/
noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone β F
@@ -180,24 +209,32 @@ noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone
β¨0, subset_closure <| SetLike.mem_coe.2 <| ConvexCone.mem_map.2 β¨0, K.Pointed, map_zero _β©β©
is_closed' := isClosed_closure
#align proper_cone.map ProperCone.map
+-/
+#print ProperCone.coe_map /-
@[simp, norm_cast]
theorem coe_map (f : E βL[β] F) (K : ProperCone β E) :
β(K.map f) = (ConvexCone.map (f : E ββ[β] F) βK).closure :=
rfl
#align proper_cone.coe_map ProperCone.coe_map
+-/
+#print ProperCone.mem_map /-
@[simp]
theorem mem_map {f : E βL[β] F} {K : ProperCone β E} {y : F} :
y β K.map f β y β (ConvexCone.map (f : E ββ[β] F) βK).closure :=
Iff.rfl
#align proper_cone.mem_map ProperCone.mem_map
+-/
+#print ProperCone.map_id /-
@[simp]
theorem map_id (K : ProperCone β E) : K.map (ContinuousLinearMap.id β E) = K :=
ProperCone.ext' <| by simpa using IsClosed.closure_eq K.is_closed
#align proper_cone.map_id ProperCone.map_id
+-/
+#print ProperCone.dual /-
/-- The inner dual cone of a proper cone is a proper cone. -/
def dual (K : ProperCone β E) : ProperCone β E
where
@@ -205,16 +242,21 @@ def dual (K : ProperCone β E) : ProperCone β E
nonempty' := β¨0, pointed_innerDualCone _β©
is_closed' := isClosed_innerDualCone _
#align proper_cone.dual ProperCone.dual
+-/
+#print ProperCone.coe_dual /-
@[simp, norm_cast]
theorem coe_dual (K : ProperCone β E) : β(dual K) = (K : Set E).innerDualCone :=
rfl
#align proper_cone.coe_dual ProperCone.coe_dual
+-/
+#print ProperCone.mem_dual /-
@[simp]
theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦, x β K β 0 β€ βͺx, yβ«_β := by
rw [β mem_coe, coe_dual, mem_innerDualCone _ _]; rfl
#align proper_cone.mem_dual ProperCone.mem_dual
+-/
/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E
@@ -257,12 +299,14 @@ variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E] [Complete
variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteSpace F]
+#print ProperCone.dual_dual /-
/-- The dual of the dual of a proper cone is itself. -/
@[simp]
theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
ProperCone.ext' <|
(K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.Nonempty K.IsClosed
#align proper_cone.dual_dual ProperCone.dual_dual
+-/
/-- This is a relative version of
`convex_cone.hyperplane_separation_of_nonempty_of_is_closed_of_nmem`, which we recover by setting
mathlib commit https://github.com/leanprover-community/mathlib/commit/9240e8be927a0955b9a82c6c85ef499ee3a626b8
@@ -4,11 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 74f1d61944a5a793e8c939d47608178c0a0cb0c2
+! leanprover-community/mathlib commit 147b294346843885f952c5171e9606616a8fd869
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Analysis.Convex.Cone.Dual
+import Mathbin.Analysis.InnerProductSpace.Adjoint
/-!
# Proper cones
@@ -22,8 +23,6 @@ linear programs, the results from this file can be used to prove duality theorem
## TODO
The next steps are:
-- Prove the cone version of Farkas' lemma (2.3.4 in the reference).
-- Add comap, adjoint
- Add convex_cone_class that extends set_like and replace the below instance
- Define the positive cone as a proper cone.
- Define primal and dual cone programs and prove weak duality.
@@ -39,6 +38,8 @@ The next steps are:
-/
+open ContinuousLinearMap Filter Set
+
namespace ConvexCone
variable {π : Type _} [OrderedSemiring π]
@@ -164,12 +165,14 @@ variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E]
variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F]
+variable {G : Type _} [NormedAddCommGroup G] [InnerProductSpace β G]
+
protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
(K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.Nonempty K.IsClosed
#align proper_cone.pointed ProperCone.pointed
/-- The closure of image of a proper cone under a continuous `β`-linear map is a proper cone. We
-use continuous maps here so that the adjoint of f is also a map between proper cones. -/
+use continuous maps here so that the comap of f is also a map between proper cones. -/
noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone β F
where
toConvexCone := ConvexCone.closure (ConvexCone.map (f : E ββ[β] F) βK)
@@ -213,13 +216,47 @@ theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦,
rw [β mem_coe, coe_dual, mem_innerDualCone _ _]; rfl
#align proper_cone.mem_dual ProperCone.mem_dual
--- TODO: add comap, adjoint
+/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
+noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E
+ where
+ toConvexCone := ConvexCone.comap (f : E ββ[β] F) S
+ nonempty' :=
+ β¨0, by
+ simp only [ConvexCone.comap, mem_preimage, map_zero, SetLike.mem_coe, mem_coe]
+ apply ProperCone.pointedβ©
+ is_closed' := by
+ simp only [ConvexCone.comap, ContinuousLinearMap.coe_coe]
+ apply IsClosed.preimage f.2 S.is_closed
+#align proper_cone.comap ProperCone.comap
+
+@[simp]
+theorem coe_comap (f : E βL[β] F) (S : ProperCone β F) : (S.comap f : Set E) = f β»ΒΉ' S :=
+ rfl
+#align proper_cone.coe_comap ProperCone.coe_comap
+
+@[simp]
+theorem comap_id (S : ConvexCone β E) : S.comap LinearMap.id = S :=
+ SetLike.coe_injective preimage_id
+#align proper_cone.comap_id ProperCone.comap_id
+
+theorem comap_comap (g : F βL[β] G) (f : E βL[β] F) (S : ProperCone β G) :
+ (S.comap g).comap f = S.comap (g.comp f) :=
+ SetLike.coe_injective <| preimage_comp.symm
+#align proper_cone.comap_comap ProperCone.comap_comap
+
+@[simp]
+theorem mem_comap {f : E βL[β] F} {S : ProperCone β F} {x : E} : x β S.comap f β f x β S :=
+ Iff.rfl
+#align proper_cone.mem_comap ProperCone.mem_comap
+
end InnerProductSpace
section CompleteSpace
variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E] [CompleteSpace E]
+variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteSpace F]
+
/-- The dual of the dual of a proper cone is itself. -/
@[simp]
theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
@@ -227,6 +264,53 @@ theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
(K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.Nonempty K.IsClosed
#align proper_cone.dual_dual ProperCone.dual_dual
+/-- This is a relative version of
+`convex_cone.hyperplane_separation_of_nonempty_of_is_closed_of_nmem`, which we recover by setting
+`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
+stated using proper cones. -/
+theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F} :
+ b β K.map f β β y : F, adjoint f y β K.dual β 0 β€ βͺy, bβ«_β :=
+ Iff.intro
+ (by
+ -- suppose `b β K.map f`
+ simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
+ ConvexCone.mem_closure, mem_closure_iff_seq_limit]
+ -- there is a sequence `seq : β β F` in the image of `f` that converges to `b`
+ rintro β¨seq, hmem, htendsβ© y hinner
+ suffices h : β n, 0 β€ βͺy, seq nβ«_β;
+ exact
+ ge_of_tendsto'
+ (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
+ htends)
+ h
+ intro n
+ obtain β¨_, h, hseqβ© := hmem n
+ simpa only [β hseq, real_inner_comm] using hinner h)
+ (by
+ -- proof by contradiction
+ -- suppose `b β K.map f`
+ intro h
+ contrapose! h
+ -- as `b β K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
+ obtain β¨y, hxy, hybβ© :=
+ ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).Nonempty
+ (K.map f).IsClosed h
+ -- the rest of the proof is a straightforward algebraic manipulation
+ refine' β¨y, _, hybβ©
+ simp_rw [ProperCone.mem_dual, adjoint_inner_right]
+ intro x hxK
+ apply hxy (f x)
+ rw [to_convex_cone_eq_coe, ProperCone.coe_map]
+ apply subset_closure
+ rw [SetLike.mem_coe, ConvexCone.mem_map]
+ use β¨x, hxK, rflβ©)
+#align proper_cone.hyperplane_separation ProperCone.hyperplane_separation
+
+theorem hyperplane_separation_of_nmem (K : ProperCone β E) {f : E βL[β] F} {b : F}
+ (disj : b β K.map f) : β y : F, adjoint f y β K.dual β§ βͺy, bβ«_β < 0 := by contrapose! disj;
+ rwa [K.hyperplane_separation]
+#align proper_cone.hyperplane_separation_of_nmem ProperCone.hyperplane_separation_of_nmem
+
end CompleteSpace
end ProperCone
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -4,14 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 915591b2bb3ea303648db07284a161a7f2a9e3d4
+! leanprover-community/mathlib commit 74f1d61944a5a793e8c939d47608178c0a0cb0c2
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
-import Mathbin.Analysis.Convex.Cone.Basic
-import Mathbin.Topology.Algebra.Monoid
+import Mathbin.Analysis.Convex.Cone.Dual
/-!
+# Proper cones
We define a proper cone as a nonempty, closed, convex cone. Proper cones are used in defining conic
programs which generalize linear programs. A linear program is a conic program for the positive
@@ -21,13 +21,16 @@ linear programs, the results from this file can be used to prove duality theorem
## TODO
-In the next few PRs (already sorry-free), we will add the definition and prove several properties
-of proper cones and finally prove the cone version of Farkas' lemma (2.3.4 in the reference).
-
The next steps are:
+- Prove the cone version of Farkas' lemma (2.3.4 in the reference).
+- Add comap, adjoint
+- Add convex_cone_class that extends set_like and replace the below instance
+- Define the positive cone as a proper cone.
- Define primal and dual cone programs and prove weak duality.
- Prove regular and strong duality for cone programs using Farkas' lemma (see reference).
- Define linear programs and prove LP duality as a special case of cone duality.
+- Find a better reference (textbook instead of lecture notes).
+- Show submodules are (proper) cones.
## References
@@ -38,12 +41,14 @@ The next steps are:
namespace ConvexCone
-variable {E : Type _} [AddCommMonoid E] [SMul β E] [TopologicalSpace E] [ContinuousConstSMul β E]
- [ContinuousAdd E]
+variable {π : Type _} [OrderedSemiring π]
+
+variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [ContinuousAdd E] [SMul π E]
+ [ContinuousConstSMul π E]
-/-- The closure of a convex cone inside a real inner product space is a convex cone. This
+/-- The closure of a convex cone inside a topological space as a convex cone. This
construction is mainly used for defining maps between proper cones. -/
-protected def closure (K : ConvexCone β E) : ConvexCone β E
+protected def closure (K : ConvexCone π E) : ConvexCone π E
where
carrier := closure βK
smul_mem' c hc _ hβ :=
@@ -52,14 +57,177 @@ protected def closure (K : ConvexCone β E) : ConvexCone β E
#align convex_cone.closure ConvexCone.closure
@[simp, norm_cast]
-theorem coe_closure (K : ConvexCone β E) : (K.closure : Set E) = closure K :=
+theorem coe_closure (K : ConvexCone π E) : (K.closure : Set E) = closure K :=
rfl
#align convex_cone.coe_closure ConvexCone.coe_closure
-protected theorem mem_closure {K : ConvexCone β E} {a : E} :
+@[simp]
+protected theorem mem_closure {K : ConvexCone π E} {a : E} :
a β K.closure β a β closure (K : Set E) :=
Iff.rfl
#align convex_cone.mem_closure ConvexCone.mem_closure
+@[simp]
+theorem closure_eq {K L : ConvexCone π E} : K.closure = L β closure (K : Set E) = L :=
+ SetLike.ext'_iff
+#align convex_cone.closure_eq ConvexCone.closure_eq
+
end ConvexCone
+/-- A proper cone is a convex cone `K` that is nonempty and closed. Proper cones have the nice
+property that the dual of the dual of a proper cone is itself. This makes them useful for defining
+cone programs and proving duality theorems. -/
+structure ProperCone (π : Type _) (E : Type _) [OrderedSemiring π] [AddCommMonoid E]
+ [TopologicalSpace E] [SMul π E] extends ConvexCone π E where
+ nonempty' : (carrier : Set E).Nonempty
+ is_closed' : IsClosed (carrier : Set E)
+#align proper_cone ProperCone
+
+namespace ProperCone
+
+section SMul
+
+variable {π : Type _} [OrderedSemiring π]
+
+variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [SMul π E]
+
+instance : Coe (ProperCone π E) (ConvexCone π E) :=
+ β¨fun K => K.1β©
+
+@[simp]
+theorem toConvexCone_eq_coe (K : ProperCone π E) : K.toConvexCone = K :=
+ rfl
+#align proper_cone.to_convex_cone_eq_coe ProperCone.toConvexCone_eq_coe
+
+theorem ext' : Function.Injective (coe : ProperCone π E β ConvexCone π E) := fun S T h => by
+ cases S <;> cases T <;> congr
+#align proper_cone.ext' ProperCone.ext'
+
+-- TODO: add convex_cone_class that extends set_like and replace the below instance
+instance : SetLike (ProperCone π E) E
+ where
+ coe K := K.carrier
+ coe_injective' _ _ h := ProperCone.ext' (SetLike.coe_injective h)
+
+@[ext]
+theorem ext {S T : ProperCone π E} (h : β x, x β S β x β T) : S = T :=
+ SetLike.ext h
+#align proper_cone.ext ProperCone.ext
+
+@[simp]
+theorem mem_coe {x : E} {K : ProperCone π E} : x β (K : ConvexCone π E) β x β K :=
+ Iff.rfl
+#align proper_cone.mem_coe ProperCone.mem_coe
+
+protected theorem nonempty (K : ProperCone π E) : (K : Set E).Nonempty :=
+ K.nonempty'
+#align proper_cone.nonempty ProperCone.nonempty
+
+protected theorem isClosed (K : ProperCone π E) : IsClosed (K : Set E) :=
+ K.is_closed'
+#align proper_cone.is_closed ProperCone.isClosed
+
+end SMul
+
+section Module
+
+variable {π : Type _} [OrderedSemiring π]
+
+variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [T1Space E] [Module π E]
+
+instance : Zero (ProperCone π E) :=
+ β¨{ toConvexCone := 0
+ nonempty' := β¨0, rflβ©
+ is_closed' := isClosed_singleton }β©
+
+instance : Inhabited (ProperCone π E) :=
+ β¨0β©
+
+@[simp]
+theorem mem_zero (x : E) : x β (0 : ProperCone π E) β x = 0 :=
+ Iff.rfl
+#align proper_cone.mem_zero ProperCone.mem_zero
+
+@[simp, norm_cast]
+theorem coe_zero : β(0 : ProperCone π E) = (0 : ConvexCone π E) :=
+ rfl
+#align proper_cone.coe_zero ProperCone.coe_zero
+
+theorem pointed_zero : (0 : ProperCone π E).Pointed := by simp [ConvexCone.pointed_zero]
+#align proper_cone.pointed_zero ProperCone.pointed_zero
+
+end Module
+
+section InnerProductSpace
+
+variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E]
+
+variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F]
+
+protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
+ (K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.Nonempty K.IsClosed
+#align proper_cone.pointed ProperCone.pointed
+
+/-- The closure of image of a proper cone under a continuous `β`-linear map is a proper cone. We
+use continuous maps here so that the adjoint of f is also a map between proper cones. -/
+noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone β F
+ where
+ toConvexCone := ConvexCone.closure (ConvexCone.map (f : E ββ[β] F) βK)
+ nonempty' :=
+ β¨0, subset_closure <| SetLike.mem_coe.2 <| ConvexCone.mem_map.2 β¨0, K.Pointed, map_zero _β©β©
+ is_closed' := isClosed_closure
+#align proper_cone.map ProperCone.map
+
+@[simp, norm_cast]
+theorem coe_map (f : E βL[β] F) (K : ProperCone β E) :
+ β(K.map f) = (ConvexCone.map (f : E ββ[β] F) βK).closure :=
+ rfl
+#align proper_cone.coe_map ProperCone.coe_map
+
+@[simp]
+theorem mem_map {f : E βL[β] F} {K : ProperCone β E} {y : F} :
+ y β K.map f β y β (ConvexCone.map (f : E ββ[β] F) βK).closure :=
+ Iff.rfl
+#align proper_cone.mem_map ProperCone.mem_map
+
+@[simp]
+theorem map_id (K : ProperCone β E) : K.map (ContinuousLinearMap.id β E) = K :=
+ ProperCone.ext' <| by simpa using IsClosed.closure_eq K.is_closed
+#align proper_cone.map_id ProperCone.map_id
+
+/-- The inner dual cone of a proper cone is a proper cone. -/
+def dual (K : ProperCone β E) : ProperCone β E
+ where
+ toConvexCone := (K : Set E).innerDualCone
+ nonempty' := β¨0, pointed_innerDualCone _β©
+ is_closed' := isClosed_innerDualCone _
+#align proper_cone.dual ProperCone.dual
+
+@[simp, norm_cast]
+theorem coe_dual (K : ProperCone β E) : β(dual K) = (K : Set E).innerDualCone :=
+ rfl
+#align proper_cone.coe_dual ProperCone.coe_dual
+
+@[simp]
+theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦, x β K β 0 β€ βͺx, yβ«_β := by
+ rw [β mem_coe, coe_dual, mem_innerDualCone _ _]; rfl
+#align proper_cone.mem_dual ProperCone.mem_dual
+
+-- TODO: add comap, adjoint
+end InnerProductSpace
+
+section CompleteSpace
+
+variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E] [CompleteSpace E]
+
+/-- The dual of the dual of a proper cone is itself. -/
+@[simp]
+theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
+ ProperCone.ext' <|
+ (K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.Nonempty K.IsClosed
+#align proper_cone.dual_dual ProperCone.dual_dual
+
+end CompleteSpace
+
+end ProperCone
+
mathlib commit https://github.com/leanprover-community/mathlib/commit/f51de8769c34652d82d1c8e5f8f18f8374782bed
@@ -4,11 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
+! leanprover-community/mathlib commit 915591b2bb3ea303648db07284a161a7f2a9e3d4
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Analysis.Convex.Cone.Basic
+import Mathbin.Topology.Algebra.Monoid
/-!
@@ -35,8 +36,6 @@ The next steps are:
-/
-open ContinuousLinearMap Filter
-
namespace ConvexCone
variable {E : Type _} [AddCommMonoid E] [SMul β E] [TopologicalSpace E] [ContinuousConstSMul β E]
mathlib commit https://github.com/leanprover-community/mathlib/commit/738054fa93d43512da144ec45ce799d18fd44248
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 620ba06c7f173d79b3cad91294babde6b4eab79c
+! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
-import Mathbin.Analysis.InnerProductSpace.Adjoint
+import Mathbin.Analysis.Convex.Cone.Basic
/-!
mathlib commit https://github.com/leanprover-community/mathlib/commit/36b8aa61ea7c05727161f96a0532897bd72aedab
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -46,7 +46,6 @@ namespace ProperCone
section Module
variable {π : Type*} [OrderedSemiring π]
-
variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [Module π E]
/-- A `PointedCone` is defined as an alias of submodule. We replicate the abbreviation here and
@@ -120,7 +119,6 @@ end PositiveCone
section Module
variable {π : Type*} [OrderedSemiring π]
-
variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [T1Space E] [Module π E]
instance : Zero (ProperCone π E) :=
@@ -149,9 +147,7 @@ end Module
section InnerProductSpace
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E]
-
variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace β F]
-
variable {G : Type*} [NormedAddCommGroup G] [InnerProductSpace β G]
protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
@@ -231,7 +227,6 @@ end InnerProductSpace
section CompleteSpace
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] [CompleteSpace E]
-
variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteSpace F]
/-- The dual of the dual of a proper cone is itself. -/
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -281,7 +281,7 @@ theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F}
simp_rw [ProperCone.mem_dual, adjoint_inner_right]
intro x hxK
apply hxy (f x)
- simp_rw [coe_map]
+ simp_rw [C, coe_map]
apply subset_closure
simp_rw [PointedCone.toConvexCone_map, ConvexCone.coe_map, coe_coe, mem_image,
SetLike.mem_coe]
@@ -86,7 +86,7 @@ theorem mem_coe {x : E} {K : ProperCone π E} : x β (K : PointedCone π E)
instance instZero (K : ProperCone π E) : Zero K := PointedCone.instZero (K.toSubmodule)
protected theorem nonempty (K : ProperCone π E) : (K : Set E).Nonempty :=
- β¨0, by { simp_rw [SetLike.mem_coe, β ProperCone.mem_coe, Submodule.zero_mem] } β©
+ β¨0, by { simp_rw [SetLike.mem_coe, β ProperCone.mem_coe, Submodule.zero_mem] }β©
#align proper_cone.nonempty ProperCone.nonempty
protected theorem isClosed (K : ProperCone π E) : IsClosed (K : Set E) :=
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-/
import Mathlib.Analysis.Convex.Cone.Closure
+import Mathlib.Analysis.InnerProductSpace.Adjoint
#align_import analysis.convex.cone.proper from "leanprover-community/mathlib"@"147b294346843885f952c5171e9606616a8fd869"
We change the definition of a ProperCone
from being a nonempty, closed, ConvexCone
to a closed, PointedCone
.
This is mathematically (not definitionally) equivalent to the earlier definition as a PointedCone
is mathematically (not definitionally) the same as a nonempty, ConvexCone
.
The definition of PointedCone
was added after ProperCone
. Hence, needed to go back and update the definition.
Co-authored-by: apurvanakade <53553755+apurvanakade@users.noreply.github.com>
@@ -3,18 +3,17 @@ Copyright (c) 2022 Apurva Nakade All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-/
-import Mathlib.Analysis.Convex.Cone.Dual
-import Mathlib.Analysis.InnerProductSpace.Adjoint
+import Mathlib.Analysis.Convex.Cone.Closure
#align_import analysis.convex.cone.proper from "leanprover-community/mathlib"@"147b294346843885f952c5171e9606616a8fd869"
/-!
# Proper cones
-We define a proper cone as a nonempty, closed, convex cone. Proper cones are used in defining conic
+We define a *proper cone* as a closed, pointed cone. Proper cones are used in defining conic
programs which generalize linear programs. A linear program is a conic program for the positive
cone. We then prove Farkas' lemma for conic programs following the proof in the reference below.
-Farkas' lemma is equivalent to strong duality. So, once have the definitions of conic programs and
+Farkas' lemma is equivalent to strong duality. So, once we have the definitions of conic and
linear programs, the results from this file can be used to prove duality theorems.
## TODO
@@ -25,7 +24,6 @@ The next steps are:
- Prove regular and strong duality for cone programs using Farkas' lemma (see reference).
- Define linear programs and prove LP duality as a special case of cone duality.
- Find a better reference (textbook instead of lecture notes).
-- Show submodules are (proper) cones.
## References
@@ -35,61 +33,29 @@ The next steps are:
open ContinuousLinearMap Filter Set
-namespace ConvexCone
-
-variable {π : Type*} [OrderedSemiring π]
-
-variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [ContinuousAdd E] [SMul π E]
- [ContinuousConstSMul π E]
-
-/-- The closure of a convex cone inside a topological space as a convex cone. This
-construction is mainly used for defining maps between proper cones. -/
-protected def closure (K : ConvexCone π E) : ConvexCone π E where
- carrier := closure βK
- smul_mem' c hc _ hβ :=
- map_mem_closure (continuous_id'.const_smul c) hβ fun _ hβ => K.smul_mem hc hβ
- add_mem' _ hβ _ hβ := map_mem_closureβ continuous_add hβ hβ K.add_mem
-#align convex_cone.closure ConvexCone.closure
-
-@[simp, norm_cast]
-theorem coe_closure (K : ConvexCone π E) : (K.closure : Set E) = closure K :=
- rfl
-#align convex_cone.coe_closure ConvexCone.coe_closure
-
-@[simp]
-protected theorem mem_closure {K : ConvexCone π E} {a : E} :
- a β K.closure β a β closure (K : Set E) :=
- Iff.rfl
-#align convex_cone.mem_closure ConvexCone.mem_closure
-
-@[simp]
-theorem closure_eq {K L : ConvexCone π E} : K.closure = L β closure (K : Set E) = L :=
- SetLike.ext'_iff
-#align convex_cone.closure_eq ConvexCone.closure_eq
-
-end ConvexCone
-
-/-- A proper cone is a convex cone `K` that is nonempty and closed. Proper cones have the nice
-property that the dual of the dual of a proper cone is itself. This makes them useful for defining
-cone programs and proving duality theorems. -/
+/-- A proper cone is a pointed cone `K` that is closed. Proper cones have the nice property that
+they are equal to their double dual, see `ProperCone.dual_dual`.
+This makes them useful for defining cone programs and proving duality theorems. -/
structure ProperCone (π : Type*) (E : Type*) [OrderedSemiring π] [AddCommMonoid E]
- [TopologicalSpace E] [SMul π E] extends ConvexCone π E where
- nonempty' : (carrier : Set E).Nonempty
+ [TopologicalSpace E] [Module π E] extends Submodule {c : π // 0 β€ c} E where
isClosed' : IsClosed (carrier : Set E)
#align proper_cone ProperCone
namespace ProperCone
-
-section SMul
+section Module
variable {π : Type*} [OrderedSemiring π]
-variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [SMul π E]
+variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [Module π E]
+
+/-- A `PointedCone` is defined as an alias of submodule. We replicate the abbreviation here and
+define `toPointedCone` as an alias of `toSubmodule`. -/
+abbrev toPointedCone (C : ProperCone π E) := C.toSubmodule
-attribute [coe] toConvexCone
+attribute [coe] toPointedCone
-instance : Coe (ProperCone π E) (ConvexCone π E) :=
- β¨toConvexConeβ©
+instance : Coe (ProperCone π E) (PointedCone π E) :=
+ β¨toPointedConeβ©
-- Porting note: now a syntactic tautology
-- @[simp]
@@ -97,14 +63,14 @@ instance : Coe (ProperCone π E) (ConvexCone π E) :=
-- rfl
#noalign proper_cone.to_convex_cone_eq_coe
-theorem ext' : Function.Injective ((β) : ProperCone π E β ConvexCone π E) := fun S T h => by
- cases S; cases T; congr
-#align proper_cone.ext' ProperCone.ext'
+theorem toPointedCone_injective : Function.Injective ((β) : ProperCone π E β PointedCone π E) :=
+ fun S T h => by cases S; cases T; congr
+#align proper_cone.ext' ProperCone.toPointedCone_injective
-- TODO: add `ConvexConeClass` that extends `SetLike` and replace the below instance
instance : SetLike (ProperCone π E) E where
coe K := K.carrier
- coe_injective' _ _ h := ProperCone.ext' (SetLike.coe_injective h)
+ coe_injective' _ _ h := ProperCone.toPointedCone_injective (SetLike.coe_injective h)
@[ext]
theorem ext {S T : ProperCone π E} (h : β x, x β S β x β T) : S = T :=
@@ -112,19 +78,21 @@ theorem ext {S T : ProperCone π E} (h : β x, x β S β x β T) : S = T :
#align proper_cone.ext ProperCone.ext
@[simp]
-theorem mem_coe {x : E} {K : ProperCone π E} : x β (K : ConvexCone π E) β x β K :=
+theorem mem_coe {x : E} {K : ProperCone π E} : x β (K : PointedCone π E) β x β K :=
Iff.rfl
#align proper_cone.mem_coe ProperCone.mem_coe
+instance instZero (K : ProperCone π E) : Zero K := PointedCone.instZero (K.toSubmodule)
+
protected theorem nonempty (K : ProperCone π E) : (K : Set E).Nonempty :=
- K.nonempty'
+ β¨0, by { simp_rw [SetLike.mem_coe, β ProperCone.mem_coe, Submodule.zero_mem] } β©
#align proper_cone.nonempty ProperCone.nonempty
protected theorem isClosed (K : ProperCone π E) : IsClosed (K : Set E) :=
K.isClosed'
#align proper_cone.is_closed ProperCone.isClosed
-end SMul
+end Module
section PositiveCone
@@ -135,8 +103,7 @@ variable [OrderedSemiring π] [OrderedAddCommGroup E] [Module π E] [Ordered
/-- The positive cone is the proper cone formed by the set of nonnegative elements in an ordered
module. -/
def positive : ProperCone π E where
- toConvexCone := ConvexCone.positive π E
- nonempty' := β¨0, ConvexCone.pointed_positive _ _β©
+ toSubmodule := PointedCone.positive π E
isClosed' := isClosed_Ici
@[simp]
@@ -156,9 +123,8 @@ variable {π : Type*} [OrderedSemiring π]
variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [T1Space E] [Module π E]
instance : Zero (ProperCone π E) :=
- β¨{ toConvexCone := 0
- nonempty' := β¨0, rflβ©
- isClosed' := isClosed_singleton }β©
+ β¨{ toSubmodule := 0
+ isClosed' := isClosed_singleton }β©
instance : Inhabited (ProperCone π E) :=
β¨0β©
@@ -173,7 +139,8 @@ theorem coe_zero : β(0 : ProperCone π E) = (0 : ConvexCone π E) :=
rfl
#align proper_cone.coe_zero ProperCone.coe_zero
-theorem pointed_zero : (0 : ProperCone π E).Pointed := by simp [ConvexCone.pointed_zero]
+theorem pointed_zero : ((0 : ProperCone π E) : ConvexCone π E).Pointed := by
+ simp [ConvexCone.pointed_zero]
#align proper_cone.pointed_zero ProperCone.pointed_zero
end Module
@@ -187,61 +154,54 @@ variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace β F]
variable {G : Type*} [NormedAddCommGroup G] [InnerProductSpace β G]
protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
- (K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.nonempty' K.isClosed
+ (K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.nonempty K.isClosed
#align proper_cone.pointed ProperCone.pointed
/-- The closure of image of a proper cone under a continuous `β`-linear map is a proper cone. We
use continuous maps here so that the comap of f is also a map between proper cones. -/
noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone β F where
- toConvexCone := ConvexCone.closure (ConvexCone.map (f : E ββ[β] F) βK)
- nonempty' :=
- β¨0, subset_closure <| SetLike.mem_coe.2 <| ConvexCone.mem_map.2 β¨0, K.pointed, map_zero _β©β©
+ toSubmodule := PointedCone.closure (PointedCone.map (f : E ββ[β] F) βK)
isClosed' := isClosed_closure
#align proper_cone.map ProperCone.map
@[simp, norm_cast]
theorem coe_map (f : E βL[β] F) (K : ProperCone β E) :
- β(K.map f) = (ConvexCone.map (f : E ββ[β] F) βK).closure :=
+ β(K.map f) = (PointedCone.map (f : E ββ[β] F) βK).closure :=
rfl
#align proper_cone.coe_map ProperCone.coe_map
@[simp]
theorem mem_map {f : E βL[β] F} {K : ProperCone β E} {y : F} :
- y β K.map f β y β (ConvexCone.map (f : E ββ[β] F) βK).closure :=
+ y β K.map f β y β (PointedCone.map (f : E ββ[β] F) βK).closure :=
Iff.rfl
#align proper_cone.mem_map ProperCone.mem_map
@[simp]
theorem map_id (K : ProperCone β E) : K.map (ContinuousLinearMap.id β E) = K :=
- ProperCone.ext' <| by simpa using IsClosed.closure_eq K.isClosed
+ ProperCone.toPointedCone_injective <| by simpa using IsClosed.closure_eq K.isClosed
#align proper_cone.map_id ProperCone.map_id
/-- The inner dual cone of a proper cone is a proper cone. -/
def dual (K : ProperCone β E) : ProperCone β E where
- toConvexCone := (K : Set E).innerDualCone
- nonempty' := β¨0, pointed_innerDualCone _β©
+ toSubmodule := PointedCone.dual (K : PointedCone β E)
isClosed' := isClosed_innerDualCone _
#align proper_cone.dual ProperCone.dual
@[simp, norm_cast]
-theorem coe_dual (K : ProperCone β E) : β(dual K) = (K : Set E).innerDualCone :=
+theorem coe_dual (K : ProperCone β E) : K.dual = (K : Set E).innerDualCone :=
rfl
#align proper_cone.coe_dual ProperCone.coe_dual
@[simp]
theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦, x β K β 0 β€ βͺx, yβ«_β := by
- rw [β mem_coe, coe_dual, mem_innerDualCone _ _]; rfl
+ aesop
#align proper_cone.mem_dual ProperCone.mem_dual
/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E where
- toConvexCone := ConvexCone.comap (f : E ββ[β] F) S
- nonempty' :=
- β¨0, by
- simp only [ConvexCone.comap, mem_preimage, map_zero, SetLike.mem_coe, mem_coe]
- apply ProperCone.pointedβ©
+ toSubmodule := PointedCone.comap (f : E ββ[β] F) S
isClosed' := by
- simp only [ConvexCone.comap, ContinuousLinearMap.coe_coe]
+ rw [PointedCone.comap]
apply IsClosed.preimage f.2 S.isClosed
#align proper_cone.comap ProperCone.comap
@@ -276,23 +236,25 @@ variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteS
/-- The dual of the dual of a proper cone is itself. -/
@[simp]
theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
- ProperCone.ext' <|
- (K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.nonempty' K.isClosed
+ ProperCone.toPointedCone_injective <| PointedCone.toConvexCone_injective <|
+ (K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.nonempty K.isClosed
#align proper_cone.dual_dual ProperCone.dual_dual
/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
-`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
+`f` to be the identity map. This is also a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F} :
b β K.map f β β y : F, adjoint f y β K.dual β 0 β€ βͺy, bβ«_β :=
Iff.intro
(by
-- suppose `b β K.map f`
- simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
- ConvexCone.mem_closure, mem_closure_iff_seq_limit]
+ simp_rw [mem_map, PointedCone.mem_closure, PointedCone.coe_map, coe_coe,
+ mem_closure_iff_seq_limit, mem_image, SetLike.mem_coe, mem_coe, mem_dual,
+ adjoint_inner_right, forall_exists_index, and_imp]
+
-- there is a sequence `seq : β β F` in the image of `f` that converges to `b`
- rintro β¨seq, hmem, htendsβ© y hinner
+ rintro seq hmem htends y hinner
suffices h : β n, 0 β€ βͺy, seq nβ«_β from
ge_of_tendsto'
(Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
@@ -306,19 +268,23 @@ theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F}
-- suppose `b β K.map f`
intro h
contrapose! h
+
-- as `b β K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
+ let C := @PointedCone.toConvexCone β F _ _ _ (K.map f)
obtain β¨y, hxy, hybβ© :=
- ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
- (K.map f).isClosed h
+ @ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem
+ _ _ _ _ C (K.map f).nonempty (K.map f).isClosed b h
+
-- the rest of the proof is a straightforward algebraic manipulation
refine' β¨y, _, hybβ©
simp_rw [ProperCone.mem_dual, adjoint_inner_right]
intro x hxK
apply hxy (f x)
- rw [ProperCone.coe_map]
+ simp_rw [coe_map]
apply subset_closure
- rw [SetLike.mem_coe, ConvexCone.mem_map]
- refine' β¨x, hxK, by rw [coe_coe]β©)
+ simp_rw [PointedCone.toConvexCone_map, ConvexCone.coe_map, coe_coe, mem_image,
+ SetLike.mem_coe]
+ exact β¨x, hxK, rflβ©)
#align proper_cone.hyperplane_separation ProperCone.hyperplane_separation
theorem hyperplane_separation_of_nmem (K : ProperCone β E) {f : E βL[β] F} {b : F}
@@ -75,7 +75,7 @@ cone programs and proving duality theorems. -/
structure ProperCone (π : Type*) (E : Type*) [OrderedSemiring π] [AddCommMonoid E]
[TopologicalSpace E] [SMul π E] extends ConvexCone π E where
nonempty' : (carrier : Set E).Nonempty
- is_closed' : IsClosed (carrier : Set E)
+ isClosed' : IsClosed (carrier : Set E)
#align proper_cone ProperCone
namespace ProperCone
@@ -86,14 +86,16 @@ variable {π : Type*} [OrderedSemiring π]
variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [SMul π E]
+attribute [coe] toConvexCone
+
instance : Coe (ProperCone π E) (ConvexCone π E) :=
- β¨fun K => K.1β©
+ β¨toConvexConeβ©
-- Porting note: now a syntactic tautology
-- @[simp]
-- theorem toConvexCone_eq_coe (K : ProperCone π E) : K.toConvexCone = K :=
-- rfl
--- #align proper_cone.to_convex_cone_eq_coe ProperCone.toConvexCone_eq_coe
+#noalign proper_cone.to_convex_cone_eq_coe
theorem ext' : Function.Injective ((β) : ProperCone π E β ConvexCone π E) := fun S T h => by
cases S; cases T; congr
@@ -119,7 +121,7 @@ protected theorem nonempty (K : ProperCone π E) : (K : Set E).Nonempty :=
#align proper_cone.nonempty ProperCone.nonempty
protected theorem isClosed (K : ProperCone π E) : IsClosed (K : Set E) :=
- K.is_closed'
+ K.isClosed'
#align proper_cone.is_closed ProperCone.isClosed
end SMul
@@ -135,7 +137,7 @@ module. -/
def positive : ProperCone π E where
toConvexCone := ConvexCone.positive π E
nonempty' := β¨0, ConvexCone.pointed_positive _ _β©
- is_closed' := isClosed_Ici
+ isClosed' := isClosed_Ici
@[simp]
theorem mem_positive {x : E} : x β positive π E β 0 β€ x :=
@@ -156,7 +158,7 @@ variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [T1Space E] [Module
instance : Zero (ProperCone π E) :=
β¨{ toConvexCone := 0
nonempty' := β¨0, rflβ©
- is_closed' := isClosed_singleton }β©
+ isClosed' := isClosed_singleton }β©
instance : Inhabited (ProperCone π E) :=
β¨0β©
@@ -166,7 +168,7 @@ theorem mem_zero (x : E) : x β (0 : ProperCone π E) β x = 0 :=
Iff.rfl
#align proper_cone.mem_zero ProperCone.mem_zero
-@[simp] -- Porting note: removed `norm_cast` (new-style structures)
+@[simp, norm_cast]
theorem coe_zero : β(0 : ProperCone π E) = (0 : ConvexCone π E) :=
rfl
#align proper_cone.coe_zero ProperCone.coe_zero
@@ -194,10 +196,10 @@ noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone
toConvexCone := ConvexCone.closure (ConvexCone.map (f : E ββ[β] F) βK)
nonempty' :=
β¨0, subset_closure <| SetLike.mem_coe.2 <| ConvexCone.mem_map.2 β¨0, K.pointed, map_zero _β©β©
- is_closed' := isClosed_closure
+ isClosed' := isClosed_closure
#align proper_cone.map ProperCone.map
-@[simp] -- Porting note: removed `norm_cast` (new-style structures)
+@[simp, norm_cast]
theorem coe_map (f : E βL[β] F) (K : ProperCone β E) :
β(K.map f) = (ConvexCone.map (f : E ββ[β] F) βK).closure :=
rfl
@@ -218,10 +220,10 @@ theorem map_id (K : ProperCone β E) : K.map (ContinuousLinearMap.id β E) = K
def dual (K : ProperCone β E) : ProperCone β E where
toConvexCone := (K : Set E).innerDualCone
nonempty' := β¨0, pointed_innerDualCone _β©
- is_closed' := isClosed_innerDualCone _
+ isClosed' := isClosed_innerDualCone _
#align proper_cone.dual ProperCone.dual
-@[simp] -- Porting note: removed `norm_cast` (new-style structures)
+@[simp, norm_cast]
theorem coe_dual (K : ProperCone β E) : β(dual K) = (K : Set E).innerDualCone :=
rfl
#align proper_cone.coe_dual ProperCone.coe_dual
@@ -232,14 +234,13 @@ theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦,
#align proper_cone.mem_dual ProperCone.mem_dual
/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
-noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E
- where
+noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E where
toConvexCone := ConvexCone.comap (f : E ββ[β] F) S
nonempty' :=
β¨0, by
simp only [ConvexCone.comap, mem_preimage, map_zero, SetLike.mem_coe, mem_coe]
apply ProperCone.pointedβ©
- is_closed' := by
+ isClosed' := by
simp only [ConvexCone.comap, ContinuousLinearMap.coe_coe]
apply IsClosed.preimage f.2 S.isClosed
#align proper_cone.comap ProperCone.comap
@@ -292,8 +293,7 @@ theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F}
ConvexCone.mem_closure, mem_closure_iff_seq_limit]
-- there is a sequence `seq : β β F` in the image of `f` that converges to `b`
rintro β¨seq, hmem, htendsβ© y hinner
- suffices h : β n, 0 β€ βͺy, seq nβ«_β;
- exact
+ suffices h : β n, 0 β€ βͺy, seq nβ«_β from
ge_of_tendsto'
(Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
htends)
@@ -126,7 +126,7 @@ end SMul
section PositiveCone
-variable (π E)
+variable (π E)
variable [OrderedSemiring π] [OrderedAddCommGroup E] [Module π E] [OrderedSMul π E]
[TopologicalSpace E] [OrderClosedTopology E]
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -37,9 +37,9 @@ open ContinuousLinearMap Filter Set
namespace ConvexCone
-variable {π : Type _} [OrderedSemiring π]
+variable {π : Type*} [OrderedSemiring π]
-variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [ContinuousAdd E] [SMul π E]
+variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [ContinuousAdd E] [SMul π E]
[ContinuousConstSMul π E]
/-- The closure of a convex cone inside a topological space as a convex cone. This
@@ -72,7 +72,7 @@ end ConvexCone
/-- A proper cone is a convex cone `K` that is nonempty and closed. Proper cones have the nice
property that the dual of the dual of a proper cone is itself. This makes them useful for defining
cone programs and proving duality theorems. -/
-structure ProperCone (π : Type _) (E : Type _) [OrderedSemiring π] [AddCommMonoid E]
+structure ProperCone (π : Type*) (E : Type*) [OrderedSemiring π] [AddCommMonoid E]
[TopologicalSpace E] [SMul π E] extends ConvexCone π E where
nonempty' : (carrier : Set E).Nonempty
is_closed' : IsClosed (carrier : Set E)
@@ -82,9 +82,9 @@ namespace ProperCone
section SMul
-variable {π : Type _} [OrderedSemiring π]
+variable {π : Type*} [OrderedSemiring π]
-variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [SMul π E]
+variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [SMul π E]
instance : Coe (ProperCone π E) (ConvexCone π E) :=
β¨fun K => K.1β©
@@ -149,9 +149,9 @@ end PositiveCone
section Module
-variable {π : Type _} [OrderedSemiring π]
+variable {π : Type*} [OrderedSemiring π]
-variable {E : Type _} [AddCommMonoid E] [TopologicalSpace E] [T1Space E] [Module π E]
+variable {E : Type*} [AddCommMonoid E] [TopologicalSpace E] [T1Space E] [Module π E]
instance : Zero (ProperCone π E) :=
β¨{ toConvexCone := 0
@@ -178,11 +178,11 @@ end Module
section InnerProductSpace
-variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E]
+variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E]
-variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F]
+variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace β F]
-variable {G : Type _} [NormedAddCommGroup G] [InnerProductSpace β G]
+variable {G : Type*} [NormedAddCommGroup G] [InnerProductSpace β G]
protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
(K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.nonempty' K.isClosed
@@ -268,9 +268,9 @@ end InnerProductSpace
section CompleteSpace
-variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E] [CompleteSpace E]
+variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] [CompleteSpace E]
-variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteSpace F]
+variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteSpace F]
/-- The dual of the dual of a proper cone is itself. -/
@[simp]
@@ -21,7 +21,6 @@ linear programs, the results from this file can be used to prove duality theorem
The next steps are:
- Add convex_cone_class that extends set_like and replace the below instance
-- Define the positive cone as a proper cone.
- Define primal and dual cone programs and prove weak duality.
- Prove regular and strong duality for cone programs using Farkas' lemma (see reference).
- Define linear programs and prove LP duality as a special case of cone duality.
@@ -125,6 +124,29 @@ protected theorem isClosed (K : ProperCone π E) : IsClosed (K : Set E) :=
end SMul
+section PositiveCone
+
+variable (π E)
+variable [OrderedSemiring π] [OrderedAddCommGroup E] [Module π E] [OrderedSMul π E]
+ [TopologicalSpace E] [OrderClosedTopology E]
+
+/-- The positive cone is the proper cone formed by the set of nonnegative elements in an ordered
+module. -/
+def positive : ProperCone π E where
+ toConvexCone := ConvexCone.positive π E
+ nonempty' := β¨0, ConvexCone.pointed_positive _ _β©
+ is_closed' := isClosed_Ici
+
+@[simp]
+theorem mem_positive {x : E} : x β positive π E β 0 β€ x :=
+ Iff.rfl
+
+@[simp]
+theorem coe_positive : β(positive π E) = ConvexCone.positive π E :=
+ rfl
+
+end PositiveCone
+
section Module
variable {π : Type _} [OrderedSemiring π]
@@ -2,15 +2,12 @@
Copyright (c) 2022 Apurva Nakade All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
-
-! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 147b294346843885f952c5171e9606616a8fd869
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Analysis.Convex.Cone.Dual
import Mathlib.Analysis.InnerProductSpace.Adjoint
+#align_import analysis.convex.cone.proper from "leanprover-community/mathlib"@"147b294346843885f952c5171e9606616a8fd869"
+
/-!
# Proper cones
Forward port [#19008](https://github.com/leanprover-community/mathlib/pull/19008)
When I ported this file (Mathlib/Analysis/Convex/Cone/Proper.lean) I did not realize that mathport
had used an older commit without the latest PR. I'm forward porting it now.
@@ -4,11 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Apurva Nakade
! This file was ported from Lean 3 source module analysis.convex.cone.proper
-! leanprover-community/mathlib commit 74f1d61944a5a793e8c939d47608178c0a0cb0c2
+! leanprover-community/mathlib commit 147b294346843885f952c5171e9606616a8fd869
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Analysis.Convex.Cone.Dual
+import Mathlib.Analysis.InnerProductSpace.Adjoint
/-!
# Proper cones
@@ -22,8 +23,6 @@ linear programs, the results from this file can be used to prove duality theorem
## TODO
The next steps are:
-- Prove the cone version of Farkas' lemma (2.3.4 in the reference).
-- Add comap, adjoint
- Add convex_cone_class that extends set_like and replace the below instance
- Define the positive cone as a proper cone.
- Define primal and dual cone programs and prove weak duality.
@@ -38,6 +37,7 @@ The next steps are:
-/
+open ContinuousLinearMap Filter Set
namespace ConvexCone
@@ -163,12 +163,14 @@ variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E]
variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F]
+variable {G : Type _} [NormedAddCommGroup G] [InnerProductSpace β G]
+
protected theorem pointed (K : ProperCone β E) : (K : ConvexCone β E).Pointed :=
(K : ConvexCone β E).pointed_of_nonempty_of_isClosed K.nonempty' K.isClosed
#align proper_cone.pointed ProperCone.pointed
/-- The closure of image of a proper cone under a continuous `β`-linear map is a proper cone. We
-use continuous maps here so that the adjoint of f is also a map between proper cones. -/
+use continuous maps here so that the comap of f is also a map between proper cones. -/
noncomputable def map (f : E βL[β] F) (K : ProperCone β E) : ProperCone β F where
toConvexCone := ConvexCone.closure (ConvexCone.map (f : E ββ[β] F) βK)
nonempty' :=
@@ -210,13 +212,47 @@ theorem mem_dual {K : ProperCone β E} {y : E} : y β dual K β β β¦xβ¦,
rw [β mem_coe, coe_dual, mem_innerDualCone _ _]; rfl
#align proper_cone.mem_dual ProperCone.mem_dual
--- TODO: add comap, adjoint
+/-- The preimage of a proper cone under a continuous `β`-linear map is a proper cone. -/
+noncomputable def comap (f : E βL[β] F) (S : ProperCone β F) : ProperCone β E
+ where
+ toConvexCone := ConvexCone.comap (f : E ββ[β] F) S
+ nonempty' :=
+ β¨0, by
+ simp only [ConvexCone.comap, mem_preimage, map_zero, SetLike.mem_coe, mem_coe]
+ apply ProperCone.pointedβ©
+ is_closed' := by
+ simp only [ConvexCone.comap, ContinuousLinearMap.coe_coe]
+ apply IsClosed.preimage f.2 S.isClosed
+#align proper_cone.comap ProperCone.comap
+
+@[simp]
+theorem coe_comap (f : E βL[β] F) (S : ProperCone β F) : (S.comap f : Set E) = f β»ΒΉ' S :=
+ rfl
+#align proper_cone.coe_comap ProperCone.coe_comap
+
+@[simp]
+theorem comap_id (S : ConvexCone β E) : S.comap LinearMap.id = S :=
+ SetLike.coe_injective preimage_id
+#align proper_cone.comap_id ProperCone.comap_id
+
+theorem comap_comap (g : F βL[β] G) (f : E βL[β] F) (S : ProperCone β G) :
+ (S.comap g).comap f = S.comap (g.comp f) :=
+ SetLike.coe_injective <| by congr
+#align proper_cone.comap_comap ProperCone.comap_comap
+
+@[simp]
+theorem mem_comap {f : E βL[β] F} {S : ProperCone β F} {x : E} : x β S.comap f β f x β S :=
+ Iff.rfl
+#align proper_cone.mem_comap ProperCone.mem_comap
+
end InnerProductSpace
section CompleteSpace
variable {E : Type _} [NormedAddCommGroup E] [InnerProductSpace β E] [CompleteSpace E]
+variable {F : Type _} [NormedAddCommGroup F] [InnerProductSpace β F] [CompleteSpace F]
+
/-- The dual of the dual of a proper cone is itself. -/
@[simp]
theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
@@ -224,6 +260,53 @@ theorem dual_dual (K : ProperCone β E) : K.dual.dual = K :=
(K : ConvexCone β E).innerDualCone_of_innerDualCone_eq_self K.nonempty' K.isClosed
#align proper_cone.dual_dual ProperCone.dual_dual
+/-- This is a relative version of
+`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
+`f` to be the identity map. This is a geometric interpretation of the Farkas' lemma
+stated using proper cones. -/
+theorem hyperplane_separation (K : ProperCone β E) {f : E βL[β] F} {b : F} :
+ b β K.map f β β y : F, adjoint f y β K.dual β 0 β€ βͺy, bβ«_β :=
+ Iff.intro
+ (by
+ -- suppose `b β K.map f`
+ simp only [ProperCone.mem_map, ProperCone.mem_dual, adjoint_inner_right,
+ ConvexCone.mem_closure, mem_closure_iff_seq_limit]
+ -- there is a sequence `seq : β β F` in the image of `f` that converges to `b`
+ rintro β¨seq, hmem, htendsβ© y hinner
+ suffices h : β n, 0 β€ βͺy, seq nβ«_β;
+ exact
+ ge_of_tendsto'
+ (Continuous.seqContinuous (Continuous.inner (@continuous_const _ _ _ _ y) continuous_id)
+ htends)
+ h
+ intro n
+ obtain β¨_, h, hseqβ© := hmem n
+ simpa only [β hseq, real_inner_comm] using hinner h)
+ (by
+ -- proof by contradiction
+ -- suppose `b β K.map f`
+ intro h
+ contrapose! h
+ -- as `b β K.map f`, there is a hyperplane `y` separating `b` from `K.map f`
+ obtain β¨y, hxy, hybβ© :=
+ ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem _ (K.map f).nonempty
+ (K.map f).isClosed h
+ -- the rest of the proof is a straightforward algebraic manipulation
+ refine' β¨y, _, hybβ©
+ simp_rw [ProperCone.mem_dual, adjoint_inner_right]
+ intro x hxK
+ apply hxy (f x)
+ rw [ProperCone.coe_map]
+ apply subset_closure
+ rw [SetLike.mem_coe, ConvexCone.mem_map]
+ refine' β¨x, hxK, by rw [coe_coe]β©)
+#align proper_cone.hyperplane_separation ProperCone.hyperplane_separation
+
+theorem hyperplane_separation_of_nmem (K : ProperCone β E) {f : E βL[β] F} {b : F}
+ (disj : b β K.map f) : β y : F, adjoint f y β K.dual β§ βͺy, bβ«_β < 0 := by
+ contrapose! disj; rwa [K.hyperplane_separation]
+#align proper_cone.hyperplane_separation_of_nmem ProperCone.hyperplane_separation_of_nmem
+
end CompleteSpace
end ProperCone
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file