:: CONVEX1 semantic presentation

definition
let c1 be non empty RLSStruct ;
let c2 be Subset of c1;
let c3 be Real;
func c3 * c2 -> Subset of a1 equals :: CONVEX1:def 1
{ (a3 * b1) where B is Element of a1 : b1 in a2 } ;
coherence
{ (c3 * b1) where B is Element of c1 : b1 in c2 } is Subset of c1
proof end;
end;

:: deftheorem Def1 defines * CONVEX1:def 1 :
for b1 being non empty RLSStruct
for b2 being Subset of b1
for b3 being Real holds b3 * b2 = { (b3 * b4) where B is Element of b1 : b4 in b2 } ;

definition
let c1 be non empty RLSStruct ;
let c2 be Subset of c1;
attr a2 is convex means :Def2: :: CONVEX1:def 2
for b1, b2 being VECTOR of a1
for b3 being Real st 0 < b3 & b3 < 1 & b1 in a2 & b2 in a2 holds
(b3 * b1) + ((1 - b3) * b2) in a2;
end;

:: deftheorem Def2 defines convex CONVEX1:def 2 :
for b1 being non empty RLSStruct
for b2 being Subset of b1 holds
( b2 is convex iff for b3, b4 being VECTOR of b1
for b5 being Real st 0 < b5 & b5 < 1 & b3 in b2 & b4 in b2 holds
(b5 * b3) + ((1 - b5) * b4) in b2 );

theorem Th1: :: CONVEX1:1
for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being Subset of b1
for b3 being Real st b2 is convex holds
b3 * b2 is convex
proof end;

theorem Th2: :: CONVEX1:2
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2, b3 being Subset of b1 st b2 is convex & b3 is convex holds
b2 + b3 is convex
proof end;

theorem Th3: :: CONVEX1:3
for b1 being RealLinearSpace
for b2, b3 being Subset of b1 st b2 is convex & b3 is convex holds
b2 - b3 is convex
proof end;

theorem Th4: :: CONVEX1:4
for b1 being non empty RLSStruct
for b2 being Subset of b1 holds
( b2 is convex iff for b3 being Real st 0 < b3 & b3 < 1 holds
(b3 * b2) + ((1 - b3) * b2) c= b2 )
proof end;

theorem Th5: :: CONVEX1:5
for b1 being non empty Abelian RLSStruct
for b2 being Subset of b1 st b2 is convex holds
for b3 being Real st 0 < b3 & b3 < 1 holds
((1 - b3) * b2) + (b3 * b2) c= b2
proof end;

theorem Th6: :: CONVEX1:6
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2, b3 being Subset of b1 st b2 is convex & b3 is convex holds
for b4 being Real holds (b4 * b2) + ((1 - b4) * b3) is convex
proof end;

Lemma3: for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being Subset of b1 holds 1 * b2 = b2
proof end;

Lemma4: for b1 being RealLinearSpace
for b2 being non empty Subset of b1 holds 0 * b2 = {(0. b1)}
proof end;

Lemma5: for b1 being non empty add-associative LoopStr
for b2, b3, b4 being Subset of b1 holds (b2 + b3) + b4 = b2 + (b3 + b4)
proof end;

Lemma6: for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being Subset of b1
for b3, b4 being Real holds b3 * (b4 * b2) = (b3 * b4) * b2
proof end;

Lemma7: for b1 being non empty RealLinearSpace-like RLSStruct
for b2, b3 being Subset of b1
for b4 being Real holds b4 * (b2 + b3) = (b4 * b2) + (b4 * b3)
proof end;

theorem Th7: :: CONVEX1:7
for b1 being RealLinearSpace
for b2 being Subset of b1
for b3 being VECTOR of b1 holds
( b2 is convex iff b3 + b2 is convex )
proof end;

theorem Th8: :: CONVEX1:8
for b1 being RealLinearSpace holds Up ((0). b1) is convex
proof end;

theorem Th9: :: CONVEX1:9
for b1 being RealLinearSpace holds Up ((Omega). b1) is convex
proof end;

theorem Th10: :: CONVEX1:10
for b1 being non empty RLSStruct
for b2 being Subset of b1 st b2 = {} holds
b2 is convex
proof end;

theorem Th11: :: CONVEX1:11
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2, b3 being Subset of b1
for b4, b5 being Real st b2 is convex & b3 is convex holds
(b4 * b2) + (b5 * b3) is convex
proof end;

theorem Th12: :: CONVEX1:12
for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being Subset of b1
for b3, b4 being Real holds (b3 + b4) * b2 c= (b3 * b2) + (b4 * b2)
proof end;

