Counting a finite set by its fibers #
Set.ncard forms of the familiar Finset estimates.
Main results #
Set.ncard_eq_sum_ncard_fiberwise: a finite set mapped into a finset is the disjoint union of its fibers (Finset.card_eq_sum_card_fiberwise).Set.ncard_le_mul_ncard_image: a finite set whose fibers underfhave at mostnelements has at mostntimes as many elements as its image (Finset.card_le_mul_card_image).Set.ncard_image_le_ncard_image_of_factorsThrough: ifffactors throughgons, thenftakes at most as many values onsasg.Set.encard_lt_coe_iff_finite_ncard_lt:encardandncardagree below a natural number (Set.encard_le_coe_iff_finite_ncard_le).
theorem Set.ncard_image_le_ncard_image_of_factorsThrough {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} (hs : s.Finite) {f : α → β} {g : α → γ} (h : ∀ a ∈ s, ∀ b ∈ s, g a = g b → f a = f b) :
If f factors through g on s, that is, f agrees on any two points of s at which g
agrees, then f takes at most as many values on the finite set s as g does.