请输入您要查询的百科知识:

 

词条 List object
释义

  1. Formal definition

      Equivalent definitions  

  2. Examples

  3. Properties

  4. References

  5. See also

{{Refimprove|date=December 2017}}

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 definition

Let {{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:

  1. an object {{var|L}}{{var|A}},
  2. a morphism {{var|o}}{{var|A}} : 1 → {{var|L}}{{var|A}}, and
  3. a morphism {{var|s}}{{var|A}} : {{var|A}} × {{var|L}}{{var|A}} → {{var|L}}{{var|A}}

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 definitions

In 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

  • In Set, the category of sets, list objects over a set {{var|A}} are simply finite lists with elements drawn from {{var|A}}. In this case, {{var|o}}{{var|A}} picks out the empty list and {{var|s}}{{var|A}} corresponds to appending an element to the head of the list.
  • In the calculus of inductive constructions or similar type theories with inductive types (or heuristically, even strongly typed functional languages such as Haskell), lists are types defined by two constructors, nil and cons, which correspond to {{var|o}}{{var|A}} and {{var|s}}{{var|A}}, respectively. The recursion principle for lists guarantees they have the expected univeral property.

Properties

Like 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}}

References

1. ^Philip Wadler: Recursive types for free! University of Glasgow, July 1998. Draft.
  • {{Cite book|url=https://www.worldcat.org/oclc/50164783|title=Sketches of an Elephant: a Topos Theory Compendium|last=Johnstone|first=Peter T.|date=2002|publisher=Oxford University Press|isbn=0198534256|location=Oxford|oclc=50164783}}

See also

  • Natural number object
  • F-algebra
  • Initial algebra
{{Category theory}}

2 : Objects (category theory)|Topos theory

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 17:45:49