@@ -185,7 +185,7 @@ begin
185
185
exact ⟨list.nodup.ndnil, λ_, false.elim⟩,
186
186
simp[array.iterate_aux, list.map_append], exact
187
187
let ⟨nd, al⟩ := IH (le_of_lt h) in
188
- ⟨ list.nodup_append_of_nodup_of_nodup_of_disjoint nd (v.nodup _ _) $ λa m1 m2,
188
+ ⟨list.nodup_append nd (v.nodup _ _) $ λa m1 m2,
189
189
let ⟨⟨a', b⟩, m1, e1⟩ := list.exists_of_mem_map m1 in
190
190
let ⟨⟨a'', b'⟩, m2, e2⟩ := list.exists_of_mem_map m2 in
191
191
match a', a'', b, b', m1, m2, e1, e2 with ._, ._, b, b', m1, m2, rfl, rfl :=
@@ -319,14 +319,11 @@ section
319
319
have nd' : ((u ++ v2 ++ w).map sigma.fst).nodup, begin
320
320
rw [list.map_append, list.map_append] at nd,
321
321
rw [list.map_append, list.map_append],
322
- have ndu : (u.map sigma.fst).nodup := list.nodup_of_nodup_append_left (list.nodup_of_nodup_append_left nd),
323
- have ndv1 : (v1.map sigma.fst).nodup := list.nodup_of_nodup_append_right (list.nodup_of_nodup_append_left nd),
324
- have ndw : (w.map sigma.fst).nodup := list.nodup_of_nodup_append_right nd,
325
- have djuw : (u.map sigma.fst).disjoint (w.map sigma.fst) :=
326
- list.disjoint_of_disjoint_append_left_left (list.disjoint_of_nodup_append nd),
327
- exact list.nodup_append_of_nodup_of_nodup_of_disjoint
328
- (list.nodup_append_of_nodup_of_nodup_of_disjoint ndu hvnd djuv)
329
- ndw (list.disjoint_append_of_disjoint_left djuw djwv.comm)
322
+ have ndu := list.nodup_of_nodup_append_left (list.nodup_of_nodup_append_left nd),
323
+ have ndw := list.nodup_of_nodup_append_right nd,
324
+ have djuw := list.disjoint_of_disjoint_append_left_left (list.disjoint_of_nodup_append nd),
325
+ exact list.nodup_append (list.nodup_append ndu hvnd djuv)
326
+ ndw (list.disjoint_append_of_disjoint_left djuw djwv.symm)
330
327
end ,
331
328
begin
332
329
rw [e, calc s + (u ++ v1 ++ w).length + v2.length - v1.length
@@ -495,7 +492,7 @@ theorem not_contains_empty (hash_fn : α → nat) (n a) :
495
492
¬ (@mk_hash_map α _ β hash_fn n).contains a :=
496
493
by apply bool_iff_false.2 ; dsimp [contains]; rw [find_empty]; refl
497
494
498
- theorem insert_theorem (hash_fn : α → nat) {n n'}
495
+ theorem insert_lemma (hash_fn : α → nat) {n n'}
499
496
{bkts : bucket_array α β n} {sz} (v : valid hash_fn bkts sz) :
500
497
valid hash_fn (bkts.foldl (mk_array _ [] : bucket_array α β n') (reinsert_aux hash_fn)) sz :=
501
498
suffices ∀ (l : list Σ a, β a),
520
517
apply IH _ _ v',
521
518
simp,
522
519
have nd' := list.nodup_of_nodup_cons nd,
523
- apply list.nodup_append_of_nodup_of_nodup_of_disjoint
520
+ apply list.nodup_append
524
521
(list.nodup_of_nodup_append_left nd')
525
522
(v'.as_list_nodup _),
526
523
exact λa m1 m2,
@@ -568,7 +565,7 @@ let n' : ℕ+ := ⟨n.1 * 2, mul_pos n.2 dec_trivial⟩,
568
565
size := size',
569
566
nbuckets := n',
570
567
buckets := buckets'',
571
- is_valid := insert_theorem _ valid' }
568
+ is_valid := insert_lemma _ valid' }
572
569
573
570
theorem mem_insert : Π (m : hash_map α β) (a b a' b'),
574
571
sigma.mk a' b' ∈ (m.insert a b).entries ↔
@@ -701,7 +698,7 @@ match (by apply_instance : decidable (contains_aux a bkt)) with
701
698
append_of_modify u' [⟨a, b⟩] [] _ hl' hfl', v.as_list_nodup _ with
702
699
| ._, ._, ⟨u, w, rfl, rfl⟩, nd' := by simp; simp at nd'; exact
703
700
⟨λhm, ⟨λe, match a', e, b', hm with ._, rfl, b', hm := by {
704
- rw [← list.mem_append_iff ] at hm;
701
+ rw [← list.mem_append ] at hm;
705
702
have hm := list.mem_map sigma.fst hm;
706
703
rw list.map_append at hm;
707
704
exact list.not_mem_of_nodup_cons (list.nodup_head nd') hm }
0 commit comments