proposition: Lemma first_index_error_Some_correct {A} (P : A -> bool) (n : nat) (ls : list A) : first_index_error P ls = Some n <-> ((exists elem, nth_error ls n = Some elem /\ P elem = true) /\ forall m, m < n -> forall elem, nth_error ls m = Some elem -> P elem = false).
proof: Proof. revert n. induction ls; simpl; intros. { destruct n; first_index_error_t. } { specialize (IHls (pred n)). destruct n; first_index_error_t. } 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