Convex Analysis (Rockafellar, 1970) -- Chapter 02 -- Section 07 -- Part 8
noncomputable sectionopen scoped Topologysection Chap02section Section07
The effective domain of f is contained in the effective domain of its closure.
lemma domf_subset_domcl_of_closure_le {n : Nat} (f : (Fin n โ Real) โ EReal) :
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f โ
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) := by
intro x hx
have hx' :
(x : Fin n โ Real) โ effectiveDomain (Set.univ : Set (Fin n โ Real)) f := by
simpa using hx
have hx_lt : f x < (โค : EReal) := by
have hx'' :
(x : Fin n โ Real) โ
{x | x โ (Set.univ : Set (Fin n โ Real)) โง f x < (โค : EReal)} := by
simpa [effectiveDomain_eq] using hx'
exact hx''.2
have hle : convexFunctionClosure f x โค f x :=
(convexFunctionClosure_le_self (f := f)) x
have hxcl_lt : convexFunctionClosure f x < (โค : EReal) := lt_of_le_of_lt hle hx_lt
have hxcl :
(x : Fin n โ Real) โ
{x |
x โ (Set.univ : Set (Fin n โ Real)) โง
convexFunctionClosure f x < (โค : EReal)} := by
exact โจby simp, hxcl_ltโฉ
have hxcl' :
(x : Fin n โ Real) โ
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) := by
simpa [effectiveDomain_eq] using hxcl
simpa using hxcl'The effective domain of the closure lies in the closure of the effective domain.
lemma domcl_subset_closure_domf {n : Nat} {f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f) :
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) โ
closure
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f) := by
classical
intro x hx
have hx' :
(x : Fin n โ Real) โ
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) := by
simpa using hx
have hx'' :
(x : Fin n โ Real) โ
(LinearMap.fst โ (Fin n โ Real) Real) ''
epigraph (S := (Set.univ : Set (Fin n โ Real))) (convexFunctionClosure f) := by
simpa [effectiveDomain_eq_image_fst] using hx'
have hbot : โ x, f x โ (โฅ : EReal) := by
intro x
exact hf.2.2 x (by simp)
have hepi :
epigraph (S := (Set.univ : Set (Fin n โ Real))) (convexFunctionClosure f) =
closure (epigraph (S := (Set.univ : Set (Fin n โ Real))) f) :=
(epigraph_convexFunctionClosure_eq_closure_epigraph (f := f) hbot).1
have hx''' :
(x : Fin n โ Real) โ
(LinearMap.fst โ (Fin n โ Real) Real) ''
closure (epigraph (S := (Set.univ : Set (Fin n โ Real))) f) := by
simpa [hepi] using hx''
have hcont :
Continuous (LinearMap.fst โ (Fin n โ Real) Real) :=
(LinearMap.fst โ (Fin n โ Real) Real).continuous_of_finiteDimensional
have hsubset :=
image_closure_subset_closure_image
(f := LinearMap.fst โ (Fin n โ Real) Real)
(s := epigraph (S := (Set.univ : Set (Fin n โ Real))) f) hcont
have hxcl :
(x : Fin n โ Real) โ
closure
((LinearMap.fst โ (Fin n โ Real) Real) ''
epigraph (S := (Set.univ : Set (Fin n โ Real))) f) := by
exact hsubset hx'''
have hxcl' :
(x : Fin n โ Real) โ
closure (effectiveDomain (Set.univ : Set (Fin n โ Real)) f) := by
simpa [effectiveDomain_eq_image_fst] using hxcl
have hxpre :
x โ (fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
closure (effectiveDomain (Set.univ : Set (Fin n โ Real)) f) := by
simpa using hxcl'
have hopen :
IsOpenMap (fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) := by
simpa using (EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).isOpenMap
have hcont' :
Continuous (fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) := by
simpa using (EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).continuous
have hxcl'' :
x โ
closure
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f) := by
simpa [hopen.preimage_closure_eq_closure_preimage hcont'
(s := effectiveDomain (Set.univ : Set (Fin n โ Real)) f)] using hxpre
exact hxcl''
If domcl lies in closure domf, then it lies in domf or its relative boundary.
lemma domcl_subset_domf_union_rbd {n : Nat}
{domf domcl : Set (EuclideanSpace Real (Fin n))} (hsubset : domcl โ closure domf) :
domcl โ domf โช euclideanRelativeBoundary n domf := by
intro x hx
have hxcl : x โ closure domf := hsubset hx
by_cases hxdom : x โ domf
ยท exact Or.inl hxdom
ยท have hri_sub : euclideanRelativeInterior n domf โ domf :=
(euclideanRelativeInterior_subset_closure n domf).1
have hxnotri : x โ euclideanRelativeInterior n domf := by
intro hxri
exact hxdom (hri_sub hxri)
have hxrbd : x โ euclideanRelativeBoundary n domf := by
exact โจhxcl, hxnotriโฉ
exact Or.inr hxrbd
Equal closures for domf and domcl follow from the two inclusions.
lemma closure_domcl_eq_domf {n : Nat}
{domf domcl : Set (EuclideanSpace Real (Fin n))} (hdomf : domf โ domcl)
(hdomcl : domcl โ closure domf) :
closure domcl = closure domf := by
have h1 : closure domf โ closure domcl := closure_mono hdomf
have h2 : closure domcl โ closure (closure domf) := closure_mono hdomcl
have h2' : closure domcl โ closure domf := by
simpa [closure_closure] using h2
exact le_antisymm h2' h1Relative interiors coincide under closure equality for convex sets.
lemma ri_domcl_eq_domf {n : Nat}
{domf domcl : Set (EuclideanSpace Real (Fin n))} (hconvf : Convex Real domf)
(hconvcl : Convex Real domcl) (hcl : closure domcl = closure domf) :
euclideanRelativeInterior n domcl = euclideanRelativeInterior n domf := by
exact (euclideanRelativeInterior_eq_of_closure_eq n domcl domf hconvcl hconvf) hcl
Corollary 7.4.1. If f is a proper convex function, then dom (cl f) differs from
dom f at most by including some additional relative boundary points of dom f.
In particular, dom (cl f) and dom f have the same closure and relative interior, as well
as the same dimension.
theorem convexFunctionClosure_effectiveDomain_subset_relativeBoundary_and_same_closure_ri_dim
{n : Nat} {f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f) :
let domf : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f
let domcl : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f)
domf โ domcl โง
domcl โ domf โช euclideanRelativeBoundary n domf โง
closure domcl = closure domf โง
euclideanRelativeInterior n domcl = euclideanRelativeInterior n domf โง
Module.finrank Real (affineSpan Real domcl).direction =
Module.finrank Real (affineSpan Real domf).direction := by
classical
set domf : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f with hdomf
set domcl : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) with hdomcl
have hdomf_sub : domf โ domcl := by
simpa [hdomf, hdomcl] using (domf_subset_domcl_of_closure_le (f := f))
have hdomcl_sub : domcl โ closure domf := by
simpa [hdomf, hdomcl] using (domcl_subset_closure_domf (f := f) hf)
have hdomcl_union : domcl โ domf โช euclideanRelativeBoundary n domf :=
domcl_subset_domf_union_rbd (domf := domf) (domcl := domcl) hdomcl_sub
have hclosure : closure domcl = closure domf :=
closure_domcl_eq_domf (domf := domf) (domcl := domcl) hdomf_sub hdomcl_sub
have hconv_domf : Convex Real domf := by
have hconv_eff :
Convex Real (effectiveDomain (Set.univ : Set (Fin n โ Real)) f) :=
effectiveDomain_convex (S := (Set.univ : Set (Fin n โ Real))) (f := f) hf.1
simpa [hdomf] using
(Convex.linear_preimage
(s := effectiveDomain (Set.univ : Set (Fin n โ Real)) f) hconv_eff
(EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).toLinearMap)
have hproper_cl :
ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) :=
(convexFunctionClosure_closed_properConvexFunctionOn_and_agrees_on_ri (f := f) hf).1.2
have hconv_domcl : Convex Real domcl := by
have hconv_eff :
Convex Real
(effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f)) :=
effectiveDomain_convex (S := (Set.univ : Set (Fin n โ Real)))
(f := convexFunctionClosure f) hproper_cl.1
simpa [hdomcl] using
(Convex.linear_preimage
(s := effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f))
hconv_eff (EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).toLinearMap)
have hri :
euclideanRelativeInterior n domcl = euclideanRelativeInterior n domf :=
ri_domcl_eq_domf (domf := domf) (domcl := domcl) hconv_domf hconv_domcl hclosure
have hspan : affineSpan Real domcl = affineSpan Real domf := by
calc
affineSpan Real domcl = affineSpan Real (closure domcl) := by
symm
simp [affineSpan_closure_eq n domcl]
_ = affineSpan Real (closure domf) := by simp [hclosure]
_ = affineSpan Real domf := by
simp [affineSpan_closure_eq n domf]
refine โจhdomf_sub, hdomcl_union, hclosure, hri, ?_โฉ
simpa using congrArg (fun s => Module.finrank Real s.direction) hspanAffine sets have full relative interior and empty relative boundary.
lemma ri_eq_and_boundary_empty_of_isAffineSet {n : Nat}
{C : Set (EuclideanSpace Real (Fin n))}
(hC :
IsAffineSet n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' C)) :
euclideanRelativeInterior n C = C โง euclideanRelativeBoundary n C = โ
:= by
classical
let e : (Fin n โ Real) โแต[Real] EuclideanSpace Real (Fin n) :=
(EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).symm.toLinearMap.toAffineMap
rcases
(isAffineSet_iff_affineSubspace n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' C)).1 hC with
โจs, hsโฉ
let s' : AffineSubspace Real (EuclideanSpace Real (Fin n)) := s.map e
have hs' : (s' : Set (EuclideanSpace Real (Fin n))) = C := by
ext x; constructor
ยท intro hx
rcases hx with โจy, hy, rflโฉ
have hy' :
y โ (fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' C := by
simpa [hs] using hy
rcases hy' with โจz, hz, rflโฉ
simpa [e] using hz
ยท intro hx
have hx' :
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) x โ
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' C := by
exact โจx, hx, rflโฉ
have hx'' :
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) x โ s := by
simpa [hs.symm] using hx'
refine โจ(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) x, hx'', ?_โฉ
simp [e]
have hrel :
euclideanRelativelyOpen n (s' : Set (EuclideanSpace Real (Fin n))) โง
IsClosed (s' : Set (EuclideanSpace Real (Fin n))) :=
affineSubspace_relativelyOpen_closed n s'
have hri : euclideanRelativeInterior n C = C := by
simpa [hs'] using hrel.1
have hcl : closure C = C := by
simpa [hs'] using hrel.2.closure_eq
have hrbd : euclideanRelativeBoundary n C = โ
:= by
simp [euclideanRelativeBoundary, hri, hcl]
exact โจhri, hrbdโฉFor affine effective domain, the effective domain of the closure coincides.
lemma domcl_eq_domf_of_affine_effectiveDomain {n : Nat} {f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f)
(haff : IsAffineSet n (effectiveDomain (Set.univ : Set (Fin n โ Real)) f)) :
let domf : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f
let domcl : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f)
domcl = domf := by
classical
set domf : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f with hdomf
set domcl : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) with hdomcl
rcases
(by
simpa [hdomf.symm, hdomcl.symm] using
(convexFunctionClosure_effectiveDomain_subset_relativeBoundary_and_same_closure_ri_dim
(f := f) hf)) with
โจhdomf_sub, hdomcl_sub, -, -, -โฉ
have himage_domf :
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' domf =
effectiveDomain (Set.univ : Set (Fin n โ Real)) f := by
ext x; constructor
ยท intro hx
rcases hx with โจy, hy, rflโฉ
simpa [hdomf] using hy
ยท intro hx
refine โจ(EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).symm x, ?_, ?_โฉ
ยท simpa [hdomf] using
(show (fun y : EuclideanSpace Real (Fin n) => (y : Fin n โ Real))
((EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).symm x) โ
effectiveDomain (Set.univ : Set (Fin n โ Real)) f from
by simpa using hx)
ยท simp
have haff_domf :
IsAffineSet n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' domf) := by
simpa [himage_domf] using haff
have hrbd : euclideanRelativeBoundary n domf = โ
:=
(ri_eq_and_boundary_empty_of_isAffineSet (n := n) (C := domf) haff_domf).2
have hdomcl_sub' : domcl โ domf := by
simpa [hrbd] using hdomcl_sub
exact subset_antisymm hdomcl_sub' hdomf_subFor affine effective domain, the closure agrees with the function everywhere.
lemma convexFunctionClosure_eq_of_affine_effectiveDomain {n : Nat} {f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f)
(haff : IsAffineSet n (effectiveDomain (Set.univ : Set (Fin n โ Real)) f)) :
convexFunctionClosure f = f := by
classical
set domf : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f with hdomf
set domcl : Set (EuclideanSpace Real (Fin n)) :=
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) (convexFunctionClosure f) with hdomcl
have hdomcl_eq : domcl = domf := by
simpa [hdomf, hdomcl] using
(domcl_eq_domf_of_affine_effectiveDomain (f := f) hf haff)
have himage_domf :
(fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' domf =
effectiveDomain (Set.univ : Set (Fin n โ Real)) f := by
ext x; constructor
ยท intro hx
rcases hx with โจy, hy, rflโฉ
simpa [hdomf] using hy
ยท intro hx
refine โจ(EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).symm x, ?_, ?_โฉ
ยท simpa [hdomf] using
(show (fun y : EuclideanSpace Real (Fin n) => (y : Fin n โ Real))
((EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).symm x) โ
effectiveDomain (Set.univ : Set (Fin n โ Real)) f from
by simpa using hx)
ยท simp
have haff_domf :
IsAffineSet n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) '' domf) := by
simpa [himage_domf] using haff
have hri : euclideanRelativeInterior n domf = domf :=
(ri_eq_and_boundary_empty_of_isAffineSet (n := n) (C := domf) haff_domf).1
funext x
let x' : EuclideanSpace Real (Fin n) :=
(EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)).symm x
have hx'coe : (x' : Fin n โ Real) = x := by
simp [x']
by_cases hx' : x' โ domf
ยท have hxri : x' โ euclideanRelativeInterior n domf := by
simpa [hri] using hx'
have hxri' :
x' โ euclideanRelativeInterior n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f) := by
simpa [hdomf] using hxri
have hEq := (convexFunctionClosure_eq_on_ri (f := f) hf) x' hxri'
simpa [hx'coe] using hEq
ยท have hxnot' : ยฌ f (x' : Fin n โ Real) < (โค : EReal) := by
simpa [hdomf, effectiveDomain_eq] using hx'
have hxnot : ยฌ f x < (โค : EReal) := by
simpa [hx'coe] using hxnot'
have hfx_top : f x = (โค : EReal) := by
by_contra hne
exact hxnot ((lt_top_iff_ne_top).2 hne)
have hxcl : x' โ domcl := by
simpa [hdomcl_eq] using hx'
have hxcl_not' : ยฌ convexFunctionClosure f (x' : Fin n โ Real) < (โค : EReal) := by
simpa [hdomcl, effectiveDomain_eq] using hxcl
have hxcl_not : ยฌ convexFunctionClosure f x < (โค : EReal) := by
simpa [hx'coe] using hxcl_not'
have hcl_top : convexFunctionClosure f x = (โค : EReal) := by
by_contra hne
exact hxcl_not ((lt_top_iff_ne_top).2 hne)
exact hcl_top.trans hfx_top.symm
Corollary 7.4.2. If f is a proper convex function such that dom f is an affine set
(which holds in particular if f is finite throughout โ^n), then f is closed.
theorem properConvexFunction_closed_of_affine_effectiveDomain {n : Nat}
{f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f)
(haff : IsAffineSet n (effectiveDomain (Set.univ : Set (Fin n โ Real)) f)) :
ClosedConvexFunction f := by
have hclosed_cl : ClosedConvexFunction (convexFunctionClosure f) :=
(convexFunctionClosure_closed_properConvexFunctionOn_and_agrees_on_ri (f := f) hf).1.1
have hcl_eq : convexFunctionClosure f = f :=
convexFunctionClosure_eq_of_affine_effectiveDomain (f := f) hf haff
simpa [hcl_eq] using hclosed_cl/- Remark 7.0.24: Theorems 7.2 and 7.4 imply that a convex function `f` is always lower
semicontinuous except perhaps at relative boundary points of `dom f`. In fact, `f` is
continuous relative to `ri (dom f)` (see ยง10). -/A lower semicontinuous minorant that agrees at a point transfers lsc.
lemma lowerSemicontinuousAt_of_le_of_eq {ฮฑ ฮฒ : Type*} [TopologicalSpace ฮฑ] [Preorder ฮฒ]
{f g : ฮฑ โ ฮฒ} {x : ฮฑ} (hg : LowerSemicontinuousAt g x) (hle : g โค f)
(hxeq : g x = f x) : LowerSemicontinuousAt f x := by
intro y hy
have hy' : y < g x := by
simpa [hxeq] using hy
have h := hg y hy'
refine h.mono ?_
intro x' hx'
exact lt_of_lt_of_le hx' (hle x')theorem convexFunction_lowerSemicontinuousAt_on_ri_effectiveDomain {n : Nat}
{f : (Fin n โ Real) โ EReal} (hf : ConvexFunction f) :
โ x โ
euclideanRelativeInterior n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f),
LowerSemicontinuousAt f x := by
classical
intro x hxri
by_cases hproper : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f
ยท have hclosed :
ClosedConvexFunction (convexFunctionClosure f) :=
(convexFunctionClosure_closed_properConvexFunctionOn_and_agrees_on_ri
(f := f) hproper).1.1
have hagree :
convexFunctionClosure f x = f x :=
(convexFunctionClosure_closed_properConvexFunctionOn_and_agrees_on_ri
(f := f) hproper).2 x hxri
have hle : convexFunctionClosure f โค f := convexFunctionClosure_le_self (f := f)
have hlscl : LowerSemicontinuousAt (convexFunctionClosure f) x := (hclosed.2 x)
exact lowerSemicontinuousAt_of_le_of_eq hlscl hle hagree
ยท have hconv : ConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f := by
simpa [ConvexFunction] using hf
have himproper :
ImproperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f := โจhconv, hproperโฉ
have hbot :
f x = (โฅ : EReal) :=
improperConvexFunctionOn_eq_bot_on_ri_effectiveDomain (f := f) himproper x hxri
have hlscl :
LowerSemicontinuousAt (fun _ : (Fin n โ Real) => (โฅ : EReal)) x :=
(closed_improper_const_bot (n := n)).1.2 x
have hle : (fun _ : (Fin n โ Real) => (โฅ : EReal)) โค f := by
intro x
exact bot_le
exact
lowerSemicontinuousAt_of_le_of_eq hlscl hle (by simpa using hbot.symm)/- Proper convex functions are continuous on the relative interior of their effective domain. -/Proper convex functions are finite on the relative interior of their effective domain.
lemma properConvexFunctionOn_ne_top_on_ri_effectiveDomain {n : Nat}
{f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f) :
โ x โ
euclideanRelativeInterior n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f),
f x โ (โฅ : EReal) โง f x โ (โค : EReal) := by
intro x hxri
have hx' :
x โ
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f) :=
(euclideanRelativeInterior_subset_closure n
((fun x : EuclideanSpace Real (Fin n) => (x : Fin n โ Real)) โปยน'
effectiveDomain (Set.univ : Set (Fin n โ Real)) f)).1 hxri
have hxdom :
(x : Fin n โ Real) โ effectiveDomain (Set.univ : Set (Fin n โ Real)) f := by
simpa using hx'
have hbot : f x โ (โฅ : EReal) := hf.2.2 x (by simp)
have htop : f x โ (โค : EReal) :=
mem_effectiveDomain_imp_ne_top (S := Set.univ) (f := f) hxdom
exact โจhbot, htopโฉ
The toReal of a proper convex function is convex on its effective domain.
lemma convexOn_toReal_on_effectiveDomain {n : Nat} {f : (Fin n โ Real) โ EReal}
(hf : ProperConvexFunctionOn (Set.univ : Set (Fin n โ Real)) f) :
ConvexOn โ (effectiveDomain (Set.univ : Set (Fin n โ Real)) f) (fun x => (f x).toReal) := by
classical
set C : Set (Fin n โ Real) := effectiveDomain (Set.univ : Set (Fin n โ Real)) f
have hconvC : Convex โ C := by
simpa [C] using
(effectiveDomain_convex (S := (Set.univ : Set (Fin n โ Real))) (f := f) hf.1)
have hconvf : ConvexFunctionOn C f := by
simpa [C] using
(convexFunctionOn_iff_convexFunctionOn_effectiveDomain
(S := (Set.univ : Set (Fin n โ Real))) (f := f)).1 hf.1
have hnotbot : โ x โ C, f x โ (โฅ : EReal) := by
intro x hx
exact hf.2.2 x (by simp)
have hseg :=
(convexFunctionOn_iff_segment_inequality (C := C) (f := f) hconvC hnotbot).1 hconvf
refine (convexOn_iff_forall_pos).2 ?_
refine โจhconvC, ?_โฉ
intro x hx y hy a b ha hb hab
have hb_lt : b < 1 := by linarith
have ha_eq : a = 1 - b := by linarith
have hseg' :
f ((1 - b) โข x + b โข y) โค
((1 - b : Real) : EReal) * f x + ((b : Real) : EReal) * f y :=
hseg x (by simpa [C] using hx) y (by simpa [C] using hy) b hb hb_lt
have hbot :
f ((1 - b) โข x + b โข y) โ (โฅ : EReal) := by
exact hf.2.2 _ (by simp)
have hfx_bot : f x โ (โฅ : EReal) := hf.2.2 x (by simp)
have hfy_bot : f y โ (โฅ : EReal) := hf.2.2 y (by simp)
have hfx_top : f x โ (โค : EReal) :=
mem_effectiveDomain_imp_ne_top (S := Set.univ) (f := f) (by simpa [C] using hx)
have hfy_top : f y โ (โค : EReal) :=
mem_effectiveDomain_imp_ne_top (S := Set.univ) (f := f) (by simpa [C] using hy)
have hfx_coe : ((f x).toReal : EReal) = f x :=
EReal.coe_toReal hfx_top hfx_bot
have hfy_coe : ((f y).toReal : EReal) = f y :=
EReal.coe_toReal hfy_top hfy_bot
have hsum :
((1 - b : Real) : EReal) * f x + ((b : Real) : EReal) * f y =
(( (1 - b) * (f x).toReal + b * (f y).toReal : Real) : EReal) := by
calc
((1 - b : Real) : EReal) * f x + ((b : Real) : EReal) * f y =
((1 - b : Real) : EReal) * ((f x).toReal : EReal) +
((b : Real) : EReal) * ((f y).toReal : EReal) := by
simp [hfx_coe, hfy_coe]
_ = (( (1 - b) * (f x).toReal : Real) : EReal) +
((b * (f y).toReal : Real) : EReal) := by
simp [EReal.coe_mul]
_ = (( (1 - b) * (f x).toReal + b * (f y).toReal : Real) : EReal) := by
simp
have hsum_not_top :
((1 - b : Real) : EReal) * f x + ((b : Real) : EReal) * f y โ (โค : EReal) := by
rw [hsum]
exact EReal.coe_ne_top _
have hsum_toReal :
(((1 - b : Real) : EReal) * f x + ((b : Real) : EReal) * f y).toReal =
(1 - b) * (f x).toReal + b * (f y).toReal := by
have hsum' := congrArg EReal.toReal hsum
simpa using hsum'
have hineq :
(f ((1 - b) โข x + b โข y)).toReal โค
( (1 - b) * (f x).toReal + b * (f y).toReal ) := by
have hsum_toReal' :
(((1 - (b : EReal)) * f x + (b : EReal) * f y).toReal =
(1 - b) * (f x).toReal + b * (f y).toReal) := by
simpa [EReal.coe_sub] using hsum_toReal
have h := EReal.toReal_le_toReal hseg' hbot hsum_not_top
simpa [hsum_toReal'] using h
simpa [ha_eq] using hineq
Lift continuity of toReal โ f to continuity of f on finite-valued sets.
lemma continuousOn_ereal_of_toReal {ฮฑ : Type*} [TopologicalSpace ฮฑ] {f : ฮฑ โ EReal}
{s : Set ฮฑ} (hcont : ContinuousOn (fun x => (f x).toReal) s)
(hfinite : โ x โ s, f x โ (โฅ : EReal) โง f x โ (โค : EReal)) :
ContinuousOn f s := by
have hcont' :
ContinuousOn (fun x => ((f x).toReal : EReal)) s := by
exact continuous_coe_real_ereal.comp_continuousOn hcont
have hEq :
Set.EqOn (fun x => f x) (fun x => ((f x).toReal : EReal)) s := by
intro x hx
have hne_bot : f x โ (โฅ : EReal) := (hfinite x hx).1
have hne_top : f x โ (โค : EReal) := (hfinite x hx).2
exact (EReal.coe_toReal hne_top hne_bot).symm
exact hcont'.congr hEq/- Relative interior continuity for real-valued convex functions (Section 10 placeholder). -/In full dimension, relative interior equals interior, giving continuity for convex maps.
lemma convexOn_continuousOn_ri_of_affineSpan_eq_univ {n : Nat}
{C : Set (EuclideanSpace Real (Fin n))} {g : EuclideanSpace Real (Fin n) โ โ}
(hg : ConvexOn โ C g)
(hspan : (affineSpan Real C : Set (EuclideanSpace Real (Fin n))) = Set.univ) :
ContinuousOn g (euclideanRelativeInterior n C) := by
have hri :
euclideanRelativeInterior n C = interior C :=
euclideanRelativeInterior_eq_interior_of_affineSpan_eq_univ n C hspan
simpa [hri] using (ConvexOn.continuousOn_interior (C := C) (f := g) hg)Affine equivalences transport continuity on relative interiors.
lemma continuousOn_ri_of_affineEquiv {n : Nat}
{C : Set (EuclideanSpace Real (Fin n))} {g : EuclideanSpace Real (Fin n) โ โ}
(e : EuclideanSpace Real (Fin n) โแต[Real] EuclideanSpace Real (Fin n))
(hcont :
ContinuousOn (fun x => g (e.symm x)) (euclideanRelativeInterior n (e '' C))) :
ContinuousOn g (euclideanRelativeInterior n C) := by
have hcont_e :
ContinuousOn (fun x => e x) (euclideanRelativeInterior n C) :=
(AffineEquiv.continuous_of_finiteDimensional (f := e)).continuousOn
have hmap :
Set.MapsTo (fun x => e x) (euclideanRelativeInterior n C)
(euclideanRelativeInterior n (e '' C)) := by
intro x hx
have hx' : e x โ e '' euclideanRelativeInterior n C := โจx, hx, rflโฉ
simpa [euclideanRelativeInterior_image_affineEquiv (n := n) (C := C) (e := e)] using hx'
have hcomp :
ContinuousOn (fun x => g (e.symm (e x))) (euclideanRelativeInterior n C) :=
hcont.comp (s := euclideanRelativeInterior n C) hcont_e hmap
simpa using hcompThe coordinate subspace as a submodule.
def coordinateSubmodule (n m : Nat) : Submodule Real (EuclideanSpace Real (Fin n)) :=
{ carrier := coordinateSubspace n m
zero_mem' := by
intro i hi
simp
add_mem' := by
intro x y hx hy i hi
have hx' := hx i hi
have hy' := hy i hi
simp [hx', hy']
smul_mem' := by
intro r x hx i hi
have hx' := hx i hi
simp [hx'] }Coordinate-subspace affine equivalence using extend-by-zero and restriction.
noncomputable def coordinateSubspace_affineEquiv {n m : Nat} (hmn : m โค n) :
EuclideanSpace Real (Fin m) โแต[Real] (coordinateSubmodule n m) := by
classical
let e_m : EuclideanSpace Real (Fin m) โL[Real] (Fin m โ Real) :=
EuclideanSpace.equiv (๐ := Real) (ฮน := Fin m)
let e_n : EuclideanSpace Real (Fin n) โL[Real] (Fin n โ Real) :=
EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)
let A' : (Fin m โ Real) โโ[Real] (Fin n โ Real) :=
Function.ExtendByZero.linearMap Real (Fin.castLE hmn)
let g' : (Fin n โ Real) โโ[Real] (Fin m โ Real) :=
LinearMap.funLeft Real Real (Fin.castLE hmn)
let A : EuclideanSpace Real (Fin m) โโ[Real] EuclideanSpace Real (Fin n) :=
e_n.symm.toLinearMap.comp (A'.comp e_m.toLinearMap)
let g : EuclideanSpace Real (Fin n) โโ[Real] EuclideanSpace Real (Fin m) :=
e_m.symm.toLinearMap.comp (g'.comp e_n.toLinearMap)
have hleft' : Function.LeftInverse g' A' := by
intro x
ext i
have hcomp :=
Function.extend_comp (f := Fin.castLE hmn) (g := x) (e' := fun _ => (0 : Real))
(hf := Fin.castLE_injective hmn)
have hcomp' := congrArg (fun h => h i) hcomp
simpa [A', g', LinearMap.funLeft_apply] using hcomp'
have hleft : Function.LeftInverse g A := by
intro x
apply e_m.injective
have hcomp : e_m (g (A x)) = g' (A' (e_m x)) := by
have h1 : e_m (g (A x)) = g' (e_n (A x)) := by
simp [g, LinearMap.comp_apply]
have h2 : e_n (A x) = A' (e_m x) := by
simp [A, LinearMap.comp_apply]
simpa [h2] using h1
simpa [hcomp] using (hleft' (e_m x))
have hrange : LinearMap.range A = coordinateSubmodule n m := by
ext x; constructor
ยท rintro โจy, rflโฉ
intro i hi
have hi' : ยฌ โ j : Fin m, Fin.castLE hmn j = i := by
intro h
rcases h with โจj, hjโฉ
have hval : (j : Nat) = (i : Nat) := by
simpa using congrArg Fin.val hj
have hjlt : (i : Nat) < m := by
simpa [hval] using j.is_lt
exact (not_lt_of_ge hi) hjlt
have hAy :
(e_n (A y)) i = 0 := by
have hAy' : e_n (A y) = A' (e_m y) := by
simp [A, LinearMap.comp_apply]
have hAy'' := congrArg (fun f => f i) hAy'
simpa [A', Function.extend_apply', hi'] using hAy''
simpa [e_n, EuclideanSpace.equiv, PiLp.coe_continuousLinearEquiv] using hAy
ยท intro hx
refine โจg x, ?_โฉ
apply e_n.injective
have hAg : e_n (A (g x)) = A' (g' (e_n x)) := by
have h1 : e_n (A (g x)) = A' (e_m (g x)) := by
simp [A, LinearMap.comp_apply]
have h2 : e_m (g x) = g' (e_n x) := by
simp [g, LinearMap.comp_apply]
simpa [h2] using h1
apply funext
intro i
by_cases hi : (i : Nat) < m
ยท let j : Fin m := โจi, hiโฉ
have hij : Fin.castLE hmn j = i := by
ext
rfl
have hA' :
(A' (g' (e_n x))) i = (e_n x) i := by
have hA'' :
(A' (g' (e_n x))) (Fin.castLE hmn j) =
(e_n x) (Fin.castLE hmn j) := by
simp [A', g', LinearMap.funLeft_apply, Fin.castLE_injective hmn]
simpa [hij] using hA''
simpa [hAg] using hA'
ยท have hi' : m โค (i : Nat) := le_of_not_gt hi
have hnot : ยฌ โ j : Fin m, Fin.castLE hmn j = i := by
intro h
rcases h with โจj, hjโฉ
have hval : (j : Nat) = (i : Nat) := by
simpa using congrArg Fin.val hj
have hjlt : (i : Nat) < m := by
simpa [hval] using j.is_lt
exact hi hjlt
have hx' : (e_n x) i = 0 := by
have hx'' : x i = 0 := hx i hi'
simpa [e_n, EuclideanSpace.equiv, PiLp.coe_continuousLinearEquiv] using hx''
have hA' :
(A' (g' (e_n x))) i = 0 := by
simp [A', g', Function.extend_apply', hnot]
simpa [hAg, hx'] using hA'
let e0 : EuclideanSpace Real (Fin m) โโ[Real] LinearMap.range A :=
LinearEquiv.ofLeftInverse (f := A) (g := g) hleft
let e1 : LinearMap.range A โโ[Real] coordinateSubmodule n m :=
LinearEquiv.ofEq _ _ hrange
exact (e0.trans e1).toAffineEquivPulling back a full-dimensional set from the coordinate subspace gives full affine span.
lemma affineSpan_preimage_eq_univ {n m : Nat} (hmn : m โค n)
{C : Set (EuclideanSpace Real (Fin n))}
(hspan :
(affineSpan Real C : Set (EuclideanSpace Real (Fin n))) = coordinateSubspace n m) :
(affineSpan Real
((coordinateSubspace_affineEquiv (n := n) (m := m) hmn).symm ''
(Subtype.val โปยน' C)) : Set (EuclideanSpace Real (Fin m))) = Set.univ := by
classical
let e := coordinateSubspace_affineEquiv (n := n) (m := m) hmn
let Csub : Set (coordinateSubmodule n m) := Subtype.val โปยน' C
have hCsub : C โ coordinateSubspace n m := by
intro x hx
have hx' : x โ (affineSpan Real C : Set (EuclideanSpace Real (Fin n))) :=
subset_affineSpan (k := Real) (s := C) hx
simpa [hspan] using hx'
have himage :
(fun x : coordinateSubmodule n m => (x : EuclideanSpace Real (Fin n))) '' Csub = C := by
ext x; constructor
ยท rintro โจy, hy, rflโฉ
exact hy
ยท intro hx
exact โจโจx, hCsub hxโฉ, hx, rflโฉ
have hmap :
(affineSpan Real Csub).map ((coordinateSubmodule n m).subtype.toAffineMap) =
affineSpan Real C := by
simpa [himage] using
(AffineSubspace.map_span (k := Real)
(f := (coordinateSubmodule n m).subtype.toAffineMap) (s := Csub))
have hmap_set :
(fun x : coordinateSubmodule n m => (x : EuclideanSpace Real (Fin n))) ''
(affineSpan Real Csub : Set (coordinateSubmodule n m)) =
coordinateSubspace n m := by
have hmap_set' :
(fun x : coordinateSubmodule n m => (x : EuclideanSpace Real (Fin n))) ''
(affineSpan Real Csub : Set (coordinateSubmodule n m)) =
(affineSpan Real C : Set (EuclideanSpace Real (Fin n))) := by
simpa [AffineSubspace.coe_map] using
congrArg (fun (S : AffineSubspace Real (EuclideanSpace Real (Fin n))) =>
(S : Set (EuclideanSpace Real (Fin n)))) hmap
simpa [hspan] using hmap_set'
have hspan_sub :
(affineSpan Real Csub : Set (coordinateSubmodule n m)) = Set.univ := by
ext x; constructor
ยท intro _; exact Set.mem_univ _
ยท intro _
have hxval : (x : EuclideanSpace Real (Fin n)) โ coordinateSubspace n m := x.property
have hximage :
(x : EuclideanSpace Real (Fin n)) โ
(fun y : coordinateSubmodule n m => (y : EuclideanSpace Real (Fin n))) ''
(affineSpan Real Csub : Set (coordinateSubmodule n m)) := by
simp [hmap_set, hxval]
rcases hximage with โจy, hy, hyvalโฉ
have hyx : y = x := by
apply Subtype.ext
simpa using hyval
simpa [hyx] using hy
have hspan_sub' :
affineSpan Real Csub = (โค : AffineSubspace Real (coordinateSubmodule n m)) := by
ext x; constructor
ยท intro _; exact Set.mem_univ _
ยท intro _
change x โ (affineSpan Real Csub : Set (coordinateSubmodule n m))
simp [hspan_sub]
have hspan_e :
affineSpan Real (e.symm '' Csub) =
(โค : AffineSubspace Real (EuclideanSpace Real (Fin m))) :=
(AffineEquiv.span_eq_top_iff (e := e.symm) (s := Csub)).1 hspan_sub'
have hspan_e_set :
(affineSpan Real (e.symm '' Csub) : Set (EuclideanSpace Real (Fin m))) = Set.univ := by
simpa using
congrArg
(fun (S : AffineSubspace Real (EuclideanSpace Real (Fin m))) =>
(S : Set (EuclideanSpace Real (Fin m)))) hspan_e
simpa using hspan_e_set
If A has a right inverse on s, then A '' (A โปยน' s) = s.
lemma image_preimage_eq_of_rightInverse {ฮฑ ฮฒ : Type*} {A : ฮฑ โ ฮฒ} {g : ฮฒ โ ฮฑ} {s : Set ฮฒ}
(hright : โ y โ s, A (g y) = y) : A '' (A โปยน' s) = s := by
ext y; constructor
ยท rintro โจx, hx, rflโฉ
exact hx
ยท intro hy
refine โจg y, ?_, hright y hyโฉ
simpa [hright y hy] using hyFor linear affine maps, the value equals the linear part.
lemma affineMap_apply_eq_linear {n m : Nat}
(A : EuclideanSpace Real (Fin m) โแต[Real] EuclideanSpace Real (Fin n))
(hA0 : A 0 = 0) : โ x, A x = A.linear x := by
intro x
have h := A.map_vadd 0 x
simpa [hA0] using hThe relative interior of a linear affine image is the image of the relative interior.
lemma ri_image_linearMap_eq {n m : Nat}
{D : Set (EuclideanSpace Real (Fin m))} (hconvD : Convex Real D)
(A : EuclideanSpace Real (Fin m) โแต[Real] EuclideanSpace Real (Fin n))
(hA0 : A 0 = 0) :
euclideanRelativeInterior n (A '' D) = A '' euclideanRelativeInterior m D := by
have hAeq : โ x, A x = A.linear x := affineMap_apply_eq_linear (A := A) hA0
have himage :
((A.linear : EuclideanSpace Real (Fin m) โ EuclideanSpace Real (Fin n)) '' D) =
A '' D := by
ext y; constructor
ยท rintro โจx, hx, rflโฉ
exact โจx, hx, hAeq xโฉ
ยท rintro โจx, hx, rflโฉ
exact โจx, hx, (hAeq x).symmโฉ
have himage_ri :
((A.linear : EuclideanSpace Real (Fin m) โ EuclideanSpace Real (Fin n)) ''
euclideanRelativeInterior m D) =
A '' euclideanRelativeInterior m D := by
ext y; constructor
ยท rintro โจx, hx, rflโฉ
exact โจx, hx, hAeq xโฉ
ยท rintro โจx, hx, rflโฉ
exact โจx, hx, (hAeq x).symmโฉ
have hri :=
(euclideanRelativeInterior_image_linearMap_eq_and_image_closure_subset m n D hconvD
A.linear).1
simpa [himage, himage_ri] using hriThe coordinate-subspace embedding is surjective onto subsets of the subspace.
lemma A_image_eq_C' {n m : Nat} {C' : Set (EuclideanSpace Real (Fin n))}
(e : EuclideanSpace Real (Fin m) โแต[Real] coordinateSubmodule n m)
(A : EuclideanSpace Real (Fin m) โแต[Real] EuclideanSpace Real (Fin n))
(hA : A = ((coordinateSubmodule n m).subtype.toAffineMap).comp e.toAffineMap)
(hC' : C' โ coordinateSubspace n m) :
A '' (A โปยน' C') = C' := by
classical
ext y; constructor
ยท rintro โจx, hx, rflโฉ
exact hx
ยท intro hy
have hy' : (โจy, hC' hyโฉ : coordinateSubmodule n m) โ (Subtype.val โปยน' C') := by
simpa using hy
refine โจe.symm โจy, hC' hyโฉ, ?_, ?_โฉ
ยท have : A (e.symm โจy, hC' hyโฉ) = y := by
simp [hA, AffineMap.comp_apply]
simpa [this] using hy
ยท simp [hA, AffineMap.comp_apply]Transfer continuity along a left inverse on an image.
lemma continuousOn_of_leftInverse_on_range {ฮฑ ฮฒ ฮณ : Type*} [TopologicalSpace ฮฑ]
[TopologicalSpace ฮฒ] [TopologicalSpace ฮณ]
{A : ฮฑ โ ฮฒ} {g : ฮฒ โ ฮฑ} {f : ฮฒ โ ฮณ} {s : Set ฮฑ} {t : Set ฮฒ}
(hcont : ContinuousOn (fun x => f (A x)) s)
(hleft : Function.LeftInverse g A)
(ht : t = A '' s)
(hg : Continuous g) :
ContinuousOn f t := by
have hmaps : Set.MapsTo g t s := by
intro y hy
rcases (by simpa [ht] using hy) with โจx, hx, rflโฉ
simpa [hleft x] using hx
have hcomp :
ContinuousOn (fun y => f (A (g y))) t :=
hcont.comp (s := t) hg.continuousOn hmaps
have hEq : Set.EqOn (fun y => f (A (g y))) f t := by
intro y hy
rcases (by simpa [ht] using hy) with โจx, hx, rflโฉ
simp [hleft x]
exact hcomp.congr hEq.symmReduce continuity on relative interior via an affine coordinate subspace model.
lemma convexOn_continuousOn_ri_via_coordinateSubspace {n : Nat}
{C : Set (EuclideanSpace Real (Fin n))} {g : EuclideanSpace Real (Fin n) โ โ}
(hg : ConvexOn โ C g) : ContinuousOn g (euclideanRelativeInterior n C) := by
classical
by_cases hri : (euclideanRelativeInterior n C).Nonempty
ยท have hri_sub : euclideanRelativeInterior n C โ C :=
(euclideanRelativeInterior_subset_closure n C).1
have hCnonempty : C.Nonempty := by
rcases hri with โจx, hxโฉ
exact โจx, hri_sub hxโฉ
let m := Module.finrank Real (affineSpan Real C).direction
obtain โจT, hTโฉ :=
exists_affineEquiv_affineSpan_eq_coordinateSubspace n m C hCnonempty (by simp [m])
have hspanT :
(affineSpan Real (T '' C) : Set (EuclideanSpace Real (Fin n))) =
coordinateSubspace n m := by
have hspan' := affineSpan_image_affineEquiv (n := n) (C := C) (e := T)
simpa [hspan'] using hT
have hmn :
m โค n := by
have hle :
Module.finrank Real (affineSpan Real C).direction โค
Module.finrank Real (EuclideanSpace Real (Fin n)) :=
Submodule.finrank_le (affineSpan Real C).direction
simpa [m, finrank_euclideanSpace_fin] using hle
let e := coordinateSubspace_affineEquiv (n := n) (m := m) hmn
let C' : Set (EuclideanSpace Real (Fin n)) := T '' C
let A : EuclideanSpace Real (Fin m) โแต[Real] EuclideanSpace Real (Fin n) :=
((coordinateSubmodule n m).subtype.toAffineMap).comp e.toAffineMap
let D : Set (EuclideanSpace Real (Fin m)) :=
e.symm '' (Subtype.val โปยน' C')
have hpre : T.symm โปยน' C = C' := by
ext x; constructor
ยท intro hx
exact โจT.symm x, hx, by simpโฉ
ยท rintro โจy, hy, rflโฉ
simpa using hy
have hconvT : ConvexOn โ C' (fun x => g (T.symm x)) := by
simpa [hpre, C', Function.comp] using
(ConvexOn.comp_affineMap (g := T.symm.toAffineMap) (s := C) hg)
have hD : D = A โปยน' C' := by
ext x; constructor
ยท rintro โจy, hy, rflโฉ
simpa [A, C', AffineMap.comp_apply] using hy
ยท intro hx
refine โจe x, ?_, by simpโฉ
simpa [A, C', AffineMap.comp_apply] using hx
have hconvD : ConvexOn โ D (fun x => g (T.symm (A x))) := by
simpa [D, hD, Function.comp, A] using
(ConvexOn.comp_affineMap (g := A) (s := C') hconvT)
have hspanD :
(affineSpan Real D : Set (EuclideanSpace Real (Fin m))) = Set.univ := by
simpa [D, C'] using
(affineSpan_preimage_eq_univ (n := n) (m := m) hmn
(C := C') hspanT)
have hcontD :
ContinuousOn (fun x => g (T.symm (A x))) (euclideanRelativeInterior m D) := by
exact convexOn_continuousOn_ri_of_affineSpan_eq_univ
(C := D) (g := fun x => g (T.symm (A x))) hconvD hspanD
-- TODO: transport continuity back to `C'` using the linear map image lemma for `A`.
have hcontC' :
ContinuousOn (fun x => g (T.symm x)) (euclideanRelativeInterior n C') := by
have hC'sub : C' โ coordinateSubspace n m := by
intro x hx
have hx' :
x โ (affineSpan Real C' : Set (EuclideanSpace Real (Fin n))) :=
subset_affineSpan (k := Real) (s := C') hx
simpa [C', hspanT] using hx'
have hA_image : A '' D = C' := by
have hA_image' :
A '' (A โปยน' C') = C' :=
A_image_eq_C' (e := e) (A := A) rfl hC'sub
simpa [hD] using hA_image'
let e_m' : EuclideanSpace Real (Fin m) โL[Real] (Fin m โ Real) :=
EuclideanSpace.equiv (๐ := Real) (ฮน := Fin m)
let e_n' : EuclideanSpace Real (Fin n) โL[Real] (Fin n โ Real) :=
EuclideanSpace.equiv (๐ := Real) (ฮน := Fin n)
let A0' : (Fin m โ Real) โโ[Real] (Fin n โ Real) :=
Function.ExtendByZero.linearMap Real (Fin.castLE hmn)
let A0 : EuclideanSpace Real (Fin m) โโ[Real] EuclideanSpace Real (Fin n) :=
e_n'.symm.toLinearMap.comp (A0'.comp e_m'.toLinearMap)
have hAeq : โ x, A x = A0 x := by
intro x
simp [A, A0, A0', AffineMap.comp_apply, e, coordinateSubspace_affineEquiv, e_m', e_n']
have hA0 : A 0 = 0 := by
simp [hAeq 0]
have hri_eq :
euclideanRelativeInterior n C' = A '' euclideanRelativeInterior m D := by
have hri := ri_image_linearMap_eq (n := n) (m := m) (D := D) hconvD.1 A hA0
simpa [hA_image] using hri
let p' : (Fin n โ Real) โโ[Real] (Fin m โ Real) :=
LinearMap.funLeft Real Real (Fin.castLE hmn)
let p : EuclideanSpace Real (Fin n) โโ[Real] EuclideanSpace Real (Fin m) :=
e_m'.symm.toLinearMap.comp (p'.comp e_n'.toLinearMap)
have hleft0' : Function.LeftInverse p' A0' := by
intro x
ext i
have hcomp :=
Function.extend_comp (f := Fin.castLE hmn) (g := x) (e' := fun _ => (0 : Real))
(hf := Fin.castLE_injective hmn)
have hcomp' := congrArg (fun h => h i) hcomp
simpa [A0', p', LinearMap.funLeft_apply] using hcomp'
have hleft0 : Function.LeftInverse p A0 := by
intro x
apply e_m'.injective
have hcomp : e_m' (p (A0 x)) = p' (A0' (e_m' x)) := by
have h1 : e_m' (p (A0 x)) = p' (e_n' (A0 x)) := by
simp [p, LinearMap.comp_apply]
have h2 : e_n' (A0 x) = A0' (e_m' x) := by
simp [A0, LinearMap.comp_apply]
simpa [h2] using h1
simpa [hcomp] using (hleft0' (e_m' x))
have hleft : Function.LeftInverse p A := by
intro x
simpa [hAeq x] using hleft0 x
have hpcont : Continuous p :=
(LinearMap.continuous_of_finiteDimensional (f := p))
exact
continuousOn_of_leftInverse_on_range (A := A) (g := p)
(f := fun x => g (T.symm x)) (s := euclideanRelativeInterior m D)
(t := euclideanRelativeInterior n C') hcontD hleft hri_eq hpcont
exact continuousOn_ri_of_affineEquiv (n := n) (C := C) (g := g) (e := T) hcontC'
ยท have hri' : euclideanRelativeInterior n C = โ
:= by
apply Set.eq_empty_iff_forall_notMem.2
intro x hx
exact hri โจx, hxโฉ
simp [hri']end Section07end Chap02