1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* This file was automatically generated: do not edit *********************)
19 (*#***********************************************************************)
21 (* v * The Coq Proof Assistant / The Coq Development Team *)
23 (* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
25 (* \VV/ **************************************************************)
27 (* // * This file is distributed under the terms of the *)
29 (* * GNU Lesser General Public License Version 2.1 *)
31 (*#***********************************************************************)
33 (*i $Id: Adist.v,v 1.9.2.1 2004/07/16 19:31:04 herbelin Exp $ i*)
35 include "Bool/Bool.ma".
37 include "ZArith/ZArith.ma".
39 include "Arith/Arith.ma".
41 include "Arith/Min.ma".
43 include "IntMap/Addr.ma".
45 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_1.con" as definition.
47 inline procedural "cic:/Coq/IntMap/Adist/natinf.ind".
49 inline procedural "cic:/Coq/IntMap/Adist/ad_plength.con" as definition.
51 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_infty.con" as lemma.
53 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_zeros.con" as lemma.
55 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_one.con" as lemma.
57 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_first_one.con" as lemma.
59 inline procedural "cic:/Coq/IntMap/Adist/ni_min.con" as definition.
61 inline procedural "cic:/Coq/IntMap/Adist/ni_min_idemp.con" as lemma.
63 inline procedural "cic:/Coq/IntMap/Adist/ni_min_comm.con" as lemma.
65 inline procedural "cic:/Coq/IntMap/Adist/ni_min_assoc.con" as lemma.
67 inline procedural "cic:/Coq/IntMap/Adist/ni_min_O_l.con" as lemma.
69 inline procedural "cic:/Coq/IntMap/Adist/ni_min_O_r.con" as lemma.
71 inline procedural "cic:/Coq/IntMap/Adist/ni_min_inf_l.con" as lemma.
73 inline procedural "cic:/Coq/IntMap/Adist/ni_min_inf_r.con" as lemma.
75 inline procedural "cic:/Coq/IntMap/Adist/ni_le.con" as definition.
77 inline procedural "cic:/Coq/IntMap/Adist/ni_le_refl.con" as lemma.
79 inline procedural "cic:/Coq/IntMap/Adist/ni_le_antisym.con" as lemma.
81 inline procedural "cic:/Coq/IntMap/Adist/ni_le_trans.con" as lemma.
83 inline procedural "cic:/Coq/IntMap/Adist/ni_le_min_1.con" as lemma.
85 inline procedural "cic:/Coq/IntMap/Adist/ni_le_min_2.con" as lemma.
87 inline procedural "cic:/Coq/IntMap/Adist/ni_min_case.con" as lemma.
89 inline procedural "cic:/Coq/IntMap/Adist/ni_le_total.con" as lemma.
91 inline procedural "cic:/Coq/IntMap/Adist/ni_le_min_induc.con" as lemma.
93 inline procedural "cic:/Coq/IntMap/Adist/le_ni_le.con" as lemma.
95 inline procedural "cic:/Coq/IntMap/Adist/ni_le_le.con" as lemma.
97 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_lb.con" as lemma.
99 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_ub.con" as lemma.
101 (*#* We define an ultrametric distance between addresses:
102 $d(a,a')=1/2^pd(a,a')$,
103 where $pd(a,a')$ is the number of identical bits at the beginning
104 of $a$ and $a'$ (infinity if $a=a'$).
105 Instead of working with $d$, we work with $pd$, namely
108 inline procedural "cic:/Coq/IntMap/Adist/ad_pdist.con" as definition.
110 (*#* d is a distance, so $d(a,a')=0$ iff $a=a'$; this means that
111 $pd(a,a')=infty$ iff $a=a'$: *)
113 inline procedural "cic:/Coq/IntMap/Adist/ad_pdist_eq_1.con" as lemma.
115 inline procedural "cic:/Coq/IntMap/Adist/ad_pdist_eq_2.con" as lemma.
117 (*#* $d$ is a distance, so $d(a,a')=d(a',a)$: *)
119 inline procedural "cic:/Coq/IntMap/Adist/ad_pdist_comm.con" as lemma.
121 (*#* $d$ is an ultrametric distance, that is, not only $d(a,a')\leq
123 but in fact $d(a,a')\leq max(d(a,a''),d(a'',a'))$.
124 This means that $min(pd(a,a''),pd(a'',a'))<=pd(a,a')$ (lemma [ad_pdist_ultra] below).
125 This follows from the fact that $a ~Ra~|a| = 1/2^{\texttt{ad\_plength}}(a))$
126 is an ultrametric norm, i.e. that $|a-a'| \leq max (|a-a''|, |a''-a'|)$,
127 or equivalently that $|a+b|<=max(|a|,|b|)$, i.e. that
128 min $(\texttt{ad\_plength}(a), \texttt{ad\_plength}(b)) \leq
129 \texttt{ad\_plength} (a~\texttt{xor}~ b)$
130 (lemma [ad_plength_ultra]).
133 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_ultra_1.con" as lemma.
135 inline procedural "cic:/Coq/IntMap/Adist/ad_plength_ultra.con" as lemma.
137 inline procedural "cic:/Coq/IntMap/Adist/ad_pdist_ultra.con" as lemma.