theorem
Hex.Perm.Cycle.expand_count
(ks : List Nat)
(f : Nat → Nat)
(k : Nat)
(hd : ks.Nodup)
:
List.count k (List.flatMap (fun (j : Nat) => List.replicate (f j) j) ks) = if k ∈ ks then f k else 0
theorem
Hex.Perm.Cycle.expand_sorted
(ks : List Nat)
(f : Nat → Nat)
(hs : List.Pairwise (fun (x1 x2 : Nat) => x1 ≤ x2) ks)
:
List.Pairwise (fun (x1 x2 : Nat) => x1 ≤ x2) (List.flatMap (fun (j : Nat) => List.replicate (f j) j) ks)
The length histogram retains exactly the multiplicity of every emitted cycle length, including singleton fixed points.
theorem
Hex.Perm.cycleType_sorted
{n : Nat}
(p : Perm n)
:
List.Pairwise (fun (x1 x2 : Nat) => x1 ≤ x2) p.cycleType.toList