File: Mathlib/Data/Finmap.lean

full_name: Multiset.keys
code: /-- Multiset of keys of an association multiset. -/
def keys (s : Multiset (Sigma β)) : Multiset α 
goal: Multiset α

full_name: Multiset.coe_keys
code: @[simp]
theorem coe_keys {l : List (Sigma β)} : keys (l : Multiset (Sigma β)) = (l.keys : Multiset α) 
goal: (↑l).keys = ↑l.keys

full_name: Multiset.NodupKeys
code: /-- `NodupKeys s` means that `s` has no duplicate keys. -/
def NodupKeys (s : Multiset (Sigma β)) : Prop 
goal: Prop

full_name: Multiset.coe_nodupKeys
code: @[simp]
theorem coe_nodupKeys {l : List (Sigma β)} : @NodupKeys α β l ↔ l.NodupKeys 
goal: (↑l).NodupKeys ↔ l.NodupKeys

full_name: Multiset.nodup_keys
code: lemma nodup_keys {m : Multiset (Σ a, β a)} : m.keys.Nodup ↔ m.NodupKeys 
goal: m.keys.Nodup ↔ m.NodupKeys

full_name: Multiset.NodupKeys.nodup
code: protected lemma NodupKeys.nodup {m : Multiset (Σ a, β a)} (h : m.NodupKeys) : m.Nodup 
goal: m.Nodup

full_name: Finmap.nodupKeys
code: /-- `Finmap β` is the type of finite maps over a multiset. It is effectively
  a quotient of `AList β` by permutation of the underlying list. -/
structure Finmap (β : α → Type v) : Type max u v where
  /-- The underlying `Multiset` of a `Finmap` -/
  entries : Multiset (Sigma β)
  /-- There are no duplicate keys in `entries` -/
  nodupKeys : entries.NodupKeys
goal: self.entries.NodupKeys

full_name: Finmap.entries
code: /-- `Finmap β` is the type of finite maps over a multiset. It is effectively
  a quotient of `AList β` by permutation of the underlying list. -/
structure Finmap (β : α → Type v) : Type max u v where
  /-- The underlying `Multiset` of a `Finmap` -/
  entries : Multiset (Sigma β)
  /-- There are no duplicate keys in `entries` -/
  nodupKeys : entries.NodupKeys
goal: Multiset (Sigma β)

full_name: Finmap
code: /-- `Finmap β` is the type of finite maps over a multiset. It is effectively
  a quotient of `AList β` by permutation of the underlying list. -/
structure Finmap (β : α → Type v) : Type max u v where
  /-- The underlying `Multiset` of a `Finmap` -/
  entries : Multiset (Sigma β)
  /-- There are no duplicate keys in `entries` -/
  nodupKeys : entries.NodupKeys
goal: Type (max u v)

full_name: AList.toFinmap
code: /-- The quotient map from `AList` to `Finmap`. -/
def AList.toFinmap (s : AList β) : Finmap β 
goal: Finmap β

full_name: «_aux_Mathlib_Data_Finmap___macroRules_term⟦_⟧_1»
code: local notation:arg "⟦" a "⟧" => AList.toFinmap a
goal: Lean.Macro

full_name: _aux_Mathlib_Data_Finmap___unexpand_AList_toFinmap_1
code: local notation:arg "⟦" a "⟧" => AList.toFinmap a
goal: Lean.PrettyPrinter.Unexpander

full_name: AList.toFinmap_eq
code: theorem AList.toFinmap_eq {s₁ s₂ : AList β} :
    toFinmap s₁ = toFinmap s₂ ↔ s₁.entries ~ s₂.entries 
goal: ⟦s₁⟧ = ⟦s₂⟧ ↔ s₁.entries ~ s₂.entries

full_name: AList.toFinmap_entries
code: @[simp]
theorem AList.toFinmap_entries (s : AList β) : ⟦s⟧.entries = s.entries 
goal: ⟦s⟧.entries = ↑s.entries

full_name: List.toFinmap
code: /-- Given `l : List (Sigma β)`, create a term of type `Finmap β` by removing
entries with duplicate keys. -/
def List.toFinmap [DecidableEq α] (s : List (Sigma β)) : Finmap β 
goal: Finmap β

