Section Set_of_tuple_of_positive.
Context {Ar : Arity}.
Fixpoint eqList (l1 l2 : list positive) :=
match l1, l2 with
| nil, nil => True
| (hd1 :: tl1), (hd2 :: tl2) => (Pos.eq hd1 hd2) /\ (eqList tl1 tl2)
| _, _ => False
end.
Definition tST := cartesianPower positive (S (S n)).
Definition eqST (cp1 cp2 : tST) :=
eqList (PosSort.sort (CPToList cp1)) (PosSort.sort (CPToList cp2)).
Fixpoint eqbList (l1 l2 : list positive) :=
match l1, l2 with
| nil         , nil          => true
| (hd1 :: tl1), (hd2 :: tl2) => (Pos.eqb hd1 hd2) && (eqbList tl1 tl2)
| _           , _            => false
end.

Lemma eqbListEqList : forall l1 l2, eqbList l1 l2 = true <-> eqList l1 l2.