Documentation

Linglib.Syntax.DependencyGrammar.Projectivity

Projectivity and its relaxations #

A dependency graph is projective when the positions each node dominates form a contiguous stretch of the sentence. Natural language is not always projective, so the literature weakens the constraint in several directions. Planarity bans crossing arcs, well-nestedness bans interleaved subtrees, and gap degree counts the discontinuities a single node may show.

In this file we define those constraints and prove the inclusions among them that hold on trees. The witnesses separating the constraints are the source papers' own figures, and live in their study files.

Main definitions #

Main results #

References #

[KN06] — Mildly non-projective dependency structures, source of the Definition numbers cited above [Kuh13] — Mildly non-projective dependency grammar [Mel88] — Dependency syntax: theory and practice, source of the Link Grammar planarity notion

The binary constraints: projectivity, planarity, well-nestedness #

A dependency graph is projective if the positions dominated by any one position are order-convex.

Equations
Instances For
    @[reducible, inline]
    abbrev DependencyGrammar.Alternate {n : } (a b c d : Fin n) :

    Positions a b c d alternate if a < c < b < d, so that the pairs {a, b} and {c, d} strictly interleave.

    Equations
    Instances For

      A dependency graph is planar if no two links alternate, so that its arcs can be drawn above the sentence without crossing.

      Equations
      Instances For
        def DependencyGrammar.Graph.Interleave {n : } (g : Graph n) (v w : Fin n) :

        The subtrees at v and w interleave if each contributes two positions and the two pairs alternate.

        Equations
        Instances For

          A dependency graph is well-nested if interleaved subtrees are never disjoint, one of the two roots always dominating the other.

          Equations
          Instances For
            theorem DependencyGrammar.Graph.isProjective_iff {n : } (g : Graph n) :
            g.IsProjective ∀ (v x : Fin n), Dominates g v x∀ (y : Fin n), Dominates g v y∀ (z : Fin n), x zz yDominates g v z

            Projectivity, unfolded: nothing between two dominated positions escapes.

            @[instance_reducible]
            instance DependencyGrammar.instDecidableIsProjective {n : } (g : Graph n) :
            Decidable g.IsProjective
            Equations
            • One or more equations did not get rendered due to their size.
            @[instance_reducible]
            instance DependencyGrammar.instDecidableInterleave {n : } (g : Graph n) (v w : Fin n) :
            Decidable (g.Interleave v w)
            Equations

            Gap degree #

            theorem DependencyGrammar.Graph.projection_pairwise_lt {n : } (g : Graph n) (v : Fin n) :
            List.Pairwise (fun (x1 x2 : Fin n) => x1 < x2) (g.projection v)

            The projection is strictly increasing.

            def DependencyGrammar.Graph.gapDegreeAt {n : } (g : Graph n) (v : Fin n) :

            The gap degree of a position counts the discontinuities in its projection, the adjacent members more than one position apart.

            Equations
            Instances For
              def DependencyGrammar.Graph.gapDegree {n : } (g : Graph n) :

              The gap degree of a graph is the maximum over its positions.

              Equations
              Instances For

                Crossings #

                def DependencyGrammar.Graph.crossings {n : } (g : Graph n) :

                The number of crossing link pairs, counted as quadruples a < c < b < d carrying links {a, b} and {c, d}. Each crossing pair contributes once, since of the two ways to order the pairs only one alternates.

                Equations
                Instances For

                  Projectivity as gap degree zero #

                  Planarity is having no crossings — the binary constraint as the least value of the count.

                  theorem DependencyGrammar.Graph.gapDegreeAt_eq_zero_iff {n : } {g : Graph n} {v : Fin n} :
                  g.gapDegreeAt v = 0 (g.dominated v).OrdConnected

                  A position has gap degree zero exactly when what it dominates is order-convex.

                  Projectivity is gap degree zero: the parametric constraint at its least value is the binary one.

                  The hierarchy on trees #

                  theorem DependencyGrammar.Graph.IsProjective.dominates_of_mem_uIcc {n : } {g : Graph n} (hP : g.IsProjective) {p t x : Fin n} (h : g.Adj p t) (hx : x Set.uIcc p t) :
                  Dominates g p x

                  In a projective graph the head of an arc dominates every position the arc spans, since the head dominates both endpoints and is order-convex.

                  theorem DependencyGrammar.Graph.IsProjective.isPlanar {n : } {g : Graph n} (hT : g.IsTree) (hP : g.IsProjective) :

                  Every projective tree is planar.

                  theorem DependencyGrammar.Graph.IsPlanar.mem_uIcc_of_linked {n : } {g : Graph n} (hPl : g.IsPlanar) {lo hi p q : Fin n} (hL : g.Linked lo hi) (hL' : g.Linked p q) (hlp : lo < p) (hph : p < hi) :
                  q Set.uIcc lo hi

                  In a planar graph, a link with one endpoint strictly inside the span of another link has its other endpoint inside that span too.

                  theorem DependencyGrammar.Graph.IsPlanar.no_strict_straddle {n : } {g : Graph n} (hPl : g.IsPlanar) {p q p' q' : Fin n} (hL : g.Linked p q) (hL' : g.Linked p' q') (hin : p' Set.uIcc p q) (hne1 : p' p) (hne2 : p' q) (hout : q'Set.uIcc p q) :
                  False

                  Planarity forbids a link with one endpoint strictly inside another link's span and the other endpoint outside it.

                  theorem DependencyGrammar.Graph.IsPlanar.isWellNested {n : } {g : Graph n} (hT : g.IsTree) (hPl : g.IsPlanar) :

                  Every planar tree is well-nested: interleaved subtrees would force a link below one of them to straddle a link below the other.

                  theorem DependencyGrammar.Graph.IsPlanar.root_mem_gap {n : } {g : Graph n} (hT : g.IsTree) (hPl : g.IsPlanar) {v i j k : Fin n} (hi : Dominates g v i) (hj : Dominates g v j) (hik : i < k) (hkj : k < j) (hk : ¬Dominates g v k) :
                  i < g.root g.root < j

                  In a planar tree every gap contains the root: if v dominates i and j but skips a position between them, the root lies strictly between i and j. So a planar tree rooted at a sentence boundary is projective, which is why planarity buys nothing once the root is given a boundary position.

                  theorem DependencyGrammar.Graph.IsPlanar.isProjective_of_isBot {n : } {g : Graph n} (hT : g.IsTree) (hPl : g.IsPlanar) (hr : IsBot g.root) :

                  A planar tree whose root precedes every position is projective: a gap would have to contain the root, and nothing lies to its left.

                  Every projective tree is well-nested, via planarity.