Module mathcomp.analysis.convex
From HB Require Import structures.From mathcomp Require Import all_ssreflect_compat 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.
Reserved Notation "x <| p |> y" (format "x <| p |> y", at level 49).
Set 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.
Section def.
Variables (R : numDomainType) (T : Type) (conv : {i01 R} -> T -> T -> T).
Local Notation "x <| p |> y" := (conv p x y).
Definition
ConvexQuasiAssoc.law : forall [R : numDomainType] [T : Type], ({i01 R} -> T -> T -> T) -> Prop ConvexQuasiAssoc.law is not universe polymorphic Arguments ConvexQuasiAssoc.law [R] [T]%_type_scope conv%_function_scope ConvexQuasiAssoc.law is transparent Expands to: Constant mathcomp.analysis.convex.ConvexQuasiAssoc.law Declared in library mathcomp.analysis.convex, line 61, characters 11-14
p%:num = r%:num * s%:num ->
s%:num.~ = p%:num.~ * q%:num.~ ->
a <| p |> (b <| q |> c) = (a <| r |> b) <| s |> c.
End def.
Lemma pq_sr (R : comPzRingType) (p q r s : R) :
p = r * s ->
1 - s = (1 - p) * (1 - q) ->
(1 - p) * q = s * (1 - r).
Proof.
Lemma sE (R : pzRingType) (p q s : R) :
1 - s = (1 - p) * (1 - q) ->
s = 1 - (1 - p) * (1 - q).
Lemma qE (R : comUnitRingType) (p q r s : R) :
1 - p \is a GRing.unit ->
p = r * s ->
1 - s = (1 - p) * (1 - q) ->
q = (s * (1 - r)) / (1 - p).
Lemma rE (R : unitRingType) (p r s : R) :
s \is a GRing.unit -> p = r * s -> r = p / s.
End lemmas.
End ConvexQuasiAssoc.
Definition
convex_quasi_associative : forall [R : numDomainType] [T : Type], ({i01 R} -> T -> T -> T) -> Prop convex_quasi_associative is not universe polymorphic Arguments convex_quasi_associative [R] [T]%_type_scope conv%_function_scope convex_quasi_associative is transparent Expands to: Constant mathcomp.analysis.convex.convex_quasi_associative Declared in library mathcomp.analysis.convex, line 101, characters 11-35
HB.mixin Record isConvexSpace (R : numDomainType) T := {
conv : {i01 R} -> T -> T -> T ;
conv1 : forall a b, conv 1%:i01 a b = a ;
convmm : forall (p : {i01 R}) a, conv p a a = a ;
convC : forall (p : {i01 R}) a b, conv p a b = conv (1 - p%:inum)%:i01 b a;
convA : convex_quasi_associative conv
}.
#[short(type=convType)]
HB.structure Definition ConvexSpace (R : numDomainType) :=
{T of isConvexSpace R T & Choice T}.
Notation "a <| p |> b" := (conv p a b) : convex_scope.
Section convex_space_lemmas.
Context R (A : convType R).
Implicit Types a b : A.
Lemma conv0 a b : a <| 0%:i01 |> b = b.
Proof.
End convex_space_lemmas.
Local Open Scope convex_scope.
Definition
convex_lmodType : forall {R : numDomainType}, lmodType R -> Type convex_lmodType is not universe polymorphic Arguments convex_lmodType {R} E convex_lmodType is transparent Expands to: Constant mathcomp.analysis.convex.convex_lmodType Declared in library mathcomp.analysis.convex, line 131, characters 11-26
Section lmodType_convex_space.
Context {R : numDomainType} {E' : lmodType R}.
Implicit Type p q r : {i01 R}.
Let E := convex_lmodType E'.
Let avg p (a b : E) := p%:inum *: a + p%:inum.~ *: b.
Let avg1 a b : avg 1%:i01 a b = a.
Let avgI p x : avg p x x = x.
Let avgC p x y : avg p x y = avg (1 - (p%:inum))%:i01 y x.
Let avgA : convex_quasi_associative avg.
Proof.
HB.instance Definition _ := Choice.on E.
HB.instance Definition _ :=
isConvexSpace.Build R E avg1 avgI avgC avgA.
End lmodType_convex_space.
Definition
convex_numDomainType : numDomainType -> Type convex_numDomainType is not universe polymorphic Arguments convex_numDomainType R convex_numDomainType is transparent Expands to: Constant mathcomp.analysis.convex.convex_numDomainType Declared in library mathcomp.analysis.convex, line 166, characters 11-31
Section numDomainType_convex_space.
Context {R : numDomainType}.
Implicit Types p q : {i01 R}.
Let avg p (a b : convex_lmodType R^o) := a <| p |> b.
Let avg1 a b : avg 1%:i01 a b = a.
Proof.
Let avgI p x : avg p x x = x.
Proof.
Let avgC p x y : avg p x y = avg (1 - (p%:inum))%:i01 y x.
Proof.
Let avgA : convex_quasi_associative avg.
Proof.
HB.instance Definition _ := @isConvexSpace.Build R R^o
_ avg1 avgI avgC avgA.
End numDomainType_convex_space.
Section conv_numDomainType.
Context {R : numDomainType}.
Lemma convR_gt0 (a b : R^o) (t : {i01 R}) : 0 < a -> 0 < b -> 0 < a <| t |> b.
Proof.
Lemma convRE (a b : R^o) (t : {i01 R}) :
a <| t |> b = t%:inum * a + t%:inum.~ * b.
Proof.
Let convRCE (a b : R^o) (t : {i01 R}) :
a <| t |> b = t%:inum.~ * b + t%:inum * a.
Lemma convR_line_path (a b : R^o) (t : {i01 R}) :
a <| t |> b = line_path b a t%:num.
Proof.
Lemma convN (a b : R^o) (t : {i01 R}) : - (a <| t |> b) = - a <| t |> - b.
Lemma conv_le (a b : R^o) (t : {i01 R}) : a <= b -> a <| t |> b <= b.
Proof.
Lemma convR_itv (a b : R^o) (t : {i01 R}) : a <= b -> a <| t |> b \in `[a, b].
End conv_numDomainType.
Definition
convex_set : forall [R : numDomainType] [M : lmodType R], set (convex_lmodType M) -> Prop convex_set is not universe polymorphic Arguments convex_set [R M] A%_classical_set_scope convex_set is transparent Expands to: Constant mathcomp.analysis.convex.convex_set Declared in library mathcomp.analysis.convex, line 229, characters 11-21
(A : set (convex_lmodType M)) :=
forall x y lambda, x \in A -> y \in A -> x <| lambda |> y \in A.
Lemma convex_setW (R : numDomainType) (M : lmodType R)
(A : set (convex_lmodType M)) :
convex_set A <->
{in A &, forall x y (k : {i01 R}),
0 < k%:num -> k%:num < 1 -> x <| k |> y \in A}.
Proof.
Definition
convex_function : forall [R : numFieldType] [E : lmodType R], set (convex_lmodType E) -> (convex_lmodType E -> R^o) -> Prop convex_function is not universe polymorphic Arguments convex_function [R E] D%_classical_set_scope f%_function_scope convex_function is transparent Expands to: Constant mathcomp.analysis.convex.convex_function Declared in library mathcomp.analysis.convex, line 248, characters 11-26
(E' := convex_lmodType E) (D : set E') (f : E' -> R^o) :=
forall (t : {i01 R}),
{in D &, forall (x y : E'), (f (x <| t |> y) <= f x <| t |> f y)%R}.