 reserve Omega for non empty set;
 reserve F for SigmaField of Omega;
 reserve phi for Real_Sequence;
 reserve jpi for pricefunction;
 reserve Prob for Probability of Special_SigmaField2;

theorem ThArb:
  for n being Nat
  for r being Real st r>0 holds
  for jpi being pricefunction
  for d being Nat
  for RV being Real-Valued-Random-Variable of Special_SigmaField2 st
     RV={1,2,3,4}-->(jpi.d*(1+r)) &
     RV is_integrable_on P2M(Prob) &
     RV is_simple_func_in Special_SigmaField2 holds
       jpi.d=expect(Real_RV(r,RV),Prob)
proof
let n be Nat;
set Omega2={1,2,3,4};
set F2=Special_SigmaField2;
let r be Real;
assume A00: r>0;
let jpi be pricefunction;
let d be Nat;
let RV be Real-Valued-Random-Variable of F2;
assume ASS0: RV=Omega2-->jpi.d*(1+r) &
             RV is_integrable_on P2M(Prob) &
             RV is_simple_func_in F2;
set myconst=1/(1+r);
Z1: expect(Real_RV(r,RV),Prob) = myconst*expect(RV,Prob)
 by ASS0,RANDOM_1:def 2,RANDOM_1:27;
B1: expect(RV,Prob)=Integral (P2M(Prob),RV)
  by ASS0,RANDOM_1:def 2,def 3;
reconsider FOmega = Omega2 as Element of F2 by PROB_1:5;
 D1: FOmega=dom RV by FUNCT_2:def 1;
SS: R_EAL RV=RV & RV is nonnegative
 proof
  for x being ExtReal holds x in rng RV implies 0. <= x
  proof
   let x be ExtReal;
   assume CASS0: x in rng RV;
   consider w being object such that
    W1: w in dom RV & RV.w=x by CASS0,FUNCT_1:def 3;
   reconsider w as Element of Omega2 by W1;
   0<=RV.w
   proof
    d in NAT by ORDINAL1:def 12; then
    0<=jpi.d by FINANCE1:def 2;
    hence thesis by ASS0,A00;
   end;
  hence thesis by W1;
  end;
 hence thesis by SUPINF_2:def 12,SUPINF_2:def 9;
 end; then
  expect(RV,Prob)= integral+ (P2M(Prob),(R_EAL RV))
    by D1,B1,MESFUNC6:82;
then Q3: expect(RV,Prob)= integral' (P2M(Prob),(R_EAL RV)) by
 MESFUNC5:77,MESFUNC6:49,ASS0,SS;
set myr=jpi.d*(1+r);
d in NAT by ORDINAL1:def 12; then
TT: 0<=jpi.d by FINANCE1:def 2;
(for x being object st x in dom (R_EAL RV) holds (R_EAL RV).x=myr) &
dom (R_EAL RV) in F2 & 0<=myr by ASS0,FUNCOP_1:7,TT,A00;
then Q4: expect(RV,Prob)=myr*(P2M(Prob)).(dom (R_EAL RV)) by Q3,MESFUNC5:104;
 dom (R_EALRV)=Omega2 & Omega2=[#]F2 by FUNCT_2:def 1; then
expect(RV,Prob)=myr*1 by Q4,PROB_1:30;
then Spec: expect(Real_RV(r,RV),Prob)=jpi.d*((1/(1+r))*(1+r)) by Z1;
1=1*(1+r)*(1+r)" by XCMPLX_1:203,A00;
hence thesis by Spec;
end;