Lemma11: for b1 being non empty RLSStruct
for b2, b3 being Subset of b1
for b4 being Real st b2 c= b3 holds
b4 * b2 c= b4 * b3
proof end;

Lemma12: for b1 being non empty RLSStruct
for b2 being empty Subset of b1
for b3 being Real holds b3 * b2 = {}
proof end;

Lemma13: for b1 being non empty LoopStr
for b2 being empty Subset of b1
for b3 being Subset of b1 holds b2 + b3 = {}
proof end;

Lemma14: for b1 being non empty right_zeroed LoopStr
for b2 being Subset of b1 holds b2 + {(0. b1)} = b2
proof end;

Lemma15: for b1 being RealLinearSpace
for b2 being Subset of b1
for b3, b4 being Real st b3 >= 0 & b4 >= 0 & b2 is convex holds
(b3 * b2) + (b4 * b2) c= (b3 + b4) * b2
proof end;

theorem Th13: :: CONVEX1:13
for b1 being RealLinearSpace
for b2 being Subset of b1
for b3, b4 being Real st b3 >= 0 & b4 >= 0 & b2 is convex holds
(b3 * b2) + (b4 * b2) = (b3 + b4) * b2
proof end;

theorem Th14: :: CONVEX1:14
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2, b3, b4 being Subset of b1
for b5, b6, b7 being Real st b2 is convex & b3 is convex & b4 is convex holds
((b5 * b2) + (b6 * b3)) + (b7 * b4) is convex
proof end;

theorem Th15: :: CONVEX1:15
for b1 being non empty RLSStruct
for b2 being Subset-Family of b1 st ( for b3 being Subset of b1 st b3 in b2 holds
b3 is convex ) holds
meet b2 is convex
proof end;

theorem Th16: :: CONVEX1:16
for b1 being non empty RLSStruct
for b2 being Subset of b1 st b2 is Affine holds
b2 is convex
proof end;

registration
let c1 be non empty RLSStruct ;
cluster non empty convex Element of K40(the carrier of a1);
existence
ex b1 being Subset of c1 st
( not b1 is empty & b1 is convex )
proof end;
end;

registration
let c1 be non empty RLSStruct ;
cluster empty convex Element of K40(the carrier of a1);
existence
ex b1 being Subset of c1 st
( b1 is empty & b1 is convex )
proof end;
end;

theorem Th17: :: CONVEX1:17
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being VECTOR of b1
for b4 being Real st b2 = { b5 where B is VECTOR of b1 : b5 .|. b3 >= b4 } holds
b2 is convex
proof end;

theorem Th18: :: CONVEX1:18
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being VECTOR of b1
for b4 being Real st b2 = { b5 where B is VECTOR of b1 : b5 .|. b3 > b4 } holds
b2 is convex
proof end;

theorem Th19: :: CONVEX1:19
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being VECTOR of b1
for b4 being Real st b2 = { b5 where B is VECTOR of b1 : b5 .|. b3 <= b4 } holds
b2 is convex
proof end;

theorem Th20: :: CONVEX1:20
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being VECTOR of b1
for b4 being Real st b2 = { b5 where B is VECTOR of b1 : b5 .|. b3 < b4 } holds
b2 is convex
proof end;

definition
let c1 be RealLinearSpace;
let c2 be Linear_Combination of c1;
attr a2 is convex means :Def3: :: CONVEX1:def 3
ex b1 being FinSequence of the carrier of a1 st
( b1 is one-to-one & rng b1 = Carrier a2 & ex b2 being FinSequence of REAL st
( len b2 = len b1 & Sum b2 = 1 & ( for b3 being Nat st b3 in dom b2 holds
( b2 . b3 = a2 . (b1 . b3) & b2 . b3 >= 0 ) ) ) );
end;

:: deftheorem Def3 defines convex CONVEX1:def 3 :
for b1 being RealLinearSpace
for b2 being Linear_Combination of b1 holds
( b2 is convex iff ex b3 being FinSequence of the carrier of b1 st
( b3 is one-to-one & rng b3 = Carrier b2 & ex b4 being FinSequence of REAL st
( len b4 = len b3 & Sum b4 = 1 & ( for b5 being Nat st b5 in dom b4 holds
( b4 . b5 = b2 . (b3 . b5) & b4 . b5 >= 0 ) ) ) ) );

theorem Th21: :: CONVEX1:21
for b1 being RealLinearSpace
for b2 being Linear_Combination of b1 st b2 is convex holds
Carrier b2 <> {}
proof end;

theorem Th22: :: CONVEX1:22
for b1 being RealLinearSpace
for b2 being Linear_Combination of b1
for b3 being VECTOR of b1 st b2 is convex & b2 . b3 <= 0 holds
not b3 in Carrier b2
proof end;

