词条 | List object |
释义 |
In category theory, an abstract mathematical discipline, and in its applications to logic and theoretical computer science, a list object is an abstract definition of a list, that is, a finite ordered sequence. Formal definitionLet {{var|C}} be a category with finite products and a terminal object 1. A list object over an object {{var|A}} of {{var|C}} is:
such that for any object {{var|B}} of {{var|C}} with maps {{var|b}} : 1 → {{var|B}} and {{var|t}} : {{var|A}} × {{var|B}} → {{var|B}}, there exists a unique {{var|f}} : {{var|L}}{{var|A}} → {{var|B}} such that the following diagram commutes: where 〈id{{var|A}}, {{var|f}}〉 denotes the arrow induced by the universal property of the product when applied to id{{var|A}} (the identity on {{var|A}}) and {{var|f}}. The notation {{var|A}}* (à la Kleene star) is sometimes used to denote lists over {{var|A}}. {{sfn|Johnstone|2002|loc=A2.5.15}} Equivalent definitionsIn a category with a terminal object 1, binary coproducts (denoted by +), and binary products (denoted by ×), a list object over {{var|A}} can be defined as the initial algebra of the endofunctor that acts on objects by {{var|X}} ↦ 1 + ({{var|A}} × {{var|X}}) and on arrows by {{var|f}} ↦ [id1,〈id{{var|A}}, {{var|f}}〉].[1] Examples
PropertiesLike all constructions defined by a universal mapping property, lists over an object are unique up to canonical isomorphism. The object {{var|L}}1 (lists over the terminal object) has the universal property of a natural number object. In any category with lists, one can define the length of a list {{var|L}}{{var|A}} to be the unique morphism {{var|l}} : {{var|L}}{{var|A}} → {{var|L}}1 which makes the following diagram commute:{{sfn|Johnstone|2002|p=117}} References1. ^Philip Wadler: Recursive types for free! University of Glasgow, July 1998. Draft.
See also
2 : Objects (category theory)|Topos theory |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。