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 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  数二項演算_省略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  数二項演算_省略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  数二項演算_省略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);
        }
 private TikZDiagram CreateTikZDiagram(Dictionary <TokenString, Morphism> dic)
 => new TikZDiagram("", -1, false, false, true, dic, ExtensionsInTest.CreateDefaultMorphisms(), ExtensionsInTest.CreateDefaultFunctors().ToList());