theorem Th23: :: CONVEX1:23
for b1 being RealLinearSpace
for b2 being Linear_Combination of b1 st b2 is convex holds
b2 <> ZeroLC b1
proof end;

Lemma20: for b1 being RealLinearSpace
for b2 being VECTOR of b1
for b3 being Linear_Combination of b1 st b3 is convex & Carrier b3 = {b2} holds
( b3 . b2 = 1 & Sum b3 = (b3 . b2) * b2 )
proof end;

Lemma21: for b1 being RealLinearSpace
for b2, b3 being VECTOR of b1
for b4 being Linear_Combination of b1 st b4 is convex & Carrier b4 = {b2,b3} & b2 <> b3 holds
( (b4 . b2) + (b4 . b3) = 1 & b4 . b2 >= 0 & b4 . b3 >= 0 & Sum b4 = ((b4 . b2) * b2) + ((b4 . b3) * b3) )
proof end;

Lemma22: for b1 being FinSequence
for b2, b3, b4 being set st b1 is one-to-one & rng b1 = {b2,b3,b4} & b2 <> b3 & b3 <> b4 & b4 <> b2 & not b1 = <*b2,b3,b4*> & not b1 = <*b2,b4,b3*> & not b1 = <*b3,b2,b4*> & not b1 = <*b3,b4,b2*> & not b1 = <*b4,b2,b3*> holds
b1 = <*b4,b3,b2*>
proof end;

Lemma23: for b1 being RealLinearSpace
for b2, b3, b4 being VECTOR of b1
for b5 being Linear_Combination of {b2,b3,b4} st b2 <> b3 & b3 <> b4 & b4 <> b2 holds
Sum b5 = (((b5 . b2) * b2) + ((b5 . b3) * b3)) + ((b5 . b4) * b4)
proof end;

Lemma24: for b1 being RealLinearSpace
for b2, b3, b4 being VECTOR of b1
for b5 being Linear_Combination of b1 st b5 is convex & Carrier b5 = {b2,b3,b4} & b2 <> b3 & b3 <> b4 & b4 <> b2 holds
( ((b5 . b2) + (b5 . b3)) + (b5 . b4) = 1 & b5 . b2 >= 0 & b5 . b3 >= 0 & b5 . b4 >= 0 & Sum b5 = (((b5 . b2) * b2) + ((b5 . b3) * b3)) + ((b5 . b4) * b4) )
proof end;

theorem Th24: :: CONVEX1:24
for b1 being RealLinearSpace
for b2 being VECTOR of b1
for b3 being Linear_Combination of {b2} st b3 is convex holds
( b3 . b2 = 1 & Sum b3 = (b3 . b2) * b2 )
proof end;

theorem Th25: :: CONVEX1:25
for b1 being RealLinearSpace
for b2, b3 being VECTOR of b1
for b4 being Linear_Combination of {b2,b3} st b2 <> b3 & b4 is convex holds
( (b4 . b2) + (b4 . b3) = 1 & b4 . b2 >= 0 & b4 . b3 >= 0 & Sum b4 = ((b4 . b2) * b2) + ((b4 . b3) * b3) )
proof end;

theorem Th26: :: CONVEX1:26
for b1 being RealLinearSpace
for b2, b3, b4 being VECTOR of b1
for b5 being Linear_Combination of {b2,b3,b4} st b2 <> b3 & b3 <> b4 & b4 <> b2 & b5 is convex holds
( ((b5 . b2) + (b5 . b3)) + (b5 . b4) = 1 & b5 . b2 >= 0 & b5 . b3 >= 0 & b5 . b4 >= 0 & Sum b5 = (((b5 . b2) * b2) + ((b5 . b3) * b3)) + ((b5 . b4) * b4) )
proof end;

theorem Th27: :: CONVEX1:27
for b1 being RealLinearSpace
for b2 being VECTOR of b1
for b3 being Linear_Combination of b1 st b3 is convex & Carrier b3 = {b2} holds
b3 . b2 = 1 by Lemma20;

theorem Th28: :: CONVEX1:28
for b1 being RealLinearSpace
for b2, b3 being VECTOR of b1
for b4 being Linear_Combination of b1 st b4 is convex & Carrier b4 = {b2,b3} & b2 <> b3 holds
( (b4 . b2) + (b4 . b3) = 1 & b4 . b2 >= 0 & b4 . b3 >= 0 ) by Lemma21;

