File: .lake/packages/batteries/Batteries/Data/List/Pairwise.lean

full_name: List.rel_of_pairwise_cons
code: theorem rel_of_pairwise_cons (p : (a :: l).Pairwise R) : ∀ {a'}, a' ∈ l → R a a' 
goal: ∀ {α : Type u_1} {a : α} {l : List α} {R : α → α → Prop}, List.Pairwise R (a :: l) → ∀ {a' : α}, a' ∈ l → R a a'

full_name: List.Pairwise.of_cons
code: theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l 
goal: ∀ {α : Type u_1} {a : α} {l : List α} {R : α → α → Prop}, List.Pairwise R (a :: l) → List.Pairwise R l

full_name: List.Pairwise.tail
code: theorem Pairwise.tail : ∀ {l : List α} (_p : Pairwise R l), Pairwise R l.tail
  
goal: List.Pairwise R l.tail

full_name: List.Pairwise.drop
code: theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n)
  
goal: List.Pairwise R l → List.Pairwise R (List.drop n l)

full_name: List.Pairwise.imp_of_mem
code: theorem Pairwise.imp_of_mem {S : α → α → Prop}
    (H : ∀ {a b}, a ∈ l → b ∈ l → R a b → S a b) (p : Pairwise R l) : Pairwise S l 
goal: List.Pairwise S l

full_name: List.Pairwise.and
code: theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) :
    l.Pairwise fun a b => R a b ∧ S a b 
goal: ∀ {α : Type u_1} {R : α → α → Prop} {l : List α} {S : α → α → Prop},
  List.Pairwise R l → List.Pairwise S l → List.Pairwise (fun a b => R a b ∧ S a b) l

full_name: List.pairwise_and_iff
code: theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l 
goal: ∀ {α : Type u_1} {R : α → α → Prop} {l : List α} {S : α → α → Prop},
  List.Pairwise (fun a b => R a b ∧ S a b) l ↔ List.Pairwise R l ∧ List.Pairwise S l

full_name: List.Pairwise.imp₂
code: theorem Pairwise.imp₂ (H : ∀ a b, R a b → S a b → T a b)
    (hR : Pairwise R l) (hS : l.Pairwise S) : l.Pairwise T 
goal: ∀ {α : Type u_1} {R S T : α → α → Prop} {l : List α},
  (∀ (a b : α), R a b → S a b → T a b) → List.Pairwise R l → List.Pairwise S l → List.Pairwise T l

full_name: List.Pairwise.iff_of_mem
code: theorem Pairwise.iff_of_mem {S : α → α → Prop} {l : List α}
    (H : ∀ {a b}, a ∈ l → b ∈ l → (R a b ↔ S a b)) : Pairwise R l ↔ Pairwise S l 
goal: List.Pairwise R l ↔ List.Pairwise S l

full_name: List.Pairwise.iff
code: theorem Pairwise.iff {S : α → α → Prop} (H : ∀ a b, R a b ↔ S a b) {l : List α} :
    Pairwise R l ↔ Pairwise S l 
goal: List.Pairwise R l ↔ List.Pairwise S l

full_name: List.pairwise_of_forall
code: theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l 
goal: List.Pairwise R l

full_name: List.Pairwise.and_mem
code: theorem Pairwise.and_mem {l : List α} :
    Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l 
goal: List.Pairwise R l ↔ List.Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l

full_name: List.Pairwise.imp_mem
code: theorem Pairwise.imp_mem {l : List α} :
    Pairwise R l ↔ Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l 
goal: List.Pairwise R l ↔ List.Pairwise (fun x y => x ∈ l → y ∈ l → R x y) l

full_name: List.Pairwise.forall_of_forall_of_flip
code: theorem Pairwise.forall_of_forall_of_flip (h₁ : ∀ x ∈ l, R x x) (h₂ : Pairwise R l)
    (h₃ : l.Pairwise (flip R)) : ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → R x y 
goal: ∀ {α : Type u_1} {l : List α} {R : α → α → Prop},
  (∀ (x : α), x ∈ l → R x x) →
    List.Pairwise R l → List.Pairwise (flip R) l → ∀ ⦃x : α⦄, x ∈ l → ∀ ⦃y : α⦄, y ∈ l → R x y

full_name: List.pairwise_singleton
code: theorem pairwise_singleton (R) (a : α) : Pairwise R [a] 
goal: List.Pairwise R [a]

full_name: List.pairwise_pair
code: theorem pairwise_pair {a b : α} : Pairwise R [a, b] ↔ R a b 
goal: List.Pairwise R [a, b] ↔ R a b

full_name: List.pairwise_append_comm
code: theorem pairwise_append_comm {R : α → α → Prop} (s : ∀ {x y}, R x y → R y x) {l₁ l₂ : List α} :
    Pairwise R (l₁ ++ l₂) ↔ Pairwise R (l₂ ++ l₁) 
