Definition h2foldr {A: UU} {n: nat} {v: vec A n} {P: A → UU} {h1v: hvec (vec_map P v)} {Q: ∏ (a: A) (p: P a), UU} {B: UU} (comp: ∏ (a: A) (p: P a), Q a p → B → B) (s: B) (h2v: hvec (h1map_vec Q h1v)) : B. Proof. revert n v h1v h2v. refine (vec_ind _ _ _). - intros. exact s. - simpl. intros x n xs IHxs h1v h2v. exact (comp _ _ (pr1 h2v) (IHxs (pr2 h1v) (pr2 h2v))). Defined.
Require Import UniMath.Foundations.All. Require Import UniMath.Combinatorics.StandardFiniteSets.