ruc-ai4math/mathlib_handler_benchmark_410 huggingface dataset:
-- List.permutationsAux2_comp_append
theorem permutationsAux2_comp_append {t : α} {ts ys : List α} {r : List β} (f : List α → β) :
    ((permutationsAux2 t [] r ys) fun x => f (x ++ ts)).2 = (permutationsAux2 t ts r ys f).2 
Arguments: {α : Type u_1} {β : Type u_2} {t : α} {ts ys : List α} {r : List β} (f : List α → β)
Goal: (List.permutationsAux2 t [] r ys fun x => f (x ++ ts)).2 = (List.permutationsAux2 t ts r ys f).2
-- List.map_permutationsAux2'
theorem map_permutationsAux2' {α' β'} (g : α → α') (g' : β → β') (t : α) (ts ys : List α)
    (r : List β) (f : List α → β) (f' : List α' → β') (H : ∀ a, g' (f a) = f' (map g a)) :
    map g' (permutationsAux2 t ts r ys f).2 =
      (permutationsAux2 (g t) (map g ts) (map g' r) (map g ys) f').2 
Arguments: {α : Type u_1} {β : Type u_2} {α' : Type u_3} {β' : Type u_4} (g : α → α') (g' : β → β') (t : α) (ts ys : List α) (r : List β) (f : List α → β) (f' : List α' → β') (H : ∀ (a : List α), g' (f a) = f' (List.map g a))
Goal: List.map g' (List.permutationsAux2 t ts r ys f).2 =
  (List.permutationsAux2 (g t) (List.map g ts) (List.map g' r) (List.map g ys) f').2
-- List.map_permutationsAux2
theorem map_permutationsAux2 (t : α) (ts : List α) (ys : List α) (f : List α → β) :
    (permutationsAux2 t ts [] ys id).2.map f = (permutationsAux2 t ts [] ys f).2 
Arguments: {α : Type u_1} {β : Type u_2} (t : α) (ts ys : List α) (f : List α → β)
Goal: List.map f (List.permutationsAux2 t ts [] ys id).2 = (List.permutationsAux2 t ts [] ys f).2
-- List.permutationsAux2_snd_eq
theorem permutationsAux2_snd_eq (t : α) (ts : List α) (r : List β) (ys : List α) (f : List α → β) :
    (permutationsAux2 t ts r ys f).2 =
      ((permutationsAux2 t [] [] ys id).2.map fun x => f (x ++ ts)) ++ r 
Arguments: {α : Type u_1} {β : Type u_2} (t : α) (ts : List α) (r : List β) (ys : List α) (f : List α → β)
Goal: (List.permutationsAux2 t ts r ys f).2 = List.map (fun x => f (x ++ ts)) (List.permutationsAux2 t [] [] ys id).2 ++ r
-- List.map_map_permutationsAux2
theorem map_map_permutationsAux2 {α'} (g : α → α') (t : α) (ts ys : List α) :
    map (map g) (permutationsAux2 t ts [] ys id).2 =
      (permutationsAux2 (g t) (map g ts) [] (map g ys) id).2 
Arguments: {α : Type u_1} {α' : Type u_3} (g : α → α') (t : α) (ts ys : List α)
Goal: List.map (List.map g) (List.permutationsAux2 t ts [] ys id).2 =
  (List.permutationsAux2 (g t) (List.map g ts) [] (List.map g ys) id).2
-- List.map_map_permutations'Aux
theorem map_map_permutations'Aux (f : α → β) (t : α) (ts : List α) :
    map (map f) (permutations'Aux t ts) = permutations'Aux (f t) (map f ts) 
Arguments: {α : Type u_1} {β : Type u_2} (f : α → β) (t : α) (ts : List α)
Goal: List.map (List.map f) (List.permutations'Aux t ts) = List.permutations'Aux (f t) (List.map f ts)
-- List.permutations'Aux_eq_permutationsAux2
theorem permutations'Aux_eq_permutationsAux2 (t : α) (ts : List α) :
    permutations'Aux t ts = (permutationsAux2 t [] [ts ++ [t]] ts id).2 
Arguments: {α : Type u_1} (t : α) (ts : List α)
Goal: List.permutations'Aux t ts = (List.permutationsAux2 t [] [ts ++ [t]] ts id).2
-- List.mem_permutationsAux2
theorem mem_permutationsAux2 {t : α} {ts : List α} {ys : List α} {l l' : List α} :
    l' ∈ (permutationsAux2 t ts [] ys (l ++ ·)).2 ↔
      ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l' = l ++ l₁ ++ t :: l₂ ++ ts 
Arguments: {α : Type u_1} {t : α} {ts ys l l' : List α}
Goal: l' ∈ (List.permutationsAux2 t ts [] ys fun x => l ++ x).2 ↔
  ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l' = l ++ l₁ ++ t :: l₂ ++ ts
-- List.mem_permutationsAux2'
theorem mem_permutationsAux2' {t : α} {ts : List α} {ys : List α} {l : List α} :
    l ∈ (permutationsAux2 t ts [] ys id).2 ↔
      ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l = l₁ ++ t :: l₂ ++ ts 
Arguments: {α : Type u_1} {t : α} {ts ys l : List α}
Goal: l ∈ (List.permutationsAux2 t ts [] ys id).2 ↔ ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l = l₁ ++ t :: l₂ ++ ts
-- List.length_permutationsAux2
theorem length_permutationsAux2 (t : α) (ts : List α) (ys : List α) (f : List α → β) :
    length (permutationsAux2 t ts [] ys f).2 = length ys 
Arguments: {α : Type u_1} {β : Type u_2} (t : α) (ts ys : List α) (f : List α → β)
Goal: (List.permutationsAux2 t ts [] ys f).2.length = ys.length
-- List.foldr_permutationsAux2
theorem foldr_permutationsAux2 (t : α) (ts : List α) (r L : List (List α)) :
    foldr (fun y r => (permutationsAux2 t ts r y id).2) r L =
      (L.bind fun y => (permutationsAux2 t ts [] y id).2) ++ r 
Arguments: {α : Type u_1} (t : α) (ts : List α) (r L : List (List α))
Goal: List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) r L =
  (L.bind fun y => (List.permutationsAux2 t ts [] y id).2) ++ r
-- List.mem_foldr_permutationsAux2
theorem mem_foldr_permutationsAux2 {t : α} {ts : List α} {r L : List (List α)} {l' : List α} :
    l' ∈ foldr (fun y r => (permutationsAux2 t ts r y id).2) r L ↔
      l' ∈ r ∨ ∃ l₁ l₂, l₁ ++ l₂ ∈ L ∧ l₂ ≠ [] ∧ l' = l₁ ++ t :: l₂ ++ ts 
Arguments: {α : Type u_1} {t : α} {ts : List α} {r L : List (List α)} {l' : List α}
Goal: l' ∈ List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) r L ↔
  l' ∈ r ∨ ∃ l₁ l₂, l₁ ++ l₂ ∈ L ∧ l₂ ≠ [] ∧ l' = l₁ ++ t :: l₂ ++ ts
-- List.length_foldr_permutationsAux2
theorem length_foldr_permutationsAux2 (t : α) (ts : List α) (r L : List (List α)) :
    length (foldr (fun y r => (permutationsAux2 t ts r y id).2) r L) =
      Nat.sum (map length L) + length r 
Arguments: {α : Type u_1} (t : α) (ts : List α) (r L : List (List α))
Goal: (List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) r L).length = Nat.sum (List.map List.length L) + r.length
-- List.length_foldr_permutationsAux2'
theorem length_foldr_permutationsAux2' (t : α) (ts : List α) (r L : List (List α)) (n)
    (H : ∀ l ∈ L, length l = n) :
    length (foldr (fun y r => (permutationsAux2 t ts r y id).2) r L) = n * length L + length r 
Arguments: {α : Type u_1} (t : α) (ts : List α) (r L : List (List α)) (n : ℕ) (H : ∀ (l : List α), l ∈ L → l.length = n)
Goal: (List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) r L).length = n * L.length + r.length
-- List.permutationsAux_nil
@[simp]
theorem permutationsAux_nil (is : List α) : permutationsAux [] is = [] 
Arguments: {α : Type u_1} (is : List α)
Goal: [].permutationsAux is = []
-- List.permutationsAux_cons
@[simp]
theorem permutationsAux_cons (t : α) (ts is : List α) :
    permutationsAux (t :: ts) is =
      foldr (fun y r => (permutationsAux2 t ts r y id).2) (permutationsAux ts (t :: is))
        (permutations is) 
Arguments: {α : Type u_1} (t : α) (ts is : List α)
Goal: (t :: ts).permutationsAux is =
  List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) (ts.permutationsAux (t :: is)) is.permutations
-- List.permutations_nil
@[simp]
theorem permutations_nil : permutations ([] : List α) = [[]] 
Arguments: {α : Type u_1}
Goal: [].permutations = [[]]
-- List.map_permutationsAux
theorem map_permutationsAux (f : α → β) :
    ∀ ts is :
    List α, map (map f) (permutationsAux ts is) = permutationsAux (map f ts) (map f is) 
Arguments: {α : Type u_1} {β : Type u_2} (f : α → β) (ts is : List α)
Goal: List.map (List.map f) (ts.permutationsAux is) = (List.map f ts).permutationsAux (List.map f is)
-- List.map_permutations
theorem map_permutations (f : α → β) (ts : List α) :
    map (map f) (permutations ts) = permutations (map f ts) 
Arguments: {α : Type u_1} {β : Type u_2} (f : α → β) (ts : List α)
Goal: List.map (List.map f) ts.permutations = (List.map f ts).permutations
-- List.map_permutations'
theorem map_permutations' (f : α → β) (ts : List α) :
    map (map f) (permutations' ts) = permutations' (map f ts) 
Arguments: {α : Type u_1} {β : Type u_2} (f : α → β) (ts : List α)
Goal: List.map (List.map f) ts.permutations' = (List.map f ts).permutations'
-- List.permutationsAux_append
theorem permutationsAux_append (is is' ts : List α) :
    permutationsAux (is ++ ts) is' =
      (permutationsAux is is').map (· ++ ts) ++ permutationsAux ts (is.reverse ++ is') 
Arguments: {α : Type u_1} (is is' ts : List α)
Goal: (is ++ ts).permutationsAux is' =
  List.map (fun x => x ++ ts) (is.permutationsAux is') ++ ts.permutationsAux (is.reverse ++ is')
-- List.permutations_append
theorem permutations_append (is ts : List α) :
    permutations (is ++ ts) = (permutations is).map (· ++ ts) ++ permutationsAux ts is.reverse 
Arguments: {α : Type u_1} (is ts : List α)
Goal: (is ++ ts).permutations = List.map (fun x => x ++ ts) is.permutations ++ ts.permutationsAux is.reverse
-- List.Sorted.le_of_lt
protected theorem Sorted.le_of_lt [Preorder α] {l : List α} (h : l.Sorted (· < ·)) :
    l.Sorted (· ≤ ·) 
Arguments: {α : Type u} [Preorder α] {l : List α} (h : List.Sorted (fun x x_1 => x < x_1) l)
Goal: List.Sorted (fun x x_1 => x ≤ x_1) l
-- List.Sorted.lt_of_le
protected theorem Sorted.lt_of_le [PartialOrder α] {l : List α} (h₁ : l.Sorted (· ≤ ·))
    (h₂ : l.Nodup) : l.Sorted (· < ·) 
Arguments: {α : Type u} [PartialOrder α] {l : List α} (h₁ : List.Sorted (fun x x_1 => x ≤ x_1) l) (h₂ : l.Nodup)
Goal: List.Sorted (fun x x_1 => x < x_1) l
-- List.Sorted.ge_of_gt
protected theorem Sorted.ge_of_gt [Preorder α] {l : List α} (h : l.Sorted (· > ·)) :
    l.Sorted (· ≥ ·) 
Arguments: {α : Type u} [Preorder α] {l : List α} (h : List.Sorted (fun x x_1 => x > x_1) l)
Goal: List.Sorted (fun x x_1 => x ≥ x_1) l
-- List.Sorted.gt_of_ge
protected theorem Sorted.gt_of_ge [PartialOrder α] {l : List α} (h₁ : l.Sorted (· ≥ ·))
    (h₂ : l.Nodup) : l.Sorted (· > ·) 
Arguments: {α : Type u} [PartialOrder α] {l : List α} (h₁ : List.Sorted (fun x x_1 => x ≥ x_1) l) (h₂ : l.Nodup)
Goal: List.Sorted (fun x x_1 => x > x_1) l
-- List.sorted_nil
@[simp]
theorem sorted_nil : Sorted r [] 
Arguments: {α : Type u} {r : α → α → Prop}
Goal: List.Sorted r []
-- List.Sorted.of_cons
theorem Sorted.of_cons : Sorted r (a :: l) → Sorted r l 
Arguments: {α : Type u} {r : α → α → Prop} {a : α} {l : List α}
Goal: List.Sorted r (a :: l) → List.Sorted r l
-- List.Sorted.tail
theorem Sorted.tail {r : α → α → Prop} {l : List α} (h : Sorted r l) : Sorted r l.tail 
Arguments: {α : Type u} {r : α → α → Prop} {l : List α} (h : List.Sorted r l)
Goal: List.Sorted r l.tail
-- List.rel_of_sorted_cons
theorem rel_of_sorted_cons {a : α} {l : List α} : Sorted r (a :: l) → ∀ b ∈ l, r a b 
Arguments: {α : Type u} {r : α → α → Prop} {a : α} {l : List α}
Goal: List.Sorted r (a :: l) → ∀ b ∈ l, r a b
-- List.Sorted.head!_le
theorem Sorted.head!_le [Inhabited α] [Preorder α] {a : α} {l : List α} (h : Sorted (· < ·) l)
    (ha : a ∈ l) : l.head! ≤ a 
Arguments: {α : Type u} [Inhabited α] [Preorder α] {a : α} {l : List α} (h : List.Sorted (fun x x_1 => x < x_1) l) (ha : a ∈ l)
Goal: l.head! ≤ a
-- List.Sorted.le_head!
theorem Sorted.le_head! [Inhabited α] [Preorder α] {a : α} {l : List α} (h : Sorted (· > ·) l)
    (ha : a ∈ l) : a ≤ l.head! 
Arguments: {α : Type u} [Inhabited α] [Preorder α] {a : α} {l : List α} (h : List.Sorted (fun x x_1 => x > x_1) l) (ha : a ∈ l)
Goal: a ≤ l.head!
-- List.sorted_cons
@[simp]
theorem sorted_cons {a : α} {l : List α} : Sorted r (a :: l) ↔ (∀ b ∈ l, r a b) ∧ Sorted r l 
Arguments: {α : Type u} {r : α → α → Prop} {a : α} {l : List α}
Goal: List.Sorted r (a :: l) ↔ (∀ b ∈ l, r a b) ∧ List.Sorted r l
-- List.Sorted.nodup
protected theorem Sorted.nodup {r : α → α → Prop} [IsIrrefl α r] {l : List α} (h : Sorted r l) :
    Nodup l 
Arguments: {α : Type u} {r : α → α → Prop} [IsIrrefl α r] {l : List α} (h : List.Sorted r l)
Goal: l.Nodup
-- List.eq_of_perm_of_sorted
theorem eq_of_perm_of_sorted [IsAntisymm α r] {l₁ l₂ : List α} (hp : l₁ ~ l₂) (hs₁ : Sorted r l₁)
    (hs₂ : Sorted r l₂) : l₁ = l₂ 
Arguments: {α : Type u} {r : α → α → Prop} [IsAntisymm α r] {l₁ l₂ : List α} (hp : l₁.Perm l₂) (hs₁ : List.Sorted r l₁) (hs₂ : List.Sorted r l₂)
Goal: l₁ = l₂
-- List.sublist_of_subperm_of_sorted
theorem sublist_of_subperm_of_sorted [IsAntisymm α r] {l₁ l₂ : List α} (hp : l₁ <+~ l₂)
    (hs₁ : l₁.Sorted r) (hs₂ : l₂.Sorted r) : l₁ <+ l₂ 
Arguments: {α : Type u} {r : α → α → Prop} [IsAntisymm α r] {l₁ l₂ : List α} (hp : l₁.Subperm l₂) (hs₁ : List.Sorted r l₁) (hs₂ : List.Sorted r l₂)
Goal: l₁.Sublist l₂
-- List.sorted_singleton
@[simp 1100] -- Porting note: higher priority for linter
theorem sorted_singleton (a : α) : Sorted r [a] 
Arguments: {α : Type u} {r : α → α → Prop} (a : α)
Goal: List.Sorted r [a]
-- List.Sorted.rel_get_of_lt
theorem Sorted.rel_get_of_lt {l : List α} (h : l.Sorted r) {a b : Fin l.length} (hab : a < b) :
    r (l.get a) (l.get b) 
Arguments: {α : Type u} {r : α → α → Prop} {l : List α} (h : List.Sorted r l) {a b : Fin l.length} (hab : a < b)
Goal: r (l.get a) (l.get b)
-- List.Sorted.rel_nthLe_of_lt
@[deprecated Sorted.rel_get_of_lt (since := "2024-05-08")]
theorem Sorted.rel_nthLe_of_lt {l : List α} (h : l.Sorted r) {a b : ℕ} (ha : a < l.length)
    (hb : b < l.length) (hab : a < b) : r (l.nthLe a ha) (l.nthLe b hb) 
Arguments: {α : Type u} {r : α → α → Prop} {l : List α} (h : List.Sorted r l) {a b : ℕ} (ha : a < l.length) (hb : b < l.length) (hab : a < b)
Goal: r (l.nthLe a ha) (l.nthLe b hb)
-- List.Sorted.rel_get_of_le
theorem Sorted.rel_get_of_le [IsRefl α r] {l : List α} (h : l.Sorted r) {a b : Fin l.length}
    (hab : a ≤ b) : r (l.get a) (l.get b) 
Arguments: {α : Type u} {r : α → α → Prop} [IsRefl α r] {l : List α} (h : List.Sorted r l) {a b : Fin l.length} (hab : a ≤ b)
Goal: r (l.get a) (l.get b)
-- List.Sorted.rel_nthLe_of_le
@[deprecated Sorted.rel_get_of_le (since := "2024-05-08")]
theorem Sorted.rel_nthLe_of_le [IsRefl α r] {l : List α} (h : l.Sorted r) {a b : ℕ}
    (ha : a < l.length) (hb : b < l.length) (hab : a ≤ b) : r (l.nthLe a ha) (l.nthLe b hb) 
Arguments: {α : Type u} {r : α → α → Prop} [IsRefl α r] {l : List α} (h : List.Sorted r l) {a b : ℕ} (ha : a < l.length) (hb : b < l.length) (hab : a ≤ b)
Goal: r (l.nthLe a ha) (l.nthLe b hb)
-- List.Sorted.rel_of_mem_take_of_mem_drop
theorem Sorted.rel_of_mem_take_of_mem_drop {l : List α} (h : List.Sorted r l) {k : ℕ} {x y : α}
    (hx : x ∈ List.take k l) (hy : y ∈ List.drop k l) : r x y 
Arguments: {α : Type u} {r : α → α → Prop} {l : List α} (h : List.Sorted r l) {k : ℕ} {x y : α} (hx : x ∈ List.take k l) (hy : y ∈ List.drop k l)
Goal: r x y
-- List.sorted_ofFn_iff
theorem sorted_ofFn_iff {r : α → α → Prop} : (ofFn f).Sorted r ↔ ((· < ·) ⇒ r) f f 
Arguments: {n : ℕ} {α : Type u} {f : Fin n → α} {r : α → α → Prop}
Goal: List.Sorted r (List.ofFn f) ↔ ((fun x x_1 => x < x_1) ⇒ r) f f
-- List.sorted_lt_ofFn_iff
@[simp] theorem sorted_lt_ofFn_iff : (ofFn f).Sorted (· < ·) ↔ StrictMono f 
Arguments: {n : ℕ} {α : Type u} {f : Fin n → α} [Preorder α]
Goal: List.Sorted (fun x x_1 => x < x_1) (List.ofFn f) ↔ StrictMono f
-- List.sorted_le_ofFn_iff
@[simp] theorem sorted_le_ofFn_iff : (ofFn f).Sorted (· ≤ ·) ↔ Monotone f 
Arguments: {n : ℕ} {α : Type u} {f : Fin n → α} [Preorder α]
Goal: List.Sorted (fun x x_1 => x ≤ x_1) (List.ofFn f) ↔ Monotone f
-- List.monotone_iff_ofFn_sorted
@[deprecated sorted_le_ofFn_iff (since := "2023-01-10")]
theorem monotone_iff_ofFn_sorted : Monotone f ↔ (ofFn f).Sorted (· ≤ ·) 
Arguments: {n : ℕ} {α : Type u} {f : Fin n → α} [Preorder α]
Goal: Monotone f ↔ List.Sorted (fun x x_1 => x ≤ x_1) (List.ofFn f)
-- List.orderedInsert_nil
@[simp]
theorem orderedInsert_nil (a : α) : [].orderedInsert r a = [a] 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (a : α)
Goal: List.orderedInsert r a [] = [a]
-- List.orderedInsert_length
theorem orderedInsert_length : ∀ (L : List α) (a : α), (L.orderedInsert r a).length = L.length + 1
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (L : List α) (a : α)
Goal: (List.orderedInsert r a L).length = L.length + 1
-- List.orderedInsert_eq_take_drop
theorem orderedInsert_eq_take_drop (a : α) :
    ∀ l : List α,
      l.orderedInsert r a = (l.takeWhile fun b => ¬a ≼ b) ++ a :: l.dropWhile fun b => ¬a ≼ b
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (a : α) (l : List α)
Goal: List.orderedInsert r a l = List.takeWhile (fun b => decide ¬r a b) l ++ a :: List.dropWhile (fun b => decide ¬r a b) l
-- List.insertionSort_cons_eq_take_drop
theorem insertionSort_cons_eq_take_drop (a : α) (l : List α) :
    insertionSort r (a :: l) =
      ((insertionSort r l).takeWhile fun b => ¬a ≼ b) ++
        a :: (insertionSort r l).dropWhile fun b => ¬a ≼ b 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (a : α) (l : List α)
Goal: List.insertionSort r (a :: l) =
  List.takeWhile (fun b => decide ¬r a b) (List.insertionSort r l) ++
    a :: List.dropWhile (fun b => decide ¬r a b) (List.insertionSort r l)
-- List.mem_orderedInsert
@[simp]
theorem mem_orderedInsert {a b : α} {l : List α} :
    a ∈ orderedInsert r b l ↔ a = b ∨ a ∈ l 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] {a b : α} {l : List α}
Goal: a ∈ List.orderedInsert r b l ↔ a = b ∨ a ∈ l
-- List.perm_orderedInsert
theorem perm_orderedInsert (a) : ∀ l : List α, orderedInsert r a l ~ a :: l
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (a : α) (l : List α)
Goal: (List.orderedInsert r a l).Perm (a :: l)
-- List.orderedInsert_count
theorem orderedInsert_count [DecidableEq α] (L : List α) (a b : α) :
    count a (L.orderedInsert r b) = count a L + if a = b then 1 else 0 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] [DecidableEq α] (L : List α) (a b : α)
Goal: List.count a (List.orderedInsert r b L) = List.count a L + if a = b then 1 else 0
-- List.perm_insertionSort
theorem perm_insertionSort : ∀ l : List α, insertionSort r l ~ l
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (l : List α)
Goal: (List.insertionSort r l).Perm l
-- List.Sorted.insertionSort_eq
theorem Sorted.insertionSort_eq : ∀ {l : List α}, Sorted r l → insertionSort r l = l
  
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] {l : List α}
Goal: List.Sorted r l → List.insertionSort r l = l
-- List.erase_orderedInsert
theorem erase_orderedInsert [DecidableEq α] [IsRefl α r] (x : α) (xs : List α) :
    (xs.orderedInsert r x).erase x = xs 
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] [DecidableEq α] [IsRefl α r] (x : α) (xs : List α)
Goal: (List.orderedInsert r x xs).erase x = xs
-- List.erase_orderedInsert_of_not_mem
theorem erase_orderedInsert_of_not_mem [DecidableEq α]
    {x : α} {xs : List α} (hx : x ∉ xs) :
    (xs.orderedInsert r x).erase x = xs 
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] [DecidableEq α] {x : α} {xs : List α} (hx : x ∉ xs)
Goal: (List.orderedInsert r x xs).erase x = xs
-- List.orderedInsert_erase
theorem orderedInsert_erase [DecidableEq α] [IsAntisymm α r] (x : α) (xs : List α) (hx : x ∈ xs)
    (hxs : Sorted r xs) :
    (xs.erase x).orderedInsert r x = xs 
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] [DecidableEq α] [IsAntisymm α r] (x : α) (xs : List α) (hx : x ∈ xs) (hxs : List.Sorted r xs)
Goal: List.orderedInsert r x (xs.erase x) = xs
-- List.sublist_orderedInsert
theorem sublist_orderedInsert (x : α) (xs : List α) : xs <+ xs.orderedInsert r x 
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] (x : α) (xs : List α)
Goal: xs.Sublist (List.orderedInsert r x xs)
-- List.Sorted.orderedInsert
theorem Sorted.orderedInsert (a : α) : ∀ l, Sorted r l → Sorted r (orderedInsert r a l)
  
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] [IsTotal α r] [IsTrans α r] (a : α) (l : List α)
Goal: List.Sorted r l → List.Sorted r (List.orderedInsert r a l)
-- List.sorted_insertionSort
theorem sorted_insertionSort : ∀ l, Sorted r (insertionSort r l)
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] [IsTotal α r] [IsTrans α r] (l : List α)
Goal: List.Sorted r (List.insertionSort r l)
-- List.split_cons_of_eq
theorem split_cons_of_eq (a : α) {l l₁ l₂ : List α} (h : split l = (l₁, l₂)) :
    split (a :: l) = (a :: l₂, l₁) 