full_name: Finmap.nodup_entries
code: lemma nodup_entries (f : Finmap β) : f.entries.Nodup 
goal: f.entries.Nodup

full_name: Finmap.liftOn
code: /-- Lift a permutation-respecting function on `AList` to `Finmap`. -/
-- @[elab_as_elim] Porting note: we can't add `elab_as_elim` attr in this type
def liftOn {γ} (s : Finmap β) (f : AList β → γ)
    (H : ∀ a b : AList β, a.entries ~ b.entries → f a = f b) : γ 
goal: γ

full_name: Finmap.liftOn_toFinmap
code: @[simp]
theorem liftOn_toFinmap {γ} (s : AList β) (f : AList β → γ) (H) : liftOn ⟦s⟧ f H = f s 
goal: ⟦s⟧.liftOn f H = f s

full_name: Finmap.liftOn₂
code: /-- Lift a permutation-respecting function on 2 `AList`s to 2 `Finmap`s. -/
-- @[elab_as_elim] Porting note: we can't add `elab_as_elim` attr in this type
def liftOn₂ {γ} (s₁ s₂ : Finmap β) (f : AList β → AList β → γ)
    (H : ∀ a₁ b₁ a₂ b₂ : AList β,
      a₁.entries ~ a₂.entries → b₁.entries ~ b₂.entries → f a₁ b₁ = f a₂ b₂) : γ 
goal: γ

full_name: Finmap.liftOn₂_toFinmap
code: @[simp]
theorem liftOn₂_toFinmap {γ} (s₁ s₂ : AList β) (f : AList β → AList β → γ) (H) :
    liftOn₂ ⟦s₁⟧ ⟦s₂⟧ f H = f s₁ s₂ 
goal: ⟦s₁⟧.liftOn₂ ⟦s₂⟧ f H = f s₁ s₂

full_name: Finmap.induction_on
code: @[elab_as_elim]
theorem induction_on {C : Finmap β → Prop} (s : Finmap β) (H : ∀ a : AList β, C ⟦a⟧) : C s 
goal: C s

full_name: Finmap.induction_on₂
code: @[elab_as_elim]
theorem induction_on₂ {C : Finmap β → Finmap β → Prop} (s₁ s₂ : Finmap β)
    (H : ∀ a₁ a₂ : AList β, C ⟦a₁⟧ ⟦a₂⟧) : C s₁ s₂ 
goal: C s₁ s₂

full_name: Finmap.induction_on₃
code: @[elab_as_elim]
theorem induction_on₃ {C : Finmap β → Finmap β → Finmap β → Prop} (s₁ s₂ s₃ : Finmap β)
    (H : ∀ a₁ a₂ a₃ : AList β, C ⟦a₁⟧ ⟦a₂⟧ ⟦a₃⟧) : C s₁ s₂ s₃ 
goal: C s₁ s₂ s₃

full_name: Finmap.ext
code: @[ext]
theorem ext : ∀ {s t : Finmap β}, s.entries = t.entries → s = t
  
goal: s.entries = t.entries → s = t

full_name: Finmap.ext_iff
code: protected theorem ext_iff {s t : Finmap β} : s = t ↔ s.entries = t.entries 
goal: s = t ↔ s.entries = t.entries

full_name: Finmap.ext_iff'
code: @[simp]
theorem ext_iff' {s t : Finmap β} : s.entries = t.entries ↔ s = t 
goal: s.entries = t.entries ↔ s = t

full_name: Finmap.instMembership
code: /-- The predicate `a ∈ s` means that `s` has a value associated to the key `a`. -/
instance : Membership α (Finmap β) 
goal: Membership α (Finmap β)

full_name: Finmap.mem_def
code: theorem mem_def {a : α} {s : Finmap β} : a ∈ s ↔ a ∈ s.entries.keys 
goal: a ∈ s ↔ a ∈ s.entries.keys

full_name: Finmap.mem_toFinmap
code: @[simp]
theorem mem_toFinmap {a : α} {s : AList β} : a ∈ toFinmap s ↔ a ∈ s 
goal: a ∈ ⟦s⟧ ↔ a ∈ s

