Partially ordered constraints #
This file defines the partially ordered constraints (POC) model of variation of Kiparsky and
Anttila. A POC grammar is a partial order on the constraint set, and each evaluation samples a
total order consistent with it, a linear extension, whose OT optimum is the output. A single
grammar therefore induces a distribution over outputs: Anttila's quantitative interpretation
is the uniform measure uniformOn on the grammar's linear extensions, and the probability of an
output is that measure at the rankings picking it. The central identities are division-free
cardinality equations, which the rate theorems restate as values of the measure.
Main definitions #
stratified stratumOf inner: Tesar and Smolensky's stratified domination hierarchies, pulled back from mathlib'sProd.Lexalonga ↦ (stratumOf a, a). Equality is the discrete grammar, with no ranking imposed.IsConsistent r σ: the rankingσis a linear extension ofr, that is,r ≤ σ.toRel.consistentTotalOrders r: theFinsetof linear extensions ofr, nonempty by Szpilrajn.toGrammar,orderIdealAntimatroid: a POC grammar as aGrammar, and its order-ideal antimatroid.active con i o o',favoring con i o o': the constraints distinguishing a candidate pair, and those preferringo.
Main results #
consistentTotalOrders_eq_linearExtensions: the linear extensions of a POC grammar are those of its simple ERC encodingtoERCs.sum_measure_setOf_picksAt: under any probability measure on rankings, POC's uniform one or stochastic OT's, the outputs' probabilities sum to one, which produces intermediate frequencies, such as Coetzee and Pater's t/d-deletion rates, that no single ranking reproduces.picksAt_binary_iff_exists_favoring_isMinOn: a binary competition is decided by its σ-earliest active constraint.uniformOn_real_picksAt_discrete_binary,uniformOn_real_picksAt_stratified_binary:chosenwins at rate|favoring ∩ active| / |active|, restricted to the deciding stratum in the stratified case.uniformOn_picksAt_stratified_eq_one: a candidate that dominates every rival at the deciding stratum is the categorical output.
Implementation notes #
Grammars are unbundled relations r : Fin n → Fin n → Prop with [IsPartialOrder (Fin n) r],
never PartialOrder (Fin n) values, since a class-typed binder would become a local instance and
capture the ≤ and < notation that must keep meaning the positional order of Fin n. This is
mathlib's own idiom for orders treated as data (Szpilrajn's extend_partialOrder).
References #
- P. Kiparsky, An OT Perspective on Phonological Variation (1993)
- A. Anttila, Deriving Variation from Grammar (1997)
- B. Tesar and P. Smolensky, The Learnability of Optimality Theory (1995)
- A. Prince, Entailed Ranking Arguments (2002)
- N. Merchant and J. Riggle, OT grammars, beyond partial orders: ERC sets and antimatroids (2016)
- R. P. Dilworth, Lattices with unique irreducible decompositions (1940)
- A. W. Coetzee and J. Pater, The Place of Variation in Phonological Theory (2011)
Grammars and their linear extensions #
Equality is the discrete partial order, relating nothing beyond reflexivity. As a POC grammar it is [Ant97]'s "no ranking imposed" baseline, of which every permutation is a consistent linear extension.
A permutation σ is consistent with grammar r when r is contained
in the total order σ induces (Ranking.toRel) — σ is a linear extension
of r. Unfolds to ∀ a b, r a b → σ.symm a ≤ σ.symm b.
Equations
- OptimalityTheory.IsConsistent r σ = (r ≤ σ.toRel)
Instances For
Equations
- OptimalityTheory.instDecidableIsConsistentOfDecidableRelFin r σ = decidable_of_iff (∀ (a b : Fin n), r a b → (Equiv.symm σ) a ≤ (Equiv.symm σ) b) ⋯
consistentTotalOrders r is the finite set of linear extensions of r.
Equations
- OptimalityTheory.consistentTotalOrders r = Finset.filter (OptimalityTheory.IsConsistent r) Finset.univ
Instances For
The ranking g * σ extends r iff σ extends the g-pullback of r, so consistency
transports along constraint relabeling.
The linear extensions of a grammar are closed under its symmetries, since a relabeling that
preserves r acts on the consistent rankings.
For the discrete grammar, every permutation is a linear extension.
σ is consistent with the total order it induces — reflexivity of the relation lattice.
A ranking-induced order has its ranking as unique consistent linear
extension, by the rigidity of Ranking.toRel
(Ranking.toRel_le_toRel_iff).
Szpilrajn — every grammar has a consistent linear extension #
Every grammar has a consistent linear extension, since Szpilrajn's theorem
(extend_partialOrder) extends r to a linear order, which is the induced order of some
ranking (Ranking.exists_toRel_eq).
Stratified grammars #
Earlier strata dominate later ones wholesale, and within a stratum an inner order applies. With the discrete inner order this is the freely-ranked stratum grammar of [Ant97] eq. (50) — the Stratified Domination Hierarchy of [TS95] that constraint-demotion learning produces.
The stratified grammar induced by stratumOf and an inner order inner —
mathlib's lexicographic order (Prod.Lex) pulled back along
a ↦ (stratumOf a, a): strata compare strictly, ties defer to inner.
The plain characterization is stratified_iff; cross-stratum inner
edges are ignored.
Equations
- OptimalityTheory.stratified stratumOf inner a b = Prod.Lex (fun (x1 x2 : Fin s) => x1 < x2) inner (stratumOf a, a) (stratumOf b, b)
Instances For
Dominance in a stratified grammar holds iff a's stratum strictly precedes b's, or they share a stratum and the inner order relates them.
Equations
- OptimalityTheory.instDecidableRelFinStratified x✝¹ x✝ = decidable_of_iff (stratumOf x✝¹ < stratumOf x✝ ∨ stratumOf x✝¹ = stratumOf x✝ ∧ inner x✝¹ x✝) ⋯
Under a stratified grammar, an earlier-stratum constraint occupies a strictly earlier position in every consistent ranking.
Swapping two constraints of a stratum on which the inner order is trivial is a symmetry of the stratified grammar.
Consistent rankings of a stratified grammar are closed under swapping two constraints of a stratum on which the inner order is trivial.
Grounding in the ERC lex API #
A partial order is a set of dominance requirements — each related pair is a
simple ERC a ≫ b ([MR16b]), and under this encoding the
consistent total orders are exactly ERC.linearExtensions ([Pri02]).
The simple-ERC encoding of a grammar, with one ERC a ≫ b
(simpleERC a b) for each related pair — diagonal pairs give trivial ERCs,
matching toRel's reflexivity. Transitively-implied pairs are entailed by the
covering pairs, so the encoding has the same linear extensions as the
Hasse-edge one.
Equations
- OptimalityTheory.toERCs r = Finset.image (fun (p : Fin n × Fin n) => OptimalityTheory.simpleERC p.1 p.2) {p : Fin n × Fin n | r p.1 p.2}
Instances For
A ranking satisfies toERCs r exactly when it is a linear extension of
r: per pair, satisfaction of simpleERC a b is σ.toRel a b.
The consistent total orders of a grammar are exactly the linear extensions of its simple-ERC encoding ([MR16b]; [Pri02]).
The order-ideal antimatroid of a POC #
A grammar's Hasse-edge encoding is a consistent set of simple ERCs, so it has
a Birkhoff antimatroid whose feasible sets are exactly the order ideals of r
([Dil40]; [MR16b]).
Some linear extension of r satisfies toERCs r, so it is consistent.
The order-ideal antimatroid of a partial order is the antimatroid of its encoding as simple
ERCs, whose feasible sets are its order ideals (orderIdealAntimatroid_isFeasible_iff).
Equations
Instances For
A set is feasible for each ERC of the encoding of r exactly when it is an order ideal of
r, containing every constraint above one of its members.
The feasible sets of orderIdealAntimatroid are the order ideals of r.
Bridge to the Grammar hub #
A partial order on constraints is the simple-ERC fragment of an OT grammar —
its consistent total orders are exactly the legs of
Grammar.ofERCs (toERCs r) ([MR16b]).
The Grammar whose legs are r's consistent total orders.
Equations
Instances For
The quantitative interpretation #
A POC grammar draws one of its linear extensions uniformly at each evaluation
([Ant97]), so it is the probability measure uniformOn ↑(consistentTotalOrders r) on
rankings, and the probability that it selects o for input i is that measure at
{σ | PicksAt cands con σ i o}: the fraction of linear extensions picking o.
The constraints active on the candidate pair o, o' at input i are those assigning the
two candidates different violation counts ([Ant97]'s decisive constraints). Inactive
constraints cannot affect the competition.
Equations
- OptimalityTheory.active con i o o' = {c : Fin n | con c (i, o) ≠ con c (i, o')}
Instances For
The constraints favoring o over o' at input i are those assigning o strictly
fewer violations.
Equations
- OptimalityTheory.favoring con i o o' = {c : Fin n | con c (i, o) < con c (i, o')}
Instances For
σ picks output o for input i if o is the unique strict OT winner — every other in-set candidate is lex-strictly worse than o under σ.
Equations
- OptimalityTheory.PicksAt cands con σ i o = (o ∈ cands i ∧ ∀ o' ∈ cands i, o' ≠ o → (toLex fun (k : Fin n) => con (σ k) (i, o)) < toLex fun (k : Fin n) => con (σ k) (i, o'))
Instances For
A ranking picks at most one output, since strict lex domination is asymmetric.
With pairwise-distinct violation profiles, every ranking picks some output — the candidate with the lex-minimal permuted profile wins strictly.
Equations
- OptimalityTheory.instDecidablePicksAt cands con σ i o = id inferInstance
With pairwise-distinct violation profiles the picks-fibers over the
candidate set partition the consistent extensions, the division-free form of
sum_measure_setOf_picksAt.
Two distinct candidates with distinct violation profiles partition the consistent rankings.
With pairwise-distinct violation profiles every ranking picks exactly one candidate, so under any probability measure on rankings, a POC grammar's or stochastic OT's, the candidates' probabilities sum to one.
Binary competitions are decided by the earliest active constraint #
For binary candidate sets cands i = {chosen, other}, PicksAt σ i chosen reduces to lex
domination of the permuted profile of chosen, which is decided at the first position where the
profiles differ. So chosen wins exactly when the σ-earliest constraint of
active con i chosen other, the one at which σ.symm is least, lies in
favoring con i chosen other. Counting rankings by their σ-earliest active constraint
(Equiv.Perm.card_filter_isMinOn_symm_mul_card) then gives closed-form rates for binary POC
competitions without enumerating rankings.
The output o lex-dominates o' under σ exactly when the σ-earliest active constraint
favors o.
For binary candidate sets, PicksAt σ i chosen holds exactly when the σ-earliest active
constraint favors chosen.
Closed-form rate for binary candidates #
With binary candidates, the rankings picking chosen number
n! · |favoring ∩ active| / |active|, stated without division. Each ranking is decided by its
σ-earliest active constraint, and every active constraint comes first equally often.
Under the discrete grammar, with every ranking a linear extension, the uniform measure on
rankings picks chosen at rate |favoring ∩ active| / |active|.
Deciding-stratum rate for stratified grammars #
A binary competition whose variants tie on every stratum before k is decided within stratum
k, and later strata, including any inner rankings among them, are provably irrelevant. This is
[Ant97]'s tableau-count shortcut stated against the full grammar rather than a per-stratum
sub-grammar.
On a consistent ranking of a stratified grammar, the σ-earliest active constraint is the
σ-earliest active constraint of the deciding stratum k, since earlier strata are inactive
(h_tie) and every constraint of stratum k precedes the later strata.
Under a stratified grammar, a binary competition whose variants tie on every stratum before
k, with k freely ranked internally (h_triv) and containing an active constraint (h_dec),
is decided within stratum k. The rankings picking chosen, times the active constraints Dₖ
of that stratum, equal all consistent rankings times those favoring chosen, and later strata
cannot affect the outcome.
Under a stratified grammar, the uniform measure on its linear extensions picks chosen at
the deciding-stratum rate |favoring ∩ Dₖ| / |Dₖ|.
Categorical outcomes under stratified grammars #
Under a stratified grammar, a consistent ranking picks o when, against every rival, the
first stratum on which they differ has all its active constraints favoring o.
A candidate dominating every rival at the deciding stratum wins with probability one.