:: RFUNCT_3 semantic presentation

definition
let c1, c2 be Nat;
redefine func min as min c1,c2 -> Nat;
coherence
min c1,c2 is Nat
by FINSEQ_2:1;
end;

definition
let c1 be real number ;
func max+ c1 -> Real equals :: RFUNCT_3:def 1
max a1,0;
correctness
coherence
max c1,0 is Real
;
by XREAL_0:def 1;
func max- c1 -> Real equals :: RFUNCT_3:def 2
max (- a1),0;
correctness
coherence
max (- c1),0 is Real
;
by XREAL_0:def 1;
end;

:: deftheorem Def1 defines max+ RFUNCT_3:def 1 :
for b1 being real number holds max+ b1 = max b1,0;

:: deftheorem Def2 defines max- RFUNCT_3:def 2 :
for b1 being real number holds max- b1 = max (- b1),0;

theorem Th1: :: RFUNCT_3:1
for b1 being real number holds b1 = (max+ b1) - (max- b1)
proof end;

theorem Th2: :: RFUNCT_3:2
for b1 being real number holds abs b1 = (max+ b1) + (max- b1)
proof end;

theorem Th3: :: RFUNCT_3:3
for b1 being real number holds 2 * (max+ b1) = b1 + (abs b1)
proof end;

theorem Th4: :: RFUNCT_3:4
for b1, b2 being real number st 0 <= b1 holds
max+ (b1 * b2) = b1 * (max+ b2)
proof end;

theorem Th5: :: RFUNCT_3:5
for b1, b2 being real number holds max+ (b1 + b2) <= (max+ b1) + (max+ b2)
proof end;

theorem Th6: :: RFUNCT_3:6
for b1 being real number holds
( 0 <= max+ b1 & 0 <= max- b1 ) by SQUARE_1:46;

theorem Th7: :: RFUNCT_3:7
for b1, b2, b3, b4 being real number st b1 <= b3 & b2 <= b4 holds
max b1,b2 <= max b3,b4
proof end;

Lemma7: for b1 being Nat
for b2 being non empty set
for b3 being FinSequence of b2 st len b3 <= b1 holds
b3 | b1 = b3
proof end;

Lemma8: for b1 being Function
for b2 being set st not b2 in rng b1 holds
b1 " {b2} = {}
proof end;

theorem Th8: :: RFUNCT_3:8
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being real number st b3 <> 0 holds
b2 " {(b4 / b3)} = (b3 (#) b2) " {b4}
proof end;

