~ubuntu-branches/ubuntu/hardy/coq-doc/hardy

« back to all changes in this revision

Viewing changes to library/Coq.IntMap.Mapfold.html

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2004-09-18 13:28:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040918132822-ees5mb8qmzd6a0fw
Tags: 8.0pl1.0-1
* Added the Coq faq, moved the tutorial to the root directory and added
  doc-base files for both, closes: #272204.
* Set dh_compat to level 4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html xmlns="http://www.w3.org/1999/xhtml">
 
2
<head>
 
3
<meta http-equiv="Content-Type" content="text/html; charset="><link rel="stylesheet" href="style.css" type="text/css"><title>Coq.IntMap.Mapfold</title>
 
4
</head>
 
5
 
 
6
<body>
 
7
 
 
8
<h1>Library Coq.IntMap.Mapfold</h1>
 
9
 
 
10
<code>
 
11
<code class="keyword">Require</code> <code class="keyword">Import</code> Bool.<br/>
 
12
<code class="keyword">Require</code> <code class="keyword">Import</code> Sumbool.<br/>
 
13
<code class="keyword">Require</code> <code class="keyword">Import</code> ZArith.<br/>
 
14
<code class="keyword">Require</code> <code class="keyword">Import</code> Addr.<br/>
 
15
<code class="keyword">Require</code> <code class="keyword">Import</code> Adist.<br/>
 
16
<code class="keyword">Require</code> <code class="keyword">Import</code> Addec.<br/>
 
17
<code class="keyword">Require</code> <code class="keyword">Import</code> Map.<br/>
 
18
<code class="keyword">Require</code> <code class="keyword">Import</code> Fset.<br/>
 
19
<code class="keyword">Require</code> <code class="keyword">Import</code> Mapaxioms.<br/>
 
20
<code class="keyword">Require</code> <code class="keyword">Import</code> Mapiter.<br/>
 
21
<code class="keyword">Require</code> <code class="keyword">Import</code> Lsort.<br/>
 
22
<code class="keyword">Require</code> <code class="keyword">Import</code> Mapsubset.<br/>
 
23
<code class="keyword">Require</code> <code class="keyword">Import</code> List.<br/>
 
24
 
 
25
<br/>
 
26
<code class="keyword">Section</code> MapFoldResults.<br/>
 
27
 
 
28
<br/>
 
29
&nbsp;&nbsp;  <code class="keyword">Variable</code> A : Set.<br/>
 
30
 
 
31
<br/>
 
32
&nbsp;&nbsp;  <code class="keyword">Variable</code> M : Set.<br/>
 
33
&nbsp;&nbsp;  <code class="keyword">Variable</code> neutral : M.<br/>
 
34
&nbsp;&nbsp;  <code class="keyword">Variable</code> op : M -&gt; M -&gt; M.<br/>
 
35
 
 
36
<br/>
 
37
&nbsp;&nbsp;  <code class="keyword">Variable</code> nleft : forall a:M, op neutral a = a.<br/>
 
38
&nbsp;&nbsp;  <code class="keyword">Variable</code> nright : forall a:M, op a neutral = a.<br/>
 
39
&nbsp;&nbsp;  <code class="keyword">Variable</code> assoc : forall a b c:M, op (op a b) c = op a (op b c).<br/>
 
40
 
 
41
<br/>
 
42
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_ext"></a>MapFold_ext :<br/>
 
43
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m m':<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
44
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapaxioms.html#eqmap">eqmap</a> A m m' -&gt; <a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> _ _ neutral op f m = <a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> _ _ neutral op f m'.<br/>
 
45
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
46
&nbsp;&nbsp;&nbsp;&nbsp;intros. rewrite (<a href="Coq.IntMap.Mapiter.html#MapFold_as_fold">MapFold_as_fold</a> A M neutral op assoc nleft nright f m).<br/>
 
