proposition: Lemma setpart_shape_imset (T1 T2 : finType) (f : T1 -> T2) (A : {set {set T1}}) : injective f -> setpart_shape [set f @: x | x : {set T1} in A] = setpart_shape A.
proof: Proof. Proof using. rewrite /setpart_shape /= => Hinj. apply/perm_sortP/permP => // P. rewrite !count_set_of_card -(card_imset _ (imset_inj Hinj)). rewrite imsetI; last by move=> B C _ _; exact: imset_inj. congr #{_}; apply/setP => S; rewrite !inE. case: (boolP (S \in (imset _ _))) => //= /imsetP[U _ -> {S}]. rewrite (card_imset _ Hinj). apply/idP/imsetP => [| [V]]. - by exists U; rewrite // inE. - by rewrite inE => HP /(imset_inj Hinj) ->. Qed.
imports: HB(structures) mathcomp(all_ssreflect) mathcomp(div ssralg ssrint ssrnum binomial) tools combclass sorted ordtype