(* an induction principle for pairs of finite maps with equal support *)
Section FMapInd.
Variables (K : ordType) (V : Type).
Notation fmap := (finMap K V).
Notation nil := (@nil K V).

(* Specifications: *)
Lemma supp_eq_ins (s1 s2 : fmap) k1 k2 v1 v2 :
path ord k1 (supp s1) -> path ord k2 (supp s2) ->
supp (ins k1 v1 s1) =i supp (ins k2 v2 s2) ->
k1 = k2 /\ supp s1 =i supp s2.
Lemma fmap_ind2 (P : fmap -> fmap -> Prop) :
P nil nil ->
(forall k v1 v2 s1 s2,
path ord k (supp s1) -> path ord k (supp s2) ->
P s1 s2 -> P (ins k v1 s1) (ins k v2 s2)) ->
forall s1 s2, supp s1 =i supp s2 -> P s1 s2.