public void 数3() { var mor = ToMorphismHelp(@"M^{#1#2#3}", @"\bicat{B}(#2, #3)\times\bicat{B}(#1, #2)", @"\bicat{B}(#1, #3)", MorphismType.Bifunctor); var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { mor, }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"M^{abc}") .TestMorphism(@"M^{abc}", @"\bicat{B}(b, c)\times\bicat{B}(a, b)", @"\bicat{B}(a, c)", MorphismType.Bifunctor); tikz.CreateMorphism(@"M^{abc}", @"\bicat{B}(b, c)\times\bicat{B}(a, b)", @"\bicat{B}(a, c)") .TestMorphism(@"M^{abc}", @"\bicat{B}(b, c)\times\bicat{B}(a, b)", @"\bicat{B}(a, c)", MorphismType.Bifunctor, true); tikz.CreateMorphism(@"M^{ace}") .TestMorphism(@"M^{ace}", @"\bicat{B}(c, e)\times\bicat{B}(a, c)", @"\bicat{B}(a, e)", MorphismType.Bifunctor); tikz.CreateMorphism(@"M^{abb}") .TestMorphism(@"M^{abb}", @"\bicat{B}(b, b)\times\bicat{B}(a, b)", @"\bicat{B}(a, b)", MorphismType.Bifunctor); tikz.CreateMorphism(@"M^{Fa, Fb, Fc}") .TestMorphism(@"M^{Fa, Fb, Fc}", @"\bicat{B}(Fb, Fc)\times\bicat{B}(Fa, Fb)", @"\bicat{B}(Fa, Fc)", MorphismType.Bifunctor); }
public void 数LeftUnitor2() { var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { ToMorphismHelp(@"\lambda^{#1?}_{#2?}", @"\id_{#3?}\ocmp #2", @"#2", MorphismType.OneMorphism) }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\lambda_f", @"\id_b\ocmp f", "f") .TestMorphism(@"\lambda_f", @"\id_b\ocmp f", @"f", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\lambda_f", @"\id\ocmp f", "f") .TestMorphism(@"\lambda_f", @"\id\ocmp f", @"f", MorphismType.OneMorphism, true); }
public void 数二項演算() { var dic = new Dictionary <TokenString, Morphism>(); var list = ExtensionsInTest.CreateDefaultMorphisms(); list.Add(ToMorphismHelp(@"\rho^{#1?}_{#2?}", @"#2\otimes\Vunit", @"#2", MorphismType.OneMorphism)); list.Add(ToMorphismHelp(@"\rho^{#1?}_{#2?}", @"#2\Vunit", @"#2", MorphismType.OneMorphism)); var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\rho^{ab}_x\otimes\rho_u", @"(x\otimes \Vunit)\otimes (u\otimes \Vunit)", @"x\otimes u") .TestMorphism(@"\rho^{ab}_x\otimes\rho_u", @"(x\otimes \Vunit)\otimes (u\otimes \Vunit)", @"x\otimes u", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\id\otimes\rho^{ab}_x", @"a\otimes (x\otimes \Vunit)", @"a \otimes x") .TestMorphism(@"\id\otimes\rho^{ab}_x", @"a\otimes (x\otimes \Vunit)", @"a \otimes x", MorphismType.OneMorphism, true); }
public void 数二項演算_省略1() { var dic = new Dictionary <TokenString, Morphism>() { { "f".ToTokenString(), Morphism.Create(@"f\colon u\rightarrow v").TestSingle() }, { "g".ToTokenString(), Morphism.Create(@"g\colon s\rightarrow t").TestSingle() }, }; var tikz = new TikZDiagram("", -1, false, true, true, dic, ExtensionsInTest.CreateDefaultMorphisms(), Array.Empty <Functor>()); tikz.CreateMorphism(@"f\otimes g") .TestMorphism(@"f\otimes g", @"u\otimes s", @"v\otimes t", MorphismType.OneMorphism); tikz.CreateMorphism(@"f\otimes g", @"u\otimes s", @"v\otimes t") .TestMorphism(@"f\otimes g", @"u\otimes s", @"v\otimes t", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"f\otimes g", @"us", @"vt") .TestMorphism(@"f\otimes g", @"us", @"vt", MorphismType.OneMorphism, true); }
public void 数st() { var dic = new Dictionary <TokenString, Morphism>() { { "F".ToTokenString(), Morphism.Create(@"F\colon\encat{A}\rightarrow\encat{B}").TestSingle() } }; var list = new List <Morphism>() { ToMorphismHelp(@"#1_{#2#3}", @"#1s(#2, #3)", @"#1t(#1#2, #1#3)", MorphismType.OneMorphism) }; var func = ExtensionsInTest.CreateDefaultFunctors().ToList(); var tikz = new TikZDiagram("", -1, false, false, true, dic, list, func); tikz.CreateMorphism(@"F_{ab}") .TestMorphism(@"F_{ab}", @"\encat{A}(a, b)", @"\encat{B}(Fa, Fb)", MorphismType.Functor); tikz.CreateMorphism(@"F_{ab}", @"\encat{A}(a, b)", @"\encat{B}(Fa, Fb)") .TestMorphism(@"F_{ab}", @"\encat{A}(a, b)", @"\encat{B}(Fa, Fb)", MorphismType.Functor, true); }
public void 数RightUnitor() { var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { ToMorphismHelp(@"\rho^{#1?}_{#2?}", @"#2\otimes\Vunit", @"#2", MorphismType.OneMorphism) }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\rho_x", @"\Vunit\otimes x", null) .TestMorphism(@"\rho_x", @"x\otimes \Vunit", @"x", MorphismType.OneMorphism); tikz.CreateMorphism(@"\rho_x^{-1}", "x", @"x\otimes\Vunit") .TestMorphism(@"\rho_x^{-1}", "x", @"x\otimes \Vunit", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\rho_{u\otimes v}", @"(u\otimes v)\otimes \Vunit", @"u\otimes v") .TestMorphism(@"\rho_{u\otimes v}", @"(u\otimes v)\otimes \Vunit", @"u\otimes v", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\rho", @"x\otimes \Vunit", "x") .TestMorphism(@"\rho", @"x\otimes \Vunit", @"x", MorphismType.OneMorphism, true); }
public void 数Associator_NotNull() { var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { ToMorphismHelp(@"\alpha^{#1}_{#2#3#4}", @"(#2\otimes #3)\otimes #4", @"#2\otimes (#3\otimes #4)", MorphismType.OneMorphism) }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\alpha^{abcd}_{uvw}") .TestMorphism(@"\alpha^{abcd}_{uvw}", @"(u\otimes v)\otimes w", @"u\otimes(v\otimes w)", MorphismType.OneMorphism); tikz.CreateMorphism(@"\alpha^x_{u, v\otimes w, x}") .TestMorphism(@"\alpha^x_{u, v\otimes w, x}", @"(u\otimes (v\otimes w))\otimes x", @"u\otimes((v\otimes w)\otimes x)", MorphismType.OneMorphism); tikz.CreateMorphism(@"(\alpha_{abc}^x)^{-1}") .TestMorphism(@"(\alpha_{abc}^x)^{-1}", @"a\otimes(b\otimes c)", @"(a\otimes b)\otimes c", MorphismType.OneMorphism); tikz.CreateMorphism(@"\alpha^x_{Fu, Fv, Fw}") .TestMorphism(@"\alpha^x_{Fu, Fv, Fw}", @"(Fu\otimes Fv)\otimes Fw", @"Fu\otimes(Fv\otimes Fw)", MorphismType.OneMorphism); }
public void 数2() { var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { Morphism.Create(@"m_{#1#2} \colon \encat{A}(#1, #2) \rightarrow \encat{B}(G#1, G#2)").TestSingle() }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"m_{ab}") .TestMorphism(@"m_{ab}", @"\encat{A}(a, b)", @"\encat{B}(Ga, Gb)", MorphismType.Functor); tikz.CreateMorphism(@"m_{ab}", @"\encat{A}(a, b)", @"\encat{B}(Ga, Gb)") .TestMorphism(@"m_{ab}", @"\encat{A}(a, b)", @"\encat{B}(Ga, Gb)", MorphismType.Functor, true); tikz.CreateMorphism(@"m_{{Fa}{Fb}}") .TestMorphism(@"m_{{Fa}{Fb}}", @"\encat{A}(Fa, Fb)", @"\encat{B}(GFa, GFb)", MorphismType.Functor); tikz.CreateMorphism(@"m_{{Fa}{Fb}}", @"\encat{A}(Fa, Fb)", @"\encat{B}(GFa, GFb)") .TestMorphism(@"m_{{Fa}{Fb}}", @"\encat{A}(Fa, Fb)", @"\encat{B}(GFa, GFb)", MorphismType.Functor, true); }
public void 数ab() { var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { ToMorphismHelp(@"\ev", @"[#1a, #2]\otimes #1b", @"#2", MorphismType.OneMorphism) }; var func = ExtensionsInTest.CreateDefaultFunctors().ToList(); func.Add(Functor.Create("F#1", "G#1")); func.Add(Functor.Create("X", "Y")); var tikz = new TikZDiagram("", -1, false, false, true, dic, list, func); tikz.CreateMorphism(@"\ev", @"[u, v]\otimes u", @"v") .TestMorphism(@"\ev", @"[u, v]\otimes u", @"v", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\ev", @"[X, v]\otimes Y", @"v") .TestMorphism(@"\ev", @"[X, v]\otimes Y", @"v", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\ev", @"[Fu, v]\otimes Gu", @"v") .TestMorphism(@"\ev", @"[Fu, v]\otimes Gu", @"v", MorphismType.OneMorphism, true); }
public void 数1() { var mor = ToMorphismHelp(@"\test{#1}", "F(#1)", "G(#1)", MorphismType.OneMorphism); var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { mor, }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\test a") .TestMorphism(@"\test a", "F(a)", "G(a)", MorphismType.OneMorphism); tikz.CreateMorphism(@"\test{x}") .TestMorphism(@"\test{x}", "F(x)", "G(x)", MorphismType.OneMorphism); tikz.CreateMorphism(@"\test{x^i_j}") .TestMorphism(@"\test{x^i_j}", "F(x^i_j)", "G(x^i_j)", MorphismType.OneMorphism); tikz.CreateMorphism(@"\test{\alpha\beta}") .TestMorphism(@"\test{\alpha\beta}", @"F(\alpha\beta)", @"G(\alpha\beta)", MorphismType.OneMorphism); }
public void 数Associator_Null() { var dic = new Dictionary <TokenString, Morphism>(); var list = new List <Morphism>() { ToMorphismHelp(@"\alpha^{#1?}_{#2?#3?#4?}", @"(#2\otimes #3)\otimes #4", @"#2\otimes (#3\otimes #4)", MorphismType.OneMorphism) }; var tikz = new TikZDiagram("", -1, false, false, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\alpha_{uvw}", @"(u\otimes v)\otimes w", null) .TestMorphism(@"\alpha_{uvw}", @"(u\otimes v)\otimes w", @"u\otimes(v\otimes w)", MorphismType.OneMorphism); tikz.CreateMorphism(@"\alpha_{u, v\otimes w, x}") .TestMorphism(@"\alpha_{u, v\otimes w, x}", @"(u\otimes (v\otimes w))\otimes x", @"u\otimes((v\otimes w)\otimes x)", MorphismType.OneMorphism); tikz.CreateMorphism(@"\alpha_{abc}^{-1}", @"a\otimes(b\otimes c)") .TestMorphism(@"\alpha_{abc}^{-1}", @"a\otimes(b\otimes c)", @"(a\otimes b)\otimes c", MorphismType.OneMorphism); tikz.CreateMorphism(@"\alpha", @"(u\otimes v)\otimes w", @"u\otimes (v\otimes w)") .TestMorphism(@"\alpha", @"(u\otimes v)\otimes w", @"u\otimes(v\otimes w)", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\alpha", @"(\encat{A}\otimes \encat{B})\otimes \encat{C}", @"\encat{A}\otimes (\encat{B}\otimes \encat{C})") .TestMorphism(@"\alpha", @"(\encat{A}\otimes \encat{B})\otimes \encat{C}", @"\encat{A}\otimes(\encat{B}\otimes \encat{C})", MorphismType.Functor, true); }
public void 数二項演算_省略3() { var dic = new Dictionary <TokenString, Morphism>(); var list = ExtensionsInTest.CreateDefaultMorphisms(); list.Add(Morphism.Create(@"\alpha^{#1?}_{#2?#3?#4?}\colon (#2#3)#4\rightarrow #2(#3#4)").TestSingle()); var tikz = new TikZDiagram("", -1, false, true, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\alpha", @"((\encat{C}_{cd}\encat{D}_{c'd'})(\encat{C}_{bc}\encat{D}_{b'c'}))(\encat{C}_{ab}\encat{D}_{a'b'})", @"(\encat{C}_{cd}\encat{D}_{c'd'})((\encat{C}_{bc}\encat{D}_{b'c'})(\encat{C}_{ab}\encat{D}_{a'b'}))" ).TestMorphism(@"\alpha", @"((\encat{C}_{cd}\encat{D}_{c'd'})(\encat{C}_{bc}\encat{D}_{b'c'}))(\encat{C}_{ab}\encat{D}_{a'b'})", @"(\encat{C}_{cd}\encat{D}_{c'd'})((\encat{C}_{bc}\encat{D}_{b'c'})(\encat{C}_{ab}\encat{D}_{a'b'}))", MorphismType.Functor, true ); }
public void Morphism二項演算_省略() { var mor1 = ToMorphismHelp(@"f", "a", "b", MorphismType.OneMorphism); var mor2 = ToMorphismHelp(@"g", "s", "t", MorphismType.OneMorphism); var mor3 = ToMorphismHelp(@"X", @"\test{A}", @"\test{B}", MorphismType.OneMorphism); var mor4 = ToMorphismHelp(@"Y", @"\test{C}", @"\test{D}", MorphismType.OneMorphism); var mor5 = ToMorphismHelp(@"\beta_i", "Fi", "Gi", MorphismType.OneMorphism); var mor6 = ToMorphismHelp(@"\gamma_j", "Kj", "Lj", MorphismType.OneMorphism); var mor7 = ToMorphismHelp(@"\sigma", "P", "Q", MorphismType.NaturalTransformation); var mor8 = ToMorphismHelp(@"\tau", "R", "S", MorphismType.NaturalTransformation); var dic = new Dictionary <TokenString, Morphism>() { { mor1.Name.ToTokenString(), mor1 }, { mor2.Name.ToTokenString(), mor2 }, { mor3.Name.ToTokenString(), mor3 }, { mor4.Name.ToTokenString(), mor4 }, { mor5.Name.ToTokenString(), mor5 }, { mor6.Name.ToTokenString(), mor6 }, { mor7.Name.ToTokenString(), mor7 }, { mor8.Name.ToTokenString(), mor8 }, }; var tikz = new TikZDiagram("", -1, false, true, true, dic, ExtensionsInTest.CreateDefaultMorphisms(), ExtensionsInTest.CreateDefaultFunctors().ToList()); var mor = tikz.CreateMorphism(@"f\otimes g", @"as", @"bt"); mor.TestMorphism(@"f\otimes g", @"as", @"bt", MorphismType.OneMorphism, true); mor = tikz.CreateMorphism(@"X\otimes Y", @"(\test{A})(\test{C})", @"(\test{B})(\test{D})"); mor.TestMorphism(@"X\otimes Y", @"(\test{A})(\test{C})", @"(\test{B})(\test{D})", MorphismType.OneMorphism, true); mor = tikz.CreateMorphism(@"\beta_i\otimes\gamma_j", @"(Fi)(Kj)", @"(Gi)(Lj)"); mor.TestMorphism(@"\beta_i\otimes\gamma_j", @"(Fi)(Kj)", @"(Gi)(Lj)", MorphismType.OneMorphism, true); mor = tikz.CreateMorphism(@"\sigma_a\otimes\tau_b", @"(Pa)(Rb)", @"(Qa)(Sb)"); mor.TestMorphism(@"\sigma_a\otimes\tau_b", @"(Pa)(Rb)", @"(Qa)(Sb)", MorphismType.OneMorphism, true); mor = tikz.CreateMorphism(@"(\sigma_a\otimes\tau_b)\otimes\beta_i", @"((Pa)(Rb))(Fi)", @"((Qa)(Sb))(Gi)"); mor.TestMorphism(@"(\sigma_a\otimes\tau_b)\otimes\beta_i", @"((Pa)(Rb))(Fi)", @"((Qa)(Sb))(Gi)", MorphismType.OneMorphism, true); mor = tikz.CreateMorphism(@"\sigma_a\otimes(\tau_b\otimes\beta_i)", @"(Pa)((Rb)(Fi))", @"(Qa)((Sb)(Gi))"); mor.TestMorphism(@"\sigma_a\otimes (\tau_b\otimes\beta_i)", @"(Pa)((Rb)(Fi))", @"(Qa)((Sb)(Gi))", MorphismType.OneMorphism, true); }
public void 数二項演算_省略2() { var dic = new Dictionary <TokenString, Morphism>(); var list = ExtensionsInTest.CreateDefaultMorphisms(); list.Add(ToMorphismHelp(@"\rho^{#1?}_{#2?}", @"#2\otimes\Vunit", @"#2", MorphismType.OneMorphism)); list.Add(ToMorphismHelp(@"\rho^{#1?}_{#2?}", @"#2\Vunit", @"#2", MorphismType.OneMorphism)); list.Add(ToMorphismHelp(@"\lambda^{#1?}_{#2?}", @"\Vunit #2", @"#2", MorphismType.OneMorphism)); var tikz = new TikZDiagram("", -1, false, true, true, dic, list, Array.Empty <Functor>()); tikz.CreateMorphism(@"\rho^{ab}_x\otimes\rho_u", @"(x\Vunit)(u\Vunit)", @"xu") .TestMorphism(@"\rho^{ab}_x\otimes\rho_u", @"(x\Vunit)(u\Vunit)", @"xu", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\id\otimes\rho^{ab}_x", @"a(x\Vunit)", @"ax") .TestMorphism(@"\id\otimes\rho^{ab}_x", @"a(x\Vunit)", @"ax", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\lambda\otimes(\id\otimes\rho)", @"(\Vunit a)(s(x\Vunit))", @"a(sx)") .TestMorphism(@"\lambda\otimes(\id\otimes\rho)", @"(\Vunit a)(s(x\Vunit))", @"a(sx)", MorphismType.OneMorphism, true); tikz.CreateMorphism(@"\lambda", @"\Vunit \encat{C}_{ab}", @"\encat{C}_{ab}") .TestMorphism(@"\lambda", @"\Vunit \encat{C}_{ab}", @"\encat{C}_{ab}", MorphismType.Functor, true); tikz.CreateMorphism(@"\id\otimes\rho", @"\encat{C}_{st}(\encat{C}_{xz}\Vunit)", @"\encat{C}_{st}\encat{C}_{xz}") .TestMorphism(@"\id\otimes\rho", @"\encat{C}_{st}(\encat{C}_{xz}\Vunit)", @"\encat{C}_{st}\encat{C}_{xz}", MorphismType.Functor, true); tikz.CreateMorphism(@"\lambda\otimes(\id\otimes\rho)", @"(\Vunit \encat{C}_{ab})(\encat{C}_{st}(\encat{C}_{xz}\Vunit))", @"\encat{C}_{ab}(\encat{C}_{st}\encat{C}_{xz})") .TestMorphism(@"\lambda\otimes(\id\otimes\rho)", @"(\Vunit \encat{C}_{ab})(\encat{C}_{st}(\encat{C}_{xz}\Vunit))", @"\encat{C}_{ab}(\encat{C}_{st}\encat{C}_{xz})", MorphismType.Functor, true); }