def WList.betweenSets {α : Type u_1} {β : Type u_2} (w : WList α β) (S T : Set α) [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] :
WList α β
Equations
- w.betweenSets S T = (w.suffixFromLast fun (x : α) => x ∈ S).prefixUntil fun (x : α) => x ∈ T
Instances For
@[simp]
theorem WList.betweenSets_isInfix {α : Type u_1} {β : Type u_2} (w : WList α β) (S T : Set α) [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] :
(w.betweenSets S T).IsInfix w
theorem WList.betweenSets_first_mem_iff {α : Type u_1} {β : Type u_2} (w : WList α β) (S T : Set α) [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] :
theorem WList.betweenSets_first_mem {α : Type u_1} {β : Type u_2} {w : WList α β} {S T : Set α} [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hw : ∃ x ∈ w, x ∈ S) :
theorem WList.betweenSets_first_eq_of_mem {α : Type u_1} {β : Type u_2} {v : α} {w : WList α β} {S T : Set α} [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hv : v ∈ w.betweenSets S T) (hvS : v ∈ S) :
theorem WList.betweenSets_first_eq_iff_mem {α : Type u_1} {β : Type u_2} {v : α} {w : WList α β} {S T : Set α} [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hw : ∃ x ∈ w, x ∈ S) :
theorem WList.betweenSets_vertex_tail_not_prop {α : Type u_1} {β : Type u_2} (w : WList α β) (S T : Set α) [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (x : α) :
x ∈ (w.betweenSets S T).vertex.tail → x ∉ S
theorem WList.betweenSets_last_mem {α : Type u_1} {β : Type u_2} {w : WList α β} {S T : Set α} [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hw : ∃ u ∈ w.suffixFromLast fun (x : α) => x ∈ S, u ∈ T) :
theorem WList.betweenSets_last_eq_of_mem {α : Type u_1} {β : Type u_2} {v : α} {w : WList α β} {S T : Set α} [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hv : v ∈ w.betweenSets S T) (hvT : v ∈ T) :
theorem WList.betweenSets_last_eq_iff_mem {α : Type u_1} {β : Type u_2} {v : α} {w : WList α β} {S T : Set α} [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hw : ∃ u ∈ w.suffixFromLast fun (x : α) => x ∈ S, u ∈ T) :
theorem WList.betweenSets_vertex_dropLast_not_prop {α : Type u_1} {β : Type u_2} (w : WList α β) (S T : Set α) [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (x : α) :
x ∈ (w.betweenSets S T).vertex.dropLast → x ∉ T
theorem WList.betweenSets_isPrefix_iff {α : Type u_1} {β : Type u_2} {w : WList α β} (S T : Set α) [DecidablePred fun (x : α) => x ∈ S] [DecidablePred fun (x : α) => x ∈ T] (hnd : w.vertex.Nodup) :
def WList.breakAt_aux {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) (L : List (WList α β)) :
Equations
- (WList.nil x).breakAt_aux P e' w' L = if P x then WList.nil x :: WList.cons x e' w' :: L else WList.cons x e' w' :: L
- (WList.cons x e w_2).breakAt_aux P e' w' L = if P x then w_2.breakAt_aux P e (WList.nil x) (WList.cons x e' w' :: L) else w_2.breakAt_aux P e (WList.cons x e' w') L
Instances For
@[simp]
theorem WList.breakAt_aux_length {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) (L : List (WList α β)) :
(w.breakAt_aux P e' w' L).length = List.countP (fun (b : α) => decide (P b)) w.vertex + L.length + 1
theorem WList.breakAt_aux_append {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) (L : List (WList α β)) :
theorem WList.breakAt_aux_eq_concat {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' w'' : WList α β) :
@[simp]
theorem WList.breakAt_aux_foldl {α : Type u_1} {β : Type u_2} {x : α} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) :
theorem WList.breakAt_aux_ne_nil' {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) :
@[simp]
theorem WList.breakAt_aux_ne_nil {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) (L : List (WList α β)) :
theorem WList.breakAt_aux_getLast {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) :
theorem WList.breakAt_aux_head {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] (e' : β) (w' : WList α β) :
theorem WList.breakAt_aux_isChain_eq {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] {e' : β} {w' : WList α β} :
List.IsChain (fun (x1 x2 : WList α β) => x1.last = x2.first) (w.breakAt_aux P e' w' [])
theorem WList.nonempty_of_mem_breakAt_aux_tail {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] {e' : β} {w' Q : WList α β} (hQ : Q ∈ (w.breakAt_aux P e' w' []).tail) :
Q.Nonempty
theorem WList.breakAt_aux_map_first_eq_vertex_filter {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] {e' : β} {w' : WList α β} :
The segmentation of w breaks w at every vertex satisfying P and returns
the list of segments. With the possible exception of the first and the last segment,
all segments have the endpoints satisfying P.
If P never occurs, this is [w].
If w.first satisfies P, then the first segment is nil w.first.
Similarly, if w.last satisfies P, then the last segment is nil w.last.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem WList.breakAt_reverse_length {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
@[simp]
theorem WList.breakAt_length {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.breakAt_reverse_foldl_append_cancel {α : Type u_1} {β : Type u_2} {x : α} (w : WList α β) (P : α → Prop) [DecidablePred P] :
@[simp]
theorem WList.breakAt_foldl_append_cancel {α : Type u_1} {β : Type u_2} {x : α} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.breakAt_reverse_getLast {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.breakAt_getLast {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.breakAt_reverse_head {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
@[simp]
theorem WList.breakAt_head {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.breakAt_reverse_isChain_eq {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.breakAt_isChain_eq {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
@[simp]
theorem WList.decomposeTo_breakAt {α : Type u_1} {β : Type u_2} [Inhabited α] (w : WList α β) (P : α → Prop) [DecidablePred P] :
w.DecomposeTo (w.breakAt P)
theorem WList.breakAt_tail_map_first_eq_vertex_filter {α : Type u_1} {β : Type u_2} (w : WList α β) (P : α → Prop) [DecidablePred P] :
theorem WList.exists_infix_of_exists_prop {α : Type u_1} {β : Type u_2} {w : WList α β} {p q : α → Prop} (hp : ∃ x ∈ w, p x) (hq : ∃ x ∈ w, q x) :