(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** * FMapPositive : an implementation of FMapInterface for [positive] keys. *)
Set Implicit Arguments.
Local Open Scope positive_scope.
Local Unset Elimination Schemes.
(** This file is an adaptation to the [FMap] framework of a work by Xavier Leroy and Sandrine Blazy (used for building certified compilers). Keys are of type [positive], and maps are binary trees: the sequence of binary digits of a positive number corresponds to a path in such a tree. This is quite similar to the [IntMap] library, except that no path compression is implemented, and that the current file is simple enough to be self-contained. *)
(** First, some stuff about [positive] *)
Fixpoint append (i j : positive) : positive :=
match i with
| xH => j
| xI ii => xI (append ii j)
| xO ii => xO (append ii j)
end.

Lemma append_assoc_0 :
forall (i j : positive), append i (xO j) = append (append i (xO xH)) j.