The canonical permutation of colour data #
A mixed colouring of d slots splits into its even colours (a
multiset, since they may repeat) and its odd colours (a list, whose
order the summand's sign remembers). When the odd list is
duplicate-free the colouring is a permutation of the canonical
colouring at the same data — even colours sorted, odd colours in
increasing order — and the permutation's odd inversion count is the
odd list's own sorting sign.
That is what lets the mixed summand be read off the data alone: the functional sees only the multiset and the set, and the sign the reindexing costs is exactly the one the list carries.
Colour data extraction #
The even colours of a mixed colouring, as a multiset: even colours may repeat.
Equations
Instances For
The odd colours, in slot order: the list whose sorting sign the summand carries.
Equations
Instances For
The odd colours as a set — the index the functional is evaluated at.
Equations
- RS.oddFinsetOf c = (RS.oddListOf c).toFinset
Instances For
Card bookkeeping #
The two parts account for every slot.
When the odd list is duplicate-free its set has the same size.
Colour value rank #
Colour rank for sorting #
Monotonicity #
Multiset decomposition #
Canon list structure #
Multiset equality between c and canon #
Pair inversions #
Inversions helpers #
FilterMap structure lemma #
If g ∘ f is some (vals t) at positions ps t (strictly increasing)
and none
elsewhere, then filterMap g (ofFn f) equals ofFn vals.
Sign clause #
Main theorem #
The canonical permutation: any colouring with a duplicate-free odd list is a permutation of the canonical one at its own data, and the permutation's odd inversion sign is exactly the odd list's sorting sign.