Documentation

CslibFrontier.Foundations.Data.Finset.LowestMax

The last element of a finite initial subset #

These initial-subset facts identify the highest starred coordinate of a canonical tensor box and the remaining star set after replacing it. They use the existing rank-filter initial subset rather than adding a second ordering or rank convention.

theorem Finset.mem_lowest_of_le {α : Type u_1} [LinearOrder α] {S : Finset α} {k : ℕ} {x y : α} (hy : y ∈ lowest k S) (hx : x ∈ S) (hxy : x ≤ y) :
x ∈ lowest k S

Membership of a finite initial subset is downward closed inside the original set.

theorem Finset.card_filter_lt_max_lowest {α : Type u_1} [LinearOrder α] {S : Finset α} {k : ℕ} (hk : k ≤ S.card) (hne : (lowest k S).Nonempty) :
{x ∈ S | x < (lowest k S).max' hne}.card + 1 = k

The last of the first k elements has precisely k - 1 predecessors in the original set.

theorem Finset.erase_max_lowest {α : Type u_1} [LinearOrder α] {S : Finset α} {k : ℕ} (hk : k ≤ S.card) (hne : (lowest k S).Nonempty) :
(lowest k S).erase ((lowest k S).max' hne) = lowest (k - 1) S

Removing the last selected element leaves the shorter initial subset.

theorem Finset.erase_max_lowest_erase {α : Type u_1} [LinearOrder α] {S : Finset α} {k : ℕ} (hk : k ≤ S.card) (hne : (lowest k S).Nonempty) :
(lowest k S).erase ((lowest k S).max' hne) = lowest (k - 1) (S.erase ((lowest k S).max' hne))

Removing that coordinate from the ambient set leaves the same shorter initial subset.