The sorted points moved by a permutation.
Equations
- p.support = (List.filter (fun (i : Fin n) => decide (p.get i ≠ i)) (List.finRange n)).toArray
Instances For
Follow one cycle, marking each point on its first visit. The degree bounds its length, including when the cycle contains every point.
Equations
Instances For
Scan the starting points, retaining the marks between visits.
Equations
Instances For
Disjoint cycles, including singleton fixed points. Scanning starting points in order makes each cycle begin at its least point and orders the cycles.
Equations
- p.allCycles = (p.scanCycles (List.finRange n) (Vector.replicate n false) #[]).snd
Instances For
@[instance_reducible]
Equations
- Hex.Perm.instMul = { mul := Hex.Perm.comp }
@[instance_reducible]
Equations
- Hex.Perm.instInv = { inv := Hex.Perm.inv }
@[instance_reducible]
Equations
- Hex.Perm.instOfNatOfNatNat = { ofNat := Hex.Perm.id n }
@[instance_reducible]
Equations
- Hex.Perm.instPowNat = { pow := Hex.Perm.pow }