full_name: Finmap.keys
code: /-- The set of keys of a finite map. -/
def keys (s : Finmap β) : Finset α 
goal: Finset α

full_name: Finmap.keys_val
code: @[simp]
theorem keys_val (s : AList β) : (keys ⟦s⟧).val = s.keys 
goal: ⟦s⟧.keys.val = ↑s.keys

full_name: Finmap.keys_ext
code: @[simp]
theorem keys_ext {s₁ s₂ : AList β} : keys ⟦s₁⟧ = keys ⟦s₂⟧ ↔ s₁.keys ~ s₂.keys 
goal: ⟦s₁⟧.keys = ⟦s₂⟧.keys ↔ s₁.keys ~ s₂.keys

full_name: Finmap.mem_keys
code: theorem mem_keys {a : α} {s : Finmap β} : a ∈ s.keys ↔ a ∈ s 
goal: a ∈ s.keys ↔ a ∈ s

full_name: Finmap.instEmptyCollection
code: /-- The empty map. -/
instance : EmptyCollection (Finmap β) 
goal: EmptyCollection (Finmap β)

full_name: Finmap.instInhabited
code: instance : Inhabited (Finmap β) 
goal: Inhabited (Finmap β)

full_name: Finmap.empty_toFinmap
code: @[simp]
theorem empty_toFinmap : (⟦∅⟧ : Finmap β) = ∅ 
goal: ⟦∅⟧ = ∅

full_name: Finmap.toFinmap_nil
code: @[simp]
theorem toFinmap_nil [DecidableEq α] : ([].toFinmap : Finmap β) = ∅ 
goal: [].toFinmap = ∅

full_name: Finmap.not_mem_empty
code: theorem not_mem_empty {a : α} : a ∉ (∅ : Finmap β) 
goal: a ∉ ∅

full_name: Finmap.keys_empty
code: @[simp]
theorem keys_empty : (∅ : Finmap β).keys = ∅ 
goal: ∅.keys = ∅

full_name: Finmap.singleton
code: /-- The singleton map. -/
def singleton (a : α) (b : β a) : Finmap β 
goal: Finmap β

full_name: Finmap.keys_singleton
code: @[simp]
theorem keys_singleton (a : α) (b : β a) : (singleton a b).keys = {a} 
goal: (Finmap.singleton a b).keys = {a}

full_name: Finmap.mem_singleton
code: @[simp]
theorem mem_singleton (x y : α) (b : β y) : x ∈ singleton y b ↔ x = y 
goal: x ∈ Finmap.singleton y b ↔ x = y

full_name: Finmap.decidableEq
code: instance decidableEq [∀ a, DecidableEq (β a)] : DecidableEq (Finmap β)
  
goal: DecidableEq (Finmap β)

full_name: Finmap.lookup
code: /-- Look up the value associated to a key in a map. -/
def lookup (a : α) (s : Finmap β) : Option (β a) 
goal: Option (β a)

full_name: Finmap.lookup_toFinmap
code: @[simp]
theorem lookup_toFinmap (a : α) (s : AList β) : lookup a ⟦s⟧ = s.lookup a 
goal: Finmap.lookup a ⟦s⟧ = AList.lookup a s

full_name: Finmap.dlookup_list_toFinmap
code: @[simp]
theorem dlookup_list_toFinmap (a : α) (s : List (Sigma β)) : lookup a s.toFinmap = s.dlookup a 
goal: Finmap.lookup a s.toFinmap = List.dlookup a s

full_name: Finmap.lookup_empty
code: @[simp]
theorem lookup_empty (a) : lookup a (∅ : Finmap β) = none 
goal: Finmap.lookup a ∅ = none

full_name: Finmap.lookup_isSome
code: theorem lookup_isSome {a : α} {s : Finmap β} : (s.lookup a).isSome ↔ a ∈ s 
goal: (Finmap.lookup a s).isSome = true ↔ a ∈ s

full_name: Finmap.lookup_eq_none
code: theorem lookup_eq_none {a} {s : Finmap β} : lookup a s = none ↔ a ∉ s 
goal: Finmap.lookup a s = none ↔ a ∉ s

