In each ordered pair the 64257rst component is an element of and the second component is an element of Example Cartesian product If and ab cd then ab cd ab cd Determining If and are 64257nite sets then 57527 because there are choices for the ID: 22731
Download Pdf The PPT/PDF document "Cartesian Products and Relations Denitio..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
CartesianProductsandRelationsDenition(Cartesianproduct)IfAandBaresets,theCartesianproductofAandBisthesetAB=f(a;b):(a2A)and(b2B)g.Thefollowingpointsareworthspecialattention:TheCartesianproductoftwosetsisaset,andtheelementsofthatsetareorderedpairs.Ineachorderedpair,therstcomponentisanelementofA,andthesecondcomponentisanelementofB.Example(Cartesianproduct)IfA=ff1;2g;f3ggandB=f(a;b);(c;d)g,thenAB=f(f1;2g;(a;b));(f1;2g;(c;d));(f3g;(a;b));(f3g;(c;d))g:DeterminingjABj.IfAandBarenitesets,thenjABj=jAjjBjbecausetherearejAjchoicesfortherstcomponentofeachorderedpairand,foreachofthese,jBjchoicesforthesecondcomponentoftheorderedpair.CartesianProductisnotcommutativeForthesetsAandBoneparagraphabove,BA=f((a;b);f1;2g);((a;b);f3g);((c;d);f1;2g);((c;d);f3g)g:Thisexampleshowsthat,ingeneral,AB6=BA.TheunderlyingreasonisthatifAandBarenon-emptyandoneset,sayA,containsanelementxwhichisnotinB,thenABcontainsanorderedpairwithrstcomponentequaltox,butBAcontainsnosuchorderedpair.TheconditionthatAandBarenon-emptyisrequiredbecauseofthefollowingProposition.PropositionCPR1.IfAisaset,thenA;=;and;A=;.Proof.WearguebycontradictionusingthedenitionofCartesianproduct:SupposeA;6=;andconsider(x;y)2A;.Then,bydenitionofCartesianproduct,y2;,acontradiction.Therefore,thesetA;mustbeempty.Theproofthat;A=;issimilar,andisleftasanexercise. PropositionCPR2.IfAandBaresets,AB=BAifandonlyifA=B,orA=;,orB=;.Proof.(()IfA=BthensubstitutingBforAgivesAB=AA=BA.IfA=;orB=;,thenbyPropositionCP1,AB=;=BA.())SupposethatAandBarenon-emptysetsandAB=BA.Letx2A.SinceB6=;,thereexistsanelementy2B,sothat(x;y)2AB.SinceAB=BA,wehavethat(x;y)2BA(too).BythedenitionofCartesianproduct,x2B.Therefore,AB.SimilarlyBA.Thus,A=B. ItissometimestruethattheCartesianproductdistributesoverothersetoperationssimilarlytothedistributivelawofmultiplicationoveraddition.1 PropositionCPR3.LetA;BandCbesets.Then,(a)A(B\C)=(AB)\(AC);(b)A(B[C)=(AB)[(AC);(c)(A\B)C=(AC)\(BC);(d)(A[B)C=(AC)[(BC).Proof.Weprovepart(b)andleavetheproofsoftheremainingpartsasanexercise.Wehave(x;y)2A(B[C),x2Aandy2B[C,(x2A)and(y2Bory2C),[(x2A)and(y2B)]or[(x2A)and(y2C)](byadistributivelawoflogic),[(x;y)2AB]or[(x;y)2AC],(x;y)2(AB)[(AC). Exercise.Investigate,andproveordisproveasappropriate,similarstatementsinvolvingthesetoperationsrelativecomplement(AB),andsymmetricdierence.Denition(relation).ArelationfromasetAtoasetBisasubsetofAB.A(binary)relationonAisasubsetofAA.Itisimportanttorememberthatarelationisasetororderedpairs.Thereneedbenorelationshipbetweenthecomponentsoftheorderedpairs;anysetoforderedpairsisarelation.Usually,however,wechoosewhichorderedpairsbelongtotherelationsothatcomponentsarerelatedinsomeway,sowethinkoftherelationassomehowrepresentingtheconnection.Forexample,ifA=fGary;Jing;KeikagandB=f7447;7448;7455g,thenR=f(Gary;7448);(Jing;7447);(Keika;7455)gisarelationfromAtoBthatpairseachUVicMathinstructorinsetAandher/hisUVictelephoneextensioninsetB.Countingrelations.SinceanysubsetofABisarelationfromAtoB,itfollowsthatifAandBarenitesetsthenthenumberofrelationsfromAtoBis2jABj=2jAjjBj.OnewaytoseethisisasthenumberofsubsetsofAB.Adirectwaytocountisthesamewayonecountssubsets:observethatforeachofthejABj=jAjjBjorderedpairsinABtherearetwopossibilities,eithertheorderedpairbelongstotherelationoritdoesn't,sobytheruleofproductthenumberofrelationsfromAtoBis2222(jAjjBjtwos).Similarly,ifAisanitesetthenthenumberofrelationsonAis2jAjjAj.LetA=f1;2;:::10g.Bytheabove,thereare2100relationsonA.Thenumberofthesethatcontainthepairs(1;1);(2;2);:::;(10;10)is110290=290:eachofthe10speciedpairsmustbeintherelation(1waytodothis),andtherearetwopossibilities{inornot{foreachoftheremaining90pairs.SimilarreasoningshowsthatthenumberofrelationsonAthatcontainnoneof(1;2);(3;4);(5;6)is297.ThenumberofrelationsonAthatcontain(2;5)or(7;9)is2100298(totalminusthenumberthatcontainneitherorderedpair).Adierentwayofcountingthesegivestheequivalentexpression299+299298(thenumberthatcontain(2;5)plusnumberthatcontain(7;9)minusthenumberthatcontainboth).Finally,thenumberofrelationsonAthatcontaineither(2;5)or(7;9)butnotbothis298+298(thenumberthatcontain(2;5)andnot(7;9)plusthenumberthatcontain(7;9)andnot(2;5)).2 Example(lessthanorequaltorelation)TherelationRonthesetA=f1;2;3ggivenbyR=f(1;1);(1;2);(1;3);(2;2);(2;3);(3;3)gisthesetofallorderedpairs(a;b)ofelementsofAsuchthatabandwecanthinkofthesetRasrepresentingthe\lessthanorequalto"relation.Inxnotationforrelations.IfRisarelationonAand(a;b)2R,wesometimesusetheinxnotationaRbandsay\aisrelatedtob(underR)".IfaisnotrelatedtobunderR,wesometimesusetheinxnotationwithaslashthroughtheR.Example(subsetrelation,inxnotation).LetB=fa;b;cgandletSbetherelationonP(B)(thepowersetofB,i.e.thesetofallsubsetsofB)denedbyXSY,XY.Thatis,asubsetXofBisrelatedtoasubsetYofBunderSexactlywhenXisasubsetofY.ThesymbolScanberegardedasasynonymforthesymbolor,alternatively,thesymbolcouldberegardedasthenameofthesetofallorderedpairs(X;Y)whereX;Y2P(B)andXisasubsetofY.Example(recursivelydenedrelations).Relationsaresets(oforderedpairs),andthuscansometimesbedenedrecursively.Forexample,letDbetherelationonZ+(thepositiveintegers)denedby:BASIS:1R5;RECURSION:Forallx;y2Z+,ifxRythen(x+1)R(y+5).Aftergeneratingafewterms,itisnotdiculytoguessandprovethatR=f(a;b)2Z+Z+:b=5ag.ThestatementtobeprovedisP(a):Anorderedpair(a;b)belongstoRifandonlyifb=5a.Werstprovebyinductiononathatifa2Z+andb=5a,then(a;b)2R:BASIS(a=1):(1;5)2RbydenitionofR.Thus,thestatementistruefora=1.INDUCTIONHYPOTHESIS:Forsomek1,supposethatifn=5kthen(k;n)2R.INDUCTIONSTEP:Supposem=5(k+1).Thenm5=5k,sobytheinductionhypothesis(k;m5)2R.BythedenitionofR;(k;m5)2R)(k+1;m5+5)2R.Thus,ifm=5(k+1),then(k+1;m)2R.Therefore,byinduction,foralla2Z+,ifa2Z+andb=5a,then(a;b)2R.Tocompletetheproof,weshowbyinductiononathatif(a;b)2Rthenb=5a:BASIS(a=1):BydenitionofR,theonlyorderedpairinRwithrstcomponentequalto1is(1;5).Since5=51,thestatementistruefora=1.INDUCTIONHYPOTHESIS:Forsomek1,supposethatif(k;n)2R,thenn=5k.INDUCTIONSTEP:Suppose(k+1;m)2R.BydenitionofR,thiscanhappenonlyif(k;m5)2R.Bytheinductionhypothesis,m5=5k.Hencem=5k+5=5(k+1).Thus,if(k+1;m)2R,thenm=5(k+1).Therefore,byinduction,foralla2Z+,if(a;b)2Rthenb=5a.Foramoredicultexample,considertherelationSonZ+denedby:BASIS:(1;2);(1;3)2S;RECURSION:Forallx;y2Z+,if(x;y)2Sthen(x+1;y+2);(x+1;y+3)2S.Exercise:ProvebyinductionthatS=f(k;n)2Z+Z+:2kn3kg.3 FunctionsDenition(function).AfunctionfromasetAtoasetBisarelationffromAtoBwiththepropertythatforeveryelementa2Athereexistsoneandonlyoneelementb2Bsuchthat(a;b)2f.Denition(image,value,preimage).IffisafunctionfromAtoB,thenweusethenotationf:A!B.Fromthedenitionofafunctioniff:A!B,thenfcanbeviewedasanassignment,toeachelementa2A,ofauniqueelementbinB.If(a;b)2f,thenwedenotetheassignmentofbtoabywritingb=f(a)andcallingbtheimageofaunderf,orthevalueoffat(a);theelementaiscalledapreimageofb.(Notethatitisapreimageratherthanthepreimage;morethanoneelementofAcouldmaptob.)Itiscommonusagetosay\fmapsAtoB".ThisexpressionarisesfromtheusualarrowdiagramwhereeachelementofAisjoinedbyanarrowtotheelementofBassignedtoit.Unfortunately,thistendstoleadtotheconfusionthattheelementsofAaresomehowassignedtotheelementsofB,whichisbackwards!ItistheelementsofBthatareassignedtotheelementsofA.Itisimportanttokeepthefollowingfactsstraight.EveryelementofAhassomeelementofBassignedtoit.NoelementofAisassignedmorethanoneelementofB,eachisassignedexactlyone.ThereisnoguaranteethatdierentelementsofAareassigneddierentelementsofB.WhenwesaythateachelementofAisassignedauniqueelementofB,wemeanthateachelementofAisassignedoneandonlyoneelemntofB.Thisdoesnotmeanthatifa16=a2,thenf(a1)6=f(a2);itisquitepossiblethatf(a1)=f(a2)(Wehaveaspecialnameforfunctionswiththepropertythata16=a2impliesf(a1)6=f(a2):1-1.)ThereisnoguaranteethatanyparticularelementofBisassignedtoanyelementofA.(WehaveaspecialnameforfunctionswiththepropertythateveryelementofBistheimageofatleastoneelementofA:onto.)Denition(domain,inputs,codomain,range).Beforewecantalkaboutfunctions,weneednamesfortheobjectswewanttotalkabout:ThesetAiscalledthedomain,andtheelementsofAarecalledinputstof(sothedomainiswheretheinputslive).ThesetBiscalledthecodomain.ThesubsetofBconsistingoftheelementswhicharevaluesoff(i.e.,areassignedtosomeelementinA)iscalledtherangeoff.(Think:thevaluesoffrangeovertheelementsinthisset.)Therangeoffisthesetf(A)=fb:b2Bandb=f(a)forsomea2Ag.Example(function,domain,codomain,range,image,preimage).LetAbethesetofallfacultyandstudentsatUVic,andletBbethesetofallamountsofmoneyindollarsandcents.LetfbetherelationfromAtoBwhere(a;b)2f,persona2Aowesamountbtothelibrary.Sinceforeverypersona2Athereisauniqueamountofmoneythats/heowestothelibrary(possibly$0),fisafunction.ThedomainoffisA,itscodomainisB,anditsrangeisthesetofallamountsofmoneythatareowed(eachbyatleastoneperson).If(Gary,$1:59)2f,thenf(Gary)=$1:59,theimageofGary4 is$1:59,apre-imageof$1:59isGary,andtheamount$1:59belongstotherangeoff.(Note:anypersonwhoowes$1:59tothelibraryisalsoapre-imageof$1:59.)Theaboveexampledemonstratesafunctionwhichcannotbedenedby\givingaformula"forf(a).InthedenitionoffunctionAandBarejustsets{theredon'thavetobeanynumbersanywhere{soitmaybeverydiculttogiveaformula.Example(function,domain,codomain,range,image,preimage).Letf:R!Rdenedbyf(x)=2dxe.(Recallthat,forarealnumberx,theceilingofx,denoteddxeisthesmallestintegerwhichisgreaterthanorequaltox.Hencefisafunction.)ThedomainoffisthesetRofrealnumbers.Thecodomainisalsothesetofrealnumbers.Therangeoffisthesetofevenintegers:sincedxeisaninteger,f(x)=2dxeisaneveninteger.Thus,therangeisasubsetoftheevenintegers.Toseethateveryeveninteger2t;(t2Z)isavalueoff,observethatfort2Z,f(t)=2dte=2t.Exercises.Weleaveasanexerciseforthereadertodeterminetherangeofthefunctiong:R!Rdenedbyg(x)=bxc2.(Recallthatforarealnumberx,the oorofx,denotedbxcisthelargestintegerwhichislessthanorequaltox.)Formoreexercises,ndtherangeofh:R!Rdenedbyh(x)=b2xc,andshowthattherangeof`:Z!Zdenedby`(n)=n2+4n+4isfk2:k2Ng=f02;12;22;:::g.Countingfunctions.LetAandBbenitesets,sayA=fa1;a2;:::;amgandB=fb1;b2;:::;bng.WecountthenumberoffunctionsfromAtoB.Bythedenitionoffunction,foreacha2Athereisexactlyoneb2Bsuchthat(a;b)2f.Thus,therearenchoicesfortheelementtobepairedwitha1,nchoicesfortheelementtobepairedwitha2,andsoon.Ingeneral,foreachchoiceforatherearen=jBjchoicesfortheelementbsuchthat(a;b)2f.Bytheruleofproduct,thenumberoffunctionsfromAtoBisthereforennn(mterms,allequalton),whichequalsnm(orjBjjAj).Denition(imageofaset,preimageofaset).Thenotionsofimageandpreimagecanbegeneralizedtosets.Supposef:A!Bisafunction.IfA1A,thentheimageofA1underfisthesetf(A1)=fb2B:b=f(a)forsomea2A1g.Thatis,f(A1)isthesetwhoseelementsaretheimagesunderfoftheelementsinA1.IfB1B,thenthepreimageofB1underfisthesetf1(B1)=fa2A:f(a)2B1g.Thatis,f1(B1)isthesetofelementsinAwhoseimageunderfisinB1.Example(imageofaset,preimageofaset).LetA=f1;2;3;4;5g;B=fa;b;c;dgandf:A!Bbegivenbyf=f(1;d);(2;a);(3;c);(4;a);(5;c)g.Thenf(f1;2;3g)=fd;a;cg,andf1(fd;a;cg)=f1;2;3;4;5g.Noticethatthisshowsthatiff(A1)=B1thenitneednotbethecasethatf1(B1)=A1;itishowever,truethatiff(A1)=B1,thenf1(B1)A1.(Toseethis,lety2B1.theny=f(x)forsomex2A1.Hencex2f1(B1).)Weleaveitasanexercisetoprovethatequalityoccurs,thatisf1(f(A1))=A1,ifandonlyifthereisnoelementa2AA1suchthatf(a)2f(A1).Asafurtherexercise,provethatforB1Bwehavef(f1(B1))B1,5 withequalityifandonlyifB1isasubsetoftherangeoff(thatis,everyelementofB1istheimageofsomeelementofA).Observethatiff:A!Bisafunctionthen,bydenirtionoffunctionf1(B)=Aandf(A)istherangeoff(whichisasubsetofB).LetB1B.Bydenitionofpreimageofasubsetofthecodomainwehavef1(B1)=;ifandonlyifthereisnoelementx2Awithf(x)2B1.Thusf1(;)=;and,intheexampleabovef1(fbg)=;.Example(ndingtherange).Letf:R!Zbedenedbyf(x)=d2xe+b2xc.Todeterminetherangeoff,webeginbytestingafewvaluesofx:f(0)=0;Ifx2(0;1=2),then2x2(0;1)sod2xe=1andb2xc=0,hencef(x)=1;f(1=2)=2;Ifx2(1=2;1)then2x2(1;2)d2xe=2andb2xc=1,hencef(x)=3;f(1)=4;Ifx2(1;3=2),then2x2(2;3)sod2xe=3andb2xc=2,hencef(x)=5.f(3=2)=6.Basedonthesecomputations,itseemsreasonabletoguessthattherangeoffisZ.Weprovethatthisisthecase.First,observethatf(x)isanintegerforeveryx2R,sof(R)Z.Toshowtheoppositeinclusion,lety2Z.Wemustndx2Rsuchthatf(x)=y.Ifyiseven,sayy=2t;t2Z,thenf(t=2)=d2t=2e+b2t=2c=2t=y.Ifyisodd,sayy=2t+1;t2Z,thenforanyx2(t=2;t=2+1=2)wehave2x2(t;t+1),hencef(x)=(t+1)+t=2t+1=y.HencetherangeoffisZ.Asanexercise,showthattheimageofthesetNofnaturalnumbersisf(N)=f4n:n2Ng.Example(ndingpreimages).Letg:R!Zbedenedbyg(x)=b3xc.Wedeterminethepreimageoff1;1gandofT=f2n:n2Ng.Todetermineg1(f1;1g)weneedtogureoutthepreimagesofeachelementoff1;1g.Wehaveg(x)=1,b3xc=1,3x2[1;0)$x2[1=3;0).Similarly,g(x)=1,x2[1=3;2=3).Thus,g1(f1;1g)=[1=3;0)[[1=3;2=3).Thesetg1(T)canbedeterminedinthesameway.Forn2Nwehaveg(x)=2n,b3xc=2n,3x2[2n;2n+1),x2[2n=3;(2n+1)=3).Therefore,g1(T)=S1n=0[2n=3;(2n+1)=3)=[0;1=3)[[2=3;1)[[4=3;5=3)[[3;7=3)[.TheoremF1.Letf:A!Bbeafunction,A1;A2AandB1;B2B.Then(a)f(A1[A2)=f(A1)[f(A2);(b)f(A1\A2)f(A1)\f(A2).(c)f1(B1[B2)=f1(B1)[f1(B2).(d)f1(B1\B2)=f1(B1)\f1(B2).Proof.Weprove(b)andleavetheothersasexercises.Lety2f(A1\A2).theny=f(x)forsomex2A1\A2.Sincex2A1\A2ifandonlyifx2A1andx2A2,wehavey=f(x)forsomex2A1andy=f(x)forsomex2A2.Therefore,y2f(A1)andy2f(A2),i.e.y2f(A1)\f(A2). Toseethatstrictcontainmentcanoccurinpart(b)ofTheoremF1,considerthefunctionf:f1;2;3g!f1;2gwheref=f(1;1);(2;1);(3;2).TakeA1=f1;3gandA2=f2;3g.Thenf(A1\A2)=f(f3g)=f2gwhereasf(A1)\f(A2)=f1;2g\f1;2g=f1;2g.6 Denition(equalityoffunctions).Twofunctionsf:A!Bandg:A!Bareequaliff(x)=g(x)foreveryx2A.Iffandgareequal,wewritef=g.Thereisasubtlepointhiddeninthedenitionofequalityoffunctions.Fortwofunctionstobeequal,theymusthavethesamedomain,thesamecodomain,andgivethesamevalueforthesameinput.Thus,technically,thefunctionf:Z!Zdenedbyf(x)=jxjisnotequaltothefunctiong:Z!Ndenedbyg(x)=jxjbecausethesetwofunctionsdonothavethesamecodomain.Denition(restrictionofafunction,extensionofafunction).Letf:A!Bbeafunction.ForXA,therestrictionofftoXisthefunctionfjX:X!BdenedbyfjX(x)=f(x)forallx2X.IfA0A,anextensionofftoA0isanyfunctiong:A0!Bforwhichg(x)=f(x)foreveryx2A.Therestrictionofafunctionf:A!BisthenewfunctionobtainedbyretrictingtheallowedinputsforftoasubsetofitsdomainA.AnextensionoffisanyfunctionthatisidenticaltofontheinputsinA,andisalsodenedfortheinputsinA0A.Observethatfcan,andprobablydoes,havemorethanoneextension.Thisiswhywesaanextension,ratherthantheextension.Observethatifgisanextensionoff,thengjA=f.Example(restriction).Letf:R!Zbedenedbyf(x)=2dxebxc.TherestrictionfjZofftotheintegersisthefunctionfjZ:Z!ZwherefjZ(n)=nforalln2Z(becauseifnisanintegerthenbxc=dne=n).Countingrestrictionsandextensions.LetA=f1;2;3;4;5g;B=fs;t;u;v;w;x;y;zgandf:A!Bbef=f(1;t);(2;x);(3;x);(4;s);(5;t)g.Thenumberofextensionsofftoafunctionfromf1;2;:::;9gtoBis84,sincethereare8choicesfortheimageofeachof6;7;8and9(inanextensiontheimagesof1;2;3;4and5mustbethesameasforf).TherangeoffisR=fs;t;xg,andthenumberofsubetsA0AsuchthatfjA0alsohasrangeRis133,sinceA0:mustcontain4(sincef1(fsg)=f4g),mustcontainatleastoneof1and5(sincef1(ftg=f1;5g)mustcontainatleastoneof2and3(sincef1(fxg)=f2;3g).Denition(converseofarelation).LetRbearelationfromAtoB.TheconverseofRistherelationRcfromBtoAdenedbyRc=f(b;a):(a;b)2Rg.(ThisistherelationobtainedbyreversingthecomponentsofeachorderedpairinR.)Motivatingquestion.Supposef:A!Bisafunction.Then,bydenition,fisrelationfromAtoB.Itisnaturaltowonderwhentheconverserelation,fc,isafunction(fromBtoA).Example(fcnotafunction).LetA=f1;2;3g;B=fa;b;c;dg;andf=f(1;a);(2;b);(3;c)g.Then,fc=f(a;1);(b;2);(c;3)gisnotafunctionbecauseitcontainsnoorderedpairwithrstcomponentequaltod.(Equivalently,thepreimageofsome1-elementsubsetofBistheemptyset.)ThesamesituationwillariseforanyfunctionffromasetAtoasetBwheretherangeisapropersubsetofthecodomain.Hence,forfctohaveachanceatbeingafunction,itmustbetruethatf(A)=B.(Thesearecalledontofunctions.)7 Example(fcnotafunction).LetA=f1;2;3g;B=fa;bg;andf=f(1;a);(2;b);(3;b)g.Then,fc=f(a;1);(b;2);(b;3)gisnotafunctionbecauseitcontainstwoorderedpairswithrstcomponentequaltob.ThesamesituationwillariseforanyfunctionffromasetAtoasetBwheresometwoelementsofAhavethesameimage.(Thatis,thereexista1;a22Awherea16=a2butf(a1)=f(a2)).Equivalently,thepreimageofsome1-elementsubsetofBcontainstwoormoreelements.)Hence,forfctohaveachanceatbeingafunction,itmustbetruethatifa1;a22Aanda16=a2,thenf(a1)6=f(a2).(Thesearecalled1-1functions.)Wewilldevelopsomeresultsaboutthefunctionswiththepropertiessuggestedbythetwoexamplesabove,andafterthatwewillreturntothequestionofwhentheconverseofafunctionfromAtoBisafunctionfromBtoA.Denition(1-1function).Afunctionf:A!Biscalledone-to-one(1-1,orinjective,oraninjection)iff(x)=f(y)impliesx=y,forallx;y2A.(Thatis,fis1-1ifandonlyifdierentelementsofAhavedierentimagesinB.Equivalently,fis1-1ifandonlyifeveryelementofBistheimageunderfofatmostoneelementofA.)PropositionF2.IfAandBarenitesetsandf:A!Bisa1-1function,thenjAjjBj.Proof.SupposejAj=m.IfnotwoelementsofAhavethesameimageunderf,thentherangeoffcontainsexactlymelements.SincetherangeoffisasubsetofB,wehavejAj=mjBj. Proving1-1.Toproveafunctionfis1-1,startwith\Assumef(x)=f(y)."andthenargue,usingwhatyouaregivenaboutf,thatx=y(thelastclauseis...x=y.Thereforefis1-1.)Equivalently,youcouldprovethecontrapositive:startwith\Assumex6=y."andargueuntilyoucanconcludewith\Thenf(x)6=f(y).".Example(provingafunctionis1-1).Letf:Z!Nbedenedbyf(x)=5x7.Weprovefis1-1.Assumef(x)=f(y).Then5x7=5y7.Inturn,thisimplies5x=5xandx=y.Thereforefis1-1.Disproving1-1.Toprovethatafunctionfisnot1-1,nddistinctelementsxandyinthedomainsothatf(x)=f(y).Bydoingthis,youhavedemonstratedthattheimplication(f(x)=f(y))!(x=y)isFalse,andsof(x)=f(y)impliesx=y,forallx;y2A,isFalse.Example(provingafunctionisnot1-1).Letf:Z+!Z+bedenedbyf(1)=1,andforn2;f(n)isthelargestprimefactorofn.Computingafewvaluesoffyieldsf(2)=2;f(3)=3;andf(4)=2.Sincef(4)=f(2)and46=2,thefunctionfisnot1-1.Adviceaboutinvestigatingfunctionsre:1-1.Ifitisnotpossibletoeasilyidentifyelementsxandyinthedomainsothatf(x)=f(y),thenstarttryingtoprovethatfis1-1.Iffisn't1-1,thentheproofwillbreakdownatsomepoint,andthiswillleadtotherequiredxelements.Forexample,letf:R!Rbef(x)=x214x+57=(x7)2+8.Now,f(x)=f(y))(x7)2+8=(y7)2+8,(x7)2=(y7)2.Toprovefis8 1-1,itisnecessarytoobtainx=y,butthelastequalitygivesx7=(y7),whichleadstox=yory=x14.Thelastoftheseequationsgivestheelementsxandyrequiredtoshowfisnot1-1:Choosex=0(say)andy=014=14.Thenx6=y,andf(x)=57=f(y)(checkthearithmetic!),sofisnot1-1.Counting1-1functions.SupposejAj=mandjBj=n.Wecountthenumberof1-1functionsfromAtoB.ByPropositionF2,ifmntherearenone.Assumemn.SupposeA=fa1;;a2;:::;amg.Therearenchoicesfortheimageofa1and,foreachofthesetherearen1choicesfortheimageofa2,n2choicesfortheimageofa3,andsoonuntil,nally,therearen(m1)=nm+1choicesfortheimageofam.Thus,bytheruleofproduct,thenumberof1-1functionsfromAtoBisn(n1)(nm+1)=n!=(nm)!.OnetoonefunctionsallowustodescribeasituationwhenequalityholdsintheoremF1(b).PropositionF3.Letf:A!Bbea1-1functionandA1;A2A.Thenf(A1\A2)=f(A1)\f(A2).Proof.ByTheoremF1(b),f(A1\A2)f(A1)\f(A2).Thus,itremainstoprovetheoppositeinclusion.Supposefis1-1,andlety2f(A1)\f(A2).Theny=f(x1)forsomex12A1andy=f(x2)forsomex22A2.Sincefis1-1,f(x1)=f(x2))x1=x2.Hence,y=f(x)forsomex2A1\A2,thatis,y2f(A1\A2).Thus,f(A1\A2)f(A1)\f(A2),asrequired. Comparethepartoftheargumentwherethepropertythatfis1-1wasusedtotheparagraphfollowingTheoremF1.ToseethattheconverseofPropositionF3isfalse,considerf:Z!Zwheref(n)=0foralln2Z.Denition(ontofunction).Afunctionf:A!Biscalledonto(orsurjective,orasurjection)ifforeveryelementb2Bthereisanelementa2Asuchthatf(a)=b.(Thatis,fisontoifandonlyifeveryelementofBistheimageunderfofsomeelementofA.Equivalently,fisontoifandonlyifeveryelementofBistheimageunderfofatleastoneelementofA.)PropositionF4.IfAandBarenitesetsandf:A!Bisanontofunction,thenjAjjBj.Proof.Supposefisonto.TheneveryelementofBhasatleastonepreimage.Bythedenitionoffunction,eachelementofAisapreimageforauniqueelementofB.Thus,jAj=Pb2Bjf1(fbg)jPb2B1=jBj. Provingonto.Toprovethatafunctionisontoyoumustarguethatforeveryb2B(equivalently,anarbitrarilychosenb2B)thereisana2Asuchthatf(a)=b.Thus,therstlineoftheproofis\Letb2B.Wemustnda2Asuchthatf(a)=b.".WhatyoudonextdependsonthedescriptionoffandofthesetB.Usually,you\solve"f(a)=bforaintermsofb(aswrittenitgivesbintermsofa).Then,youverifythatwhatyouhaveisanelementofA.Finally,yousubstitutethisbackintofandshowthatitgivesb.Thelastlineoftheproofis\Henceifa=:::,thenf(a)==b,andsofisonto.".9 Example(provingonto).Weshowthatthefunctionf:R+!R+denedbyf(x)=9+(x+3)3isonto.Lety2R+.Thenf(x)=y,9+(x+3)3=y,(x+3)3=y+9,x+3=p y+9.Sincex2R+;x+30andwecandisregardthenegativesquareroottoobtainx=3+p y+9.Wemustverifythatthisxbelongstothedomain.Sincey2R+wehavey+99andp y+93.Therefore3+p y+92R+.Hence,ifx=3+p y+9,thenf(x)=9+((3+p y+9)+3)3=9+(p y+9)2=y,andsofisonto.Disprovingonto.Toprovethatafunctionisnotontoyoumustndanelementb2Bwhichisnotf(a)foranya2A.Howyoudothisdependsonf.Ingeneral,itisusefultotrytoprovethatfisontoasabove.Ifitisn'tonto,thenyouwillreachapointwhereeitheryoucan'tsolveforaintermsofb,oryouwillsucceedindoingthisbuttheonlypossibilitiesyoundarenotelementsofA.Ineithercaseyouaredone.Whatyouaredoingisassumingthatfisontoandshowingthatleadsto(logicallyimplies)acontradiction.SinceonlyaFalsestatementlogicallyimpliesacontradiction,itmustbethattheassumptionthatfisontoisFalse.Example(disprovingonto).Considerthefunctionf:R!Rdenedbyf(x)=(x2)210.Lety2R.Thenf(x)=y,(x2)210=y,(x2)2=y+10.Ifyischosensothaty+100(sayy=11)thenthereisnorealnumberxsothat(x2)2=y+10because(x2)20forallrealnumbersx.Thus,thereisnox2Rsothatf(x)=11,sofisnotonto.Example(disprovingonto).Considerthefunctionf:Z!Zdenedbyf(n)=2n+3.Lety2Z.Thenf(n)=y,2n+3=y,n=(y3)=3.But(y3)=262Zforally2Z:Inparticularify=0then(y3)=2=3=2.Wenowhavethatiff(n)=0,thenn=3=2.Thus,thereisnon2Zsuchthatf(n)=0,sofisnotonto.Ontodependsonthecodomain.ObservethatthefunctionfintheexampleaboveisontoasafunctionfromRtoR.Exercise:WhataboutfromQtoQ?FornitesetsAandB,ithasbeenstraightforwardtocountthenumberoffunctionsfromAtoB,andalsothenumberof1-1functionsfromAtoB.WedonotpresentlyhavethetechniquesnecessarytocountthenumberofontofunctionsfromAtoB.ThiswillhavetowaituntilwehavecoveredthePrincipleofInclusionandExclusion,lateron.However,westateandusetheresultnow.FactF5.LetAandBbesetswithjAj=mandjBj=n.Then,thenumberofontofunctonsfromAtoBisPnk=0(1)knk(nk)m.Example(countingusingontofunctions).Wecountthenumberofwaysthatacollectionof5labelled(distiguishable)containerscanholdacollectionof8labelled(dis-tinguishable)balls,ifnocontainerisleftempty.Thisisthesameasthenumberoffunctionsfromthesetofballsontothethesetofcontainers(f(b)isthecontainerthatholdsballb),whichisP5k=0(1)k5k(5k)8=50585148+52385328+54185508=126000.Thenumberofwaysinwhichtherst3containersholdtherst5ballsandthelast2containersholdthelast3balls(and,still,nocontainerisleftempty)equalsthenumberoffunctionsfromasetof5labelledballstotheasetof3labelledcontainers,timesthe10 numberoffunctionsfromasetof3labelledballstotheasetof2labelledcontainers.ThisisP3k=0(1)k3k(3k)5P2k=0(1)k2k(2k)3=864.CorollaryF6.LetAandBbenitesets.Iff:A!Bisboth1-1andonto,thenjAj=jBj.Proof.Sincefis1-1,wehavejAjjBjbyPropositionF2.Sincefisonto,wehavejAjjBjbyPropositionF4.Theresultnowfollows. Denition(1-1correspondence).Afunctionf:A!Biscalleda1-1correspondence(orbijective,orabijection)ifitisboth1-1andonto.Bythedenitionsof1-1andonto,afunctionfisa1-1correspondenceifandonlyifeveryelementofBistheimageofexactlyoneelementofAunderf.Todetermineifafunctionisa1-1correspondence,usethemethodsdiscussedabovetocheckwhetheritis1-1andonto.(Ofcourse,youcanstoponceitfailstohaveoneoftheseproperties.)CorollaryF6isanimportantcountingprinciple.Itsaysthatiftwonitecollectionsofobjectscanbeputinto1-1correspondence,thentherearethesamenumberofobjectsineachcollection.Forexample,thereisa1-1correspondencebetweenthesubsetsofA=fa1;a2;:::;angandthesetBofbinarysequencesb1b2:::bnoflengthn:Itisgivenbythefunctionf:P(A)!Bdenedbyf(X)isthebinarysequenceb1b2:::bnwherefori=1;2;:::;n,bi=1ifai2X0ifai62X:Toseethatfis1-1,notethatiff(X)=f(Y)thenthedenitionoffimpliesthatXandYcontainexactlythesameelements.Toseethatfisonto,letb1b2:::bn2BandconstructX2P(A)bytheruleai2X,bi=1.Iffollowsfromthedenitionoffthatf(X)=b1b2:::bn.Hence,thenumberofsubsetsofAequalsthenumberofbinarysequencesoflengthn,whichequals2n(twochoicesforeachposition).Exercises.SupposethatjAj=jBj.Prove:(a)Iff:A!Bisa1-1function,thenitisa1-1correspondence(i.e.fisalsoonto).(b)Iff:A!Bisanontofunction,thenitisa1-1correspondence(i.e.fisalso1-1).PropositionF7.Letf:A!Bbeafunction.(a)Iffis1-1,thenanyrestrictionofftoasubsetA1Ais1-1.(b)Iffisonto,thenforanyA0A,anyextensionofftoafunctiong:A0!Bisonto.Proof.(a):Letx;y2A1andsupposef(x)=f(y).SinceA1A,wehavex;y2A.Sincefis1-1,f(x)=f(y).ThereforefjA1is1-1.(b):Letb2B.Sincefisonto,thereexistsx2Asuchthatf(x)=y. Denition(compositionoffunctions).LetA;BandCbesets,andf:A!Bandg:B!Cbefunctions.Thecompositionoffandg(orthecompositefunction)isthefunction(gf):A!Cdenedby(gf)(a)=g(f(a))foreveryelementainA.11 Functioncompositionisnotcommutative.Ingeneral,ordermatters.Forfandgasabove,thecompositionoffandgisusuallynotthesameasthecompositionofgandf.Forexample,letf:Z!Zbedenedbyf(x)=x2andg:Z!Zbedenedbyg(x)=x+3.Then,(gf)(x)=g(f(x))=g(x2)=x2+3and(fg)(x)=f(g(x))=f(x+3)=(x+3)2=x2+6x+9.Since(gf)(0)=3and(fg)(0)=9,wehavegf6=fg.Itisalsopossiblethat,dependingonthesetsA;BandC,thefunctiongfisdenedbutthefunctionfgisnot.Weleaveitasanexercisetondanexamplethatdemonstratesthis.Denition(identityfunctiononaset).TheidentityfunctiononthesetXisthefunction1X:X!Xdenedby1X(x)=xforeveryelementxofX.Theinteger0isanidentityelementwithrespecttoadditionofrealnumbers:x+0=0+x=xforallx2R.Similarly,1isanidentitywithrespecttomultiplicationofnonzerorealnumbers:1x=x1=xforallx2Rf0g.Theidentityfunctiononasetactsinasimilarwaywithrespecttofunctioncomposition.PropositionF8.LetAandBbesetsandf:A!Bbeafunction.Then(a)f1A=f,and(b)1Bf=f.Proof.Weprove(a)andleave(b)asanexercise.Letx2A.Then,f1A(x)=f(1A(x))=f(x).Hence,f1A=f. Eventhoughfunctioncompositionisnotcommutative,itisassociative.Wenowprovethis.PropositionF9.LetA;B;C,andDbesetsandf:A!B;g:B!C,andh:C!Dbefunctions.Thenh(gf)=(hg)f.Proof.Bydenitionoffunctioncomposition,bothh(gf)and(hg)farefunctionsfromAtoD,sotheyhavethesamedomainandcodomain.Letx2A.Then,(h(gf))(x)=h((gf)(x))=h(g(f(x))=(hg)(f(x))=((hg)f)(x),asrequired. PropositionF10.LetA;BandCbesetsandg:A!Bandf:B!Cbefunctions.Then,(a)Iffandgare1-1,thengfis1-1.(b)Iffandgareonto,thengfisonto.(c)Iffandgare1-1correspondences,thengfisa1-1correspondence.Proof.Weprove(a)andleavetheproofof(b)foranexercise.Statement(c)isanimmediateconsequenceof(a)and(b).Suppose(gf)(x)=(gf)(y).Theng(f(x))=g(f(y)).Sincegis1-1,f(x)=f(y).Sincefis1-1,x=y.therefore,gfis1-1. 12 Exercises:ndexamplestodemonstratethattheconverseofeachstatementinpropo-sitionF10isfalse,butthefollowingstatementistrue:Iffgisa1-1correspondence,thenfis1-1andgisonto(butfneednotbeontoandgneednotbe1-1).Also,ndanexampletodemonstratethattheconverseoftheaboveimplicationisFalse(nevermindthepartinbrackets).Wenowreturntothequestionofwhentheconverseofafunctionisitselfafunction.PropositionF11.Letf:A!Bbeafunction.Thenfcisafunctionifandonlyiffis1-1andonto.Proof.())Supposefcisafunction.Bythedenitionoffunction,foreveryb2Bfccontainsexactlyoneorderedpairwithrstcomponentequaltob.Thus,foreveryb2Bfcontainsexactlyoneorderedpairwithsecondcomponentequaltob.Thatis,fis1-1andonto.(()Supposefis1-1andonto.Then,foreveryb2Bfcontainsexactlyoneorderedpairwithsecondcomponentequaltob.Thismeansthatforeveryb2Bfccontainsexactlyoneorderedpairwithrstcomponentequaltob.Thatis,fcisafunction. Supposefisa1-1andontofunction.Then,byPropositionF11,fcisafunction.Since(fc)c=fandfisafunction,PropositionF11impliesthatthefunctionfcis(also)1-1andonto.Inthearithmeticofrealnumbers,theinverseofxisxbecausex+(x)equalstheadditiveidentity,zero.Forx6=0,themultiplicativeinverseofxis1=xbecausex(1=x)equalsthemultiplicativeidentity,one.Theinverseofafunctionisanalogous,andisdenedbelow.Denition(invertiblefunction).Afunctionf:A!Biscalledinvertibleifthereexistsafunctiong:B!Asuchthatgf=1Aandfg=1B.Supposef:A!Bisa1-1correspondence.Then,byPropositionF11,fcisafunction.Considerthecompositefunctionfcf.Fora2Awehave(fcf)=fc(f(a))=a,bydenitionofconverse.Thus,fcf=1A.Similarly,forb2Bwehave(ffc)(b)=fc(f(b))=b.Thus,ffc=1B.Therefore,a1-1andontofunctionisinvertible.PropositionF12.Supposef:A!Bisinvertible.Thenthefunctiongsuchthatgf=1Aandfg=1Bisunique.Proof.Supposeg:B!Aandh:B!Aarefunctionssuchthatgf=1Aandfg=1Bandhf=1Aandfh=1B.Weneedtoshowg=h.Letb2B.Theng(b)=g(1B(b))=(g1B)(b)=(g(fh))(b)=((gf)h)(b)=(1Ah)(b)=1A(h(b))=h(b).Thus,g=h.Thiscomepletestheproof. Denition(inverse).Letf:A!Bbeaninvertiblefunction.Theinverseoffistheuniquefunctiongsuchthatgf=1Aandfg=1B.Itiscustomarytodenotetheinverseoffbyf1.Inthecasewheref:A!Bis1-1andonto,wehaveabovethatfisinvertibleandfc=f1.13 Donotconfusethenotationfortheinverseofafunction,(whichexistsonlysometimes)andthenotationforthepreimageofasubsetofthecodomain(whichalwaysexists).Theyusethesamesymbols,buttheformeroftheseisafunctionandthelatterisaset.Itshouldbeclearfromthecontextwhichobjectisunderdiscussion.PropositionF13.Letf:A!Bbeafunction.Then,fisinvertibleifandonlyifitis1-1andonto.Proof.(()Supposefis1-1andonto.Wehavenotedabovethatinthiscasefisinvertibleandfc=f1.())Supposethatfisinvertible.Then,thereisafunctionf1:B!Asuchthatf1f=1Aandff1=1B.Supposef(x)=f(y).Thenf1(f(x))=f1(f(y)).TheLHSofthisequationis(f1f)(x)=1A(x)=xandtheRHSis(f1f)(y)=1A(y)=y.Thus,x=y,andfis1-1.Letb2B.Sincef1isafunction,thereexistsa2Asuchthatf1(b)=a.Bydenitionofinversefunction,wehavef(a)=f(f1(b))=(ff1)(b)=1B(b)=b.Thereforefisonto.Thiscompletestheproof. CombiningPropositionsF12andF13givesthatiffisaninvertiblefunction,thenf1=fc.Bydenitionofconverse,thismeansthatf1hasthepropertythat,fora2Aandb2B,f(a)=b,f1(b)=a.(ComparethistothelastparagraphintheproofofPropositionF13.)Some(inverse)functionsaredenedinexactlythisway{forexampleforx2R+andy2R,wehavelog10(x)=y,10y=xProvingfisinvertibleandndingtheinverse.Therearetwowaystoprovethatafunctionf:A!Bisinvertible.Onewayistowritedowntherightfunctiong:B!Aandthencheckthatgf=1Aandfg1B.AnotherwayistousePropositionF13andcheckiffis1-1andonto.Intheproofthatfisonto,onestartswith"Lety2Bandsupposef(x)=y."andultimatelyderives\Thenx=g(y).".Byourdiscussioninthepreviousparagraph,gistheinversefunction.Thus,adescriptionoftheinversefunctionisabyproductoftheproofthatfisonto.Noticethatthedenitionofaninvertiblefunctionissymmetricinfandg(a.k.a.f1).Thus,iffisinvertible,soisf1and(f1)1=f.Example(provingfisinvertibleandndingf1).Letf:R+!Rbedenedbyf(x)=2ln(x)7.Weshowthatfisinvertibleandndf1.Supposef(a)=f(b).Then,wehave2ln(a)7=2ln(b)7,2ln(a)=2ln(b),ln(a)=ln(b),eln(a)=eln(b),a=b,sincetheexponentialandlogarithmfunctionsareinverses.Thus,fis1-1.Now,supposey2R.Then,f(x)=y,2ln(x)7=y,ln(x)=(y+7)=2,x=e(y+7)=2.Fory2Rthequantitye(y+7)=22R+,thedomainoff.Hence,ifx=e(y+7)=2thenf(x)=f(e(y+7)=2)=2ln(e(y+7)=2)7=2(y+7)=27=y,sofisonto.Moreoverf1:R!R+isdescribedbyf1(y)=e(y+7)=2.14