Filtering and swapping list products #
The list product l₁ ×ˢ l₂ enumerates pairs with the left element outermost. Filtering it by a
predicate of one component is the product with that list filtered, as for Finset
(Finset.filter_product_left), and swapping its pairs permutes it into l₂ ×ˢ l₁, as for
Multiset (Multiset.map_swap_product). The list forms keep the order of the pairs, which matters
when lists represent bags of rows in a fixed order.
Main results #
List.filter_product_left,List.filter_product_right: filtering a product by one component.List.perm_map_swap_product: swapping the pairs of a product permutes it into the other product.