full_name: Finmap.mem_lookup_iff
code: lemma mem_lookup_iff {s : Finmap β} {a : α} {b : β a} :
    b ∈ s.lookup a ↔ Sigma.mk a b ∈ s.entries 
goal: b ∈ Finmap.lookup a s ↔ ⟨a, b⟩ ∈ s.entries

full_name: Finmap.lookup_eq_some_iff
code: lemma lookup_eq_some_iff {s : Finmap β} {a : α} {b : β a} :
    s.lookup a = b ↔ Sigma.mk a b ∈ s.entries 
goal: Finmap.lookup a s = some b ↔ ⟨a, b⟩ ∈ s.entries

full_name: Finmap.sigma_keys_lookup
code: @[simp] lemma sigma_keys_lookup (s : Finmap β) :
    s.keys.sigma (fun i => (s.lookup i).toFinset) = ⟨s.entries, s.nodup_entries⟩ 
goal: (s.keys.sigma fun i => (Finmap.lookup i s).toFinset) = { val := s.entries, nodup := ⋯ }

full_name: Finmap.lookup_singleton_eq
code: @[simp]
theorem lookup_singleton_eq {a : α} {b : β a} : (singleton a b).lookup a = some b 
goal: Finmap.lookup a (Finmap.singleton a b) = some b

full_name: Finmap.instDecidableMem
code: instance (a : α) (s : Finmap β) : Decidable (a ∈ s) 
goal: Decidable (a ∈ s)

full_name: Finmap.mem_iff
code: theorem mem_iff {a : α} {s : Finmap β} : a ∈ s ↔ ∃ b, s.lookup a = some b 
goal: a ∈ s ↔ ∃ b, Finmap.lookup a s = some b

full_name: Finmap.mem_of_lookup_eq_some
code: theorem mem_of_lookup_eq_some {a : α} {b : β a} {s : Finmap β} (h : s.lookup a = some b) : a ∈ s 
goal: a ∈ s

full_name: Finmap.ext_lookup
code: theorem ext_lookup {s₁ s₂ : Finmap β} : (∀ x, s₁.lookup x = s₂.lookup x) → s₁ = s₂ 
goal: (∀ (x : α), Finmap.lookup x s₁ = Finmap.lookup x s₂) → s₁ = s₂

