English
The sigma-keys lookup identity equates the sigma-encoded keys with the entries.
Русский
Идентичность sigma-ключей lookup совпадает с записями.
LaTeX
$$$$ \mathrm{keys}.\sigma (\lambda i . (\mathrm{lookup}\ i\ s).toFinset) = \langle s.\mathrm{entries}, s.\mathrm{nodup\_entries} \rangle $$$$
Lean4
@[simp]
theorem sigma_keys_lookup (s : Finmap β) :
s.keys.sigma (fun i => (s.lookup i).toFinset) = ⟨s.entries, s.nodup_entries⟩ :=
by
ext x
have : x ∈ s.entries → x.1 ∈ s.keys := Multiset.mem_map_of_mem _
simpa [lookup_eq_some_iff]