theorem Th29: :: CONVEX1:29
for b1 being RealLinearSpace
for b2, b3, b4 being VECTOR of b1
for b5 being Linear_Combination of b1 st b5 is convex & Carrier b5 = {b2,b3,b4} & b2 <> b3 & b3 <> b4 & b4 <> b2 holds
( ((b5 . b2) + (b5 . b3)) + (b5 . b4) = 1 & b5 . b2 >= 0 & b5 . b3 >= 0 & b5 . b4 >= 0 & Sum b5 = (((b5 . b2) * b2) + ((b5 . b3) * b3)) + ((b5 . b4) * b4) ) by Lemma24;

definition
let c1 be non empty RLSStruct ;
let c2 be Subset of c1;
func Convex-Family c2 -> Subset-Family of a1 means :Def4: :: CONVEX1:def 4
for b1 being Subset of a1 holds
( b1 in a3 iff ( b1 is convex & a2 c= b1 ) );
existence
ex b1 being Subset-Family of c1 st
for b2 being Subset of c1 holds
( b2 in b1 iff ( b2 is convex & c2 c= b2 ) )
proof end;
uniqueness
for b1, b2 being Subset-Family of c1 st ( for b3 being Subset of c1 holds
( b3 in b1 iff ( b3 is convex & c2 c= b3 ) ) ) & ( for b3 being Subset of c1 holds
( b3 in b2 iff ( b3 is convex & c2 c= b3 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines Convex-Family CONVEX1:def 4 :
for b1 being non empty RLSStruct
for b2 being Subset of b1
for b3 being Subset-Family of b1 holds
( b3 = Convex-Family b2 iff for b4 being Subset of b1 holds
( b4 in b3 iff ( b4 is convex & b2 c= b4 ) ) );

definition
let c1 be non empty RLSStruct ;
let c2 be Subset of c1;
func conv c2 -> convex Subset of a1 equals :: CONVEX1:def 5
meet (Convex-Family a2);
coherence
meet (Convex-Family c2) is convex Subset of c1
proof end;
end;

:: deftheorem Def5 defines conv CONVEX1:def 5 :
for b1 being non empty RLSStruct
for b2 being Subset of b1 holds conv b2 = meet (Convex-Family b2);

theorem Th30: :: CONVEX1:30
for b1 being non empty RLSStruct
for b2 being Subset of b1
for b3 being convex Subset of b1 st b2 c= b3 holds
conv b2 c= b3
proof end;

theorem Th31: :: CONVEX1:31
for b1 being FinSequence
for b2, b3, b4 being set st b1 is one-to-one & rng b1 = {b2,b3,b4} & b2 <> b3 & b3 <> b4 & b4 <> b2 & not b1 = <*b2,b3,b4*> & not b1 = <*b2,b4,b3*> & not b1 = <*b3,b2,b4*> & not b1 = <*b3,b4,b2*> & not b1 = <*b4,b2,b3*> holds
b1 = <*b4,b3,b2*> by Lemma22;

theorem Th32: :: CONVEX1:32
for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being Subset of b1 holds 1 * b2 = b2 by Lemma3;

theorem Th33: :: CONVEX1:33
for b1 being non empty RLSStruct
for b2 being empty Subset of b1
for b3 being Real holds b3 * b2 = {} by Lemma12;

theorem Th34: :: CONVEX1:34
for b1 being RealLinearSpace
for b2 being non empty Subset of b1 holds 0 * b2 = {(0. b1)} by Lemma4;

theorem Th35: :: CONVEX1:35
for b1 being non empty right_zeroed LoopStr
for b2 being Subset of b1 holds b2 + {(0. b1)} = b2 by Lemma14;

theorem Th36: :: CONVEX1:36
for b1 being non empty add-associative LoopStr
for b2, b3, b4 being Subset of b1 holds (b2 + b3) + b4 = b2 + (b3 + b4) by Lemma5;

theorem Th37: :: CONVEX1:37
for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being Subset of b1
for b3, b4 being Real holds b3 * (b4 * b2) = (b3 * b4) * b2 by Lemma6;

theorem Th38: :: CONVEX1:38
for b1 being non empty RealLinearSpace-like RLSStruct
for b2, b3 being Subset of b1
for b4 being Real holds b4 * (b2 + b3) = (b4 * b2) + (b4 * b3) by Lemma7;

theorem Th39: :: CONVEX1:39
for b1 being non empty RLSStruct
for b2, b3 being Subset of b1
for b4 being Real st b2 c= b3 holds
b4 * b2 c= b4 * b3 by Lemma11;

theorem Th40: :: CONVEX1:40
for b1 being non empty LoopStr
for b2 being empty Subset of b1
for b3 being Subset of b1 holds b2 + b3 = {} by Lemma13;