fact: Definition cpcolor1 s (f : colseq -> ctree) (et : colseq) := let f2 c et' := f [:: c, c & et'] in match s, et with | CpR n, _ => f (rot n et) | CpR', _ => if size et <= 1 then CtreeEmpty else f (rotr 1 et) | CpU, _ => ctree_union (f2 Color1 et) (ctree_union (f2 Color2 et) (f2 Color3 et)) | CpK, [:: e1, e2 & et'] => if e1 == e2 then CtreeEmpty else f (e1 +c e2 :: et') | CpY, e1 :: et' => let e2 := Eperm231 e1 in let e3 := Eperm312 e1 in ctree_union (f [:: e2, e3 & et']) (f [:: e3, e2 & et']) | CpH, [:: e1, e2 & et'] => if e1 == e2 then ctree_union (f2 (Eperm231 e1) et') (f2 (Eperm312 e1) et') else f [:: e2, e1 & et'] | CpA, [:: e1, e2 & et'] => if e1 == e2 then f (if et' is [::] then et else et') else CtreeEmpty | _, _ => CtreeEmpty end.
imports: mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat seq choice) mathcomp(fintype path fingraph) fourcolor(hypermap geometry color coloring cfmap ctree)