Map make filter Map find? none
Cedar.Thm.map_make_filterMap_find?_none
Plain-language statement
Similar to above but for the none case
Exact Lean statement
theorem map_make_filterMap_find?_none
[LT α] [DecidableLT α] [StrictLT α] [DecidableEq α]
[DecidableEq γ] [LT γ] [DecidableLT γ] [StrictLT γ]
{m : Map α β}
{k : α} {k' : γ}
{f : α × β → Option (γ × κ)}
(hfind : m.find? k = .none)
(hf : ∀ kv, (∃ v'', f kv = .some (k', v'')) → kv.1 = k) :
(Map.make (m.toList.filterMap f)).find? k' = .noneFormal artifact
Lean source
theorem map_make_filterMap_find?_none [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] [DecidableEq γ] [LT γ] [DecidableLT γ] [StrictLT γ] {m : Map α β} {k : α} {k' : γ} {f : α × β → Option (γ × κ)} (hfind : m.find? k = .none) (hf : ∀ kv, (∃ v'', f kv = .some (k', v'')) → kv.1 = k) : (Map.make (m.toList.filterMap f)).find? k' = .none:= by apply Map.all_absent_find?_none intros v hmem_k'_v have := Map.mem_make_mem_list hmem_k'_v have ⟨(k'', v''), hmem_kv, hfkv⟩ := List.mem_filterMap.mp this have heq_k'' := hf (k'', v'') simp only [ hfkv, Option.some.injEq, Prod.mk.injEq, true_and, exists_eq', forall_const, ] at heq_k'' have := Map.in_list_implies_contains hmem_kv have := Map.contains_iff_some_find?.mp this simp [heq_k'', hfind] at this- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/Term/UDF.lean:65-87
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Find? ext
Cedar.Data.Map.find?_ext
Plain-language statement
Two well-formed maps are equal if they have the same find? for every key.
Source project: Cedar Specification
Person-level attribution pending.
Find? notmem keys
Cedar.Data.Map.find?_notmem_keys
Plain-language statement
Inverse of find?_mem_toList, except that this requires wf
Source project: Cedar Specification
Person-level attribution pending.
Find? some iff in values
Cedar.Data.Map.find?_some_iff_in_values
Plain-language statement
The mp direction of this does not need the wf precondition and, in fact, is available separately as find?_some_implies_in_values above
Source project: Cedar Specification
Person-level attribution pending.