File: Mathlib/Data/List/Forall2.lean

full_name: List.Forall₂.imp
code: theorem Forall₂.imp (H : ∀ a b, R a b → S a b) {l₁ l₂} (h : Forall₂ R l₁ l₂) : Forall₂ S l₁ l₂ 
goal: List.Forall₂ S l₁ l₂

full_name: List.Forall₂.mp
code: theorem Forall₂.mp {Q : α → β → Prop} (h : ∀ a b, Q a b → R a b → S a b) :
    ∀ {l₁ l₂}, Forall₂ Q l₁ l₂ → Forall₂ R l₁ l₂ → Forall₂ S l₁ l₂
  
goal: List.Forall₂ Q l₁ l₂ → List.Forall₂ R l₁ l₂ → List.Forall₂ S l₁ l₂

full_name: List.Forall₂.flip
code: theorem Forall₂.flip : ∀ {a b}, Forall₂ (flip R) b a → Forall₂ R a b
  
goal: List.Forall₂ (flip R) b a → List.Forall₂ R a b

full_name: List.forall₂_same
code: @[simp]
theorem forall₂_same : ∀ {l : List α}, Forall₂ Rₐ l l ↔ ∀ x ∈ l, Rₐ x x
  
goal: List.Forall₂ Rₐ l l ↔ ∀ (x : α), x ∈ l → Rₐ x x

full_name: List.forall₂_refl
code: theorem forall₂_refl [IsRefl α Rₐ] (l : List α) : Forall₂ Rₐ l l 
goal: List.Forall₂ Rₐ l l

full_name: List.forall₂_eq_eq_eq
code: @[simp]
theorem forall₂_eq_eq_eq : Forall₂ ((· = ·) : α → α → Prop) = Eq 
goal: (List.Forall₂ fun x x_1 => x = x_1) = Eq

full_name: List.forall₂_nil_left_iff
code: @[simp]
theorem forall₂_nil_left_iff {l} : Forall₂ R nil l ↔ l = nil 
goal: List.Forall₂ R [] l ↔ l = []

full_name: List.forall₂_nil_right_iff
code: @[simp]
theorem forall₂_nil_right_iff {l} : Forall₂ R l nil ↔ l = nil 
goal: List.Forall₂ R l [] ↔ l = []

full_name: List.forall₂_cons_left_iff
code: theorem forall₂_cons_left_iff {a l u} :
    Forall₂ R (a :: l) u ↔ ∃ b u', R a b ∧ Forall₂ R l u' ∧ u = b :: u' 
goal: List.Forall₂ R (a :: l) u ↔ ∃ b u', R a b ∧ List.Forall₂ R l u' ∧ u = b :: u'

full_name: List.forall₂_cons_right_iff
code: theorem forall₂_cons_right_iff {b l u} :
    Forall₂ R u (b :: l) ↔ ∃ a u', R a b ∧ Forall₂ R u' l ∧ u = a :: u' 
goal: List.Forall₂ R u (b :: l) ↔ ∃ a u', R a b ∧ List.Forall₂ R u' l ∧ u = a :: u'

full_name: List.forall₂_and_left
code: theorem forall₂_and_left {p : α → Prop} :
    ∀ l u, Forall₂ (fun a b => p a ∧ R a b) l u ↔ (∀ a ∈ l, p a) ∧ Forall₂ R l u
  
goal: List.Forall₂ (fun a b => p a ∧ R a b) l u ↔ (∀ (a : α), a ∈ l → p a) ∧ List.Forall₂ R l u

full_name: List.forall₂_map_left_iff
code: @[simp]
theorem forall₂_map_left_iff {f : γ → α} :
    ∀ {l u}, Forall₂ R (map f l) u ↔ Forall₂ (fun c b => R (f c) b) l u
  
goal: List.Forall₂ R (List.map f l) u ↔ List.Forall₂ (fun c b => R (f c) b) l u