Arguments: {α : Type u} (a : α) {l l₁ l₂ : List α} (h : l.split = (l₁, l₂))
Goal: (a :: l).split = (a :: l₂, l₁)
-- List.length_split_le
theorem length_split_le :
    ∀ {l l₁ l₂ : List α}, split l = (l₁, l₂) → length l₁ ≤ length l ∧ length l₂ ≤ length l
  
Arguments: {α : Type u} {l l₁ l₂ : List α}
Goal: l.split = (l₁, l₂) → l₁.length ≤ l.length ∧ l₂.length ≤ l.length
-- List.length_split_fst_le
theorem length_split_fst_le (l : List α) : length (split l).1 ≤ length l 
Arguments: {α : Type u} (l : List α)
Goal: l.split.1.length ≤ l.length
-- List.length_split_snd_le
theorem length_split_snd_le (l : List α) : length (split l).2 ≤ length l 
Arguments: {α : Type u} (l : List α)
Goal: l.split.2.length ≤ l.length
-- List.length_split_lt
theorem length_split_lt {a b} {l l₁ l₂ : List α} (h : split (a :: b :: l) = (l₁, l₂)) :
    length l₁ < length (a :: b :: l) ∧ length l₂ < length (a :: b :: l) 
Arguments: {α : Type u} {a b : α} {l l₁ l₂ : List α} (h : (a :: b :: l).split = (l₁, l₂))
Goal: l₁.length < (a :: b :: l).length ∧ l₂.length < (a :: b :: l).length
-- List.perm_split
theorem perm_split : ∀ {l l₁ l₂ : List α}, split l = (l₁, l₂) → l ~ l₁ ++ l₂
  
