Counting permutations that extend a finite partial assignment #
For k distinct domain points xs : Fin k ↪ α and target values ys : Fin k → α, the set
RandomPermutation.extPerms (List.ofFn fun i => (xs i, ys i)) of permutations of a finite type α
sending each xs i to ys i has at most (Fintype.card α)! / (Fintype.card α).descFactorial k
elements. Equivalently, a uniformly random permutation takes k prescribed values at k distinct
points with probability at most 1 / (|α| (|α| - 1) ⋯ (|α| - k + 1)). These results depend only on
RandomPermutation.extPerms, not on any cipher construction.
Main results #
Cslib.RandomPermutation.extPerms_ofFn_eq: the extensions of aList.ofFncache as a filter over all permutations.Cslib.RandomPermutation.card_extPerms_ofFn_eq: the extension count is the same for all injective target tuples.Cslib.RandomPermutation.sum_card_extPerms_ofFn: the extension counts over all injective target tuples sum to(Fintype.card α)!.Cslib.RandomPermutation.card_extPerms_ofFn_mul_descFactorial_le: the falling-factorial bound#extPerms * (Fintype.card α).descFactorial k ≤ (Fintype.card α)!(original).Cslib.RandomPermutation.card_filter_apply_eq_mul_card_le: its one-point case: at most(Fintype.card α)! / Fintype.card αpermutations send a given point to a given value.
The extensions of the cache List.ofFn fun i => (xs i, ys i) are the permutations sending
every xs i to ys i.
For distinct domain points xs, the number of permutations extending the cache
List.ofFn fun i => (xs i, e i) does not depend on the injective target tuple e.
Summing the extension counts over all injective target tuples e : Fin k ↪ α counts every
permutation of α exactly once.
Falling-factorial upper bound on k-point extPerms fibers (original):
for any k distinct domain points xs : Fin k ↪ α and any target values ys : Fin k → α,
#(extPerms (List.ofFn fun i => (xs i, ys i))) * (Fintype.card α).descFactorial k ≤ (Fintype.card α).factorial.
The one-point case of card_extPerms_ofFn_mul_descFactorial_le: at most
(Fintype.card α)! / Fintype.card α permutations of α send x to a.