:: Integrability of Multivariable Continuous Functions
::  by Noboru Endou and Yasunari Shidama
:: 
:: Received December 12, 2025
:: Copyright (c) 2025-2026 Association of Mizar Users
::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 4.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/4.0/.

environ

 vocabularies MEASUR14, INTEGRA1, MEASUR13, FINSEQ_1, FINSEQ_2, NUMBERS,
      XXREAL_0, SUBSET_1, CARD_1, ARYTM_3, ARYTM_1, RELAT_1, REAL_1, FUNCT_1,
      XBOOLE_0, TARSKI, ZFMISC_1, PROB_1, SUPINF_2, PARTFUN1, MEASURE1,
      MESFUNC5, MESFUNC1, MEASUR10, MEASUR11, COMPLEX1, MESFUN12, ORDINAL2,
      INTEGRA5, NAT_1, FUNCT_2, FUNCOP_1, CARD_3, XCMPLX_0, MEASURE5, XXREAL_1,
      MEASUR12, DUALSP02, NFCONT_2, CFCONT_1, RCOMP_1, PRE_TOPC, XXREAL_2,
      GROUP_2, STRUCT_0, SQUARE_1, NORMSP_1, MEASURE6, REALSET1, FCONT_1,
      MEASUR15, FCONT_2, SUPINF_1, VALUED_1, REAL_NS1;
 notations TARSKI, XBOOLE_0, ZFMISC_1, SUBSET_1, RELAT_1, FUNCT_1, ORDINAL1,
      RELSET_1, PARTFUN1, FUNCT_2, BINOP_1, FUNCT_3, DOMAIN_1, SUPINF_1,
      FUNCOP_1, CARD_1, CARD_3, NUMBERS, XXREAL_3, XCMPLX_0, XXREAL_0, XREAL_0,
      VALUED_1, SQUARE_1, EXTREAL1, COMPLEX1, MESFUNC1, FCONT_1, FCONT_2,
      FINSEQ_1, FINSEQ_2, EUCLID, RVSUM_1, SUPINF_2, PROB_1, RCOMP_1, MEASURE1,
      MEASURE5, MEASUR12, MESFUNC5, MESFUNC6, INTEGRA5, MEASUR10, MEASUR11,
      MESFUN12, MEASUR13, MESFUN16, MEASUR14, SEQ_2, STRUCT_0, PRE_TOPC,
      RLVECT_1, NORMSP_0, NORMSP_1, NFCONT_1, PRVECT_1, PRVECT_2, PRVECT_4,
      NFCONT_2, REAL_NS1, DUALSP02, PRVECT_3, MEASUR15;
 constructors EXTREAL1, SUPINF_1, MESFUNC2, MEASUR11, MESFUN12, MESFUNC6,
      LPSPACE1, SQUARE_1, DOMAIN_1, FCONT_1, FCONT_2, MEASUR12, INTEGRA1,
      WSIERP_1, COMSEQ_2, MEASUR14, NEWTON, INTEGRA5, BINOP_2, NFCONT_1,
      NFCONT_2, DUALSP02, PRVECT_4, REAL_NS1, MESFUN16, MEASUR15;
 registrations ORDINAL1, XBOOLE_0, RELAT_1, SUBSET_1, XXREAL_0, XREAL_0, NAT_1,
      NUMBERS, VALUED_0, RELSET_1, MEASURE1, XXREAL_3, FINSEQ_2, FUNCT_1,
      FUNCT_2, FUNCOP_1, CARD_1, CARD_3, PRVECT_3, MEMBERED, XXREAL_2,
      SRINGS_4, MEASUR13, EUCLID, SQUARE_1, STRUCT_0, NORMSP_0, NORMSP_1,
      FOMODEL0, PRVECT_2, PRVECT_1, FINSEQ_9, MEASURE5, FCONT_1, MESFUN13,
      COMPLEX1, MEASUR15, REAL_NS1;
 requirements BOOLE, SUBSET, NUMERALS, REAL, ARITHM;


begin :: Preliminaries

theorem :: MESFUN18:1
  for X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
  f be PartFunc of X,REAL st dom f = {} holds f is_integrable_on M;