47
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (<a href="Coq.IntMap.Mapiter.html#MapFold_as_fold">MapFold_as_fold</a> A M neutral op assoc nleft nright f m').<br/>
 
48
&nbsp;&nbsp;&nbsp;&nbsp;cut (<a href="Coq.IntMap.Mapiter.html#alist_of_Map">alist_of_Map</a> A m = <a href="Coq.IntMap.Mapiter.html#alist_of_Map">alist_of_Map</a> A m'). intro. rewrite H0. reflexivity.<br/>
 
49
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Lsort.html#alist_canonical">alist_canonical</a>. unfold eqmap in H. apply <a href="Coq.IntMap.Mapaxioms.html#eqm_trans">eqm_trans</a> with (f':= <a href="Coq.IntMap.Map.html#MapGet">MapGet</a> A m).<br/>
 
50
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqm_sym">eqm_sym</a>. apply <a href="Coq.IntMap.Mapiter.html#alist_of_Map_semantics">alist_of_Map_semantics</a>.<br/>
 
51
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqm_trans">eqm_trans</a> with (f':= <a href="Coq.IntMap.Map.html#MapGet">MapGet</a> A m'). assumption.<br/>
 
52
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapiter.html#alist_of_Map_semantics">alist_of_Map_semantics</a>.<br/>
 
53
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Lsort.html#alist_of_Map_sorts2">alist_of_Map_sorts2</a>.<br/>
 
54
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Lsort.html#alist_of_Map_sorts2">alist_of_Map_sorts2</a>.<br/>
 
55
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
56
 
 
57
<br/>
 
58
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_ext_f_1"></a>MapFold_ext_f_1 :<br/>
 
59
&nbsp;&nbsp;&nbsp;forall (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (f g:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
60
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(forall (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A), <a href="Coq.IntMap.Map.html#MapGet">MapGet</a> _ m a = <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ y -&gt; f (pf a) y = g (pf a) y) -&gt;<br/>
 
61
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op f pf m = <a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op g pf m.<br/>
 
62
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
63
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m. trivial.<br/>
 
64
&nbsp;&nbsp;&nbsp;&nbsp;simpl in |- *. intros. apply H. rewrite (<a href="Coq.IntMap.Addec.html#ad_eq_correct">ad_eq_correct</a> a). reflexivity.<br/>
 
65
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *. rewrite (H f g (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0))).<br/>
 
66
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (H0 f g (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0))). reflexivity.<br/>
 
67
&nbsp;&nbsp;&nbsp;&nbsp;intros. apply H1. rewrite <a href="Coq.IntMap.Map.html#MapGet_M2_bit_0_1">MapGet_M2_bit_0_1</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_double_plus_un_div_2">ad_double_plus_un_div_2</a>. assumption.<br/>
 
68
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Addr.html#ad_double_plus_un_bit_0">ad_double_plus_un_bit_0</a>.<br/>
 
69
&nbsp;&nbsp;&nbsp;&nbsp;intros. apply H1. rewrite <a href="Coq.IntMap.Map.html#MapGet_M2_bit_0_0">MapGet_M2_bit_0_0</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_double_div_2">ad_double_div_2</a>. assumption.<br/>
 
70
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Addr.html#ad_double_bit_0">ad_double_bit_0</a>.<br/>
 
71
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
72
 
 
73
<br/>
 
74
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_ext_f"></a>MapFold_ext_f :<br/>
 
75
&nbsp;&nbsp;&nbsp;forall (f g:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
76
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(forall (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A), <a href="Coq.IntMap.Map.html#MapGet">MapGet</a> _ m a = <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ y -&gt; f a y = g a y) -&gt;<br/>
 
77
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> _ _ neutral op f m = <a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> _ _ neutral op g m.<br/>
 
78
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
79
&nbsp;&nbsp;&nbsp;&nbsp;intros. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_ext_f_1">MapFold_ext_f_1</a> m f g (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; a0) H).<br/>
 
80
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
81
 
 
82
<br/>
 
83
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold1_as_Fold_1"></a>MapFold1_as_Fold_1 :<br/>
 
84
&nbsp;&nbsp;&nbsp;forall (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (f f':<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (pf pf':<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
85
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(forall (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A), f (pf a) y = f' (pf' a) y) -&gt;<br/>
 
86
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op f pf m = <a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op f' pf' m.<br/>
 
87
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
88
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m. trivial.<br/>
 
89
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *. apply H.<br/>
 
90
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *.<br/>
 
91
&nbsp;&nbsp;&nbsp;&nbsp;rewrite<br/>
 
92
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(H f f' (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0))<br/>
 
93
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf' (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0))).<br/>
 
94
&nbsp;&nbsp;&nbsp;&nbsp;rewrite<br/>
 
95
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(H0 f f' (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0))<br/>
 
96
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf' (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0))).<br/>
 
97
&nbsp;&nbsp;&nbsp;&nbsp;reflexivity.<br/>
 
98
&nbsp;&nbsp;&nbsp;&nbsp;intros. apply H1.<br/>
 
99
&nbsp;&nbsp;&nbsp;&nbsp;intros. apply H1.<br/>
 
100
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
101
 
 
102
<br/>
 
103
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold1_as_Fold"></a>MapFold1_as_Fold :<br/>
 
104
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
105
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op f pf m =<br/>
 
106
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> _ _ neutral op (fun (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A) =&gt; f (pf a) y) m.<br/>
 
107
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
108
&nbsp;&nbsp;&nbsp;&nbsp;intros. unfold MapFold in |- *. apply <a href="Coq.IntMap.Mapfold.html#MapFold1_as_Fold_1">MapFold1_as_Fold_1</a>. trivial.<br/>
 
109
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
110
 
 
111
<br/>
 
112
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold1_ext"></a>MapFold1_ext :<br/>
 
113
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m m':<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
114
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapaxioms.html#eqmap">eqmap</a> A m m' -&gt;<br/>
 
115
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forall pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>,<br/>
 
116
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op f pf m = <a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> _ _ neutral op f pf m'.<br/>
 
117
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
118
&nbsp;&nbsp;&nbsp;&nbsp;intros. rewrite <a href="Coq.IntMap.Mapfold.html#MapFold1_as_Fold">MapFold1_as_Fold</a>. rewrite <a href="Coq.IntMap.Mapfold.html#MapFold1_as_Fold">MapFold1_as_Fold</a>. apply <a href="Coq.IntMap.Mapfold.html#MapFold_ext">MapFold_ext</a>. assumption.<br/>
 
119
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
120
 
 
121
<br/>
 
122
&nbsp;&nbsp;  <code class="keyword">Variable</code> comm : forall a b:M, op a b = op b a.<br/>
 
123
 
 
124
<br/>
 
125
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Put_disjoint_1"></a>MapFold_Put_disjoint_1 :<br/>
 
126
&nbsp;&nbsp;&nbsp;forall (p:<a href="Coq.NArith.BinPos.html#positive">positive</a>) (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>) <br/>
 
127
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(a1 a2:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y1 y2:A),<br/>
 
128
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Addr.html#ad_xor">ad_xor</a> a1 a2 = <a href="Coq.IntMap.Addr.html#ad_x">ad_x</a> p -&gt;<br/>
 
129
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf (<a href="Coq.IntMap.Map.html#MapPut1">MapPut1</a> A a1 y1 a2 y2 p) =<br/>
 
130
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (f (pf a1) y1) (f (pf a2) y2).<br/>
 
131
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
132
&nbsp;&nbsp;&nbsp;&nbsp;simple induction p. intros. simpl in |- *. elim (<a href="Coq.Bool.Sumbool.html#sumbool_of_bool">sumbool_of_bool</a> (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a1)). intro H1. rewrite H1.<br/>
 
133
&nbsp;&nbsp;&nbsp;&nbsp;simpl in |- *. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. apply comm.<br/>
 
134
&nbsp;&nbsp;&nbsp;&nbsp;change (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a2 = <a href="Coq.Bool.Bool.html#negb">negb</a> <a href="Coq.Init.Datatypes.html#true">true</a>) in |- *. rewrite &lt;- H1. rewrite (<a href="Coq.IntMap.Addr.html#ad_neg_bit_0_2">ad_neg_bit_0_2</a> _ _ _ H0).<br/>
 
135
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.Bool.Bool.html#negb_elim">negb_elim</a>. reflexivity.<br/>
 
136
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
137
&nbsp;&nbsp;&nbsp;&nbsp;intro H1. rewrite H1. simpl in |- *. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>.<br/>
 
138
&nbsp;&nbsp;&nbsp;&nbsp;reflexivity.<br/>
 
139
&nbsp;&nbsp;&nbsp;&nbsp;change (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a2 = <a href="Coq.Bool.Bool.html#negb">negb</a> <a href="Coq.Init.Datatypes.html#false">false</a>) in |- *. rewrite &lt;- H1. rewrite (<a href="Coq.IntMap.Addr.html#ad_neg_bit_0_2">ad_neg_bit_0_2</a> _ _ _ H0).<br/>
 
140
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.Bool.Bool.html#negb_elim">negb_elim</a>. reflexivity.<br/>
 
141
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
142
&nbsp;&nbsp;&nbsp;&nbsp;simpl in |- *. intros. elim (<a href="Coq.Bool.Sumbool.html#sumbool_of_bool">sumbool_of_bool</a> (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a1)). intro H1. rewrite H1. simpl in |- *.<br/>
 
143
&nbsp;&nbsp;&nbsp;&nbsp;rewrite nleft.<br/>
 
144
&nbsp;&nbsp;&nbsp;&nbsp;rewrite<br/>
 
145
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(H f (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0)) (<br/>
 
146
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a1) (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a2) y1 y2).<br/>
 
147
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>. reflexivity.<br/>
 
148
&nbsp;&nbsp;&nbsp;&nbsp;rewrite &lt;- (<a href="Coq.IntMap.Addr.html#ad_same_bit_0">ad_same_bit_0</a> _ _ _ H0). assumption.<br/>
 
149
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
150
&nbsp;&nbsp;&nbsp;&nbsp;rewrite &lt;- <a href="Coq.IntMap.Addr.html#ad_xor_div_2">ad_xor_div_2</a>. rewrite H0. reflexivity.<br/>
 
151
&nbsp;&nbsp;&nbsp;&nbsp;intro H1. rewrite H1. simpl in |- *. rewrite nright.<br/>
 
152
&nbsp;&nbsp;&nbsp;&nbsp;rewrite<br/>
 
153
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(H f (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0)) (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a1) (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a2) y1 y2)<br/>
 
154
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<br/>
 
155
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. reflexivity.<br/>
 
156
&nbsp;&nbsp;&nbsp;&nbsp;rewrite &lt;- (<a href="Coq.IntMap.Addr.html#ad_same_bit_0">ad_same_bit_0</a> _ _ _ H0). assumption.<br/>
 
157
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
158
&nbsp;&nbsp;&nbsp;&nbsp;rewrite &lt;- <a href="Coq.IntMap.Addr.html#ad_xor_div_2">ad_xor_div_2</a>. rewrite H0. reflexivity.<br/>
 
159
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *. elim (<a href="Coq.Bool.Sumbool.html#sumbool_of_bool">sumbool_of_bool</a> (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a1)). intro H0. rewrite H0. simpl in |- *.<br/>
 
160
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>. apply comm.<br/>
 
161
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
162
&nbsp;&nbsp;&nbsp;&nbsp;change (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a2 = <a href="Coq.Bool.Bool.html#negb">negb</a> <a href="Coq.Init.Datatypes.html#true">true</a>) in |- *. rewrite &lt;- H0. rewrite (<a href="Coq.IntMap.Addr.html#ad_neg_bit_0_1">ad_neg_bit_0_1</a> _ _ H).<br/>
 
163
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.Bool.Bool.html#negb_elim">negb_elim</a>. reflexivity.<br/>
 
164
&nbsp;&nbsp;&nbsp;&nbsp;intro H0. rewrite H0. simpl in |- *. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>.<br/>
 
165
&nbsp;&nbsp;&nbsp;&nbsp;reflexivity.<br/>
 
166
&nbsp;&nbsp;&nbsp;&nbsp;change (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a2 = <a href="Coq.Bool.Bool.html#negb">negb</a> <a href="Coq.Init.Datatypes.html#false">false</a>) in |- *. rewrite &lt;- H0. rewrite (<a href="Coq.IntMap.Addr.html#ad_neg_bit_0_1">ad_neg_bit_0_1</a> _ _ H).<br/>
 
167
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.Bool.Bool.html#negb_elim">negb_elim</a>. reflexivity.<br/>
 
168
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
169
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
170
 
 
171
<br/>
 
172
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Put_disjoint_2"></a>MapFold_Put_disjoint_2 :<br/>
 
173
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
174
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Map.html#MapGet">MapGet</a> A m a = <a href="Coq.IntMap.Map.html#NONE">NONE</a> A -&gt;<br/>
 
175
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A m a y) =<br/>
 
176
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (f (pf a) y) (<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf m).<br/>
 
177
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
178
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m. intros. simpl in |- *. rewrite (nright (f (pf a) y)). reflexivity.<br/>
 
179
&nbsp;&nbsp;&nbsp;&nbsp;intros a1 y1 a2 y2 pf H. simpl in |- *. elim (<a href="Coq.IntMap.Addr.html#ad_sum">ad_sum</a> (<a href="Coq.IntMap.Addr.html#ad_xor">ad_xor</a> a1 a2)). intro H0. elim H0.<br/>
 
180
&nbsp;&nbsp;&nbsp;&nbsp;intros p H1. rewrite H1. rewrite comm. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_Put_disjoint_1">MapFold_Put_disjoint_1</a> p f pf a1 a2 y1 y2 H1).<br/>
 
181
&nbsp;&nbsp;&nbsp;&nbsp;intro H0. rewrite (<a href="Coq.IntMap.Addec.html#ad_eq_complete">ad_eq_complete</a> _ _ (<a href="Coq.IntMap.Addec.html#ad_xor_eq_true">ad_xor_eq_true</a> _ _ H0)) in H.<br/>
 
182
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (<a href="Coq.IntMap.Map.html#M1_semantics_1">M1_semantics_1</a> A a2 y1) in H. discriminate H.<br/>
 
183
&nbsp;&nbsp;&nbsp;&nbsp;intros. elim (<a href="Coq.Bool.Sumbool.html#sumbool_of_bool">sumbool_of_bool</a> (<a href="Coq.IntMap.Addr.html#ad_bit_0">ad_bit_0</a> a)). intro H2.<br/>
 
184
&nbsp;&nbsp;&nbsp;&nbsp;cut (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A (<a href="Coq.IntMap.Map.html#M2">M2</a> A m0 m1) a y = <a href="Coq.IntMap.Map.html#M2">M2</a> A m0 (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A m1 (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a) y)). intro.<br/>
 
185
&nbsp;&nbsp;&nbsp;&nbsp;rewrite H3. simpl in |- *. rewrite (H0 (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a) y (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0))).<br/>
 
186
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double_plus_un">ad_div_2_double_plus_un</a>. rewrite &lt;- assoc.<br/>
 
187
&nbsp;&nbsp;&nbsp;&nbsp;rewrite<br/>
 
188
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(comm (<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0)) m0)<br/>
 
189
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(f (pf a) y)).<br/>
 
