# HG changeset patch # User Yasutaka Higa # Date 1423377800 -32400 # Node ID cff9f6f0ff25f6dc6155bf9b0ed2e3c31100a409 # Parent 6c0d32ef01cd519a3db694a05cb92daaf87ad47d Add description natural transformation diff -r 6c0d32ef01cd -r cff9f6f0ff25 category.tex --- a/category.tex Sun Feb 08 13:29:32 2015 +0900 +++ b/category.tex Sun Feb 08 15:43:20 2015 +0900 @@ -53,11 +53,11 @@ 改めて、morphism の合成の順序が結果に影響しないことを式にすると式\ref{exp:morphism_composition_law}のようになる。 \begin{eqnarray} + \label{exp:morphism_composition_law} f : C \rightarrow D \nonumber \\ g : B \rightarrow C \nonumber \\ h : A \rightarrow B \nonumber \\ (f \circ g) \circ h = f \circ (g \circ h) : A \rightarrow D - \label{exp:morphism_composition_law} \end{eqnarray} \end{itemize} @@ -132,20 +132,20 @@ category C の morphism は式\ref{exp:functor_categoryC}であるとする。 \begin{eqnarray} + \label{exp:functor_categoryC} f : A \rightarrow C \\ \nonumber g : B \rightarrow B \\ \nonumber h : B \rightarrow C \\ \nonumber f = g \circ h - \label{exp:functor_categoryC} \end{eqnarray} 次に、 2 つの object A', B' と morphism f', g' を持つ category D を考える。 category D の morphism は式\ref{exp:functor_categoryD}であるとする。 \begin{eqnarray} + \label{exp:functor_categoryD} f : B' \rightarrow A' \\ \nonumber g : A' \rightarrow B' \\ \nonumber - \label{exp:functor_categoryD} \end{eqnarray} C から D への functor F は式\ref{exp:functorF}のようなものがある。 @@ -153,6 +153,7 @@ 要素数が異なるため一見正しく mapping できないように思えるが、正しく Functor 則を満たしている。 \begin{eqnarray} + \label{exp:functorF} F(A) = A' \\ \nonumber F(B) = B' \\ \nonumber F(C) = A' \\ \nonumber @@ -163,7 +164,6 @@ F(g) = g' \\ \nonumber F(h) = f' \\ \nonumber F(h \circ g) = F(h) \circ F(g) = f' \circ g' = id_{A'} = F(f) - \label{exp:functorF} \end{eqnarray} functor F を用いて category C を category D へと mapping した図が図\ref{fig:functor}である。 @@ -180,7 +180,44 @@ % }}} +% {{{ Natural Transformation + \section{Natural Transformation} +\label{section:natural_transformation} +\ref{section:functor}節では category から category への mapping である functor について述べた。 +\ref{section:natural_transformation}節では functor と functor の関係である Natural Transformation(自然変換)について述べる。 + +category C から D への functor F, G が存在する時、F から G への変換 t を考える。 + +t は category C の A に対し、F(A) から G(A) への変換を提供する(式\ref{exp:trans})。 + +\begin{equation} + t(A) : F(A) \rightarrow G(A) + \label{exp:trans} +\end{equation} + +t が 式\ref{exp:natural_transformation}を満たす時、t を natural transformation を呼ぶ。 + +\begin{eqnarray} + \label{exp:natural_transformation} + f : A \rightarrow B \\ \nonumber + G(f)t(A) = t(B)F(f) +\end{eqnarray} + +t が natural transformation である時、 category A における A を functor F で移したのちに morphism を適用しても、 functor G で移した後に morphism を適用しても良いという可換性が得られる。 +式\ref{exp:natural_transformation}の可換図は図\ref{fig:natural_transformation}となる。 + +\begin{figure}[htbp] + \begin{center} + \includegraphics[scale=1.0]{fig/natural_transformation.pdf} + \caption{自然変換の可換図(式\ref{exp:natural_transformation})} + \label{fig:natural_transformation} + \end{center} +\end{figure} + +% }}} + \section{Monad} +\section{Kleisli Triple} \section{Monads in Functional Programming} diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/delta_example.xbb --- a/fig/delta_example.xbb Sun Feb 08 13:29:32 2015 +0900 +++ b/fig/delta_example.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -4,5 +4,5 @@ %%HiResBoundingBox: 0.000000 0.000000 559.000000 279.000000 %%PDFVersion: 1.3 %%Pages: 1 -%%CreationDate: Sun Feb 8 13:09:16 2015 +%%CreationDate: Sun Feb 8 15:38:39 2015 diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/functor.xbb --- a/fig/functor.xbb Sun Feb 08 13:29:32 2015 +0900 +++ b/fig/functor.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -4,5 +4,5 @@ %%HiResBoundingBox: 0.000000 0.000000 545.000000 456.000000 %%PDFVersion: 1.3 %%Pages: 1 -%%CreationDate: Sun Feb 8 13:09:16 2015 +%%CreationDate: Sun Feb 8 15:38:39 2015 diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/morphism_composition_law.xbb --- a/fig/morphism_composition_law.xbb Sun Feb 08 13:29:32 2015 +0900 +++ b/fig/morphism_composition_law.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -4,5 +4,5 @@ %%HiResBoundingBox: 0.000000 0.000000 412.000000 273.000000 %%PDFVersion: 1.3 %%Pages: 1 -%%CreationDate: Sun Feb 8 13:09:16 2015 +%%CreationDate: Sun Feb 8 15:38:39 2015 diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/natural_transformation.graffle --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fig/natural_transformation.graffle Sun Feb 08 15:43:20 2015 +0900 @@ -0,0 +1,674 @@ + + + + + ActiveLayerIndex + 0 + ApplicationVersion + + com.omnigroup.OmniGraffle + 139.18.0.187838 + + AutoAdjust + + BackgroundGraphic + + Bounds + {{0, 0}, {558.99997329711914, 783}} + Class + SolidGraphic + ID + 2 + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + + BaseZoom + 0 + CanvasOrigin + {0, 0} + ColumnAlign + 1 + ColumnSpacing + 36 + CreationDate + 2015-02-08 06:35:15 +0000 + Creator + atton + DisplayScale + 1 0/72 in = 1 0/72 in + GraphDocumentVersion + 8 + GraphicsList + + + Bounds + {{29.000000000000057, 82}, {19, 14}} + Class + ShapedGraphic + FitText + YES + Flow + Resize + ID + 41 + Shape + Rectangle + Style + + fill + + Draws + NO + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Pad + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 F(f)} + VerticalPad + 0 + + Wrap + NO + + + Bounds + {{201, 82}, {21, 14}} + Class + ShapedGraphic + FitText + YES + Flow + Resize + ID + 39 + Shape + Rectangle + Style + + fill + + Draws + NO + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Pad + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 G(f)} + VerticalPad + 0 + + Wrap + NO + + + Class + LineGraphic + Head + + ID + 34 + + ID + 38 + Points + + {184.01739330364478, 71} + {184.07951224523333, 121} + + Style + + stroke + + HeadArrow + FilledArrow + Legacy + + LineType + 1 + TailArrow + 0 + + + Tail + + ID + 11 + + + + Class + LineGraphic + Head + + ID + 33 + + ID + 37 + Points + + {56.030107822037429, 71} + {56.137635757885405, 121} + + Style + + stroke + + HeadArrow + FilledArrow + Legacy + + LineType + 1 + TailArrow + 0 + + + Tail + + ID + 9 + + + + Bounds + {{104, 112}, {20, 14}} + Class + ShapedGraphic + FitText + YES + Flow + Resize + ID + 36 + Shape + Rectangle + Style + + fill + + Draws + NO + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Pad + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 t(B)} + VerticalPad + 0 + + Wrap + NO + + + Class + LineGraphic + Head + + ID + 34 + + ID + 35 + Points + + {75, 135.0000119638957} + {165, 135.0000119638957} + + Style + + stroke + + HeadArrow + FilledArrow + Legacy + + LineType + 1 + TailArrow + 0 + + + Tail + + ID + 33 + + + + Bounds + {{165, 121}, {38, 28}} + Class + ShapedGraphic + ID + 34 + Shape + Rectangle + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 G(B)} + + + + Bounds + {{37, 121}, {38, 28}} + Class + ShapedGraphic + ID + 33 + Shape + Rectangle + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 F(B)} + + + + Bounds + {{104, 31}, {20, 14}} + Class + ShapedGraphic + FitText + YES + Flow + Resize + ID + 15 + Shape + Rectangle + Style + + fill + + Draws + NO + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Pad + 0 + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 t(A)} + VerticalPad + 0 + + Wrap + NO + + + Class + LineGraphic + Head + + ID + 11 + + ID + 12 + Points + + {75, 57.000008045718587} + {165, 57.000008045718587} + + Style + + stroke + + HeadArrow + FilledArrow + Legacy + + LineType + 1 + TailArrow + 0 + + + Tail + + ID + 9 + + + + Bounds + {{165, 43}, {38, 28}} + Class + ShapedGraphic + ID + 11 + Shape + Rectangle + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 G(A)} + + + + Bounds + {{37, 43}, {38, 28}} + Class + ShapedGraphic + ID + 9 + Shape + Rectangle + Style + + shadow + + Draws + NO + + stroke + + Draws + NO + + + Text + + Text + {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 +\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc + +\f0\fs24 \cf0 F(A)} + + + + GridInfo + + GuidesLocked + NO + GuidesVisible + YES + HPages + 1 + ImageCounter + 1 + KeepToScale + + Layers + + + Lock + NO + Name + Layer 1 + Print + YES + View + YES + + + LayoutInfo + + Animate + NO + circoMinDist + 18 + circoSeparation + 0.0 + layoutEngine + dot + neatoSeparation + 0.0 + twopiSeparation + 0.0 + + LinksVisible + NO + MagnetsVisible + NO + MasterSheets + + ModificationDate + 2015-02-08 06:38:26 +0000 + Modifier + atton + NotesVisible + NO + Orientation + 2 + OriginVisible + NO + PageBreaks + YES + PrintInfo + + NSBottomMargin + + float + 41 + + NSHorizonalPagination + + coded + BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG + + NSLeftMargin + + float + 18 + + NSPaperSize + + size + {594.99997329711914, 842} + + NSPrintReverseOrientation + + int + 0 + + NSRightMargin + + float + 18 + + NSTopMargin + + float + 18 + + + PrintOnePage + + ReadOnly + NO + RowAlign + 1 + RowSpacing + 36 + SheetTitle + Canvas 1 + SmartAlignmentGuidesActive + YES + SmartDistanceGuidesActive + YES + UniqueID + 1 + UseEntirePage + + VPages + 1 + WindowInfo + + CurrentSheet + 0 + ExpandedCanvases + + + name + Canvas 1 + + + Frame + {{373, 4}, {693, 874}} + ListView + + OutlineWidth + 142 + RightSidebar + + ShowRuler + + Sidebar + + SidebarWidth + 120 + VisibleRegion + {{0, 0}, {558, 735}} + Zoom + 1 + ZoomValues + + + Canvas 1 + 1 + 1 + + + + + diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/natural_transformation.pdf Binary file fig/natural_transformation.pdf has changed diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/natural_transformation.xbb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fig/natural_transformation.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -0,0 +1,8 @@ +%%Title: ./fig/natural_transformation.pdf +%%Creator: extractbb 20140317 +%%BoundingBox: 0 0 211 136 +%%HiResBoundingBox: 0.000000 0.000000 211.000000 136.000000 +%%PDFVersion: 1.3 +%%Pages: 1 +%%CreationDate: Sun Feb 8 15:38:39 2015 + diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/non_delta_example.xbb --- a/fig/non_delta_example.xbb Sun Feb 08 13:29:32 2015 +0900 +++ b/fig/non_delta_example.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -4,5 +4,5 @@ %%HiResBoundingBox: 0.000000 0.000000 504.000000 244.000000 %%PDFVersion: 1.3 %%Pages: 1 -%%CreationDate: Sun Feb 8 13:09:16 2015 +%%CreationDate: Sun Feb 8 15:38:39 2015 diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/ryukyu.xbb --- a/fig/ryukyu.xbb Sun Feb 08 13:29:32 2015 +0900 +++ b/fig/ryukyu.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -4,5 +4,5 @@ %%HiResBoundingBox: 0.000000 0.000000 595.000000 842.000000 %%PDFVersion: 1.3 %%Pages: 1 -%%CreationDate: Sun Feb 8 13:09:16 2015 +%%CreationDate: Sun Feb 8 15:38:39 2015 diff -r 6c0d32ef01cd -r cff9f6f0ff25 fig/simple_category.xbb --- a/fig/simple_category.xbb Sun Feb 08 13:29:32 2015 +0900 +++ b/fig/simple_category.xbb Sun Feb 08 15:43:20 2015 +0900 @@ -4,5 +4,5 @@ %%HiResBoundingBox: 0.000000 0.000000 205.000000 82.000000 %%PDFVersion: 1.3 %%Pages: 1 -%%CreationDate: Sun Feb 8 13:09:16 2015 +%%CreationDate: Sun Feb 8 15:38:39 2015