 in today's lecture we will be discussing on closures of a relation now suppose I have a set A and a relation R on the set A that is R is a subset of A x A now we have already seen that relations satisfy certain properties like reflexivity symmetry transitivity antisymmetry and so on so we will be particularly discussing on three properties reflexive symmetric and transitive so reflexive symmetric and transitive properties however to start with we will just take a general property let us say P that is let us denote the property by P suppose P is a property of a relation in particular P can be as I said reflexive symmetric or transitive property now a general relation R may or may not have P so that is our starting point so suppose a relay we are considering a relation we which does not have a prop which does not have the property P then we may ask that I would like to extend the relation to a relation and this extension should be minimal such that the extended relation has the property P for example if the property is reflexivity or let us say reflexive property and suppose R is my relation which is not reflexive I would like to extend it extend R to a relation let us say R sub P such that that R sub P is reflexive and it is the smallest reflexive relation containing R now in general let us let us give a definition with respect to the general property P and a general relation R the closure of a relation R on a set A the closure of a relation R on a set A with respect to a property P say is the smallest relation denoted by R P such that R is a subset of RP which in turn of course is a subset of A cross A now here there are certain issues that needs clarification first of all the point which is more or less clear that what we mean by a relation containing another relation because after all we have defined a relation to be a subset of A cross A on which it is defined and then if I say that the relation RP is contained in R that means R is a subset of RP as a set but a more a more critical point is that this RP has to be minimal with respect to the property the question is what do we mean by that we are coming to it shortly but let us write again the same thing a more explicitly so suppose RP is the closure of R with respect to P then what what are the properties that RP must have in other words suppose RP is the closure of R with respect to the property P then one the first thing is that RP must have the property P then second R must be a subset of RP which in turn is a subset of A cross A and third if we consider a relation S with property P containing R then and contained in RP then S must be equal to RP if S is a subset of A cross A having property P and R is a subset of S which in turn is a subset of RP which in turn is a subset of A cross A of course then S must be equal to RP and the third point specifically say what we mean by the minimal extension it means that we have a relation R here and then we have A cross A and RP is somewhere in between such that R is a subset of RP and RP is a subset of A cross A it is to be remembered that RP satisfies the property P now suppose we have some S which also satisfies the property P and which is a superset of R as I have drawn here and subset of RP then this will force S to be equal to RP so that means that we have R the relation R over here and RP on the top of it and which satisfies P but there is no and there is no relation in between R and RP satisfying P and properly contained in RP so RP in that sense is the minimal extension of R having property P now we will start looking at closures of specific relations that is closures of relations with specific properties the first property and probably the easiest property that we have in hand is reflexivity so we consider now reflexive closure of a relation suppose is a relation on a the reflexive closure of R is a relation RC say such that RC is reflexive suppose S is any reflexive relation such that R is a subset of S which in turn is a subset of RC which in turn is a subset of A cross A then S equal to RC thus we see that this is exact translation of the general case that we have discussed just sometime back considering a general property now the property is no more general this is the reflexivity property and we have said what we mean by reflexive closure of a relation now we ask the question how to find how to find the reflexive closure of a relation the reflexive closure of a relation R on a so let us be very specific that we have said suppose a is the relay is the set on which relation R is defined and we would like to know the reflexive closure now of course if R is reflexive the reflexive closure of R is R itself but we do not know that therefore we define a relation which we denote by capital delta and which is essentially the equality relation so capital delta consists of all points a a such that a belongs to a or in other words I can write it contains all pairs a b such that a, b belongs to a and a equal to b all right so this is a equality relation now what we do is that we simply augment if at all necessary these a a type of elements to R and we call that that is RC that is a reflexive closure of a relay of the reflexive closure of R and I do not think I need to explain anything more because it is very straightforward RC is equal to R union capital delta the equality relation now suppose we are given R in terms of a matrix that is instead of R we are given the matrix corresponding to R that is MR and then it is very direct that the equality relation is nothing but the identity matrix all right so only the diagonal elements will be one and rest will be a zeros so we are assuming here assuming that a is of size n all right so delta is this thing the identity matrix and MR of course is a matrix the matrix corresponding to R and if you want to know the matrix corresponding to RC so that is MRC we can just write this is equal to MR union delta because we have already told that RC is R union delta and we know that from our previous lecture that this is equal to MR or M delta and M delta essentially is the identity matrix therefore this is MR or IN where IN is equal to the N by N identity matrix all right so this is easy but well this somehow captures the basic basic idea of closure that we just add new new elements to the relation original relation R to maximally extended to its closure with respect to certain property and we have also seen here that if we write in terms of matrices sometimes it is possible to write the whole computation very neatly because we just know now that we have to just take the R of the identity matrix to the original matrix of the relation and the matrix that we get is the matrix corresponding to the closure now let us look at an example right now let us consider A to be the set 1 2 3 and 4 and we consider a relation R equal to say 1 1 then 1 2 2 3 and 3 4 not linking this one is the link this is a link I am doing it but now it will so I have to press here it was not happening actually when I press there but it was not happening but anyway all right so this is 3 4 okay now suppose we want to find out the reflexive closure of R well then we have to write down the equality relation which is very straightforward because it is 1 1 2 2 then 3 3 and then 4 4 4 4 all right now we take R union delta this gives us 1 1 and then 1 2 and then 2 2 then 2 3 then 3 3 3 4 and lastly we have 4 4 of course this is the reflexive closure if we now look at the graph corresponding to this relation then we will see that we have another way of looking into the reflexive closure so let us look at the graph corresponding to R defined on a so we have got four vertices we label them by 1 2 3 and 4 and here we notice that 1 1 is there 1 1 means there is a self loop from 1 to 1 and then we have a we have an edge from 1 to 2 and then we have an edge from 2 to 3 and then we have 3 to 4 this is the original relation given by the given by R and finding out its reflexive reflexive closure is just putting self loops at each vertex that makes each of the vertex related to itself and where there is already a self loop that is in this case 1 we do not have to do anything so this is the reflexive closure of the relation and a relation R and the graph corresponding to it again we start with R suppose R is a relation on a set A the symmetric closure RS of R is a symmetric relation containing R is a symmetric relation containing R such that S is another symmetric relation satisfying R subset of S subset of RS subset of A cross A then S equal to RS we come to the question of how to find the symmetric closure of R in order to do that we will first start by defining another relation corresponding to R which is called the inverse of R we denote it by R inverse and define as a R inverse B if and only if B R A now at this point we must not confuse R inverse with complement of R since R is a subset of A cross A there is a set theoretic complement of R which we usually denote by R over line which is essentially A cross A set minus R now when we translate it in the language of relations this will mean that A R complement B if and only if A is not related to B this is our complement but we are not here defining complement of R we are defining R inverse where we say that A is related to B if B by R inverse B is related to A by R now what we claim over here is that the symmetric closure of a relation R that we are denoting at R sub S is nothing but R union R inverse we have to see why it is true so first we have to show that R sub S is symmetric for that let A R sub S B now this implies that A R union R inverse B which implies that A R B or A R inverse B which in turn implies that B R inverse A well that is the definition of R inverse we have said that A R B if and only if A R B R inverse A so since here we have got A R B here therefore I can write B R inverse A since A R inverse B if and only if B R A now or B R A therefore we see that this is B R A or B R inverse A but that means that B is R union R inverse A which in turn means B RS A because RS is R union R inverse therefore we see that A R sub S B implies B R sub S A but that is the property that RS to have if it is symmetric and so RS is symmetric the next property that we have to show is that R is a subset of RS but that is extremely straightforward over here because RS is union of R and R inverse and therefore we can write that R is a subset of R union R inverse which is equal to RS now we come to the third property which is the minimality so now let us suppose that we have a relation let us call it T which is symmetric and which is sandwiched between R and T so suppose T is a symmetric relation on A that R is a subset of T which in turn is a subset of RS which of course is a subset of A cross A now let us start let us start from let us let us try to prove that T is equal to RS we already know that T is a subset of RS clearly T is a subset of RS we have to prove the other way round so we start it in a fresh page right so let us write again so we have R is a subset of T which in turn is a subset of RS of course T is a subset of RS it is already known now I will start from RS side so suppose that A is related to B by RS now this implies that A is related to B by R or A is related to B by R inverse this is because RS is a subset of R union R inverse now this implies that A is related to B that is all right or B is related to a okay because that is by the definition of R inverse we know that A R inverse B both the implies B R A so therefore we can write that ASB or BSA why since R is a subset of T so just let me correct this is not S but this is T so instead of S there I must write this is T because since R is a subset of T A RB means ATB B R A means BTA therefore we have come to a scenario where A is related to B or B is related to A so therefore through through R therefore since R is a subset of T I can say that A is related to B by T because it is related to B by R and R is a subset of T and or B is related to A by T now we started with the assumption that T is symmetric starting assumption is that T is symmetric okay so therefore ATB or ATB here this thing PTA is ATB because T is symmetric and therefore we have the same thing we have ATB or ATB therefore this implies that ATB now this means if we now notice from the beginning that is this to the end we have proved that AR sub ST implies ATB this implies that RS is a subset of T but already we knew that T is a subset of RS now we have got RS is a subset of T therefore we have T is equal to RS so this is what we wanted to show to prove the minimality of RS and this is what we have shown now we will consider the matrix corresponding to RS so in general we will consider matrix corresponding to a so what we want to consider now is how to construct the matrix corresponding to RS so first we have to know how to construct the matrix corresponding to R inverse now if you see that a matrix MR which corresponds to the relation R defined on a is given by Mij n x n where the number of elements in a is n on which R is defined and further to specify the matrix we need to write the elements of a in a in some order which we fix afterwards so suppose when we write in that order the elements of a is a 1 up to a n then Mij is equal to 1 if ai is related to aj is 0 if ai is not related to aj now suppose we consider the matrix corresponding to MR inverse now suppose we denote this matrix by Mij bar sorry Mij prime now Mij prime is defined in this way Mij prime is equal to 1 if ai is R inverse aj that implies aj R ai and 0 if ai is not R inverse aj which implies both ways if aj is not in not related to ai that means that M prime sub ij equal to Mji because when aj is related to ai then M sub ji is equal to 1 well then M prime sub ij is 1 therefore this relation holds and when j is aj is not related to ai then Mji is 0 and same as M prime sub ij therefore this is same thus it is clear from this that M sub R inverse that is the matrix corresponding to R inverse is equal to the transpose of the matrix corresponding to R because in the new matrix the ij is switched that means rows and columns are switched therefore we have this and now since we know that RS is equal to R union R inverse the matrix corresponding to RS is the matrix corresponding to R union R inverse which is equal to the matrix corresponding to R or the matrix corresponding to R inverse which in turn is equal to the matrix corresponding to R or the matrix corresponding to R transpose this gives a particularly straightforward method to construct the matrix corresponding to the symmetric closure of any relation and then of course from that we can write the relation or the digraph corresponding to the relation very quickly next we come to the question of finding the transitive closure of a relation the transitive closure of a relation is a relation which is transitive and which admits no transitive relation between itself and the relation under consideration so transitive transitive closure of R on a is a relation we usually define transitive closure as R superscript plus we I will read it as R plus is a relation R plus such that R plus is transitive any relation T on a which is transitive subset T subset R plus of course all subset of a Cartesian product A is equal to R plus that is T is equal to R plus so again we have the problem of finding out the transitive closure of a relation to do that we have to recall few things that we have studied in previous lectures so if we have a relation R then we can take we can compose this relation R to with itself several times for example by R square we mean the relation R composition R now when we say that a that an element a is R square B this means that there exists an intermediate element C1 let us say in the set a on which R is defined such that a R C1 and C1 R B now suppose we raise R to the power 3 then a R cube B will mean that there are elements C1 and C2 belonging to a such that a R C1 C1 R C2 and C2 R B if we go forward like this then we can define the general case that is let us say a R to the power k B all right this means that there exists C1 C2 so on up to Ck-1 belonging to a such that a R C1, C1 R C2 so on Ck-2 R Ck-1 then Ck-1 R B so we see that we can have sequence of powers of R defined in this way that is R R square R cube so on Rk and so on we can construct a relation by taking the union of all these relations so we consider the relation that we get by taking R union R square union R cube union moving in this way Rk union so on in a compact way we can write this as i equal to 1 to 8 R raise to the power i and what can be proved is that this is same as R plus that is the transitive closure of R we will stop here in today's lecture and we will continue discussions on closure of relations particularly closures particularly the closure of transitive relations in the next lecture thank you