Documentation

Linglib.Semantics.Events.Path

Spatial paths #

A path is a finite sequence of locations, the spatial counterpart of a temporal interval. Zwarts gives paths an algebra: concatenation, defined only when one path ends where the next starts, the subpath order, and Krifka's adjacency of paths that share an endpoint. Zwarts's own paths are continuous curves, mathlib's topological _root_.Path, but he allows sequences of places as compatible with the algebra, and they keep every operation computable.

Pantcheva classifies paths by where they are inside a region. On any path parametrized by a bounded linear order of positions, a sequence of places or a curve, the positions inside the region form a set, and its order-theoretic shape is the path's: an upper set for a cofinal path (to), a lower set for a coinitial one (from), an interval missing both ends for a transitive one (past), the last position alone for a terminative one (up to). Reparametrizing keeps the shape and reversing the order reverses it, so a source path is a reversed goal path. An event domain's spatial trace sends each event to the path it traverses, as its temporal trace sends it to its run time.

Main definitions #

Main results #

References #

structure Spatial.Path (Loc : Type u_1) :
Type u_1

A path is a directed trajectory through space, given by the finite sequence of locations it visits.

  • source : Loc

    The location the path starts from.

  • steps : List Loc

    The later locations, which are empty for a constant path.

Instances For
    @[instance_reducible]
    instance Spatial.instDecidableEqPath {Loc✝ : Type u_1} [DecidableEq Loc✝] :
    DecidableEq (Path Loc✝)
    Equations
    def Spatial.instDecidableEqPath.decEq {Loc✝ : Type u_1} [DecidableEq Loc✝] (x✝ x✝¹ : Path Loc✝) :
    Decidable (x✝ = x✝¹)
    Equations
    • Spatial.instDecidableEqPath.decEq { source := a, steps := a_1 } { source := b, steps := b_1 } = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
    Instances For
      @[instance_reducible]
      instance Spatial.instReprPath {Loc✝ : Type u_1} [Repr Loc✝] :
      Repr (Path Loc✝)
      Equations
      def Spatial.instReprPath.repr {Loc✝ : Type u_1} [Repr Loc✝] :
      Path Loc✝ → ℕ → Std.Format
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Spatial.Path.goal {Loc : Type u_1} (p : Path Loc) :
        Loc

        The goal of a path is its last location.

        Equations
        Instances For
          def Spatial.Path.points {Loc : Type u_1} (p : Path Loc) :
          List Loc

          The points of a path are its locations from source to goal.

          Equations
          Instances For
            def Spatial.Path.const {Loc : Type u_1} (l : Loc) :
            Path Loc

            The constant path at l visits only l.

            Equations
            Instances For
              @[simp]
              theorem Spatial.Path.goal_const {Loc : Type u_1} (l : Loc) :
              (const l).goal = l
              theorem Spatial.Path.points_ne_nil {Loc : Type u_1} (p : Path Loc) :
              p.points ≠ []
              theorem Spatial.Path.points_injective {Loc : Type u_1} :
              Function.Injective points

              Concatenation and subpaths #

              def Spatial.Path.IsConcat {Loc : Type u_1} (p q r : Path Loc) :

              IsConcat p q r says that r is the concatenation p + q, defined only when p ends where q starts.

              Equations
              Instances For
                theorem Spatial.Path.IsConcat.source_eq {Loc : Type u_1} {p q r : Path Loc} (h : p.IsConcat q r) :
                theorem Spatial.Path.IsConcat.goal_eq {Loc : Type u_1} {p q r : Path Loc} (h : p.IsConcat q r) :
                r.goal = q.goal
                theorem Spatial.Path.IsConcat.points_eq {Loc : Type u_1} {p q r : Path Loc} (h : p.IsConcat q r) :
                r.points = p.points ++ q.steps
                theorem Spatial.Path.isConcat_const {Loc : Type u_1} (l : Loc) :

                A constant path concatenates with itself to itself.

                def Spatial.Path.Subpath {Loc : Type u_1} (p q : Path Loc) :

                p is a subpath of q when concatenating some paths around p yields q.

                Equations
                Instances For
                  theorem Spatial.Path.subpath_iff_infix {Loc : Type u_1} {p q : Path Loc} :
                  p.Subpath q ↔ p.points <:+: q.points

                  Subpath-hood is infix-hood of point sequences.

                  @[instance_reducible]
                  def Spatial.Path.instSubpathOrder {Loc : Type u_1} :
                  PartialOrder (Path Loc)

                  The subpath order is a scoped instance, since paths are also studied under a rival total lattice sum (the SemilatticeSup (Path Loc) of Studies/GoldbergJackendoff2004.lean). Activate it with open scoped Spatial.Path.

                  Equations
                  Instances For
                    theorem Spatial.Path.const_source_le {Loc : Type u_1} (p : Path Loc) :
                    const p.source ≤ p

                    Constant paths are least in the subpath order.

                    Adjacency #

                    def Spatial.Path.adjacent {Loc : Type u_1} (p1 p2 : Path Loc) :

                    Two paths are adjacent when the goal of one is the source of the other, Krifka's spatial adjacency.

                    Equations
                    Instances For
                      theorem Spatial.Path.adjacent_comm {Loc : Type u_1} {p1 p2 : Path Loc} :
                      p1.adjacent p2 ↔ p2.adjacent p1

                      Path adjacency is symmetric.

                      @[simp]
                      theorem Spatial.Path.adjacent_self {Loc : Type u_1} {p : Path Loc} :
                      p.adjacent p ↔ p.goal = p.source

                      A path is adjacent to itself iff it is a loop.

                      theorem Spatial.Path.IsConcat.adjacent {Loc : Type u_1} {p q r : Path Loc} (h : p.IsConcat q r) :

                      Concatenable paths are adjacent.

                      Reversal #

                      def Spatial.Path.reverse {Loc : Type u_1} (p : Path Loc) :
                      Path Loc

                      The reverse of a path traverses it from its goal to its source.

                      Equations
                      Instances For
                        @[simp]
                        theorem Spatial.Path.source_reverse {Loc : Type u_1} (p : Path Loc) :
                        @[simp]
                        theorem Spatial.Path.points_reverse {Loc : Type u_1} (p : Path Loc) :
                        p.reverse.points = p.points.reverse
                        @[simp]
                        theorem Spatial.Path.goal_reverse {Loc : Type u_1} (p : Path Loc) :
                        @[simp]
                        theorem Spatial.Path.reverse_reverse {Loc : Type u_1} (p : Path Loc) :

                        Directions #

                        The direction heads of a path, in containment order, Goal built on Place, Source on Goal, and Route on Source.

                        • place : Direction

                          Place is static location, the base of the others.

                        • goal : Direction

                          Goal is motion to.

                        • source : Direction

                          Source is motion from.

                        • route : Direction

                          Route is motion via or past.

                        Instances For
                          @[instance_reducible]
                          Equations
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[instance_reducible]
                            Equations
                            • One or more equations did not get rendered due to their size.
                            def Spatial.Path.Direction.shells (d : Direction) :
                            Finset (Fin 4)

                            The heads a direction contains, a downward-closed stack.

                            Equations
                            Instances For
                              theorem Spatial.Path.Direction.lt_iff_shells_ssubset (d₁ d₂ : Direction) :
                              d₁.rank < d₂.rank ↔ d₁.shells ⊂ d₂.shells

                              Strict rank is strict inclusion of head stacks.

                              The direction of a path traversed the other way swaps Goal and Source and keeps Place and Route.

                              Equations
                              Instances For

                                Shapes #

                                How a path relates its run inside the region to its run outside.

                                • transitional : Transition

                                  The path changes its relation to the region, as to does.

                                • delimited : Transition

                                  The path changes it at one point, which bounds the motion, as up to does.

                                • nonTransitional : Transition

                                  The path does not change it, as towards does.

                                Instances For
                                  @[instance_reducible]
                                  Equations
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[instance_reducible]
                                    Equations
                                    • One or more equations did not get rendered due to their size.

                                    The eight shapes of a path relative to a region.

                                    • cofinal : Shape

                                      A cofinal path runs outside, then inside, as to does.

                                    • coinitial : Shape

                                      A coinitial path runs inside, then outside, as from does.

                                    • transitive : Shape

                                      A transitive path runs outside, inside and outside, as past does.

                                    • terminative : Shape

                                      A terminative path runs outside up to its goal, which is inside, as up to does.

                                    • egressive : Shape

                                      An egressive path starts inside and runs outside, as starting from does.

                                    • approximative : Shape

                                      An approximative path runs outside, nearer at each point, as towards does.

                                    • recessive : Shape

                                      A recessive path runs outside, farther at each point, as away from does.

                                    • prolative : Shape

                                      A prolative path runs inside throughout, as along does.

                                    Instances For
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      def Spatial.Path.instReprShape.repr :
                                      Shape → ℕ → Std.Format
                                      Equations
                                      Instances For
                                        theorem Spatial.Path.Shape.direction_transition_injective :
                                        Function.Injective fun (s : Shape) => (s.direction, s.transition)

                                        A shape is its direction and its transition.

                                        A direction and a transition make a shape exactly when the direction is not Place and a Route is not delimited.

                                        A shape is bounded when it has a transition, which makes the motion telic.

                                        Equations
                                        Instances For
                                          @[instance_reducible]
                                          Equations

                                          Shapes relative to a region #

                                          A path parametrized by a bounded linear order of positions, a sequence of places or a curve, has the shape its positions inside a region give it: a cofinal path's form an upper set, a coinitial path's a lower set, a transitive path's an interval inside the path.

                                          def Spatial.Path.IsCofinal {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] (R : Set α) (γ : ι → α) :

                                          A cofinal path starts outside R, ends inside it, and stays inside once in, as a path to R does.

                                          Equations
                                          Instances For
                                            def Spatial.Path.IsCoinitial {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] (R : Set α) (γ : ι → α) :

                                            A coinitial path starts inside R, ends outside it, and stays outside once out, as a path from R does.

                                            Equations
                                            Instances For
                                              def Spatial.Path.IsTransitive {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] (R : Set α) (γ : ι → α) :

                                              A transitive path starts and ends outside R and is inside it over one stretch, as a path past R is.

                                              Equations
                                              Instances For
                                                def Spatial.Path.IsTerminative {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] (R : Set α) (γ : ι → α) :

                                                A terminative path is inside R at its end only, as a path up to R is.

                                                Equations
                                                Instances For
                                                  def Spatial.Path.IsEgressive {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] (R : Set α) (γ : ι → α) :

                                                  An egressive path is inside R at its start only, as a path starting from R is.

                                                  Equations
                                                  Instances For
                                                    def Spatial.Path.IsProlative {ι : Type u_2} {α : Type u_4} (R : Set α) (γ : ι → α) :

                                                    A prolative path is inside R throughout, as a path along R is.

                                                    Equations
                                                    Instances For
                                                      def Spatial.Path.IsApproximative {ι : Type u_2} {α : Type u_4} {β : Type u_5} [LinearOrder ι] (R : Set α) (γ : ι → α) [Preorder β] (d : α → β) :

                                                      An approximative path is outside R throughout and nearer to it by d at each later position, as a path towards R is.

                                                      Equations
                                                      Instances For
                                                        def Spatial.Path.IsRecessive {ι : Type u_2} {α : Type u_4} {β : Type u_5} [LinearOrder ι] (R : Set α) (γ : ι → α) [Preorder β] (d : α → β) :

                                                        A recessive path is outside R throughout and farther from it by d at each later position, as a path away from R is.

                                                        Equations
                                                        Instances For
                                                          theorem Spatial.Path.IsTerminative.isCofinal {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] {R : Set α} {γ : ι → α} (h : IsTerminative R γ) :

                                                          A terminative path is cofinal.

                                                          theorem Spatial.Path.IsCofinal.not_isCoinitial {ι : Type u_2} {α : Type u_4} [LinearOrder ι] [BoundedOrder ι] {R : Set α} {γ : ι → α} (h : IsCofinal R γ) :

                                                          No path is both cofinal and coinitial.

                                                          theorem Spatial.Path.HasShape.comp {ι : Type u_2} {κ : Type u_3} {α : Type u_4} {β : Type u_5} [LinearOrder ι] [BoundedOrder ι] [LinearOrder κ] [BoundedOrder κ] {R : Set α} {γ : ι → α} [Preorder β] {d : α → β} {s : Shape} (h : HasShape R γ d s) (e : κ ≃o ι) :
                                                          HasShape R (γ ∘ ⇑e) d s

                                                          A path keeps its shape under reparametrization by an order isomorphism.

                                                          theorem Spatial.Path.hasShape_comp {ι : Type u_2} {κ : Type u_3} {α : Type u_4} {β : Type u_5} [LinearOrder ι] [BoundedOrder ι] [LinearOrder κ] [BoundedOrder κ] {R : Set α} {γ : ι → α} [Preorder β] {d : α → β} (e : κ ≃o ι) {s : Shape} :
                                                          HasShape R (γ ∘ ⇑e) d s ↔ HasShape R γ d s

                                                          Reparametrizing a path by an order isomorphism keeps its shape.

                                                          theorem Spatial.Path.hasShape_comp_ofDual {ι : Type u_2} {α : Type u_4} {β : Type u_5} [LinearOrder ι] [BoundedOrder ι] {R : Set α} {γ : ι → α} [Preorder β] {d : α → β} {s : Shape} :
                                                          HasShape R (γ ∘ ⇑OrderDual.ofDual) d s ↔ HasShape R γ d s.reverse

                                                          Traversing a path the other way, on the dual order of positions, reverses its shape.

                                                          Sequences of places as parametrized paths #

                                                          def Spatial.Path.toFun {Loc : Type u_2} (p : Path Loc) :
                                                          Fin (p.steps.length + 1) → Loc

                                                          A path's places, indexed by their positions.

                                                          Equations
                                                          Instances For
                                                            @[instance_reducible]
                                                            instance Spatial.Path.instCoeFunForallFinHAddNatLengthStepsOfNat {Loc : Type u_2} :
                                                            CoeFun (Path Loc) fun (p : Path Loc) => Fin (p.steps.length + 1) → Loc
                                                            Equations
                                                            @[simp]
                                                            theorem Spatial.Path.coe_bot {Loc : Type u_2} (p : Path Loc) :
                                                            p.toFun ⊥ = p.source
                                                            @[simp]
                                                            theorem Spatial.Path.coe_top {Loc : Type u_2} (p : Path Loc) :
                                                            p.toFun ⊤ = p.goal
                                                            theorem Spatial.Path.length_steps_reverse {Loc : Type u_2} (p : Path Loc) :
                                                            p.reverse.steps.length = p.steps.length
                                                            def Spatial.Path.revIso {Loc : Type u_2} (p : Path Loc) :
                                                            Fin (p.reverse.steps.length + 1) ≃o (Fin (p.steps.length + 1))ᵒᵈ

                                                            The positions of a reversed path, as an order isomorphism onto the dual of the path's.

                                                            Equations
                                                            • p.revIso = (Fin.castOrderIso ⋯).trans Fin.revOrderIso.symm
                                                            Instances For
                                                              theorem Spatial.Path.coe_reverse {Loc : Type u_2} (p : Path Loc) :
                                                              p.reverse.toFun = (p.toFun ∘ ⇑OrderDual.ofDual) ∘ ⇑p.revIso

                                                              A reversed path is the path read on the dual order of positions.

                                                              theorem Spatial.Path.hasShape_reverse {Loc : Type u_2} (p : Path Loc) {β : Type u_3} [Preorder β] {d : Loc → β} {R : Set Loc} {s : Shape} :

                                                              Reversing a path reverses its shape.

                                                              Localization #

                                                              The part of the reference object a spatial expression localizes in, orthogonal to the direction.

                                                              • interior : Localization

                                                                The interior, as of in, into and out of.

                                                              • surface : Localization

                                                                The surface, as of on, onto and off.

                                                              • exterior : Localization

                                                                The exterior, as of at, to and from.

                                                              Instances For
                                                                @[instance_reducible]
                                                                Equations
                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  class Event.SpatialTrace (E : Type u_1) (Loc : outParam (Type u_2)) :
                                                                  Type (max u_1 u_2)

                                                                  The spatial trace of an event domain E, which sends each event to the path its theme traverses.

                                                                  Instances