简体   繁体   English

为什么初始代数对应于数据和最终的余代数?

[英]Why do initial algebras correspond to data and final coalgebras to codata?

If I understand correctly, we can model inductive data types as initial F-algebras and co-inductive data types as final F-coalgebras (for an appropriate endofunctor F ) [ 1 ]. 如果我理解正确,我们可以将归纳数据类型建模为初始F-代数和共感应数据类型作为最终F-余代数(对于适当的内耦合器F )[ 1 ]。 I understand that according to Lambek's lemma the initial algebras (and final coalgebras) are fixed point solutions of the isomorphism T ≅ FT , but I don't see why the initial algebra is the least fixed point, while the final coalgebra is the greatest fixed point. 据我所知,根据Lambek引理初始代数(和最终余代数)被固定在同构的单点解决方案T ≅ FT ,但我不明白为什么最初的代数是固定的点,而最后的余代数是最大的固定点。 (Is it obvious that the isomorphism T ≅ FT has a solution?) (显然同构T ≅ FT有一个解决方案吗?)

Also I'm not really clear on how are inductive and co-inductive data types defined in type theory. 另外,我还不清楚类型理论中如何定义归纳和共感数据类型。 Are there any recommended resources on this topic and maybe their relationship to category theory? 是否有关于此主题的推荐资源,以及它们与类别理论的关系?

Thank you! 谢谢!

My understanding is that, in principle, there may be many solutions to the fixed point equation T ≅ FT . 我的理解是,原则上,定点方程T ≅ FT可能有很多解。 By Lambek's lemma, the initial algebra, if it exists, is one of those fixed points. 根据Lambek的引理,初始代数(如果存在)是其中一个固定点。 In fact it's the least fixed point. 事实上,这是最不固定的一点。

There is a universal condition that defines the least fixed point, along the lines of there being a unique morphism to any other fixed point that satisfy certain commutation conditions. 有一个通用条件定义了最小的固定点,沿着与满足某些换向条件的任何其他固定点存在唯一态射的线。

In other words, not every fixed point defines the initial algebra. 换句话说,并非每个固定点都定义了初始代数。

The same argument applies to final coalgebras and greatest fixed points. 同样的论证适用于最终的余代数和最大的固定点。

See, for instance, Least Fixed Point of a Functor . 例如,参见Functor的最小不动点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM