proposition: Lemma Vopt_filter_app p (xs : vector A p) q (ys : vector A q) x : forall n (ks : vector nat n) i (hi : i < n), Vnth (Vopt_filter ks xs) hi = Some x -> Vnth (Vopt_filter ks (Vapp xs ys)) hi = Some x.
proof: Proof. induction ks; simpl; intros i hi. fo. destruct i. destruct (lt_dec h p); destruct (lt_dec h (p+q)); try (discr||lia). rewrite Vnth_app. destruct (le_gt_dec p h). lia. rewrite Vnth_eq with (h2:=g); auto. apply IHks. Qed.
imports: Coq(Vector Program Structures.Equalities Morphisms) CoLoR(LogicUtil NatUtil EqUtil ListUtil BoolUtil RelUtil)