@@ -1861,6 +1861,11 @@ lemma mem_map' (f : α ↪ β) {a} {s : finset α} : f a ∈ s.map f ↔ a ∈ s
1861
1861
1862
1862
lemma mem_map_of_mem (f : α ↪ β) {a} {s : finset α} : a ∈ s → f a ∈ s.map f := (mem_map' _).2
1863
1863
1864
+ lemma forall_mem_map {f : α ↪ β} {s : finset α} {p : Π a, a ∈ s.map f → Prop } :
1865
+ (∀ y ∈ s.map f, p y H) ↔ ∀ x ∈ s, p (f x) (mem_map_of_mem _ H) :=
1866
+ ⟨λ h y hy, h (f y) (mem_map_of_mem _ hy), λ h x hx,
1867
+ by { obtain ⟨y, hy, rfl⟩ := mem_map.1 hx, exact h _ hy }⟩
1868
+
1864
1869
lemma apply_coe_mem_map (f : α ↪ β) (s : finset α) (x : s) : f x ∈ s.map f :=
1865
1870
mem_map_of_mem f x.prop
1866
1871
@@ -1910,6 +1915,20 @@ theorem map_filter {p : β → Prop} [decidable_pred p] :
1910
1915
(s.map f).filter p = (s.filter (p ∘ f)).map f :=
1911
1916
eq_of_veq (map_filter _ _ _)
1912
1917
1918
+ /-- A helper lemma to produce a default proof for `finset.map_disj_union`. -/
1919
+ theorem map_disj_union_aux {f : α ↪ β} {s₁ s₂ : finset α} :
1920
+ (∀ a, a ∈ s₁ → a ∉ s₂) ↔ ∀ a, a ∈ map f s₁ → a ∉ map f s₂ :=
1921
+ by simp_rw [forall_mem_map, mem_map']
1922
+
1923
+ theorem map_disj_union {f : α ↪ β} (s₁ s₂ : finset α) (h) (h' := map_disj_union_aux.1 h) :
1924
+ (s₁.disj_union s₂ h).map f = (s₁.map f).disj_union (s₂.map f) h' :=
1925
+ eq_of_veq $ multiset.map_add _ _ _
1926
+
1927
+ /-- A version of `finset.map_disj_union` for writing in the other direction. -/
1928
+ theorem map_disj_union' {f : α ↪ β} (s₁ s₂ : finset α) (h') (h := map_disj_union_aux.2 h') :
1929
+ (s₁.disj_union s₂ h).map f = (s₁.map f).disj_union (s₂.map f) h' :=
1930
+ map_disj_union _ _ _
1931
+
1913
1932
theorem map_union [decidable_eq α] [decidable_eq β]
1914
1933
{f : α ↪ β} (s₁ s₂ : finset α) : (s₁ ∪ s₂).map f = s₁.map f ∪ s₂.map f :=
1915
1934
coe_injective $ by simp only [coe_map, coe_union, set.image_union]
0 commit comments