Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Codensity and the Giry monad Tom Avery 19th June 2015 Tom Avery Codensity and the Giry monad Structure of this talk Introduction The Giry monad Codensity monads Main result Tom Avery Codensity and the Giry monad Introduction Let X be a ‘space’. Want to choose a point of X at random. Tom Avery Codensity and the Giry monad Introduction Let X be a ‘space’. Want to choose a point of X at random. Need a probability measure on X . Write TX for the ’space’ of probability measures on X; then we want a point of TX. Tom Avery Codensity and the Giry monad Introduction Let X be a ‘space’. Want to choose a point of X at random. Need a probability measure on X . Write TX for the ’space’ of probability measures on X; then we want a point of TX. To be fair we should choose this at random too. To do this, we need a probability measure on TX , i.e. an element of TTX . Tom Avery Codensity and the Giry monad Introduction Let X be a ‘space’. Want to choose a point of X at random. Need a probability measure on X . Write TX for the ’space’ of probability measures on X; then we want a point of TX. To be fair we should choose this at random too. To do this, we need a probability measure on TX , i.e. an element of TTX . So, given ρ ∈ TTX , we can 1 choose π ∈ TX at random according to ρ, 2 choose x ∈ X at random according to π. Tom Avery Codensity and the Giry monad Introduction Let X be a ‘space’. Want to choose a point of X at random. Need a probability measure on X . Write TX for the ’space’ of probability measures on X; then we want a point of TX. To be fair we should choose this at random too. To do this, we need a probability measure on TX , i.e. an element of TTX . So, given ρ ∈ TTX , we can 1 choose π ∈ TX at random according to ρ, 2 choose x ∈ X at random according to π. This is a way of choosing an element of X ‘at random’ i.e. a probability measure on X . So we have a map TTX → TX Tom Avery Codensity and the Giry monad Introduction Let X be a ‘space’. Want to choose a point of X at random. Need a probability measure on X . Write TX for the ’space’ of probability measures on X; then we want a point of TX. To be fair we should choose this at random too. To do this, we need a probability measure on TX , i.e. an element of TTX . So, given ρ ∈ TTX , we can 1 choose π ∈ TX at random according to ρ, 2 choose x ∈ X at random according to π. This is a way of choosing an element of X ‘at random’ i.e. a probability measure on X . So we have a map TTX → TX Given x ∈ X we have a way of choosing a point of X at random: “always choose x”. So we have X → TX . Tom Avery Codensity and the Giry monad Introduction So we might expect space X 7→ probability measures on X to form a monad. Tom Avery Codensity and the Giry monad Introduction So we might expect space X 7→ probability measures on X to form a monad. Can vary what we mean by ‘space’: sets, measurable spaces, topological spaces, Polish spaces, etc. Tom Avery Codensity and the Giry monad Introduction So we might expect space X 7→ probability measures on X to form a monad. Can vary what we mean by ‘space’: sets, measurable spaces, topological spaces, Polish spaces, etc. and what notion of ‘measure’ we are interested in: measures taking values in {0, 1}, [0, 1], [0, ∞], R, C, etc. finitely vs. countably additive distributions of compact support etc. Tom Avery Codensity and the Giry monad Introduction So we might expect space X 7→ probability measures on X to form a monad. Can vary what we mean by ‘space’: sets, measurable spaces, topological spaces, Polish spaces, etc. and what notion of ‘measure’ we are interested in: measures taking values in {0, 1}, [0, 1], [0, ∞], R, C, etc. finitely vs. countably additive distributions of compact support etc. We get the Giry monad when we take ‘measurable spaces’ and ‘probability measures’. Tom Avery Codensity and the Giry monad Introduction Question: Is there a unified categorical description of all these variations? Tom Avery Codensity and the Giry monad Introduction Codensity monads provide one tool. Theorem The Giry monad and finitely additive Giry monad arise as codensity monads (of certain functors). Tom Avery Codensity and the Giry monad Introduction Codensity monads provide one tool. Theorem The Giry monad and finitely additive Giry monad arise as codensity monads (of certain functors). analogous to Theorem (Gildenhuys, Kennison) The ultrafilter monad (on Set) is the codensity monad of FinSet ,→ Set. (The ultrafilter monad is a measure monad: An ultrafilter on a set X is the same as a finitely additive probability measure defined on the power set of X taking values in {0, 1}) Tom Avery Codensity and the Giry monad Introduction Notation: Meas is the category of measurable spaces and maps. I = [0, 1] (with Borel σ-algebra). If S is a set, X an object of a category, then [S, X ] is the ‘S-th power of X ’. Tom Avery Codensity and the Giry monad The Giry Monad The Giry monad, G = (G , η, µ) consists of: Endofunctor: G : Meas → Meas, sends Ω to the set of probability measures on Ω, with a suitable σ-algebra. Tom Avery Codensity and the Giry monad The Giry Monad The Giry monad, G = (G , η, µ) consists of: Endofunctor: G : Meas → Meas, sends Ω to the set of probability measures on Ω, with a suitable σ-algebra. Unit: If ω ∈ Ω and A ⊆ Ω, is measurable then ( 1 if ω ∈ A η(ω)(A) = 0 otherwise. Tom Avery Codensity and the Giry monad The Giry Monad The Giry monad, G = (G , η, µ) consists of: Endofunctor: G : Meas → Meas, sends Ω to the set of probability measures on Ω, with a suitable σ-algebra. Unit: If ω ∈ Ω and A ⊆ Ω, is measurable then ( 1 if ω ∈ A η(ω)(A) = 0 otherwise. Multiplication: If ρ ∈ GG Ω and A ⊆ Ω, then Z µ(ρ)(A) = π(A) dρ(π) π∈G Ω Tom Avery Codensity and the Giry monad The Giry Monad The Giry monad, G = (G , η, µ) consists of: Endofunctor: G : Meas → Meas, sends Ω to the set of probability measures on Ω, with a suitable σ-algebra. Unit: If ω ∈ Ω and A ⊆ Ω, is measurable then ( 1 if ω ∈ A η(ω)(A) = 0 otherwise. Multiplication: If ρ ∈ GG Ω and A ⊆ Ω, then Z µ(ρ)(A) = π(A) dρ(π) π∈G Ω replacing ‘probability measures’ with ‘finitely additive probability measures’ gives the finitely additive Giry monad F = (F , η, µ). Note that G is a submonad of F. Tom Avery Codensity and the Giry monad The Giry Monad Let C be the category with objects I n for n ∈ N, morphisms are affine maps (i.e. maps that preserve convex combinations) Tom Avery Codensity and the Giry monad The Giry Monad Let C be the category with objects I n for n ∈ N, morphisms are affine maps (i.e. maps that preserve convex combinations) Then C is in fact a Lawvere theory. A C-algebra can be described as a set A equipped with for each r ∈ I , a map +r : A × A → A (think of this as x +r y = rx + (1 − r )y ), for each r ∈ I , an element r¯ ∈ A, (’constant at r ’), a unary operation i : A → A (think of i(a) as ’1 − a’) satisfying some axioms. Tom Avery Codensity and the Giry monad The Giry Monad Let C be the category with objects I n for n ∈ N, morphisms are affine maps (i.e. maps that preserve convex combinations) Then C is in fact a Lawvere theory. A C-algebra can be described as a set A equipped with for each r ∈ I , a map +r : A × A → A (think of this as x +r y = rx + (1 − r )y ), for each r ∈ I , an element r¯ ∈ A, (’constant at r ’), a unary operation i : A → A (think of i(a) as ’1 − a’) satisfying some axioms. Examples: I and Meas(Ω, I ) for any Ω ∈ Meas. Tom Avery Codensity and the Giry monad The Giry Monad Let C be the category with objects I n for n ∈ N, morphisms are affine maps (i.e. maps that preserve convex combinations) Then C is in fact a Lawvere theory. A C-algebra can be described as a set A equipped with for each r ∈ I , a map +r : A × A → A (think of this as x +r y = rx + (1 − r )y ), for each r ∈ I , an element r¯ ∈ A, (’constant at r ’), a unary operation i : A → A (think of i(a) as ’1 − a’) satisfying some axioms. Examples: I and Meas(Ω, I ) for any Ω ∈ Meas. Tom Avery Codensity and the Giry monad The Giry Monad Consider C-algebra homomorphisms Meas(Ω, I ) → I . Call such a homomorphism continuous if it preserves pointwise limits of sequences. That is φ ∈ C-Alg(Meas(Ω, I ), I ) is continuous if, for every sequence fn : Ω → I with fn → f pointwise as n → ∞, we have φ(fn ) → φ(f ) as n → ∞. Write C-Algcts (Meas(Ω, I ), I ) for the set of continuous homomorphisms. Tom Avery Codensity and the Giry monad The Giry Monad Consider C-algebra homomorphisms Meas(Ω, I ) → I . Call such a homomorphism continuous if it preserves pointwise limits of sequences. That is φ ∈ C-Alg(Meas(Ω, I ), I ) is continuous if, for every sequence fn : Ω → I with fn → f pointwise as n → ∞, we have φ(fn ) → φ(f ) as n → ∞. Write C-Algcts (Meas(Ω, I ), I ) for the set of continuous homomorphisms. Proposition (correction of Sturtz) Let Ω ∈ Meas. As sets, we have C-Alg(Meas(Ω, I ), I ) ∼ = F Ω and C-Algcts (Meas(Ω, I ), I ) ∼ = G Ω. Tom Avery Codensity and the Giry monad The Giry Monad Consider C-algebra homomorphisms Meas(Ω, I ) → I . Call such a homomorphism continuous if it preserves pointwise limits of sequences. That is φ ∈ C-Alg(Meas(Ω, I ), I ) is continuous if, for every sequence fn : Ω → I with fn → f pointwise as n → ∞, we have φ(fn ) → φ(f ) as n → ∞. Write C-Algcts (Meas(Ω, I ), I ) for the set of continuous homomorphisms. Proposition (correction of Sturtz) Let Ω ∈ Meas. As sets, we have C-Alg(Meas(Ω, I ), I ) ∼ = F Ω and C-Algcts (Meas(Ω, I ), I ) ∼ = G Ω. (Compare: An ultrafilter on a set S is an element of Bool(Set(S, 2), 2).) Tom Avery Codensity and the Giry monad The Giry Monad Proposition (correction of Sturtz) Let Ω ∈ Meas. As sets, we have C-Alg(Meas(Ω, I ), I ) ∼ = F Ω and C-Algcts (Meas(Ω, I ), I ) ∼ = G Ω. Given φ : Meas(Ω, I ) → I , define a finitely additive probability measure π by π(A) = φ(χA ), for A ⊆ Ω measurable, with characteristic function χA . Tom Avery Codensity and the Giry monad The Giry Monad Proposition (correction of Sturtz) Let Ω ∈ Meas. As sets, we have C-Alg(Meas(Ω, I ), I ) ∼ = F Ω and C-Algcts (Meas(Ω, I ), I ) ∼ = G Ω. Given φ : Meas(Ω, I ) → I , define a finitely additive probability measure π by π(A) = φ(χA ), for A ⊆ Ω measurable, with characteristic function χA . Tom Avery Given a finitely additive probability measure π, define φ : Meas(Ω, I ) → I by Z φ(f ) = f dπ Ω for f ∈ Meas(Ω, I ). Codensity and the Giry monad Codensity Monads Let U : B → M be a functor. The codensity monad of U (if it exists) is the right Kan extension T U : M → M of U along itself. Write κ : T U U → U for the universal natural transformation. Tom Avery Codensity and the Giry monad Codensity Monads Let U : B → M be a functor. The codensity monad of U (if it exists) is the right Kan extension T U : M → M of U along itself. Write κ : T U U → U for the universal natural transformation. We obtain η : idM → T U and µ : T U T U → T U making T U into a monad via: /M U B κ U TU ks idM η & B /M U = U & M M and /M U B B TU | κ U TU { M ks # µ M = κ U TU ) κ M U $ TU Tom Avery /M U Codensity and the Giry monad U T M. Codensity Monads Remark: If U is a right adjoint, then T U is the monad induced by the adjunction. Tom Avery Codensity and the Giry monad Codensity Monads Remark: If U is a right adjoint, then T U is the monad induced by the adjunction. The end formula for right Kan extensions gives Z TUX ∼ [M(X , Ub), Ub] = b∈B for X ∈ M. Tom Avery Codensity and the Giry monad Codensity Monads Remark: If U is a right adjoint, then T U is the monad induced by the adjunction. The end formula for right Kan extensions gives Z TUX ∼ [M(X , Ub), Ub] = b∈B for X ∈ M. Example: If B is a Lawvere theory and U : B → M is a model with underlying object R, say, then T U is characterised by M(Y , T U X ) ∼ = B-Alg(M(X , R), M(Y , R)). Tom Avery Codensity and the Giry monad Main Result Recall C is the category (Lawvere theory, in fact) with objects: I n , n ∈ N. morphisms: affine maps. The objects of C have natural (Borel) σ-algebras so there is a functor U : C → Meas. This exhibits I ∈ Meas as a C-algebra. Tom Avery Codensity and the Giry monad Main Result Recall C is the category (Lawvere theory, in fact) with objects: I n , n ∈ N. morphisms: affine maps. The objects of C have natural (Borel) σ-algebras so there is a functor U : C → Meas. This exhibits I ∈ Meas as a C-algebra. Define the category D with objects: the objects of C together with d0 = {(xn )∞ n=0 | xn ∈ I and xn → 0 as n → ∞} morphisms: affine maps. There is a similar functor V : D → Meas. (But D is not a Lawvere theory) Tom Avery Codensity and the Giry monad Main Result Theorem (TA) The codensity monad of U : C = {I 0 , I 1 , I 2 , . . .} → Meas is the finitely additive Giry monad F. The codensity monad of V : D = {I 0 , I 1 , . . . , d0 } → Meas is the Giry monad G. Sketch proof: The forgetful functor Meas → Set is representable. Hence for Ω ∈ Meas, the underlying set of T U Ω is C-Alg(Meas(Ω, I ), I ) ∼ = F Ω. Then check the isomorphisms are compatible with measurable space and monad structure. Similarly one can see that the underlying set of T V Ω is C-Algcts (Meas(Ω, I ), I ) ∼ = G Ω, and check compatibility. Tom Avery Codensity and the Giry monad Related Results Let U 0 : C0 → Meas be any of the following: C0 the category of simplices ∆n ⊆ Rn and affine maps between them, and U 0 the obvious forgetful functor; Tom Avery Codensity and the Giry monad Related Results Let U 0 : C0 → Meas be any of the following: C0 the category of simplices ∆n ⊆ Rn and affine maps between them, and U 0 the obvious forgetful functor; C0 the monoid of affine endomorphisms of I 2 (or ∆2 ), and U 0 the action on I 2 ∈ Meas (or ∆2 ∈ Meas respectively); Tom Avery Codensity and the Giry monad Related Results Let U 0 : C0 → Meas be any of the following: C0 the category of simplices ∆n ⊆ Rn and affine maps between them, and U 0 the obvious forgetful functor; C0 the monoid of affine endomorphisms of I 2 (or ∆2 ), and U 0 the action on I 2 ∈ Meas (or ∆2 ∈ Meas respectively); C0 the category of all bounded convex subsets of Euclidean space with affine maps, and U 0 the forgetful functor. Tom Avery Codensity and the Giry monad Related Results Let U 0 : C0 → Meas be any of the following: C0 the category of simplices ∆n ⊆ Rn and affine maps between them, and U 0 the obvious forgetful functor; C0 the monoid of affine endomorphisms of I 2 (or ∆2 ), and U 0 the action on I 2 ∈ Meas (or ∆2 ∈ Meas respectively); C0 the category of all bounded convex subsets of Euclidean space with affine maps, and U 0 the forgetful functor. Then the codensity monad of U 0 is still the finitely additive Giry monad F. Tom Avery Codensity and the Giry monad Related Results Consider the last of these: C0 = {bounded convex subsets of Rn }, U 0 = forgetful. Here’s an interpretation of the result in this case. The collection F Ω of finitely additive probability measures on Ω ∈ Meas satisfies the following: Tom Avery Codensity and the Giry monad Related Results Consider the last of these: C0 = {bounded convex subsets of Rn }, U 0 = forgetful. Here’s an interpretation of the result in this case. The collection F Ω of finitely additive probability measures on Ω ∈ Meas satisfies the following: F Ω is a measurable space, and f.a. probability measures can be pushed forward along measurable maps, every f.a. probability measure on a convex bounded C ⊆ Rn has a ’barycentre’ in C , pushforward along affine maps between convex bounded sets respects barycentres, and F is characterised by being terminal such. Tom Avery Codensity and the Giry monad Related Results Let V 0 : D0 → Meas be any of the following D0 the category of simplices, together with P∞ ∆ω = {(xn )∞ n=0 | xn ∈ I , n=0 xn = 1} and affine maps, and V 0 forgetful; Tom Avery Codensity and the Giry monad Related Results Let V 0 : D0 → Meas be any of the following D0 the category of simplices, together with P∞ ∆ω = {(xn )∞ n=0 | xn ∈ I , n=0 xn = 1} and affine maps, and V 0 forgetful; D0 the monoid of affine endomorphisms of d0 (or ∆ω ), and V 0 the action on d0 ∈ Meas (or∆ω respectively); Tom Avery Codensity and the Giry monad Related Results Let V 0 : D0 → Meas be any of the following D0 the category of simplices, together with P∞ ∆ω = {(xn )∞ n=0 | xn ∈ I , n=0 xn = 1} and affine maps, and V 0 forgetful; D0 the monoid of affine endomorphisms of d0 (or ∆ω ), and V 0 the action on d0 ∈ Meas (or∆ω respectively); D0 the category of closed, convex, bounded subsets of the vector space c0 = {(xn )∞ n=0 | xn ∈ R, xn → 0} with the sup norm, with affine maps between them, and V 0 forgetful. Then the codensity monad of V 0 is still the Giry monad G. A similar interpretation of the last of these holds as on the previous slide. Tom Avery Codensity and the Giry monad Related monads Recall C is the category with objects I n and affine maps (WITHOUT d0 ). There is an obvious functor from C to CHaus, the category of compact Hausdorff spaces. The codensity monad of this sends a space X to the space of regular Borel probability measures on X . Tom Avery Codensity and the Giry monad Related monads Recall C is the category with objects I n and affine maps (WITHOUT d0 ). There is an obvious functor from C to CHaus, the category of compact Hausdorff spaces. The codensity monad of this sends a space X to the space of regular Borel probability measures on X . There is a monad on Top of ’Scott-continuous probability valuations’. This can be realised as the codensity monad of a certain forgetfull functor C → Top, where C is a category whose objects are spaces of (transfinite) sequences in I . Tom Avery Codensity and the Giry monad T. Avery. Codensity and the Giry monad. arXiv:1410.4432, 2014. M. Giry. A categorical approach to probability theory. In Categorical Aspects of Topology and Analysis, volume 915 of Lecture Notes in Mathematics, pages 65–85. Springer 1982. K. Sturtz. The Giry monad as a codensity monad. arXiv:1406.6030, 2014. D. Gildenhuys and J. F. Kennison. Equational completion, model induced triples and pro-objects. Journal of Pure and Applied Algebra, 1:317–346, 1971. T. Leinster. Codensity and the ultrafilter monad. Theory and Applications of Categories, 28(13):332270, 2013. Tom Avery Codensity and the Giry monad