Abstract tree with dominance relation (B&P Definition 1)
Enhanced with the Connected Ancestor Condition (CAC) needed for Embeddability (Theorem 8): ancestors are linearly ordered in a tree.
- nodes : Set Node
- dom : Node → Node → Prop
- root : Node
Connected Ancestor Condition (CAC): If both x and y dominate z, then either x dominates y or y dominates x. This captures that ancestors in a tree are linearly ordered.
Nodes closed under dominance
Instances For
Proper dominance: a properly dominates b iff a dominates b and a ≠ b
Instances For
Upper bounds of a node with respect to property P (B&P Definition 2). UB(a, P) = {b | b properly dominates a ∧ b ∈ P}
Instances For
Command relation generated by property P (B&P Definition 3). C_P = {(a,b) | ∀x ∈ UB(a,P). x dominates b}
a P-commands b iff every P-node that properly dominates a also dominates b.
Equations
- Phenomena.Anaphora.Compare.commandRelation T P = {ab : Node × Node | ∀ x ∈ Phenomena.Anaphora.Compare.upperBounds T ab.1 P, T.dom x ab.2}
Instances For
Theorem 1 (Intersection Theorem): C_P ∩ C_Q = C_{P∪Q}
This is the central algebraic result: union of properties gives intersection of command relations.
Corollary: The map P ↦ C_P is antitone (order-reversing)
Maximal property: all nodes
Equations
Instances For
Empty property
Equations
Instances For
IDc-command: C_{all nodes} — the most restrictive command relation
Equations
Instances For
Universal command: C_∅ — the least restrictive (everything commands everything)
Equations
Instances For
IDc-command is the bottom of the lattice: IDc ⊆ C_P for all P
Universal command is the top: C_P ⊆ Universal for all P
All command relations are reflexive
All command relations satisfy constituency/descent
Configurational Equivalence Corollary: If the upper bounds of node a are the same for properties P and Q, then C_P and C_Q agree on all pairs starting from a.
This formalizes the configurational assumption: different theories (using different P's) agree when their upper bounds coincide.
Corollary: If P and Q have the same nodes above a, C_P(a,-) = C_Q(a,-)
Configurational Clause Condition: For subject position s, if there is exactly one node x that properly dominates s, and x ∈ P ↔ x ∈ Q, then C_P and C_Q agree on pairs from s.
In a standard clause [S [NP_subj] [VP...]], the only node properly dominating the subject NP is S. So any P containing S agrees with any Q containing S.
Directions in a binary tree
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Phenomena.Anaphora.Compare.instBEqDir.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Address = path from root
Instances For
Get subtree at address (binary branching only)
Equations
- Phenomena.Anaphora.Compare.atAddr x✝ [] = some x✝
- Phenomena.Anaphora.Compare.atAddr (Core.Tree.Tree.node PUnit.unit [l, head]) (Phenomena.Anaphora.Compare.Dir.L :: rest) = Phenomena.Anaphora.Compare.atAddr l rest
- Phenomena.Anaphora.Compare.atAddr (Core.Tree.Tree.node PUnit.unit [head, r]) (Phenomena.Anaphora.Compare.Dir.R :: rest) = Phenomena.Anaphora.Compare.atAddr r rest
- Phenomena.Anaphora.Compare.atAddr x✝ (head :: tail) = none
Instances For
Does address a dominate b? (a is prefix of b)
Equations
Instances For
Sister of an address (flip last direction)
Equations
- Phenomena.Anaphora.Compare.sister [] = none
- Phenomena.Anaphora.Compare.sister [Phenomena.Anaphora.Compare.Dir.L] = some [Phenomena.Anaphora.Compare.Dir.R]
- Phenomena.Anaphora.Compare.sister [Phenomena.Anaphora.Compare.Dir.R] = some [Phenomena.Anaphora.Compare.Dir.L]
- Phenomena.Anaphora.Compare.sister (d :: rest) = Option.map (fun (x : List Phenomena.Anaphora.Compare.Dir) => d :: x) (Phenomena.Anaphora.Compare.sister rest)
Instances For
C-command (@cite{reinhart-1976} def. 36): A c-commands B iff A's sister dominates B.
Standard definition for binary branching trees; dominates
uses isPrefixOf which includes the identity case.
Equations
- Phenomena.Anaphora.Compare.cCommand addrA addrB = match Phenomena.Anaphora.Compare.sister addrA with | none => false | some sis => Phenomena.Anaphora.Compare.dominates sis addrB
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Find index in list
Equations
Instances For
Equations
Instances For
O-command: A o-commands B iff A precedes B in the argument structure.
Position in arg-st = obliqueness rank. Earlier = less oblique.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Get label for dependency
Equations
- g.labelOf a h = Option.map (fun (x : Phenomena.Anaphora.Compare.DepEdge α) => x.label) (List.find? (fun (e : Phenomena.Anaphora.Compare.DepEdge α) => e.dependent == a && e.head == h) g.edges)
Instances For
D-command: A d-commands B iff A and B are co-dependents of the same head, and A bears the "subj" relation (designated binder).
Equations
Instances For
A configurational transitive clause bundles aligned representations.
The key invariants capture what it means for a structure to be configurational:
- Tree has subject external to VP, object internal
- Arg-st has subject before object (less oblique)
- Dep-graph has both as dependents of verb, subject labeled "subj"
When these hold, the three command relations must agree.
- subj : String
- verb : String
- obj : String
- tree : Core.Tree.Tree Unit String
- subjAddr : Address
- objAddr : Address
Instances For
The ConfigurationalClause structure constraints ensure command equivalence.
Rather than proving this for arbitrary instances (which requires metaprogramming),
the key insight is demonstrated by the concrete example johnSeesHimself_commands.
The structural constraints (subjAddr = [L], objAddr = [R,R], argSt = [subj, obj], dependency labels) force all three command notions to agree for any valid instance.
"John sees himself" as a configurational clause
Equations
- One or more equations did not get rendered due to their size.
Instances For
Verify the example satisfies command equivalence
Main Agreement Theorem: Reflexive Coreference
All four theories correctly predict the reflexive coreference patterns.
Main Agreement Theorem: Complementary Distribution
Main Agreement Theorem: Pronominal Disjoint Reference
Total minimal pairs tested
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.S Phenomena.Anaphora.Compare.Category.S = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.S (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.NP Phenomena.Anaphora.Compare.Category.NP = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.NP (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.VP Phenomena.Anaphora.Compare.Category.VP = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.VP (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.V Phenomena.Anaphora.Compare.Category.V = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.V (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.PP Phenomena.Anaphora.Compare.Category.PP = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.PP (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.N Phenomena.Anaphora.Compare.Category.N = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.N (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.D Phenomena.Anaphora.Compare.Category.D = isTrue ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq Phenomena.Anaphora.Compare.Category.D (Phenomena.Anaphora.Compare.Category.other a) = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.S = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.NP = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.VP = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.V = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.PP = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.N = isFalse ⋯
- Phenomena.Anaphora.Compare.instDecidableEqCategory.decEq (Phenomena.Anaphora.Compare.Category.other a) Phenomena.Anaphora.Compare.Category.D = isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Labeled tree extends abstract tree with category labels
Instances For
S-nodes
Equations
Instances For
NP-nodes
Equations
Instances For
Branching nodes
Equations
- One or more equations did not get rendered due to their size.
Instances For
Maximal projections (simplified)
Equations
- One or more equations did not get rendered due to their size.
Instances For
S-command (@cite{langacker-1969}'s original "command" relation, parameterized by S-nodes)
Equations
Instances For
NP-command
Equations
Instances For
K-command (@cite{reinhart-1976}'s c-command, parameterized by branching nodes; also @cite{kayne-1984})
Equations
Instances For
MAX-command (approximates Chomsky's c-command)
Equations
Instances For
S-command ∩ NP-command = command by {S} ∪ {NP}
If S ⊆ MaxProj, then MAX-command ⊆ S-command
The set of command relations on a tree
Equations
Instances For
Command relations inherit the complete lattice structure from Set
The Intersection Theorem restated: P ↦ C_P converts ⊔ to ⊓
Generalized intersection theorem for arbitrary unions
OrderDual for the powerset ordered by superset
Equations
- Phenomena.Anaphora.Compare.commandMap T = { toFun := fun (P : Set Node) => OrderDual.toDual (Phenomena.Anaphora.Compare.commandRelation T P), monotone' := ⋯ }
Instances For
The command map is order-reversing (stated directly)
A command relation C_P is ambidextrous iff for all a: either ∃x. x ∈ UB(a,P) or (a,b) ∈ C_P for all b.
B&P Theorem 3: All command relations are ambidextrous.
Boundedness (B&P Theorem 4): Adding a root node to the generating property does not alter the command relation.
C_P = C_{P ∪ {r}} when r is the root.
Proof: C_P ⊇ C_{P∪{r}} by the Intersection Theorem (antitone). For the reverse: if (a,b) ∈ C_P but (a,b) ∉ C_{P∪{r}}, there must be some c ∈ P ∪ {r} \ P that properly dominates a but doesn't dominate b. The only such c is the root. But the root dominates everything, contradiction.
Simpler Boundedness: The root is not a proper dominator of any node.
This is because the root dominates everything, so if root properly dominates a, then root ≠ a, which is possible. But the key point for command relations is that adding root to P doesn't change which pairs command each other.
Alternative Boundedness: If UB(a,P) is nonempty and (a,b) ∈ C_P, then ∃x ∈ UB(a,P). x dom b.
This is immediate from the definition but useful as a lemma.
Fairness witness: ¬(a C_P c) implies ∃x ∈ UB(a,P). ¬(x dom c).
This is the contrapositive of the command definition.
Fairness (B&P Theorem 6): (aCb ∧ bCc ∧ ¬aCc) → (aCd → b dominates d).
If a commands b, b commands c, but a doesn't command c, then every node that a commands is dominated by b.
Proof: Let x be the witness from ¬aCc (x ∈ UB(a,P), x doesn't dominate c). From aCb, x dominates b. If x ≠ b, then x properly dominates b, so x ∈ UB(b,P). From bCc, x would dominate c - contradiction. So x = b. Then from aCd, x dominates d, i.e., b dominates d.
Mate relation: M_P = C_P ∩ (C_P)⁻¹
Two nodes are P-mates iff they mutually P-command each other. Examples: clause-mates (S-command), co-arguments (NP-command).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Mate relations are symmetric
Mate relations are reflexive on nodes in C_P
S-mates (clausemates): nodes that mutually S-command
Equations
Instances For
NP-mates (co-arguments): nodes that mutually NP-command
Equations
Instances For
Intersection theorem for mate relations
Constituency/Descent (stronger form): If a commands b and b dominates c, then a commands c.
B&P Theorem 7: C_P is closed under descent on the second argument.
This is already proved as command_descent above. Here we restate it
in the standard form.
Embeddability (B&P Theorem 8): Command relations are preserved under graph embedding.
B&P's actual Theorem 8 is about embedding one graph G₁ into another G₂: "A node a commands b in G₁ if and only if a commands b in G₂" when G₁ is rooted, G₂ satisfies CAC, and the embedding obeys Integrity.
Here we prove a simpler internal version using CAC: If x properly dominates b (with x ∈ P), and either x dominates a (giving x ∈ UB(a,P)) or a dominates x, then we can transfer command from a to b.
The key insight: in a tree with CAC, any upper bound of b is comparable to a.
Embeddability corollary: If every upper bound of b that properly dominates b also properly dominates a, then a commanding c implies b commands c.
This requires: UB(b,P) ⊆ {x | x properly dominates a} ∪ {x | a dominates x ∧ x dom c}
In a tree with CAC, the first disjunct covers most cases.
A command relation generated by a binary relation R rather than a property.
C_R(a,b) iff ∀x. (a R x) → (x dominates b)
This generalizes the property-based definition: C_P = C_{R_P} where (a R_P x) iff x properly dominates a and x ∈ P.
Equations
Instances For
The property-based command is a special case of relation-based
Command equivalence (B&P Definition 20): R ~ S iff C_R = C_S
Equations
Instances For
Maximal generator (B&P Definition 21): R̂ = ∪{S | S ⊇ R ∧ S ~ R}
The largest relation that generates the same command relation as R.
Key insight: if c dominates some upper bound b for a, then (c,a) can be added to R without changing C_R (non-minimal upper bounds don't affect command).
Equations
- Phenomena.Anaphora.Compare.maximalGenerator T R a x = ∃ (S : Node → Node → Prop), (∀ (a' x' : Node), R a' x' → S a' x') ∧ Phenomena.Anaphora.Compare.commandEquivalent T R S ∧ S a x
Instances For
Maximal generator contains the original relation
Key Lemma for Union Theorem: Non-minimal upper bounds are in the maximal generator.
If c dominates d, and (d, a) ∈ R (meaning d is an upper bound for a in R), then (c, a) ∈ R̂ (the maximal generator).
Proof: Adding (c, a) to R doesn't change C_R because any node that needed to be dominated by c would already be dominated by d (by transitivity).
Maximal generator is command-equivalent to original
Intersection Theorem for Relations: C_R ∩ C_S = C_{R ∪ S}
Analogous to property-based intersection theorem.
Union Theorem (B&P Theorem 9): C_R ∪ C_S = C_{R̂ ∩ Ŝ}
Union over command relations corresponds to intersection over maximal generators.
The proof relies on CAC: if (a,b) ∈ C_{R̂∩Ŝ} but (a,b) ∉ C_R ∪ C_S, then there exist c with (c,a) ∈ R and d with (d,a) ∈ S, both properly dominating a but neither dominating b. By CAC, either c dom d or d dom c. Say c dom d. Then c is a non-minimal upper bound for a via S, so (c,a) ∈ Ŝ. And (c,a) ∈ R̂ since R̂ ⊇ R. So (c,a) ∈ R̂ ∩ Ŝ, contradicting (a,b) ∈ C_{R̂∩Ŝ}.
The reverse inclusion requires CAC.
This is B&P's Theorem 9 reverse direction: C_{R̂∩Ŝ} ⊆ C_R ∪ C_S.
Proof sketch: If (a,b) ∈ C_{R̂∩Ŝ} but (a,b) ∉ C_R ∪ C_S, then there exist witnesses c with (c,a) ∈ R and d with (d,a) ∈ S, both properly dominating a but neither dominating b. By CAC, either c dom d or d dom c. Say c dom d. Then c is a non-minimal upper bound via d for S, so (c,a) ∈ Ŝ. And (c,a) ∈ R̂ since R̂ ⊇ R. So (c,a) ∈ R̂ ∩ Ŝ, meaning (a,b) ∈ C_{R̂∩Ŝ} implies c dom b. Contradiction.
The full proof requires showing that non-minimal upper bounds are in Ŝ, which needs the precise characterization of maximal generators.
The image of the command map: all command relations
Equations
Instances For
Command relations are closed under arbitrary intersection
The command relations form a closure system
@cite{barker-pullum-1990} Formalization Coverage #
@cite{barker-pullum-1990} @cite{hudson-1990} @cite{pollard-sag-1994} @cite{reinhart-1976}
Fully Proved Theorems #
Kracht Infrastructure — Status #
| Reference | Status |
|---|---|
| Kracht Thm 2 (→) | tight_implies_fair ✓ |
| Kracht Thm 2 (←) | fair_implies_tight_exists — FALSE as stated (see counterexample in docstring). Replaced with commandFromFunction_sub_commandRelation ✓ |
Note: Theorem 4 (Boundedness), Theorem 8 (Embeddability) are now fully proved using the Connected Ancestor Condition (CAC) added to AbstractTree.
B&P Theorem 9 (Union Theorem) is now fully proved using nonminimal_in_maximalGenerator,
which shows that non-minimal upper bounds can be added to a relation without changing the
generated command relation.
Not Yet Formalized #
| B&P Reference | Notes |
|---|---|
| Section 4 (Government) | Would require m-command, barriers theory |
| Full Galois Connection | Could use GaloisInsertion from Mathlib |
| Lattice as Complete Lattice | Image forms a complete sub-lattice |
Linguistic Applications Proved #
- All 4 theories agree on reflexive coreference, complementary distribution, pronominal disjoint reference (empirically verified)
- Configurational equivalence explains why theories agree on simple clauses
- Concrete command relations (c-command, o-command, d-command) demonstrated
Insight #
The formalization shows that grammar comparison can be made mathematically precise: theories that seem to differ in mechanism (tree geometry vs obliqueness vs dependency paths) are unified through B&P's algebraic framework. When the structural assumptions align (configurational languages), the theories necessarily agree by the Intersection Theorem.
@cite{kracht-1993} "Mathematical Aspects of Command Relations" #
Kracht shows that command relations have richer algebraic structure than B&P identified:
Associated Functions: Each command relation C has an associated function f_C : T → T where C_x = ↓f_C(x) (downward closure)
Tight Relations: Relations satisfying: x < f(y) → f(x) ≤ f(y)
Fair = Tight (Theorem 2): The "fair" relations of B&P are exactly the "tight" relations defined by the associated function property.
Distributoid Structure: (Cr(T), ∩, ∪, ∘) where ∘ is relational composition. Composition distributes over both ∩ and ∪.
Union Elimination: ∪ can be expressed using ∩ and ∘ alone: C_P ∪ C_Q = (C_P ∘ C_Q) ∩ (C_Q ∘ C_P) ∩ (C_P • C_Q)
Insight #
Working with associated functions f : T → T (monotone, bounded) is more elegant than working with the relations directly. The composition of command relations corresponds to ordinary function composition:
f_{R∘S} = f_S ∘ f_R
This reversal is because command relations are "upper-bound based" - the generator x dominates the commanded element b.
Associated function for a command relation.
For command relation C = C_P, the associated function f : T → T maps each node a to the infimum (meet) of its P-upper-bounds.
In a tree, this is the "minimal P-dominator" of a (if it exists).
Properties (Kracht Conditions 1-5):
- f(r) = r (root maps to itself)
- f(x) dominates x (f(x) is an upper bound)
- f is monotone: x dom y → f(x) dom f(y)
- f(f(x)) = f(x) (idempotent on range)
- (Tightness) x < f(y) → f(x) ≤ f(y)
- f : Node → Node
The function mapping each node to its "minimal P-dominator"
Root maps to itself (Condition 1)
f(x) dominates x (Condition 2)
Monotonicity (Condition 3)
Idempotent on range (Condition 4)
Instances For
Tightness condition (Kracht Condition 5): If x is strictly below f(y), then f(x) ≤ f(y).
This captures that command relations are "fair" in B&P's sense: the generating property P determines a consistent boundary.
Instances For
A tight associated function satisfies all five Kracht conditions
Instances For
The command relation determined by an associated function.
C_f = {(a,b) | f(a) dominates b}
This is equivalent to the property-based definition when P = {x | f(x) = x} (the fixed points of f).
Equations
Instances For
The command relation from a tight function is reflexive
The command relation from a tight function satisfies descent
Relational composition of command relations.
(C ∘ D)(a,c) iff ∃b. C(a,b) ∧ D(b,c)
For command relations from associated functions: C_f ∘ C_g corresponds to C_{g∘f} (note the reversal!)
Equations
Instances For
Composition is associative
For associated functions, composition reverses: C_f ∘ C_g ⊆ C_{g ∘ f}
This is because if f(a) dom b and g(b) dom c, then g(f(a)) dom g(b) dom c (by monotonicity and transitivity).
Note: We prove containment rather than equality since the composed function g ∘ f may not satisfy all AssociatedFunction conditions without additional assumptions (specifically, idempotence).
A Distributoid is an algebraic structure (D, ∩, ∪, ∘) where:
- (D, ∩, ∪) is a distributive lattice
- ∘ is an associative operation
- ∘ distributes over both ∩ and ∪
Command relations form a distributoid (Kracht Theorem 8).
- sup : α → α → α
- inf : α → α → α
- comp : α → α → α
Composition operation
Composition is associative
Left distributivity over meet
Right distributivity over meet
Left distributivity over join
Right distributivity over join
Instances
Composition distributes over intersection for command relations (one direction)
Composition distributes over intersection (reverse direction).
This direction requires finding a common witness from potentially different witnesses b₁ (for C_Q) and b₂ (for C_R). The key idea: use p₀ = the minimal P-upper-bound of a. Since UB(a, P) is a chain (by CAC), p₀ is dominated by every other P-upper-bound, making C_P(a, p₀) hold. Any Q-upper-bound (or R-upper-bound) of p₀ is also a Q-upper-bound (resp. R-upper-bound) of b₁ (resp. b₂), because p₀ dominates both b₁ and b₂.
When UB(a, P) = ∅, root serves as witness: all command relations hold vacuously since root has no proper dominator.
A relation R is fair in B&P's sense if it satisfies: (a R b) ∧ (b R c) ∧ ¬(a R c) → ∀d. (a R d) → (b dom d)
This is B&P's Theorem 6 condition.
Equations
Instances For
All property-generated command relations are fair (B&P Theorem 6)
Kracht Theorem 2: For tight associated functions, the generated command relation is fair, and conversely, every fair command relation comes from a tight associated function.
First direction: tight → fair. Requires a ∈ T.nodes for the
idempotent condition on the associated function. The hypothesis
hNodesAll says all elements of the Node type are tree nodes
(i.e., there are no "phantom" elements outside the tree).
Kracht Theorem 2 converse — FALSE as originally stated #
The theorem fair_implies_tight_exists claimed: every fair commandRelation T P
equals commandFromFunction T tf for some tight associated function tf.
This is false because the two notions have different transitivity:
commandFromFunction T afis always transitive (via monotonicity + idempotence).commandRelation T Pcan be non-transitive: at P-nodes with no P-ancestor,UB(a, P) = ∅makes command vacuously universal.
Counterexample: tree root → p → a, P = {p}.
- (a, p) ∈ C_P and (p, root) ∈ C_P (UB(p,{p}) = ∅, vacuous).
- But (a, root) ∉ C_P (UB(a,{p}) = {p}, and p does not dominate root).
- No transitive relation equals C_P, hence no
commandFromFunction.
The correct relationship is commandFromFunction ⊆ commandRelation for the
fixed-point property, proved below.
An associated function's command relation refines the property-based command relation for its fixed-point set P = {x | f(x) = x}.
Forward direction: if f(a) dom b, then every P-upper-bound of a also dominates b (via monotonicity: x dom a → f(x) dom f(a) → x dom f(a)).
The antecedent intersection of two relations: R • S = {(a,c) | ∃b. (a,b) ∈ R ∧ (a,b) ∈ S ∧ (b dom c)}
This captures "common antecedents" between R and S.
Equations
Instances For
Union Elimination (Kracht Lemma 10-11): C_P ∪ C_Q = (C_P ∘ C_Q) ∩ (C_Q ∘ C_P) ∩ (C_P • C_Q)
Union can be expressed using only ∩ and ∘ (plus antecedent intersection).
This shows that ∪ is "eliminable" in the distributoid structure, meaning the theory can be developed using ∩ and ∘ alone.
First inclusion: C_P ∪ C_Q ⊆ (C_P ∘ C_Q) ∩ (C_Q ∘ C_P) ∩ (C_P • C_Q)
Note: Requires both a, c ∈ T.nodes for reflexivity. The antecedent intersection part also requires a dom c, which holds when a ∈ P or a ∈ Q (so UB(a,_) = ∅ and a commands everything below it).
Union Elimination (reverse direction): (C_P ∘ C_Q) ∩ (C_Q ∘ C_P) ∩ (C_P • C_Q) ⊆ C_P ∪ C_Q
This is the harder direction - it relies on the specific structure of command relations.
Heyting Algebra via Mathlib #
Set α is a CompleteAtomicBooleanAlgebra and hence a HeytingAlgebra.
The Heyting implication for sets is: A ⇨ B = Aᶜ ∪ B
@cite{kracht-1993} shows command relations form a Heyting algebra. Since command
relations are a subset of Set (Node × Node), and the latter is already
a Heyting algebra, we show:
- The standard Heyting implication satisfies the adjunction property
- Our explicit definition agrees with Mathlib's
⇨ - Command relations are closed under Heyting operations (sub-Heyting-algebra)
The Heyting implication on sets: A ⇨ B = Aᶜ ∪ B
This can also be characterized as: A ⇨ B = ⋃₀ {E | E ∩ A ⊆ B}
(the largest set E such that E ∩ A ⊆ B).
Equations
- Phenomena.Anaphora.Compare.commandImplication _T C D = C ⇨ D
Instances For
Our explicit union definition equals Mathlib's Heyting implication.
For sets, A ⇨ B = Aᶜ ∪ B, which is exactly the largest E with E ∩ A ⊆ B.
The Heyting adjunction: E ∩ C ⊆ D ↔ E ⊆ (C ⇨ D)
This is the defining property of Heyting implication.
In Mathlib, this is le_himp_iff.
Modus ponens for command relations: (C ⇨ D) ∩ C ⊆ D
Transitivity of Heyting implication: (A ⇨ B) ∩ (B ⇨ C) ⊆ (A ⇨ C)
Uses Mathlib's himp_le_himp_himp_himp: b ⇨ c ≤ (a ⇨ b) ⇨ a ⇨ c
Command relations form a closure system, hence a complete Heyting algebra.
The key property is that arbitrary intersections of command relations
are command relations (proved in commandImage_closed_under_sInter).
Combined with the lattice structure, this gives us a complete Heyting algebra on the set of command relations.
Pseudo-complement: In a Heyting algebra, the complement is Cᶜ = C ⇨ ⊥
For sets, Cᶜ is the set-theoretic complement.
Pseudo-complement property: C ∩ Cᶜ = ∅
B&P's Open Question Answered: Command relations do NOT form a Boolean algebra.
In a Boolean algebra, we would have C ∪ Cᶜ = ⊤ (law of excluded middle).
In a Heyting algebra, this fails in general.
For Set α, this actually DOES hold (sets form a Boolean algebra),
but the subtype of command relations may not be closed under complement.
The key insight from Kracht: complement of a command relation is generally NOT a command relation. Hence command relations form a Heyting algebra but not a Boolean algebra.
Currying via Heyting implication: (A ∩ B) ⇨ C = A ⇨ (B ⇨ C)
This is the "currying" property of Heyting algebras.
This follows directly from Mathlib's himp_himp.
Weakening: A ⊆ B → (C ⇨ A) ⊆ (C ⇨ B)
Contraposition (weak): A ⊆ B → Bᶜ ⊆ Aᶜ
A command relation expression in normal form uses only:
- Base relations C_P (for properties P)
- Meet (∩)
- Composition (∘)
Union is eliminable by J.6. Join is eliminable because for command relations, join = intersection of generators (by the Intersection Theorem).
Kracht Theorem 9: Every command relation expression has a normal form using only ∩ and ∘.
- base {Node : Type} {T : AbstractTree Node} : Set Node → NormalForm T
- meet {Node : Type} {T : AbstractTree Node} : NormalForm T → NormalForm T → NormalForm T
- comp {Node : Type} {T : AbstractTree Node} : NormalForm T → NormalForm T → NormalForm T
Instances For
Evaluate a normal form expression to a command relation
Equations
- One or more equations did not get rendered due to their size.
- Phenomena.Anaphora.Compare.NormalForm.eval T (Phenomena.Anaphora.Compare.NormalForm.base P) = Phenomena.Anaphora.Compare.commandRelation T P
- Phenomena.Anaphora.Compare.NormalForm.eval T (n1.meet n2) = Phenomena.Anaphora.Compare.NormalForm.eval T n1 ∩ Phenomena.Anaphora.Compare.NormalForm.eval T n2
Instances For
Meet in normal form corresponds to union of generators
@cite{kracht-1993} Coverage Summary #
| Kracht Reference | Name | Status |
|---|---|---|
| Definition 1 | Associated Functions | AssociatedFunction, TightAssociatedFunction |
| Theorem 2 | Fair = Tight | tight_implies_fair ✓, fair_implies_tight_exists FALSE → commandFromFunction_sub_commandRelation ✓ |
| Proposition 6 | Composition Distributivity | command_comp_inter_left ✓, command_comp_inter_left_rev ✓ |
| Theorem 8 | Distributoid Structure | Distributoid typeclass |
| Theorem 9 | Normal Forms | NormalForm, normalForm_meet_is_union |
| Lemma 10-11 | Union Elimination | union_elimination_forward ✓, union_elimination_reverse ✓ |
| Theorem 10 | Heyting Algebra | Uses Mathlib's HeytingAlgebra ✓ |
Mathlib Integration #
The Heyting algebra structure now uses Mathlib's HeytingAlgebra typeclass:
Set (Node × Node)is already aHeytingAlgebra(inherited fromCompleteBooleanAlgebra)- Heyting implication
C ⇨ DfromMathlib.Order.Heyting.Basic - Key theorems (
command_heyting,command_modus_ponens,command_himp_trans) now leverage Mathlib'sSet.subset_himp_iffand related lemmas commandImplication_eq_sUnionshows our explicit definition equals Mathlib's⇨
Insights #
Associated functions provide a cleaner interface than relations. The map f : T → T replaces the "minimal P-upper-bound" concept.
Tightness is the key condition ensuring command relations behave well under composition. It's equivalent to B&P's fairness.
Union is eliminable: the full theory can be developed using only ∩ and ∘, which simplifies algebraic manipulations.
Not a Boolean algebra: B&P's open question is answered negatively. Complement doesn't work because command relations lack negation. But they do form a Heyting algebra (intuitionistic logic), which is formalized via Mathlib's
HeytingAlgebratypeclass.Distributoid structure enables representing complex binding conditions (e.g., "commands and doesn't dominate") as compositions and intersections of basic command relations.