Jump to content

Natural numbers object: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Replace png by svg image
Citation bot (talk | contribs)
Add: s2cid, authors 1-1. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Headbomb | Linked from Wikipedia:WikiProject_Academic_Journals/Journals_cited_by_Wikipedia/Sandbox2 | #UCB_webform_linked 617/999
 
(27 intermediate revisions by 18 users not shown)
Line 1: Line 1:
In [[category theory]], a '''natural numbers object''' ('''NNO''') is an object endowed with a [[Recursion (computer science)|recursive]] [[Mathematical structure|structure]] similar to [[natural number]]s. More precisely, in a [[Category (mathematics)|category]] '''E''' with a [[terminal object]] 1, an NNO ''N'' is given by:
{{refimprove|date=December 2017}}
In [[category theory]], a '''natural number object (NNO)''' is an object endowed with a [[Recursion (computer science)|recursive]] [[Mathematical structure|structure]] similar to [[natural number]]s. More precisely, in a [[Category (mathematics)|category]] '''E''' with a [[terminal object]] 1, an NNO ''N'' is given by:


# a [[global element]] ''z'' : 1 → ''N'', and
# a [[global element]] ''z'' : 1 → ''N'', and
Line 8: Line 7:


# ''u'' ∘ ''z'' = ''q'', and
# ''u'' ∘ ''z'' = ''q'', and
# ''u'' ∘ ''s'' = ''f'' ∘ ''u''.{{sfn|Johnstone|2002|loc=A2.5.1}}{{sfn|Lawvere|2005|p=14}}<ref>{{Cite journal|last=Leinster|first=Tom|date=2014|title=Rethinking set theory|journal=American Mathematical Monthly |volume=121|issue=5|pages=403–415|arxiv=1212.6543|bibcode=2012arXiv1212.6543L|doi=10.4169/amer.math.monthly.121.05.403|s2cid=5732995 }}</ref>
# ''u'' ∘ ''s'' = ''f'' ∘ ''u''.<ref>{{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|at=A2.5.1}}</ref>


In other words, the triangle and square in the following diagram commute.
In other words, the triangle and square in the following diagram commute.
Line 19: Line 18:
# ''y'' ∈<sub>'''E'''</sub> ''N'' ⊢ ''u'' (''s'' ''y'') = ''f'' (''u'' (''y''))
# ''y'' ∈<sub>'''E'''</sub> ''N'' ⊢ ''u'' (''s'' ''y'') = ''f'' (''u'' (''y''))


