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

full_name: List.Perm.refl
code: @[simp, refl] protected theorem Perm.refl : ∀ l : List α, l ~ l
  
goal: l ~ l

full_name: List.Perm.rfl
code: protected theorem Perm.rfl {l : List α} : l ~ l 
goal: l ~ l

full_name: List.Perm.of_eq
code: theorem Perm.of_eq (h : l₁ = l₂) : l₁ ~ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ = l₂ → l₁ ~ l₂

full_name: List.Perm.symm
code: protected theorem Perm.symm {l₁ l₂ : List α} (h : l₁ ~ l₂) : l₂ ~ l₁ 
goal: l₂ ~ l₁

full_name: List.perm_comm
code: theorem perm_comm {l₁ l₂ : List α} : l₁ ~ l₂ ↔ l₂ ~ l₁ 
goal: l₁ ~ l₂ ↔ l₂ ~ l₁

full_name: List.Perm.swap'
code: theorem Perm.swap' (x y : α) {l₁ l₂ : List α} (p : l₁ ~ l₂) : y :: x :: l₁ ~ x :: y :: l₂ 
goal: y :: x :: l₁ ~ x :: y :: l₂

full_name: List.Perm.recOnSwap'
code: /--
Similar to `Perm.recOn`, but the `swap` case is generalized to `Perm.swap'`,
where the tail of the lists are not necessarily the same.
-/
@[elab_as_elim] theorem Perm.recOnSwap'
    {motive : (l₁ : List α) → (l₂ : List α) → l₁ ~ l₂ → Prop} {l₁ l₂ : List α} (p : l₁ ~ l₂)
    (nil : motive [] [] .nil)
    (cons : ∀ x {l₁ l₂}, (h : l₁ ~ l₂) → motive l₁ l₂ h → motive (x :: l₁) (x :: l₂) (.cons x h))
    (swap' : ∀ x y {l₁ l₂}, (h : l₁ ~ l₂) → motive l₁ l₂ h →
      motive (y :: x :: l₁) (x :: y :: l₂) (.swap' _ _ h))
    (trans : ∀ {l₁ l₂ l₃}, (h₁ : l₁ ~ l₂) → (h₂ : l₂ ~ l₃) → motive l₁ l₂ h₁ → motive l₂ l₃ h₂ →
      motive l₁ l₃ (.trans h₁ h₂)) : motive l₁ l₂ p 
goal: motive l₁ l₂ p

full_name: List.Perm.eqv
code: theorem Perm.eqv (α) : Equivalence (@Perm α) 
goal: Equivalence List.Perm

full_name: List.isSetoid
code: instance isSetoid (α) : Setoid (List α) 
goal: Setoid (List α)

full_name: List.Perm.mem_iff
code: theorem Perm.mem_iff {a : α} {l₁ l₂ : List α} (p : l₁ ~ l₂) : a ∈ l₁ ↔ a ∈ l₂ 
goal: a ∈ l₁ ↔ a ∈ l₂

full_name: List.Perm.subset
code: theorem Perm.subset {l₁ l₂ : List α} (p : l₁ ~ l₂) : l₁ ⊆ l₂ 
goal: l₁ ⊆ l₂

full_name: List.Perm.append_right
code: theorem Perm.append_right {l₁ l₂ : List α} (t₁ : List α) (p : l₁ ~ l₂) : l₁ ++ t₁ ~ l₂ ++ t₁ 
goal: l₁ ++ t₁ ~ l₂ ++ t₁

full_name: List.Perm.append_left
code: theorem Perm.append_left {t₁ t₂ : List α} : ∀ l : List α, t₁ ~ t₂ → l ++ t₁ ~ l ++ t₂
  
goal: t₁ ~ t₂ → l ++ t₁ ~ l ++ t₂

full_name: List.Perm.append
code: theorem Perm.append {l₁ l₂ t₁ t₂ : List α} (p₁ : l₁ ~ l₂) (p₂ : t₁ ~ t₂) : l₁ ++ t₁ ~ l₂ ++ t₂ 
goal: l₁ ++ t₁ ~ l₂ ++ t₂

full_name: List.Perm.append_cons
code: theorem Perm.append_cons (a : α) {h₁ h₂ t₁ t₂ : List α} (p₁ : h₁ ~ h₂) (p₂ : t₁ ~ t₂) :
    h₁ ++ a :: t₁ ~ h₂ ++ a :: t₂ 
goal: h₁ ++ a :: t₁ ~ h₂ ++ a :: t₂

full_name: List.perm_middle
code: @[simp] theorem perm_middle {a : α} : ∀ {l₁ l₂ : List α}, l₁ ++ a :: l₂ ~ a :: (l₁ ++ l₂)
  
goal: l₁ ++ a :: l₂ ~ a :: (l₁ ++ l₂)

full_name: List.perm_append_singleton
code: @[simp] theorem perm_append_singleton (a : α) (l : List α) : l ++ [a] ~ a :: l 
goal: l ++ [a] ~ a :: l

full_name: List.perm_append_comm
code: theorem perm_append_comm : ∀ {l₁ l₂ : List α}, l₁ ++ l₂ ~ l₂ ++ l₁
  
goal: l₁ ++ l₂ ~ l₂ ++ l₁

full_name: List.concat_perm
code: theorem concat_perm (l : List α) (a : α) : concat l a ~ a :: l 
goal: l.concat a ~ a :: l

full_name: List.Perm.length_eq
code: theorem Perm.length_eq {l₁ l₂ : List α} (p : l₁ ~ l₂) : length l₁ = length l₂ 
goal: l₁.length = l₂.length

full_name: List.Perm.eq_nil
code: theorem Perm.eq_nil {l : List α} (p : l ~ []) : l = [] 
goal: l = []

full_name: List.Perm.nil_eq
code: theorem Perm.nil_eq {l : List α} (p : [] ~ l) : [] = l 
goal: [] = l

full_name: List.perm_nil
code: @[simp] theorem perm_nil {l₁ : List α} : l₁ ~ [] ↔ l₁ = [] 
goal: l₁ ~ [] ↔ l₁ = []

full_name: List.nil_perm
code: @[simp] theorem nil_perm {l₁ : List α} : [] ~ l₁ ↔ l₁ = [] 
goal: [] ~ l₁ ↔ l₁ = []

full_name: List.not_perm_nil_cons
code: theorem not_perm_nil_cons (x : α) (l : List α) : ¬[] ~ x :: l 
goal: ¬[] ~ x :: l

full_name: List.reverse_perm
code: @[simp] theorem reverse_perm : ∀ l : List α, reverse l ~ l
  
goal: l.reverse ~ l

full_name: List.perm_cons_append_cons
code: theorem perm_cons_append_cons {l l₁ l₂ : List α} (a : α) (p : l ~ l₁ ++ l₂) :
    a :: l ~ l₁ ++ a :: l₂ 
goal: a :: l ~ l₁ ++ a :: l₂

full_name: List.perm_replicate
code: @[simp] theorem perm_replicate {n : Nat} {a : α} {l : List α} :
    l ~ replicate n a ↔ l = replicate n a 
goal: l ~ List.replicate n a ↔ l = List.replicate n a

full_name: List.replicate_perm
code: @[simp] theorem replicate_perm {n : Nat} {a : α} {l : List α} :
    replicate n a ~ l ↔ replicate n a = l 
goal: List.replicate n a ~ l ↔ List.replicate n a = l

full_name: List.perm_singleton
code: @[simp] theorem perm_singleton {a : α} {l : List α} : l ~ [a] ↔ l = [a] 
goal: l ~ [a] ↔ l = [a]

full_name: List.singleton_perm
code: @[simp] theorem singleton_perm {a : α} {l : List α} : [a] ~ l ↔ [a] = l 
goal: [a] ~ l ↔ [a] = l

full_name: List.singleton_perm_singleton
code: theorem singleton_perm_singleton {a b : α} : [a] ~ [b] ↔ a = b 
goal: [a] ~ [b] ↔ a = b

full_name: List.perm_cons_erase
code: theorem perm_cons_erase [DecidableEq α] {a : α} {l : List α} (h : a ∈ l) : l ~ a :: l.erase a 
goal: l ~ a :: l.erase a

full_name: List.Perm.filterMap
code: theorem Perm.filterMap (f : α → Option β) {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    filterMap f l₁ ~ filterMap f l₂ 
goal: List.filterMap f l₁ ~ List.filterMap f l₂

full_name: List.Perm.map
code: theorem Perm.map (f : α → β) {l₁ l₂ : List α} (p : l₁ ~ l₂) : map f l₁ ~ map f l₂ 
goal: List.map f l₁ ~ List.map f l₂

full_name: List.Perm.pmap
code: theorem Perm.pmap {p : α → Prop} (f : ∀ a, p a → β) {l₁ l₂ : List α} (p : l₁ ~ l₂) {H₁ H₂} :
    pmap f l₁ H₁ ~ pmap f l₂ H₂ 
goal: l₁ ~ l₂ → ∀ {H₁ : ∀ (a : α), a ∈ l₁ → p a} {H₂ : ∀ (a : α), a ∈ l₂ → p a}, List.pmap f l₁ H₁ ~ List.pmap f l₂ H₂

full_name: List.Perm.filter
code: theorem Perm.filter (p : α → Bool) {l₁ l₂ : List α} (s : l₁ ~ l₂) :
    filter p l₁ ~ filter p l₂ 
goal: List.filter p l₁ ~ List.filter p l₂

full_name: List.filter_append_perm
code: theorem filter_append_perm (p : α → Bool) (l : List α) :
    filter p l ++ filter (fun x => !p x) l ~ l 
goal: List.filter p l ++ List.filter (fun x => !p x) l ~ l

full_name: List.exists_perm_sublist
code: theorem exists_perm_sublist {l₁ l₂ l₂' : List α} (s : l₁ <+ l₂) (p : l₂ ~ l₂') :
    ∃ l₁', l₁' ~ l₁ ∧ l₁' <+ l₂' 
goal: ∃ l₁', l₁' ~ l₁ ∧ l₁' <+ l₂'

full_name: List.Perm.sizeOf_eq_sizeOf
code: theorem Perm.sizeOf_eq_sizeOf [SizeOf α] {l₁ l₂ : List α} (h : l₁ ~ l₂) :
    sizeOf l₁ = sizeOf l₂ 
goal: sizeOf l₁ = sizeOf l₂

full_name: List.nil_subperm
code: theorem nil_subperm {l : List α} : [] <+~ l 
goal: [] <+~ l

full_name: List.Perm.subperm_left
code: theorem Perm.subperm_left {l l₁ l₂ : List α} (p : l₁ ~ l₂) : l <+~ l₁ ↔ l <+~ l₂ 
goal: l <+~ l₁ ↔ l <+~ l₂

full_name: List.Perm.subperm_right
code: theorem Perm.subperm_right {l₁ l₂ l : List α} (p : l₁ ~ l₂) : l₁ <+~ l ↔ l₂ <+~ l 
goal: l₁ <+~ l ↔ l₂ <+~ l

full_name: List.Sublist.subperm
code: theorem Sublist.subperm {l₁ l₂ : List α} (s : l₁ <+ l₂) : l₁ <+~ l₂ 
goal: l₁ <+~ l₂

full_name: List.Perm.subperm
code: theorem Perm.subperm {l₁ l₂ : List α} (p : l₁ ~ l₂) : l₁ <+~ l₂ 
goal: l₁ <+~ l₂

full_name: List.Subperm.refl
code: @[refl] theorem Subperm.refl (l : List α) : l <+~ l 
goal: l <+~ l

full_name: List.Subperm.trans
code: theorem Subperm.trans {l₁ l₂ l₃ : List α} (s₁₂ : l₁ <+~ l₂) (s₂₃ : l₂ <+~ l₃) : l₁ <+~ l₃ 
goal: l₁ <+~ l₃

full_name: List.Subperm.cons_right
code: theorem Subperm.cons_right {α : Type _} {l l' : List α} (x : α) (h : l <+~ l') : l <+~ x :: l' 
goal: l <+~ x :: l'

full_name: List.Subperm.length_le
code: theorem Subperm.length_le {l₁ l₂ : List α} : l₁ <+~ l₂ → length l₁ ≤ length l₂
  
goal: l₁ <+~ l₂ → l₁.length ≤ l₂.length

full_name: List.Subperm.perm_of_length_le
code: theorem Subperm.perm_of_length_le {l₁ l₂ : List α} : l₁ <+~ l₂ → length l₂ ≤ length l₁ → l₁ ~ l₂
  
goal: l₁ <+~ l₂ → l₂.length ≤ l₁.length → l₁ ~ l₂

full_name: List.Subperm.antisymm
code: theorem Subperm.antisymm {l₁ l₂ : List α} (h₁ : l₁ <+~ l₂) (h₂ : l₂ <+~ l₁) : l₁ ~ l₂ 
goal: l₁ ~ l₂

full_name: List.Subperm.subset
code: theorem Subperm.subset {l₁ l₂ : List α} : l₁ <+~ l₂ → l₁ ⊆ l₂
  
goal: l₁ <+~ l₂ → l₁ ⊆ l₂

full_name: List.Subperm.filter
code: theorem Subperm.filter (p : α → Bool) ⦃l l' : List α⦄ (h : l <+~ l') :
    filter p l <+~ filter p l' 
goal: List.filter p l <+~ List.filter p l'

full_name: List.singleton_subperm_iff
code: @[simp] theorem singleton_subperm_iff {α} {l : List α} {a : α} : [a] <+~ l ↔ a ∈ l 
goal: [a] <+~ l ↔ a ∈ l

full_name: List.Sublist.exists_perm_append
code: theorem Sublist.exists_perm_append {l₁ l₂ : List α} : l₁ <+ l₂ → ∃ l, l₂ ~ l₁ ++ l
  
goal: l₁ <+ l₂ → ∃ l, l₂ ~ l₁ ++ l

full_name: List.Perm.countP_eq
code: theorem Perm.countP_eq (p : α → Bool) {l₁ l₂ : List α} (s : l₁ ~ l₂) :
    countP p l₁ = countP p l₂ 
goal: List.countP p l₁ = List.countP p l₂

full_name: List.Subperm.countP_le
code: theorem Subperm.countP_le (p : α → Bool) {l₁ l₂ : List α} : l₁ <+~ l₂ → countP p l₁ ≤ countP p l₂
  
goal: l₁ <+~ l₂ → List.countP p l₁ ≤ List.countP p l₂

full_name: List.Perm.countP_congr
code: theorem Perm.countP_congr {l₁ l₂ : List α} (s : l₁ ~ l₂) {p p' : α → Bool}
    (hp : ∀ x ∈ l₁, p x = p' x) : l₁.countP p = l₂.countP p' 
goal: List.countP p l₁ = List.countP p' l₂

full_name: List.countP_eq_countP_filter_add
code: theorem countP_eq_countP_filter_add (l : List α) (p q : α → Bool) :
    l.countP p = (l.filter q).countP p + (l.filter fun a => !q a).countP p 
goal: List.countP p l = List.countP p (List.filter q l) + List.countP p (List.filter (fun a => !q a) l)

full_name: List.Perm.count_eq
code: theorem Perm.count_eq [DecidableEq α] {l₁ l₂ : List α} (p : l₁ ~ l₂) (a) :
    count a l₁ = count a l₂ 
goal: List.count a l₁ = List.count a l₂

full_name: List.Subperm.count_le
code: theorem Subperm.count_le [DecidableEq α] {l₁ l₂ : List α} (s : l₁ <+~ l₂) (a) :
    count a l₁ ≤ count a l₂ 
goal: List.count a l₁ ≤ List.count a l₂

full_name: List.Perm.foldl_eq'
code: theorem Perm.foldl_eq' {f : β → α → β} {l₁ l₂ : List α} (p : l₁ ~ l₂)
    (comm : ∀ x ∈ l₁, ∀ y ∈ l₁, ∀ (z), f (f z x) y = f (f z y) x)
    (init) : foldl f init l₁ = foldl f init l₂ 
goal: List.foldl f init l₁ = List.foldl f init l₂

full_name: List.Perm.rec_heq
code: theorem Perm.rec_heq {β : List α → Sort _} {f : ∀ a l, β l → β (a :: l)} {b : β []} {l l' : List α}
    (hl : l ~ l') (f_congr : ∀ {a l l' b b'}, l ~ l' → HEq b b' → HEq (f a l b) (f a l' b'))
    (f_swap : ∀ {a a' l b}, HEq (f a (a' :: l) (f a' l b)) (f a' (a :: l) (f a l b))) :
    HEq (@List.rec α β b f l) (@List.rec α β b f l') 
goal: HEq (List.rec b f l) (List.rec b f l')

full_name: List.perm_inv_core
code: /-- Lemma used to destruct perms element by element. -/
theorem perm_inv_core {a : α} {l₁ l₂ r₁ r₂ : List α} :
    l₁ ++ a :: r₁ ~ l₂ ++ a :: r₂ → l₁ ++ r₁ ~ l₂ ++ r₂ 
goal: l₁ ++ a :: r₁ ~ l₂ ++ a :: r₂ → l₁ ++ r₁ ~ l₂ ++ r₂

full_name: List.Perm.cons_inv
code: theorem Perm.cons_inv {a : α} {l₁ l₂ : List α} : a :: l₁ ~ a :: l₂ → l₁ ~ l₂ 
goal: a :: l₁ ~ a :: l₂ → l₁ ~ l₂

full_name: List.perm_cons
code: @[simp] theorem perm_cons (a : α) {l₁ l₂ : List α} : a :: l₁ ~ a :: l₂ ↔ l₁ ~ l₂ 
goal: a :: l₁ ~ a :: l₂ ↔ l₁ ~ l₂

full_name: List.perm_append_left_iff
code: theorem perm_append_left_iff {l₁ l₂ : List α} : ∀ l, l ++ l₁ ~ l ++ l₂ ↔ l₁ ~ l₂
  
goal: l ++ l₁ ~ l ++ l₂ ↔ l₁ ~ l₂

full_name: List.perm_append_right_iff
code: theorem perm_append_right_iff {l₁ l₂ : List α} (l) : l₁ ++ l ~ l₂ ++ l ↔ l₁ ~ l₂ 
goal: l₁ ++ l ~ l₂ ++ l ↔ l₁ ~ l₂

full_name: List.subperm_cons
code: theorem subperm_cons (a : α) {l₁ l₂ : List α} : a :: l₁ <+~ a :: l₂ ↔ l₁ <+~ l₂ 
goal: a :: l₁ <+~ a :: l₂ ↔ l₁ <+~ l₂

full_name: List.cons_subperm_of_not_mem_of_mem
code: /-- Weaker version of `Subperm.cons_left` -/
theorem cons_subperm_of_not_mem_of_mem {a : α} {l₁ l₂ : List α} (h₁ : a ∉ l₁) (h₂ : a ∈ l₂)
    (s : l₁ <+~ l₂) : a :: l₁ <+~ l₂ 
goal: a :: l₁ <+~ l₂

full_name: List.subperm_append_left
code: theorem subperm_append_left {l₁ l₂ : List α} : ∀ l, l ++ l₁ <+~ l ++ l₂ ↔ l₁ <+~ l₂
  
goal: l ++ l₁ <+~ l ++ l₂ ↔ l₁ <+~ l₂

full_name: List.subperm_append_right
code: theorem subperm_append_right {l₁ l₂ : List α} (l) : l₁ ++ l <+~ l₂ ++ l ↔ l₁ <+~ l₂ 
goal: l₁ ++ l <+~ l₂ ++ l ↔ l₁ <+~ l₂

full_name: List.Subperm.exists_of_length_lt
code: theorem Subperm.exists_of_length_lt {l₁ l₂ : List α} (s : l₁ <+~ l₂) (h : length l₁ < length l₂) :
    ∃ a, a :: l₁ <+~ l₂ 
goal: ∃ a, a :: l₁ <+~ l₂

full_name: List.subperm_of_subset
code: theorem subperm_of_subset (d : Nodup l₁) (H : l₁ ⊆ l₂) : l₁ <+~ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Nodup → l₁ ⊆ l₂ → l₁ <+~ l₂

full_name: List.perm_ext_iff_of_nodup
code: theorem perm_ext_iff_of_nodup {l₁ l₂ : List α} (d₁ : Nodup l₁) (d₂ : Nodup l₂) :
    l₁ ~ l₂ ↔ ∀ a, a ∈ l₁ ↔ a ∈ l₂ 
goal: l₁ ~ l₂ ↔ ∀ (a : α), a ∈ l₁ ↔ a ∈ l₂

full_name: List.Nodup.perm_iff_eq_of_sublist
code: theorem Nodup.perm_iff_eq_of_sublist {l₁ l₂ l : List α} (d : Nodup l)
    (s₁ : l₁ <+ l) (s₂ : l₂ <+ l) : l₁ ~ l₂ ↔ l₁ = l₂ 
goal: l₁ ~ l₂ ↔ l₁ = l₂

full_name: List.Perm.erase
code: theorem Perm.erase (a : α) {l₁ l₂ : List α} (p : l₁ ~ l₂) : l₁.erase a ~ l₂.erase a 
goal: l₁.erase a ~ l₂.erase a

full_name: List.subperm_cons_erase
code: theorem subperm_cons_erase (a : α) (l : List α) : l <+~ a :: l.erase a 
goal: l <+~ a :: l.erase a

full_name: List.erase_subperm
code: theorem erase_subperm (a : α) (l : List α) : l.erase a <+~ l 
goal: l.erase a <+~ l

full_name: List.Subperm.erase
code: theorem Subperm.erase {l₁ l₂ : List α} (a : α) (h : l₁ <+~ l₂) : l₁.erase a <+~ l₂.erase a 
goal: l₁.erase a <+~ l₂.erase a

full_name: List.Perm.diff_right
code: theorem Perm.diff_right {l₁ l₂ : List α} (t : List α) (h : l₁ ~ l₂) : l₁.diff t ~ l₂.diff t 
goal: l₁.diff t ~ l₂.diff t

full_name: List.Perm.diff_left
code: theorem Perm.diff_left (l : List α) {t₁ t₂ : List α} (h : t₁ ~ t₂) : l.diff t₁ = l.diff t₂ 
goal: l.diff t₁ = l.diff t₂

full_name: List.Perm.diff
code: theorem Perm.diff {l₁ l₂ t₁ t₂ : List α} (hl : l₁ ~ l₂) (ht : t₁ ~ t₂) : l₁.diff t₁ ~ l₂.diff t₂ 
goal: l₁.diff t₁ ~ l₂.diff t₂

full_name: List.Subperm.diff_right
code: theorem Subperm.diff_right {l₁ l₂ : List α} (h : l₁ <+~ l₂) (t : List α) :
    l₁.diff t <+~ l₂.diff t 
goal: l₁.diff t <+~ l₂.diff t

full_name: List.erase_cons_subperm_cons_erase
code: theorem erase_cons_subperm_cons_erase (a b : α) (l : List α) :
    (a :: l).erase b <+~ a :: l.erase b 
goal: (a :: l).erase b <+~ a :: l.erase b

full_name: List.subperm_cons_diff
code: theorem subperm_cons_diff {a : α} {l₁ l₂ : List α} : (a :: l₁).diff l₂ <+~ a :: l₁.diff l₂ 
goal: (a :: l₁).diff l₂ <+~ a :: l₁.diff l₂

full_name: List.subset_cons_diff
code: theorem subset_cons_diff {a : α} {l₁ l₂ : List α} : (a :: l₁).diff l₂ ⊆ a :: l₁.diff l₂ 
goal: (a :: l₁).diff l₂ ⊆ a :: l₁.diff l₂

full_name: List.cons_perm_iff_perm_erase
code: theorem cons_perm_iff_perm_erase {a : α} {l₁ l₂ : List α} :
    a :: l₁ ~ l₂ ↔ a ∈ l₂ ∧ l₁ ~ l₂.erase a 
goal: a :: l₁ ~ l₂ ↔ a ∈ l₂ ∧ l₁ ~ l₂.erase a

full_name: List.perm_iff_count
code: theorem perm_iff_count {l₁ l₂ : List α} : l₁ ~ l₂ ↔ ∀ a, count a l₁ = count a l₂ 
goal: l₁ ~ l₂ ↔ ∀ (a : α), List.count a l₁ = List.count a l₂

full_name: List.subperm_append_diff_self_of_count_le
code: /-- The list version of `add_tsub_cancel_of_le` for multisets. -/
theorem subperm_append_diff_self_of_count_le {l₁ l₂ : List α}
    (h : ∀ x ∈ l₁, count x l₁ ≤ count x l₂) : l₁ ++ l₂.diff l₁ ~ l₂ 
goal: l₁ ++ l₂.diff l₁ ~ l₂

full_name: List.subperm_ext_iff
code: /-- The list version of `Multiset.le_iff_count`. -/
theorem subperm_ext_iff {l₁ l₂ : List α} : l₁ <+~ l₂ ↔ ∀ x ∈ l₁, count x l₁ ≤ count x l₂ 
goal: l₁ <+~ l₂ ↔ ∀ (x : α), x ∈ l₁ → List.count x l₁ ≤ List.count x l₂

full_name: List.isSubperm_iff
code: theorem isSubperm_iff {l₁ l₂ : List α} : l₁.isSubperm l₂ ↔ l₁ <+~ l₂ 
goal: l₁.isSubperm l₂ = true ↔ l₁ <+~ l₂

full_name: List.decidableSubperm
code: instance decidableSubperm : DecidableRel ((· <+~ ·) : List α → List α → Prop) 
goal: DecidableRel fun x x_1 => x <+~ x_1

full_name: List.Subperm.cons_left
code: theorem Subperm.cons_left {l₁ l₂ : List α} (h : l₁ <+~ l₂) (x : α) (hx : count x l₁ < count x l₂) :
    x :: l₁ <+~ l₂ 
goal: x :: l₁ <+~ l₂

full_name: List.isPerm_iff
code: theorem isPerm_iff : ∀ {l₁ l₂ : List α}, l₁.isPerm l₂ ↔ l₁ ~ l₂
  
goal: l₁.isPerm l₂ = true ↔ l₁ ~ l₂

full_name: List.decidablePerm
code: instance decidablePerm (l₁ l₂ : List α) : Decidable (l₁ ~ l₂) 
goal: Decidable (l₁ ~ l₂)

full_name: List.Perm.insert
code: protected theorem Perm.insert (a : α) {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    l₁.insert a ~ l₂.insert a 
goal: List.insert a l₁ ~ List.insert a l₂

full_name: List.perm_insert_swap
code: theorem perm_insert_swap (x y : α) (l : List α) :
    List.insert x (List.insert y l) ~ List.insert y (List.insert x l) 
goal: List.insert x (List.insert y l) ~ List.insert y (List.insert x l)

full_name: List.perm_insertNth
code: theorem perm_insertNth {α} (x : α) (l : List α) {n} (h : n ≤ l.length) :
    insertNth n x l ~ x :: l 
goal: List.insertNth n x l ~ x :: l

full_name: List.Perm.union_right
code: theorem Perm.union_right {l₁ l₂ : List α} (t₁ : List α) (h : l₁ ~ l₂) : l₁ ∪ t₁ ~ l₂ ∪ t₁ 
goal: l₁ ∪ t₁ ~ l₂ ∪ t₁

full_name: List.Perm.union_left
code: theorem Perm.union_left (l : List α) {t₁ t₂ : List α} (h : t₁ ~ t₂) : l ∪ t₁ ~ l ∪ t₂ 
goal: l ∪ t₁ ~ l ∪ t₂

full_name: List.Perm.union
code: theorem Perm.union {l₁ l₂ t₁ t₂ : List α} (p₁ : l₁ ~ l₂) (p₂ : t₁ ~ t₂) : l₁ ∪ t₁ ~ l₂ ∪ t₂ 
goal: l₁ ∪ t₁ ~ l₂ ∪ t₂

full_name: List.Perm.inter_right
code: theorem Perm.inter_right {l₁ l₂ : List α} (t₁ : List α) : l₁ ~ l₂ → l₁ ∩ t₁ ~ l₂ ∩ t₁ 
goal: l₁ ~ l₂ → l₁ ∩ t₁ ~ l₂ ∩ t₁

full_name: List.Perm.inter_left
code: theorem Perm.inter_left (l : List α) {t₁ t₂ : List α} (p : t₁ ~ t₂) : l ∩ t₁ = l ∩ t₂ 
goal: l ∩ t₁ = l ∩ t₂

full_name: List.Perm.inter
code: theorem Perm.inter {l₁ l₂ t₁ t₂ : List α} (p₁ : l₁ ~ l₂) (p₂ : t₁ ~ t₂) : l₁ ∩ t₁ ~ l₂ ∩ t₂ 
goal: l₁ ∩ t₁ ~ l₂ ∩ t₂

full_name: List.Perm.pairwise_iff
code: theorem Perm.pairwise_iff {R : α → α → Prop} (S : ∀ {x y}, R x y → R y x) :
    ∀ {l₁ l₂ : List α} (_p : l₁ ~ l₂), Pairwise R l₁ ↔ Pairwise R l₂ 
goal: List.Pairwise R l₁ ↔ List.Pairwise R l₂

full_name: List.Pairwise.perm
code: theorem Pairwise.perm {R : α → α → Prop} {l l' : List α} (hR : l.Pairwise R) (hl : l ~ l')
    (hsymm : ∀ {x y}, R x y → R y x) : l'.Pairwise R 
goal: List.Pairwise R l'

full_name: List.Perm.pairwise
code: theorem Perm.pairwise {R : α → α → Prop} {l l' : List α} (hl : l ~ l') (hR : l.Pairwise R)
    (hsymm : ∀ {x y}, R x y → R y x) : l'.Pairwise R 
goal: List.Pairwise R l'

full_name: List.Perm.nodup_iff
code: theorem Perm.nodup_iff {l₁ l₂ : List α} : l₁ ~ l₂ → (Nodup l₁ ↔ Nodup l₂) 
goal: l₁ ~ l₂ → (l₁.Nodup ↔ l₂.Nodup)

full_name: List.Perm.join
code: theorem Perm.join {l₁ l₂ : List (List α)} (h : l₁ ~ l₂) : l₁.join ~ l₂.join 
goal: l₁.join ~ l₂.join

full_name: List.Perm.bind_right
code: theorem Perm.bind_right {l₁ l₂ : List α} (f : α → List β) (p : l₁ ~ l₂) : l₁.bind f ~ l₂.bind f 
goal: l₁.bind f ~ l₂.bind f

full_name: List.Perm.join_congr
code: theorem Perm.join_congr :
    ∀ {l₁ l₂ : List (List α)} (_ : List.Forall₂ (· ~ ·) l₁ l₂), l₁.join ~ l₂.join
  
goal: List.Forall₂ (fun x x_1 => x ~ x_1) l₁ l₂ → l₁.join ~ l₂.join

full_name: List.Perm.eraseP
code: theorem Perm.eraseP (f : α → Bool) {l₁ l₂ : List α}
    (H : Pairwise (fun a b => f a → f b → False) l₁) (p : l₁ ~ l₂) : eraseP f l₁ ~ eraseP f l₂ 
goal: List.eraseP f l₁ ~ List.eraseP f l₂

full_name: List.perm_merge
code: theorem perm_merge (s : α → α → Bool) (l r) : merge s l r ~ l ++ r 
goal: List.merge s l r ~ l ++ r

full_name: List.Perm.merge
code: theorem Perm.merge (s₁ s₂ : α → α → Bool) (hl : l₁ ~ l₂) (hr : r₁ ~ r₂) :
    merge s₁ l₁ r₁ ~ merge s₂ l₂ r₂ 
goal: List.merge s₁ l₁ r₁ ~ List.merge s₂ l₂ r₂