proposition: Lemma Permutation_map_filter : forall key (m : IndexedBag), Permutation (Values (map benumerate (filter (KeyBasedPartitioningFunction BagType key) m))) (Values (filter (KeyBasedPartitioningFunction _ key) (map benumerate m))).
proof: Proof. intros; eapply Permutation_InA_cons; eauto using elements_3w. intros; repeat rewrite <- elements_mapsto_iff; rewrite filter_iff; repeat rewrite map_mapsto_iff; intuition; eauto using KeyBasedPartitioningFunction_Proper. - destruct H as [bag [? In_k] ]; subst; rewrite filter_iff in In_k; intuition; eauto using KeyBasedPartitioningFunction_Proper. - destruct H as [bag [? In_k] ]; subst; rewrite filter_iff in In_k; intuition; eauto using KeyBasedPartitioningFunction_Proper. - destruct H0 as [bag [? In_k] ]; subst. eexists; split; eauto; rewrite filter_iff; intuition; eauto using KeyBasedPartitioningFunction_Proper. Qed.
imports: Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsInterface Fiat.QueryStructure.Implementation.DataStructures.Bags.BagsProperties Coq.FSets.FMapInterface Coq.FSets.FMapFacts Coq.Arith.PeanoNat Fiat.Common Fiat.Common.List.ListFacts Fiat.Common.List.FlattenList Fiat.Common.SetEqProperties Fiat.Common.FMapExtensions Fiat.Common.List.PermutationFacts