Section HardCorePredicate.
Variable n : nat.
Variable f : Bvector n -> Bvector n.
Variable b : Bvector n -> bool.
Variable A : Bvector n -> bool -> Comp bool.
Definition HCP_G1 :=
r <-$ {0, 1} ^ n;
g <-$ (A (f r) (b r));
ret g.
Definition HCP_G2 :=
rb <-$ {0, 1};
r <-$ {0, 1} ^ n;
g <-$ (A (f r) rb);
ret g.
Definition HCP_Advantage := | (Pr[HCP_G1]) - (Pr[HCP_G2]) | .
End HardCorePredicate.
Definition vector_firstPart_h(A : Set)(m1 m2 : nat)(v : Vector.t A (m1 + m2)) : {ls : list A | length ls = m1}.
refine (exist _ (firstn m1 (Vector.to_list v)) _).
eapply eq_trans.
apply firstn_length.
rewrite to_list_length.
eapply min_l.
omega.
Defined.
Fixpoint firstPart(A : Set)(m1 m2 : nat)(v : Vector.t A (m1 + m2)) : Vector.t A m1 :=
of_sig_list (vector_firstPart_h m1 m2 v).

Theorem skipn_length : forall (A : Set) n0 (ls : list A),
length (skipn n0 ls) = (length ls) - n0.