goal: List.Pairwise R (l₁ ++ l₂) ↔ List.Pairwise R (l₂ ++ l₁)

full_name: List.pairwise_middle
code: theorem pairwise_middle {R : α → α → Prop} (s : ∀ {x y}, R x y → R y x) {a : α} {l₁ l₂ : List α} :
    Pairwise R (l₁ ++ a :: l₂) ↔ Pairwise R (a :: (l₁ ++ l₂)) 
goal: List.Pairwise R (l₁ ++ a :: l₂) ↔ List.Pairwise R (a :: (l₁ ++ l₂))

full_name: List.Pairwise.of_map
code: theorem Pairwise.of_map {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, S (f a) (f b) → R a b)
    (p : Pairwise S (map f l)) : Pairwise R l 
goal: List.Pairwise R l

full_name: List.Pairwise.map
code: theorem Pairwise.map {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, R a b → S (f a) (f b))
    (p : Pairwise R l) : Pairwise S (map f l) 
goal: List.Pairwise S (List.map f l)

full_name: List.pairwise_filterMap
code: theorem pairwise_filterMap (f : β → Option α) {l : List β} :
    Pairwise R (filterMap f l) ↔ Pairwise (fun a a' : β => ∀ b ∈ f a, ∀ b' ∈ f a', R b b') l 