full_name: Finmap.keysLookupEquiv_apply_coe_fst
code: /-- An equivalence between `Finmap β` and pairs `(keys : Finset α, lookup : ∀ a, Option (β a))` such
that `(lookup a).isSome ↔ a ∈ keys`. -/
@[simps apply_coe_fst apply_coe_snd]
def keysLookupEquiv :
    Finmap β ≃ { f : Finset α × (∀ a, Option (β a)) // ∀ i, (f.2 i).isSome ↔ i ∈ f.1 } 
goal: (↑(Finmap.keysLookupEquiv s)).1 = s.keys

full_name: Finmap.keysLookupEquiv
code: /-- An equivalence between `Finmap β` and pairs `(keys : Finset α, lookup : ∀ a, Option (β a))` such
that `(lookup a).isSome ↔ a ∈ keys`. -/
@[simps apply_coe_fst apply_coe_snd]
def keysLookupEquiv :
    Finmap β ≃ { f : Finset α × (∀ a, Option (β a)) // ∀ i, (f.2 i).isSome ↔ i ∈ f.1 } 
goal: Finmap β ≃ { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }

full_name: Finmap.keysLookupEquiv_apply_coe_snd
code: /-- An equivalence between `Finmap β` and pairs `(keys : Finset α, lookup : ∀ a, Option (β a))` such
that `(lookup a).isSome ↔ a ∈ keys`. -/
@[simps apply_coe_fst apply_coe_snd]
def keysLookupEquiv :
    Finmap β ≃ { f : Finset α × (∀ a, Option (β a)) // ∀ i, (f.2 i).isSome ↔ i ∈ f.1 } 
goal: (↑(Finmap.keysLookupEquiv s)).2 i = Finmap.lookup i s

full_name: Finmap.keysLookupEquiv_symm_apply_keys
code: @[simp] lemma keysLookupEquiv_symm_apply_keys :
    ∀ f : {f : Finset α × (∀ a, Option (β a)) // ∀ i, (f.2 i).isSome ↔ i ∈ f.1},
      (keysLookupEquiv.symm f).keys = f.1.1 
goal: (Finmap.keysLookupEquiv.symm f).keys = (↑f).1

full_name: Finmap.keysLookupEquiv_symm_apply_lookup
code: @[simp] lemma keysLookupEquiv_symm_apply_lookup :
    ∀ (f : {f : Finset α × (∀ a, Option (β a)) // ∀ i, (f.2 i).isSome ↔ i ∈ f.1}) a,
      (keysLookupEquiv.symm f).lookup a = f.1.2 a 
goal: Finmap.lookup a (Finmap.keysLookupEquiv.symm f) = (↑f).2 a

full_name: Finmap.replace
code: /-- Replace a key with a given value in a finite map.
  If the key is not present it does nothing. -/
def replace (a : α) (b : β a) (s : Finmap β) : Finmap β 
goal: Finmap β

full_name: Finmap.replace_toFinmap
code: @[simp]
theorem replace_toFinmap (a : α) (b : β a) (s : AList β) :
    replace a b ⟦s⟧ = (⟦s.replace a b⟧ : Finmap β) 
goal: Finmap.replace a b ⟦s⟧ = ⟦AList.replace a b s⟧

full_name: Finmap.keys_replace
code: @[simp]
theorem keys_replace (a : α) (b : β a) (s : Finmap β) : (replace a b s).keys = s.keys 
goal: (Finmap.replace a b s).keys = s.keys

full_name: Finmap.mem_replace
code: @[simp]
theorem mem_replace {a a' : α} {b : β a} {s : Finmap β} : a' ∈ replace a b s ↔ a' ∈ s 
goal: a' ∈ Finmap.replace a b s ↔ a' ∈ s

full_name: Finmap.foldl
code: /-- Fold a commutative function over the key-value pairs in the map -/
def foldl {δ : Type w} (f : δ → ∀ a, β a → δ)
    (H : ∀ d a₁ b₁ a₂ b₂, f (f d a₁ b₁) a₂ b₂ = f (f d a₂ b₂) a₁ b₁) (d : δ) (m : Finmap β) : δ 
goal: δ

full_name: Finmap.any
code: /-- `any f s` returns `true` iff there exists a value `v` in `s` such that `f v = true`. -/
def any (f : ∀ x, β x → Bool) (s : Finmap β) : Bool 
goal: Bool

full_name: Finmap.all
code: /-- `all f s` returns `true` iff `f v = true` for all values `v` in `s`. -/
def all (f : ∀ x, β x → Bool) (s : Finmap β) : Bool 
goal: Bool

full_name: Finmap.erase
code: /-- Erase a key from the map. If the key is not present it does nothing. -/
def erase (a : α) (s : Finmap β) : Finmap β 
goal: Finmap β

full_name: Finmap.erase_toFinmap
code: @[simp]
theorem erase_toFinmap (a : α) (s : AList β) : erase a ⟦s⟧ = AList.toFinmap (s.erase a) 
goal: Finmap.erase a ⟦s⟧ = ⟦AList.erase a s⟧

full_name: Finmap.keys_erase_toFinset
code: @[simp]
theorem keys_erase_toFinset (a : α) (s : AList β) : keys ⟦s.erase a⟧ = (keys ⟦s⟧).erase a 
goal: ⟦AList.erase a s⟧.keys = ⟦s⟧.keys.erase a

full_name: Finmap.keys_erase
code: @[simp]
theorem keys_erase (a : α) (s : Finmap β) : (erase a s).keys = s.keys.erase a 
goal: (Finmap.erase a s).keys = s.keys.erase a

full_name: Finmap.mem_erase
code: @[simp]
theorem mem_erase {a a' : α} {s : Finmap β} : a' ∈ erase a s ↔ a' ≠ a ∧ a' ∈ s 
goal: a' ∈ Finmap.erase a s ↔ a' ≠ a ∧ a' ∈ s

full_name: Finmap.not_mem_erase_self
code: theorem not_mem_erase_self {a : α} {s : Finmap β} : ¬a ∈ erase a s 
goal: a ∉ Finmap.erase a s

full_name: Finmap.lookup_erase
code: @[simp]
theorem lookup_erase (a) (s : Finmap β) : lookup a (erase a s) = none 
goal: Finmap.lookup a (Finmap.erase a s) = none

full_name: Finmap.lookup_erase_ne
code: @[simp]
theorem lookup_erase_ne {a a'} {s : Finmap β} (h : a ≠ a') : lookup a (erase a' s) = lookup a s 
goal: Finmap.lookup a (Finmap.erase a' s) = Finmap.lookup a s

full_name: Finmap.erase_erase
code: theorem erase_erase {a a' : α} {s : Finmap β} : erase a (erase a' s) = erase a' (erase a s) 
goal: Finmap.erase a (Finmap.erase a' s) = Finmap.erase a' (Finmap.erase a s)

full_name: Finmap.sdiff
code: /-- `sdiff s s'` consists of all key-value pairs from `s` and `s'` where the keys are in `s` or
`s'` but not both. -/
def sdiff (s s' : Finmap β) : Finmap β 
goal: Finmap β

full_name: Finmap.instSDiff
code: instance : SDiff (Finmap β) 
goal: SDiff (Finmap β)

full_name: Finmap.insert
code: /-- Insert a key-value pair into a finite map, replacing any existing pair with
  the same key. -/
def insert (a : α) (b : β a) (s : Finmap β) : Finmap β 
goal: Finmap β

full_name: Finmap.insert_toFinmap
code: @[simp]
theorem insert_toFinmap (a : α) (b : β a) (s : AList β) :
    insert a b (AList.toFinmap s) = AList.toFinmap (s.insert a b) 
goal: Finmap.insert a b ⟦s⟧ = ⟦AList.insert a b s⟧

full_name: Finmap.insert_entries_of_neg
code: theorem insert_entries_of_neg {a : α} {b : β a} {s : Finmap β} :
    a ∉ s → (insert a b s).entries = ⟨a, b⟩ ::ₘ s.entries 
goal: a ∉ s → (Finmap.insert a b s).entries = ⟨a, b⟩ ::ₘ s.entries

full_name: Finmap.mem_insert
code: @[simp]
theorem mem_insert {a a' : α} {b' : β a'} {s : Finmap β} : a ∈ insert a' b' s ↔ a = a' ∨ a ∈ s 
goal: a ∈ Finmap.insert a' b' s ↔ a = a' ∨ a ∈ s

full_name: Finmap.lookup_insert
code: @[simp]
theorem lookup_insert {a} {b : β a} (s : Finmap β) : lookup a (insert a b s) = some b 
goal: Finmap.lookup a (Finmap.insert a b s) = some b

full_name: Finmap.lookup_insert_of_ne
code: @[simp]
theorem lookup_insert_of_ne {a a'} {b : β a} (s : Finmap β) (h : a' ≠ a) :
    lookup a' (insert a b s) = lookup a' s 
goal: Finmap.lookup a' (Finmap.insert a b s) = Finmap.lookup a' s

full_name: Finmap.insert_insert
code: @[simp]
theorem insert_insert {a} {b b' : β a} (s : Finmap β) :
    (s.insert a b).insert a b' = s.insert a b' 
goal: Finmap.insert a b' (Finmap.insert a b s) = Finmap.insert a b' s

full_name: Finmap.insert_insert_of_ne
code: theorem insert_insert_of_ne {a a'} {b : β a} {b' : β a'} (s : Finmap β) (h : a ≠ a') :
    (s.insert a b).insert a' b' = (s.insert a' b').insert a b 
goal: Finmap.insert a' b' (Finmap.insert a b s) = Finmap.insert a b (Finmap.insert a' b' s)

full_name: Finmap.toFinmap_cons
code: theorem toFinmap_cons (a : α) (b : β a) (xs : List (Sigma β)) :
    List.toFinmap (⟨a, b⟩ :: xs) = insert a b xs.toFinmap 
goal: (⟨a, b⟩ :: xs).toFinmap = Finmap.insert a b xs.toFinmap

full_name: Finmap.mem_list_toFinmap
code: theorem mem_list_toFinmap (a : α) (xs : List (Sigma β)) :
    a ∈ xs.toFinmap ↔ ∃ b : β a, Sigma.mk a b ∈ xs 
goal: a ∈ xs.toFinmap ↔ ∃ b, ⟨a, b⟩ ∈ xs

full_name: Finmap.insert_singleton_eq
code: @[simp]
theorem insert_singleton_eq {a : α} {b b' : β a} : insert a b (singleton a b') = singleton a b 
goal: Finmap.insert a b (Finmap.singleton a b') = Finmap.singleton a b

full_name: Finmap.extract
code: /-- Erase a key from the map, and return the corresponding value, if found. -/
def extract (a : α) (s : Finmap β) : Option (β a) × Finmap β 
goal: Option (β a) × Finmap β

full_name: Finmap.extract_eq_lookup_erase
code: @[simp]
theorem extract_eq_lookup_erase (a : α) (s : Finmap β) : extract a s = (lookup a s, erase a s) 
goal: Finmap.extract a s = (Finmap.lookup a s, Finmap.erase a s)

full_name: Finmap.union
code: /-- `s₁ ∪ s₂` is the key-based union of two finite maps. It is left-biased: if
there exists an `a ∈ s₁`, `lookup a (s₁ ∪ s₂) = lookup a s₁`. -/
def union (s₁ s₂ : Finmap β) : Finmap β 
goal: Finmap β

full_name: Finmap.instUnion
code: instance : Union (Finmap β) 
goal: Union (Finmap β)

full_name: Finmap.mem_union
code: @[simp]
theorem mem_union {a} {s₁ s₂ : Finmap β} : a ∈ s₁ ∪ s₂ ↔ a ∈ s₁ ∨ a ∈ s₂ 
goal: a ∈ s₁ ∪ s₂ ↔ a ∈ s₁ ∨ a ∈ s₂

full_name: Finmap.union_toFinmap
code: @[simp]
theorem union_toFinmap (s₁ s₂ : AList β) : (toFinmap s₁) ∪ (toFinmap s₂) = toFinmap (s₁ ∪ s₂) 
goal: ⟦s₁⟧ ∪ ⟦s₂⟧ = ⟦s₁ ∪ s₂⟧

full_name: Finmap.keys_union
code: theorem keys_union {s₁ s₂ : Finmap β} : (s₁ ∪ s₂).keys = s₁.keys ∪ s₂.keys 
goal: (s₁ ∪ s₂).keys = s₁.keys ∪ s₂.keys

full_name: Finmap.lookup_union_left
code: @[simp]
theorem lookup_union_left {a} {s₁ s₂ : Finmap β} : a ∈ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₁ 
goal: a ∈ s₁ → Finmap.lookup a (s₁ ∪ s₂) = Finmap.lookup a s₁

full_name: Finmap.lookup_union_right
code: @[simp]
theorem lookup_union_right {a} {s₁ s₂ : Finmap β} : a ∉ s₁ → lookup a (s₁ ∪ s₂) = lookup a s₂ 
goal: a ∉ s₁ → Finmap.lookup a (s₁ ∪ s₂) = Finmap.lookup a s₂

full_name: Finmap.lookup_union_left_of_not_in
code: theorem lookup_union_left_of_not_in {a} {s₁ s₂ : Finmap β} (h : a ∉ s₂) :
    lookup a (s₁ ∪ s₂) = lookup a s₁ 
goal: Finmap.lookup a (s₁ ∪ s₂) = Finmap.lookup a s₁

full_name: Finmap.mem_lookup_union
code: theorem mem_lookup_union {a} {b : β a} {s₁ s₂ : Finmap β} :
    b ∈ lookup a (s₁ ∪ s₂) ↔ b ∈ lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ lookup a s₂ 
goal: b ∈ Finmap.lookup a (s₁ ∪ s₂) ↔ b ∈ Finmap.lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ Finmap.lookup a s₂

full_name: Finmap.mem_lookup_union_middle
code: theorem mem_lookup_union_middle {a} {b : β a} {s₁ s₂ s₃ : Finmap β} :
    b ∈ lookup a (s₁ ∪ s₃) → a ∉ s₂ → b ∈ lookup a (s₁ ∪ s₂ ∪ s₃) 
goal: b ∈ Finmap.lookup a (s₁ ∪ s₃) → a ∉ s₂ → b ∈ Finmap.lookup a (s₁ ∪ s₂ ∪ s₃)

full_name: Finmap.insert_union
code: theorem insert_union {a} {b : β a} {s₁ s₂ : Finmap β} : insert a b (s₁ ∪ s₂) = insert a b s₁ ∪ s₂ 
goal: Finmap.insert a b (s₁ ∪ s₂) = Finmap.insert a b s₁ ∪ s₂

full_name: Finmap.union_assoc
code: theorem union_assoc {s₁ s₂ s₃ : Finmap β} : s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃) 
goal: s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃)

full_name: Finmap.empty_union
code: @[simp]
theorem empty_union {s₁ : Finmap β} : ∅ ∪ s₁ = s₁ 
goal: ∅ ∪ s₁ = s₁

full_name: Finmap.union_empty
code: @[simp]
theorem union_empty {s₁ : Finmap β} : s₁ ∪ ∅ = s₁ 
goal: s₁ ∪ ∅ = s₁

full_name: Finmap.erase_union_singleton
code: theorem erase_union_singleton (a : α) (b : β a) (s : Finmap β) (h : s.lookup a = some b) :
    s.erase a ∪ singleton a b = s 
goal: Finmap.erase a s ∪ Finmap.singleton a b = s

full_name: Finmap.Disjoint
code: /-- `Disjoint s₁ s₂` holds if `s₁` and `s₂` have no keys in common. -/
def Disjoint (s₁ s₂ : Finmap β) : Prop 
goal: Prop

full_name: Finmap.disjoint_empty
code: theorem disjoint_empty (x : Finmap β) : Disjoint ∅ x 
goal: ∅.Disjoint x

full_name: Finmap.Disjoint.symm
code: @[symm]
theorem Disjoint.symm (x y : Finmap β) (h : Disjoint x y) : Disjoint y x 
goal: y.Disjoint x

full_name: Finmap.Disjoint.symm_iff
code: theorem Disjoint.symm_iff (x y : Finmap β) : Disjoint x y ↔ Disjoint y x 
goal: x.Disjoint y ↔ y.Disjoint x

full_name: Finmap.instDecidableRelDisjoint
code: instance : DecidableRel (@Disjoint α β) 
goal: DecidableRel Finmap.Disjoint

full_name: Finmap.disjoint_union_left
code: theorem disjoint_union_left (x y z : Finmap β) :
    Disjoint (x ∪ y) z ↔ Disjoint x z ∧ Disjoint y z 
goal: (x ∪ y).Disjoint z ↔ x.Disjoint z ∧ y.Disjoint z

full_name: Finmap.disjoint_union_right
code: theorem disjoint_union_right (x y z : Finmap β) :
    Disjoint x (y ∪ z) ↔ Disjoint x y ∧ Disjoint x z 
goal: x.Disjoint (y ∪ z) ↔ x.Disjoint y ∧ x.Disjoint z

full_name: Finmap.union_comm_of_disjoint
code: theorem union_comm_of_disjoint {s₁ s₂ : Finmap β} : Disjoint s₁ s₂ → s₁ ∪ s₂ = s₂ ∪ s₁ 
goal: s₁.Disjoint s₂ → s₁ ∪ s₂ = s₂ ∪ s₁

full_name: Finmap.union_cancel
code: theorem union_cancel {s₁ s₂ s₃ : Finmap β} (h : Disjoint s₁ s₃) (h' : Disjoint s₂ s₃) :
    s₁ ∪ s₃ = s₂ ∪ s₃ ↔ s₁ = s₂ 
goal: s₁ ∪ s₃ = s₂ ∪ s₃ ↔ s₁ = s₂