Image of a finset α
under a partially defined function #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
In this file we define part.to_finset
and finset.pimage
. We also prove some trivial lemmas about
these definitions.
Tags #
finite set, image, partial function
@[simp, norm_cast]
theorem
finset.coe_pimage
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
{f : α →. β}
[Π (x : α), decidable (f x).dom]
{s : finset α} :
↑(finset.pimage f s) = f.image ↑s
@[simp]
theorem
finset.pimage_some
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
(s : finset α)
(f : α → β)
[Π (x : α), decidable (part.some (f x)).dom] :
finset.pimage (λ (x : α), part.some (f x)) s = finset.image f s
theorem
finset.pimage_eq_image_filter
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
{f : α →. β}
[Π (x : α), decidable (f x).dom]
{s : finset α} :
finset.pimage f s = finset.image (λ (x : {x // x ∈ finset.filter (λ (x : α), (f x).dom) s}), (f ↑x).get _) (finset.filter (λ (x : α), (f x).dom) s).attach
Rewrite s.pimage f
in terms of finset.filter
, finset.attach
, and finset.image
.
theorem
finset.pimage_union
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
{f : α →. β}
[Π (x : α), decidable (f x).dom]
{s t : finset α}
[decidable_eq α] :
finset.pimage f (s ∪ t) = finset.pimage f s ∪ finset.pimage f t
@[simp]
theorem
finset.pimage_empty
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
{f : α →. β}
[Π (x : α), decidable (f x).dom] :
finset.pimage f ∅ = ∅
theorem
finset.pimage_mono
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
{f : α →. β}
[Π (x : α), decidable (f x).dom]
{s t : finset α}
(h : s ⊆ t) :
finset.pimage f s ⊆ finset.pimage f t
theorem
finset.pimage_inter
{α : Type u_1}
{β : Type u_2}
[decidable_eq β]
{f : α →. β}
[Π (x : α), decidable (f x).dom]
{s t : finset α}
[decidable_eq α] :
finset.pimage f (s ∩ t) ⊆ finset.pimage f s ∩ finset.pimage f t