proposition: Lemma first_index_default_first_index_partial {A} (test : A -> bool) (ls : list A) default v (testo : A -> option bool) (Heq : Operations.List.first_index_default_partial testo default ls = Some v) (H : forall a v, testo a = Some v -> test a = v) : Operations.List.first_index_default test default ls = v.
proof: Proof. unfold Operations.List.first_index_default_partial in *. rewrite first_index_default_first_index_error. destruct (Operations.List.first_index_partial testo ls) as [[]|] eqn:H'. { eapply first_index_error_first_index_partial in H'; [ | eassumption ]. rewrite H'; simpl; congruence. } { eapply first_index_error_first_index_partial in H'; [ | eassumption ]. rewrite H'; simpl; congruence. } { congruence. } 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