|
8 | 8 | prelude |
9 | 9 | import Std.Data.TreeMap.Lemmas |
10 | 10 | import Std.Data.DTreeMap.Lemmas |
| 11 | +public import Init.Data.Array.Perm |
11 | 12 | public import Std.Data.TreeSet.AdditionalOperations |
12 | 13 |
|
13 | 14 | @[expose] public section |
@@ -2386,17 +2387,27 @@ theorem empty_equiv_iff_isEmpty : empty ~m t ↔ t.isEmpty := |
2386 | 2387 | theorem equiv_iff_toList_perm : t₁ ~m t₂ ↔ t₁.toList.Perm t₂.toList := |
2387 | 2388 | equiv_iff_equiv.trans TreeMap.equiv_iff_keys_unit_perm |
2388 | 2389 |
|
| 2390 | +theorem equiv_iff_toArray_perm : t₁ ~m t₂ ↔ t₁.toArray.Perm t₂.toArray := |
| 2391 | + equiv_iff_equiv.trans TreeMap.equiv_iff_keysArray_unit_perm |
| 2392 | + |
2389 | 2393 | theorem equiv_iff_forall_mem_iff [TransCmp cmp] [LawfulEqCmp cmp] : |
2390 | 2394 | t₁ ~m t₂ ↔ (∀ k, k ∈ t₁ ↔ k ∈ t₂) := |
2391 | 2395 | ⟨fun h _ => h.mem_iff, Equiv.of_forall_mem_iff⟩ |
2392 | 2396 |
|
2393 | 2397 | theorem Equiv.of_toList_perm (h : t₁.toList.Perm t₂.toList) : t₁ ~m t₂ := |
2394 | 2398 | ⟨.of_keys_unit_perm h⟩ |
2395 | 2399 |
|
| 2400 | +theorem Equiv.of_toArray_perm (h : t₁.toArray.Perm t₂.toArray) : t₁ ~m t₂ := |
| 2401 | + ⟨.of_keysArray_unit_perm h⟩ |
| 2402 | + |
2396 | 2403 | theorem equiv_iff_toList_eq [TransCmp cmp] : |
2397 | 2404 | t₁ ~m t₂ ↔ t₁.toList = t₂.toList := |
2398 | 2405 | equiv_iff_equiv.trans TreeMap.equiv_iff_keys_unit_eq |
2399 | 2406 |
|
| 2407 | +theorem equiv_iff_toArray_eq [TransCmp cmp] : |
| 2408 | + t₁ ~m t₂ ↔ t₁.toArray = t₂.toArray := |
| 2409 | + equiv_iff_equiv.trans TreeMap.equiv_iff_keysArray_unit_eq |
| 2410 | + |
2400 | 2411 | theorem insertMany_list_equiv_foldl {l : List α} : |
2401 | 2412 | insertMany t₁ l ~m l.foldl (init := t₁) fun acc a => acc.insert a := by |
2402 | 2413 | constructor |
|
0 commit comments