proposition: Lemma length_filter_eq {A f} {ls : list A} (H : length (filter f ls) = length ls) : filter f ls = ls.
proof: Proof. induction ls as [|l ls IHls]; simpl in *. { reflexivity. } { edestruct f; simpl in *; f_equal; try apply IHls; try omega. { pose proof (length_filter f ls). omega. } } 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