All proofs
Project-declaredLean 4.31.0 · null

Map MOn Values some wf alt proof

Cedar.Data.Map.mapMOnValues_some_wf_alt_proof

Plain-language statement

Alternate proof of mapMOnValues_some_wf, that relies on List.mapM_some_eq_filterMap instead of mapMOnValues_preserves_keys. Which do we prefer?

Exact Lean statement

theorem mapMOnValues_some_wf_alt_proof [LT α] [DecidableLT α] [StrictLT α] {f : β → Option γ} {m₁ : Map α β} {m₂ : Map α γ} :
  m₁.WellFormed →
  (m₁.mapMOnValues f = some m₂) →
  m₂.WellFormed

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem mapMOnValues_some_wf_alt_proof [LT α] [DecidableLT α] [StrictLT α] {f : β  Option γ} {m₁ : Map α β} {m₂ : Map α γ} :  m₁.WellFormed   (m₁.mapMOnValues f = some m₂)   m₂.WellFormed:= by  simp only [wf_iff_sorted, toList]  intro wf h₁  simp only [mapMOnValues, Option.pure_def, do_some] at h₁  replace xs, h₁, h₂ := h₁  subst h₂  simp only  replace h₁ := List.mapM_some_eq_filterMap h₁  subst h₁  apply List.filterMap_sortedBy _ wf  intro (k, v) (k', v') h₁  simp only at *  cases h₂ : f v <;> simp [h₂] at h₁  exact h₁.left
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/Data/Map.lean:1150-1167

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

Project-declaredLean 4.31.0

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.

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Find? notmem keys

Cedar.Data.Map.find?_notmem_keys

Plain-language statement

Inverse of find?_mem_toList, except that this requires wf

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

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

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record