instance
instDecidableRelProdLEByKey
{α : Type}
[LinearOrder α]
{β : Type u_1}
:
DecidableRel fun (a b : α × β) => LEByKey a b
Equations
- instDecidableRelProdLEByKey a b = if h : a.1 ≤ b.1 then isTrue h else isFalse h
Equations
- KeyValueList [] = True
- KeyValueList [hd'] = (KeyValueList [] ∧ True)
- KeyValueList (hd' :: hd'_1 :: tail_1) = (KeyValueList (hd'_1 :: tail_1) ∧ hd'.1 < hd'_1.1)
Instances For
def
List.addKV
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[Add β]
(l : List (α × β))
(a : α)
(b : β)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
KeyValueList.sorted
{α : Type}
[LinearOrder α]
{β : Type u_1}
(l : List (α × β))
(h : KeyValueList l)
:
theorem
KeyValueList.nodup
{α : Type}
[LinearOrder α]
{β : Type u_1}
(l : List (α × β))
(hl : KeyValueList l)
:
l.Nodup
theorem
KeyValueList.nodupkey
{α : Type}
[LinearOrder α]
{β : Type u_1}
(l : List (α × β))
(h : KeyValueList l)
:
List.Pairwise (fun (x1 x2 : α × β) => x1.1 ≠ x2.1) l
theorem
KeyValueList.functional
{α : Type}
[LinearOrder α]
{β : Type u_1}
(l : List (α × β))
(hl : KeyValueList l)
(x : α × β)
:
theorem
KeyValueList.eq_iff_forall_mem
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
(l₁ l₂ : List (α × β))
(h₁ : KeyValueList l₁)
(h₂ : KeyValueList l₂)
:
theorem
KeyValueList.erase
{α : Type}
[LinearOrder α]
{β : Type u_1}
(l : List (α × β))
(h : KeyValueList l)
(a : α)
:
KeyValueList (List.eraseP (fun (x : α × β) => decide (x.1 = a)) l)
theorem
KeyValueList.erase_find
{α : Type}
[LinearOrder α]
{β : Type u_1}
(l : List (α × β))
(h : KeyValueList l)
(a : α)
:
List.find? (fun (x : α × β) => decide (x.1 = a)) (List.eraseP (fun (x : α × β) => decide (x.1 = a)) l) = none
theorem
KeyValueList.orderedInsert
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
(l : List (α × β))
(h : KeyValueList l)
(a : α)
(b : β)
(hp : List.find? (fun (x : α × β) => decide (x.1 = a)) l = none)
:
KeyValueList (List.orderedInsert LEByKey (a, b) l)
theorem
KeyValueList.addKV
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[Add β]
(l : List (α × β))
(h : KeyValueList l)
(a : α)
(b : β)
:
KeyValueList (l.addKV a b)
theorem
KeyValueList.eraseP_eq_filter
{α : Type}
[LinearOrder α]
{β : Type u_1}
{l : List (α × β)}
(hl : KeyValueList l)
(a : α)
:
List.eraseP (fun (x : α × β) => decide (x.1 = a)) l = List.filter (fun (x : α × β) => decide (x.1 ≠ a)) l
theorem
KeyValueList.addKV_spec_not_key
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[Add β]
(l : List (α × β))
(hl : KeyValueList l)
(a : α)
(b : β)
(x : α × β)
:
theorem
KeyValueList.addKV_mem
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[Add β]
(l : List (α × β))
(h : KeyValueList l)
(a : α)
(b : β)
:
def
KeyValueList.addKVFold
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[Add β]
(ab : α × β)
(l : { l : List (α × β) // KeyValueList l })
:
Equations
- KeyValueList.addKVFold ab l = ⟨(↑l).addKV ab.1 ab.2, ⋯⟩
Instances For
theorem
KeyValueList.add_comm_internal
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[AddCommSemigroup β]
(l : List (α × β))
(hl : KeyValueList l)
(a₁ a₂ a : α)
(b₁ b₂ b : β)
:
instance
instLeftCommutativeProdSubtypeListKeyValueListAddKVFold
{α : Type}
[LinearOrder α]
{β : Type u_1}
[DecidableEq β]
[AddCommSemigroup β]
: