reserve X for non empty set,
        x for Element of X,
        S for SigmaField of X,
        M for sigma_Measure of S,
        f,g,f1,g1 for PartFunc of X,REAL,
        l,m,n,n1,n2 for Nat,
        a,b,c for Real;
reserve k for positive Real;
reserve v,u for VECTOR of RLSp_LpFunct(M,k);
reserve v,u for VECTOR of RLSp_AlmostZeroLpFunct(M,k);

theorem Th37:
(ex E be Element of S st M.(E`)=0 & E = dom f & f is E-measurable) &
g in a.e-eq-class_Lp(f,M,k) implies
  g a.e.= f,M & f in Lp_Functions(M,k)
proof
   assume that
A1: ex E be Element of S st M.(E`)=0 & E = dom f & f is E-measurable and
A2: g in a.e-eq-class_Lp(f,M,k);
A3:ex r be PartFunc of X,REAL st g=r & r in Lp_Functions (M,k) &
     f a.e.= r,M by A2;
   hence g a.e.= f,M;
   g in Lp_Functions(M,k) by A2; then
   consider g1 be PartFunc of X,REAL such that
A4: g = g1 & ex E be Element of S st M.(E`)=0 & dom g1 = E &
     g1 is E-measurable & (abs g1) to_power k is_integrable_on M;
   consider Eh be Element of S such that
A5: M.(Eh`) = 0 & dom g = Eh &
    g is Eh-measurable & (abs g) to_power k is_integrable_on M by A4;
   reconsider ND = Eh` as Element of S by MEASURE1:34;
   ex E be Element of S st M.E` = 0 & dom f = E &
      f is E-measurable & (abs f) to_power k is_integrable_on M
   proof
    set AFK = (abs f) to_power k;
    set AGK = (abs g) to_power k;
    consider Ef be Element of S such that
A6:  M.(Ef`)=0 & Ef = dom f & f is Ef-measurable by A1;
    take Ef;
    consider EE be Element of S such that
A7:  M.EE = 0 & g|EE` = f|EE` by A3;
    reconsider E1 = ND \/ EE as Element of S;
    EE c= E1 by XBOOLE_1:7; then
    E1` c= EE` by SUBSET_1:12; then
A8: f|E1` = (f|EE`)|E1` & g|E1` = (g|EE`)|E1` by FUNCT_1:51;
A9: dom(abs f) = Ef by A6,VALUED_1:def 11; then
    dom AFK = Ef by MESFUN6C:def 4; then
A10: dom max+(R_EAL AFK) = Ef & dom max-(R_EAL AFK) = Ef
       by MESFUNC2:def 2,def 3;
    abs f is Ef-measurable by A6,MESFUNC6:48; then
    AFK is Ef-measurable by A9,MESFUN6C:29; then
A11: Ef = dom(R_EAL AFK) & (R_EAL AFK) is Ef-measurable
       by A9,MESFUN6C:def 4; then
A12: max+(R_EAL AFK) is Ef-measurable &
    max-(R_EAL AFK) is Ef-measurable by MESFUNC2:25,26;
    (for x being Element of X holds 0. <= (max+(R_EAL AFK)).x) &
    (for x being Element of X holds 0. <= (max-(R_EAL AFK)).x)
       by MESFUNC2:12,13; then
A13: max+(R_EAL AFK) is nonnegative &
    max-(R_EAL AFK) is nonnegative by SUPINF_2:39;
A14: Ef = (Ef /\ E1) \/ (Ef \ E1) by XBOOLE_1:51;
    reconsider E0 = Ef /\ E1 as Element of S;
    reconsider E2 = Ef \ E1 as Element of S;
    max+(R_EAL AFK) = (max+(R_EAL AFK))|(dom(max+(R_EAL AFK))) &
    max-(R_EAL AFK) = (max-(R_EAL AFK))|(dom(max-(R_EAL AFK)))
       by RELAT_1:69; then
A15:integral+(M,max+(R_EAL AFK)) = integral+(M,(max+(R_EAL AFK))|E0)
        + integral+(M,(max+(R_EAL AFK))|E2) &
    integral+(M,max-(R_EAL AFK)) = integral+(M,(max-(R_EAL AFK))|E0)
        + integral+(M,(max-(R_EAL AFK))|E2)
         by A10,A12,A13,A14,MESFUNC5:81,XBOOLE_1:89;
A16:integral+(M,(max+(R_EAL AFK))|E0) >= 0 &
    integral+(M,(max-(R_EAL AFK))|E0) >= 0 by A12,A13,A10,MESFUNC5:80;
    ND is measure_zero of M & EE is measure_zero of M
       by A5,A7,MEASURE1:def 7; then
    E1 is measure_zero of M by MEASURE1:37; then
    M.E1 = 0 by MEASURE1:def 7; then
    integral+(M,(max+(R_EAL AFK))|E1) = 0 &
    integral+(M,(max-(R_EAL AFK))|E1) = 0 by A10,A12,A13,MESFUNC5:82; then
    integral+(M,(max+(R_EAL AFK))|E0) = 0 &
    integral+(M,(max-(R_EAL AFK))|E0) = 0
        by A10,A12,A13,A16,MESFUNC5:83,XBOOLE_1:17; then
A17:integral+(M,max+(R_EAL AFK)) = integral+(M,(max+(R_EAL AFK))|E2) &
    integral+(M,max-(R_EAL AFK)) = integral+(M,(max-(R_EAL AFK))|E2)
        by A15,XXREAL_3:4;
    Ef \ E1 = Ef /\ E1` by SUBSET_1:13; then
A18:E2 c= E1` by XBOOLE_1:17; then
    f|E2 = (g|E1`)|E2 by A7,A8,FUNCT_1:51; then
A19:f|E2 = g|E2 by A18,FUNCT_1:51;
A20:(abs f)|E2 = abs(f|E2) & (abs g)|E2 = abs(g|E2) by RFUNCT_1:46;
A21:((abs f)|E2) to_power k = AFK|E2 &
    ((abs g)|E2) to_power k = AGK|E2 by Th20;
A22:max+(R_EAL AFK)|E2 = max+((R_EAL AFK)|E2) &
    max+(R_EAL AGK)|E2 = max+((R_EAL AGK)|E2) &
    max-(R_EAL AFK)|E2 = max-((R_EAL AFK)|E2) &
    max-(R_EAL AGK)|E2 = max-((R_EAL AGK)|E2) by MESFUNC5:28;
A23:R_EAL AGK is_integrable_on M by A5; then
A24:integral+(M,max+(R_EAL AGK)) < +infty &
    integral+(M,max-(R_EAL AGK)) < +infty;
    integral+(M,max+((R_EAL AGK)|E2)) <= integral+(M,max+(R_EAL AGK)) &
    integral+(M,max-((R_EAL AGK)|E2)) <= integral+(M,max-(R_EAL AGK))
       by A23,MESFUNC5:97; then
    integral+(M,max+(R_EAL AFK)) < +infty &
    integral+(M,max-(R_EAL AFK)) < +infty
       by A17,A19,A20,A21,A22,A24,XXREAL_0:2; then
    (R_EAL((abs f) to_power k)) is_integrable_on M by A11;
    hence thesis by A6;
   end;
   hence f in Lp_Functions(M,k);
end;
