Canonical comparison on the SO₀ alphabet #
A carrier-free family of strict-total comparisons on the lexical alphabet
(Cat, SimpleLI, LexicalItem, LIToken) and on lists thereof. Each cmp*
satisfies two laws:
cmp*_swap:cmp a b = (cmp b a).swap(antisymmetry)cmp*_eq:cmp a b = .eq → a = b(distinct values compare unequal)
These make the comparison usable as a commutative tie-break: the SO-carrier
externalization ([MCB25] §1.12.1 / Lemma 1.13.5) orders
exocentric nodes — off Dom(h), where c-selection does not pick a head — by
cmpList cmpTok (SyntacticObject/Externalization.lean's exoYield), keeping
the section computable with no Quot.out.
The leaf comparators reuse mathlib's compare (and its Std.OrientedOrd.eq_swap
/ Std.compare_eq_iff_eq laws) on ℕ/String; Cat is compared via its
constructor index.
Category comparison #
Comparison on syntactic categories via the constructor index.
Equations
- Minimalist.cmpCat c₁ c₂ = compare c₁.ctorIdx c₂.ctorIdx
Instances For
Lexicographic list comparison #
Lexicographic comparison on lists, given an element comparison.
Equations
- Minimalist.cmpList cmp [] [] = Ordering.eq
- Minimalist.cmpList cmp [] (head :: tail) = Ordering.lt
- Minimalist.cmpList cmp (head :: tail) [] = Ordering.gt
- Minimalist.cmpList cmp (x_2 :: xs) (y :: ys) = (cmp x_2 y).then (Minimalist.cmpList cmp xs ys)
Instances For
Lexical item / token comparison #
Comparison on simple lexical items: category, then selectional stack, then phonological form.
Equations
- Minimalist.cmpSimpleLI s₁ s₂ = (Minimalist.cmpCat s₁.cat s₂.cat).then ((Minimalist.cmpList Minimalist.cmpCat s₁.sel s₂.sel).then (compare s₁.phonForm s₂.phonForm))
Instances For
Comparison on lexical items: lexicographic on their feature lists
(the nonempty proof is irrelevant).
Equations
Instances For
Comparison on tokens: by id, then by lexical item.
Equations
- Minimalist.cmpTok t₁ t₂ = (compare t₁.id t₂.id).then (Minimalist.cmpLexItem t₁.item t₂.item)