 So, what do we do? We want to apply the implicit function theorem. What do we do? We are only looking at the scalar case here by the way. We have assumed that A and B are scalars for this proof. You can also do the vector proof, but I am just keeping the discussion simpler by assuming scalar A and scalar B ok, which means what that the essentially means that your states are scalar states ok alright. So, what do I do? I basically write this as a function. This is the idea. This is that function ok. You will see why. If you look at this function, it is a function of A, B and Z ok. You already know the A, B. I have used the same notation where it was A x B x. Here it is A B. I have for the moment assumed that A and B are independent variables themselves and the x dependence are forgotten. It is actually irrelevant. So, we do not write the x dependence of anything because that way A is dependent on x, B is dependent on x and Z is also dependent on x. But the fact is when I write this expression, x does not explicitly appear anywhere. This is just a function of A and B right. So, I leverage that to just forget the x dependence and I write a function H ok and this function is B z square minus 2 A z minus B cube equal to 0. Why did I write this? Because the solution of that is this guy. If I solve for Z, you see this is a quadratic in Z right quadratic function in Z. If I equate it to 0 and I solve for Z, this is exactly the expression I will get. This is the control except for the negative sign ok. Again negative sign is irrelevant. Negative is smooth then negative is smooth. So, this is actually the expression for the control in the scalar case right. So, that is why this H has been chosen not chosen by some magic or anything pretty straight forward. So, what do we say we consider this function H of A, B and Z 3 variables. It does not matter like I said this x and y were different dimensions. So, I can club these two as one variable and this as one variable pretty simple does not matter ok. This is a scalar function of three variables equated to 0. Now, I also consider the set S in R 2 which is a set of all A, B except this. Why do you think I removed this point this particular region if you mean? Why do you think I removed this from set S or from R 2? This is a case that cannot occur by the CLF definition, cannot occur by the CLF definition right. Because if B is 0 A has to be negative or whatever yeah that is the CLF requirement yeah. So, although I have forgotten that they have a function of x, but I have to remember that there is a CLF requirement. So, CLF requirement says that if B is 0 A has to be negative. So, this is not a case that can appear therefore, I ignore this region what is that region? So, essentially it is this entire blue thing that I have drawn except for this axis the right half. So, this is the right half this entire line is not there everything else is there in the set S clear ok great. So, now I have essentially solved this solved this equation and now I can write this as tuples what is three tuple yeah A B and Z as a function of A B this is the from the implicit to the explicit this is the implicit and this is the explicit version ok. Here what Z A B is defined as 0 when B is 0 and Z A B is defined as this guy when B is non-zero ok exactly the universal formula for the scalar case ok exactly the universal formula for the scalar case. Now what pretty simple I compute the here I needed to do del f del y in this case I need to do the take the Jacobian with respect to Z this is the Jacobian I hope you are used to this it is basically taking partial with respect to multiple variables when you take then it is a Jacobian here I am still taking with respect to one variable, but still I would use the word Jacobian because you will use it in several places in the future. So, what is it I take partial with respect to this y variable in this case a y variable is actually the Z in this case yeah because I am writing y as g x right. So, therefore this is partial with respect to Z that I have to verify what is that it is just twice B Z minus twice A yeah ok. And now I compute it for these two cases ok. So, twice B Z minus twice A. So, when B is equal to 0 is just twice minus twice A right if B is equal to 0 this guy is gone ok, but when B is non-zero I have to substitute Z here in terms of A B because these are my independent variables if you will I am resolving in terms of A and B. So, when B is non-zero I substitute Z here and I get this guy ok and I get this guy ok. The good thing to Z is I have mentioned that this is non-zero for all A, B and S, but actually it is positive ok is actually positive for all A, B and S because this is positive this is also positive because I have chosen the positive one I mean that is just notation here ok. So, but the important thing is non-zero which is what we require full rank in this case full rank is just non-zero scalar the scalar right the Jacobian is a scalar. So, full rank is non-zero and it is. So, I can immediately invoke the implicit functions theorem to say that Z A B is the unique solution further Z A B is smooth. The only thing we need to note is that when definition 2.7 holds your A and B are always in the set S that is if you have a CLF then your A, B are always in the set S ok. So, therefore on this set S I have already shown that Z A B is a unique smooth solution ok on the set S this Z A B that we have is a unique smooth solution. So, this is a very by the way in general mathematics analysis and all this is a very standard way of proving smoothness ok. This is how we do it using implicit function theorem. Somebody asked me to prove smoothness of some solution or something just think at the back of your mind think that implicit function theorem has to be invoked ok. So, then you then the only big creativity here is constructing this sort of a function that is the creativity here that I constructed this function because the solution of this function gives me the universal control formula in this case. In a different context it might give me something else. So, the only creativity required is to construct this smartly. Once you do that all you have to prove is that the solution is what you are looking to prove to be smooth and the Jacobian is or the derivative or the first partial is non-zero or full right that is it ok and we have done that ok alright. Anyway continuity at the origin is anyway consequence of the small control property. So, we are not you know concerned about it. Remember that this analysis is not for the origin itself because these conditions are stated as if x is not equal to 0. All the CLF definitions are essentially saying if x is not equal to 0 this happens x is not equal to 0 yeah. So, they are not for the origin. So, the continuity at origin is basically from the small control property ok nothing else that is the idea alright excellent. Let us try some I mean I am also going to try with you yeah how we can construct some CLFs and then we try to get some controls out of it and so on and so forth ok alright. So, we start with simple things this system ok we have been doing this working with I mean I have shown you different forms of the system without the control now I am giving you something with the control it is a double integrator. It is a double integrator dynamics very relevant because a lot of mechanical systems can be reduced to double integrators ok alright position and velocity states derivative of second state is acceleration and typically acceleration is what you control ok. So, very simple connection with mechanical systems. What do you think will be what do you think I should choose as my V as my control Lyapunov function. So, do you remember what we chose as a of x 1 square plus x 2 square let us let us revise for ourselves the CLF definition. So, that we do not what we want with the CLF it has to be first of all this right that it is a candidate Lyapunov point this is too easy yeah most functions we choose as CLFs. The next one is if the contribution of the control terms are 0 then we want the drift vector term to be strictly negative for all non-zero states all non-zero states this system at 0 state this can be 0 no problem nobody cares because you are already at the equilibrium, but when the state is non-zero this has to give a negative contribution this is what is this requirement for a CLF ok. So, let us keep that in mind when we try to design ok fine let us try this simple one what is it let us try half x 1 square plus x 2 square ok half x 1 square plus x 2 square. So, what do we do we try to find the first of all what is the drift vector field here what is the drift vector field we will do all the competitions formally there is a quick way also, but I will not do the quick way see the quick I will tell you what is the quick way quick way is compute v dot then you have x 1 x 1 dot the way we are doing earlier x 2 x 2 dot this is x 1 x 2 plus x 2 times u. So, whatever multiplies v dot is a this is b x this is the simple quick way if you want to do the longer way you have to write f 0 x f 1 x del v del x and all that ok, but this is the quick way because if you see this is how it is comes out to be right every time you see this expression right here this guy this expression is illustrative enough. So, this v dot is always a x plus b transpose u. So, using this I can always compute a and b and what do I want for a CLF I want that what is the CLF requirement now well first of all it is a candidate Lyapunov function anyway. So, I mean that is oops that is done I want what what is my requirement for CLF second condition in terms of a and b in terms of a and b because I have written already a and b for all x not equal to 0 I need what yeah if b of x is actually 0 then a of x has to be negative ok b of x is actually 0 then a of x has to be strictly negative ok let us investigate this requires investigation b of x 0 implies what in our case it implies x 2 is 0 ok that the only way that b of x is exactly 0 and this implies what that x 1 x 2 is also 0 which is equal to a of x right and this is a problem right it is not negative right not negative right because it is actually 0 a of x tends to be actually 0. So, not a CLF not a CLF disappointing not a CLF such a simple example we started with we failed here so annoying do you see you understand that what do we need we need that whenever b x is 0 the a has to be negative strictly negative for all non-zero x so when is b 0 when x 2 is 0 only way for b to be 0 is x 2 0 is in fact if and only if right right there is no other way about it now I want a to be negative but let me see what happens to a a is x 1 times x 2 so whatever is x 1 it is irrelevant even for non-zero x 1 this is 0 which means a is exactly 0 but I want a to be negative ok. So, there is a problem so this function is not a CLF now what if you remember all the modifications in v I did for that then analyze this kind of a system we analyze this kind of a system what is a good control by the way for this system anybody remembers we did this now I mean I did not write the u I did not use the letter u but I gave some system a double integrator system linear double integrator what was it in the second dimension what is the control you would give for this system to stabilize you think minus x 1 minus x 2 this is the damper spring mass damper go back to spring mass damper ok like remember a target system and try to match it with the target system target system spring mass damper so I just give you as minus x 1 minus x 2 that seem to work you remember what kind of the apno function I used to prove that that the system was stable in that case it was complicated not very straight forward it was not straight forward you if you remember x 1 square plus x 2 square did not work because it is not a strictly apno function ok I do this I do this anyway I will see what happened I am not sure what happens but yeah so I compute v dot again well try the simpler way of doing thing so this x 2 plus x 1 times x 2 dot plus x 1 dot which is u plus x 2 right plus x 1 x 1 dot which is x 1 x 2 right ok I just completed the derivative substituted things now I know that everything multiplying u is the b and everything not multiplying u is the a right so what is the ax in this case ax is x 1 x 2 twice x 1 x 2 in fact plus x 2 square ok and b axis right it is x 1 plus x 2 ok ok we do the same analysis again for all x non-zero what happens if same thing I write b x is 0 we need ax to be negative right now when is b x in this case 0 x 1 equals minus x 2 correct correct ok now this implies what 2 x 1 x 2 plus x 2 square is actually equal to what if I substitute x 2 equals minus x 1 or x 1 is minus x 2 this minus x 2 square whichever one right either one this is equal to ax and this is negative because x is non-zero right is negative ok this is good yeah yes they have a green tick yes yeah this is a CLF if you look back at your notes and you check out what we did for this spring mass damper example x 1 dot is x 2 x 2 dot is minus k 1 x 1 minus k 2 x 2 just the k 1 k 2 scaling was there this is exactly this yeah we had this kind of a function ok so you know that this this is not a strict Lyapunov function ok so it is not a CLF either ok CLF is something more a CLF lets you choose a control yeah in this case you would not have been able to choose a control ok which will show you stabilization with the Lyapunov function of course with Lassal invariance yes but entire the entire idea of CLF is based on Lyapunov theorems and Lyapunov functions not on Lassal invariant Lassal invariance as you remember is a more very general sort of a result it is cannot does not align with how the Lyapunov theorems go Lyapunov theorem you can just recall how the proof of Lyapunov theorems went how the proof of Lassal invariance went 0 connection between the two yeah 0 connection like completely world apart in fact for Lassal invariance you do not even need to start with the positive definite V there is not a requirement positive definite V is not a requirement yeah so so these rely on Lyapunov theorems therefore wherever the Lyapunov theorem fails it will not turn out to be a CLF it will be something different ok it will be a it has to be a CLF yeah so in this case this is what is a CLF ok so I think I that is why I have given you ok I gave you a nice hint for this system this is this is a small extension of what we did ok so this is how you this is the procedure though or I mean of course choosing this is still you know a little bit of a guesswork but this is a lot of procedure how you check ok now now absolutely absolutely it is not like there is no easy path there if I give you a problem I will give you a hint also can you guys just tell me or try to guess without going into what I gave you as a another V forget what I gave you as another V do you do you folks think you can guess what I can add here suppose let us see notice that this pieces are inside this V right X2 square plus X1 square is also here right there are some additional terms that is all so forget what I gave can you add some term here to make it a CLF to this guy mixed terms are allowed so so remember how are we so this is one nice hint I will give you that we are typically choosing Lyapunov functions as quadratic forms right I mean we remember we made this equivalence if you have a positive definite matrix then you have a positive definite function so therefore Lyapunov functions can be those quadratic forms so your V is can be typically in this form X transpose Px now we have exploited a very small now what do we need we need that so what do we need we need that this P be positive definite correct we need this P to be positive definite alright now this is a very very simple example of this right it is just one in the diagonals and zeros here too simple and I can have more complicated version where I have something in the diagonals but still this is positive definite right all I have to do is check the determinant right for this 2 by 2 case I will have to take the check the determinant pretty easy right so for the two dimensional case all I need is this is positive this is positive and the determinant is positive that is it so so mixed terms are allowed all I am trying to say is mixed terms are allowed as long as the magnitude of the mixed term is small ok now do you think that will help us not an x2 square term see the see the only thing I can add here is a mixed term I can tell you that there is no other yeah because x2 square is anyway already there so what so now suppose I add this alpha x1 x2 because this is the only other unique term I have of course you can do funny thing like sin x1 sin x2 you know that is up to you I would not go there I would start with these kind of things exponential x1 x2 one can probably think maybe it will work also I am not denying it yeah but I am saying you should start with this simple case and then try to add terms to it rather than try to guess this guy this is coming from some fundamental logic which I know you do not know as of now ok you will know soon but right now you do not know why this works ok so for you it is simple thing to add some alpha x1 x2 suppose I did now what happens I add some terms in the derivative right so I am going to delete this just to make some space for me so this is plus what alpha x1 dot x2 plus alpha x1 x2 dot let us see if this works and then what alpha x1 dot x2 is alpha x2 square and this is alpha x1 u already nice things have happened you see why now if bx now bx is not just this bx also has this ok so bx equal to 0 implies x2 is minus alpha x1 right x2 is minus alpha x1 ok now what do I get for ax in this case implies ax is what so you tell me it is minus alpha x1 square from here from the first term from this guy I will get alpha cubed plus alpha cubed x1 square right so if alpha is less than 1 I am done right yeah so what is this this is basically minus alpha minus alpha cubed x1 square so if alpha is less than 1 I am good right and I can also I believe if alpha is less than half a positive definite right this will remain positive definite less than half whatever that is I mean greater than 0 for all alpha what 1 4th minus alpha square 1 less than half this will work I am just computing the determinant it has half half and alpha by 2 alpha by 2 actually so it is 1 4th minus alpha squared by 4 so alpha less than 1 did you just say that only oh thanks oops you were right alpha less than 1 works here also and here also alpha less than 1 I apologize sorry ok alright yeah yeah so alpha less than 1 works ok so all you need to do is alpha less than 1 all you need is add this one term whereas I added two terms whatever I made slightly more complicated things yeah so do not go by what I constructed you just add terms start with the usual quadratic simplest quadratic x1 square x2 square x3 square then you add terms you will get something ok it is not that bad and once you constructed what is CLF ok you can construct a controller universal formula if nothing else works universal formula if you cannot guess universal formula awesome right ok.