Arguments: {α : Type u} {l l₁ l₂ : List α}
Goal: l.split = (l₁, l₂) → l.Perm (l₁ ++ l₂)
-- List.mergeSort_cons_cons
@[nolint unusedHavesSuffices] -- Porting note: false positive
theorem mergeSort_cons_cons {a b} {l l₁ l₂ : List α} (h : split (a :: b :: l) = (l₁, l₂)) :
    mergeSort r (a :: b :: l) = merge (r · ·) (mergeSort r l₁) (mergeSort r l₂) 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] {a b : α} {l l₁ l₂ : List α} (h : (a :: b :: l).split = (l₁, l₂))
Goal: List.mergeSort r (a :: b :: l) = List.merge (fun x x_1 => decide (r x x_1)) (List.mergeSort r l₁) (List.mergeSort r l₂)
-- List.perm_mergeSort
theorem perm_mergeSort : ∀ l : List α, mergeSort r l ~ l
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (l : List α)
Goal: (List.mergeSort r l).Perm l
-- List.length_mergeSort
@[simp]
theorem length_mergeSort (l : List α) : (mergeSort r l).length = l.length 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (l : List α)
Goal: (List.mergeSort r l).length = l.length
-- List.Sorted.merge
theorem Sorted.merge : ∀ {l l' : List α}, Sorted r l → Sorted r l' → Sorted r (merge (r · ·) l l')
  
Arguments: {α : Type u} {r : α → α → Prop} [DecidableRel r] [IsTotal α r] [IsTrans α r] {l l' : List α}
Goal: List.Sorted r l → List.Sorted r l' → List.Sorted r (List.merge (fun x x_1 => decide (r x x_1)) l l')
-- List.sorted_mergeSort
theorem sorted_mergeSort : ∀ l : List α, Sorted r (mergeSort r l)
  
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] [IsTotal α r] [IsTrans α r] (l : List α)
Goal: List.Sorted r (List.mergeSort r l)
-- List.mergeSort_eq_self
theorem mergeSort_eq_self [IsAntisymm α r] {l : List α} : Sorted r l → mergeSort r l = l 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] [IsTotal α r] [IsTrans α r] [IsAntisymm α r] {l : List α}
Goal: List.Sorted r l → List.mergeSort r l = l
-- List.mergeSort_eq_insertionSort
theorem mergeSort_eq_insertionSort [IsAntisymm α r] (l : List α) :
    mergeSort r l = insertionSort r l 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] [IsTotal α r] [IsTrans α r] [IsAntisymm α r] (l : List α)
