List Permutations #
This file introduces the List.Perm relation, which is true if two lists are permutations of one
another.
Notation #
The notation ~ is used for permutation equivalence.
Equations
- x✝¹.decidableSubperm x✝ = decidable_of_iff (x✝¹.isSubperm x✝ = true) ⋯
idxBij #
Subperm.idxInj is an injective map from Fin xs.length to Fin ys.length
which exists when we have xs <+~ ys: conceptually it represents an embedding of
one list into the other. For example:
(by decide : [1, 0, 1] <+~ [5, 0, 1, 3, 1]).idxInj 1 = 1
Equations
- h.idxInj i = match xs.idxToSigmaCount i with | ⟨x, t⟩ => ys.sigmaCountToIdx ⟨x, ⟨↑t, ⋯⟩⟩
Instances For
Sublist.idxOrderInj is an order-preserving injective map from Fin xs.length to
Fin ys.length which exists when we have xs <+ ys: conceptually it represents an
order-preserving embedding of one list into the other. For example:
(by decide : [0, 1, 1] <+ [5, 0, 1, 3, 1]).idxInj 1 = 2
Equations
- h.idxOrderInj = ⋯.idxInj
Instances For
Perm.idxBij is a bijective map from Fin xs.length to Fin ys.length
which exists when we have xs.Perm ys: conceptually it represents a permuting of
one list into the other. For example:
(by decide : [0, 1, 1, 3, 5] ~ [5, 0, 1, 3, 1]).idxBij 2 = 4