Module mathcomp.analysis.convex
From HB Require Import structures.From mathcomp Require Import boot order finmap ssralg ssrint ssrnum interval.
From mathcomp Require Import interval_inference.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import mathcomp_extra boolp classical_sets set_interval.
From mathcomp Require Import reals topology.
# Convexity
This file provides a small account of convexity using convex spaces, to be
completed with material from InfoTheo.
```
convex_quasi_associative == quasi-associativity of the operator of
convex spaces
isConvexSpace R T == interface for convex spaces with
R : numDomainType
The HB class is ConvexSpace.
a <| t |> b == convexity operator
```
For `R : numDomainType`, `E : lmodType R` and `R` itself are shown to be
convex spaces with the following aliases:
```
convex_lmodType E == E : lmodType R as a convex space
convex_numDomainType R == R : numDomainType as a convex space
```
```
convex_set A == A : set M is a convex set
M is an Lmodule over R : numDomainType
convex_function f == f : E -> R is a convex function
E is an Lmodule over R : numFieldType
```
Reserved Notation "x <| p |> y" (format "x <| p |> y", at level 49).
Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Theory.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Declare Scope convex_scope.
Local Open Scope convex_scope.
Module
ConvexQuasiAssoc
Source code
.Source code
Section def.
Variables ( : numDomainType) ( : Type) (
conv
Source code
: {i01 R} -> T -> T -> T).Source code
Local Notation
"x <| p |> y"
Source code
:= (conv p x y).Source code
Definition
law
Source code
:= forall ( : {i01 R}) ( : T),Source code
p%:num = r%:num * s%:num ->
s%:num.~ = p%:num.~ * q%:num.~ ->
a <| p |> (b <| q |> c) = (a <| r |> b) <| s |> c.
End def.
technical relations between the parameters of the quasi-associativity law
Section lemmas.Lemma
pq_sr
Source code
( : comPzRingType) ( : R) :Source code
p = r * s ->
1 - s = (1 - p) * (1 - q) ->
(1 - p) * q = s * (1 - r).
Proof.
Lemma ( : pzRingType) ( : R) :
1 - s = (1 - p) * (1 - q) ->
s = 1 - (1 - p) * (1 - q).
Lemma ( : comUnitRingType) ( : R) :
1 - p \is a GRing.unit ->
p = r * s ->
1 - s = (1 - p) * (1 - q) ->
q = (s * (1 - r)) / (1 - p).
Lemma ( : unitRingType) ( : R) :
s \is a GRing.unit -> p = r * s -> r = p / s.
End lemmas.
End ConvexQuasiAssoc.
Definition
convex_quasi_associative
Source code
:= ConvexQuasiAssoc.law.Source code
.
mixin
Source code
Source code
Record
Source code
Source code
isConvexSpace
Source code
(Source code
numDomainType
Source code
) T := {Source code
conv : {i01 R} -> T -> T -> T ;
conv1 : forall , conv 1%:i01 a b = a ;
convmm : forall ( : {i01 R}) , conv p a a = a ;
convC : forall ( : {i01 R}) , conv p a b = conv (1 - p%:inum)%:i01 b a;
convA : convex_quasi_associative conv
}.
#[short
Source code
(Source code
type=convType
Source code
)Source code
.
structure
Source code
Source code
Definition
Source code
Source code
ConvexSpace
Source code
(Source code
numDomainType
Source code
) :=Source code
{ of isConvexSpace R T & Choice T}.
Notation
"a <| p |> b"
Source code
:= (conv p a b) : convex_scope.Source code
Section convex_space_lemmas.
Context ( : convType R).
Implicit Types a b : A.
Lemma
conv0
Source code
: a <| 0%:i01 |> b = b.Source code
Proof.
End convex_space_lemmas.
Local Open Scope convex_scope.
Definition
convex_lmodType
Source code
{ : numDomainType} ( : lmodType R) : Type := E.Source code
Section lmodType_convex_space.
Context { : numDomainType} { : lmodType R}.
Implicit Type p q r : {i01 R}.
Let := convex_lmodType E'.
Let
avg
Source code
( : E) := p%:inum *: a + p%:inum.~ *: b.Source code
Let
avg1
Source code
: avg 1%:i01 a b = a.Source code
Let
avgI
Source code
: avg p x x = x.Source code
Let
avgC
Source code
: avg p x y = avg (1 - (p%:inum))%:i01 y x.Source code
Let
avgA
Source code
: convex_quasi_associative avg.Source code
Proof.
.
instance
Source code
Source code
Definition
Source code
Source code
Choice
Source code
.on E.Source code
.
instance
Source code
Source code
Definition
Source code
Source code
isConvexSpace.Build R E avg1 avgI avgC avgA.
End lmodType_convex_space.
Definition
convex_numDomainType
Source code
( : numDomainType) : Type := R^o.Source code
Section numDomainType_convex_space.
Context { : numDomainType}.
Implicit Types p q : {i01 R}.
Let
avg
Source code
( : convex_lmodType R^o) := a <| p |> b.Source code
Let
avg1
Source code
: avg 1%:i01 a b = a.Source code
Proof.
Let
avgI
Source code
: avg p x x = x.Source code
Proof.
Let
avgC
Source code
: avg p x y = avg (1 - (p%:inum))%:i01 y x.Source code
Proof.
Let
avgA
Source code
: convex_quasi_associative avg.Source code
Proof.
.
instance
Source code
Source code
Definition
Source code
Source code
@isConvexSpace
Source code
.Build R R^oSource code
_ avg1 avgI avgC avgA.
End numDomainType_convex_space.
Section conv_numDomainType.
Context { : numDomainType}.
Lemma
convR_gt0
Source code
( : R^o) ( : {i01 R}) : 0 < a -> 0 < b -> 0 < a <| t |> b.Source code
Proof.
Lemma
convRE
Source code
( : R^o) ( : {i01 R}) :Source code
a <| t |> b = t%:inum * a + t%:inum.~ * b.
Proof.
by []. Qed.
Let
convRCE
Source code
( : R^o) ( : {i01 R}) :Source code
a <| t |> b = t%:inum.~ * b + t%:inum * a.
Lemma
convR_line_path
Source code
( : R^o) ( : {i01 R}) :Source code
a <| t |> b = line_path b a t%:num.
Proof.
Lemma
convN
Source code
( : R^o) ( : {i01 R}) : - (a <| t |> b) = - a <| t |> - b.Source code
Lemma
conv_le
Source code
( : R^o) ( : {i01 R}) : a <= b -> a <| t |> b <= b.Source code
Proof.
Lemma
convR_itv
Source code
( : R^o) ( : {i01 R}) : a <= b -> a <| t |> b \in `[a, b].Source code
End conv_numDomainType.
Definition
convex_set
Source code
( : numDomainType) ( : lmodType R)Source code
( : set (convex_lmodType M)) :=
forall
lambda
Source code
, x \in A -> y \in A -> x <| lambda |> y \in A.Source code
Lemma
convex_setW
Source code
( : numDomainType) ( : lmodType R)Source code
( : set (convex_lmodType M)) :
convex_set A <->
{in A &, forall ( : {i01 R}),
0 < k%:num -> k%:num < 1 -> x <| k |> y \in A}.
Proof.
Definition
convex_function
Source code
( : numFieldType) ( : lmodType R)Source code
( := convex_lmodType E) ( : set E') ( : E' -> R^o) :=
forall ( : {i01 R}),
{in D &, forall ( : E'), (f (x <| t |> y) <= f x <| t |> f y)%R}.