Goal: List.mergeSort r l = List.insertionSort r l
-- List.mergeSort_nil
@[simp]
theorem mergeSort_nil : [].mergeSort r = [] 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r]
Goal: List.mergeSort r [] = []
-- List.mergeSort_singleton
@[simp]
theorem mergeSort_singleton (a : α) : [a].mergeSort r = [a] 
Arguments: {α : Type u} (r : α → α → Prop) [DecidableRel r] (a : α)
Goal: List.mergeSort r [a] = [a]
-- Batteries.DList.toList_ofList
theorem toList_ofList (l : List α) : DList.toList (DList.ofList l) = l 
Arguments: {α : Type u} (l : List α)
Goal: (Batteries.DList.ofList l).toList = l
-- Batteries.DList.ofList_toList
theorem ofList_toList (l : DList α) : DList.ofList (DList.toList l) = l 
Arguments: {α : Type u} (l : Batteries.DList α)
Goal: Batteries.DList.ofList l.toList = l
-- Batteries.DList.toList_empty
theorem toList_empty : toList (@empty α) = [] 
Arguments: {α : Type u}
Goal: Batteries.DList.empty.toList = []
-- Batteries.DList.toList_singleton
theorem toList_singleton (x : α) : toList (singleton x) = [x] 
Arguments: {α : Type u} (x : α)
Goal: (Batteries.DList.singleton x).toList = [x]