190
&nbsp;&nbsp;&nbsp;&nbsp;rewrite assoc. reflexivity.<br/>
 
191
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
192
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (<a href="Coq.IntMap.Map.html#MapGet_M2_bit_0_1">MapGet_M2_bit_0_1</a> A a H2 m0 m1) in H1. assumption.<br/>
 
193
&nbsp;&nbsp;&nbsp;&nbsp;simpl in |- *. elim (<a href="Coq.IntMap.Addr.html#ad_sum">ad_sum</a> a). intro H3. elim H3. intro p. elim p. intros p0 H4 H5. rewrite H5.<br/>
 
194
&nbsp;&nbsp;&nbsp;&nbsp;reflexivity.<br/>
 
195
&nbsp;&nbsp;&nbsp;&nbsp;intros p0 H4 H5. rewrite H5 in H2. discriminate H2.<br/>
 
196
&nbsp;&nbsp;&nbsp;&nbsp;intro H4. rewrite H4. reflexivity.<br/>
 
197
&nbsp;&nbsp;&nbsp;&nbsp;intro H3. rewrite H3 in H2. discriminate H2.<br/>
 
198
&nbsp;&nbsp;&nbsp;&nbsp;intro H2. cut (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A (<a href="Coq.IntMap.Map.html#M2">M2</a> A m0 m1) a y = <a href="Coq.IntMap.Map.html#M2">M2</a> A (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A m0 (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a) y) m1).<br/>
 
