 Welcome back, we were discussing integrals of simple functions. So, we said a function is simple if it has the following form f of omega equal to sum over i equals 1 through n little a i indicator of a i of omega. So, and we defined integral f d mu if mu is some measure on the space we define integral f d mu as sum over i equals 1 through n a i mu of a i. Now, so note that so simple function inherently. So, if you assume that this function f is written like this in its canonical representation it always partitions the sample space into n part. So, if you the omega so if that is my omega and that is my r and so what will happen is that that may correspond to a 1 and all of this will map to some value a 1 and that may be a 2 and that will correspond to some little a 2 and so on. So, this function partitions my sample space into n partitions a n will map to some a n and so on. Now, we are going to so we are going to talk about a simple random variable next a simple random variable is nothing, but a simple function defined on a probability space. After all random variable is a function defined on a probability space a simple random variable is simply a simple function that is all. So, a simple random variable omega f p let us say will have the form x of omega equal to sum over i equals 1 through n little a i i a i of omega where a i is greater than or equal to 0 here 2. So, a i is greater than or equal to 0 and a i is in f. So, here a i is events a random variable which has this kind of a form is called a simple random variable and again a simple random variable will partition the sample space into n partitions a 1 through a n and all the omegas in a i correspond to the random variable taking value little a i. So, the simple random variable takes only n values some finite number of values on the real line. So, a simple random variable is obviously a discrete random variable, but not all discrete random variables are necessarily simple random variables. So, a discrete random variable could take countably infinite values whereas, simple random variable can only take n values some finite number of values. So, a geometric random variable is discrete, but it will not be simple in our description. So, this is a simple random variable and for a simple random variable we have if x is simple expectation of x which is defined as integral x d p will become. So, this I already told you expectation of x is simply integral of this function with respect to the probability measure p the mu is now p and f is now x your random variable will be now what will be sum over i equals 1 through n a i p of a i. So, this will be sum over i equals 1 through n little a i p of a i, but a i I can write as the set of all omegas for which x is equal to little a i correct. So, this can be written as i equals 1 through n little a i probability of all omegas for which x of omega equals little a i. So, that is your expectation of a simple random variable. So, in other words in short hand we can write this as sum over a i probability that x is equal to a i or you can write this in terms of the p m f p x of little a i this is clear I am just applying this definition with me. So, that is the expectation of a simple random variable it is after all follows from the definition of a of the integral of a simple function. Now, we have to move on to more general functions functions which are not necessarily simple functions we will talk about first integrals of non-negative measurable functions. Let G from omega to R union plus or minus infinity be a non-negative measurable function. Let S of G be the set of all simple functions q from omega to R union plus minus infinity such that G of omega greater than or equal to q of omega for all omega. So, what I am going to do? So, I am given some arbitrary non-negative measurable function I want to define integral G d mu. So, what the way I am going to define this is by approximating this non-negative function from below with simple functions. So, I am going to if you give me a non-negative function G I will ask you to go and collect all those simple functions q which are less than or equal to G point wise. So, this just means that q is less than or equal to G of omega. So, q is less than or equal to G point wise. So, you go and collect all such q and call that collection S of G. So, this will be a collection of all simple functions. So, this is the collection of all simple functions which are less than or equal to G point wise. So, I am going to define definition integral G d mu is defined as supremum q in S of G integral q d mu that is my definition of the integral. So, this is a definition that is very hard to use in practice, but it is never there is a definition which will help us prove properties of the integral right away. So, let me help you understand this definition. So, as I said S of G is the collection of all simple functions which are less than or equal to G and integral q d mu where q is a simple function you know what it is. So, you go ahead and evaluate q integral q d mu for all the q's in S of G. So, you will get a for each q you get a number correct. So, as you vary q through S of G you will get a collection of numbers real numbers or may be infinity right. So, you get a collection of numbers. Now, that collection of numbers has a supremum right because every collection of real numbers has a supremum correct. So, that supremum is called the integral is defined as the integral of G d mu. So, the reason I say. So, this is mathematically perfectly well defined right, but on the other hand this is very difficult to use in practice. So, if I give some function G of x is equal to x square or something you have to go ahead and hunt for all functions simple functions which are less than or equal to that function and you have to evaluate the integral that may be an uncountable collection of functions right and you have to evaluate those integrals and find the supremum of those numbers correct. So, it is not a practically useful definition, but it is nevertheless a definition that helps us prove the number of properties about integrals. We will later see that this will lead to a more practically useful definition of the abstract integral as well. For now this is a mathematically consistent, but practically useless kind of a definition, but we will prove some properties with this definition. So, one thing I want to point out is that this supremum may not be attained right. If the supremum exist, but that supremum may not be attained for any particular q in S of G right. They may not be a particular simple function which attains this supremum right, but it is well defined nevertheless properties. So, I will state some properties of the integral itself and because we are studying probability I will specifically stated for the case of random variables and probability measures. So, that is something that is more useful to us right. So, first I want to say that. So, if a belongs to f then integral I a d mu is equal to mu a and what is the probability version of the statement. So, this is for any measure and I am going to state this now for a probability space. What will this look like? So, if a is an event if a is an event expectation of I of a which is this I a d p will be into expectation of I of a is not it is equal to what? P of a probability of a right the clear mu of a will be P of a right because I am talking about a probability measure and integral I a d p will be the expectation of the random variable indicator random variable I a. So, the expectation of the indicator random variable is always the probability of the expectation of the indicator random variable of event a is always equal to the probability of a right. How is how do you prove this? Sometimes things are so trivial you get confused right. So, this is already in the. So, if you have I a it is already in the simple form right. So, it is like saying f of omega equal to I a of omega correct. So, the integral is simply equal to mu of a correct it is a direct consequence of the definition of the integral right there is practically nothing to prove here fine. Second if g is non negative measurable then integral g d mu is non negative and in this case I am going to say if x is a non negative random variable then what expectation of x is non negative. So, do you see I mean these 2 are the same statements effectively I am just this is for a probability space this is for some arbitrary measure space. Now, how do you prove that? So, the reason this is true is because you are taking essentially the supremum over. So, these simple functions will have will they will all be non negative where you are taking non negative supremum over a set of non negative numbers. So, this will follow is that clear this also very trivial. If g equals 0 mu almost everywhere then integral g d mu equal to 0. So, now what should the probability statement be say x is equal to 0 almost surely if x equals 0 almost surely expectation of x equals 0. So, g equals 0 mu almost everywhere means g is 0 except possibly on a set of mu measure 0. We do not know what this mu measure is it may be some other measure, but on a set of mu measure 0 it may be non 0, but everywhere else it is 0 that is what this means. How do you prove this? You can prove this from the definition it is because see you have to approximate from below g has to be approximate from below with simple functions correct. So, if it all. So, if you want to look for simple functions which are lower bounding g those simple functions can be non 0 only on 0 mu measure set correct. So, all these guys will have 0 integrals and you are taking supremum of 0 right. So, let me write this down for all proof for all q in s g. So, for all q in s g we have q of omega equal to 0 for all omega such that g of omega equal to 0 implies for all q in s g integral q d mu will be 0. So, q of omega. So, whenever g of omega is 0 q of omega has to be 0 right on the set of on the set where g of omega is non 0 q of omega can be anything less than g of omega, but the set where q can be non 0 has measure 0 right. So, this has to be this integral of q has to be 0 for every q in s g correct. Therefore, the supremum of all these numbers is also there. So, it is. So, although this definition is very difficult to use to compute integrals it is already helping us prove some not very trivial properties sorry q of omega being a simple function is always non negative right simple functions are defined to be non negative little a i is always greater than or equal to 0. I have not come to talking about integrals of functions that can take negative values as well I will actually now may be a good time to do that. In fact, I will continue with properties. So, if you have. So, I will continue with that in a little bit. So, if you have a function. So, let f from f for g let me just use f from omega to r union plus minus infinity be an arbitrary measurable function. Then write f is equal to f plus minus f minus where f plus of omega greater than or equal to 0 f minus of omega is greater than or equal to 0 for all omega in omega. So, what I am going to do is if you give me a function which takes negative values as well as positive values for various omegas. I am going to go ahead and resolve it as f plus minus f minus where these are this is the positive component this is the negative component. So, in picture what I am doing is let say this omega simply real line for the sake of argument. So, if you have a function f that looks like that let say it looks like that. So, this is a function that takes both positive and negative values I will keep f plus as the part above the. So, I will only that will be my f plus and my f minus will be not that, but the flip version of that. So, because f minus I want it to be non negative. So, I will take my f minus to be you know the flip version of that it will be like that. So, that f can be written as f plus minus f minus for all omega. So, this is clear now I am going to define. So, I am going to do something very logical. So, define integral f d mu as integral f plus d mu minus integral f minus d mu and this is well defined as long as at least one of the integrals is finite and undefined otherwise. So, what I am trying to say is you resolve your function which takes positive and negative values into f plus minus f minus. Now, f plus and f minus are both non negative measurable functions. So, if you want explicitly write. So, f plus is simply max of f comma 0 is not it and f minus will be minus min of f comma 0. So, that formally those are the definitions of f plus and f minus for each omega. So, and then you define integral f d mu as the integral f plus minus integral f minus and these two things are well defined. How do you define these? These are non negative functions. So, you can use this earlier definition. So, these two are always well defined. Now, the question is this minus that well defined. See now there are several possibilities it may be see this guy is a non negative function. So, it is integral must be non negative. So, it may be a non negative real number or it may be plus infinity. So, this integral may be some real number or plus infinity. Similarly, this integral may be some real number or plus infinity. If they are both real numbers finite, then this will be one real number minus some other real number perfectly well defined no problem. If this were to be infinity and this were to be some real number, then you have infinity minus some real number which you call plus infinity no problem. So, the totally four possibilities this will be. So, let us say this is finite and that is plus infinity, then you will have real number minus infinity which is minus infinity that is also no problem. The last situation is where this is infinity and this is infinity. Then infinity minus infinity is not defined. So, except when. So, in the case when both this integral and that integral are both plus infinity this integral is not defined. It has no meaning, but in all other cases it has a meaning. You either be a real number or will be infinity or minus infinity, but infinity minus infinity has no meaning. Is that clear? So, we have actually defined now integral over of any function integral of any function over the space is well defined now any measurable function. It is well defined as long as not both of them are infinity and finally. So, while I am at it. So, I will define the last bit also when. So, let a be f measurable and f an arbitrary measurable function. Then integral over a f d mu that is what I want to define. So, this is if I define that also I am done defining everything that I want to define. Then I can continue with properties. So, I am now integrating not over the whole space. So, far I have been integrating over the whole space. Remember if I do not put anything here it means I am integrating over omega. Now, I am not integrating over omega I am integrating over a particular f measurable set a. Now, this is by definition equal to integral f i a d mu. What is this mean? This is the product of f and the indicator of a. So, this will take value f whenever the omega is in a. Otherwise this integrand will be 0. This is the definition of this and this is well defined because f is a measurable function i a is an indicator of a event. So, i a is a measurable function and you can show that product of 2 measurable functions is always a measurable function. So, this guy inside the parenthesis is a measurable function and you know how to talk about integral of a measurable function d mu like that no problem. So, far everybody find with the definition so far. So, now then we can proceed with some more properties. Let G let me write let H greater than or equal to G greater than or equal to 0. Then integral H d mu greater than or equal to integral G d mu which is itself greater than or equal to 0. And for the random variable version this will look like. So, the random variable version this will look like if x greater than or equal to y then expectation of x is greater than or equal to expectation of y. So, how do you prove this? You have so now you have to do 2 things. So, you have so let us I mean I am just taking to non negative functions now. You can actually prove this even more generally, but let us once you prove it for non negative function it is easy to prove for in more generality. Now, H is bigger than or equal to G which means the remember S G correspondingly there will be S H. So, S G will consist of all those simple functions which are less than or equal to G and S H will consist of all those simple functions which is less than or equal to H, but H is always bigger than or equal to G. So, S G is contained in S G is contained in S H because of this is this clear. Every simple function which is less than or equal to G is also necessarily less than or equal to H, but there may be simple functions here which are not here because H is may be bigger. So, what so this is now you can easily prove what you want to prove because now you are supremizing over a bigger set the integral H D mu is the supremum over S H and integral G D mu is the supremum over a smaller set S G. And therefore, the supremum over a bigger set is always bigger than or equal to supremum over the smaller set and this will follow correct. Any questions? If G equals H G equals H mu almost everywhere then integral H D mu equals integral G D mu. This is a very important property and the corresponding random variable version will be what if x equals y almost surely then their expectations are equal. If x equals y almost surely which means that they only differ on a set of probability 0 then expectation of x expectation of x equals expectation of expectation of y. So, this is saying that if you have any two functions which differ only on a set of some mu measure 0 then the corresponding integrals will be equal if you are integrating with respect to that measure. So, for example, if mu were to be lambda the Lebesgue measure and if say two functions both we defined on the real line for example, if two functions are equal except on a set of Lebesgue measure 0 then their Lebesgue integrals will be equal correct. Consider for example, the Dirichlet function we studied. So, the Dirichlet function is 0 except on a set of rational which is a measure 0 set. So, the integral of the Dirichlet function is same as the integral of the function which is 0 everywhere so on the integral is 0. So, that is why this is saying. So, colloquially this property can be stated as if you change the value of the function on a measure 0 set of points the integral does not change. But both these mu's should be the same they differ only on a set of mu measure 0 then the integral with respect to that measure will not change. You cannot have like different you cannot have a Lebesgue measure here and some other measure here that does not work. This measure and this measure must be the same and similarly if two random variables are equal with probability 1 then expectation of x is equal to the expectation of y. So, this proof again follows from the definitions. So, any difference lies in a set of mu measure 0 and for the simple functions if you try to approximate them from simple functions the mu this the term where you consider the measure of the set will be 0. And therefore, you will find that the integrals are equal. Number 6, if g greater than or equal to 0 is such that integral g d mu equals 0 then g equals 0 mu almost everywhere. So, this is the converse to a property we have already studied right. We said if g equals 0 except possibly on a set of measure 0 the integral is 0. But now we are saying that if the integral is 0 then g is 0 mu almost everywhere. But this holds only if this is only for non negative functions. If g can be negative you may well have a situation where the this part and this part cancel out right the integral f plus and if integral f minus may cancel out. But if you only have a non negative function whose integral is 0 then the function itself must be 0 mu almost everywhere. And the random variable version will be if x greater than or equal to 0 is such that expectation of x equals 0 then x is equal to 0 almost surely.