OT — Elementary Ranking Conditions (Definitions + Operations) #
Pure types and operations for OT's algebraic ranking-inference layer. This module defines:
ERCVal— the three-valued alphabet {W, L, e} for Elementary Ranking ConditionsERC n— an ERC overnconstraints (a vector ofERCVal)Ranking n— a constraint ranking (a permutation ofFin n)ercOfProfiles— the bridge from violation profiles to ERCsERC.satisfiedBy,ERCSet.consistent,ERCSet.entails— the satisfaction/consistency/entailment algebratableauERC— build an ERC from a winner-loser pair in a tableausimpleERC— single-W/single-L ERCs corresponding to Hasse edges
These types connect the evaluation side of OT (ViolationProfile,
Tableau) to the inference side (ranking requirements, consistency,
typology). An ERC encodes the ranking requirements that make one
candidate beat another — the intermediate level between "a specific
ranking with specific evaluation functions" and "a violation profile
with no connection to which constraints matter."
The ranking question #
Given candidates α and β with violation profiles, the ERC [α ∼ β] answers the ranking question: exactly which rankings select α over β? A ranking satisfies [α ∼ β] iff at least one W-constraint (preferring the winner α) is ranked above all L-constraints (preferring the loser β).
References #
@cite{prince-2002} — Entailed ranking arguments (original ERC formulation) @cite{merchant-riggle-2016} — OT grammars, beyond partial orders: ERC sets and antimatroids
Equations
- Core.Constraint.OT.instDecidableEqERCVal x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Core.Constraint.OT.instReprERCVal = { reprPrec := Core.Constraint.OT.instReprERCVal.repr }
Equations
Equations
- One or more equations did not get rendered due to their size.
An Elementary Ranking Condition over n constraints.
An ERC is a vector Fin n → ERCVal encoding the ranking requirements
for one candidate to beat another. For each constraint k:
α k = Wmeans constraintkprefers the winnerα k = Lmeans constraintkprefers the loserα k = emeans constraintkis indifferent
A ranking satisfies the ERC iff some W-constraint is ranked above
all L-constraints. See ERC.satisfiedBy below.
Equations
- Core.Constraint.OT.ERC n = (Fin n → Core.Constraint.OT.ERCVal)
Instances For
Equations
- Core.Constraint.OT.instInhabitedERC = { default := fun (x : Fin n) => Core.Constraint.OT.ERCVal.e }
The set of W-constraints in an ERC: those preferring the winner.
Equations
- α.wSet = {k : Fin n | α k = Core.Constraint.OT.ERCVal.W}
Instances For
The set of L-constraints in an ERC: those preferring the loser.
Equations
- α.lSet = {k : Fin n | α k = Core.Constraint.OT.ERCVal.L}
Instances For
The set of e-constraints in an ERC: those indifferent between candidates.
Equations
- α.eSet = {k : Fin n | α k = Core.Constraint.OT.ERCVal.e}
Instances For
Decidable membership in W/L/e sets.
An ERC is trivial if it has no L-constraints — every ranking satisfies it.
Equations
- α.isTrivial = ∀ (k : Fin n), α k ≠ Core.Constraint.OT.ERCVal.L
Instances For
Equations
- Core.Constraint.OT.instDecidableIsTrivial α = Fintype.decidableForallFintype
An ERC is contradictory if it has no W-constraints but has at least one L-constraint — no ranking can satisfy it.
Equations
- α.isContradictory = ((∀ (k : Fin n), α k ≠ Core.Constraint.OT.ERCVal.W) ∧ ∃ (k : Fin n), α k = Core.Constraint.OT.ERCVal.L)
Instances For
A ranking of n constraints, represented as a permutation of Fin n.
r i is the constraint at rank position i, where position 0 is
the highest-ranked (most dominant) constraint.
Equivalently, r.symm k is the rank position of constraint k — a
lower value means higher rank (more dominant).
Equations
- Core.Constraint.OT.Ranking n = Equiv.Perm (Fin n)
Instances For
Equations
- Core.Constraint.OT.instInhabitedRanking = { default := Equiv.refl (Fin n) }
Equations
- Core.Constraint.OT.instCoeFunRankingForallFin = { coe := Equiv.toFun }
Constraint i dominates constraint j under ranking r:
i is ranked higher (lower position number) than j.
Equations
- Core.Constraint.OT.dominates r i j = ((Equiv.symm r) i < (Equiv.symm r) j)
Instances For
Equations
The identity ranking: constraint 0 is highest, n-1 is lowest.
This is the "default" ranking where index order equals rank order.
Equations
- Core.Constraint.OT.Ranking.id n = Equiv.refl (Fin n)
Instances For
Construct an ERC from two violation profiles: the winner's and the
loser's. For each constraint k:
Wif the winner has strictly fewer violations (winner-preferring)Lif the winner has strictly more violations (loser-preferring)eif violations are equal (indifferent)
This is the fundamental bridge between OT's evaluation layer
(ViolationProfile) and its inference layer (ERC). Every call
to mkTableau that selects a winner implicitly generates ERCs for
all winner-loser pairs via this function.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The W-set of ercOfProfiles consists of constraints where the
winner has strictly fewer violations.
The L-set of ercOfProfiles consists of constraints where the
winner has strictly more violations.
The e-set of ercOfProfiles consists of constraints where
violations are equal.
Construct an ERC from a list of ERCVal, with a proof that the list has the right length. Enables readable ERC literals in study files:
def myERC : ERC 4 := ercOfList [.W, .e, .L, .e]
Equations
- Core.Constraint.OT.ercOfList vs h i = vs.get ⟨↑i, ⋯⟩
Instances For
Construct a Ranking n from a function assigning rank positions to
constraints. f k is the rank position of constraint k (0 = highest).
Requires f to be a bijection (injective + surjective on Fin n).
Equations
- Core.Constraint.OT.Ranking.ofRankFn f hbij = (Equiv.ofBijective f hbij).symm
Instances For
Swap the rank positions of two constraints.
Equations
- r.swap i j = Equiv.trans r (Equiv.swap i j)
Instances For
A ranking r satisfies ERC α iff some W-constraint is ranked
above all L-constraints.
In the ranking r, position 0 is highest-ranked. r i is the
constraint at position i, and r.symm k is the rank position of
constraint k. So r.symm w < r.symm l means constraint w is
ranked above constraint l.
This is the semantic content of an ERC: it encodes a disjunction of dominance conditions. The ERC ⟨W, e, L, e⟩ says "constraint 0 must dominate constraint 2." The ERC ⟨W, W, L, e⟩ says "constraint 0 OR constraint 1 must dominate constraint 2."
Equations
- Core.Constraint.OT.ERC.satisfiedBy r α = ∀ (l : Fin n), α l = Core.Constraint.OT.ERCVal.L → ∃ (w : Fin n), α w = Core.Constraint.OT.ERCVal.W ∧ Core.Constraint.OT.dominates r w l
Instances For
Equations
- Core.Constraint.OT.instDecidableSatisfiedBy r α = Fintype.decidableForallFintype
A trivial ERC (no L-constraints) is satisfied by every ranking.
A ranking satisfies a set of ERCs iff it satisfies each one.
Equations
- Core.Constraint.OT.ERCSet.satisfiedBy r E = ∀ α ∈ E, Core.Constraint.OT.ERC.satisfiedBy r α
Instances For
Equations
- Core.Constraint.OT.instDecidableSatisfiedBy_1 r E = List.decidableBAll (Core.Constraint.OT.ERC.satisfiedBy r) E
An ERC set is consistent iff there exists at least one ranking that satisfies all ERCs in the set. An inconsistent ERC set encodes contradictory ranking requirements.
This is the decidable version — it searches over all n! rankings.
For large n, use the ERC fusion algorithm instead.
Equations
Instances For
The set of rankings consistent with an ERC set — its linear extensions in the terminology of @cite{merchant-riggle-2016}.
Equations
Instances For
ERC set E entails ERC set E' iff every ranking satisfying
E also satisfies E'. Equivalently, the linear extensions of E
are a subset of the linear extensions of E'.
This is the natural preorder on ERC sets. Two ERC sets are equivalent iff they entail each other — they have the same linear extensions and describe the same OT grammar.
Equations
Instances For
Entailment is reflexive.
Adding an ERC to a set weakens the entailment (more requirements = fewer satisfying rankings = stronger set).
If every ERC in E' is already entailed by E, then E entails
E'. This is the pointwise characterization.
Build an ERC from a winner-loser pair in a tableau.
Given a tableau t with candidates and violation profiles, and
a designated winner w and loser l, construct the ERC that
encodes the ranking requirements for w to beat l.
This is the fundamental bridge from OT evaluation to OT inference: every time a tableau selects a winner, it implicitly generates ERCs for all winner-loser pairs.
Equations
- Core.Constraint.OT.tableauERC t w l = Core.Constraint.OT.ercOfProfiles (t.profile w) (t.profile l)
Instances For
A simple ERC has exactly one W and one L — it encodes a single
dominance requirement w ≫ l (constraint w must dominate
constraint l).
Simple ERCs correspond to edges in the Hasse diagram of the ranking partial order. Sets of simple ERCs describe exactly the rankings representable as partial orders (@cite{merchant-riggle-2016} §1.1).
Equations
- α.isSimple = ((∃! w : Fin n, α w = Core.Constraint.OT.ERCVal.W) ∧ ∃! l : Fin n, α l = Core.Constraint.OT.ERCVal.L)
Instances For
Construct a simple ERC asserting that constraint i must dominate
constraint j. All other constraints are e.
Equations
- Core.Constraint.OT.simpleERC i j k = if k = i then Core.Constraint.OT.ERCVal.W else if k = j then Core.Constraint.OT.ERCVal.L else Core.Constraint.OT.ERCVal.e
Instances For
The W-position of a simple ERC.
The L-position of a simple ERC.
A simple ERC i ≫ j is satisfied by ranking r iff i dominates
j under r.
A simple ERC i ≫ j (with i ≠ j) is consistent: any ranking that
places i strictly above j is a witness; the identity ranking
works whenever the index order already has i < j, and a swap
suffices otherwise. We pick a witness by transposing (i, j) if
needed so that the resulting permutation puts i at a position
less than j's.