199
&nbsp;&nbsp;&nbsp;&nbsp;intro. rewrite H3. simpl in |- *. rewrite (H (<a href="Coq.IntMap.Addr.html#ad_div_2">ad_div_2</a> a) y (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0))).<br/>
 
200
&nbsp;&nbsp;&nbsp;&nbsp;rewrite <a href="Coq.IntMap.Addr.html#ad_div_2_double">ad_div_2_double</a>. rewrite &lt;- assoc. reflexivity.<br/>
 
201
&nbsp;&nbsp;&nbsp;&nbsp;assumption.<br/>
 
202
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (<a href="Coq.IntMap.Map.html#MapGet_M2_bit_0_0">MapGet_M2_bit_0_0</a> A a H2 m0 m1) in H1. assumption.<br/>
 
203
&nbsp;&nbsp;&nbsp;&nbsp;simpl in |- *. elim (<a href="Coq.IntMap.Addr.html#ad_sum">ad_sum</a> a). intro H3. elim H3. intro p. elim p. intros p0 H4 H5. rewrite H5 in H2.<br/>
 
204
&nbsp;&nbsp;&nbsp;&nbsp;discriminate H2.<br/>
 
205
&nbsp;&nbsp;&nbsp;&nbsp;intros p0 H4 H5. rewrite H5. reflexivity.<br/>
 
206
&nbsp;&nbsp;&nbsp;&nbsp;intro H4. rewrite H4 in H2. discriminate H2.<br/>
 
207
&nbsp;&nbsp;&nbsp;&nbsp;intro H3. rewrite H3. reflexivity.<br/>
 
208
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
209
 
 
210
<br/>
 
211
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Put_disjoint"></a>MapFold_Put_disjoint :<br/>
 
212
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A),<br/>
 
213
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Map.html#MapGet">MapGet</a> A m a = <a href="Coq.IntMap.Map.html#NONE">NONE</a> A -&gt;<br/>
 
214
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A m a y) =<br/>
 
215
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (f a y) (<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f m).<br/>
 
216
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
217
&nbsp;&nbsp;&nbsp;&nbsp;intros. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_Put_disjoint_2">MapFold_Put_disjoint_2</a> f m a y (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; a0) H).<br/>
 
218
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
219
 
 
220
<br/>
 
221
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Put_behind_disjoint_2"></a>MapFold_Put_behind_disjoint_2 :<br/>
 
222
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
223
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Map.html#MapGet">MapGet</a> A m a = <a href="Coq.IntMap.Map.html#NONE">NONE</a> A -&gt;<br/>
 
224
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf (<a href="Coq.IntMap.Map.html#MapPut_behind">MapPut_behind</a> A m a y) =<br/>
 
225
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (f (pf a) y) (<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf m).<br/>
 
226
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
227
&nbsp;&nbsp;&nbsp;&nbsp;intros. cut (<a href="Coq.IntMap.Mapaxioms.html#eqmap">eqmap</a> A (<a href="Coq.IntMap.Map.html#MapPut_behind">MapPut_behind</a> A m a y) (<a href="Coq.IntMap.Map.html#MapPut">MapPut</a> A m a y)). intro.<br/>
 
228
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (<a href="Coq.IntMap.Mapfold.html#MapFold1_ext">MapFold1_ext</a> f _ _ H0 pf). apply <a href="Coq.IntMap.Mapfold.html#MapFold_Put_disjoint_2">MapFold_Put_disjoint_2</a>. assumption.<br/>
 
229
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqmap_trans">eqmap_trans</a> with (m':= <a href="Coq.IntMap.Map.html#MapMerge">MapMerge</a> A (<a href="Coq.IntMap.Map.html#M1">M1</a> A a y) m). apply <a href="Coq.IntMap.Mapaxioms.html#MapPut_behind_as_Merge">MapPut_behind_as_Merge</a>.<br/>
 
230
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqmap_trans">eqmap_trans</a> with (m':= <a href="Coq.IntMap.Map.html#MapMerge">MapMerge</a> A m (<a href="Coq.IntMap.Map.html#M1">M1</a> A a y)).<br/>
 
