Constraint rankings #
A ranking of a constraint set indexed by ι ([Pri02]'s total domination order ≫) is an
enumeration r : Fin n ≃ ι of the constraints in rank order: r p is the constraint at rank
position p, position 0 most dominant, and r.symm i is the rank position of i. For
ι = Fin n a ranking is a permutation, Equiv.Perm (Fin n). Ranking.Dominates is the induced
strict dominance relation, a strict total order on the constraints, and Ranking.toRel its
reflexive closure, from which the ranking is recoverable (toRel_le_toRel_iff); Ranking.take r k
is the set of its top k constraints. Reading two
violation vectors in rank order and comparing them lexicographically is Pi.Lex under dominance
(toLex_comp_lt_iff). The Tableau machinery evaluates under a ranking, and the
elementary-ranking-condition layer (ElementaryRankingCondition.lean) infers rankings from
winner–loser pairs. Rankings carry the discrete σ-algebra, so that a distribution over rankings,
a partially ordered grammar's or stochastic OT's, is a Measure.
Implementation notes #
A ranking is stored as the enumeration rather than as the order relation, so that rankings can be
enumerated and compared decidably; the relation is derived (Dominates). The length n is a
parameter rather than Fintype.card ι, so that a ranking of Fin n is literally a permutation;
card_eq recovers Fintype.card ι = n from any ranking, and a statement quantifying over all
rankings is vacuous when n does not match.
References #
A ranking of the constraints ι into n rank positions, Prince's total domination order
≫, is an enumeration of the constraints in rank order: r p is the constraint at rank position
p, position 0 being the most dominant, and r.symm i is the rank position of i.
Equations
- OptimalityTheory.Ranking ι n = (Fin n ≃ ι)
Instances For
There are finitely many rankings of n constraints, and every set of them is measurable.
Equations
A total relation is maximal among antisymmetric relations, so an antisymmetric relation above it in the pointwise lattice equals it.
A ranking enumerates all the constraints, so their number is the number of rank positions.
Equations
- r.instDecidableDominates i j = { decide := (↑((Equiv.symm r) i)).succ.ble ↑((Equiv.symm r) j), reflects_decide := ⋯ }
Dominance between ranked positions is position order.
Reading two vectors in rank order and comparing them lexicographically is Pi.Lex under
dominance.
Under the identity ranking 1, dominance is index order.
A ranking reads a lex-ordered vector in rank order, so that coordinate p of r • v is the
value of v at the constraint ranked p-th. Reordering is the one operation that
breaks and reconstitutes the lex order — the Sₙ action whose orbit structure is
constraint ranking. (With this convention the action is a right action:
(r * s) • v = s • r • v.)
Equations
- OptimalityTheory.Ranking.instSMulFinLexForall = { smul := fun (r : OptimalityTheory.Ranking (Fin n) n) (v : Lex (Fin n → α)) => toLex fun (p : Fin n) => ofLex v (r p) }
Any two distinct constraints can be ranked either way, so some ranking makes i dominate
j.
Any constraint can be ranked above all the others.
The top constraints of a ranking #
The top k constraints of a ranking.
Equations
- r.take k = Finset.map (Equiv.toEmbedding r) {p : Fin n | ↑p < ↑k}
Instances For
The ranking as a total order #
Equations
- r.instDecidableToRel i j = { decide := (↑((Equiv.symm r) i)).ble ↑((Equiv.symm r) j), reflects_decide := ⋯ }
Relabeling constraints by g pulls the induced order back along g⁻¹.
A ranking is recoverable from its induced total order.
Every linear order on the constraints is the induced order of a ranking, the surjectivity
companion to toRel_injective: enumerate the constraints in s-order (Finset.sort) and read
off the ranking.
Constraints keyed injectively into a linear order are ranked by their keys.