proposition: Lemma removeA_length {A eqA} {_ : @Symmetric A eqA} {_ : @Transitive A eqA} {dec} x ls (HD : NoDupA eqA ls) : let postlen := List.length (@removeA A eqA dec x ls) in (if InA_dec dec x ls then S postlen else postlen) = List.length ls.
proof: Proof. induction HD as [|y ys IHys HD]. { reflexivity. } { simpl in *. edestruct dec; simpl in *; edestruct InA_dec; simpl in *; try solve [ apply f_equal; assumption ]. { exfalso; apply IHys. eapply InA_R_InA; try eassumption; symmetry; eassumption. } } 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