Documentation

CslibFrontier.Foundations.Data.Fintype.FiberEquiv

Label-preserving bijections and fiber cardinalities #

Two labelings f : α → γ and g : β → γ of finite types are related by a label-preserving bijection e : α ≃ β, g (e a) = f a, exactly when every label is used equally often: the fibers of f and g have the same cardinality, or equivalently the multisets of labels univ.val.map f and univ.val.map g agree. Mathlib builds the bijection from fiberwise ones (Equiv.ofFiberEquiv); this file records the resulting characterization.

Main results #

theorem Equiv.exists_apply_eq_iff_card_fiber_eq {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Finite α] [Finite β] {f : α → γ} {g : β → γ} :
(∃ (e : α ≃ β), ∀ (a : α), g (e a) = f a) ↔ ∀ (c : γ), Nat.card { a : α // f a = c } = Nat.card { b : β // g b = c }

Label-preserving bijections. Labelings f : α → γ and g : β → γ of finite types are related by a bijection e with g (e a) = f a exactly when every label c is the label of equally many points of α and of β.

theorem Multiset.count_map_univ {α : Type u_1} {γ : Type u_3} [Fintype α] [DecidableEq γ] (f : α → γ) (c : γ) :
count c (map f Finset.univ.val) = Nat.card { a : α // f a = c }

In the multiset of labels of f : α → γ on a finite type, the multiplicity of a label is the number of points carrying it.

theorem Multiset.map_univ_eq_iff_card_fiber_eq {α : Type u_1} {γ : Type u_3} [Fintype α] [DecidableEq γ] {f : α → γ} {s : Multiset γ} :
map f Finset.univ.val = s ↔ (∀ c ∈ s, Nat.card { a : α // f a = c } = count c s) ∧ ∀ (a : α), f a ∈ s

The multiset of labels of f : α → γ on a finite type is s exactly when every element c of s labels as many points as its multiplicity in s, and every label of f lies in s.

theorem Equiv.exists_apply_eq_iff_map_univ_eq {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Fintype α] [Fintype β] {f : α → γ} {g : β → γ} :
(∃ (e : α ≃ β), ∀ (a : α), g (e a) = f a) ↔ Multiset.map f Finset.univ.val = Multiset.map g Finset.univ.val

Label-preserving bijections, multiset form. Labelings f : α → γ and g : β → γ of finite types are related by a bijection e with g (e a) = f a exactly when they have the same multiset of labels.