mathlib documentation


Colex #

We define the colex ordering for finite sets, and give a couple of important lemmas and properties relating to it.

The colex ordering likes to avoid large values - it can be thought of on finset as the "binary" ordering. That is, order A based on ∑_{i ∈ A} 2^i. It's defined here in a slightly more general way, requiring only has_lt α in the definition of colex on finset α. In the context of the Kruskal-Katona theorem, we are interested in particular on how colex behaves for sets of a fixed size. If the size is 3, colex on ℕ starts 123, 124, 134, 234, 125, 135, 235, 145, 245, 345, ...

Main statements #

Notation #

We define < and to denote colex ordering, useful in particular when multiple orderings are available in context.

Tags #

colex, colexicographic, binary

References #

Todo #

Show the subset ordering is a sub-relation of the colex ordering.

def finset.colex.inhabited (α : Type u_1) :
def finset.colex (α : Type u_1) :
Type u_1

We define this type synonym to refer to the colexicographic ordering on finsets rather than the natural subset ordering.

def finset.to_colex {α : Type u_1} (s : finset α) :

A convenience constructor to turn a finset α into a finset.colex α, useful in order to use the colex ordering rather than the subset ordering.

theorem colex.eq_iff {α : Type u_1} (A B : finset α) :
def finset.colex.has_lt {α : Type u_1} [has_lt α] :

A is less than B in the colex ordering if the largest thing that's not in both sets is in B. In other words, max (A ▵ B) ∈ B (if the maximum exists).

def finset.colex.has_le {α : Type u_1} [has_lt α] :

We can define (≤) in the obvious way.

theorem colex.lt_def {α : Type u_1} [has_lt α] (A B : finset α) :
A.to_colex < B.to_colex ∃ (k : α), (∀ {x : α}, k < x(x A x B)) k A k B
theorem colex.le_def {α : Type u_1} [has_lt α] (A B : finset α) :
theorem nat.sum_pow_two_lt {k : } {A : finset } (h₁ : ∀ {x : }, x Ax < k) :
A.sum (pow 2) < 2 ^ k

If everything in A is less than k, we can bound the sum of powers.

theorem colex.hom {α : Type u_1} {β : Type u_2} [linear_order α] [decidable_eq β] [preorder β] {f : α → β} (h₁ : strict_mono f) (A B : finset α) :

Strictly monotone functions preserve the colex ordering.

theorem colex.hom_fin {n : } (A B : finset (fin n)) :
(finset.image (λ (n_1 : fin n), n_1) A).to_colex < (finset.image (λ (n_1 : fin n), n_1) B).to_colex A.to_colex < B.to_colex

A special case of colex_hom which is sometimes useful.

theorem colex.lt_trans {α : Type u_1} [linear_order α] {a b c : finset.colex α} :
a < bb < ca < c
theorem colex.le_trans {α : Type u_1} [linear_order α] (a b c : finset.colex α) :
a bb ca c
theorem colex.lt_trichotomy {α : Type u_1} [linear_order α] (A B : finset.colex α) :
A < B A = B B < A
theorem colex.mem_le_of_singleton_le {α : Type u_1} [linear_order α] {r : α} {s : finset α} :
{r}.to_colex s.to_colex(∃ (x : α) (H : x s), r x)

If {r} is less than or equal to s in the colexicographical sense, then s contains an element greater than or equal to r.

theorem colex.lt_singleton_iff_mem_lt {α : Type u_1} [linear_order α] {r : α} {s : finset α} :
s.to_colex < {r}.to_colex ∀ (x : α), x sx < r

s.to_colex < finset.to_colex {r} iff all elements of s are less than r.

theorem colex.singleton_lt_iff_lt {α : Type u_1} [linear_order α] {r s : α} :
{r}.to_colex < {s}.to_colex r < s

Colex is an extension of the base ordering on α.

theorem colex.forall_lt_of_colex_lt_of_forall_lt {α : Type u_1} [linear_order α] {A B : finset α} (t : α) (h₁ : A.to_colex < B.to_colex) (h₂ : ∀ (x : α), x Bx < t) (x : α) (H : x A) :
x < t

If A is before B in colex, and everything in B is small, then everything in A is small.

theorem colex.sdiff_lt_sdiff_iff_lt {α : Type u_1} [has_lt α] [decidable_eq α] (A B : finset α) :

Colex doesn't care if you remove the other set

theorem colex.sum_pow_two_lt_iff_lt (A B : finset ) :
A.sum (pow 2) < B.sum (pow 2) A.to_colex < B.to_colex

For subsets of ℕ, we can show that colex is equivalent to binary.