Documentation

CslibFrontier.Foundations.Data.Finset.CoordinateSelection

Selecting one member of a finite set by coordinate tests #

When coordinate values distinguish the members of a finite set, each test can keep a nonempty fiber of size at most half. A logarithmic number of equalities therefore selects one member uniquely.

Adapted from SparseSelection in lean-canny at 970f28a5ecefc1327402ade16c068aa4b1b2c183.

theorem Finset.exists_short_coordinate_selector {α : Type u_1} {ι : Type u_2} {β : Type u_3} {S : Finset α} (hS : S.Nonempty) {f : α → ι → β} (hinj : Set.InjOn f ↑S) {N : ℕ} (hcard : S.card ≤ 2 ^ N) :
∃ (L : List (ι × β)), L.length ≤ N ∧ ∃ x ∈ S, ∀ y ∈ S, (∀ c ∈ L, f y c.1 = c.2) ↔ y = x

If the coordinate function is injective on a nonempty finite set of size at most 2 ^ N, some member is uniquely selected by a list of at most N coordinate equalities.