proposition: Lemma big_ord_narrow_cond : forall n1 n2 (P : pred 'I_n2) F, forall le_n1_n2 : n1 <= n2, let w := widen_ord le_n1_n2 in \big[op/idx]_(i < n2 | P i && (i < n1)) F i === \big[op/idx]_(i < n1 | P (w i)) F (w i).
proof: Proof. move=> [|n1] n2 P F ltn12 /=. rewrite -> !big_pred0. reflexivity. intro; inversion x; inversion H1. intro; rewrite andbF//. rewrite -> (big_ord_widen_leq (fun i => P (widen_ord (m:=n2) ltn12 i)) (fun i => F (widen_ord (m:=n2) ltn12 i)) ltn12); apply: eq_big => i. rewrite ltnS; case: leqP => [le_i_n1|_]; last by rewrite !andbF. by congr (P _ && _); apply: val_inj; rewrite /= inordK. case/andP=> _ le_i_n1. assert (i = widen_ord (m:=n2) ltn12 (inord i)). by apply: val_inj; rewrite /= inordK. rewrite <- H1; reflexivity. Qed.
imports: ssreflect ssrbool ssrfun eqtype ssrnat seq div choice fintype finfun paths Setoid Morphisms OperationClasses bigops