Structural operations on DRSs #
This file develops the structural theory of the DRS type of DRS/Defs.lean:
renaming of discourse referents, the merge algebra, transport of the extension
relation along renaming, occurrence and freeness predicates, and accessibility.
Renaming along a bijection is [KR93]'s alphabetic variant (the
prose preceding Def. 1.4.8).
Main declarations #
DRS.map: renaming alongf : V → W, functorial.DRS.varFinset,DRS.freeVarFinset: occurring and free referents.DRS.IsProper: no free referent (Def. 1.4.2–1.4.3); decidable.DRS.ReuseFreeAt: no referent declared twice along a nesting path.DRS.accessibleFrom,DRS.Accessible: accessible referents, computed by [vE06]'s left-and-up walk; decidable.AccessibleTo,accessibleDomain: [GBM24]'s accessibility preorder over the sub-DRSs of a host, and its accessible domainA_K.
Main statements #
DRS.Accessible.exists_mem_accessibleDomain: every computed accessibility verdict is realized by genuine accessibility edges.
Conditions #
Renaming #
Rename discourse referents along f throughout a condition.
Equations
- DRT.Condition.map f (DRT.Condition.rel R args) = DRT.Condition.rel R fun (i : Fin n) => f (args i)
- DRT.Condition.map f (DRT.Condition.eq a b) = DRT.Condition.eq (f a) (f b)
- DRT.Condition.map f (DRT.Condition.neg K) = DRT.Condition.neg (DRT.Box.map f (DRT.Condition.map f) K)
- DRT.Condition.map f (DRT.Condition.imp a c) = DRT.Condition.imp (DRT.Box.map f (DRT.Condition.map f) a) (DRT.Box.map f (DRT.Condition.map f) c)
- DRT.Condition.map f (DRT.Condition.dis l r) = DRT.Condition.dis (DRT.Box.map f (DRT.Condition.map f) l) (DRT.Box.map f (DRT.Condition.map f) r)
Instances For
Renaming a condition along the identity is the identity.
Occurring referents #
Occurring referents (free or bound) in a condition, as a Finset — the DRS
analogue of mathlib's Term.varFinset. Membership x ∈ varFinset c is
decidable, so downstream consumers get decidable occurrence for free.
Equations
- One or more equations did not get rendered due to their size.
- (DRT.Condition.rel R args).varFinset = Finset.image args Finset.univ
- (DRT.Condition.eq a b).varFinset = {a, b}
- (DRT.Condition.neg K).varFinset = K.referents ∪ List.foldr (fun (x1 x2 : Finset V) => x1 ∪ x2) ∅ (List.map DRT.Condition.varFinset K.conditions)
Instances For
Occurring referents in a list of conditions.
Equations
- DRT.Condition.varFinsetL cs = List.foldr (fun (x1 x2 : Finset V) => x1 ∪ x2) ∅ (List.map DRT.Condition.varFinset cs)
Instances For
A condition's occurring referents are among its list's.
Free discourse referents #
The free discourse referents of a condition.
Equations
- One or more equations did not get rendered due to their size.
- (DRT.Condition.rel R args).freeVarFinset = Finset.image args Finset.univ
- (DRT.Condition.eq a b).freeVarFinset = {a, b}
- (DRT.Condition.neg K).freeVarFinset = List.foldr (fun (x1 x2 : Finset V) => x1 ∪ x2) ∅ (List.map DRT.Condition.freeVarFinset K.conditions) \ K.referents
Instances For
Free referents of a list of conditions.
Equations
- DRT.Condition.freeVarFinsetL cs = List.foldr (fun (x1 x2 : Finset V) => x1 ∪ x2) ∅ (List.map DRT.Condition.freeVarFinset cs)
Instances For
Reuse-freeness #
No discourse referent is declared twice along a nesting path: each universe is
fresh for the ambient declarations, threaded through sub-boxes the way
verification threads the base (the antecedent of a ⇒ feeds its referents
into the consequent). This is the hypothesis under which the total
agree-off-universe semantics and the persistence semantics coincide
(DRS.trueRel_iff_toRelAt in DRS/Indexed.lean).
A condition is reuse-free at ambient declarations X: each sub-box
universe is fresh for the declarations in scope, threaded the way verification
threads the base (the antecedent of a ⇒ feeds its referents into the
consequent).
Equations
- One or more equations did not get rendered due to their size.
- DRT.Condition.ReuseFreeAt X (DRT.Condition.rel R args) = True
- DRT.Condition.ReuseFreeAt X (DRT.Condition.eq a b) = True
- DRT.Condition.ReuseFreeAt X (DRT.Condition.neg K) = (Disjoint X K.referents ∧ ∀ c ∈ K.conditions, DRT.Condition.ReuseFreeAt (X ∪ K.referents) c)
Instances For
Reuse-freeness for a list of conditions.
Equations
- DRT.Condition.ReuseFreeAllAt X cs = ∀ c ∈ cs, DRT.Condition.ReuseFreeAt X c
Instances For
Accessibility threading #
Accessibility (Def. 1.4.11) is relative to a host DRS: "u accessible at box
B" means u lies in the universe of B or of a box on the path from the host
down to B. A host-free ∃ D, WeakSubordinate K D ∧ u ∈ D.referents is
vacuous, since a superordinate D introducing any referent can be manufactured.
accScope computes accessibility top-down, by [vE06]'s walk in the
directions left (from the consequent of a ⇒ to its antecedent) and up,
threading the in-scope referents along the first path to the box declaring the
target; the declarative counterpart is the host-anchored preorder AccessibleTo
at the end of this file.
Accessibility threading through a condition.
Equations
- One or more equations did not get rendered due to their size.
- DRT.Condition.accScope s (DRT.Condition.rel R args) x✝ = none
- DRT.Condition.accScope s (DRT.Condition.eq u v) x✝ = none
Instances For
Accessibility threading through a list of conditions: the first hit wins.
Equations
- DRT.Condition.accScopeL s cs x = List.foldr (fun (r acc : Option (Finset V)) => r.orElse fun (x : Unit) => acc) none (List.map (fun (c : DRT.Condition L V) => DRT.Condition.accScope s c x) cs)
Instances For
DRSs #
Renaming #
Rename discourse referents along f : V → W throughout a DRS.
Equations
- DRT.DRS.map f = DRT.Box.map f (DRT.Condition.map f)
Instances For
Renaming a DRS along the identity is the identity.
Extension along a renamed DRS is extension of the precompositions.
The extensions of f at K.map e are the extensions of f ∘ e at K,
via precomposition.
The ∀ analogue of DRS.exists_extends_map.
Merge algebra #
Occurring and free referents #
Occurring referents in a DRS (its universe and those of its conditions).
Equations
- K.varFinset = K.referents ∪ DRT.Condition.varFinsetL K.conditions
Instances For
A DRS's conditions' occurring referents are among the DRS's.
The free discourse referents of a DRS: referents occurring in its
conditions and not bound by its universe or by an ancestor reachable "left
and up" (the antecedent of a ⇒ threads its referents into the consequent).
K.freeVarFinset ⊆ b says every referent of K is bound in context b.
Equations
Instances For
The characteristic form of the referential presupposition: a box's free
referents are supplied by X iff its conditions' are supplied by the grown
base.
Merging preserves boundedness: the merge's free referents are supplied by
X when the context's are and the increment's are supplied by the grown base.
A DRS is proper iff it has no free discourse referent (Def. 1.4.2–1.4.3).
Equations
- K.IsProper = (K.freeVarFinset = ∅)
Instances For
Equations
- K.instDecidableIsProper = decidable_of_iff (K.freeVarFinset = ∅) ⋯
Merging preserves properness when the increment's free referents are supplied by the context DRS's universe.
Reuse-freeness #
A DRS is reuse-free at ambient declarations X: its universe avoids X
and its conditions are reuse-free at the grown set.
Equations
- DRT.DRS.ReuseFreeAt X K = (Disjoint X K.referents ∧ DRT.Condition.ReuseFreeAllAt (X ∪ K.referents) K.conditions)
Instances For
Accessibility #
Descend K, accumulating in-scope referents s ([vE06]'s "left and
up" walk); on reaching the box introducing x, return that box's in-scope set
s ∪ U. The ⇒-consequent additionally sees the antecedent's universe.
Equations
- DRT.DRS.accScope s K x = if x ∈ K.referents then some (s ∪ K.referents) else DRT.Condition.accScopeL (s ∪ K.referents) K.conditions x
Instances For
The referents accessible from u's introduction in T, as a decidable
Finset; ∅ if u is not introduced in T. (Def. 1.4.11 defines
accessibility of a referent from a condition; this is the derived
referent-to-referent relation of the surrounding prose.)
Equations
- T.accessibleFrom u = (DRT.DRS.accScope ∅ T u).getD ∅
Instances For
v is accessible from u's position in T. Decidable (Finset membership).
Equations
- T.Accessible u v = (v ∈ T.accessibleFrom u)
Instances For
Equations
Sub-box characterizations #
The per-constructor forms of the condition-level predicates, phrased through the corresponding DRS-level notion of the sub-boxes, and the subset relations tying free to occurring referents.
Free referents of a condition occur.
Free referents occur.
The list analogue of Condition.freeVarFinset_subset_varFinset.
Accessibility as the smallest preorder #
Following [GBM24] §4.2, accessibility is the smallest
preorder on the sub-DRSs of a host such that a box is accessible to the
sub-boxes of its complex conditions and a conditional's antecedent is accessible
to its consequent. Each generating edge anchors its containing box below the
host, which keeps the relation non-vacuous.
DRS.Accessible.exists_mem_accessibleDomain shows every verdict of the computed
accScope is realized by genuine edges.
A generating edge of the accessibility preorder over the sub-DRSs of host
(§4.2): a box is accessible to the sub-boxes of its complex conditions, and the
antecedent of a conditional is accessible to its consequent.
- neg
{L : FirstOrder.Language}
{V : Type w}
{host K K' : DRS L V}
: WeakSubordinate K host → Condition.neg K' ∈ K.conditions → AccessibleEdge host K K'
A box is accessible to the body of its
¬-conditions. - impAnte
{L : FirstOrder.Language}
{V : Type w}
{host K K' K'' : DRS L V}
: WeakSubordinate K host → Condition.imp K' K'' ∈ K.conditions → AccessibleEdge host K K'
A box is accessible to the antecedents of its
⇒-conditions. - impCons
{L : FirstOrder.Language}
{V : Type w}
{host K K' K'' : DRS L V}
: WeakSubordinate K host → Condition.imp K' K'' ∈ K.conditions → AccessibleEdge host K' K''
The antecedent of a
⇒-condition is accessible to its consequent. - disLeft
{L : FirstOrder.Language}
{V : Type w}
{host K K' K'' : DRS L V}
: WeakSubordinate K host → Condition.dis K' K'' ∈ K.conditions → AccessibleEdge host K K'
A box is accessible to the left disjunct of its
∨-conditions. - disRight
{L : FirstOrder.Language}
{V : Type w}
{host K K' K'' : DRS L V}
: WeakSubordinate K host → Condition.dis K' K'' ∈ K.conditions → AccessibleEdge host K K''
A box is accessible to the right disjunct of its
∨-conditions.
Instances For
AccessibleTo host K K' says K is accessible to K' among the sub-DRSs
of host — the smallest preorder containing the generating edges (§4.2).
Equations
- DRT.AccessibleTo host = Relation.ReflTransGen (DRT.AccessibleEdge host)
Instances For
The target of an accessibility edge is a sub-DRS of the host.
The accessible domain A_K of K in host — the set of referents declared
in some box accessible to K (§4.2).
Equations
- DRT.accessibleDomain host K = {x : V | ∃ (K' : DRT.DRS L V), DRT.AccessibleTo host K' K ∧ x ∈ K'.referents}
Instances For
Soundness of the computed accessibility #
Every computed accessibility verdict is realized by genuine §4.2 edges: if
v ∈ accessibleFrom T u, then u is declared in a sub-DRS K of T and v
lies in K's accessible domain. The converse choice among multiple declaration
sites of u is algorithmic (first hit); its characterization is future work.