231
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqmap_trans">eqmap_trans</a> with (m':= <a href="Coq.IntMap.Map.html#MapDelta">MapDelta</a> A (<a href="Coq.IntMap.Map.html#M1">M1</a> A a y) m). apply <a href="Coq.IntMap.Mapaxioms.html#eqmap_sym">eqmap_sym</a>. apply <a href="Coq.IntMap.Mapsubset.html#MapDelta_disjoint">MapDelta_disjoint</a>.<br/>
 
232
&nbsp;&nbsp;&nbsp;&nbsp;unfold MapDisjoint in |- *. unfold in_dom in |- *. simpl in |- *. intros. elim (<a href="Coq.Bool.Sumbool.html#sumbool_of_bool">sumbool_of_bool</a> (<a href="Coq.IntMap.Addec.html#ad_eq">ad_eq</a> a a0)).<br/>
 
233
&nbsp;&nbsp;&nbsp;&nbsp;intro H2. rewrite (<a href="Coq.IntMap.Addec.html#ad_eq_complete">ad_eq_complete</a> _ _ H2) in H. rewrite H in H1. discriminate H1.<br/>
 
234
&nbsp;&nbsp;&nbsp;&nbsp;intro H2. rewrite H2 in H0. discriminate H0.<br/>
 
235
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqmap_trans">eqmap_trans</a> with (m':= <a href="Coq.IntMap.Map.html#MapDelta">MapDelta</a> A m (<a href="Coq.IntMap.Map.html#M1">M1</a> A a y)). apply <a href="Coq.IntMap.Mapaxioms.html#MapDelta_sym">MapDelta_sym</a>.<br/>
 
236
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapsubset.html#MapDelta_disjoint">MapDelta_disjoint</a>. unfold MapDisjoint in |- *. unfold in_dom in |- *. simpl in |- *. intros.<br/>
 
237
&nbsp;&nbsp;&nbsp;&nbsp;elim (<a href="Coq.Bool.Sumbool.html#sumbool_of_bool">sumbool_of_bool</a> (<a href="Coq.IntMap.Addec.html#ad_eq">ad_eq</a> a a0)). intro H2. rewrite (<a href="Coq.IntMap.Addec.html#ad_eq_complete">ad_eq_complete</a> _ _ H2) in H.<br/>
 
238
&nbsp;&nbsp;&nbsp;&nbsp;rewrite H in H0. discriminate H0.<br/>
 
239
&nbsp;&nbsp;&nbsp;&nbsp;intro H2. rewrite H2 in H1. discriminate H1.<br/>
 
240
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapaxioms.html#eqmap_sym">eqmap_sym</a>. apply <a href="Coq.IntMap.Mapaxioms.html#MapPut_as_Merge">MapPut_as_Merge</a>.<br/>
 
241
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
242
 
 
243
<br/>
 
244
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Put_behind_disjoint"></a>MapFold_Put_behind_disjoint :<br/>
 
245
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A),<br/>
 
246
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Map.html#MapGet">MapGet</a> A m a = <a href="Coq.IntMap.Map.html#NONE">NONE</a> A -&gt;<br/>
 
247
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f (<a href="Coq.IntMap.Map.html#MapPut_behind">MapPut_behind</a> A m a y) =<br/>
 
248
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (f a y) (<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f m).<br/>
 
249
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
250
&nbsp;&nbsp;&nbsp;&nbsp;intros. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_Put_behind_disjoint_2">MapFold_Put_behind_disjoint_2</a> f m a y (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; a0) H).<br/>
 
251
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
252
 
 
253
<br/>
 
254
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Merge_disjoint_1"></a>MapFold_Merge_disjoint_1 :<br/>
 
255
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m1 m2:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
256
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapsubset.html#MapDisjoint">MapDisjoint</a> A A m1 m2 -&gt;<br/>
 
257
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf (<a href="Coq.IntMap.Map.html#MapMerge">MapMerge</a> A m1 m2) =<br/>
 
258
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf m1) (<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf m2).<br/>
 
259
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
260
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m1. simpl in |- *. intros. rewrite nleft. reflexivity.<br/>
 
261
&nbsp;&nbsp;&nbsp;&nbsp;intros. unfold MapMerge in |- *. apply (<a href="Coq.IntMap.Mapfold.html#MapFold_Put_behind_disjoint_2">MapFold_Put_behind_disjoint_2</a> f m2 a a0 pf).<br/>
 
262
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Fset.html#in_dom_none">in_dom_none</a>. exact (<a href="Coq.IntMap.Mapsubset.html#MapDisjoint_M1_l">MapDisjoint_M1_l</a> _ _ m2 a a0 H).<br/>
 
263
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m2. intros. simpl in |- *. rewrite nright. reflexivity.<br/>
 
264
&nbsp;&nbsp;&nbsp;&nbsp;intros. unfold MapMerge in |- *. rewrite (<a href="Coq.IntMap.Mapfold.html#MapFold_Put_disjoint_2">MapFold_Put_disjoint_2</a> f (<a href="Coq.IntMap.Map.html#M2">M2</a> A m m0) a a0 pf). apply comm.<br/>
 
265
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Fset.html#in_dom_none">in_dom_none</a>. exact (<a href="Coq.IntMap.Mapsubset.html#MapDisjoint_M1_r">MapDisjoint_M1_r</a> _ _ (<a href="Coq.IntMap.Map.html#M2">M2</a> A m m0) a a0 H1).<br/>
 
266
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *. rewrite (H m3 (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0))).<br/>
 
267
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (H0 m4 (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0))).<br/>
 
268
&nbsp;&nbsp;&nbsp;&nbsp;cut (forall a b c d:M, op (op a b) (op c d) = op (op a c) (op b d)). intro. apply H4.<br/>
 
269
&nbsp;&nbsp;&nbsp;&nbsp;intros. rewrite assoc. rewrite &lt;- (assoc b c d). rewrite (comm b c). rewrite (assoc c b d).<br/>
 
270
&nbsp;&nbsp;&nbsp;&nbsp;rewrite assoc. reflexivity.<br/>
 
