:: CONVEX2 semantic presentation

theorem Th1: :: CONVEX2:1
for b1 being non empty RLSStruct
for b2, b3 being convex Subset of b1 holds b2 /\ b3 is convex
proof end;

theorem Th2: :: CONVEX2:2
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being FinSequence of the carrier of b1
for b4 being FinSequence of REAL st b2 = { b5 where B is VECTOR of b1 : for b1 being Nat st b6 in (dom b3) /\ (dom b4) holds
ex b2 being VECTOR of b1 st
( b7 = b3 . b6 & b5 .|. b7 <= b4 . b6 )
}
holds
b2 is convex
proof end;

theorem Th3: :: CONVEX2:3
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being FinSequence of the carrier of b1
for b4 being FinSequence of REAL st b2 = { b5 where B is VECTOR of b1 : for b1 being Nat st b6 in (dom b3) /\ (dom b4) holds
ex b2 being VECTOR of b1 st
( b7 = b3 . b6 & b5 .|. b7 < b4 . b6 )
}
holds
b2 is convex
proof end;

theorem Th4: :: CONVEX2:4
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being FinSequence of the carrier of b1
for b4 being FinSequence of REAL st b2 = { b5 where B is VECTOR of b1 : for b1 being Nat st b6 in (dom b3) /\ (dom b4) holds
ex b2 being VECTOR of b1 st
( b7 = b3 . b6 & b5 .|. b7 >= b4 . b6 )
}
holds
b2 is convex
proof end;

theorem Th5: :: CONVEX2:5
for b1 being non empty RealUnitarySpace-like UNITSTR
for b2 being Subset of b1
for b3 being FinSequence of the carrier of b1
for b4 being FinSequence of REAL st b2 = { b5 where B is VECTOR of b1 : for b1 being Nat st b6 in (dom b3) /\ (dom b4) holds
ex b2 being VECTOR of b1 st
( b7 = b3 . b6 & b5 .|. b7 > b4 . b6 )
}
holds
b2 is convex
proof end;

Lemma1: for b1 being RealLinearSpace
for b2 being convex Subset of b1
for b3 being Subset of b1
for b4 being Linear_Combination of b3 st b4 is convex & b3 c= b2 holds
Sum b4 in b2
proof end;

Lemma2: for b1 being RealLinearSpace
for b2 being Subset of b1 st ( for b3 being Subset of b1
for b4 being Linear_Combination of b3 st b4 is convex & b3 c= b2 holds
Sum b4 in b2 ) holds
b2 is convex
proof end;

theorem Th6: :: CONVEX2:6
for b1 being RealLinearSpace
for b2 being Subset of b1 holds
( ( for b3 being Subset of b1
for b4 being Linear_Combination of b3 st b4 is convex & b3 c= b2 holds
Sum b4 in b2 ) iff b2 is convex ) by Lemma1, Lemma2;

definition
let c1 be RealLinearSpace;
let c2 be Subset of c1;
defpred S1[ set ] means a1 is Linear_Combination of c2;
func LinComb c2 -> set means :: CONVEX2:def 1
for b1 being set holds
( b1 in a3 iff b1 is Linear_Combination of a2 );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff b2 is Linear_Combination of c2 )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff b3 is Linear_Combination of c2 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 is Linear_Combination of c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines LinComb CONVEX2:def 1 :
for b1 being RealLinearSpace
for b2 being Subset of b1
for b3 being set holds
( b3 = LinComb b2 iff for b4 being set holds
( b4 in b3 iff b4 is Linear_Combination of b2 ) );

Lemma3: for b1 being RealLinearSpace ex b2 being Linear_Combination of b1 st b2 is convex
proof end;

registration
let c1 be RealLinearSpace;
cluster convex Linear_Combination of a1;
existence
ex b1 being Linear_Combination of c1 st b1 is convex
by Lemma3;
end;

definition
let c1 be RealLinearSpace;
mode Convex_Combination of a1 is convex Linear_Combination of a1;
end;

Lemma4: for b1 being RealLinearSpace
for b2 being non empty Subset of b1 ex b3 being Linear_Combination of b2 st b3 is convex
proof end;

registration
let c1 be RealLinearSpace;
let c2 be non empty Subset of c1;
cluster convex Linear_Combination of a2;
existence
ex b1 being Linear_Combination of c2 st b1 is convex
by Lemma4;
end;

