AFTD Auto-Formalizing Theoretical Domains

crucial_weight

def

Given a partial order P on Fin n and a solution with lower set L and selected element e, the crucial comparisons weight is a_s + b_s, where a_s is the number of maximal elements of L ∪ {e} minus 1, and b_s is the number of minimal elements of (Fin n) \ L minus 1.

Statement

noncomputable def crucial_weight {n : ℕ} (P : PartialOrder (Fin n))
    (L : Finset (Fin n)) (e : Fin n) : ℕ
Defined in
arXiv:2610.18740 Section 5
Verified
23 Oct 2026
Axioms
none listed
Built on 2
  • poset_maximalsGiven a partial order P on a type α and a finite subset S of α, poset_maximals P S is the subset of elements x in S such that no element y…
  • poset_minimalsGiven a partial order P on a type α and a finite subset S of α, poset_minimals P S is the subset of elements x in S such that no element y…
Used by 1
  • poset_key_boundFor a partial order P on Fin n and rank i, KEY(P) is the supremum over all compatible solutions s = (L, e, U) of the crucial comparisons…

Read back from the Lean

A definition of crucial_weight, which takes an implicit natural number n, a partial order P on Fin n, a subset L : Finset (Fin n), and an element e : Fin n, returning a natural number defined as the sum of: 1. The number of maximal elements in insert e L (with respect to P), minus 1 (using truncated natural number subtraction); and 2. The number of minimal elements in Finset.univ \ L (with respect to P), minus 1 (using truncated natural number subtraction).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The crucial comparisons weight a_s + b_s for a compatible solution (L, e, U). -/
noncomputable def crucial_weight {n : ℕ} (P : PartialOrder (Fin n))
    (L : Finset (Fin n)) (e : Fin n) : ℕ := open scoped Classical in
  ((poset_maximals P (insert e L)).card - 1) +
  ((poset_minimals P (Finset.univ \ L)).card - 1)
See it in the graphDiscuss this resultChallenge it