proposition: Lemma uniquize_length {A} (ls : list A) beq : List.length (uniquize beq ls) = List.length ls <-> uniquize beq ls = ls.
proof: Proof. induction ls as [|x xs IHxs]; simpl; try (split; reflexivity). edestruct @Equality.list_bin; simpl. { pose proof (uniquize_shorter xs beq). split; intro H'. { omega. } { apply (f_equal (@List.length _)) in H'. simpl in H'. omega. } } { destruct IHxs. split; intro; first [ congruence | f_equal; auto ]. } Qed.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.ZArith.ZArith Coq.Lists.List Coq.Lists.SetoidList Coq.Bool.Bool Fiat.Common Fiat.Common.List.Operations Fiat.Common.Equality Fiat.Common.List.FlattenList Fiat.Common.LogicFacts