The above definition is the [[universal property]] of NNOs, meaning they are defined [[up to]] [[List of mathematical jargon#canonical|canonical]] [[morphism|isomorphism]]. If the arrow ''u'' as defined above merely has to exist, ''[[wiktionary:i.e.|i.e.]]'' uniqueness is not required, then ''N'' is called a ''weak'' NNO.
The above definition is the [[universal property]] of NNOs, meaning they are defined [[up to]] [[List of mathematical jargon#canonical|canonical]] [[morphism|isomorphism]]. If the arrow ''u'' as defined above merely has to exist, that is, uniqueness is not required, then ''N'' is called a ''weak'' NNO.


== Equivalent definitions ==
== Equivalent definitions ==


NNOs in [[Cartesian closed category|cartesian closed categories]] (CCCs) or [[Topos|topoi]] are sometimes defined in the following equivalent way (due to [[Lawvere]]): for every pair of arrows ''g'' : ''A'' → ''B'' and ''f'' : ''B'' → ''B'', there is a unique ''h'' : ''N'' × ''A'' → ''B'' such that the squares in the following diagram commute.
NNOs in [[Cartesian closed category|cartesian closed categories]] (CCCs) or [[Topos|topoi]] are sometimes defined in the following equivalent way (due to [[Lawvere]]): for every pair of arrows ''g'' : ''A'' → ''B'' and ''f'' : ''B'' → ''B'', there is a unique ''h'' : ''N'' × ''A'' → ''B'' such that the squares in the following diagram commute.{{sfn|Johnstone|2002|loc=A2.5.2}}


<div style="margin-left: 2em">[[Image:NNO definition alt.png|alternate NNO definition]]</div>
<div style="margin-left: 2em">[[Image:NNO definition alt.png|alternate NNO definition]]</div>
Line 29: Line 28:
This same construction defines weak NNOs in cartesian categories that are not cartesian closed.
This same construction defines weak NNOs in cartesian categories that are not cartesian closed.


In a category with a terminal object 1 and binary [[Coproduct|coproducts]] (denoted by +), an NNO can be defined as the [[initial algebra]] of the [[endofunctor]] that acts on objects by {{math|{{var|X}} ↦ 1 + {{var|X}}}} and on arrows by {{math|{{var|f}} ↦ [id<sub>1</sub>, {{var|f}}]}}.
In a category with a terminal object 1 and binary [[coproduct]]s (denoted by +), an NNO can be defined as the [[initial algebra]] of the [[endofunctor]] that acts on objects by {{math|{{var|X}} ↦ 1 + {{var|X}}}} and on arrows by {{math|{{var|f}} ↦ id<sub>1</sub> + {{var|f}}}}.<ref>{{Cite book|title=Category theory for computing science|last1=Barr|first1=Michael|last2=Wells|first2=Charles|date=1990|publisher=Prentice Hall|isbn=0131204866|location=New York|oclc=19126000|page=358}}</ref>


== Properties ==
== Properties ==


* Every NNO is an initial object of the category of [[Diagram (category theory)|diagrams]] of the form
* Every NNO is an initial object of the category of [[Diagram (category theory)|diagrams]] of the form
:<math displaystyle="block">1 \xrightarrow{~ \quad q \quad ~} A \xrightarrow{~ \quad f \quad ~} A</math>
::<math displaystyle="block">1 \xrightarrow{~ \quad q \quad ~} A \xrightarrow{~ \quad f \quad ~} A</math>

* If a cartesian closed category has weak NNOs, then every [[slice category|slice]] of it also has a weak NNO.


* If a cartesian closed category has weak NNOs, then every [[slice category|slice]] of it also has a weak NNO.
* NNOs can be used for [[non-standard model]]s of [[type theory]] in a way analogous to non-standard models of analysis. Such categories (or topoi) tend to have "infinitely many" non-standard natural numbers.{{clarify|date=December 2017}} (Like always, there are simple ways to get non-standard NNOs; for example, if ''z'' = ''s z'', in which case the category or topos '''E''' is trivial.)
* NNOs can be used for [[non-standard model]]s of [[type theory]] in a way analogous to non-standard models of analysis. Such categories (or topoi) tend to have "infinitely many" non-standard natural numbers.{{clarify|date=December 2017}} (Like always, there are simple ways to get non-standard NNOs; for example, if ''z'' = ''s z'', in which case the category or topos '''E''' is trivial.)

* [[Peter Freyd|Freyd]] showed that ''z'' and ''s'' form a [[coproduct]] diagram for NNOs; also, !<sub>''N''</sub> : ''N'' → 1 is a [[coequalizer]] of ''s'' and 1<sub>''N''</sub>, ''i.e.'', every pair of global elements of ''N'' are connected by means of ''s''; furthermore, this pair of facts characterize all NNOs.
* [[Peter Freyd|Freyd]] showed that ''z'' and ''s'' form a [[coproduct]] diagram for NNOs; also, !<sub>''N''</sub> : ''N'' → 1 is a [[coequalizer]] of ''s'' and 1<sub>''N''</sub>, ''i.e.'', every pair of global elements of ''N'' are connected by means of ''s''; furthermore, this pair of facts characterize all NNOs.


== Examples ==
== Examples ==


* In '''Set''', the [[category of sets]], the standard natural numbers are an NNO. A terminal object in '''Set''' is a [[Singleton (mathematics)|singleton]], and a function out of a singleton picks out a single [[Element (set theory)|element]] of a set. The natural numbers 𝐍 are an NNO where {{var|z}} is a function from a singleton to 𝐍 whose [[Image (mathematics)|image]] is zero, and {{var|s}} is the [[successor function]]. (We could actually allow {{var|z}} to pick out ''any'' element of 𝐍, and the resulting NNO would be isomorphic to this one.) One can prove that the diagram in the definition commutes using [[mathematical induction]].
* In '''Set''', the [[category of sets]], the standard natural numbers are an NNO.{{sfn|Johnstone|2005|p=108}} A terminal object in '''Set''' is a [[Singleton (mathematics)|singleton]], and a function out of a singleton picks out a single [[Element (set theory)|element]] of a set. The natural numbers 𝐍 are an NNO where {{var|z}} is a function from a singleton to 𝐍 whose [[Image (mathematics)|image]] is zero, and {{var|s}} is the [[successor function]]. (We could actually allow {{var|z}} to pick out ''any'' element of 𝐍, and the resulting NNO would be isomorphic to this one.) One can prove that the diagram in the definition commutes using [[mathematical induction]].
* In the category of types of [[Martin-Löf type theory]] (with types as objects and functions as arrows), the standard natural numbers type '''nat''' is an NNO. One can use the recursor for '''nat''' to show that the appropriate diagram commutes.
* In the category of types of [[Martin-Löf type theory]] (with types as objects and functions as arrows), the standard natural numbers type '''nat''' is an NNO. One can use the recursor for '''nat''' to show that the appropriate diagram commutes.
* Assume that <math> \mathcal{E} </math> is a [[Grothendieck topos]] with terminal object <math> \top </math> and that <math> \mathcal{E} \simeq \mathbf{Shv}(\mathfrak{C},J) </math> for some [[Grothendieck topology]] <math> J </math> on the category <math> \mathfrak{C} </math>. Then if <math> \Gamma_{\mathbb{N}} </math> is the constant presheaf on <math> \mathfrak{C} </math>, then the NNO in <math> \mathcal{E} </math> is the sheafification of <math> \Gamma_{\mathbb{N}} </math> and may be shown to take the form <math display="block"> \mathbb{N}_{\mathcal{E}} \cong \left(\Gamma_{\mathbb{N}}\right)^{++} \cong \coprod_{n \in \mathbb{N}} \top. </math>

== References ==
{{Reflist}}


==See also==
==See also==
Line 55: Line 50:
* [[Categorical logic]]
* [[Categorical logic]]


== References ==
[[Category:Objects (category theory)]]
{{Reflist}}
* {{Cite book|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}}
* {{Cite journal|last=Lawvere|first=William|date=2005|orig-year=1964|title=An elementary theory of the category of sets (long version) with commentary|url=http://www.tac.mta.ca/tac/reprints/articles/11/tr11abs.html|journal=Reprints in Theory and Applications of Categories|volume=11|pages=1–35}}

== External links ==
* Lecture notes from [[Robert Harper (computer scientist)|Robert Harper]] which discuss NNOs in Section 2.2: https://www.cs.cmu.edu/~rwh/courses/hott/notes/notes_week3.pdf
* A blog post by Clive Newstead on the {{var|n}}-Category Cafe: https://golem.ph.utexas.edu/category/2014/01/an_elementary_theory_of_the_ca.html
* Notes on datatypes as algebras for endofunctors by computer scientist [[Philip Wadler]]: http://homepages.inf.ed.ac.uk/wadler/papers/free-rectypes/free-rectypes.txt
* Notes on the [[nLab]]: https://ncatlab.org/nlab/show/ETCS


{{Category theory}}
{{Category theory}}

[[Category:Objects (category theory)]]
[[Category:Topos theory]]
[[Category:Categorical logic]]

Latest revision as of 18:04, 18 June 2023

In category theory, a natural numbers object (NNO) is an object endowed with a recursive structure similar to natural numbers. More precisely, in a category E with a terminal object 1, an NNO N is given by:

  1. a global element z : 1 → N, and
  2. an arrow s : NN,

such that for any object A of E, global element q : 1 → A, and arrow f : AA, there exists a unique arrow u : NA such that:

  1. uz = q, and
  2. us = fu.[1][2][3]

In other words, the triangle and square in the following diagram commute.

A commutative diagram expressing the equations in the definition of an NNO

The pair (q, f) is sometimes called the recursion data for u, given in the form of a recursive definition:

  1. u (z) = q
  2. yE Nu (s y) = f (u (y))

The above definition is the universal property of NNOs, meaning they are defined up to canonical isomorphism. If the arrow u as defined above merely has to exist, that is, uniqueness is not required, then N is called a weak NNO.

Equivalent definitions

[edit]

NNOs in cartesian closed categories (CCCs) or topoi are sometimes defined in the following equivalent way (due to Lawvere): for every pair of arrows g : AB and f : BB, there is a unique h : N × AB such that the squares in the following diagram commute.[4]

alternate NNO definition

This same construction defines weak NNOs in cartesian categories that are not cartesian closed.

In a category with a terminal object 1 and binary coproducts (denoted by +), an NNO can be defined as the initial algebra of the endofunctor that acts on objects by X ↦ 1 + X and on arrows by f ↦ id1 + f.[5]

Properties

[edit]
  • Every NNO is an initial object of the category of diagrams of the form
  • If a cartesian closed category has weak NNOs, then every slice of it also has a weak NNO.
  • NNOs can be used for non-standard models of type theory in a way analogous to non-standard models of analysis. Such categories (or topoi) tend to have "infinitely many" non-standard natural numbers.[clarification needed] (Like always, there are simple ways to get non-standard NNOs; for example, if z = s z, in which case the category or topos E is trivial.)
  • Freyd showed that z and s form a coproduct diagram for NNOs; also, !N : N → 1 is a coequalizer of s and 1N, i.e., every pair of global elements of N are connected by means of s; furthermore, this pair of facts characterize all NNOs.

Examples

[edit]
  • In Set, the category of sets, the standard natural numbers are an NNO.[6] A terminal object in Set is a singleton, and a function out of a singleton picks out a single element of a set. The natural numbers 𝐍 are an NNO where z is a function from a singleton to 𝐍 whose image is zero, and s is the successor function. (We could actually allow z to pick out any element of 𝐍, and the resulting NNO would be isomorphic to this one.) One can prove that the diagram in the definition commutes using mathematical induction.
  • In the category of types of Martin-Löf type theory (with types as objects and functions as arrows), the standard natural numbers type nat is an NNO. One can use the recursor for nat to show that the appropriate diagram commutes.
  • Assume that is a Grothendieck topos with terminal object and that for some Grothendieck topology on the category . Then if is the constant presheaf on , then the NNO in is the sheafification of and may be shown to take the form

See also

[edit]

References

[edit]
  1. ^ Johnstone 2002, A2.5.1.
  2. ^ Lawvere 2005, p. 14.
  3. ^ Leinster, Tom (2014). "Rethinking set theory". American Mathematical Monthly. 121 (5): 403–415. arXiv:1212.6543. Bibcode:2012arXiv1212.6543L. doi:10.4169/amer.math.monthly.121.05.403. S2CID 5732995.
  4. ^ Johnstone 2002, A2.5.2.
  5. ^ Barr, Michael; Wells, Charles (1990). Category theory for computing science. New York: Prentice Hall. p. 358. ISBN 0131204866. OCLC 19126000.
  6. ^ Johnstone 2005, p. 108.
[edit]