theorem :: MESFUN18:2
for X be non empty set, S be SigmaField of X, M be sigma_Measure of S,
  f be PartFunc of X,ExtREAL st dom f = {} holds f is_integrable_on M;

::$N generalization \cite{MEASUR13}:3
theorem :: MESFUN18:3
for n,i,j,k be non zero Nat, X be n-element FinSequence,
 X1 be j-element FinSequence, X2 be k-element FinSequence
 st i <= j & j <= k & X1 = X|j & X2 = X|k holds
  (ProdFinSeq X1).i = (ProdFinSeq X2).i;

::$N generalization \cite{MEASUR13}:6
theorem :: MESFUN18:4
for n be non zero Nat, D be (n+1)-element FinSequence,
 D1 be n-element FinSequence st D1 = D|n holds
  CarProduct D = [: CarProduct D1,D.(n+1) :];

::$N generalization \cite{MESFUN16}:51
theorem :: MESFUN18:5
for I be Subset of REAL, J be closed_interval Subset of REAL,
 f be PartFunc of [:RNS_Real,RNS_Real:],RNS_Real,
 g be PartFunc of [:REAL,REAL:],REAL
 st [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g holds
   Integral2(L-Meas,|.R_EAL g.|) |I is PartFunc of REAL,REAL
 & Integral2(L-Meas,R_EAL g) |I is PartFunc of REAL,REAL;

::$N generalization \cite{MEASUR15}:51
theorem :: MESFUN18:6
for n be non zero Nat, D be n-element FinSequence st not D is non-empty
 holds CarProduct D = {};

::$N generalization \cite{MEASUR15}:6
theorem :: MESFUN18:7
for n be non zero Nat, X be n-element FinSequence, x be object
 holds x in CarProduct X iff
  ex px be n-element FinSequence st px in product X & x = PtCarProduct px;

::$N generalization \cite{MEASUR15}:39
theorem :: MESFUN18:8
for n be non zero Nat, D be n-element FinSequence st
 for i be Nat st i in Seg n holds D.i is Element of L-Field
  holds CarProduct D is Element of Prod_Field(L-Field n);

::$N generalization \cite{MEASUR15}:41
theorem :: MESFUN18:9
for n be non zero Nat, D be n-element FinSequence st
 for i be Nat st i in Seg n holds D.i is Interval holds
  CarProduct D is Element of Prod_Field(L-Field n);

::$N generalization \cite{MEASUR15}:48
theorem :: MESFUN18:10
for n be non zero Nat, X,Y be n-element FinSequence st
 for i be Nat st i in Seg n holds X.i c= Y.i holds
  CarProduct X c= CarProduct Y;

::$N generalization \cite{MEASUR15}:50
theorem :: MESFUN18:11
for n,k be non zero Nat, X be non empty set, D be n-element FinSequence st
  k in Seg n & (for i be Nat st i in Seg n holds D.i is Subset of X)
 holds (ProdFinSeq D).k is Subset of CarProduct(Seg k --> X);

::$N generalization \cite{MEASUR15}:73
theorem :: MESFUN18:12
for n be non zero Nat, D be n-element FinSequence st
 for i be Nat st i in Seg n holds D.i c= REAL
holds product D = (CarProd(Seg n --> REAL)).:(CarProduct D);

begin :: Integrability of continuous rean $n$-variable functions

theorem :: MESFUN18:13
  CarProduct(Seg 1 --> RNS_Real) = RNS_Real
& ElmFin(Seg 1 --> RNS_Real,1) = RNS_Real
& CarProduct(Seg 2 --> RNS_Real) = [:RNS_Real,RNS_Real:]
& ElmFin(Seg 2 --> RNS_Real,2) = RNS_Real
& CarProduct(Seg 3 --> RNS_Real) = [:RNS_Real,RNS_Real,RNS_Real:];

theorem :: MESFUN18:14
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 p be Element of CarProduct(Seg n --> REAL)
st f is_continuous_on dom f & f = g holds ProjPMap1(g,p) is continuous;

theorem :: MESFUN18:15
for X,Y,Z be non empty set, T be Function of X,Y, f be PartFunc of X,Z,
 g be PartFunc of Y,Z st T is bijective & g = f*T" holds
  dom g = T.:(dom f) & dom g = (.:T).(dom f);

theorem :: MESFUN18:16
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 P2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
 q be Element of REAL
 st f is_continuous_on dom f & f = g & P2 = ProjPMap2(g,q) holds
 P2 is_continuous_on dom P2;

theorem :: MESFUN18:17
for n be non zero Nat,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 q be Element of REAL holds
    ProjPMap2(g,q)*(CarProd(Seg n --> REAL))" is PartFunc of REAL n,REAL
  & dom(ProjPMap2(g,q)*(CarProd(Seg n --> REAL))")
     = (CarProd(Seg n --> REAL)).:(dom ProjPMap2(g,q));

theorem :: MESFUN18:18
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 p be Element of CarProduct(Seg n --> REAL)
st f is_continuous_on dom f & f = g holds ProjPMap1(|.g.|,p) is continuous;

theorem :: MESFUN18:19
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 P2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
 q be Element of REAL
 st f is_continuous_on dom f & f = g & P2 = ProjPMap2(|.g.|,q) holds
  P2 is_continuous_on dom P2;

theorem :: MESFUN18:20
for n be non zero Nat,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 q be Element of REAL holds
    ProjPMap2(|.g.|,q)*(CarProd(Seg n --> REAL))" is PartFunc of REAL n,REAL
  & dom(ProjPMap2(|.g.|,q)*(CarProd(Seg n --> REAL))")
     = (CarProd(Seg n --> REAL)).:(dom ProjPMap2(|.g.|,q));

theorem :: MESFUN18:21
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 p be Element of CarProduct(Seg n --> REAL)
 st f is_uniformly_continuous_on dom f & f = g holds
  ProjPMap1(g,p) is uniformly_continuous;

theorem :: MESFUN18:22
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 P2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
 s be Element of REAL
st f is_uniformly_continuous_on dom f & f = g & P2 = ProjPMap2(g,s) holds
 P2 is_uniformly_continuous_on dom P2;

theorem :: MESFUN18:23
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 Pg1 be PartFunc of REAL,REAL,
 x be Element of CarProduct(Seg n --> REAL)
 st f is_continuous_on dom f & f = g & Pg1 = ProjPMap1(R_EAL g,x) holds
  Pg1 is continuous;

theorem :: MESFUN18:24
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 Pg2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
 y be Element of REAL
 st f is_continuous_on dom f & f = g & Pg2 = ProjPMap2(R_EAL g,y) holds
  Pg2 is_continuous_on dom Pg2;

theorem :: MESFUN18:25
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 Pg1 be PartFunc of REAL,REAL,
 x be Element of CarProduct(Seg n --> REAL)
  st f is_continuous_on dom f & f = g & Pg1 = ProjPMap1(|.R_EAL g.|,x)
  holds Pg1 is continuous;

theorem :: MESFUN18:26
for n be non zero Nat,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 Pg2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
 y be Element of REAL
  st f is_continuous_on dom f & f = g & Pg2 = ProjPMap2(|.R_EAL g.|,y)
  holds Pg2 is_continuous_on dom Pg2;

theorem :: MESFUN18:27
for n be non zero Nat, I be Subset of CarProduct(Seg n --> REAL),
  J be non empty closed_interval Subset of REAL,
  x be Element of CarProduct(Seg n --> REAL),
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg1 be PartFunc of REAL,REAL
 st x in I & dom f = [:I,J:] & f is_continuous_on [:I,J:] & f = g
  & Pg1 = ProjPMap1(R_EAL g,x)
 holds Pg1|J is bounded & Pg1 is_integrable_on J;

theorem :: MESFUN18:28
for n be non zero Nat, I be Subset of CarProduct(Seg n --> REAL),
  J be non empty closed_interval Subset of REAL,
  x be Element of CarProduct(Seg n --> REAL),
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg1 be PartFunc of REAL,REAL
 st x in I & dom f = [:I,J:] & f is_continuous_on [:I,J:] & f = g
  & Pg1 = ProjPMap1(|.R_EAL g.|,x)
 holds Pg1|J is bounded & Pg1 is_integrable_on J;

theorem :: MESFUN18:29
for n be non zero Nat, I be Subset of CarProduct(Seg n --> REAL),
  J be closed_interval Subset of REAL,
  x be Element of CarProduct(Seg n --> REAL),
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg1 be PartFunc of REAL,REAL
 st dom f = [:I,J:] & f is_continuous_on [:I,J:] & f = g &
    Pg1 = ProjPMap1(R_EAL g,x) holds Pg1 is_integrable_on L-Meas;

theorem :: MESFUN18:30
for n be non zero Nat, I be Subset of CarProduct(Seg n --> REAL),
  J be non empty closed_interval Subset of REAL,
  x be Element of CarProduct(Seg n --> REAL),
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg1 be PartFunc of REAL,REAL
 st x in I & dom f = [:I,J:] & f is_continuous_on [:I,J:] & f = g
  & Pg1 = ProjPMap1(R_EAL g,x) holds
    integral(Pg1,J) = Integral(L-Meas,Pg1)
  & integral(Pg1,J) = Integral(L-Meas,(ProjPMap1(R_EAL g,x)))
  & integral(Pg1,J) = (Integral2(L-Meas,R_EAL g)).x;

theorem :: MESFUN18:31
for n be non zero Nat,
  I be Subset of CarProduct(Seg n --> REAL),
  J be closed_interval Subset of REAL,
  x be Element of CarProduct(Seg n --> REAL),
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg1 be PartFunc of REAL,REAL
 st dom f = [:I,J:] & f is_continuous_on [:I,J:] & f = g
  & Pg1 = ProjPMap1(|.R_EAL g.|,x) holds Pg1 is_integrable_on L-Meas;

theorem :: MESFUN18:32
for n be non zero Nat,
  I be Subset of CarProduct(Seg n --> REAL),
  J be non empty closed_interval Subset of REAL,
  x be Element of CarProduct(Seg n --> REAL),
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg1 be PartFunc of REAL,REAL
 st x in I & dom f = [:I,J:] & f is_continuous_on [:I,J:] & f = g
  & Pg1 = ProjPMap1(|.R_EAL g.|,x) holds
  integral(Pg1,J) = Integral(L-Meas,Pg1)
  & integral(Pg1,J) = Integral(L-Meas,(ProjPMap1(|.R_EAL g.|,x)))
  & integral(Pg1,J) = (Integral2(L-Meas,|.R_EAL g.|)).x;

theorem :: MESFUN18:33
for n be non zero Nat,
  I be Subset of CarProduct(Seg n --> REAL), J be Subset of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  E be Element of sigma measurable_rectangles(Prod_Field(L-Field n),L-Field)
 st [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g & E = [:I,J:] holds
   g is E-measurable;

theorem :: MESFUN18:34
for n be non zero Nat, I be Subset of CarProduct(Seg n --> REAL),
  J be closed_interval Subset of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g holds
   Integral2(L-Meas,|.R_EAL g.|) is PartFunc of CarProduct(Seg n --> REAL),REAL
 & Integral2(L-Meas,R_EAL g) is PartFunc of CarProduct(Seg n --> REAL),REAL;

theorem :: MESFUN18:35
for n be non zero Nat, D be n-element FinSequence,
  J be closed_interval Subset of REAL,
  E be Subset of [:CarProduct(Seg n --> RNS_Real),RNS_Real:]
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & E = [:CarProduct D,J:] holds E is compact;

theorem :: MESFUN18:36
for n be non zero Nat, E be set,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st f = g & E c= dom f holds
  f is_uniformly_continuous_on E iff
   for e be Real st 0 < e ex r be Real st 0 < r
    & for x1,x2 be Point of CarProduct(Seg n --> RNS_Real), y1,y2 be Real
    st [x1,y1] in E & [x2,y2] in E & ||.x2-x1.|| < r & |.y2-y1.| < r
    holds |. g.([x2,y2])-g.([x1,y1]) .| < e;

theorem :: MESFUN18:37
for n be non zero Nat, D be n-element FinSequence,
  J be closed_interval Subset of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
  st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
   & f = g & f is_continuous_on [:CarProduct D,J:]
holds
  for e be Real st 0 < e ex r be Real st 0 < r
    & for x1,x2 be Point of CarProduct(Seg n --> RNS_Real), y1,y2 be Real
       st [x1,y1] in [:CarProduct D,J:] & [x2,y2] in [:CarProduct D,J:]
        & ||.x2-x1.|| < r & |.y2-y1.| < r
       holds |. g.([x2,y2])-g.([x1,y1]) .| < e;

theorem :: MESFUN18:38
for X be set, S be RealNormSpace, f be PartFunc of S,RNS_Real,
  g be PartFunc of X,REAL st f = g holds ||.f.|| = |.g.|;

theorem :: MESFUN18:39
for n be non zero Nat, D be n-element FinSequence,
  J be closed_interval Subset of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & f is_continuous_on [:CarProduct D,J:] & f = g
holds
  for e be Real st 0 < e ex r be Real st 0 < r
   & for x1,x2 be Point of CarProduct(Seg n --> RNS_Real), y1,y2 be Real
   st [x1,y1] in [:CarProduct D,J:] & [x2,y2] in [:CarProduct D,J:] &
      ||.x2-x1.|| < r & |.y2-y1.| < r holds
        |. (|.g.|).([x2,y2])-(|.g.|).([x1,y1]) .| < e;

theorem :: MESFUN18:40
for n be non zero Nat, D be n-element FinSequence,
  I be Subset of CarProduct(Seg n --> RNS_Real),
  J be closed_interval Subset of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  G2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & I = CarProduct D & [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g
  & G2 = Integral2(L-Meas,|.R_EAL g.|) |I
  holds G2 is_continuous_on I;

theorem :: MESFUN18:41
for n be non zero Nat, D be n-element FinSequence,
  I be Subset of CarProduct(Seg n --> RNS_Real),
  J be closed_interval Subset of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  G2 be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & I = CarProduct D
  & [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g
  & G2 = Integral2(L-Meas,R_EAL g) |I holds G2 is_continuous_on I;

theorem :: MESFUN18:42
for n be non zero Nat, D be n-element FinSequence,
  g be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
  f be PartFunc of CarProduct(Seg n --> REAL),REAL st
   f = g & g is_continuous_on CarProduct D & CarProduct D c= dom g
 & (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
 holds
  for e be Real st 0 < e
   ex r be Real st 0 < r
    & for x,y be n-element FinSequence of REAL
       st PtCarProduct x in CarProduct D & PtCarProduct y in CarProduct D
        & (for i be Nat st i in dom D holds
             ex xi,yi be Real st xi = x.i & yi = y.i & |. xi-yi .| < r)
  holds |. f.(PtCarProduct x) -f.(PtCarProduct y) .| < e;

theorem :: MESFUN18:43
for n be non zero Nat, D be n-element FinSequence,
  f be PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real,
  g be PartFunc of CarProduct(Seg n --> REAL),REAL
 st f = g
  & ( for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL )
  & f is_continuous_on CarProduct D & dom f = CarProduct D
 holds g is_integrable_on Prod_Measure(L-Meas n);

theorem :: MESFUN18:44
for n be non zero Nat, D be n-element FinSequence,
  J be Subset of REAL, y be Element of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & y in J & dom f = [:CarProduct D,J:] & f is_continuous_on [:CarProduct D,J:]
  & f = g
  holds dom ProjPMap2(R_EAL g,y) = CarProduct D
      & ProjPMap2(R_EAL g,y) is_integrable_on Prod_Measure(L-Meas n);

theorem :: MESFUN18:45
for n be non zero Nat, D be n-element FinSequence,
  J be Subset of REAL, y be Element of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg2 be PartFunc of CarProduct(Seg n --> REAL),REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & y in J & dom f = [:CarProduct D,J:] & f is_continuous_on [:CarProduct D,J:]
  & f = g & Pg2 = ProjPMap2(R_EAL g,y)
  holds Pg2 is_integrable_on Prod_Measure(L-Meas n)
      & Integral(Prod_Measure(L-Meas n),ProjPMap2(R_EAL g,y))
         = (Integral1(Prod_Measure(L-Meas n),R_EAL g)).y;

theorem :: MESFUN18:46
for n be non zero Nat, D be n-element FinSequence, J be Subset of REAL,
  y be Element of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & y in J & dom f = [:CarProduct D,J:] & f is_continuous_on [:CarProduct D,J:]
  & f = g
  holds dom ProjPMap2(|.R_EAL g.|,y) = CarProduct D
  & ProjPMap2(|.R_EAL g.|,y) is_integrable_on Prod_Measure(L-Meas n);

theorem :: MESFUN18:47
for n be non zero Nat, D be n-element FinSequence, J be Subset of REAL,
  y be Element of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  E be Element of Prod_Field(L-Field n)
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & y in J & dom f = [:CarProduct D,J:] & f is_continuous_on [:CarProduct D,J:]
  & f = g & E = CarProduct D holds ProjPMap2(|.R_EAL g.|,y) is E-measurable;

theorem :: MESFUN18:48
for n be non zero Nat, D be n-element FinSequence, J be Subset of REAL,
  y be Element of REAL,
  f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
  g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
  Pg2 be PartFunc of CarProduct(Seg n --> REAL),REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & y in J & dom f = [:CarProduct D,J:] & f is_continuous_on [:CarProduct D,J:]
  & f = g & Pg2 = ProjPMap2(|.R_EAL g.|,y)
  holds Pg2 is_integrable_on Prod_Measure(L-Meas n)
  & Integral(Prod_Measure(L-Meas n),ProjPMap2(|.R_EAL g.|,y))
     = (Integral1(Prod_Measure(L-Meas n),|.R_EAL g.|)).y;

theorem :: MESFUN18:49
for n be non zero Nat, D be n-element FinSequence,
 I be Subset of CarProduct(Seg n --> RNS_Real), J be Interval
 st (for i be Nat st i in Seg n holds D.i is Interval) & I = CarProduct D
 holds [:I,J:] is Subset of [:CarProduct(Seg n --> RNS_Real),RNS_Real:]
 & [:I,J:] in sigma measurable_rectangles(Prod_Field(L-Field n),L-Field);

theorem :: MESFUN18:50
for n be non zero Nat, D be n-element FinSequence, J be Subset of REAL,
 f being PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
 & [:CarProduct D,J:] = dom f & f is_continuous_on [:CarProduct D,J:]
 & f = g holds
   Integral1(Prod_Measure(L-Meas n),|.R_EAL g.|) |J is PartFunc of REAL,REAL
 & Integral1(Prod_Measure(L-Meas n),R_EAL g) |J is PartFunc of REAL,REAL;

theorem :: MESFUN18:51
for n be non zero Nat, E1 be Element of Prod_Field(L-Field n),
 E2 be Element of L-Field holds
   [:E1,E2:] in sigma measurable_rectangles(Prod_Field(L-Field n),L-Field)
 & (Prod_Measure(L-Meas(n+1))).([:E1,E2:])
    = ((Prod_Measure(L-Meas n)).E1) * (L-Meas.E2);

theorem :: MESFUN18:52
for n be non zero Nat, D be n-element FinSequence
 st for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL
 ex r be Real, E be Element of Prod_Field(L-Field n) st
  E = CarProduct D & (Prod_Measure(L-Meas n)).E = r & 0 <= r;

theorem :: MESFUN18:53
for n be non zero Nat, D be n-element FinSequence,
 J be closed_interval Subset of REAL,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 G1 be PartFunc of REAL,REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & [:CarProduct D,J:] = dom f & f is_continuous_on [:CarProduct D,J:]
  & f = g & G1 = Integral1(Prod_Measure(L-Meas n),|.R_EAL g.|) |J
 holds G1 is continuous;

theorem :: MESFUN18:54
for n be non zero Nat, D be n-element FinSequence,
 J be closed_interval Subset of REAL,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 G1 be PartFunc of REAL,REAL
 st (for i be Nat st i in Seg n holds D.i is closed_interval Subset of REAL)
  & [:CarProduct D,J:] = dom f & f is_continuous_on [:CarProduct D,J:] & f = g
  & G1 = Integral1(Prod_Measure(L-Meas n),R_EAL g) |J
 holds G1 is continuous;

theorem :: MESFUN18:55
for n be non zero Nat, D be n-element FinSequence,
 I be Subset of CarProduct(Seg n --> RNS_Real),
 J be closed_interval Subset of REAL,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL
 st (for i be Nat st i in Seg n
       holds D.i is closed_interval Subset of REAL)
  & I = CarProduct D
  & [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g
 holds
   g is_integrable_on Prod_Measure(Prod_Measure(L-Meas n),L-Meas)
 & (for x being Element of CarProduct(Seg n --> REAL)
       holds Integral2(L-Meas,|.R_EAL g.|).x < +infty)
 & (for y being Element of REAL
       holds Integral1(Prod_Measure(L-Meas n),|.R_EAL g.|).y < +infty)
 & (for U being Element of Prod_Field(L-Field n)
       holds Integral2(L-Meas,R_EAL g) is U-measurable)
 & (for V being Element of L-Field
       holds Integral1(Prod_Measure(L-Meas n),R_EAL g) is V-measurable)
 & Integral2(L-Meas,R_EAL g) is_integrable_on Prod_Measure(L-Meas n)
 & Integral1(Prod_Measure(L-Meas n),R_EAL g) is_integrable_on L-Meas
 & Integral(Prod_Measure(Prod_Measure(L-Meas n),L-Meas),g)
      = Integral(Prod_Measure(L-Meas n),Integral2(L-Meas,R_EAL g))
 & Integral(Prod_Measure(Prod_Measure(L-Meas n),L-Meas),g)
      = Integral(L-Meas,Integral1(Prod_Measure(L-Meas n),R_EAL g));

theorem :: MESFUN18:56
for n be non zero Nat, D be (n+1)-element FinSequence,
    f be PartFunc of CarProduct(Seg(n+1) --> RNS_Real),RNS_Real,
    g be PartFunc of CarProduct(Seg(n+1) --> REAL),REAL,
    g0 be PartFunc of [:CarProduct(Seg n-->REAL),REAL:],REAL
 st f = g & g0 = g
  & (for i be Nat st i in Seg(n+1) holds D.i is closed_interval Subset of REAL)
  & f is_continuous_on CarProduct D & dom f = CarProduct D holds
    Integral2(L-Meas,R_EAL g0) is_integrable_on Prod_Measure(L-Meas n)
  & Integral(Prod_Measure(L-Meas (n+1)),g)
     = Integral(Prod_Measure(Prod_Measure(L-Meas n),L-Meas),g0);

theorem :: MESFUN18:57
for n be non zero Nat, D be n-element FinSequence,
 I be Subset of CarProduct(Seg n --> RNS_Real),
 J be closed_interval Subset of REAL,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 G2 be PartFunc of CarProduct(Seg n --> REAL),REAL
 st (for i be Nat st i in Seg n
      holds D.i is closed_interval Subset of REAL)
  & I = CarProduct D
  & [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g
  & G2 = Integral2(L-Meas,R_EAL g) | (CarProduct D) holds
   Integral(Prod_Measure(Prod_Measure(L-Meas n),L-Meas),R_EAL g)
    = Integral(Prod_Measure(L-Meas n),G2);

theorem :: MESFUN18:58
for n be non zero Nat, D be n-element FinSequence,
 I be Subset of CarProduct(Seg n --> RNS_Real),
 J be non empty closed_interval Subset of REAL,
 f be PartFunc of [:CarProduct(Seg n --> RNS_Real),RNS_Real:],RNS_Real,
 g be PartFunc of [:CarProduct(Seg n --> REAL),REAL:],REAL,
 G1 be PartFunc of REAL,REAL
  st (for i be Nat st i in Seg n
      holds D.i is closed_interval Subset of REAL)
  & I = CarProduct D
  & [:I,J:] = dom f & f is_continuous_on [:I,J:] & f = g
  & G1 = Integral1(Prod_Measure(L-Meas n),R_EAL g) |J holds
   Integral(Prod_Measure(Prod_Measure(L-Meas n),L-Meas),R_EAL g)
    = integral(G1,J);

begin :: Integrability of continuous functions on $n$-dimensional real normed spaces

theorem :: MESFUN18:59
for n be non zero Nat, f be PartFunc of product(Seg n--> RNS_Real),RNS_Real
 holds f*(CarProd(Seg n --> RNS_Real))
  is PartFunc of CarProduct(Seg n --> RNS_Real),RNS_Real;

theorem :: MESFUN18:60
for n be non zero Nat, D be n-element FinSequence,
    f be PartFunc of product(Seg n --> RNS_Real),RNS_Real
    st (for i be Nat st i in Seg n holds D.i is Subset of REAL)
      & f is_continuous_on dom f & dom f = product D
 holds f*(CarProd(Seg n --> RNS_Real)) is_continuous_on CarProduct D;

theorem :: MESFUN18:61
for n be non zero Nat holds
   REAL-NS n = product(Seg n --> RNS_Real)
 & REAL n = the carrier of product(Seg n --> RNS_Real)
 & REAL n = product(Seg n --> REAL);

theorem :: MESFUN18:62
for n be non zero Nat, D be n-element FinSequence,
    f be PartFunc of REAL-NS n,RNS_Real
    st (for i be Nat st i in Seg n holds D.i is Subset of REAL)
      & f is_continuous_on dom f & dom f = product D
 holds f*(CarProd(Seg n --> RNS_Real)) is_continuous_on CarProduct D;

theorem :: MESFUN18:63
for n be non zero Nat, D be n-element FinSequence,
 f be PartFunc of REAL-NS n,RNS_Real, g be PartFunc of REAL n,REAL,
 G be PartFunc of CarProduct(Seg n --> REAL),REAL
 st (for i be Nat st i in Seg n
          holds D.i is closed_interval Subset of REAL)
  & f is_continuous_on product D & dom f = product D
  & g = f & G = f*CarProd(Seg n --> REAL) holds
    G is_integrable_on Prod_Measure(L-Meas n)
    & g is_integrable_on XL-Meas n
    & Integral(XL-Meas n,g) = Integral(Prod_Measure(L-Meas n),G);

theorem :: MESFUN18:64
for n be non zero Nat, D be (n+1)-element FinSequence,
 f be PartFunc of REAL-NS(n+1),RNS_Real,
 G be PartFunc of CarProduct(Seg (n+1) --> REAL),REAL,
 g0 be PartFunc of [:CarProduct(Seg n-->REAL),REAL:],REAL
 st ( for i be Nat st i in Seg (n+1)
         holds D.i is closed_interval Subset of REAL)
   & f is_continuous_on product D & dom f = product D
   & G = f*CarProd(Seg (n+1) --> REAL) & g0 = G
  holds
   (for x being Element of CarProduct(Seg n-->REAL)
       holds Integral2(L-Meas,|.R_EAL g0.|).x < +infty)
 & (for x being Element of CarProduct(Seg n-->REAL)
       holds ProjPMap1(R_EAL g0,x) is_integrable_on L-Meas)
 & (for U being Element of Prod_Field(L-Field n)
       holds Integral2(L-Meas,R_EAL g0) is U-measurable)
 & Integral2(L-Meas,R_EAL g0) is_integrable_on Prod_Measure(L-Meas n)
 & Integral(Prod_Measure(L-Meas (n+1)),G)
    = Integral(Prod_Measure(L-Meas n),Integral2(L-Meas,R_EAL g0));

theorem :: MESFUN18:65
for n be non zero Nat, D be (n+1)-element FinSequence,
 D1 be n-element FinSequence, f be PartFunc of REAL-NS(n+1),RNS_Real,
 G be PartFunc of CarProduct(Seg (n+1) --> REAL),REAL,
 g0 be PartFunc of [:CarProduct(Seg n-->REAL),REAL:],REAL,
 Dk1 be non empty closed_interval Subset of REAL,
 x be Element of CarProduct(Seg n --> REAL),
 Pg be PartFunc of REAL,REAL
 st D1 = D|n & ( for i be Nat st i in Seg (n+1) holds D.i is Subset of REAL)
  & f is_continuous_on product D & dom f = product D
  & G = f*CarProd(Seg (n+1) --> REAL) & g0 = G
  & Dk1 = D.(n+1) & x in CarProduct D1 & Pg = ProjPMap1(|.R_EAL g0.|,x)
  holds dom ProjPMap1(|.R_EAL g0.|,x) = D.(n+1)
   & Pg|Dk1 is continuous & Pg|Dk1 is bounded & Pg is_integrable_on Dk1
   & ProjPMap1(|.R_EAL g0.|,x) is_integrable_on L-Meas
   & Integral(L-Meas,(ProjPMap1(|.R_EAL g0.|,x))) = integral(Pg,Dk1)
   & (Integral2(L-Meas,|.R_EAL g0.|)).x = integral(Pg,Dk1);