theorem Th9: :: RFUNCT_3:9
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds (0 (#) b2) " {0} = dom b2
proof end;

theorem Th10: :: RFUNCT_3:10
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real st 0 < b3 holds
(abs b2) " {b3} = b2 " {(- b3),b3}
proof end;

theorem Th11: :: RFUNCT_3:11
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds (abs b2) " {0} = b2 " {0}
proof end;

theorem Th12: :: RFUNCT_3:12
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real st b3 < 0 holds
(abs b2) " {b3} = {}
proof end;

theorem Th13: :: RFUNCT_3:13
for b1, b2 being non empty set
for b3 being PartFunc of b1, REAL
for b4 being PartFunc of b2, REAL
for b5 being Real st b5 <> 0 holds
( b3,b4 are_fiberwise_equipotent iff b5 (#) b3,b5 (#) b4 are_fiberwise_equipotent )
proof end;

theorem Th14: :: RFUNCT_3:14
for b1, b2 being non empty set
for b3 being PartFunc of b1, REAL
for b4 being PartFunc of b2, REAL holds
( b3,b4 are_fiberwise_equipotent iff - b3, - b4 are_fiberwise_equipotent )
proof end;

theorem Th15: :: RFUNCT_3:15
for b1, b2 being non empty set
for b3 being PartFunc of b1, REAL
for b4 being PartFunc of b2, REAL st b3,b4 are_fiberwise_equipotent holds
abs b3, abs b4 are_fiberwise_equipotent
proof end;

definition
let c1, c2 be set ;
mode PartFunc-set of c1,c2 -> set means :Def3: :: RFUNCT_3:def 3
for b1 being Element of a3 holds b1 is PartFunc of a1,a2;
existence
ex b1 being set st
for b2 being Element of b1 holds b2 is PartFunc of c1,c2
proof end;
end;

:: deftheorem Def3 defines PartFunc-set RFUNCT_3:def 3 :
for b1, b2 being set
for b3 being set holds
( b3 is PartFunc-set of b1,b2 iff for b4 being Element of b3 holds b4 is PartFunc of b1,b2 );

registration
let c1, c2 be set ;
cluster non empty PartFunc-set of a1,a2;
existence
not for b1 being PartFunc-set of c1,c2 holds b1 is empty
proof end;
end;

definition
let c1, c2 be set ;
mode PFUNC_DOMAIN of a1,a2 is non empty PartFunc-set of a1,a2;
end;

definition
let c1, c2 be set ;
redefine func PFuncs as PFuncs c1,c2 -> PartFunc-set of a1,a2;
coherence
PFuncs c1,c2 is PartFunc-set of c1,c2
proof end;
let c3 be non empty PartFunc-set of c1,c2;
redefine mode Element as Element of c3 -> PartFunc of a1,a2;
coherence
for b1 being Element of c3 holds b1 is PartFunc of c1,c2
by Def3;
end;

definition
let c1, c2 be non empty set ;
let c3 be Subset of c1;
let c4 be Element of c2;
redefine func --> as c3 --> c4 -> Element of PFuncs a1,a2;
coherence
c3 --> c4 is Element of PFuncs c1,c2
proof end;
end;

definition
let c1 be non empty set ;
let c2 be real-membered set ;
let c3, c4 be Element of PFuncs c1,c2;
redefine func + as c3 + c4 -> Element of PFuncs a1,REAL ;
coherence
c3 + c4 is Element of PFuncs c1,REAL
proof end;
redefine func - as c3 - c4 -> Element of PFuncs a1,REAL ;
coherence
c3 - c4 is Element of PFuncs c1,REAL
proof end;
redefine func (#) as c3 (#) c4 -> Element of PFuncs a1,REAL ;
coherence
c3 (#) c4 is Element of PFuncs c1,REAL
proof end;
redefine func / as c3 / c4 -> Element of PFuncs a1,REAL ;
coherence
c3 / c4 is Element of PFuncs c1,REAL
proof end;
end;

definition
let c1 be non empty set ;
let c2 be real-membered set ;
let c3 be Element of PFuncs c1,c2;
redefine func abs as abs c3 -> Element of PFuncs a1,REAL ;
coherence
abs c3 is Element of PFuncs c1,REAL
proof end;
redefine func - as - c3 -> Element of PFuncs a1,REAL ;
coherence
- c3 is Element of PFuncs c1,REAL
proof end;
redefine func ^ as c3 ^ -> Element of PFuncs a1,REAL ;
coherence
c3 ^ is Element of PFuncs c1,REAL
proof end;
end;

definition
let c1 be non empty set ;
let c2 be real-membered set ;
let c3 be Element of PFuncs c1,c2;
let c4 be real number ;
redefine func (#) as c4 (#) c3 -> Element of PFuncs a1,REAL ;
coherence
c4 (#) c3 is Element of PFuncs c1,REAL
proof end;
end;

definition
let c1 be non empty set ;
func addpfunc c1 -> BinOp of PFuncs a1,REAL means :Def4: :: RFUNCT_3:def 4
for b1, b2 being Element of PFuncs a1,REAL holds a2 . b1,b2 = b1 + b2;
existence
ex b1 being BinOp of PFuncs c1,REAL st
for b2, b3 being Element of PFuncs c1,REAL holds b1 . b2,b3 = b2 + b3
proof end;
uniqueness
for b1, b2 being BinOp of PFuncs c1,REAL st ( for b3, b4 being Element of PFuncs c1,REAL holds b1 . b3,b4 = b3 + b4 ) & ( for b3, b4 being Element of PFuncs c1,REAL holds b2 . b3,b4 = b3 + b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines addpfunc RFUNCT_3:def 4 :
for b1 being non empty set
for b2 being BinOp of PFuncs b1,REAL holds
( b2 = addpfunc b1 iff for b3, b4 being Element of PFuncs b1,REAL holds b2 . b3,b4 = b3 + b4 );

theorem Th16: :: RFUNCT_3:16
for b1 being non empty set holds addpfunc b1 is commutative
proof end;

theorem Th17: :: RFUNCT_3:17
for b1 being non empty set holds addpfunc b1 is associative
proof end;

theorem Th18: :: RFUNCT_3:18
for b1 being non empty set holds ([#] b1) --> 0 is_a_unity_wrt addpfunc b1
proof end;

theorem Th19: :: RFUNCT_3:19
for b1 being non empty set holds the_unity_wrt (addpfunc b1) = ([#] b1) --> 0
proof end;

theorem Th20: :: RFUNCT_3:20
for b1 being non empty set holds addpfunc b1 has_a_unity
proof end;

definition
let c1 be non empty set ;
let c2 be FinSequence of PFuncs c1,REAL ;
func Sum c2 -> Element of PFuncs a1,REAL equals :: RFUNCT_3:def 5
(addpfunc a1) $$ a2;
correctness
coherence
(addpfunc c1) $$ c2 is Element of PFuncs c1,REAL
;
;
end;

:: deftheorem Def5 defines Sum RFUNCT_3:def 5 :
for b1 being non empty set
for b2 being FinSequence of PFuncs b1,REAL holds Sum b2 = (addpfunc b1) $$ b2;

theorem Th21: :: RFUNCT_3:21
for b1 being non empty set holds Sum (<*> (PFuncs b1,REAL )) = ([#] b1) --> 0
proof end;

theorem Th22: :: RFUNCT_3:22
for b1 being non empty set
for b2 being Element of PFuncs b1,REAL holds Sum <*b2*> = b2 by FINSOP_1:12;

theorem Th23: :: RFUNCT_3:23
for b1 being non empty set
for b2 being FinSequence of PFuncs b1,REAL
for b3 being Element of PFuncs b1,REAL holds Sum (b2 ^ <*b3*>) = (Sum b2) + b3
proof end;

theorem Th24: :: RFUNCT_3:24
for b1 being non empty set
for b2, b3 being FinSequence of PFuncs b1,REAL holds Sum (b2 ^ b3) = (Sum b2) + (Sum b3)
proof end;

theorem Th25: :: RFUNCT_3:25
for b1 being non empty set
for b2 being FinSequence of PFuncs b1,REAL
for b3 being Element of PFuncs b1,REAL holds Sum (<*b3*> ^ b2) = b3 + (Sum b2)
proof end;

theorem Th26: :: RFUNCT_3:26
for b1 being non empty set
for b2, b3 being Element of PFuncs b1,REAL holds Sum <*b2,b3*> = b2 + b3
proof end;

theorem Th27: :: RFUNCT_3:27
for b1 being non empty set
for b2, b3, b4 being Element of PFuncs b1,REAL holds Sum <*b2,b3,b4*> = (b2 + b3) + b4
proof end;

theorem Th28: :: RFUNCT_3:28
for b1 being non empty set
for b2, b3 being FinSequence of PFuncs b1,REAL st b2,b3 are_fiberwise_equipotent holds
Sum b2 = Sum b3
proof end;

definition
let c1 be non empty set ;
let c2 be FinSequence;
func CHI c2,c1 -> FinSequence of PFuncs a1,REAL means :Def6: :: RFUNCT_3:def 6
( len a3 = len a2 & ( for b1 being Nat st b1 in dom a3 holds
a3 . b1 = chi (a2 . b1),a1 ) );
existence
ex b1 being FinSequence of PFuncs c1,REAL st
( len b1 = len c2 & ( for b2 being Nat st b2 in dom b1 holds
b1 . b2 = chi (c2 . b2),c1 ) )
proof end;
uniqueness
for b1, b2 being FinSequence of PFuncs c1,REAL st len b1 = len c2 & ( for b3 being Nat st b3 in dom b1 holds
b1 . b3 = chi (c2 . b3),c1 ) & len b2 = len c2 & ( for b3 being Nat st b3 in dom b2 holds
b2 . b3 = chi (c2 . b3),c1 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines CHI RFUNCT_3:def 6 :
for b1 being non empty set
for b2 being FinSequence
for b3 being FinSequence of PFuncs b1,REAL holds
( b3 = CHI b2,b1 iff ( len b3 = len b2 & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = chi (b2 . b4),b1 ) ) );

definition
let c1 be non empty set ;
let c2 be FinSequence of PFuncs c1,REAL ;
let c3 be FinSequence of REAL ;
func c3 (#) c2 -> FinSequence of PFuncs a1,REAL means :Def7: :: RFUNCT_3:def 7
( len a4 = min (len a3),(len a2) & ( for b1 being Nat st b1 in dom a4 holds
for b2 being PartFunc of a1, REAL
for b3 being Real st b3 = a3 . b1 & b2 = a2 . b1 holds
a4 . b1 = b3 (#) b2 ) );
existence
ex b1 being FinSequence of PFuncs c1,REAL st
( len b1 = min (len c3),(len c2) & ( for b2 being Nat st b2 in dom b1 holds
for b3 being PartFunc of c1, REAL
for b4 being Real st b4 = c3 . b2 & b3 = c2 . b2 holds
b1 . b2 = b4 (#) b3 ) )
proof end;
uniqueness
for b1, b2 being FinSequence of PFuncs c1,REAL st len b1 = min (len c3),(len c2) & ( for b3 being Nat st b3 in dom b1 holds
for b4 being PartFunc of c1, REAL
for b5 being Real st b5 = c3 . b3 & b4 = c2 . b3 holds
b1 . b3 = b5 (#) b4 ) & len b2 = min (len c3),(len c2) & ( for b3 being Nat st b3 in dom b2 holds
for b4 being PartFunc of c1, REAL
for b5 being Real st b5 = c3 . b3 & b4 = c2 . b3 holds
b2 . b3 = b5 (#) b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines (#) RFUNCT_3:def 7 :
for b1 being non empty set
for b2 being FinSequence of PFuncs b1,REAL
for b3 being FinSequence of REAL
for b4 being FinSequence of PFuncs b1,REAL holds
( b4 = b3 (#) b2 iff ( len b4 = min (len b3),(len b2) & ( for b5 being Nat st b5 in dom b4 holds
for b6 being PartFunc of b1, REAL
for b7 being Real st b7 = b3 . b5 & b6 = b2 . b5 holds
b4 . b5 = b7 (#) b6 ) ) );

definition
let c1 be non empty set ;
let c2 be FinSequence of PFuncs c1,REAL ;
let c3 be Element of c1;
func c2 # c3 -> FinSequence of REAL means :Def8: :: RFUNCT_3:def 8
( len a4 = len a2 & ( for b1 being Nat
for b2 being Element of PFuncs a1,REAL st b1 in dom a4 & a2 . b1 = b2 holds
a4 . b1 = b2 . a3 ) );
existence
ex b1 being FinSequence of REAL st
( len b1 = len c2 & ( for b2 being Nat
for b3 being Element of PFuncs c1,REAL st b2 in dom b1 & c2 . b2 = b3 holds
b1 . b2 = b3 . c3 ) )
proof end;
uniqueness
for b1, b2 being FinSequence of REAL st len b1 = len c2 & ( for b3 being Nat
for b4 being Element of PFuncs c1,REAL st b3 in dom b1 & c2 . b3 = b4 holds
b1 . b3 = b4 . c3 ) & len b2 = len c2 & ( for b3 being Nat
for b4 being Element of PFuncs c1,REAL st b3 in dom b2 & c2 . b3 = b4 holds
b2 . b3 = b4 . c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def8 defines # RFUNCT_3:def 8 :
for b1 being non empty set
for b2 being FinSequence of PFuncs b1,REAL
for b3 being Element of b1
for b4 being FinSequence of REAL holds
( b4 = b2 # b3 iff ( len b4 = len b2 & ( for b5 being Nat
for b6 being Element of PFuncs b1,REAL st b5 in dom b4 & b2 . b5 = b6 holds
b4 . b5 = b6 . b3 ) ) );

definition
let c1, c2 be non empty set ;
let c3 be FinSequence of PFuncs c1,c2;
let c4 be Element of c1;
pred c4 is_common_for_dom c3 means :Def9: :: RFUNCT_3:def 9
for b1 being Element of PFuncs a1,a2
for b2 being Nat st b2 in dom a3 & a3 . b2 = b1 holds
a4 in dom b1;
end;

:: deftheorem Def9 defines is_common_for_dom RFUNCT_3:def 9 :
for b1, b2 being non empty set
for b3 being FinSequence of PFuncs b1,b2
for b4 being Element of b1 holds
( b4 is_common_for_dom b3 iff for b5 being Element of PFuncs b1,b2
for b6 being Nat st b6 in dom b3 & b3 . b6 = b5 holds
b4 in dom b5 );

theorem Th29: :: RFUNCT_3:29
for b1, b2 being non empty set
for b3 being FinSequence of PFuncs b1,b2
for b4 being Element of b1
for b5 being Nat st b4 is_common_for_dom b3 & b5 <> 0 holds
b4 is_common_for_dom b3 | b5
proof end;

theorem Th30: :: RFUNCT_3:30
for b1, b2 being non empty set
for b3 being FinSequence of PFuncs b1,b2
for b4 being Element of b1
for b5 being Nat st b4 is_common_for_dom b3 holds
b4 is_common_for_dom b3 /^ b5
proof end;

theorem Th31: :: RFUNCT_3:31
for b1 being non empty set
for b2 being Element of b1
for b3 being FinSequence of PFuncs b1,REAL st len b3 <> 0 holds
( b2 is_common_for_dom b3 iff b2 in dom (Sum b3) )
proof end;

theorem Th32: :: RFUNCT_3:32
for b1 being non empty set
for b2 being FinSequence of PFuncs b1,REAL
for b3 being Element of b1
for b4 being Nat holds (b2 | b4) # b3 = (b2 # b3) | b4
proof end;

theorem Th33: :: RFUNCT_3:33
for b1 being non empty set
for b2 being FinSequence
for b3 being Element of b1 holds b3 is_common_for_dom CHI b2,b1
proof end;

theorem Th34: :: RFUNCT_3:34
for b1 being non empty set
for b2 being Element of b1
for b3 being FinSequence of PFuncs b1,REAL
for b4 being FinSequence of REAL st b2 is_common_for_dom b3 holds
b2 is_common_for_dom b4 (#) b3
proof end;

theorem Th35: :: RFUNCT_3:35
for b1 being non empty set
for b2 being FinSequence
for b3 being FinSequence of REAL
for b4 being Element of b1 holds b4 is_common_for_dom b3 (#) (CHI b2,b1)
proof end;

theorem Th36: :: RFUNCT_3:36
for b1 being non empty set
for b2 being Element of b1
for b3 being FinSequence of PFuncs b1,REAL st b2 is_common_for_dom b3 holds
(Sum b3) . b2 = Sum (b3 # b2)
proof end;

definition
let c1 be non empty set ;
let c2 be PartFunc of c1, REAL ;
func max+ c2 -> PartFunc of a1, REAL means :Def10: :: RFUNCT_3:def 10
( dom a3 = dom a2 & ( for b1 being Element of a1 st b1 in dom a3 holds
a3 . b1 = max+ (a2 . b1) ) );
existence
ex b1 being PartFunc of c1, REAL st
( dom b1 = dom c2 & ( for b2 being Element of c1 st b2 in dom b1 holds
b1 . b2 = max+ (c2 . b2) ) )
proof end;
uniqueness
for b1, b2 being PartFunc of c1, REAL st dom b1 = dom c2 & ( for b3 being Element of c1 st b3 in dom b1 holds
b1 . b3 = max+ (c2 . b3) ) & dom b2 = dom c2 & ( for b3 being Element of c1 st b3 in dom b2 holds
b2 . b3 = max+ (c2 . b3) ) holds
b1 = b2
proof end;
func max- c2 -> PartFunc of a1, REAL means :Def11: :: RFUNCT_3:def 11
( dom a3 = dom a2 & ( for b1 being Element of a1 st b1 in dom a3 holds
a3 . b1 = max- (a2 . b1) ) );
existence
ex b1 being PartFunc of c1, REAL st
( dom b1 = dom c2 & ( for b2 being Element of c1 st b2 in dom b1 holds
b1 . b2 = max- (c2 . b2) ) )
proof end;
uniqueness
for b1, b2 being PartFunc of c1, REAL st dom b1 = dom c2 & ( for b3 being Element of c1 st b3 in dom b1 holds
b1 . b3 = max- (c2 . b3) ) & dom b2 = dom c2 & ( for b3 being Element of c1 st b3 in dom b2 holds
b2 . b3 = max- (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def10 defines max+ RFUNCT_3:def 10 :
for b1 being non empty set
for b2, b3 being PartFunc of b1, REAL holds
( b3 = max+ b2 iff ( dom b3 = dom b2 & ( for b4 being Element of b1 st b4 in dom b3 holds
b3 . b4 = max+ (b2 . b4) ) ) );

:: deftheorem Def11 defines max- RFUNCT_3:def 11 :
for b1 being non empty set
for b2, b3 being PartFunc of b1, REAL holds
( b3 = max- b2 iff ( dom b3 = dom b2 & ( for b4 being Element of b1 st b4 in dom b3 holds
b3 . b4 = max- (b2 . b4) ) ) );

theorem Th37: :: RFUNCT_3:37
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds
( b2 = (max+ b2) - (max- b2) & abs b2 = (max+ b2) + (max- b2) & 2 (#) (max+ b2) = b2 + (abs b2) )
proof end;

theorem Th38: :: RFUNCT_3:38
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real st 0 < b3 holds
b2 " {b3} = (max+ b2) " {b3}
proof end;

theorem Th39: :: RFUNCT_3:39
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds b2 " (left_closed_halfline 0) = (max+ b2) " {0}
proof end;

theorem Th40: :: RFUNCT_3:40
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Element of b1 st b3 in dom b2 holds
0 <= (max+ b2) . b3
proof end;

theorem Th41: :: RFUNCT_3:41
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real st 0 < b3 holds
b2 " {(- b3)} = (max- b2) " {b3}
proof end;

theorem Th42: :: RFUNCT_3:42
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds b2 " (right_closed_halfline 0) = (max- b2) " {0}
proof end;

theorem Th43: :: RFUNCT_3:43
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Element of b1 st b3 in dom b2 holds
0 <= (max- b2) . b3
proof end;

theorem Th44: :: RFUNCT_3:44
for b1, b2 being non empty set
for b3 being PartFunc of b1, REAL
for b4 being PartFunc of b2, REAL st b3,b4 are_fiberwise_equipotent holds
max+ b3, max+ b4 are_fiberwise_equipotent
proof end;

theorem Th45: :: RFUNCT_3:45
for b1, b2 being non empty set
for b3 being PartFunc of b1, REAL
for b4 being PartFunc of b2, REAL st b3,b4 are_fiberwise_equipotent holds
max- b3, max- b4 are_fiberwise_equipotent
proof end;

registration
let c1, c2 be set ;
cluster finite Relation of a1,a2;
existence
ex b1 being PartFunc of c1,c2 st b1 is finite
proof end;
end;

registration
let c1 be non empty set ;
let c2 be finite PartFunc of c1, REAL ;
cluster max+ a2 -> finite ;
coherence
max+ c2 is finite
proof end;
cluster max- a2 -> finite ;
coherence
max- c2 is finite
proof end;
end;

theorem Th46: :: RFUNCT_3:46
for b1, b2 being non empty set
for b3 being finite PartFunc of b1, REAL
for b4 being finite PartFunc of b2, REAL st max+ b3, max+ b4 are_fiberwise_equipotent & max- b3, max- b4 are_fiberwise_equipotent holds
b3,b4 are_fiberwise_equipotent
proof end;

theorem Th47: :: RFUNCT_3:47
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set holds (max+ b2) | b3 = max+ (b2 | b3)
proof end;

theorem Th48: :: RFUNCT_3:48
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set holds (max- b2) | b3 = max- (b2 | b3)
proof end;

theorem Th49: :: RFUNCT_3:49
for b1 being non empty set
for b2 being PartFunc of b1, REAL st ( for b3 being Element of b1 st b3 in dom b2 holds
b2 . b3 >= 0 ) holds
max+ b2 = b2
proof end;

theorem Th50: :: RFUNCT_3:50
for b1 being non empty set
for b2 being PartFunc of b1, REAL st ( for b3 being Element of b1 st b3 in dom b2 holds
b2 . b3 <= 0 ) holds
max- b2 = - b2
proof end;

definition
let c1 be non empty set ;
let c2 be PartFunc of c1, REAL ;
let c3 be Real;
func c2 - c3 -> PartFunc of a1, REAL means :Def12: :: RFUNCT_3:def 12
( dom a4 = dom a2 & ( for b1 being Element of a1 st b1 in dom a4 holds
a4 . b1 = (a2 . b1) - a3 ) );
existence
ex b1 being PartFunc of c1, REAL st
( dom b1 = dom c2 & ( for b2 being Element of c1 st b2 in dom b1 holds
b1 . b2 = (c2 . b2) - c3 ) )
proof end;
uniqueness
for b1, b2 being PartFunc of c1, REAL st dom b1 = dom c2 & ( for b3 being Element of c1 st b3 in dom b1 holds
b1 . b3 = (c2 . b3) - c3 ) & dom b2 = dom c2 & ( for b3 being Element of c1 st b3 in dom b2 holds
b2 . b3 = (c2 . b3) - c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def12 defines - RFUNCT_3:def 12 :
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real
for b4 being PartFunc of b1, REAL holds
( b4 = b2 - b3 iff ( dom b4 = dom b2 & ( for b5 being Element of b1 st b5 in dom b4 holds
b4 . b5 = (b2 . b5) - b3 ) ) );

theorem Th51: :: RFUNCT_3:51
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds b2 - 0 = b2
proof end;

theorem Th52: :: RFUNCT_3:52
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real
for b4 being set holds (b2 | b4) - b3 = (b2 - b3) | b4
proof end;

theorem Th53: :: RFUNCT_3:53
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being Real holds b2 " {(b4 + b3)} = (b2 - b3) " {b4}
proof end;

theorem Th54: :: RFUNCT_3:54
for b1, b2 being non empty set
for b3 being PartFunc of b1, REAL
for b4 being PartFunc of b2, REAL
for b5 being Real holds
( b3,b4 are_fiberwise_equipotent iff b3 - b5,b4 - b5 are_fiberwise_equipotent )
proof end;

definition
let c1 be PartFunc of REAL , REAL ;
let c2 be set ;
pred c1 is_convex_on c2 means :Def13: :: RFUNCT_3:def 13
( a2 c= dom a1 & ( for b1 being Real st 0 <= b1 & b1 <= 1 holds
for b2, b3 being Real st b2 in a2 & b3 in a2 & (b1 * b2) + ((1 - b1) * b3) in a2 holds
a1 . ((b1 * b2) + ((1 - b1) * b3)) <= (b1 * (a1 . b2)) + ((1 - b1) * (a1 . b3)) ) );
end;

:: deftheorem Def13 defines is_convex_on RFUNCT_3:def 13 :
for b1 being PartFunc of REAL , REAL
for b2 being set holds
( b1 is_convex_on b2 iff ( b2 c= dom b1 & ( for b3 being Real st 0 <= b3 & b3 <= 1 holds
for b4, b5 being Real st b4 in b2 & b5 in b2 & (b3 * b4) + ((1 - b3) * b5) in b2 holds
b1 . ((b3 * b4) + ((1 - b3) * b5)) <= (b3 * (b1 . b4)) + ((1 - b3) * (b1 . b5)) ) ) );

theorem Th55: :: RFUNCT_3:55
for b1, b2 being Real
for b3 being PartFunc of REAL , REAL holds
( b3 is_convex_on [.b1,b2.] iff ( [.b1,b2.] c= dom b3 & ( for b4 being Real st 0 <= b4 & b4 <= 1 holds
for b5, b6 being Real st b5 in [.b1,b2.] & b6 in [.b1,b2.] holds
b3 . ((b4 * b5) + ((1 - b4) * b6)) <= (b4 * (b3 . b5)) + ((1 - b4) * (b3 . b6)) ) ) )
proof end;

theorem Th56: :: RFUNCT_3:56
for b1, b2 being Real
for b3 being PartFunc of REAL , REAL holds
( b3 is_convex_on [.b1,b2.] iff ( [.b1,b2.] c= dom b3 & ( for b4, b5, b6 being Real st b4 in [.b1,b2.] & b5 in [.b1,b2.] & b6 in [.b1,b2.] & b4 < b5 & b5 < b6 holds
((b3 . b4) - (b3 . b5)) / (b4 - b5) <= ((b3 . b5) - (b3 . b6)) / (b5 - b6) ) ) )
proof end;

theorem Th57: :: RFUNCT_3:57
for b1 being PartFunc of REAL , REAL
for b2, b3 being set st b1 is_convex_on b2 & b3 c= b2 holds
b1 is_convex_on b3
proof end;

theorem Th58: :: RFUNCT_3:58
for b1 being PartFunc of REAL , REAL
for b2 being set
for b3 being Real holds
( b1 is_convex_on b2 iff b1 - b3 is_convex_on b2 )
proof end;

theorem Th59: :: RFUNCT_3:59
for b1 being PartFunc of REAL , REAL
for b2 being set
for b3 being Real st 0 < b3 holds
( b1 is_convex_on b2 iff b3 (#) b1 is_convex_on b2 )
proof end;

theorem Th60: :: RFUNCT_3:60
for b1 being PartFunc of REAL , REAL
for b2 being set st b2 c= dom b1 holds
0 (#) b1 is_convex_on b2
proof end;

theorem Th61: :: RFUNCT_3:61
for b1, b2 being PartFunc of REAL , REAL
for b3 being set st b1 is_convex_on b3 & b2 is_convex_on b3 holds
b1 + b2 is_convex_on b3
proof end;

theorem Th62: :: RFUNCT_3:62
for b1 being PartFunc of REAL , REAL
for b2 being set
for b3 being Real st b1 is_convex_on b2 holds
max+ (b1 - b3) is_convex_on b2
proof end;

theorem Th63: :: RFUNCT_3:63
for b1 being PartFunc of REAL , REAL
for b2 being set st b1 is_convex_on b2 holds
max+ b1 is_convex_on b2
proof end;

theorem Th64: :: RFUNCT_3:64
id ([#] REAL ) is_convex_on REAL
proof end;

theorem Th65: :: RFUNCT_3:65
for b1 being Real holds max+ ((id ([#] REAL )) - b1) is_convex_on REAL by Th62, Th64;

definition
let c1 be non empty set ;
let c2 be PartFunc of c1, REAL ;
let c3 be set ;
assume E53: dom (c2 | c3) is finite ;
func FinS c2,c3 -> non-increasing FinSequence of REAL means :Def14: :: RFUNCT_3:def 14
a2 | a3,a4 are_fiberwise_equipotent ;
existence
ex b1 being non-increasing FinSequence of REAL st c2 | c3,b1 are_fiberwise_equipotent
proof end;
uniqueness
for b1, b2 being non-increasing FinSequence of REAL st c2 | c3,b1 are_fiberwise_equipotent & c2 | c3,b2 are_fiberwise_equipotent holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines FinS RFUNCT_3:def 14 :
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set st dom (b2 | b3) is finite holds
for b4 being non-increasing FinSequence of REAL holds
( b4 = FinS b2,b3 iff b2 | b3,b4 are_fiberwise_equipotent );

theorem Th66: :: RFUNCT_3:66
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set st dom (b2 | b3) is finite holds
FinS b2,(dom (b2 | b3)) = FinS b2,b3
proof end;

theorem Th67: :: RFUNCT_3:67
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set st dom (b2 | b3) is finite holds
FinS (b2 | b3),b3 = FinS b2,b3
proof end;

definition
let c1 be non empty set ;
let c2 be PartFunc of c1, REAL ;
let c3 be finite set ;
redefine func | as c2 | c3 -> finite PartFunc of a1, REAL ;
coherence
c2 | c3 is finite PartFunc of c1, REAL
proof end;
end;

theorem Th68: :: RFUNCT_3:68
for b1 being non empty set
for b2 being Element of b1
for b3 being set
for b4 being PartFunc of b1, REAL st b3 is finite & b2 in dom (b4 | b3) holds
(FinS b4,(b3 \ {b2})) ^ <*(b4 . b2)*>,b4 | b3 are_fiberwise_equipotent
proof end;

theorem Th69: :: RFUNCT_3:69
for b1 being non empty set
for b2 being Element of b1
for b3 being set
for b4 being PartFunc of b1, REAL st dom (b4 | b3) is finite & b2 in dom (b4 | b3) holds
(FinS b4,(b3 \ {b2})) ^ <*(b4 . b2)*>,b4 | b3 are_fiberwise_equipotent
proof end;

theorem Th70: :: RFUNCT_3:70
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set
for b4 being finite set st b4 = dom (b2 | b3) holds
len (FinS b2,b3) = card b4
proof end;

theorem Th71: :: RFUNCT_3:71
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds FinS b2,{} = <*> REAL
proof end;

theorem Th72: :: RFUNCT_3:72
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Element of b1 st b3 in dom b2 holds
FinS b2,{b3} = <*(b2 . b3)*>
proof end;

theorem Th73: :: RFUNCT_3:73
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set
for b4 being Element of b1 st dom (b2 | b3) is finite & b4 in dom (b2 | b3) & (FinS b2,b3) . (len (FinS b2,b3)) = b2 . b4 holds
FinS b2,b3 = (FinS b2,(b3 \ {b4})) ^ <*(b2 . b4)*>
proof end;

defpred S1[ Nat] means for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being set
for b5 being finite set st b5 = dom (b2 | b4) & dom (b2 | b3) is finite & b4 c= b3 & a1 = card b5 & ( for b6, b7 being Element of b1 st b6 in dom (b2 | b4) & b7 in dom (b2 | (b3 \ b4)) holds
b2 . b6 >= b2 . b7 ) holds
FinS b2,b3 = (FinS b2,b4) ^ (FinS b2,(b3 \ b4));

Lemma62: S1[0]
proof end;

Lemma63: for b1 being Nat st S1[b1] holds
S1[b1 + 1]
proof end;

theorem Th74: :: RFUNCT_3:74
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being set st dom (b2 | b3) is finite & b4 c= b3 & ( for b5, b6 being Element of b1 st b5 in dom (b2 | b4) & b6 in dom (b2 | (b3 \ b4)) holds
b2 . b5 >= b2 . b6 ) holds
FinS b2,b3 = (FinS b2,b4) ^ (FinS b2,(b3 \ b4))
proof end;

theorem Th75: :: RFUNCT_3:75
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real
for b4 being set
for b5 being Element of b1 st dom (b2 | b4) is finite & b5 in dom (b2 | b4) holds
( (FinS (b2 - b3),b4) . (len (FinS (b2 - b3),b4)) = (b2 - b3) . b5 iff (FinS b2,b4) . (len (FinS b2,b4)) = b2 . b5 )
proof end;

theorem Th76: :: RFUNCT_3:76
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Real
for b4 being set
for b5 being finite set st b5 = dom (b2 | b4) holds
FinS (b2 - b3),b4 = (FinS b2,b4) - ((card b5) |-> b3)
proof end;

theorem Th77: :: RFUNCT_3:77
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set st dom (b2 | b3) is finite & ( for b4 being Element of b1 st b4 in dom (b2 | b3) holds
b2 . b4 >= 0 ) holds
FinS (max+ b2),b3 = FinS b2,b3
proof end;

theorem Th78: :: RFUNCT_3:78
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set
for b4 being Real
for b5 being finite set st b5 = dom (b2 | b3) & rng (b2 | b3) = {b4} holds
FinS b2,b3 = (card b5) |-> b4
proof end;

theorem Th79: :: RFUNCT_3:79
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being set st dom (b2 | (b3 \/ b4)) is finite & b3 misses b4 holds
FinS b2,(b3 \/ b4),(FinS b2,b3) ^ (FinS b2,b4) are_fiberwise_equipotent
proof end;

definition
let c1 be non empty set ;
let c2 be PartFunc of c1, REAL ;
let c3 be set ;
func Sum c2,c3 -> Real equals :: RFUNCT_3:def 15
Sum (FinS a2,a3);
correctness
coherence
Sum (FinS c2,c3) is Real
;
;
end;

:: deftheorem Def15 defines Sum RFUNCT_3:def 15 :
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set holds Sum b2,b3 = Sum (FinS b2,b3);

theorem Th80: :: RFUNCT_3:80
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set
for b4 being Real st dom (b2 | b3) is finite holds
Sum (b4 (#) b2),b3 = b4 * (Sum b2,b3)
proof end;

theorem Th81: :: RFUNCT_3:81
for b1 being non empty set
for b2, b3 being PartFunc of b1, REAL
for b4 being set
for b5 being finite set st b5 = dom (b2 | b4) & dom (b2 | b4) = dom (b3 | b4) holds
Sum (b2 + b3),b4 = (Sum b2,b4) + (Sum b3,b4)
proof end;

theorem Th82: :: RFUNCT_3:82
for b1 being non empty set
for b2, b3 being PartFunc of b1, REAL
for b4 being set st dom (b2 | b4) is finite & dom (b2 | b4) = dom (b3 | b4) holds
Sum (b2 - b3),b4 = (Sum b2,b4) - (Sum b3,b4)
proof end;

theorem Th83: :: RFUNCT_3:83
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being set
for b4 being Real
for b5 being finite set st b5 = dom (b2 | b3) holds
Sum (b2 - b4),b3 = (Sum b2,b3) - (b4 * (card b5))
proof end;

theorem Th84: :: RFUNCT_3:84
for b1 being non empty set
for b2 being PartFunc of b1, REAL holds Sum b2,{} = 0 by Th71, RVSUM_1:102;

theorem Th85: :: RFUNCT_3:85
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3 being Element of b1 st b3 in dom b2 holds
Sum b2,{b3} = b2 . b3
proof end;

theorem Th86: :: RFUNCT_3:86
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being set st dom (b2 | (b3 \/ b4)) is finite & b3 misses b4 holds
Sum b2,(b3 \/ b4) = (Sum b2,b3) + (Sum b2,b4)
proof end;

theorem Th87: :: RFUNCT_3:87
for b1 being non empty set
for b2 being PartFunc of b1, REAL
for b3, b4 being set st dom (b2 | (b3 \/ b4)) is finite & dom (b2 | b3) misses dom (b2 | b4) holds
Sum b2,(b3 \/ b4) = (Sum b2,b3) + (Sum b2,b4)
proof end;