AFTD Auto-Formalizing Theoretical Domains

order_pos

def

The 1-based position of attribute a in order π, taking values in {1, ..., d}.

Statement

def order_pos {d : ℕ} (π : Order d) (a : Fin d) : ℕ
Defined in
arXiv:2610.39311 Section 2
Verified
31 Oct 2026
Axioms
none listed
Built on 1
  • OrderAn order of dimension d is a permutation of the attribute set {0, ..., d-1}, represented as a list without duplicates containing all…
Used by 2

Read back from the Lean

Given a natural number $d$, an ordering $\pi : \text{Order } d$ (a structure containing a list $\pi.\text{elems} : \text{List } (\text{Fin } d)$ with no duplicates and length $d$), and an element $a : \text{Fin } d$, order_pos defines a natural number equal to $1$ plus the 0-based index of $a$ in $\pi.\text{elems}$ (computed via List.idxOf).

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

/-- 1-based position of attribute a in order π. -/
def order_pos {d : ℕ} (π : Order d) (a : Fin d) : ℕ := π.elems.idxOf a + 1
See it in the graphDiscuss this resultChallenge it