271
&nbsp;&nbsp;&nbsp;&nbsp;exact (<a href="Coq.IntMap.Mapsubset.html#MapDisjoint_M2_r">MapDisjoint_M2_r</a> _ _ _ _ _ _ H3).<br/>
 
272
&nbsp;&nbsp;&nbsp;&nbsp;exact (<a href="Coq.IntMap.Mapsubset.html#MapDisjoint_M2_l">MapDisjoint_M2_l</a> _ _ _ _ _ _ H3).<br/>
 
273
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
274
 
 
275
<br/>
 
276
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_Merge_disjoint"></a>MapFold_Merge_disjoint :<br/>
 
277
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m1 m2:<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
278
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapsubset.html#MapDisjoint">MapDisjoint</a> A A m1 m2 -&gt;<br/>
 
279
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f (<a href="Coq.IntMap.Map.html#MapMerge">MapMerge</a> A m1 m2) =<br/>
 
280
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op (<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f m1) (<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f m2).<br/>
 
281
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
282
&nbsp;&nbsp;&nbsp;&nbsp;intros. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_Merge_disjoint_1">MapFold_Merge_disjoint_1</a> f m1 m2 (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; a0) H).<br/>
 
283
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
284
&nbsp;<br/>
 
285
<code class="keyword">End</code> MapFoldResults.<br/>
 
286
 
 
287
<br/>
 
288
<code class="keyword">Section</code> MapFoldDistr.<br/>
 
289
 
 
290
<br/>
 
291
&nbsp;&nbsp;  <code class="keyword">Variable</code> A : Set.<br/>
 
292
 
 
293
<br/>
 
294
&nbsp;&nbsp;  <code class="keyword">Variable</code> M : Set.<br/>
 
295
&nbsp;&nbsp;  <code class="keyword">Variable</code> neutral : M.<br/>
 
296
&nbsp;&nbsp;  <code class="keyword">Variable</code> op : M -&gt; M -&gt; M.<br/>
 
297
 
 
298
<br/>
 
299
&nbsp;&nbsp;  <code class="keyword">Variable</code> M' : Set.<br/>
 
300
&nbsp;&nbsp;  <code class="keyword">Variable</code> neutral' : M'.<br/>
 
301
&nbsp;&nbsp;  <code class="keyword">Variable</code> op' : M' -&gt; M' -&gt; M'.<br/>
 
302
 
 
303
<br/>
 
304
&nbsp;&nbsp;  <code class="keyword">Variable</code> N : Set.<br/>
 
305
 
 
306
<br/>
 
307
&nbsp;&nbsp;  <code class="keyword">Variable</code> times : M -&gt; N -&gt; M'.<br/>
 
308
 
 
309
<br/>
 
310
&nbsp;&nbsp;  <code class="keyword">Variable</code> absorb : forall c:N, times neutral c = neutral'.<br/>
 
311
&nbsp;&nbsp;<code class="keyword">Variable</code><br/>
 
312
&nbsp;&nbsp;&nbsp;&nbsp;distr :<br/>
 
313
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forall (a b:M) (c:N), times (op a b) c = op' (times a c) (times b c).<br/>
 
314
 
 
315
<br/>
 
316
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_distr_r_1"></a>MapFold_distr_r_1 :<br/>
 
317
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (c:N) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
318
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;times (<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M neutral op f pf m) c =<br/>
 
319
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A M' neutral' op' (fun (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A) =&gt; times (f a y) c) pf m.<br/>
 
320
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
321
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m. intros. exact (absorb c).<br/>
 
322
&nbsp;&nbsp;&nbsp;&nbsp;trivial.<br/>
 
323
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *. rewrite distr. rewrite H. rewrite H0. reflexivity.<br/>
 
324
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
325
 
 
326
<br/>
 
327
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_distr_r"></a>MapFold_distr_r :<br/>
 
328
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (c:N),<br/>
 
329
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;times (<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f m) c =<br/>
 
330
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M' neutral' op' (fun (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A) =&gt; times (f a y) c) m.<br/>
 
331
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
332
&nbsp;&nbsp;&nbsp;&nbsp;intros. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_distr_r_1">MapFold_distr_r_1</a> f m c (fun a:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; a)).<br/>
 
333
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
334
 
 
335
<br/>
 
336
<code class="keyword">End</code> MapFoldDistr.<br/>
 
337
 
 
338
<br/>
 
339
<code class="keyword">Section</code> MapFoldDistrL.<br/>
 
340
 
 
341
<br/>
 
342
&nbsp;&nbsp;  <code class="keyword">Variable</code> A : Set.<br/>
 
343
 
 
344
<br/>
 
345
&nbsp;&nbsp;  <code class="keyword">Variable</code> M : Set.<br/>
 
346
&nbsp;&nbsp;  <code class="keyword">Variable</code> neutral : M.<br/>
 
347
&nbsp;&nbsp;  <code class="keyword">Variable</code> op : M -&gt; M -&gt; M.<br/>
 
348
 
 
349
<br/>
 
350
&nbsp;&nbsp;  <code class="keyword">Variable</code> M' : Set.<br/>
 
351
&nbsp;&nbsp;  <code class="keyword">Variable</code> neutral' : M'.<br/>
 
352
&nbsp;&nbsp;  <code class="keyword">Variable</code> op' : M' -&gt; M' -&gt; M'.<br/>
 
353
 
 
354
<br/>
 
355
&nbsp;&nbsp;  <code class="keyword">Variable</code> N : Set.<br/>
 
356
 
 
357
<br/>
 
358
&nbsp;&nbsp;  <code class="keyword">Variable</code> times : N -&gt; M -&gt; M'.<br/>
 
359
 
 
360
<br/>
 
361
&nbsp;&nbsp;  <code class="keyword">Variable</code> absorb : forall c:N, times c neutral = neutral'.<br/>
 
362
&nbsp;&nbsp;<code class="keyword">Variable</code><br/>
 
363
&nbsp;&nbsp;&nbsp;&nbsp;distr :<br/>
 
364
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forall (a b:M) (c:N), times c (op a b) = op' (times c a) (times c b).<br/>
 
365
 
 
366
<br/>
 
367
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_distr_l"></a>MapFold_distr_l :<br/>
 
368
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; M) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (c:N),<br/>
 
