The Lumenary · First-year graduate
Monads
Name: ______________________
Date: ______________________
You will learn to
- Verify the monad laws for the list, power-set and maybe monads on , and identify their algebras (monoids, complete join-semilattices, pointed sets)
- Prove that every adjunction induces a monad , and construct the Kleisli and Eilenberg–Moore adjunctions that recover any monad
- Construct the comparison functors and show that the Kleisli and Eilenberg–Moore categories need not be equivalent
- State Beck's monadicity theorem, show that is monadic over and is not
- Explain how monads model computational effects and probabilistic transitions
- 1.
The maybe monad on has , , and collapsing the two copies of . What is a -algebra ?
- A.A set with a chosen element (a pointed set)
- B.A monoid
- C.A set with an idempotent map
- D.Any set, with no extra structure
- 2.
How many algebra structures for the power-set monad are there on the three-element set ?
- 3.
In the Kleisli category of the list monad, let and (both from to ). What is ?
- A.
- B.
- C.
- D.
- 4.
Let with , unit and counit . The induced monad is on . What is its multiplication ?
- A.
- B.
- C.
- D.
- 5.
In proving that is a right identity in the Kleisli category, we write, for ,
Which two facts justify the second and third equalities, in order?
- A.Naturality of ; then the left unit law
- B.The right unit law ; then associativity
- C.Naturality of ; then naturality of
- D.The two triangle identities of an adjunction
- 6.
For the list monad on , . Which argument shows that the Kleisli category is not equivalent to ?
- A. has exactly two monoid endomorphisms, but every object of has either one or infinitely many endomorphisms.
- B. has more objects than .
- C. has a zero object and does not.
- D.The comparison functor is not full.
- 7.
Which forgetful functors to are monadic? (Choose all that apply.)
- A.
- B.
- C.Compact Hausdorff spaces
- D.
- E.Posets
- 8.
In the Lean file, a list algebra on
Xhasact : List X → X. Which field states the associativity law ?- A.
∀ xss : List (List X), act (xss.map act) = act xss.flatten - B.
∀ x : X, act [x] = x - C.
∀ x y : X, act [x, y] = act [y, x] - D.
∀ xss : List (List X), act xss = act xss.flatten
- A.
- 9.
Write
kleisli(f, g)returning the Kleisli composite (firstf, theng) for the list monad:fandgare Python functions returning lists, and the composite appliesgto every output offand concatenates. Also writeunit(x)returning[x]. The tests check the Kleisli category laws on examples.Computational — Practice