proposition: Lemma nth_error_enumerate A ls start idx : nth_error (@enumerate A ls start) idx = option_map (fun v => (start + idx, v)) (nth_error ls idx).
proof: Proof. revert start idx; induction ls as [|l ls IHls], idx as [|idx]; try reflexivity. { simpl; rewrite Nat.add_0_r; reflexivity. } { simpl; rewrite <- plus_n_Sm, IHls; reflexivity. } 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