369
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;times c (<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M neutral op f m) =<br/>
 
370
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A M' neutral' op' (fun (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (y:A) =&gt; times c (f a y)) m.<br/>
 
371
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
372
&nbsp;&nbsp;&nbsp;&nbsp;intros. apply <a href="Coq.IntMap.Mapfold.html#MapFold_distr_r">MapFold_distr_r</a> with (times:= fun (a:M) (b:N) =&gt; times b a);<br/>
 
373
&nbsp;&nbsp;assumption.<br/>
 
374
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
375
 
 
376
<br/>
 
377
<code class="keyword">End</code> MapFoldDistrL.<br/>
 
378
 
 
379
<br/>
 
380
<code class="keyword">Section</code> MapFoldExists.<br/>
 
381
 
 
382
<br/>
 
383
&nbsp;&nbsp;  <code class="keyword">Variable</code> A : Set.<br/>
 
384
 
 
385
<br/>
 
386
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_orb_1"></a>MapFold_orb_1 :<br/>
 
387
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; <a href="Coq.Init.Datatypes.html#bool">bool</a>) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) (pf:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; <a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
388
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold1">MapFold1</a> A <a href="Coq.Init.Datatypes.html#bool">bool</a> <a href="Coq.Init.Datatypes.html#false">false</a> <a href="Coq.Bool.Bool.html#orb">orb</a> f pf m =<br/>
 
389
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match <a href="Coq.IntMap.Mapiter.html#MapSweep1">MapSweep1</a> A f pf m with<br/>
 
390
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ =&gt; <a href="Coq.Init.Datatypes.html#true">true</a><br/>
 
391
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| _ =&gt; <a href="Coq.Init.Datatypes.html#false">false</a><br/>
 
392
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end.<br/>
 
393
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
394
&nbsp;&nbsp;&nbsp;&nbsp;simple induction m. trivial.<br/>
 
395
&nbsp;&nbsp;&nbsp;&nbsp;intros a y pf. simpl in |- *. unfold MapSweep2 in |- *. case (f (pf a) y); reflexivity.<br/>
 
396
&nbsp;&nbsp;&nbsp;&nbsp;intros. simpl in |- *. rewrite (H (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0))).<br/>
 
