Documentation

CslibFrontier.Foundations.Data.Finset.Lowest

Initial segments of finite linearly ordered sets #

Finset.lowest k s retains the elements with fewer than k predecessors in s. Its members precede every omitted member, and its cardinality is min k s.card. This finite rank specification avoids choosing an enumeration in the clients.

The proofs generalize the ordered-level argument in [AlmanWilliams2026, Section 4.2], primary formal source Boxes.lean at anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5. The concrete consumer is the canonical tensor-box construction. No execution bound is asserted.

def Finset.lowest {α : Type u_1} [LinearOrder α] (k : ℕ) (s : Finset α) :

The elements having fewer than k predecessors in the finite set.

theorem Finset.lowest_subset {α : Type u_1} [LinearOrder α] (k : ℕ) (S : Finset α) :
lowest k S ⊆ S

The selected elements belong to the original set.

@[simp]
theorem Finset.mem_lowest {α : Type u_1} [LinearOrder α] {k : ℕ} {S : Finset α} {ℓ : α} :
ℓ ∈ lowest k S ↔ ℓ ∈ S ∧ {ℓ' ∈ S | ℓ' < ℓ}.card < k

Membership is determined by the number of strictly smaller elements in the set.

theorem Finset.lowest_lt {α : Type u_1} [LinearOrder α] {k : ℕ} {S : Finset α} {ℓ ℓ' : α} (hℓ : ℓ ∈ lowest k S) (hℓ' : ℓ' ∈ S \ lowest k S) :
ℓ < ℓ'

Every selected element precedes every unselected element of the set.

theorem Finset.eq_lowest_of_lt {α : Type u_1} [LinearOrder α] {S T : Finset α} (hT : T ⊆ S) (h : ∀ ℓ ∈ T, ∀ ℓ' ∈ S \ T, ℓ < ℓ') :
T = lowest T.card S

An initial subset is determined by its cardinality.

theorem Finset.card_lowest {α : Type u_1} [LinearOrder α] (k : ℕ) (S : Finset α) :
(lowest k S).card = min k S.card

Selection saturates at the size of the original set.