Multisets of sigma types #
theorem
Multiset.NodupKeys.nodup_keys
{α : Type u}
{β : α → Type v}
{m : Multiset ((a : α) × β a)}
:
Alias of the reverse direction of Multiset.nodup_keys.
Finmap #
Lifting from AList #
Induction #
extensionality #
mem #
@[implicit_reducible]
The predicate a ∈ s means that s has a value associated to the key a.
keys #
empty #
@[implicit_reducible]
The empty map.
@[simp]
singleton #
The singleton map.
Instances For
@[implicit_reducible]
instance
Finmap.decidableEq
{α : Type u}
{β : α → Type v}
[DecidableEq α]
[(a : α) → DecidableEq (β a)]
:
DecidableEq (Finmap β)
lookup #
def
Finmap.lookup
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : Finmap β)
:
Option (β a)
Look up the value associated to a key in a map.
Instances For
@[simp]
theorem
Finmap.lookup_toFinmap
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : AList β)
:
@[simp]
theorem
Finmap.dlookup_list_toFinmap
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : List (Sigma β))
:
@[simp]
theorem
Finmap.lookup_eq_none
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s : Finmap β}
:
@[simp]
theorem
Finmap.lookup_singleton_eq
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
:
@[implicit_reducible]
instance
Finmap.instDecidableMem
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : Finmap β)
:
theorem
Finmap.mem_of_lookup_eq_some
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s : Finmap β}
(h : lookup a s = some b)
:
An equivalence between Finmap β and pairs (keys : Finset α, lookup : ∀ a, Option (β a)) such
that (lookup a).isSome ↔ a ∈ keys.
Instances For
@[simp]
theorem
Finmap.keysLookupEquiv_apply_coe_snd
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(s : Finmap β)
(i : α)
:
@[simp]
theorem
Finmap.keysLookupEquiv_apply_coe_fst
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(s : Finmap β)
:
replace #
def
Finmap.replace
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
(s : Finmap β)
:
Finmap β
Replace a key with a given value in a finite map. If the key is not present it does nothing.
Instances For
@[simp]
theorem
Finmap.replace_toFinmap
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
(s : AList β)
:
@[simp]
theorem
Finmap.keys_replace
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
(s : Finmap β)
:
@[simp]
theorem
Finmap.mem_replace
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{b : β a}
{s : Finmap β}
:
foldl #
erase #
Erase a key from the map. If the key is not present it does nothing.
Instances For
@[simp]
@[simp]
theorem
Finmap.keys_erase_toFinset
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : AList β)
:
theorem
Finmap.notMem_erase_self
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s : Finmap β}
:
a ∉ erase a s
@[simp]
sdiff #
sdiff s s' consists of all key-value pairs from s and s' where the keys are in s or
s' but not both.
Instances For
@[implicit_reducible]
insert #
def
Finmap.insert
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
(s : Finmap β)
:
Finmap β
Insert a key-value pair into a finite map, replacing any existing pair with the same key.
Instances For
@[simp]
theorem
Finmap.insert_toFinmap
{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
(s : AList β)
:
@[simp]
theorem
Finmap.lookup_insert
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
(s : Finmap β)
:
@[simp]
theorem
Finmap.insert_insert
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b b' : β a}
(s : Finmap β)
:
@[simp]
theorem
Finmap.insert_singleton_eq
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b b' : β a}
:
extract #
Erase a key from the map, and return the corresponding value, if found.
Instances For
union #
@[implicit_reducible]
@[simp]
theorem
Finmap.lookup_union_right
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finmap β}
:
theorem
Finmap.lookup_union_left_of_not_in
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finmap β}
(h : a ∉ s₂)
:
@[simp]
@[simp]
Disjoint #
@[implicit_reducible]
theorem
Finmap.union_comm_of_disjoint
{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s₁ s₂ : Finmap β}
: