products and sums yukita

55
Products and Sums http:// cis.k.hosei.ac.jp/ ~yukita/

Upload: brittany-lamb

Post on 04-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Products and Sums yukita

Products and Sums

http://cis.k.hosei.ac.jp/~yukita/

Page 2: Products and Sums yukita

2

Products

• To express the notion of function with several variables

• We need to talk about products of objects.

Page 3: Products and Sums yukita

3

Ex. 1. Add and Multiply

ZYXf

yxyx

multiply

yxyx

add

:

form theof arrowan need We

),(

:

),(

:

RRR

RRR

Page 4: Products and Sums yukita

4

The one point set and the empty set

. is possiblityonly The

. ofsubset a is : above, case In the

.),(;!; hereproperty w with the

ofsubset a ,definitionby is, :function A

.:!by thisdenote also We

. to fromfunction oneexactly is thereset any Given [2]

{*}.:!by thisdenote We

{*}. to fromfunction oneexactly is thereset any Given [1]

f

XXf

fyxYyXxYX

YXf

X

XX

X

XX

Remark

Page 5: Products and Sums yukita

5

Prop. Property [2] characterizes the empty set.

.isomorphic are and that showswhich

,:1 and :1 have also We

.1 bemust which function oneexactly and

:function oneexactly is theresays ofproperty same The

.1 bemust which function oneexactly and

:function oneexactly is thereSo

.function oneexactly is there,set any For

[2].property thehasset that another be Let

Z

ZZ

Z

ZZ

Z

XZX

Z

Z

Z

Proof.

Page 6: Products and Sums yukita

6

Prop. Property [1] characterizes the one point set.

.isomorphic are *}{ and that showswhich

,{*}*}{:1 and :1 have also We

.1 bemust which {*}*}{function oneexactly and

{*}:function oneexactly is theresays *}{ ofproperty same The

.1 bemust which function oneexactly and

{*}:function oneexactly is thereSo

.function oneexactly is there,set any For

[1].property thehasset that another be Let

{*}

{*}

Z

ZZ

Z

ZZ

Z

ZXX

Z

Z

Z

Proof.

Page 7: Products and Sums yukita

7

What is the use of this kind of argument?

• We respect specification by arrows.

• Properties [1] and [2] are specifications.

• Corresponding implementations are the one point set and the empty set.

• There are many cases where specification determines implementation up to isomorphism.

Page 8: Products and Sums yukita

8

Def. Initial and terminal objects

.1 arrow unique a is therein object any for if

called is (one) 1object An

.0 arrow unique a is therein object any for if

called is (zero) 0object an category aIn

XX

terminal

XX

initial

A

A

A

Page 9: Products and Sums yukita

9

Ex. 2. Elements of a set

.) of or (or

of 1 arrows call wein terminalis 1 If

. ofelement an toscorrespond {*}function Each

Aconstantspoints

AelementsA

XX

A Def.

Page 10: Products and Sums yukita

10

Ex. 3. The power set 2X

not. do categories small objects;

terminaland initial have to tendcategories large general,In

arrow. oneexactly with

monoid theisobject terminala have tomonoidonly The

.2in terminalis itself subset The

Note.

4. Ex.

XX

Page 11: Products and Sums yukita

11

.conversely and

,in object initialan is then in object terminala is If

dual. are terminaland initial of sdefinition The op AA

Remark.

AA

Page 12: Products and Sums yukita

12

Products

.categoriesother in products of

concept apply thecan that weso arrowsonly using and to

it relatingby product cartesian thezecharacteri try toWe

ofcategory in the

},|),{(

by defined is and ofproduct cartesian The

YX

YX

YyXxyxYX

YX

Sets.

Page 13: Products and Sums yukita

13

YX YX 2p1p

x y

1

Cartesian product of X and Y

. and of , us gives , with composingthen

, of 1: an and 1object terminala have weIf

21 YXyxelementspp

YXYXelement

Page 14: Products and Sums yukita

14.then

,,

such that : arrowan is there

such that :, arrows Given two s)(uniquenes

.,

such that : arrowan is there

,:,: arrowsGiven )(existence

:assplit becan The

.,

such that : arrow unique a is there

,:,:

arrows and object any given if, and of a called is

arrows with twoobject an ,category aIn

2211

21

21

21

pppp

YXZ

YXZ

ypxp

YXZ

YZyXZx

conditionty universali

ypxp

YXZ

YZyXZx

ZYXproduct

YYXX

YXpp

Note.

ADef.

Page 15: Products and Sums yukita

15

YX YX 2p1p

x y

Z

Universality (existence)

commute. diagram following themakes that : arrowan have we

, diagramany Given

YXZ

YZX yx

Page 16: Products and Sums yukita

16

YX YX 2p1p

Z

Universality (uniqueness)

).,(by denote We

. have then we, and

such that :, arrows any twoGiven

2211

yx

pppp

YXZ

Page 17: Products and Sums yukita

17

. and such that :

arrowan is e that thermeans ofproperty defining The

. toisomorphic is that

show Weproduct.another is Suppose

2211

21

qpqpYXQ

YX

YXQ

YQX qq

Proof.

Prop. The product of two objects in a category is unique up to isomorphism.

YX YX 2p1p

1q 2q

Q

Page 18: Products and Sums yukita

18

. and such that :

arrowan is e that thermeans ofproperty defining The

2211 pqpqQYX

Q

)(continued

YX YX 2p1p

1q 2q

Q

Page 19: Products and Sums yukita

19

YX

Q

2q1q

1q

Q1

2q

Q

.1 have we

property, uniqueness By the

Q

Page 20: Products and Sums yukita

20

YX

YX

2p1p

1p

YX1

2p

YX

.1 have we

property, uniqueness By the

YX

Page 21: Products and Sums yukita

21

Note

.1 and 1 such that : and

: morphisms twoare thereif isomorphic be to

said are and category. a of objects are and Let

BA gffgABg

BAf

BABA

Page 22: Products and Sums yukita

22

Ex. 6. Category 2X

product. of uniqueness theguaranteesproperty This

arrow. onemost at is thereobjects ofpair any Between

.

isproduct Their . of subsets are and Let

.in contained is means category In this

product. a has 2category in the objects ofpair Each

VVUU

XVU

BABA

X

Page 23: Products and Sums yukita

23

Preordered Category

• The product of two objects, if it exists, is their intersection.

• In other words, the greatest lower bound of the two objects.

Page 24: Products and Sums yukita

24

Ex. 7. The monoid with one object A and two arrows 1A and , satisfying 2=, does not have products.

. arrow single and

, arrows of pairsbetween bijection is thereand

again. be it would existed, If

AAAA

AAAA

AAAAA

AAA

Page 25: Products and Sums yukita

25

Ex. 8. The Diagonal Function

function. or thecalled

),,(

:

function, a is thereset aGiven

copyfunction diagonal

xxx

XXX

X

Page 26: Products and Sums yukita

26

Def. Diagonal in an Arbitrary Category with Products

:commute diagram following themaking arrow unique theis X

.XX XX 2p1p

X1X X1

X

Page 27: Products and Sums yukita

27

parallel.in and functions two thesay, toSo

)).(),((),(

:

:by denotedfunction a is there

:,: functions given two ,In

2121

2121

2211

gf

xgxfxx

YYXXgf

YXgYXf

Sets9. Ex.

Page 28: Products and Sums yukita

28

Def. Parallel Functions in an Arbitrary Category with Products

commute. diagram following themaking arrow unique theis arrow the

,: ,: arrows Given two 2211

gf

YXgYXf

2Y1Y21 YY

2Yp1Yp

f gf g

21 XX 1X 2X2Xp

1Xp

Page 29: Products and Sums yukita

29

Ex. 10. The Twist Function

),(),(

:

function a is there and sets given two ,In

,

xyyx

XYYXtwist

YX

YX

Sets

Page 30: Products and Sums yukita

30

Def. The Twist Function in an Aribitrary Category with Products

:commute diagram following themakes that arrow unique theis Then

. of sprojection thebe , and of sprojection thebe ,Let

,

2121

YXtwist

XYqqYXpp

.XY XY

2p 1p

1q

twist

2q

YX

Page 31: Products and Sums yukita

31

Object oriented viewpublic class ObjCatA{

}

public class ProdCatA extends ObjCatA{

   ObjCatA x, y;

public ProdCatA(ObjCatA x, ObjCatyA y){

this.x = x; this.y = y;

}

public ArrowCatA<z,this> factArrows

(ObjA z, ArrowCatA<z,x> f, ArrowCatA<z,y> g){

return /* the unique arrow that satisfies

the property in the last slide */

}

}

Page 32: Products and Sums yukita

32

Ex.11. Category Circ

.0*

:

and

,1*

:

namely , from functions twoare There

sets. esebetween th functions all :Arrows

}|),,,{(

,{*}, where,,,, :Objects

}.1,0{Let

10

10

10

21

10210

BBfalse

BBtrue

BB

BxxxxB

BBBBBB

B

inn

Page 33: Products and Sums yukita

33

Negation, And, Or

1(1,1)

1(1,0)

1(0,1)

0(0,0)

: ,

1(1,1)

0(1,0)

0(0,1)

0(0,0)

:

01

10 :

1212

11

BBorBBand

BB

Page 34: Products and Sums yukita

34

Claim. Category Circ has products.

products. ofproperty check themust We

),,(),,(),,(

follows. as and ofproduct thedefine We

111

21

nmmnmm

npnmnmpm

nm

xxxxxx

BBBBB

BB

Page 35: Products and Sums yukita

35

.nBmB nmB 2p1p

f g

X

property. ith thisfunction w oneonly theis

thatand , and check thateasily can We

)).(),(),(,),(()(Then

)).(),(()( and ))(,),(()(Let

21

11

11

gpfp

xgxgxfxfx

xgxgxgxfxfxf

nm

nm

Page 36: Products and Sums yukita

36

not

BB :

Page 37: Products and Sums yukita

37

&

BB2 :&

Page 38: Products and Sums yukita

38

BB2 :or

or

Page 39: Products and Sums yukita

39

wires.up splits : 2BB

Page 40: Products and Sums yukita

40

side.by side components twoputs : 22 BB gf

f

g

Page 41: Products and Sums yukita

41

series.in components twoputs : BB fg

f g

Page 42: Products and Sums yukita

42

wires. theof twos twist:twist 2 2BB

Page 43: Products and Sums yukita

43

Boolean Gates f(x,y,z)

&

or

not

not

not

not

&

&

&

x

y

z

),,( zyxf

Page 44: Products and Sums yukita

44

),,()&&,&&(

)&&,&&(),&,,&(

),&,,&(),,,,,(

),,,,,(),,,,,(

),,,,,(),,(

or

2&&

41&1&6

6116

6333 3

zyxfzyxzyx

zyxzyxzyxzyx

zyxzyxzyxzyx

zyxzyxzyxzyx

zyxzyxzyx

BB

BB

BB

BB

BBBB

2

4

BB

BB

B

Page 45: Products and Sums yukita

45

3)11()1&1(&&)(&or

follows. ascircuit aby dimplemente becan

BBBBB f

Page 46: Products and Sums yukita

46

Summary

• Using wires, we can implement products.

• Every function BmBn can be implemented using not, &, or, true, false, using products and composition.

Page 47: Products and Sums yukita

47

commute. diagram

following themakesthat

arrow unique a is there

),( :

arrows offamily a and object any Given

property. following thehaswhich

),( :

sprojection offamily a with togetherobject an isfamily theof

product The . of objects offamily finite a be )(Let

KlXZf

Z

KlXXp

X

X

ll

lKk

kl

Kkk

Kkk

ADef.

.lXKk

kXlp

lf

Z

Page 48: Products and Sums yukita

48

Note. The product of the empty family

The product is a terminal object. Since the family is empty, the only requirement is that, given Z, there is a unique arrow from Z to the product.

Page 49: Products and Sums yukita

49

. and such that :

arrowan is e that thermeans ofproperty defining The

. toisomorphic is that

show Weproduct.another is Suppose

llllKl

l

Kll

Kll

lq

qpqpXQ

X

XQ

XQ l

Proof.

Prop. The product of a family of objects in a category is unique up to isomorphism.

lX Kl

lXlp

lq

Q

Page 50: Products and Sums yukita

50

. such that :

arrowan is e that thermeans ofproperty defining The

llKl

l pqQX

Q

)(continued

X Kl

lXlp

lq

Q

Page 51: Products and Sums yukita

51

lX

Q

lq

lq

Q1

Q

.1 have we

property, uniqueness By the

Q

Page 52: Products and Sums yukita

52

lX

lp

lp

Kl

lX1

Kl

lX

.1 have we

property, uniqueness By the

Kl

lX

Kl

lX

Page 53: Products and Sums yukita

53

Prop. 4.2. If products of all pairs of objects exist in A and a terminal object exists then products of finite families exit.

. then and unique have wediagram, in the as ,,,Given

.,,Let

.)(family theofproduct theis )( that show will We

3212211 321

}3,2,1{321

 hgfZ

pppppppp

XXXX

XXXXXXX

kk

Proof.

321 XXX 21 XXp

1Xp

2Xp

f

gh

3Xp21 XX

2X

Z

.3X

1X

Page 54: Products and Sums yukita

54

.)(product the

ofproperty uniqueness by the Hence

. and onto projectionwith

composites same thehave and Hence,

.product theofproperty uniqueness by the Hence

. and onto sprojection with composites same thehave and Then,

.

and ,

,

equations. threefollowing thesatisfying arrowanother is

Suppose unique. is such that show We

321

321

21

21

33

22

11

2121

2121

3

2212

1211

XXX

XXX

XXpp

XXpp

hppp

gppppp

fppppp

XXXX

XXXX

X

XXXX

XXXX

inued).Proof(cont

321 XXX 21 XXp

1Xp

2Xp

f

2121

XXXX pp

gh

3Xp

21 XX

2X

Z

.3X

1X

Page 55: Products and Sums yukita

55

e)associativ(Strictly

indentity. theis misomorphis thecategory In

. toisomorphic areBoth

.isomorphic are )( and )(

321

321321

Circ14. Ex.

Proof.

Cor.

XXX

XXXXXX