full_name: List.forall₂_map_right_iff
code: @[simp]
theorem forall₂_map_right_iff {f : γ → β} :
    ∀ {l u}, Forall₂ R l (map f u) ↔ Forall₂ (fun a c => R a (f c)) l u
  
goal: List.Forall₂ R l (List.map f u) ↔ List.Forall₂ (fun a c => R a (f c)) l u

full_name: List.left_unique_forall₂'
code: theorem left_unique_forall₂' (hr : LeftUnique R) : ∀ {a b c}, Forall₂ R a c → Forall₂ R b c → a = b
  
goal: List.Forall₂ R a c → List.Forall₂ R b c → a = b

full_name: Relator.LeftUnique.forall₂
code: theorem _root_.Relator.LeftUnique.forall₂ (hr : LeftUnique R) : LeftUnique (Forall₂ R) 
goal: Relator.LeftUnique (List.Forall₂ R)

full_name: List.right_unique_forall₂'
code: theorem right_unique_forall₂' (hr : RightUnique R) :
    ∀ {a b c}, Forall₂ R a b → Forall₂ R a c → b = c
  
goal: List.Forall₂ R a b → List.Forall₂ R a c → b = c

full_name: Relator.RightUnique.forall₂
code: theorem _root_.Relator.RightUnique.forall₂ (hr : RightUnique R) : RightUnique (Forall₂ R) 
goal: Relator.RightUnique (List.Forall₂ R)

full_name: Relator.BiUnique.forall₂
code: theorem _root_.Relator.BiUnique.forall₂ (hr : BiUnique R) : BiUnique (Forall₂ R) 
goal: Relator.BiUnique (List.Forall₂ R)

full_name: List.Forall₂.length_eq
code: theorem Forall₂.length_eq : ∀ {l₁ l₂}, Forall₂ R l₁ l₂ → length l₁ = length l₂
  
goal: List.Forall₂ R l₁ l₂ → l₁.length = l₂.length

full_name: List.Forall₂.get
code: theorem Forall₂.get :
    ∀ {x : List α} {y : List β}, Forall₂ R x y →
      ∀ ⦃i : ℕ⦄ (hx : i < x.length) (hy : i < y.length), R (x.get ⟨i, hx⟩) (y.get ⟨i, hy⟩)
  
goal: List.Forall₂ R x y → ∀ ⦃i : ℕ⦄ (hx : i < x.length) (hy : i < y.length), R (x.get ⟨i, hx⟩) (y.get ⟨i, hy⟩)

full_name: List.Forall₂.nthLe
code: @[deprecated (since := "2024-05-05")] theorem Forall₂.nthLe {x y} (h : Forall₂ R x y) ⦃i : ℕ⦄
    (hx : i < x.length) (hy : i < y.length) : R (x.nthLe i hx) (y.nthLe i hy) 
goal: R (x.nthLe i hx) (y.nthLe i hy)

full_name: List.forall₂_of_length_eq_of_get
code: theorem forall₂_of_length_eq_of_get :
    ∀ {x : List α} {y : List β},
      x.length = y.length → (∀ i h₁ h₂, R (x.get ⟨i, h₁⟩) (y.get ⟨i, h₂⟩)) → Forall₂ R x y
  
goal: x.length = y.length →
  (∀ (i : ℕ) (h₁ : i < x.length) (h₂ : i < y.length), R (x.get ⟨i, h₁⟩) (y.get ⟨i, h₂⟩)) → List.Forall₂ R x y

