Documentation

Matroid.Graph.WList.TakeDrop.Defs

Cutting wLists Off #

def WList.prefixUntil {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
WList α β

Take the prefix ending at the first vertex satisfying a predicate P (or the entire wList if nothing satisfies P).

Equations
Instances For
    @[simp]
    theorem WList.prefixUntil_nil {α : Type u_1} {β : Type u_2} {u : α} {P : α → Prop} [DecidablePred P] :
    @[simp]
    theorem WList.prefixUntil_cons {α : Type u_1} {β : Type u_2} {x : α} {e : β} {P : α → Prop} [DecidablePred P] (w : WList α β) :
    (cons x e w).prefixUntil P = if P x then nil x else cons x e (w.prefixUntil P)
    def WList.prefixUntilVertex {α : Type u_1} {β : Type u_2} [DecidableEq α] (w : WList α β) (x : α) :
    WList α β

    The prefix of w ending at a vertex x. Equal to w if x ∉ w.

    Equations
    Instances For
      @[simp]
      theorem WList.prefixUntilVertex_nil {α : Type u_1} {β : Type u_2} {u x : α} [DecidableEq α] :
      @[simp]
      theorem WList.prefixUntilVertex_cons_eq_nil {α : Type u_1} {β : Type u_2} [DecidableEq α] (u : α) (e : β) (w : WList α β) :
      theorem WList.prefixUntilVertex_cons {α : Type u_1} {β : Type u_2} {x : α} [DecidableEq α] (u : α) (e : β) (w : WList α β) :
      def WList.suffixFrom {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
      WList α β

      Take the suffix starting at the first vertex satisfying a predicate P, (or the Nil wList on the last vertex if nothing satisfies P)

      Equations
      Instances For
        @[simp]
        theorem WList.suffixFrom_nil {α : Type u_1} {β : Type u_2} {u : α} {P : α → Prop} [DecidablePred P] :
        @[simp]
        theorem WList.suffixFrom_cons {α : Type u_1} {β : Type u_2} {x : α} {e : β} {P : α → Prop} [DecidablePred P] (w : WList α β) :
        (cons x e w).suffixFrom P = if P x then cons x e w else w.suffixFrom P
        theorem WList.suffixFrom_isSuffix {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
        def WList.suffixFromVertex {α : Type u_1} {β : Type u_2} [DecidableEq α] (w : WList α β) (x : α) :
        WList α β

        The suffix of w starting at the first occurence of a vertex x. Equal to [w.last] if x ∉ w.

        Equations
        Instances For
          @[simp]
          theorem WList.suffixFromVertex_nil {α : Type u_1} {β : Type u_2} {u x : α} [DecidableEq α] :
          theorem WList.suffixFromVertex_isSuffix {α : Type u_1} {β : Type u_2} [DecidableEq α] (w : WList α β) (x : α) :
          def WList.prefixUntilEdge {α : Type u_1} {β : Type u_2} (w : WList α β) (Q : β → Prop) [DecidablePred Q] :
          WList α β

          Take the prefix ending at the tail of the first edge satisfying Q. Equal to w if no edge satisfies Q.

          Equations
          Instances For
            @[simp]
            theorem WList.prefixUntilEdge_nil {α : Type u_1} {β : Type u_2} {u : α} {Q : β → Prop} [DecidablePred Q] :
            theorem WList.prefixUntilEdge_cons {α : Type u_1} {β : Type u_2} {x : α} {e : β} {Q : β → Prop} [DecidablePred Q] (w : WList α β) :
            @[simp]
            theorem WList.prefixUntilEdge_cons_true {α : Type u_1} {β : Type u_2} {x : α} {e : β} {w : WList α β} {Q : β → Prop} [DecidablePred Q] (he : Q e) :
            @[simp]
            theorem WList.prefixUntilEdge_cons_false {α : Type u_1} {β : Type u_2} {x : α} {e : β} {w : WList α β} {Q : β → Prop} [DecidablePred Q] (he : ¬Q e) :
            theorem WList.prefixUntilEdge_isPrefix {α : Type u_1} {β : Type u_2} (w : WList α β) (Q : β → Prop) [DecidablePred Q] :
            theorem WList.prefixUntilEdge_length_lt {α : Type u_1} {β : Type u_2} {w : WList α β} {Q : β → Prop} [DecidablePred Q] (hQ : ∃ e ∈ w.edgeSet, Q e) :
            def WList.suffixFromEdge {α : Type u_1} {β : Type u_2} (w : WList α β) (Q : β → Prop) [DecidablePred Q] :
            WList α β

            Take the suffix starting at the head of the first edge satisfying Q. Equal to nil w.last if no edge satisfies Q.

            Equations
            Instances For
              @[simp]
              theorem WList.suffixFromEdge_nil {α : Type u_1} {β : Type u_2} {u : α} {Q : β → Prop} [DecidablePred Q] :
              theorem WList.suffixFromEdge_cons {α : Type u_1} {β : Type u_2} {x : α} {e : β} {Q : β → Prop} [DecidablePred Q] (w : WList α β) :
              @[simp]
              theorem WList.suffixFromEdge_cons_true {α : Type u_1} {β : Type u_2} {x : α} {e : β} {w : WList α β} {Q : β → Prop} [DecidablePred Q] (he : Q e) :
              (cons x e w).suffixFromEdge Q = w
              @[simp]
              theorem WList.suffixFromEdge_cons_false {α : Type u_1} {β : Type u_2} {x : α} {e : β} {w : WList α β} {Q : β → Prop} [DecidablePred Q] (he : ¬Q e) :
              theorem WList.suffixFromEdge_isSuffix {α : Type u_1} {β : Type u_2} (w : WList α β) (Q : β → Prop) [DecidablePred Q] :
              theorem WList.suffixFromEdge_length_lt {α : Type u_1} {β : Type u_2} {w : WList α β} {Q : β → Prop} [DecidablePred Q] (hQ : ∃ e ∈ w.edgeSet, Q e) :
              def WList.prefixUntilEdgeLabel {α : Type u_1} {β : Type u_2} [DecidableEq β] (w : WList α β) (e : β) :
              WList α β

              The prefix of w ending just before the first occurrence of edge e. Equal to w if e ∉ w.edge.

              Equations
              Instances For
                def WList.suffixFromEdgeLabel {α : Type u_1} {β : Type u_2} [DecidableEq β] (w : WList α β) (e : β) :
                WList α β

                The suffix of w starting just after the first occurrence of edge e. Equal to nil w.last if e ∉ w.edge.

                Equations
                Instances For
                  def WList.prefixUntilLast {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
                  WList α β

                  Take the prefix of w ending at the last occurence of x in w. Equal to w if x ∉ w.

                  Equations
                  Instances For
                    def WList.suffixFromLast {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
                    WList α β

                    Take the suffix of w starting at the last occurence of P in w. If P never occurs, this is all of w.

                    Equations
                    Instances For
                      def WList.tail {α : Type u_1} {β : Type u_2} :
                      WList α β → WList α β

                      Remove the first vertex and edge from a wList

                      Equations
                      Instances For
                        @[simp]
                        theorem WList.tail_nil {α : Type u_1} {β : Type u_2} (x : α) :
                        (nil x).tail = nil x
                        @[simp]
                        theorem WList.tail_cons {α : Type u_1} {β : Type u_2} (x : α) (e : β) (w : WList α β) :
                        (cons x e w).tail = w
                        theorem WList.edgeMap_tail {α : Type u_1} {β : Type u_2} {β' : Type u_3} (w : WList α β) (σ : β → β') :
                        (edgeMap σ w).tail = edgeMap σ w.tail
                        theorem WList.map_tail {α : Type u_1} {β : Type u_2} {α' : Type u_3} (w : WList α β) (f : α → α') :
                        (map f w).tail = map f w.tail
                        def WList.dropLast {α : Type u_1} {β : Type u_2} :
                        WList α β → WList α β

                        Remove the last edge and vertex from a wList. This is the reverse of the reversed tail.

                        Equations
                        Instances For
                          @[simp]
                          theorem WList.dropLast_nil {α : Type u_1} {β : Type u_2} {x : α} :
                          @[simp]
                          theorem WList.dropLast_cons_nil {α : Type u_1} {β : Type u_2} {x y : α} {e : β} :
                          (cons x e (nil y)).dropLast = nil x
                          @[simp]
                          theorem WList.dropLast_cons_cons {α : Type u_1} {β : Type u_2} {x y : α} {e e' : β} {w : WList α β} :
                          (cons x e (cons y e' w)).dropLast = cons x e (cons y e' w).dropLast
                          def WList.take {α : Type u_1} {β : Type u_2} :
                          WList α β → ℕ → WList α β

                          Take the first n vertices from a WList. Returns the entire list if n ≥ w.length + 1.

                          Equations
                          Instances For
                            @[simp]
                            theorem WList.take_nil {α : Type u_1} {β : Type u_2} (x : α) (n : ℕ) :
                            (nil x).take n = nil x
                            @[simp]
                            theorem WList.take_zero {α : Type u_1} {β : Type u_2} (w : WList α β) :
                            w.take 0 = nil w.first
                            @[simp]
                            theorem WList.take_cons_succ {α : Type u_1} {β : Type u_2} (x : α) (e : β) (w : WList α β) (n : ℕ) :
                            (cons x e w).take (n + 1) = cons x e (w.take n)
                            def WList.drop {α : Type u_1} {β : Type u_2} :
                            WList α β → ℕ → WList α β

                            Drop the first n vertices from a WList. Returns nil w.last if n ≥ w.length + 1.

                            Equations
                            Instances For
                              @[simp]
                              theorem WList.drop_zero {α : Type u_1} {β : Type u_2} (w : WList α β) :
                              w.drop 0 = w
                              @[simp]
                              theorem WList.drop_nil {α : Type u_1} {β : Type u_2} (x : α) (n : ℕ) :
                              (nil x).drop n = nil x
                              @[simp]
                              theorem WList.drop_cons_succ {α : Type u_1} {β : Type u_2} (x : α) (e : β) (w : WList α β) (n : ℕ) :
                              (cons x e w).drop (n + 1) = w.drop n
                              @[irreducible]
                              def WList.dedup {α : Type u_1} {β : Type u_2} [DecidableEq α] :
                              WList α β → WList α β

                              Remove duplicate vertices from a WList to give a duplicate-free sublist.

                              Equations
                              Instances For
                                @[simp]
                                theorem WList.dedup_nil {α : Type u_1} {β : Type u_2} [DecidableEq α] (x : α) :
                                (nil x).dedup = nil x