AFTD Auto-Formalizing Theoretical Domains

poset_maximals

def

Given 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 in S strictly exceeds x under P.

Statement

noncomputable def poset_maximals {α : Type*} (P : PartialOrder α) (S : Finset α) : Finset α
Defined in
arXiv:2610.18740 Section 5
Verified
23 Oct 2026
Axioms
none listed
Used by 1
  • crucial_weightGiven 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,…

Read back from the Lean

Given a type α, a partial order P on α, and a finite subset S of α, poset_maximals P S is the finite subset of S consisting of all elements x ∈ S such that for every y ∈ S, if x ≤ y (with respect to the ordering of P), then x = y.

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 maximal elements of a finite subset under a partial order. -/
noncomputable def poset_maximals {α : Type*} (P : PartialOrder α) (S : Finset α) : Finset α := open scoped Classical in
  S.filter (fun x => ∀ y ∈ S, @LE.le α P.toLE x y → x = y)
See it in the graphDiscuss this resultChallenge it