a counterexample to tensorability of effects
play

A Counterexample to Tensorability of Effects Sergey Goncharov and - PowerPoint PPT Presentation

A Counterexample to Tensorability of Effects Sergey Goncharov and Lutz Schr oder September 1, 2011 2 / 16 Very-very Abstract Picture Our work addresses the question of general existence of tensor products of monads open since 1969: Ernie


  1. A Counterexample to Tensorability of Effects Sergey Goncharov and Lutz Schr¨ oder September 1, 2011

  2. 2 / 16 Very-very Abstract Picture • Our work addresses the question of general existence of tensor products of monads open since 1969: Ernie Manes. A triple theoretic construction of compact algebras. In Seminar on Triples and Categorical Homology Theory , volume 80 of Lect. Notes Math. , pages 91–118. Springer, 1969. • This work is a complementary part of our paper Sergey Goncharov and Lutz Schr¨ oder. Powermonads and tensors of unranked effects. In LICS , pages 227–236, 2011.

  3. 3 / 16 Monads, Effects and Metalanguage Strong monad T : Underlying category C , endofunctor T : C → C , unit: η : Id → T , multiplication µ : T 2 → T , (!) plus strength : τ A , B : A × TB → T ( A × B ) . Metalanguage of effects : • Type W ::= W | 1 | Type W × Type W | T ( Type W ) • Term construction ((co-)Cartesian operators omitted): x : A ∈ Γ Γ ✄ t : A Γ ✄ f ( t ) : B ( f : A → B ∈ Σ ) Γ ✄ x : A Γ , x : A ✄ q : TB Γ ✄ t : A Γ ✄ p : TA Γ ✄ ret t : TA Γ ✄ do x ← p ; q : TB

  4. 4 / 16 Monads, Effects and Metalanguage: Usage Rough idea: • function spaces are morphisms: � A ⇁ B � = � A � → T � B � ; • sequencing is binding: � x := p ; q � = do x ← � p � ; � q � ; • values are pure computations: � c � = ret � c � . Examples: • Exceptions: TA = A + E . • States: TA = S → ( S × A ) . • Nondeterminism: TA = P ( A ) , P ω ( A ) , P ⋆ ( A ) , . . . • Input/Output: TA = µX . ( A + ( I → O × X )) . • Continuations: TA = ( X → R ) → R . For instance, for TX = P X : � A ⇁ B � = P ( � A � × � B � ) .

  5. 5 / 16 Algebraic effects (Finitary) Lawvere theory: small Cartesian category L plus a strict-product-preserving, identity-on-objects functor: I : N op → L ( N = naturals and maps with summs as coproducts.) • L ( n , 1 ) — operations; L ( 0, 1 ) — constants; • Mod ( L , C ) ⊆ Fun ( L , C ) — models of L in C ; • forgetful functor Mod ( L , C ) → C leads to finitary monads. Finite nondeterminism: one constant ⊥ : 0 → 1, one operation: + : 2 → 1. Then e.g. ( λa , b , c . a + b + c ) : 3 → 1, ( λa . � a , ⊥� ) : 1 → 2, etc. States: lookup l : V → 1, update l , v 1 → 1 ( l ∈ L , v ∈ V ). � � E.g.: update l , v lookup l � p 1 , . . . , p | V | � = update l , v ( p v ) . Large Lawvere theory: L has all small products; I : Set op → L is strict-small-product-preserving, id-on-objects. Theorem [Linton, 1966]: Large Lawvere theories = Monads on Set .

  6. � � 6 / 16 Sum and Tensor Sum of effects: blind union of signatures. For example Σ ⋆ + T = µγ . T ( Σγ + −) ( Σ ⋆ = I/O, Resumptions, Exeptions.) Tensor = Sum modulo commutativity of operations: n 1 � f 2 � n 1 × n 2 n 1 × m 2 f 1 � n 2 f 1 � m 2 m 1 � f 2 � m 1 × m 2 . m 1 × n 2 ( n � f = f × . . . × f ‘ n times’.) For instance: lookup l � p 1 + q 1 , p 2 + q 2 � = lookup l � p 1 , p 2 � + lookup l � q 1 , q 2 � . Examples: (− × S ) S � T = T (− × S ) S , (−) S � T = T S , ( M × −) � T = T ( M × −) where M is a monoid (of messages).

  7. 7 / 16 Tensors and Powermonads Tensors can be used as monad transoformers. Example: T ⊗ ( S × −) S = � S � T ( S × −) Another example: T P = T ⊗ P — a powermonad. Provided existence of T P , • T �→ T P is the left adjoint to the forgetful functor from completely additive monad (those enriched over complete semilattices with the bottom) to vanilla monads. • T P supports generalised Fischer-Ladner encoding: if ( b , p , q ) := do b ?; p + do ( ¬ b ) ?; q , while ( b , p ) := do x ← ( init x ← ret x in ( do b ?; p ) ⋆ ) ; do ( ¬ b ) ?; ret x Existence of tensors has been open since [Manes, 1969]

  8. 8 / 16 Existence of Tensors Existence of a tensor with T ⇐ ⇒ Smallness of L T ( n , 1 ) . From [Hyland, Plotkin, and Power, 2003] , [Hyland, Levy, Plotkin, and Power, 2007] we know: • tensors of ranked ( ≈ algebraic) monads always exist; • tensors of ranked monads with continuations exist; • tensors with states always exist. Tensors with uniform monads exist [Goncharov and Schr¨ oder, 2011] (e.g. P and the continuations are uniform). Example: P ⊗ T exists for L P ⊗ T ( n , 1 ) is a quotient of P ( L T ( n , 1 )) . For instance if TX = µγ . ( γ × γ + X ) then f ( { a , b } , c ) → f ( { a } ∪ { b } , { c } ∪ ∅ ) → { f ( a , c ) , f ( b , ∅ ) }

  9. 8 / 16 Existence of Tensors Existence of a tensor with T ⇐ ⇒ Smallness of L T ( n , 1 ) . From [Hyland, Plotkin, and Power, 2003] , [Hyland, Levy, Plotkin, and Power, 2007] we know: • tensors of ranked ( ≈ algebraic) monads always exist; • tensors of ranked monads with continuations exist; • tensors with states always exist. Tensors with uniform monads exist [Goncharov and Schr¨ oder, 2011] (e.g. P and the continuations are uniform). Example: P ⊗ T exists for L P ⊗ T ( n , 1 ) is a quotient of P ( L T ( n , 1 )) . For instance if TX = µγ . ( γ × γ + X ) then f ( { a , b } , c ) → f ( { a } ∪ { b } , { c } ∪ ∅ ) → { f ( a , c ) , f ( b , ∅ ) }

  10. 8 / 16 Existence of Tensors Existence of a tensor with T ⇐ ⇒ Smallness of L T ( n , 1 ) . From [Hyland, Plotkin, and Power, 2003] , [Hyland, Levy, Plotkin, and Power, 2007] we know: • tensors of ranked ( ≈ algebraic) monads always exist; • tensors of ranked monads with continuations exist; • tensors with states always exist. Tensors with uniform monads exist [Goncharov and Schr¨ oder, 2011] (e.g. P and the continuations are uniform). Example: P ⊗ T exists for L P ⊗ T ( n , 1 ) is a quotient of P ( L T ( n , 1 )) . For instance if TX = µγ . ( γ × γ + X ) then f ( { a , b } , c ) → f ( { a } ∪ { b } , { c } ∪ ∅ ) → { f ( a , c ) , f ( b , ∅ ) }

  11. 8 / 16 Existence of Tensors Existence of a tensor with T ⇐ ⇒ Smallness of L T ( n , 1 ) . From [Hyland, Plotkin, and Power, 2003] , [Hyland, Levy, Plotkin, and Power, 2007] we know: • tensors of ranked ( ≈ algebraic) monads always exist; • tensors of ranked monads with continuations exist; • tensors with states always exist. Tensors with uniform monads exist [Goncharov and Schr¨ oder, 2011] (e.g. P and the continuations are uniform). Example: P ⊗ T exists for L P ⊗ T ( n , 1 ) is a quotient of P ( L T ( n , 1 )) . For instance if TX = µγ . ( γ × γ + X ) then f ( { a , b } , c ) → f ( { a } ∪ { b } , { c } ∪ ∅ ) → { f ( a , c ) , f ( b , ∅ ) }

  12. 9 / 16 Non-existence of Tensors: Plan of the Proof 1. Define an unranked non-uniform monad W . Let W + 2 = W (− + 2 ) . 2. For every S and T introduce ( S ⊗ T ) -algebras, which are simultaneously S - and T -algebras satisfying commutation of S -operations with T -operations. 3. Ensure that whenever ( S ⊗ T ) ∅ exists it must be the initial ( S ⊗ T ) -algebra. � � 4. Find such T for which there are ( W + 2 ) ⊗ T -algebras of arbitrary large cardinality with ‘no junk’. 5. ????? 6. PROFIT!!!

  13. 9 / 16 Non-existence of Tensors: Plan of the Proof 1. Define an unranked non-uniform monad W . Let W + 2 = W (− + 2 ) . 2. For every S and T introduce ( S ⊗ T ) -algebras, which are simultaneously S - and T -algebras satisfying commutation of S -operations with T -operations. 3. Ensure that whenever ( S ⊗ T ) ∅ exists it must be the initial ( S ⊗ T ) -algebra. � � 4. Find such T for which there are ( W + 2 ) ⊗ T -algebras of arbitrary large cardinality with ‘no junk’. 5. ????? 6. PROFIT!!!

  14. 9 / 16 Non-existence of Tensors: Plan of the Proof 1. Define an unranked non-uniform monad W . Let W + 2 = W (− + 2 ) . 2. For every S and T introduce ( S ⊗ T ) -algebras, which are simultaneously S - and T -algebras satisfying commutation of S -operations with T -operations. 3. Ensure that whenever ( S ⊗ T ) ∅ exists it must be the initial ( S ⊗ T ) -algebra. � � 4. Find such T for which there are ( W + 2 ) ⊗ T -algebras of arbitrary large cardinality with ‘no junk’. 5. ????? 6. PROFIT!!!

  15. 9 / 16 Non-existence of Tensors: Plan of the Proof 1. Define an unranked non-uniform monad W . Let W + 2 = W (− + 2 ) . 2. For every S and T introduce ( S ⊗ T ) -algebras, which are simultaneously S - and T -algebras satisfying commutation of S -operations with T -operations. 3. Ensure that whenever ( S ⊗ T ) ∅ exists it must be the initial ( S ⊗ T ) -algebra. � � 4. Find such T for which there are ( W + 2 ) ⊗ T -algebras of arbitrary large cardinality with ‘no junk’. 5. ????? 6. PROFIT!!!

  16. 9 / 16 Non-existence of Tensors: Plan of the Proof 1. Define an unranked non-uniform monad W . Let W + 2 = W (− + 2 ) . 2. For every S and T introduce ( S ⊗ T ) -algebras, which are simultaneously S - and T -algebras satisfying commutation of S -operations with T -operations. 3. Ensure that whenever ( S ⊗ T ) ∅ exists it must be the initial ( S ⊗ T ) -algebra. � � 4. Find such T for which there are ( W + 2 ) ⊗ T -algebras of arbitrary large cardinality with ‘no junk’. 5. ????? 6. PROFIT!!!

Recommend


More recommend