(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU Lesser General Public License for more details.                *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(********************************************************************** Proof of Huffman algorithm: PBTree.v  Definition of partial binary trees (nodes have upto 2 sons)  Definitions: pbtree, inpb, pbfree, compute_pbcode, pbadd pbbuild, all_pbleaves, distinct_pbleaves, compute_pbcode  Laurent.Thery@inria.fr (2003) **********************************************************************)
Section PBTree.
Variable A : Type.
Variable empty : A.
Variable eqA_dec : forall a b : A, {a = b} + {a <> b}.
(* Partial Binary Tree (no more than 2 sons *)
Inductive pbtree : Type :=
| pbleaf : A -> pbtree
| pbleft : pbtree -> pbtree
| pbright : pbtree -> pbtree
| pbnode : pbtree -> pbtree -> pbtree.

(* Specifications: *)
(* Predictate for belonging *)
Theorem pbleaf_or_not :
forall p, (exists a : _, p = pbleaf a) \/ (forall a : A, p <> pbleaf a).