All proofs
Project-declaredLean 4.31.0 · null

Map Union union map Union

List.mapUnion_union_mapUnion'

Plain-language statement

mapUnion_union_mapUnion applies when you have the same function f and different input lists. mapUnion_union_mapUnion' applies when you have different functions f/g and the same input list.

Exact Lean statement

public theorem mapUnion_union_mapUnion' {α β} [LT α] [StrictLT α] [DecidableLT α] {f g : β → Set α} {xs : List β} :
  (∀ x ∈ xs, (f x).WellFormed ∧ (g x).WellFormed) →
  List.mapUnion f xs ∪ List.mapUnion g xs = List.mapUnion (λ x => f x ∪ g x) xs

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
public theorem mapUnion_union_mapUnion' {α β} [LT α] [StrictLT α] [DecidableLT α] {f g : β  Set α} {xs : List β} :  ( x  xs, (f x).WellFormed  (g x).WellFormed)   List.mapUnion f xs ∪ List.mapUnion g xs = List.mapUnion (λ x => f x ∪ g x) xs:= by  cases xs  case nil => simp [mapUnion, EmptyCollection.emptyCollection, Set.union_empty_left Set.empty_wf]  case cons hd tl =>    intro wf    simp only [mem_cons, forall_eq_or_imp] at wf    replace ⟨⟨fwf, gwf, tlwf := wf ; clear wf    rw [mapUnion_cons, mapUnion_cons, mapUnion_cons]    · have ih := mapUnion_union_mapUnion' tlwf      rw [Set.union_assoc]      conv => lhs ; rhs ; rw [ Set.union_assoc] ; lhs ; rw [Set.union_comm]      conv => lhs ; rhs ; rw [Set.union_assoc, ih]      simp [Set.union_assoc]    · intro b hb ; cases hb      · exact Set.union_wf _ _      · exact Set.union_wf _ _    · intro b hb ; cases hb      case head => exact gwf      case tail htl => exact (tlwf b htl).right    · intro b hb ; cases hb      case head => exact fwf      case tail htl => exact (tlwf b htl).left
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/Data/MapUnion.lean:270-294

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