PS

Category

Category, 圏

Category:

  •  \mathcal{C}

とは、以下から成る代数的構造  (\mathcal{C} _ 0, \mathcal{C} _ 1, \text{dom}, \text{cod}, \circ, \text{id} ) である:

  1. 類:  \mathcal{C} _ 0 (objects)
  2. 類:  \mathcal{C} _ 1 (morphisms)
  3. 関数:   \text{dom} : \mathcal{C} _ 1 \rightarrow \mathcal{C} _ 0 (domain of)
  4. 関数:  \text{cod} : \mathcal{C} _ 1 \rightarrow \mathcal{C} _ 0 (codomain of)
  5. 関数:  \circ : \mathcal{C} _ 2 \rightarrow \mathcal{C} _ 1 (composite of)
  6. 関数:  \text{id} : \mathcal{C} _ 0 \rightarrow \mathcal{C} _ 1 (identity of)

ただし、

  •  \mathcal{C}_2 \equiv \lbrace (g, f) \in \mathcal{C} _ 1 \times \mathcal{C} _ 1 \mid \text{dom}(g) = \text{cod}(f) \rbrace

とした。

これらは以下の四つの要件を満たさなくてはならない。

任意の

  •  A \in \mathcal{C}_0
  •  f, g, h \in \mathcal{C} _ 1

について

  1.  (g, f) \in \mathcal{C} _ 2 \Rightarrow (\text{dom}(g \circ f) = \text{dom}(f) \wedge \text{cod}(g \circ f) = \text{cod}(g))
  2.  ( (h, g) \in \mathcal{C} _ 2 \wedge (g, f) \in \mathcal{C} _ 2 ) \Rightarrow h \circ (g \circ f) = (h \circ g) \circ f
  3.  \text{dom}(\text{id}(A)) = \text{cod}(\text{id}(A)) = A
  4.  f \circ \text{id}(\text{dom}(f)) = \text{id}(\text{cod}(f)) \circ f = f

Directed graphとしての圏

@deprecated

圏はdirected graphの一種である。オブジェクト指向的には、directed graphを継承している。実際、

  •  V \equiv \mathcal{C}_0
  •  E \equiv \{ \text{(dom($f$),cod($f$))} | f \in \mathcal{C}_1 \}

とすれば

  •  (V, E)

はdirected graphになる。

 \mathcal{C} の添字の数字は、圏をgraphとみなしたときのpathの長さを暗示している。

記法

  •  A \in \mathcal{C} \equiv A \in \mathcal{C} _ 0
  •  f \in \mathcal{C} \equiv f \in \mathcal{C} _ 1
  •  \mathcal{C}(A, B) \equiv \lbrace f \in \mathcal{C} _ 1 \mid \text{dom}(f) = A \wedge \text{cod}(f) = B \rbrace
  •  f: A \rightarrow B \equiv f \in \mathcal{C}(A, B)
  •  \text{id}_A \equiv \text{id}(A)
  •  A \equiv \text{id} _ A

命題

  •  (A, B) \neq (A', B') \Rightarrow \mathcal{C}(A, B) \cap \mathcal{C}(A', B') = \emptyset
  •  \text{id} : \text{injective}
  •  \mathcal{C} _ 1 \ne \emptyset \Rightarrow \mathcal{C} _ 0 \ne \emptyset

参考文献