fbpx
维基百科

單子 (範疇論)

數學的分支範疇論中,單子(英語:monad),又稱三元組(triple, triad)、標準構造(standard construction)、基本構造(fundamental construction[1],是一個內函子英语endofunctor(即由某範疇映到自身的函子),連同滿足特定連貫條件英语coherence condition的兩個自然變換,三者構成的整體。單子用於研究互為伴隨的函子對,並將偏序集上的闭包算子推廣到任意範疇。

導論與定義 编辑

單子是一類內函子英语endofunctor(連同其他資訊)。例如,若  為一對伴隨函子  的左伴隨,則複合 是單子。若  互為逆函子,則對應的單子是恆等函子。一般而言,伴隨關係並不等同范畴的等价,而可以聯繫不同性質的範疇。為了探討伴隨關係所「保持」的性質,數學家研究單子論。理論的另一半,即藉考慮 ,以研究伴隨關係,是單子論的對偶理論。該類函子稱為餘單子(英語:comonad)。

嚴格定義 编辑

本條目中, 皆表示某範疇 上的單子是函子 ,連同兩個自然變換,分別是單位 (其中  上的恆等函子)與乘法 (其中 是複合 ,亦是  的函子),且要滿足下列連貫條件英语coherence condition

  •  (左右皆為 的自然變換)。此處  水平複合而得。
  •  (兩者皆為 的自然變換)。此處 表示由函子 到自身的恆等自然變換。

以上兩式,亦可以下列交換圖複述:

 
            
 

記號  的含義,參見自然變換,又或考慮以下更具體的寫法,不用水平複合記號,並將各函子作用在任意物件 上:

                

定義中,若將 當成幺半群的乘法,則第一條公理類似幺半群英语monoid (category theory)乘法結合律,而第二條公理類似單位元的存在性(由 給出)。準確而言, 上的單子,可以等價地定義為 的內函子範疇 中的幺半群英语monoid (category theory)。(該範疇的物件是 上的內函子,而態射是內函子間的自然變換,幺半結構來自內函子的複合運算。)如此,單子不僅在形式上具有與幺半群相似的公理,甚而單子就是幺半群的特例。

冪集單子 编辑

冪集單子 集合範疇 上的單子。其定義中,函子 取為冪集運算,即 為集合 冪集,而對於函數   的子集映至其像集,即 。對每個集合 ,有函數 ,對每個元素 映至單元子集 , 並有函數

 

 的若干個子集構成的族,映至該些子集的並集。以上是冪集單子的定義。

兩個單子的複合,未必為單子。舉例,冪集單子 的二次疊代 ,無法配備單子結構。[2]

餘單子 编辑

取上節定義的範疇論對偶英语Dual (category theory),便是餘單子(或餘三元組)的定義。簡單複述,範疇 上的餘單子,是對偶範疇英语opposite category 上的單子。所以,餘單子是由  的某個函子 ,連同餘單位餘乘法(英語:counit and comultiplication)兩個自然變換,組成的整體,而三者所要滿足的公理,是將原定義中所有態射反轉方向而得。

單子之於幺半群,如同餘單子之於餘幺半群。每個集合皆是餘幺半群,且僅有唯一一種方式,所以抽象代數中,較少考慮餘幺半群。然而,在線性代數中,向量空間範疇(配備張量積)的餘幺半群較為重要,以餘代數之名為人所知。

歷史 编辑

單子的概念最早由羅傑·戈德芒英语Roger Godement於1958年提出[3],當時稱為「標準構造」(英語:standard construction)。實際上,該書用到的是餘單子,用作解決某個層餘調英语Sheaf cohomology問題。

其後,單子又出現於彼得·胡伯(Peter Huber)對範疇同倫的研究中。該論文包含由任意一對伴隨函子得出單子的證明。[4]

1965年,海因里希·克萊斯利英语Heinrich Kleisli[5],及塞缪尔·艾伦伯格約翰·柯曼·摩爾英语John Coleman Moore二人[6]分別獨立證明反向的結論,即每個單子皆可由某對伴隨函子產生。後一篇論文中,將單子稱為「三元組」。

1963年,威廉·洛維爾英语William Lawvere提出泛代數的範疇論。1966年,弗雷德·林頓(Fred Linton)將該理論用單子的語言表達。[7]單子本身來自拓撲方面的考量,事先似乎比洛維爾的理論更難處理,但已成為用範疇論語言闡述泛代數的方法中,較常見的一個。現今常用的英文名稱monad是1971年由桑德斯·麥克蘭恩在《現職數學家用的範疇英语Categories for the Working Mathematician》引入,以其類似單子論中的同名哲學概念,即某種能生出其他所有事物的實體。

1980年代,歐金尼奧·莫吉英语Eugenio Moggi理論計算機科學中,利用單子,為電腦程式的若干方面建立模型,包括例外處理、邊界情況。[8]此後,有多種函數式編程語言仔細實作此想法,作為一種基本規律,同樣稱為單子。2001年,若干數學家注意到,用單子研究程式標誌語意的方法,與洛維爾的理論,兩者之間有關聯。[9]。此為代數與語義間的聯繫,是後來活躍的研究課題。

例子 编辑

伴隨的複合 编辑

若有伴隨關係

 

(即  的左伴隨,下同),則由此有 上的單子。此普遍的構造,取內函子為複合

 

而單位自然變換來自伴隨的單位 ,乘法自然變換源自伴隨的餘單位 

 

反之,給定單子,可以明確找回一對伴隨函子,使單子為該對伴隨函子的複合。此構造用到下節定義的 代數的艾倫伯格-摩爾範疇 [10]

兩重對偶 编辑

給定 雙重對偶單子(英語:double dualisation monad)源自伴隨關係

 

其中兩個函子 皆將 向量空间 映至對偶空間 ,所以對應的單子將向量空間 映至雙對偶 Kock (1970)對此有更廣泛的討論。

偏序集的閉包算子 编辑

偏序集 可以視為特殊的範疇,任意兩件物件之間有最多一支態射,且  有態射当且仅当偏序中 。於是,偏序集之間的函子,即是保序映射,而伴隨函子對,則組成兩偏序集間的伽罗瓦连接,相應的單子是伽羅華連接的闭包算子

自由遺忘伴隨 编辑

又舉例,設 群範疇 集合范畴 遺忘函子,將映至其基集,又設 自由函子,由  ,則  的左伴隨。此時,對應的單子 的作用是,輸入一個集合 ,輸出自由群 的基集,即字母取自 ,且無相鄰兩個字母互為逆元的字串的集合。

該單子的單位變換,由包含映射

 

給出,該包含映射將 的任意元素,看成僅得一個字元的字串,從而是 的元素。最後,單子的乘法

 

串接或「壓平」運算,將若干條字串組成的串,映至該串中所有字串前後連接而成的一條字串。至此描述完單子的兩個自然變換

前述例子中,自由群可以推廣至其他種類的代數結構,即泛代数意義下的任意一英语Variety (universal algebra)代數。如此,每類代數定義了集合範疇上的一個單子。更重要的是,該類代數的範疇,可從單子找回,即單子的艾倫伯格-摩爾代數範疇,故單子可視為泛代數之簇的推廣。

另外,尚有一個單子源自伴隨關係。在向量空間範疇 上,若 表示將向量空間 映至其张量代数 的內函子,則相應有單位自然變換將 嵌入到其张量代数,並有乘法自然變換,在 處的分量是態射 ,將張量積之張量積展開化簡。

餘密度單子 编辑

只要滿足某些不強的條件,無左伴隨的函子也可以產生單子,稱為餘密度單子英语codensity monad。例如,從有限集合範疇 到集合範疇 的包含函子無法配備左伴隨,但其餘密度單子定義在 上,將任意集合 映至其上所有超滤子集合 。 類似例子見於Leinster (2013)。

單子的代數 编辑

給定範疇 上的單子 ,可以考慮 中的 代數物件 在該些物件上的作用,與單子的單位與乘法相容。具體而言, 代數  中的物件 ,連同態射 (稱為該代數的結構映射),使得圖

   

皆可交換。

 代數間的態射  中的態射 ,且要使

 

可交換。於是, 代數及之間的態射組成範疇,稱為艾倫伯格-摩爾範疇(英語:Eilenberg–Moore category),記為 .

例子 编辑

自由群單子上的代數 编辑

 為前述自由群單子,則 代數是集合 ,連同由 生成的自由群  的映射(求值evaluation),且該映射要滿足結合律與單位元的公理。換言之, 本身就具有群結構,而  的映射,是將字串按 的群乘法,計算所得的結果

分佈單子上的代數 编辑

另一個例子是集合範疇上的分佈單子(英語:distribution monad ,其將集合 映至其上所有有限支撐概率分佈的集合。該等分佈,是函數 ,僅於有限多個元素 處取值非零,而各元素處取值之和為 。以符號表示,

 

可由定義證明,分佈單子上的代數,等同於凸集,即集合要配備二元運算 (對每個 ),滿足的公理比照歐氏空間中,凸組合 具備的性質。[11][12]

對稱單子上的代數 编辑

另一個有用的單子,是交換環 的模範疇 上的對稱代數單子

 

  映到各階對稱張量英语symmetric tensor冪的直和

 

其中 。例如, ,左右兩邊作為 模同構。如此,對稱代數單子上的代數,是交換 代數。類似地,也有反對稱張量英语Antisymmetric tensor單子 與全張量單子 ,相應的代數分別是反對稱 代數與自由 代數,故

 

前者是 上添加 個生成元的自由反對稱代數,而後者則是 個生成元的自由代數。

E環譜中的交換代數 编辑

對於可交換 代數英语Highly structured ring spectrum,亦有類似的構造,[13]:113對於可交換 代數 ,對應單子上的代數是可交換的 代數。若 表示 模的範疇,則可以考慮函子 ,定義為

 

其中

 

此函子是單子,而由該單子上的代數範疇,可以得到可交換 代數的範疇 

單子與伴隨 编辑

前文所述,任何伴隨關係皆產生單子。反之,每個單子 皆可由某個伴隨關係產生,即原範疇與 代數的艾倫伯格-摩爾範疇之間的自由-遺忘伴隨

 

其中,左伴隨  的物件 映到自由 代數 ,右伴隨 則將 代數 遺忘掉 ,變回 。然而,通常有多組不同的伴隨關係產生同樣的單子,該些伴隨關係組成範疇 :物件是伴隨關係 使得 ,而態射是在 一側為恆等函子的伴隨關係態射。如此,艾倫伯格-摩爾範疇的自由-遺忘伴隨  的終物件,而始物件是克萊斯利範疇英语Kleisli category ,定義為 中的自由 代數組成的完全子範疇,即僅包含形如  代數,其中 歷遍 的物件。

單子伴隨 编辑

設有伴隨關係 ,對應單子為 ,則函子 可分解為

 

其中 是遺忘函子。換言之,對 中任意物件 ,都能賦予 自然的 代數結構。若分解式中,首個函子 給出  範疇間的等價,則形容該伴隨關係為單子的(英語:monadic)。[14]後亦引申用作形容函子,若函子 有左伴隨 ,且該伴隨關係為單子的,則 亦稱為單子的。例如,群範疇集合範疇間的自由-遺忘伴隨是單子的,因為相應單子 上的 代數是群(見前文)。一般而言,若有伴隨關係 為單子的,則單從 的物件及其上的 作用,已足以重組出 的物件。

貝克單子性定理 编辑

貝克單子性定理給出伴隨關係在何種充要條件下為單子的。定理有以下簡化版:

若滿足以下三項條件:

  •  保守函子英语conservative functor,換言之, 反映同構(英語:reflects isomorphisms),即對 中每一支態射,其為同構當且僅當在 作用下的像為 中的同構;
  •  餘等化子英语coequalizer
  •  餘等化子英语coequalizer

 為單子的。

例如,由豪斯多夫空间範疇 集合範疇 的遺忘函子是單子的。然而,由任意拓撲空間範疇 到集合範疇 的遺忘函子則並非單子的,而定理中,保守函子的條件不成立,因為有非緊或非豪斯多夫空間,之間存在連續雙射,但不為同胚[15] 貝克定理有對偶版本,刻劃餘單子伴隨關係,對拓撲斯論及有關下降英语descent (category theory)代数几何課題有用。

餘單子的伴隨關係,首先有下列例子:

 

其中 皆為交換環,左伴隨用到的張量積 的定義中,選定了環同態 ,而右伴隨 是遺忘函子。根據貝克定理,當且僅當 忠實平坦 模時,該伴隨為餘單子的。所以,可將配備下降數據(英語:descent datum,即源自伴隨關係的餘單子的作用)的 模,降成 模。所得的忠實平坦下降英语faithfully flat descent理論,廣泛應用於代數幾何。

用途 编辑

函数式编程中,會使用單子表達某類(有時有副作用的)順序式計算,見单子 (函数式编程)

範疇論邏輯中,藉闭包算子內代數,以及兩者與S4模態邏輯直觉主义逻辑的關係,能以單子餘單子理論類比模态逻辑

推廣 编辑

亦可定義2-範疇 中的單子。

參見 编辑

  • 單子間的分配律英语Distributive law between monads
  • 洛維爾理論英语Lawvere theory
  • 单子 (函数式编程)——函數式編程中,用作構造通用類型的設計模式
  • 多子 (範疇論)英语Polyad
  • 強單子英语Strong monad

參考文獻 编辑

  1. ^ Barr, Michael; Wells, Charles. Toposes, Triples and Theories [拓撲斯、三元組與理論] (PDF). Grundlehren der mathematischen Wissenschaften 278 (Springer-Verlag). 1985: 82 and 120 [2021-09-17]. ISBN 0-387-96115-1. (原始内容 (PDF)于2020-11-25). 
  2. ^ Klin; Salamanca. Iterated Covariant Powerset is not a Monad [共變冪集疊代後不是單子]. Electronic Notes in Theoretical Computer Science. 2018-12-01, 341: 261–276. doi:10.1016/j.entcs.2018.11.013  (英语). 
  3. ^ Godement, Roger. Topologie Algébrique et Théorie des Faisceaux [代數拓撲與層論]. Actualités Sci. Ind., Publ. Math. Univ. Strasbourg 1252. Paris: Hermann. 1958: viii+283 pp (法语).  |issue=被忽略 (帮助)
  4. ^ Huber, Peter J. Homotopy theory in general categories [一般範疇的同倫論]. Mathematische Annalen. 1961, 144 (5): 361–385 (英语). 
  5. ^ Kleisli, Heinrich. Every standard construction is induced by a pair of adjoint functors [每個標準構造皆由某對伴隨函子產生]. Proceedings of the American Mathematical Society. 1965, 16 (3): 544–546 (英语). 
  6. ^ Eilenberg, Samuel; Moore, John Coleman. Adjoint functors and triples [伴隨函子與三元組]. Am. J. Math. 1965, 9: 301–398 (英语). 
  7. ^ Linton, Fred E. J. Some aspects of equational theories [等式理論的若干方面]. Proc. Conf. on Categorical Algebra at La Jolla. 1966: 84–95 (英语).  参数|journal=与模板{{cite conference}}不匹配(建议改用{{cite journal}}|book-title=) (帮助)
  8. ^ Moggi, Eugenio. Notions on computation on monads [單子上的計算概念] (PDF). [2021-09-25]. (原始内容 (PDF)于2011-03-22) (英语). 
  9. ^ Plotkin, Gordon; Power, John. Adequacy for Algebraic Effects [代數效果的適切性]. Proc. FOSSACS 2001. Lecture Notes in Computer Science 2030. 2001: 1–24. doi:10.1007/3-540-45315-6_1 (英语). 
  10. ^ Riehl (2017,162)
  11. ^ Świrszcz, T. Monadic functors and convexity [單子函子與凸性]. Bull. Acad. Polon. Sci. Sér. Sci. Math. Astron. Phys. 1974, 22: 39–42. MR 0390019 (英语). 
  12. ^ Jacobs, Bart. Convexity, Duality and Effects [凸性、對偶、作用]. Calude, C.S.; Sassone, V. (编). Theoretical Computer Science [理論電腦科學]. IFIP Advances in Information and Communication Technology 323. 2010: 1–19. ISBN 978-3-642-15239-9. doi:10.1007/978-3-642-15240-5_1  (英语). 
  13. ^ Basterra, M. André–Quillen cohomology of commutative S-algebras [交換S代數的André–Quillen上同調]. Journal of Pure and Applied Algebra. 1999-12-15, 144 (2): 111–143 [2021-09-18]. ISSN 0022-4049. doi:10.1016/S0022-4049(98)00051-6 . (原始内容于2022-01-30) (英语). 
  14. ^ MacLane (1978)所用定義中,條件「等價」要再加強為「同構英语Isomorphism of categories」。
  15. ^ MacLane (1978,§§VI.3, VI.9)
  • Barr, Michael; Wells, Charles. Category Theory for Computing Science [電腦科學用的範疇論] (PDF). 1999 [2021-09-24]. (原始内容 (PDF)于2021-12-30) (英语). 
  • Kock, Anders. On Double Dualization Monads [論雙重對偶單子]. Mathematica Scandinavica. 1970, 27: 151. doi:10.7146/math.scand.a-10995  (英语). 
  • Leinster, Tom. Codensity and the ultrafilter monad [餘密度與超濾子單子]. Theory and Applications of Categories. 2013, 28: 332–370. Bibcode:2012arXiv1209.3606L. arXiv:1209.3606  (英语). 
  • MacLane, Saunders. Categories for the Working Mathematician [現職數學家用的範疇]. Graduate Texts in Mathematics 5. 1978. ISBN 978-1-4419-3123-8. doi:10.1007/978-1-4757-4721-8  (英语). 
  • Pedicchio, Maria Cristina; Tholen, Walter (编). Categorical Foundations. Special Topics in Order, Topology, Algebra, and Sheaf Theory [範疇基礎。序、拓撲、代數、層論特別專題]. Encyclopedia of Mathematics and Its Applications 97. Cambridge: Cambridge University Press. 2004. ISBN 0-521-83414-7. Zbl 1034.18001 (英语). 
  • Riehl, Emily. Category Theory in Context [脈絡中的範疇論] (PDF). 2017. ISBN 9780486820804. (原始内容 (PDF)于5 Apr 2021) (英语). 
  • Turi, Daniele. Category Theory Lecture Notes [範疇論講義] (PDF). 1996–2001 [2021-09-24]. (原始内容 (PDF)于2022-02-21) (英语). 


單子, 範疇論, 关于單子在電腦軟件的應用, 请见, 單子, 函數式編程, 數學的分支範疇論中, 單子, 英語, monad, 又稱三元組, triple, triad, 標準構造, standard, construction, 基本構造, fundamental, construction, 是一個內函子, 英语, endofunctor, 即由某範疇映到自身的函子, 連同滿足特定連貫條件, 英语, coherence, condition, 的兩個自然變換, 三者構成的整體, 單子用於研究互為伴隨的函子對, . 关于單子在電腦軟件的應用 请见 單子 函數式編程 數學的分支範疇論中 單子 英語 monad 又稱三元組 triple triad 標準構造 standard construction 基本構造 fundamental construction 1 是一個內函子 英语 endofunctor 即由某範疇映到自身的函子 連同滿足特定連貫條件 英语 coherence condition 的兩個自然變換 三者構成的整體 單子用於研究互為伴隨的函子對 並將偏序集上的闭包算子推廣到任意範疇 目录 1 導論與定義 1 1 嚴格定義 1 2 冪集單子 1 3 餘單子 1 4 歷史 2 例子 2 1 伴隨的複合 2 1 1 兩重對偶 2 1 2 偏序集的閉包算子 2 1 3 自由遺忘伴隨 2 2 餘密度單子 3 單子的代數 3 1 例子 3 1 1 自由群單子上的代數 3 1 2 分佈單子上的代數 3 1 3 對稱單子上的代數 3 1 4 E 環譜中的交換代數 4 單子與伴隨 4 1 單子伴隨 4 2 貝克單子性定理 5 用途 6 推廣 7 參見 8 參考文獻導論與定義 编辑單子是一類內函子 英语 endofunctor 連同其他資訊 例如 若F displaystyle F nbsp 和G displaystyle G nbsp 為一對伴隨函子 F displaystyle F nbsp 為G displaystyle G nbsp 的左伴隨 則複合G F displaystyle G circ F nbsp 是單子 若F displaystyle F nbsp 與G displaystyle G nbsp 互為逆函子 則對應的單子是恆等函子 一般而言 伴隨關係並不等同范畴的等价 而可以聯繫不同性質的範疇 為了探討伴隨關係所 保持 的性質 數學家研究單子論 理論的另一半 即藉考慮F G displaystyle F circ G nbsp 以研究伴隨關係 是單子論的對偶理論 該類函子稱為餘單子 英語 comonad 嚴格定義 编辑 本條目中 C displaystyle mathcal C nbsp 皆表示某範疇 C displaystyle mathcal C nbsp 上的單子是函子T C C displaystyle T mathcal C to mathcal C nbsp 連同兩個自然變換 分別是單位h 1 C T displaystyle eta 1 mathcal C to T nbsp 其中1 C displaystyle 1 mathcal C nbsp 是C displaystyle mathcal C nbsp 上的恆等函子 與乘法m T 2 T displaystyle mu T 2 to T nbsp 其中T 2 displaystyle T 2 nbsp 是複合T T displaystyle T circ T nbsp 亦是C displaystyle mathcal C nbsp 到C displaystyle mathcal C nbsp 的函子 且要滿足下列連貫條件 英语 coherence condition m T m m m T displaystyle mu circ T mu mu circ mu T nbsp 左右皆為T 3 T displaystyle T 3 to T nbsp 的自然變換 此處T m displaystyle T mu nbsp 與m T displaystyle mu T nbsp 經水平複合而得 m T h m h T 1 T displaystyle mu circ T eta mu circ eta T 1 T nbsp 兩者皆為T T displaystyle T to T nbsp 的自然變換 此處1 T displaystyle 1 T nbsp 表示由函子T displaystyle T nbsp 到自身的恆等自然變換 以上兩式 亦可以下列交換圖複述 nbsp nbsp 記號T m displaystyle T mu nbsp 與m T displaystyle mu T nbsp 的含義 參見自然變換 又或考慮以下更具體的寫法 不用水平複合記號 並將各函子作用在任意物件X displaystyle X nbsp 上 nbsp nbsp 定義中 若將m displaystyle mu nbsp 當成幺半群的乘法 則第一條公理類似幺半群 英语 monoid category theory 的乘法結合律 而第二條公理類似單位元的存在性 由h displaystyle eta nbsp 給出 準確而言 C displaystyle mathcal C nbsp 上的單子 可以等價地定義為C displaystyle mathcal C nbsp 的內函子範疇E n d C displaystyle mathbf End mathcal C nbsp 中的幺半群 英语 monoid category theory 該範疇的物件是C displaystyle C nbsp 上的內函子 而態射是內函子間的自然變換 幺半結構來自內函子的複合運算 如此 單子不僅在形式上具有與幺半群相似的公理 甚而單子就是幺半群的特例 冪集單子 编辑 冪集單子P displaystyle mathcal P nbsp 是集合範疇S e t displaystyle mathbf Set nbsp 上的單子 其定義中 函子T displaystyle T nbsp 取為冪集運算 即T A displaystyle T A nbsp 為集合A displaystyle A nbsp 的冪集 而對於函數f A B displaystyle f A to B nbsp T f displaystyle T f nbsp 將A displaystyle A nbsp 的子集映至其像集 即T f A f A displaystyle T f A f A nbsp 對每個集合A displaystyle A nbsp 有函數h A A T A displaystyle eta A A to T A nbsp 對每個元素a A displaystyle a in A nbsp 映至單元子集 a displaystyle a nbsp 並有函數 m A T T A T A displaystyle mu A colon T T A to T A nbsp 將A displaystyle A nbsp 的若干個子集構成的族 映至該些子集的並集 以上是冪集單子的定義 兩個單子的複合 未必為單子 舉例 冪集單子P displaystyle mathcal P nbsp 的二次疊代P P displaystyle mathcal P circ mathcal P nbsp 無法配備單子結構 2 餘單子 编辑 取上節定義的範疇論對偶 英语 Dual category theory 便是餘單子 或餘三元組 的定義 簡單複述 範疇C displaystyle mathcal C nbsp 上的餘單子 是對偶範疇 英语 opposite category C o p displaystyle C mathrm op nbsp 上的單子 所以 餘單子是由C displaystyle mathcal C nbsp 到C displaystyle mathcal C nbsp 的某個函子U displaystyle U nbsp 連同餘單位與餘乘法 英語 counit and comultiplication 兩個自然變換 組成的整體 而三者所要滿足的公理 是將原定義中所有態射反轉方向而得 單子之於幺半群 如同餘單子之於餘幺半群 每個集合皆是餘幺半群 且僅有唯一一種方式 所以抽象代數中 較少考慮餘幺半群 然而 在線性代數中 向量空間範疇 配備張量積 的餘幺半群較為重要 以餘代數之名為人所知 歷史 编辑 此章节需要扩充 中文名稱 單子 由來單子的概念最早由羅傑 戈德芒 英语 Roger Godement 於1958年提出 3 當時稱為 標準構造 英語 standard construction 實際上 該書用到的是餘單子 用作解決某個層餘調 英语 Sheaf cohomology 問題 其後 單子又出現於彼得 胡伯 Peter Huber 對範疇同倫的研究中 該論文包含由任意一對伴隨函子得出單子的證明 4 1965年 海因里希 克萊斯利 英语 Heinrich Kleisli 5 及塞缪尔 艾伦伯格 約翰 柯曼 摩爾 英语 John Coleman Moore 二人 6 分別獨立證明反向的結論 即每個單子皆可由某對伴隨函子產生 後一篇論文中 將單子稱為 三元組 1963年 威廉 洛維爾 英语 William Lawvere 提出泛代數的範疇論 1966年 弗雷德 林頓 Fred Linton 將該理論用單子的語言表達 7 單子本身來自拓撲方面的考量 事先似乎比洛維爾的理論更難處理 但已成為用範疇論語言闡述泛代數的方法中 較常見的一個 現今常用的英文名稱monad 是1971年由桑德斯 麥克蘭恩在 現職數學家用的範疇 英语 Categories for the Working Mathematician 引入 以其類似單子論中的同名哲學概念 即某種能生出其他所有事物的實體 1980年代 歐金尼奧 莫吉 英语 Eugenio Moggi 在理論計算機科學中 利用單子 為電腦程式的若干方面建立模型 包括例外處理 邊界情況 8 此後 有多種函數式編程語言仔細實作此想法 作為一種基本規律 同樣稱為單子 2001年 若干數學家注意到 用單子研究程式標誌語意的方法 與洛維爾的理論 兩者之間有關聯 9 此為代數與語義間的聯繫 是後來活躍的研究課題 例子 编辑伴隨的複合 编辑 若有伴隨關係 F C D G displaystyle F mathcal C rightleftarrows mathcal D G nbsp 即F displaystyle F nbsp 為G displaystyle G nbsp 的左伴隨 下同 則由此有C displaystyle mathcal C nbsp 上的單子 此普遍的構造 取內函子為複合 T G F displaystyle T G circ F nbsp 而單位自然變換來自伴隨的單位h id C G F displaystyle eta operatorname id mathcal C to G circ F nbsp 乘法自然變換源自伴隨的餘單位e displaystyle varepsilon nbsp T 2 G F G F G e F G F T displaystyle T 2 G circ F circ G circ F xrightarrow G circ varepsilon circ F G circ F T nbsp 反之 給定單子 可以明確找回一對伴隨函子 使單子為該對伴隨函子的複合 此構造用到下節定義的T displaystyle T nbsp 代數的艾倫伯格 摩爾範疇C T displaystyle C T nbsp 10 兩重對偶 编辑 給定域k displaystyle k nbsp 雙重對偶單子 英語 double dualisation monad 源自伴隨關係 V e c t k V e c t k o p displaystyle mathbf Vect k rightleftarrows mathbf Vect k mathrm op nbsp 其中兩個函子 displaystyle nbsp 皆將k displaystyle k nbsp 向量空间V displaystyle V nbsp 映至對偶空間V Hom V k displaystyle V operatorname Hom V k nbsp 所以對應的單子將向量空間V displaystyle V nbsp 映至雙對偶V displaystyle V nbsp Kock 1970 對此有更廣泛的討論 偏序集的閉包算子 编辑 偏序集 P displaystyle P leq nbsp 可以視為特殊的範疇 任意兩件物件之間有最多一支態射 且x displaystyle x nbsp 到y displaystyle y nbsp 有態射当且仅当偏序中x y displaystyle x leq y nbsp 於是 偏序集之間的函子 即是保序映射 而伴隨函子對 則組成兩偏序集間的伽罗瓦连接 相應的單子是伽羅華連接的闭包算子 自由遺忘伴隨 编辑 又舉例 設G displaystyle G nbsp 為群範疇G r p displaystyle mathbf Grp nbsp 至集合范畴S e t displaystyle mathbf Set nbsp 的遺忘函子 將群映至其基集 又設F displaystyle F nbsp 為自由函子 由S e t displaystyle mathbf Set nbsp 到G r p displaystyle mathbf Grp nbsp 則F displaystyle F nbsp 是G displaystyle G nbsp 的左伴隨 此時 對應的單子T G F displaystyle T G circ F nbsp 的作用是 輸入一個集合X displaystyle X nbsp 輸出自由群F X displaystyle F X nbsp 的基集 即字母取自 x x 1 x X displaystyle x x 1 x in X nbsp 且無相鄰兩個字母互為逆元的字串的集合 該單子的單位變換 由包含映射 h X X T X displaystyle eta X X rightarrow T X nbsp 給出 該包含映射將X displaystyle X nbsp 的任意元素 看成僅得一個字元的字串 從而是T X displaystyle T X nbsp 的元素 最後 單子的乘法 m X T T X T X displaystyle mu X T T X rightarrow T X nbsp 是串接或 壓平 運算 將若干條字串組成的串 映至該串中所有字串前後連接而成的一條字串 至此描述完單子的兩個自然變換 前述例子中 自由群可以推廣至其他種類的代數結構 即泛代数意義下的任意一簇 英语 Variety universal algebra 代數 如此 每類代數定義了集合範疇上的一個單子 更重要的是 該類代數的範疇 可從單子找回 即單子的艾倫伯格 摩爾代數範疇 故單子可視為泛代數之簇的推廣 另外 尚有一個單子源自伴隨關係 在向量空間範疇V e c t displaystyle mathbf Vect nbsp 上 若T displaystyle T nbsp 表示將向量空間V displaystyle V nbsp 映至其张量代数T V displaystyle T V nbsp 的內函子 則相應有單位自然變換將V displaystyle V nbsp 嵌入到其张量代数 並有乘法自然變換 在V displaystyle V nbsp 處的分量是態射T T V T V displaystyle T T V to T V nbsp 將張量積之張量積展開化簡 餘密度單子 编辑 只要滿足某些不強的條件 無左伴隨的函子也可以產生單子 稱為餘密度單子 英语 codensity monad 例如 從有限集合範疇F i n S e t displaystyle mathbf FinSet nbsp 到集合範疇S e t displaystyle mathbf Set nbsp 的包含函子無法配備左伴隨 但其餘密度單子定義在S e t displaystyle mathbf Set nbsp 上 將任意集合X displaystyle X nbsp 映至其上所有超滤子的集合b X displaystyle beta X nbsp 類似例子見於Leinster 2013 單子的代數 编辑参见 F代數 英语 F algebra 和偽代數 英语 pseudoalgebra 給定範疇C displaystyle mathcal C nbsp 上的單子 T h m displaystyle T eta mu nbsp 可以考慮C displaystyle mathcal C nbsp 中的T displaystyle boldsymbol T nbsp 代數物件 T displaystyle T nbsp 在該些物件上的作用 與單子的單位與乘法相容 具體而言 T displaystyle boldsymbol T nbsp 代數 x h displaystyle x h nbsp 是C displaystyle mathcal C nbsp 中的物件x displaystyle x nbsp 連同態射h T x x displaystyle h Tx to x nbsp 稱為該代數的結構映射 使得圖 nbsp 及 nbsp 皆可交換 T displaystyle T nbsp 代數間的態射f x h x h displaystyle f x h to x h nbsp 是C displaystyle mathcal C nbsp 中的態射f x x displaystyle f x to x nbsp 且要使 nbsp 可交換 於是 T displaystyle T nbsp 代數及之間的態射組成範疇 稱為艾倫伯格 摩爾範疇 英語 Eilenberg Moore category 記為C T displaystyle mathcal C T nbsp 例子 编辑 自由群單子上的代數 编辑 若T displaystyle T nbsp 為前述自由群單子 則T displaystyle T nbsp 代數是集合X displaystyle X nbsp 連同由X displaystyle X nbsp 生成的自由群F X displaystyle F X nbsp 到X displaystyle X nbsp 的映射 求值 evaluation 且該映射要滿足結合律與單位元的公理 換言之 X displaystyle X nbsp 本身就具有群結構 而F X displaystyle F X nbsp 至X displaystyle X nbsp 的映射 是將字串按X displaystyle X nbsp 的群乘法 計算所得的結果 分佈單子上的代數 编辑 另一個例子是集合範疇上的分佈單子 英語 distribution monad D displaystyle mathcal D nbsp 其將集合X displaystyle X nbsp 映至其上所有有限支撐的概率分佈的集合 該等分佈 是函數f X 0 1 displaystyle f X to 0 1 nbsp 僅於有限多個元素x X displaystyle x in X nbsp 處取值非零 而各元素處取值之和為1 displaystyle 1 nbsp 以符號表示 D X f X 0 1 supp f lt x X f x 1 displaystyle mathcal D X left f X to 0 1 begin matrix text supp f lt infty sum x in X f x 1 end matrix right nbsp 可由定義證明 分佈單子上的代數 等同於凸集 即集合要配備二元運算 r displaystyle r nbsp 對每個r 0 1 displaystyle r in 0 1 nbsp 滿足的公理比照歐氏空間中 凸組合 x y r x 1 r y displaystyle x y mapsto rx 1 r y nbsp 具備的性質 11 12 對稱單子上的代數 编辑 另一個有用的單子 是交換環R displaystyle R nbsp 的模範疇M o d R displaystyle mathbf Mod R nbsp 上的對稱代數單子 Sym M o d R M o d R displaystyle text Sym bullet mathbf Mod R to mathbf Mod R nbsp 將R displaystyle R nbsp 模M displaystyle M nbsp 映到各階對稱張量 英语 symmetric tensor 冪的直和 Sym M k 0 Sym k M displaystyle text Sym bullet M bigoplus k 0 infty text Sym k M nbsp 其中Sym 0 M R displaystyle text Sym 0 M R nbsp 例如 Sym R n R x 1 x n displaystyle text Sym bullet R oplus n cong R x 1 ldots x n nbsp 左右兩邊作為R displaystyle R nbsp 模同構 如此 對稱代數單子上的代數 是交換R displaystyle R nbsp 代數 類似地 也有反對稱張量 英语 Antisymmetric tensor 單子Alt displaystyle text Alt bullet nbsp 與全張量單子T displaystyle T bullet nbsp 相應的代數分別是反對稱R displaystyle R nbsp 代數與自由R displaystyle R nbsp 代數 故 Alt R n R x 1 x n T R n R x 1 x n displaystyle begin aligned text Alt bullet R oplus n amp R x 1 ldots x n text T bullet R oplus n amp R langle x 1 ldots x n rangle end aligned nbsp 前者是R displaystyle R nbsp 上添加n displaystyle n nbsp 個生成元的自由反對稱代數 而後者則是n displaystyle n nbsp 個生成元的自由代數 E 環譜中的交換代數 编辑 對於可交換S displaystyle mathbb S nbsp 代數 英语 Highly structured ring spectrum 亦有類似的構造 13 113對於可交換S displaystyle mathbb S nbsp 代數A displaystyle A nbsp 對應單子上的代數是可交換的A displaystyle A nbsp 代數 若M o d A displaystyle mathbf Mod A nbsp 表示A displaystyle A nbsp 模的範疇 則可以考慮函子P M o d A M o d A displaystyle mathbb P mathbf Mod A to mathbf Mod A nbsp 定義為 P M j 0 M j S j displaystyle mathbb P M bigvee j geq 0 M j Sigma j nbsp 其中 M j M A A M j displaystyle M j underbrace M wedge A cdots wedge A M j nbsp 此函子是單子 而由該單子上的代數範疇 可以得到可交換A displaystyle A nbsp 代數的範疇C A displaystyle mathcal C A nbsp 單子與伴隨 编辑如前文所述 任何伴隨關係皆產生單子 反之 每個單子T displaystyle T nbsp 皆可由某個伴隨關係產生 即原範疇與T displaystyle T nbsp 代數的艾倫伯格 摩爾範疇之間的自由 遺忘伴隨 T C C T F displaystyle T mathcal C rightleftarrows mathcal C T F nbsp 其中 左伴隨T displaystyle T nbsp 將C displaystyle mathcal C nbsp 的物件x displaystyle x nbsp 映到自由T displaystyle T nbsp 代數T x displaystyle T x nbsp 右伴隨F displaystyle F nbsp 則將T displaystyle T nbsp 代數 x h displaystyle x h nbsp 遺忘掉h displaystyle h nbsp 變回x displaystyle x nbsp 然而 通常有多組不同的伴隨關係產生同樣的單子 該些伴隨關係組成範疇A d j C T displaystyle mathbf Adj mathcal C T nbsp 物件是伴隨關係 F G h e displaystyle F G eta varepsilon nbsp 使得 G F h G e F T h m displaystyle GF eta G varepsilon F T eta mu nbsp 而態射是在C displaystyle mathcal C nbsp 一側為恆等函子的伴隨關係態射 如此 艾倫伯格 摩爾範疇的自由 遺忘伴隨C T displaystyle mathcal C T nbsp 是A d j C T displaystyle mathbf Adj mathcal C T nbsp 的終物件 而始物件是克萊斯利範疇 英语 Kleisli category C T displaystyle mathcal C T nbsp 定義為C T displaystyle mathcal C T nbsp 中的自由T displaystyle T nbsp 代數組成的完全子範疇 即僅包含形如T x displaystyle T x nbsp 的T displaystyle T nbsp 代數 其中x displaystyle x nbsp 歷遍C displaystyle mathcal mathcal C nbsp 的物件 單子伴隨 编辑 設有伴隨關係 F C D G D C h e displaystyle F mathcal C to mathcal D G mathcal D to mathcal C eta varepsilon nbsp 對應單子為T displaystyle T nbsp 則函子G displaystyle G nbsp 可分解為 D G C T F C displaystyle mathcal D xrightarrow tilde G mathcal C T xrightarrow F mathcal C nbsp 其中F displaystyle F nbsp 是遺忘函子 換言之 對D displaystyle mathcal D nbsp 中任意物件Y displaystyle Y nbsp 都能賦予G Y displaystyle G Y nbsp 自然的T displaystyle T nbsp 代數結構 若分解式中 首個函子G displaystyle tilde G nbsp 給出D displaystyle mathcal D nbsp 與C T displaystyle C T nbsp 兩範疇間的等價 則形容該伴隨關係為單子的 英語 monadic 14 後亦引申用作形容函子 若函子G D C displaystyle G mathcal D to mathcal C nbsp 有左伴隨F displaystyle F nbsp 且該伴隨關係為單子的 則G displaystyle G nbsp 亦稱為單子的 例如 群範疇與集合範疇間的自由 遺忘伴隨是單子的 因為相應單子T displaystyle T nbsp 上的T displaystyle T nbsp 代數是群 見前文 一般而言 若有伴隨關係 F C D G D C h e displaystyle F mathcal C to mathcal D G mathcal D to mathcal C eta varepsilon nbsp 為單子的 則單從C displaystyle mathcal C nbsp 的物件及其上的T displaystyle T nbsp 作用 已足以重組出D displaystyle mathcal D nbsp 的物件 貝克單子性定理 编辑 主条目 貝克單子性定理 英语 Beck s monadicity theorem 貝克單子性定理給出伴隨關係在何種充要條件下為單子的 定理有以下簡化版 若滿足以下三項條件 G displaystyle G nbsp 為保守函子 英语 conservative functor 換言之 G displaystyle G nbsp 反映同構 英語 reflects isomorphisms 即對D displaystyle mathcal D nbsp 中每一支態射 其為同構當且僅當在G displaystyle G nbsp 作用下的像為C displaystyle mathcal C nbsp 中的同構 C displaystyle mathcal C nbsp 有餘等化子 英语 coequalizer G displaystyle G nbsp 保餘等化子 英语 coequalizer 則G displaystyle G nbsp 為單子的 例如 由緊豪斯多夫空间範疇C H a u s displaystyle mathbf CHaus nbsp 到集合範疇S e t displaystyle mathbf Set nbsp 的遺忘函子是單子的 然而 由任意拓撲空間範疇T o p displaystyle mathbf Top nbsp 到集合範疇S e t displaystyle mathbf Set nbsp 的遺忘函子則並非單子的 而定理中 保守函子的條件不成立 因為有非緊或非豪斯多夫空間 之間存在連續雙射 但不為同胚 15 貝克定理有對偶版本 刻劃餘單子伴隨關係 對拓撲斯論及有關下降 英语 descent category theory 的代数几何課題有用 餘單子的伴隨關係 首先有下列例子 A B M o d A M o d B F displaystyle otimes A B mathbf Mod A rightleftarrows mathbf Mod B F nbsp 其中A B displaystyle A B nbsp 皆為交換環 左伴隨用到的張量積 A displaystyle otimes A nbsp 的定義中 選定了環同態A B displaystyle A to B nbsp 而右伴隨F displaystyle F nbsp 是遺忘函子 根據貝克定理 當且僅當B displaystyle B nbsp 為忠實平坦A displaystyle A nbsp 模時 該伴隨為餘單子的 所以 可將配備下降數據 英語 descent datum 即源自伴隨關係的餘單子的作用 的B displaystyle B nbsp 模 降成A displaystyle A nbsp 模 所得的忠實平坦下降 英语 faithfully flat descent 理論 廣泛應用於代數幾何 用途 编辑函数式编程中 會使用單子表達某類 有時有副作用的 順序式計算 見单子 函数式编程 範疇論邏輯中 藉闭包算子 內代數 以及兩者與S4模態邏輯 直觉主义逻辑的關係 能以單子餘單子理論類比模态逻辑 推廣 编辑亦可定義2 範疇C displaystyle mathcal C nbsp 中的單子 參見 编辑單子間的分配律 英语 Distributive law between monads 洛維爾理論 英语 Lawvere theory 单子 函数式编程 函數式編程中 用作構造通用類型的設計模式 多子 範疇論 英语 Polyad 強單子 英语 Strong monad 參考文獻 编辑 Barr Michael Wells Charles Toposes Triples and Theories 拓撲斯 三元組與理論 PDF Grundlehren der mathematischen Wissenschaften 278 Springer Verlag 1985 82 and 120 2021 09 17 ISBN 0 387 96115 1 原始内容存档 PDF 于2020 11 25 Klin Salamanca Iterated Covariant Powerset is not a Monad 共變冪集疊代後不是單子 Electronic Notes in Theoretical Computer Science 2018 12 01 341 261 276 doi 10 1016 j entcs 2018 11 013 nbsp 英语 Godement Roger Topologie Algebrique et Theorie des Faisceaux 代數拓撲與層論 Actualites Sci Ind Publ Math Univ Strasbourg 1252 Paris Hermann 1958 viii 283 pp 法语 issue 被忽略 帮助 Huber Peter J Homotopy theory in general categories 一般範疇的同倫論 Mathematische Annalen 1961 144 5 361 385 英语 Kleisli Heinrich Every standard construction is induced by a pair of adjoint functors 每個標準構造皆由某對伴隨函子產生 Proceedings of the American Mathematical Society 1965 16 3 544 546 英语 Eilenberg Samuel Moore John Coleman Adjoint functors and triples 伴隨函子與三元組 Am J Math 1965 9 301 398 英语 Linton Fred E J Some aspects of equational theories 等式理論的若干方面 Proc Conf on Categorical Algebra at La Jolla 1966 84 95 英语 参数 journal 与模板 cite conference 不匹配 建议改用 cite journal 或 book title 帮助 Moggi Eugenio Notions on computation on monads 單子上的計算概念 PDF 2021 09 25 原始内容存档 PDF 于2011 03 22 英语 Plotkin Gordon Power John Adequacy for Algebraic Effects 代數效果的適切性 Proc FOSSACS 2001 Lecture Notes in Computer Science 2030 2001 1 24 doi 10 1007 3 540 45315 6 1 英语 Riehl 2017 162 Swirszcz T Monadic functors and convexity 單子函子與凸性 Bull Acad Polon Sci Ser Sci Math Astron Phys 1974 22 39 42 MR 0390019 英语 Jacobs Bart Convexity Duality and Effects 凸性 對偶 作用 Calude C S Sassone V 编 Theoretical Computer Science 理論電腦科學 IFIP Advances in Information and Communication Technology 323 2010 1 19 ISBN 978 3 642 15239 9 doi 10 1007 978 3 642 15240 5 1 nbsp 英语 Basterra M Andre Quillen cohomology of commutative S algebras 交換S代數的Andre Quillen上同調 Journal of Pure and Applied Algebra 1999 12 15 144 2 111 143 2021 09 18 ISSN 0022 4049 doi 10 1016 S0022 4049 98 00051 6 nbsp 原始内容存档于2022 01 30 英语 MacLane 1978 所用定義中 條件 等價 要再加強為 同構 英语 Isomorphism of categories MacLane 1978 VI 3 VI 9 Barr Michael Wells Charles Category Theory for Computing Science 電腦科學用的範疇論 PDF 1999 2021 09 24 原始内容存档 PDF 于2021 12 30 英语 Kock Anders On Double Dualization Monads 論雙重對偶單子 Mathematica Scandinavica 1970 27 151 doi 10 7146 math scand a 10995 nbsp 英语 Leinster Tom Codensity and the ultrafilter monad 餘密度與超濾子單子 Theory and Applications of Categories 2013 28 332 370 Bibcode 2012arXiv1209 3606L arXiv 1209 3606 nbsp 英语 MacLane Saunders Categories for the Working Mathematician 現職數學家用的範疇 Graduate Texts in Mathematics 5 1978 ISBN 978 1 4419 3123 8 doi 10 1007 978 1 4757 4721 8 nbsp 英语 Pedicchio Maria Cristina Tholen Walter 编 Categorical Foundations Special Topics in Order Topology Algebra and Sheaf Theory 範疇基礎 序 拓撲 代數 層論特別專題 Encyclopedia of Mathematics and Its Applications 97 Cambridge Cambridge University Press 2004 ISBN 0 521 83414 7 Zbl 1034 18001 英语 Riehl Emily Category Theory in Context 脈絡中的範疇論 PDF 2017 ISBN 9780486820804 原始内容存档 PDF 于5 Apr 2021 英语 Turi Daniele Category Theory Lecture Notes 範疇論講義 PDF 1996 2001 2021 09 24 原始内容存档 PDF 于2022 02 21 英语 取自 https zh wikipedia org w index php title 單子 範疇論 amp oldid 72476588, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。