Zulip Chat Archive

Stream: Is there code for X?

Topic: union distributes over nonempty bUnion


Rémi Bottinelli (Feb 14 2023 at 13:40):

Hey, I'm looking for this:

example {α β : Type*} (s : set α) (S : set β) (hS : S.nonempty) (f : β  set α) :
  s  ( t  S, f t) =  t  S, s  (f t) := by library_search [hS]

What's the cleanest way to get it? Thanks!

Eric Wieser (Feb 14 2023 at 13:47):

lemma set.union_bUnion {α β : Type*} (s : set α) (S : set β) (hS : S.nonempty) (f : β  set α) :
  s  ( t  S, f t) =  t  S, s  (f t) :=
begin
  letI := hS.coe_sort,
  simpa only [set.Union_coe_set, subtype.coe_mk] using set.union_Union s (λ x : S, f x),
end

Rémi Bottinelli (Feb 14 2023 at 13:57):

Thanks, I hadn't found union_Union! Would union_bUnion belong in data.set.lattice ?


Last updated: Dec 20 2023 at 11:08 UTC