Section FINITE_CONSTRUCTIVE.
Variable A: Type.
Fixpoint p_tree_finite_c (t: PTree.t A) : positive :=
match t with
PTree.Leaf => 1%positive
| PTree.Node l _ r => Pos.max (xO (p_tree_finite_c l)) (xI (p_tree_finite_c r))
end.
Definition pmap_finite_c (m: PMap.t A) : positive :=
p_tree_finite_c (snd m).

Lemma pmap_finite_sound_c:
forall (m: PMap.t A) n, ((pmap_finite_c m) <= n)%positive -> PMap.get n m = fst m.