goal: List.Pairwise R (List.filterMap f l) ↔ List.Pairwise (fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b') l

full_name: List.Pairwise.filter_map
code: theorem Pairwise.filter_map {S : β → β → Prop} (f : α → Option β)
    (H : ∀ a a' : α, R a a' → ∀ b ∈ f a, ∀ b' ∈ f a', S b b') {l : List α} (p : Pairwise R l) :
    Pairwise S (filterMap f l) 
goal: List.Pairwise S (List.filterMap f l)

full_name: List.pairwise_filter
code: theorem pairwise_filter (p : α → Prop) [DecidablePred p] {l : List α} :
    Pairwise R (filter p l) ↔ Pairwise (fun x y => p x → p y → R x y) l 
goal: List.Pairwise R (List.filter (fun b => decide (p b)) l) ↔ List.Pairwise (fun x y => p x → p y → R x y) l

full_name: List.Pairwise.filter
code: theorem Pairwise.filter (p : α → Bool) : Pairwise R l → Pairwise R (filter p l) 
goal: List.Pairwise R l → List.Pairwise R (List.filter p l)

full_name: List.pairwise_join
code: theorem pairwise_join {L : List (List α)} :
    Pairwise R (join L) ↔
      (∀ l ∈ L, Pairwise R l) ∧ Pairwise (fun l₁ l₂ => ∀ x ∈ l₁, ∀ y ∈ l₂, R x y) L 
goal: List.Pairwise R L.join ↔
  (∀ (l : List α), l ∈ L → List.Pairwise R l) ∧
    List.Pairwise (fun l₁ l₂ => ∀ (x : α), x ∈ l₁ → ∀ (y : α), y ∈ l₂ → R x y) L

full_name: List.pairwise_bind
code: theorem pairwise_bind {R : β → β → Prop} {l : List α} {f : α → List β} :
    List.Pairwise R (l.bind f) ↔
      (∀ a ∈ l, Pairwise R (f a)) ∧ Pairwise (fun a₁ a₂ => ∀ x ∈ f a₁, ∀ y ∈ f a₂, R x y) l 
goal: List.Pairwise R (l.bind f) ↔
  (∀ (a : α), a ∈ l → List.Pairwise R (f a)) ∧
    List.Pairwise (fun a₁ a₂ => ∀ (x : β), x ∈ f a₁ → ∀ (y : β), y ∈ f a₂ → R x y) l

full_name: List.pairwise_iff_forall_sublist
code: theorem pairwise_iff_forall_sublist : l.Pairwise R ↔ (∀ {a b}, [a,b] <+ l → R a b) 
goal: ∀ {α : Type u_1} {l : List α} {R : α → α → Prop}, List.Pairwise R l ↔ ∀ {a b : α}, [a, b] <+ l → R a b

full_name: List.pairwise_of_reflexive_on_dupl_of_forall_ne
code: @[deprecated pairwise_iff_forall_sublist (since := "2023-09-18")]
theorem pairwise_of_reflexive_on_dupl_of_forall_ne [DecidableEq α] {l : List α} {r : α → α → Prop}
    (hr : ∀ a, 1 < count a l → r a a) (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r 
goal: List.Pairwise r l

full_name: List.map_get_sublist
code: /-- given a list `is` of monotonically increasing indices into `l`, getting each index
  produces a sublist of `l`.  -/
theorem map_get_sublist {l : List α} {is : List (Fin l.length)} (h : is.Pairwise (·.val < ·.val)) :
    is.map (get l) <+ l 
goal: List.map l.get is <+ l

full_name: List.sublist_eq_map_get
code: /-- given a sublist `l' <+ l`, there exists a list of indices `is` such that
  `l' = map (get l) is`. -/
theorem sublist_eq_map_get (h : l' <+ l) : ∃ is : List (Fin l.length),
    l' = map (get l) is ∧ is.Pairwise (· < ·) 
goal: ∀ {α : Type u_1} {l' l : List α}, l' <+ l → ∃ is, l' = List.map l.get is ∧ List.Pairwise (fun x x_1 => x < x_1) is

full_name: List.pairwise_iff_getElem
code: theorem pairwise_iff_getElem : Pairwise R l ↔
    ∀ (i j : Nat) (_hi : i < l.length) (_hj : j < l.length) (_hij : i < j), R l[i] l[j] 
goal: ∀ {α : Type u_1} {R : α → α → Prop} {l : List α},
  List.Pairwise R l ↔ ∀ (i j : Nat) (_hi : i < l.length) (_hj : j < l.length), i < j → R l[i] l[j]

full_name: List.pairwise_iff_get
code: theorem pairwise_iff_get : Pairwise R l ↔ ∀ (i j) (_hij : i < j), R (get l i) (get l j) 
goal: ∀ {α : Type u_1} {R : α → α → Prop} {l : List α},
  List.Pairwise R l ↔ ∀ (i j : Fin l.length), i < j → R (l.get i) (l.get j)

full_name: List.pairwise_replicate
code: theorem pairwise_replicate {α : Type _} {r : α → α → Prop} {x : α} (hx : r x x) :
    ∀ n : Nat, Pairwise r (List.replicate n x)
  
goal: List.Pairwise r (List.replicate n x)

full_name: List.pwFilter_nil
code: @[simp] theorem pwFilter_nil [DecidableRel R] : pwFilter R [] = [] 
goal: ∀ {α : Type u_1} {R : α → α → Prop} [inst : DecidableRel R], List.pwFilter R [] = []

full_name: List.pwFilter_cons_of_pos
code: @[simp] theorem pwFilter_cons_of_pos [DecidableRel (α := α) R] {a : α} {l : List α}
    (h : ∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = a :: pwFilter R l 
goal: List.pwFilter R (a :: l) = a :: List.pwFilter R l

full_name: List.pwFilter_cons_of_neg
code: @[simp] theorem pwFilter_cons_of_neg [DecidableRel (α := α) R] {a : α} {l : List α}
    (h : ¬∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = pwFilter R l 
goal: List.pwFilter R (a :: l) = List.pwFilter R l

full_name: List.pwFilter_map
code: theorem pwFilter_map [DecidableRel (α := α) R] (f : β → α) :
    ∀ l : List β, pwFilter R (map f l) = map f (pwFilter (fun x y => R (f x) (f y)) l)
  
goal: List.pwFilter R (List.map f l) = List.map f (List.pwFilter (fun x y => R (f x) (f y)) l)

full_name: List.pwFilter_sublist
code: theorem pwFilter_sublist [DecidableRel (α := α) R] : ∀ l : List α, pwFilter R l <+ l
  
goal: List.pwFilter R l <+ l

full_name: List.pwFilter_subset
code: theorem pwFilter_subset [DecidableRel (α := α) R] (l : List α) : pwFilter R l ⊆ l 
goal: List.pwFilter R l ⊆ l

full_name: List.pairwise_pwFilter
code: theorem pairwise_pwFilter [DecidableRel (α := α) R] : ∀ l : List α, Pairwise R (pwFilter R l)
  
goal: List.Pairwise R (List.pwFilter R l)

full_name: List.pwFilter_eq_self
code: theorem pwFilter_eq_self [DecidableRel (α := α) R] {l : List α} :
    pwFilter R l = l ↔ Pairwise R l 
goal: List.pwFilter R l = l ↔ List.Pairwise R l

full_name: List.pwFilter_idem
code: @[simp] theorem pwFilter_idem [DecidableRel (α := α) R] :
    pwFilter R (pwFilter R l) = pwFilter R l 
goal: List.pwFilter R (List.pwFilter R l) = List.pwFilter R l

full_name: List.forall_mem_pwFilter
code: theorem forall_mem_pwFilter [DecidableRel (α := α) R]
    (neg_trans : ∀ {x y z}, R x z → R x y ∨ R y z) (a : α) (l : List α) :
    (∀ b ∈ pwFilter R l, R a b) ↔ ∀ b ∈ l, R a b 
goal: (∀ (b : α), b ∈ List.pwFilter R l → R a b) ↔ ∀ (b : α), b ∈ l → R a b