full_name: List.forall₂_of_length_eq_of_nthLe
code: @[deprecated (since := "2024-05-05")] theorem forall₂_of_length_eq_of_nthLe {x y}
    (H : x.length = y.length) (H' : ∀ i h₁ h₂, R (x.nthLe i h₁) (y.nthLe i h₂)) :
    Forall₂ R x y 
goal: List.Forall₂ R x y

full_name: List.forall₂_iff_get
code: theorem forall₂_iff_get {l₁ : List α} {l₂ : List β} :
    Forall₂ R l₁ l₂ ↔ l₁.length = l₂.length ∧ ∀ i h₁ h₂, R (l₁.get ⟨i, h₁⟩) (l₂.get ⟨i, h₂⟩) 
goal: List.Forall₂ R l₁ l₂ ↔
  l₁.length = l₂.length ∧ ∀ (i : ℕ) (h₁ : i < l₁.length) (h₂ : i < l₂.length), R (l₁.get ⟨i, h₁⟩) (l₂.get ⟨i, h₂⟩)

full_name: List.forall₂_iff_nthLe
code: @[deprecated (since := "2024-05-05")] theorem forall₂_iff_nthLe {l₁ : List α} {l₂ : List β} :
    Forall₂ R l₁ l₂ ↔ l₁.length = l₂.length ∧ ∀ i h₁ h₂, R (l₁.nthLe i h₁) (l₂.nthLe i h₂) 
goal: List.Forall₂ R l₁ l₂ ↔
  l₁.length = l₂.length ∧ ∀ (i : ℕ) (h₁ : i < l₁.length) (h₂ : i < l₂.length), R (l₁.nthLe i h₁) (l₂.nthLe i h₂)

full_name: List.forall₂_zip
code: theorem forall₂_zip : ∀ {l₁ l₂}, Forall₂ R l₁ l₂ → ∀ {a b}, (a, b) ∈ zip l₁ l₂ → R a b
  
goal: List.Forall₂ R l₁ l₂ → ∀ {a : α} {b : β}, (a, b) ∈ l₁.zip l₂ → R a b

full_name: List.forall₂_iff_zip
code: theorem forall₂_iff_zip {l₁ l₂} :
    Forall₂ R l₁ l₂ ↔ length l₁ = length l₂ ∧ ∀ {a b}, (a, b) ∈ zip l₁ l₂ → R a b 
goal: List.Forall₂ R l₁ l₂ ↔ l₁.length = l₂.length ∧ ∀ {a : α} {b : β}, (a, b) ∈ l₁.zip l₂ → R a b

full_name: List.forall₂_take
code: theorem forall₂_take : ∀ (n) {l₁ l₂}, Forall₂ R l₁ l₂ → Forall₂ R (take n l₁) (take n l₂)
  
goal: List.Forall₂ R l₁ l₂ → List.Forall₂ R (List.take n l₁) (List.take n l₂)

full_name: List.forall₂_drop
code: theorem forall₂_drop : ∀ (n) {l₁ l₂}, Forall₂ R l₁ l₂ → Forall₂ R (drop n l₁) (drop n l₂)
  
goal: List.Forall₂ R l₁ l₂ → List.Forall₂ R (List.drop n l₁) (List.drop n l₂)

full_name: List.forall₂_take_append
code: theorem forall₂_take_append (l : List α) (l₁ : List β) (l₂ : List β) (h : Forall₂ R l (l₁ ++ l₂)) :
    Forall₂ R (List.take (length l₁) l) l₁ 
goal: List.Forall₂ R (List.take l₁.length l) l₁

full_name: List.forall₂_drop_append
code: theorem forall₂_drop_append (l : List α) (l₁ : List β) (l₂ : List β) (h : Forall₂ R l (l₁ ++ l₂)) :
    Forall₂ R (List.drop (length l₁) l) l₂ 
goal: List.Forall₂ R (List.drop l₁.length l) l₂

full_name: List.rel_mem
code: theorem rel_mem (hr : BiUnique R) : (R ⇒ Forall₂ R ⇒ Iff) (· ∈ ·) (· ∈ ·)
  
goal: (R ⇒ List.Forall₂ R ⇒ Iff) (fun x x_1 => x ∈ x_1) fun x x_1 => x ∈ x_1

full_name: List.rel_map
code: theorem rel_map : ((R ⇒ P) ⇒ Forall₂ R ⇒ Forall₂ P) map map
  
goal: ((R ⇒ P) ⇒ List.Forall₂ R ⇒ List.Forall₂ P) List.map List.map

full_name: List.rel_append
code: theorem rel_append : (Forall₂ R ⇒ Forall₂ R ⇒ Forall₂ R) (· ++ ·) (· ++ ·)
  
goal: (List.Forall₂ R ⇒ List.Forall₂ R ⇒ List.Forall₂ R) (fun x x_1 => x ++ x_1) fun x x_1 => x ++ x_1

full_name: List.rel_reverse
code: theorem rel_reverse : (Forall₂ R ⇒ Forall₂ R) reverse reverse
  
goal: (List.Forall₂ R ⇒ List.Forall₂ R) List.reverse List.reverse

full_name: List.forall₂_reverse_iff
code: @[simp]
theorem forall₂_reverse_iff {l₁ l₂} : Forall₂ R (reverse l₁) (reverse l₂) ↔ Forall₂ R l₁ l₂ 
goal: List.Forall₂ R l₁.reverse l₂.reverse ↔ List.Forall₂ R l₁ l₂

full_name: List.rel_join
code: theorem rel_join : (Forall₂ (Forall₂ R) ⇒ Forall₂ R) join join
  
goal: (List.Forall₂ (List.Forall₂ R) ⇒ List.Forall₂ R) List.join List.join

full_name: List.rel_bind
code: theorem rel_bind : (Forall₂ R ⇒ (R ⇒ Forall₂ P) ⇒ Forall₂ P) List.bind List.bind 
goal: (List.Forall₂ R ⇒ (R ⇒ List.Forall₂ P) ⇒ List.Forall₂ P) List.bind List.bind

full_name: List.rel_foldl
code: theorem rel_foldl : ((P ⇒ R ⇒ P) ⇒ P ⇒ Forall₂ R ⇒ P) foldl foldl
  
goal: ((P ⇒ R ⇒ P) ⇒ P ⇒ List.Forall₂ R ⇒ P) List.foldl List.foldl

full_name: List.rel_foldr
code: theorem rel_foldr : ((R ⇒ P ⇒ P) ⇒ P ⇒ Forall₂ R ⇒ P) foldr foldr
  
goal: ((R ⇒ P ⇒ P) ⇒ P ⇒ List.Forall₂ R ⇒ P) List.foldr List.foldr

full_name: List.rel_filter
code: theorem rel_filter {p : α → Bool} {q : β → Bool}
    (hpq : (R ⇒ (· ↔ ·)) (fun x => p x) (fun x => q x)) :
    (Forall₂ R ⇒ Forall₂ R) (filter p) (filter q)
  
goal: (List.Forall₂ R ⇒ List.Forall₂ R) (List.filter p) (List.filter q)

full_name: List.rel_filterMap
code: theorem rel_filterMap : ((R ⇒ Option.Rel P) ⇒ Forall₂ R ⇒ Forall₂ P) filterMap filterMap
  
goal: ((R ⇒ Option.Rel P) ⇒ List.Forall₂ R ⇒ List.Forall₂ P) List.filterMap List.filterMap

full_name: List.SublistForall₂.cons
code: /-- Given a relation `R`, `sublist_forall₂ r l₁ l₂` indicates that there is a sublist of `l₂` such
  that `forall₂ r l₁ l₂`. -/
inductive SublistForall₂ (R : α → β → Prop) : List α → List β → Prop
  | nil {l} : SublistForall₂ R [] l
  | cons {a₁ a₂ l₁ l₂} : R a₁ a₂ → SublistForall₂ R l₁ l₂ → SublistForall₂ R (a₁ :: l₁) (a₂ :: l₂)
  | cons_right {a l₁ l₂} : SublistForall₂ R l₁ l₂ → SublistForall₂ R l₁ (a :: l₂)
goal: R a₁ a₂ → List.SublistForall₂ R l₁ l₂ → List.SublistForall₂ R (a₁ :: l₁) (a₂ :: l₂)

full_name: List.SublistForall₂
code: /-- Given a relation `R`, `sublist_forall₂ r l₁ l₂` indicates that there is a sublist of `l₂` such
  that `forall₂ r l₁ l₂`. -/
inductive SublistForall₂ (R : α → β → Prop) : List α → List β → Prop
  | nil {l} : SublistForall₂ R [] l
  | cons {a₁ a₂ l₁ l₂} : R a₁ a₂ → SublistForall₂ R l₁ l₂ → SublistForall₂ R (a₁ :: l₁) (a₂ :: l₂)
  | cons_right {a l₁ l₂} : SublistForall₂ R l₁ l₂ → SublistForall₂ R l₁ (a :: l₂)
goal: List α → List β → Prop

full_name: List.SublistForall₂.cons_right
code: /-- Given a relation `R`, `sublist_forall₂ r l₁ l₂` indicates that there is a sublist of `l₂` such
  that `forall₂ r l₁ l₂`. -/
inductive SublistForall₂ (R : α → β → Prop) : List α → List β → Prop
  | nil {l} : SublistForall₂ R [] l
  | cons {a₁ a₂ l₁ l₂} : R a₁ a₂ → SublistForall₂ R l₁ l₂ → SublistForall₂ R (a₁ :: l₁) (a₂ :: l₂)
  | cons_right {a l₁ l₂} : SublistForall₂ R l₁ l₂ → SublistForall₂ R l₁ (a :: l₂)
goal: List.SublistForall₂ R l₁ l₂ → List.SublistForall₂ R l₁ (a :: l₂)

full_name: List.SublistForall₂.nil
code: /-- Given a relation `R`, `sublist_forall₂ r l₁ l₂` indicates that there is a sublist of `l₂` such
  that `forall₂ r l₁ l₂`. -/
inductive SublistForall₂ (R : α → β → Prop) : List α → List β → Prop
  | nil {l} : SublistForall₂ R [] l
  | cons {a₁ a₂ l₁ l₂} : R a₁ a₂ → SublistForall₂ R l₁ l₂ → SublistForall₂ R (a₁ :: l₁) (a₂ :: l₂)
  | cons_right {a l₁ l₂} : SublistForall₂ R l₁ l₂ → SublistForall₂ R l₁ (a :: l₂)
goal: List.SublistForall₂ R [] l

full_name: List.sublistForall₂_iff
code: theorem sublistForall₂_iff {l₁ : List α} {l₂ : List β} :
    SublistForall₂ R l₁ l₂ ↔ ∃ l, Forall₂ R l₁ l ∧ l <+ l₂ 
goal: List.SublistForall₂ R l₁ l₂ ↔ ∃ l, List.Forall₂ R l₁ l ∧ l.Sublist l₂

full_name: List.SublistForall₂.is_refl
code: instance SublistForall₂.is_refl [IsRefl α Rₐ] : IsRefl (List α) (SublistForall₂ Rₐ) 
goal: IsRefl (List α) (List.SublistForall₂ Rₐ)

full_name: List.SublistForall₂.is_trans
code: instance SublistForall₂.is_trans [IsTrans α Rₐ] : IsTrans (List α) (SublistForall₂ Rₐ) 
goal: IsTrans (List α) (List.SublistForall₂ Rₐ)

full_name: List.Sublist.sublistForall₂
code: theorem Sublist.sublistForall₂ {l₁ l₂ : List α} (h : l₁ <+ l₂) [IsRefl α Rₐ] :
    SublistForall₂ Rₐ l₁ l₂ 
goal: List.SublistForall₂ Rₐ l₁ l₂

full_name: List.tail_sublistForall₂_self
code: theorem tail_sublistForall₂_self [IsRefl α Rₐ] (l : List α) : SublistForall₂ Rₐ l.tail l 
goal: List.SublistForall₂ Rₐ l.tail l