@@ -358,6 +358,37 @@ lemma image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a b
358
358
image₂ f s {b} = s :=
359
359
by rw [image₂_singleton_right, funext h, image_id']
360
360
361
+ /-- If each partial application of `f` is injective, and images of `s` under those partial
362
+ applications are disjoint (but not necessarily distinct!), then the size of `t` divides the size of
363
+ `finset.image₂ f s t`. -/
364
+ lemma card_dvd_card_image₂_right (hf : ∀ a ∈ s, injective (f a))
365
+ (hs : ((λ a, t.image $ f a) '' s).pairwise_disjoint id) :
366
+ t.card ∣ (image₂ f s t).card :=
367
+ begin
368
+ classical,
369
+ induction s using finset.induction with a s ha ih,
370
+ { simp },
371
+ specialize ih (forall_of_forall_insert hf)
372
+ (hs.subset $ set.image_subset _ $ coe_subset.2 $ subset_insert _ _),
373
+ rw image₂_insert_left,
374
+ by_cases h : disjoint (image (f a) t) (image₂ f s t),
375
+ { rw card_union_eq h,
376
+ exact (card_image_of_injective _ $ hf _ $ mem_insert_self _ _).symm.dvd.add ih },
377
+ simp_rw [←bUnion_image_left, disjoint_bUnion_right, not_forall] at h,
378
+ obtain ⟨b, hb, h⟩ := h,
379
+ rwa union_eq_right_iff_subset.2 ,
380
+ exact (hs.eq (set.mem_image_of_mem _ $ mem_insert_self _ _)
381
+ (set.mem_image_of_mem _ $ mem_insert_of_mem hb) h).trans_subset (image_subset_image₂_right hb),
382
+ end
383
+
384
+ /-- If each partial application of `f` is injective, and images of `t` under those partial
385
+ applications are disjoint (but not necessarily distinct!), then the size of `s` divides the size of
386
+ `finset.image₂ f s t`. -/
387
+ lemma card_dvd_card_image₂_left (hf : ∀ b ∈ t, injective (λ a, f a b))
388
+ (ht : ((λ b, s.image $ λ a, f a b) '' t).pairwise_disjoint id) :
389
+ s.card ∣ (image₂ f s t).card :=
390
+ by { rw ←image₂_swap, exact card_dvd_card_image₂_right hf ht }
391
+
361
392
variables [decidable_eq α] [decidable_eq β]
362
393
363
394
lemma image₂_inter_union_subset_union :
0 commit comments