 Let us go to the next one, continuity. So function, so let us look at this, let us think of let f be this function and I will think of it as a function of n variables taking real values. It can also be a vector function, it is not very hard to extend this to vector function. So it is a function for that takes from Rn to R that means it is a function of n variable and the eventual value that it outputs is a real number. Now we say f is continuous at a point x in Rn if the following holds for every epsilon greater than 0 there exists a delta greater than 0 such that we say f is continuous at a point x in Rn if for every epsilon greater than 0 I can find a delta greater than 0 such that the difference f y minus f x if I look at it in absolute value is no more than epsilon for all y's that are within a delta radius ball of x. So the challenge is thrown in this way you set how close you want your function value to be that is your epsilon you throw me an epsilon and the challenge is that I will be able to find for your delta such that if I look at the function values in the delta radius ball around x look at y is that lie in a delta radius ball look at these y's that lie in a delta radius ball around x then the function values f of y are no more than plus minus epsilon from f of x ok f y minus f x is at most epsilon in absolute value if you can do this alright then we say that the function is continuous at the point x. So we say the function is continuous at x continuous simply so we say f is continuous if it is continuous at all points. So there is another way of now this is a complicated somewhat complicated definition because it is it is posed in terms of this kind of a challenge there is another way of there is another equivalent way of writing this which is the following which is using the language of sequences. So suppose if I have so we say that f is f is continuous we say that f is continuous at x if suppose you take if you take any sequence x k like this that converges to x take any sequence that converges to x then along that sequence you look at f of x k look at the sequence f of x k its limit should be equal to f of x in the language of sequences what the continuity definition is basically saying is you take any sequence of points x k in the in the in the domain of the function domain space of the function and look at the value the sequence of values that gets generated in the ring then that sequence of values is itself a convergent sequence which converges to the value of the function at that. So another in effect what it is saying is limit of f of x k is equal to f of limit of x k. So the limit basically jumps inside the evaluation of the function this is what we mean by continuous. Okay now this then brings us back to optimization. So I had told you that I had told you through the through Queen Dito's problem why it is actually why we cannot take for granted the existence of a solution to an optimization problem because if the solution does not exist you can sort you can get all kinds of absurd conclusions just by arguing inductively without without checking the existence. So we need a way of checking for the existence of a solution that does not entail finding a solution in the first place. Without finding a solution you should be able to be guaranteed rest assured that the solution at least exists then you can go about finding it if you want to. So that is what is guaranteed by this theorem of Weistra. So for me to write Weistra's theorem we should first write out what we mean by an optimization problem formally. So the way I stated the optimization problem previously was this. We are looking for a you have a function like this say a function from R n to R suppose and you have a set S is a subset of R n and what we want is a x star in S such that f of x star is less than equal to f of x for all x in S. Effectively what we want is this if you look at the set of values that f takes over the set S look at the set of values that f takes over the set S so f x such that x belongs to it look at this set what we want is effectively the infimum of that set you want the least we want the greatest lower bound for on that set because we because f of x star is the least possible value of f in this particular set. But then that is this is the but when you think if you look at if you if you think of it this way this creates a the following question how do we know we know that the infimum exists for every bounded set and infimum exists thanks to completeness axiom but the but the completeness axiom does not tell us that the infimum is of the form f of x star for some point x star in the set. So how do we know so this quantity exists as a real number but how do we know does there exists an x star in S such that f of x star equals this particular is clear so so these are two this brings us to two separate questions one is when is the infimum itself finite the second is when is there a matching when is when is that infimum actually achieved by a point in the set. So if there exists such an x star we say the if so we say the infimum is attained by x star in that case it is both so if the infimum is not attained by x star then it is not meaningful to look for such an x star it is not present in the set of alternatives that you are searching for but it is meaningful nonetheless to look for the infimum of f nonetheless that is me that is that is meaningfully although the x star finding the x star itself may not be meaningful. Let me give you an example let us look at this function here. I have this function on real so this is the domain of the function here I am plotting plotting its values. So the function looks like this it is it is decreases up till this point say suppose point A now at point A at point A there is a jump discontinuity at point A its value is actually here not here. So the value of the function at A is this bold dot here and then from here it increases supposedly nearly this. So now this is my function here plotted out here my S is just real numbers. So can someone tell me what is the what is this you are tempted to say f of A but then f of A is this and that is certainly not the minimum value of f. So what is so it is meaningful to talk so what is this particular thing this particular thing is this point here the point to which the function tends to from the left the value of the function to which it tends to from the left but there is no point in the domain where it takes that particular value. The best bet was A itself but for A the point the value is up has been has jumped up. There is no point in the domain for which this thing is attained. So this limiting value is attained. So this is the case where as I said this quantity exists this one exists and is finite it is some finite number it is this this height here but there is no x star. So this is the case where the infimum exists but is not attained. So this is equal to this height. Let us take another example look at the function e to the minus x and suppose S is 0 to infinity e to the minus x how does this look at x equal to 0 this is going to be 1 and then it will decrease exponentially like this. Now what is again question here is again what is this what is this infimum 0 right after all that that is the the greatest lower bound for all the function values of f. So this is equal to 0 but then what is the x star there is there is no there is no finite x star I mean there is no there is no number there is no nothing that we can call as a real number which attains this value x which gives you this particular infimum value. So there is again in this case there does not exist an x star such that f of x star equals this infimum. Now as you can see this is an issue that you are faced with typically you would start with an optimization problem you have a domain that that is specified in us in a sort of implicit way you cannot enumerate every point and check what is happening in the domain. There are a function also whose terrain you complete you do not completely understand the function is specified in some sort of black box fashion for you do not know the full how the undilutations are where the function is higher where it is lower where it may have jumps or any of that with that kind of knowledge you now need to make sure that none of these kind of cases happen that there is actually a that the that the infimum is in fact attained and that is it is meaningful to look for a solution x star for this for the optimizations of right. So that is what Weister's theorem gives you. So now I will state the theorem let s be a subset of Rn that is closed and bounded in other words it is compact let f be a function from Rn to R that is continuous then f attains attains its infimum on x that is there exists an x star in s such that f of x star equals infimum of f of x as x range over there is such a thing called as in this case this case our notation changes we are not then we are not looking that we do not call it the infimum in this case we when the infimum is attained we use the notation minimum is the notation used should denote that the infimum is attained let me end with one small observation which I made last time also but I will just make it more concretely I have been talking about in optimization I have been talking about minimizing function right here you are looking at out here to see I am talking of f x star less than equal to f x. So I am looking at values that are lesser than all other values but that is not so if you are if you are looking for suppose you are you have a function g and you wanted to look for you wanted to find suppose g is a function from Rn to R and you have some subset s of Rn and you are looking for a x star such that g of x star is greater than equal to g of x for all x. In this case the problem you are trying to solve is that of a supremum of this supremum of g of x as x ranges over s and the question is whether this this is attained by some g of x star. Now what this that it is very easy to map this back to the setting that I the setting that we have considered which where we are looking to minimize rather than maximize and that is by simply taking f x as minus g x identically equal to minus g x. If f x is minus g x then the supremum of this is simply the supremum of minus f x as x ranges over s which is it is easy to show is the same as negative of the infimum of f x. So infimizing f is equivalent to supremizing f right. So as a result without loss of generality we will just always work with minimization because that also is very is somehow fits very nicely with the convex shape of functions and convex side.