397
&nbsp;&nbsp;&nbsp;&nbsp;rewrite (H0 (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double_plus_un">ad_double_plus_un</a> a0))).<br/>
 
398
&nbsp;&nbsp;&nbsp;&nbsp;case (<a href="Coq.IntMap.Mapiter.html#MapSweep1">MapSweep1</a> A f (fun a0:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; pf (<a href="Coq.IntMap.Addr.html#ad_double">ad_double</a> a0)) m0); reflexivity.<br/>
 
399
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
400
 
 
401
<br/>
 
402
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="MapFold_orb"></a>MapFold_orb :<br/>
 
403
&nbsp;&nbsp;&nbsp;forall (f:<a href="Coq.IntMap.Addr.html#ad">ad</a> -&gt; A -&gt; <a href="Coq.Init.Datatypes.html#bool">bool</a>) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
404
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> A <a href="Coq.Init.Datatypes.html#bool">bool</a> <a href="Coq.Init.Datatypes.html#false">false</a> <a href="Coq.Bool.Bool.html#orb">orb</a> f m =<br/>
 
405
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match <a href="Coq.IntMap.Mapiter.html#MapSweep">MapSweep</a> A f m with<br/>
 
406
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ =&gt; <a href="Coq.Init.Datatypes.html#true">true</a><br/>
 
407
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| _ =&gt; <a href="Coq.Init.Datatypes.html#false">false</a><br/>
 
408
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end.<br/>
 
409
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
410
&nbsp;&nbsp;&nbsp;&nbsp;intros. exact (<a href="Coq.IntMap.Mapfold.html#MapFold_orb_1">MapFold_orb_1</a> f m (fun a:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; a)).<br/>
 
411
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
412
 
 
413
<br/>
 
414
<code class="keyword">End</code> MapFoldExists.<br/>
 
415
 
 
416
<br/>
 
417
<code class="keyword">Section</code> DMergeDef.<br/>
 
418
 
 
419
<br/>
 
420
&nbsp;&nbsp;  <code class="keyword">Variable</code> A : Set.<br/>
 
421
 
 
422
<br/>
 
423
&nbsp;&nbsp;<code class="keyword">Definition</code> <a name="DMerge"></a>DMerge :=<br/>
 
424
&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Mapiter.html#MapFold">MapFold</a> (<a href="Coq.IntMap.Map.html#Map">Map</a> A) (<a href="Coq.IntMap.Map.html#Map">Map</a> A) (<a href="Coq.IntMap.Map.html#M0">M0</a> A) (<a href="Coq.IntMap.Map.html#MapMerge">MapMerge</a> A) (fun (_:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (m:<a href="Coq.IntMap.Map.html#Map">Map</a> A) =&gt; m).<br/>
 
425
 
 
426
<br/>
 
427
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="in_dom_DMerge_1"></a>in_dom_DMerge_1 :<br/>
 
428
&nbsp;&nbsp;&nbsp;forall (m:<a href="Coq.IntMap.Map.html#Map">Map</a> (<a href="Coq.IntMap.Map.html#Map">Map</a> A)) (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
429
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A a (<a href="Coq.IntMap.Mapfold.html#DMerge">DMerge</a> m) =<br/>
 
430
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match <a href="Coq.IntMap.Mapiter.html#MapSweep">MapSweep</a> _ (fun (_:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (m0:<a href="Coq.IntMap.Map.html#Map">Map</a> A) =&gt; <a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A a m0) m with<br/>
 
431
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ =&gt; <a href="Coq.Init.Datatypes.html#true">true</a><br/>
 
432
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| _ =&gt; <a href="Coq.Init.Datatypes.html#false">false</a><br/>
 
433
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end.<br/>
 
434
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
435
&nbsp;&nbsp;&nbsp;&nbsp;unfold DMerge in |- *. intros.<br/>
 
436
&nbsp;&nbsp;&nbsp;&nbsp;rewrite<br/>
 
437
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<a href="Coq.IntMap.Mapfold.html#MapFold_distr_l">MapFold_distr_l</a> (<a href="Coq.IntMap.Map.html#Map">Map</a> A) (<a href="Coq.IntMap.Map.html#Map">Map</a> A) (<a href="Coq.IntMap.Map.html#M0">M0</a> A) (<a href="Coq.IntMap.Map.html#MapMerge">MapMerge</a> A) <a href="Coq.Init.Datatypes.html#bool">bool</a> <a href="Coq.Init.Datatypes.html#false">false</a> <a href="Coq.Bool.Bool.html#orb">orb</a> <a href="Coq.IntMap.Addr.html#ad">ad</a><br/>
 
438
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A) (fun c:<a href="Coq.IntMap.Addr.html#ad">ad</a> =&gt; <a href="Coq.Init.Logic.html#refl_equal">refl_equal</a> _) (<a href="Coq.IntMap.Fset.html#in_dom_merge">in_dom_merge</a> A))<br/>
 
439
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<br/>
 
440
&nbsp;&nbsp;&nbsp;&nbsp;apply <a href="Coq.IntMap.Mapfold.html#MapFold_orb">MapFold_orb</a>.<br/>
 
441
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
442
 
 
443
<br/>
 
444
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="in_dom_DMerge_2"></a>in_dom_DMerge_2 :<br/>
 
445
&nbsp;&nbsp;&nbsp;forall (m:<a href="Coq.IntMap.Map.html#Map">Map</a> (<a href="Coq.IntMap.Map.html#Map">Map</a> A)) (a:<a href="Coq.IntMap.Addr.html#ad">ad</a>),<br/>
 
446
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A a (<a href="Coq.IntMap.Mapfold.html#DMerge">DMerge</a> m) = <a href="Coq.Init.Datatypes.html#true">true</a> -&gt;<br/>
 
447
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{b : <a href="Coq.IntMap.Addr.html#ad">ad</a> &amp; <br/>
 
448
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{m0 : <a href="Coq.IntMap.Map.html#Map">Map</a> A | <a href="Coq.IntMap.Map.html#MapGet">MapGet</a> _ m b = <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ m0 /\ <a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A a m0 = <a href="Coq.Init.Datatypes.html#true">true</a>}}.<br/>
 
449
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
450
&nbsp;&nbsp;&nbsp;&nbsp;intros m a. rewrite <a href="Coq.IntMap.Mapfold.html#in_dom_DMerge_1">in_dom_DMerge_1</a>.<br/>
 
451
&nbsp;&nbsp;&nbsp;&nbsp;elim<br/>
 
452
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<a href="Coq.IntMap.Map.html#option_sum">option_sum</a> _<br/>
 
453
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<a href="Coq.IntMap.Mapiter.html#MapSweep">MapSweep</a> (<a href="Coq.IntMap.Map.html#Map">Map</a> A) (fun (_:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (m0:<a href="Coq.IntMap.Map.html#Map">Map</a> A) =&gt; <a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A a m0) m)).<br/>
 
454
&nbsp;&nbsp;&nbsp;&nbsp;intro H. elim H. intro r. elim r. intros b m0 H0. intro. split with b. split with m0.<br/>
 
455
&nbsp;&nbsp;&nbsp;&nbsp;split. exact (<a href="Coq.IntMap.Mapiter.html#MapSweep_semantics_2">MapSweep_semantics_2</a> _ _ _ _ _ H0).<br/>
 
456
&nbsp;&nbsp;&nbsp;&nbsp;exact (<a href="Coq.IntMap.Mapiter.html#MapSweep_semantics_1">MapSweep_semantics_1</a> _ _ _ _ _ H0).<br/>
 
457
&nbsp;&nbsp;&nbsp;&nbsp;intro H. rewrite H. intro. discriminate H0.<br/>
 
458
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
459
 
 
460
<br/>
 
461
&nbsp;&nbsp;<code class="keyword">Lemma</code> <a name="in_dom_DMerge_3"></a>in_dom_DMerge_3 :<br/>
 
462
&nbsp;&nbsp;&nbsp;forall (m:<a href="Coq.IntMap.Map.html#Map">Map</a> (<a href="Coq.IntMap.Map.html#Map">Map</a> A)) (a b:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (m0:<a href="Coq.IntMap.Map.html#Map">Map</a> A),<br/>
 
463
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Map.html#MapGet">MapGet</a> _ m a = <a href="Coq.IntMap.Map.html#SOME">SOME</a> _ m0 -&gt;<br/>
 
464
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A b m0 = <a href="Coq.Init.Datatypes.html#true">true</a> -&gt; <a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A b (<a href="Coq.IntMap.Mapfold.html#DMerge">DMerge</a> m) = <a href="Coq.Init.Datatypes.html#true">true</a>.<br/>
 
465
&nbsp;&nbsp;<code class="keyword">Proof</code>.<br/>
 
466
&nbsp;&nbsp;&nbsp;&nbsp;intros m a b m0 H H0. rewrite <a href="Coq.IntMap.Mapfold.html#in_dom_DMerge_1">in_dom_DMerge_1</a>.<br/>
 
467
&nbsp;&nbsp;&nbsp;&nbsp;elim<br/>
 
468
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<a href="Coq.IntMap.Mapiter.html#MapSweep_semantics_4">MapSweep_semantics_4</a> _ (fun (_:<a href="Coq.IntMap.Addr.html#ad">ad</a>) (m'0:<a href="Coq.IntMap.Map.html#Map">Map</a> A) =&gt; <a href="Coq.IntMap.Fset.html#in_dom">in_dom</a> A b m'0) _ _ _<br/>
 
469
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H H0).<br/>
 
470
&nbsp;&nbsp;&nbsp;&nbsp;intros a' H1. elim H1. intros m'0 H2. rewrite H2. reflexivity.<br/>
 
471
&nbsp;&nbsp;<code class="keyword">Qed</code>.<br/>
 
472
 
 
473
<br/>
 
474
<code class="keyword">End</code> DMergeDef.</code>
 
475
<hr/><a href="index.html">Index</a><hr/><font size="-1">This page has been generated by <a href="http://www.lri.fr/~filliatr/coqdoc/">coqdoc</a></font>
 
476
</body>
 
477
</html>
 
 
b'\\ No newline at end of file'