linear functors and their fixed points
play

Linear Functors and their Fixed Points Masuka Yeasin Department of - PowerPoint PPT Presentation

Linear Functors and their Fixed Points Masuka Yeasin Department of Computer Science University of Calgary FMCS 2012 1 / 49 Introduction Linear actegories: A linearly distributive category with a monoidal category acting on it both


  1. Linear Functors and their Fixed Points Masuka Yeasin Department of Computer Science University of Calgary FMCS 2012 1 / 49

  2. Introduction Linear actegories: A linearly distributive category with a monoidal category acting on it both covariantly and contravariantly. -The Logic of Message Passing (J. R. B. Cockett and Craig Pastro) We shall prove that the actions give the structure of a parameterized linear functor and the inductive and coinductive data types form a linear functor pair (when data is built on a linear functor). In particular, circuit diagrams are helpful to establish these facts. 2 / 49

  3. Motivation The logic of products and coproducts gives the logic of communication along channel. Linearly distributive categories manage communication channels. Linear actegories provide message passing in process world. Linear functor gives a basis on which one can build inductive (and coinductive) concurrent data or protocols. 3 / 49

  4. � � � � � � � � Algebraic definition of Inductive datatype An inductive datatype for an endo-functor F : X → X is: An object µx.F ( x ). A map cons : F ( µx.F ( x )) → µx.F ( x ) such that given any object A ∈ X and a map f : F ( A ) → A , there exists a unique fold map such that the following diagram commutes. cons � µx.F ( x ) F ( µx.F ( x )) F (fold( f )) fold( f ) � A F ( A ) f 4 / 49

  5. � � � � � � � � Algebraic definition of Coinductive datatype Dually a coinductive datatype for F is: An object νx.F ( x ). A map dest : νx.F ( x ) → F ( νx.F ( x )) such that given any object A ∈ X and a map f : A → F ( A ), there exists a unique unfold map such that the following diagram commutes. f � F ( A ) A unfold( f ) F (unfold( f )) νx.F ( x ) dest � F ( νx.F ( x )) 5 / 49

  6. Fixed points Lambek’s Lemma If F : X → X is a functor for which µx.F ( x ) exists then cons : F ( µx.F ( x )) → µx.F ( x ) is an isomorphism and (dually) if νx.F ( x ) exists then dest : νx.F ( x ) → F ( νx.F ( x )) is an isomorphism. 6 / 49

  7. � � Circular combinator (alternative method) A (circular) combinator over F is f � D A c[ ] c[ f ] � D F ( A ) where F ( h ) h � A ′ � F ( A ′ ) F ( A ) A ⇒ � � � � ������� � � �������� � � � � � � � � f f ′ c[ f ′ ] c[ f ] � � � D D 7 / 49

  8. � Circular definition of Inductive datatype A circular inductive datatype is: An object µx.F ( x ). A map cons : F ( µx.F ( x )) → µx.F ( x ) such that given a (circular) combinator c [ ] over F , there exists a unique fold map µa. c[ a ] such that the following diagram commutes. cons F ( µx.F ( x )) � µx.F ( x ) � ������������� c[ µa. c[ a ]] µa. c[ a ] D 8 / 49

  9. � Circular definition of Coinductive datatype Dually a circular coinductive datatype is: An object νx.F ( x ). A map dest : νx.F ( x ) → F ( νx.F ( x )) such that given a (circular) combinator c[ ] over F , there exists a unique unfold map νb. c[ b ] such that the following diagram commutes. νb. c[ b ] � νx.F ( x ) D � ����������� c[ νb. c[ b ]] dest F ( νx.F ( x )) 9 / 49

  10. Circular rules We can express cons , dest , fold and unfold in proof theoretically. fold map ∀ X f : X → D X → D F ( X ) → D µx.F ( x ) → D unfold map f : D → X ∀ X D → X D → F ( X ) D → νx.F ( x ) 10 / 49

  11. Circular rules cons f � F ( µx.F ( x )) X cons[ f ] � µx.F ( x ) X dest f � X F ( νx.F ( x )) dest[ f ] � X νx.F ( x ) These circular rules are used to form datatypes. 11 / 49

  12. � � � � � � Example for inductive datatype The set of natural numbers N with zero and succ constructors [zero , succ] 1 + N � N This map forms an inductive datatype for natural numbers such that the following diagram commutes. [zero , succ] zero � N succ � N 1 + N 1 N id + f f 1 f f � U � U 1 1 + U U u [ u,h ] h If we use circular combinator, then ∀ X X ⊢ f N 1 ⊢ zero N X ⊢ succ( X ) N 1 + X ⊢ N N ⊢ g N 12 / 49

  13. Polycategories A Polycategory X is a category that consists of list of objects with polymaps. For example, P, Q, R ⊢ A, B, C . These maps correspond to Gentzen sequents. Composition of polymaps is the cut rules. For example, P, Q ⊢ R, A A, B ⊢ C, D P, Q, B ⊢ R, C, D 13 / 49

  14. Representability of ⊗ and ⊕ We can represent ⊗ and ⊕ by sequents calculus rules of inference. For example, Γ 1 , X, Y, Γ 2 ⊢ ∆ Γ 1 , X ⊗ Y, Γ 2 ⊢ ∆ Γ ⊢ ∆ 1 , X, Y, ∆ 2 Γ ⊢ ∆ 1 , X ⊕ Y, ∆ 2 Γ 1 , X ⊢ ∆ 1 Y, Γ 2 ⊢ ∆ 2 Γ 1 , X ⊕ Y, Γ 2 ⊢ ∆ 1 , ∆ 2 Γ 1 ⊢ ∆ 1 , X Γ 2 ⊢ Y, ∆ 2 Γ 1 , Γ 2 ⊢ ∆ 1 , X ⊗ Y, ∆ 2 14 / 49

  15. Linear distribution A representable polycategory gives us linearly distributive category. For example, a derivation of one linear distribution is X ⊢ X Y ⊢ Y X, Y ⊢ X ⊗ Y Z ⊢ Z X, Y ⊕ Z ⊢ X ⊗ Y, Z X ⊗ ( Y ⊕ Z ) ⊢ ( X ⊗ Y ) ⊕ Z 15 / 49

  16. Symmetric linearly distributive category A linearly distributive category is symmetric if both the tensors and pars are symmetric. For symmetric case, there are two linear distributions. δ L R : A ⊗ ( B ⊕ C ) → B ⊕ ( A ⊗ C ) δ R L : ( B ⊕ C ) ⊗ A ( B ⊗ A ) ⊕ C → that must satisfy some coherence conditions. For example, δ L a ⊗ ; 1 ⊗ δ L R ; δ L R ; 1 ⊕ a ⊗ = R δ R L ; δ L δ L R ; 1 ⊕ δ R R ⊕ 1; a ⊕ = L 16 / 49

  17. Circular rules for linearly distributive categories Circular rules are natural formalism to get fixed points in linearly distributive categories. If we have closure, then ∀ X X ⊢ Γ ⇒ ∆ X ⊢ Γ ⇒ ∆ c[ ] F ( X ) ⊢ Γ ⇒ ∆ µx.F ( x ) ⊢ Γ ⇒ ∆ Γ , µx.F ( x ) ⊢ ∆ But it is not expressable in the linearly distributive setting. Circular rules allow us to express this ∀ X Γ , X ⊢ ∆ Γ , X ⊢ ∆ c[ ] Γ , F ( X ) ⊢ ∆ Γ , µx.F ( x ) ⊢ ∆ 17 / 49

  18. Monoidal functor Suppose F : X → X is a monoidal functor. So there must be the following two natural transformations. ◮ m ⊗ : F ( A ) ⊗ F ( B ) → F ( A ⊗ B ) ◮ m ⊤ : ⊤ → F ( ⊤ ) that must satisfy two equations. ◮ ( m ⊤ ⊗ 1) m F ( u ) = u ◮ a ⊗ (1 ⊗ m ) m = ( m ⊗ 1) m F ( a ⊗ ) 18 / 49

  19. Is the greatest fixed point of a monoidal functor monoidal? Proposition The greatest fixed point of a monoidal functor is monoidal and dually the least fixed point of a comonoidal functor is comonoidal. Consider ˆ F = νx.F ( , x ) is the greatest fixed point of a monoidal functor. To prove that ˆ F is monoidal, we have to show that the two equations hold. m � Consider the first equation, ( � m ⊤ ⊗ 1) � F ( u ) = u m � It suffices to show that for a fixed g , ( � m ⊤ ⊗ 1) � F ( u ) = unfold( g ) and u = unfold( g ). 19 / 49

  20. � � � � Defining diagram of � m and � m ⊤ dest ⊗ dest � F ( A, b m ⊗ � F ( A ⊗ B, b F ( A ) ⊗ b b F ( A )) ⊗ F ( B, b F ( A ) ⊗ b F ( B ) F ( B )) F ( B )) � � � � � � � � F (1 , c m ) � � c � m � � b � F ( A ⊗ B, b F ( A ⊗ B ) F ( A ⊗ B )) dest m ⊤ � F ( ⊤ , ⊤ ) ⊤ m ⊤ d F (1 , d m ⊤ ) b � F ( ⊤ , b F ( ⊤ ) F ( ⊤ )) dest 20 / 49

  21. m � ( � m ⊤ ⊗ 1) � F ( u ) = unfold[( m ⊤ ⊗ dest) m ⊗ F ( u, 1)] 21 / 49

  22. u = unfold[( m ⊤ ⊗ dest) m ⊗ F ( u, 1)] m � So ( � m ⊤ ⊗ 1) � F ( u ) = u The greatest fixed point of a monoidal functor is monoidal. 22 / 49

  23. Linear Functor A linear functor is a functor that consists of a monoidal ( F : X → Y ) and a comonoidal ( ¯ F : X → Y ) functor and four natural transformations (called “linear strengths”). ⊗ : F ( A ⊕ B ) → ¯ v R F ( A ) ⊕ F ( B ) ⊗ : F ( A ⊕ B ) → F ( A ) ⊕ ¯ v L F ( B ) ⊕ : F ( A ) ⊗ ¯ F ( B ) → ¯ v R F ( A ⊗ B ) ⊕ : ¯ F ( A ) ⊗ F ( B ) → ¯ v L F ( A ⊗ B ) The above data must satisfy several coherence conditions. For example, ⊕ ¯ ( m ⊗ ⊗ 1) v R F ( a ⊗ ) = a ⊗ (1 ⊗ v R ⊕ ) v R ⊕ ( v L ⊗ ⊗ 1) δ R R (1 ⊕ v L ⊕ ) = m ⊗ F ( δ R R ) v L ⊗ ( v R ⊗ ⊗ 1) δ R R (1 ⊕ m ⊗ ) = m ⊗ F ( δ R R ) v R ⊗ 23 / 49

  24. Linear fixed point Proposition The fixed point of a linear functor is linear. In order to prove this, we have to show that The greatest fixed point of a monoidal functor, ˆ F is monoidal and (dually) the least fixed point of a comonoidal functor, ¯ ˆ F is comonoidal.(Proved) There exist linear strengths between these two fixed point functors that must satisfy the coherence conditions. 24 / 49

  25. Does linear strength exist? F ( A ) ⊗ ¯ ¯ Prove ˆ ˆ ˆ F ( B ) ⊢ ˆ F ( A ⊗ B ) map exists and it is unique fold v R ⊕ map. It suffices to show that if there is a combinator c[ ] F ( A ) ⊗ X ⊢ ¯ ˆ ˆ F ( A ⊗ B ) c[ ] F ( B, X ) ⊢ ¯ F ( A ) ⊗ ¯ ˆ ˆ F ( A ⊗ B ) 25 / 49

Recommend


More recommend