definition
let c1 be RealLinearSpace;
let c2 be non empty Subset of c1;
mode Convex_Combination of a2 is convex Linear_Combination of a2;
end;

Lemma5: for b1 being RealLinearSpace
for b2, b3 being Subspace of b1 holds Up (b2 + b3) = (Up b2) + (Up b3)
proof end;

Lemma6: for b1 being RealLinearSpace
for b2, b3 being Subspace of b1 holds Up (b2 /\ b3) = (Up b2) /\ (Up b3)
proof end;

theorem Th7: :: CONVEX2:7
for b1 being RealLinearSpace
for b2 being Subset of b1 holds Convex-Family b2 <> {}
proof end;

theorem Th8: :: CONVEX2:8
for b1 being RealLinearSpace
for b2 being Subset of b1 holds b2 c= conv b2
proof end;

Lemma8: for b1 being RealLinearSpace
for b2, b3 being Convex_Combination of b1
for b4, b5 being Real st b4 * b5 > 0 holds
Carrier ((b4 * b2) + (b5 * b3)) = (Carrier (b4 * b2)) \/ (Carrier (b5 * b3))
proof end;

Lemma9: for b1, b2 being Function st b1,b2 are_fiberwise_equipotent holds
for b3, b4 being set st b3 in dom b1 & b4 in dom b1 & b3 <> b4 holds
ex b5, b6 being set st
( b5 in dom b2 & b6 in dom b2 & b5 <> b6 & b1 . b3 = b2 . b5 & b1 . b4 = b2 . b6 )
proof end;

Lemma10: for b1 being RealLinearSpace
for b2 being Linear_Combination of b1
for b3 being Subset of b1 st b3 c= Carrier b2 holds
ex b4 being Linear_Combination of b1 st Carrier b4 = b3
proof end;

theorem Th9: :: CONVEX2:9
for b1 being RealLinearSpace
for b2, b3 being Convex_Combination of b1
for b4 being Real st 0 < b4 & b4 < 1 holds
(b4 * b2) + ((1 - b4) * b3) is Convex_Combination of b1
proof end;

theorem Th10: :: CONVEX2:10
for b1 being RealLinearSpace
for b2 being non empty Subset of b1
for b3, b4 being Convex_Combination of b2
for b5 being Real st 0 < b5 & b5 < 1 holds
(b5 * b3) + ((1 - b5) * b4) is Convex_Combination of b2
proof end;

theorem Th11: :: CONVEX2:11
for b1 being RealLinearSpace ex b2 being Linear_Combination of b1 st b2 is convex by Lemma3;

theorem Th12: :: CONVEX2:12
for b1 being RealLinearSpace
for b2 being non empty Subset of b1 ex b3 being Linear_Combination of b2 st b3 is convex by Lemma4;

theorem Th13: :: CONVEX2:13
for b1 being RealLinearSpace
for b2, b3 being Subspace of b1 holds Up (b2 + b3) = (Up b2) + (Up b3) by Lemma5;

theorem Th14: :: CONVEX2:14
for b1 being RealLinearSpace
for b2, b3 being Subspace of b1 holds Up (b2 /\ b3) = (Up b2) /\ (Up b3) by Lemma6;

theorem Th15: :: CONVEX2:15
for b1 being RealLinearSpace
for b2, b3 being Convex_Combination of b1
for b4, b5 being Real st b4 * b5 > 0 holds
Carrier ((b4 * b2) + (b5 * b3)) = (Carrier (b4 * b2)) \/ (Carrier (b5 * b3)) by Lemma8;

theorem Th16: :: CONVEX2:16
for b1, b2 being Function st b1,b2 are_fiberwise_equipotent holds
for b3, b4 being set st b3 in dom b1 & b4 in dom b1 & b3 <> b4 holds
ex b5, b6 being set st
( b5 in dom b2 & b6 in dom b2 & b5 <> b6 & b1 . b3 = b2 . b5 & b1 . b4 = b2 . b6 ) by Lemma9;

theorem Th17: :: CONVEX2:17
for b1 being RealLinearSpace
for b2 being Linear_Combination of b1
for b3 being Subset of b1 st b3 c= Carrier b2 holds
ex b4 being Linear_Combination of b1 st Carrier b4 = b3 by Lemma10;