l3lab/ntp-mathlib huggingface dataset:
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
    apply Sublist.append (nil_sublist _)
    exact h.sym (n + 1)
  | n + 1, .cons₂ a h => by
    rw [List.sym, List.sym]
    

Proof state:
α : Type u_1
xs✝ ys✝ : List α
n✝¹ n✝ : ℕ
xs ys : List α
h✝ : xs <+ ys
n : ℕ
l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
⊢ List.map (fun p => a ::ₛ p) (List.sym n (a :: l₁✝)) ++ List.sym (n + 1) l₁✝ <+
    List.map (fun p => a ::ₛ p) (List.sym n (a :: l₂✝)) ++ List.sym (n + 1) l₂✝

Next tactic:
apply Sublist.append
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
    apply Sublist.append (nil_sublist _)
    exact h.sym (n + 1)
  | n + 1, .cons₂ a h => by
    rw [List.sym, List.sym]
    apply Sublist.append
    · 

Proof state:
case hl
α : Type u_1
xs✝ ys✝ : List α
n✝¹ n✝ : ℕ
xs ys : List α
h✝ : xs <+ ys
n : ℕ
l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
⊢ List.map (fun p => a ::ₛ p) (List.sym n (a :: l₁✝)) <+ List.map (fun p => a ::ₛ p) (List.sym n (a :: l₂✝))

Next tactic:
exact ((cons₂ a h).sym n).map _
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
    apply Sublist.append (nil_sublist _)
    exact h.sym (n + 1)
  | n + 1, .cons₂ a h => by
    rw [List.sym, List.sym]
    apply Sublist.append
    · exact ((cons₂ a h).sym n).map _
    · 

Proof state:
case hr
α : Type u_1
xs✝ ys✝ : List α
n✝¹ n✝ : ℕ
xs ys : List α
h✝ : xs <+ ys
n : ℕ
l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
⊢ List.sym (n + 1) l₁✝ <+ List.sym (n + 1) l₂✝

Next tactic:
exact h.sym (n + 1)
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝ n : ℕ
xs✝ : List α
a : α
xs : List α
z : Sym α 0
ha : a ∈ z
hz : z ∈ List.sym 0 xs
⊢ a ∈ xs

Next tactic:
cases Sym.eq_nil_of_card_zero z
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    

Proof state:
case refl
α : Type u_1
xs✝¹ ys : List α
n✝ n : ℕ
xs✝ : List α
a : α
xs : List α
ha : a ∈ Sym.nil
hz : Sym.nil ∈ List.sym 0 xs
⊢ a ∈ xs

Next tactic:
simp at ha
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝¹ n✝ : ℕ
xs : List α
a : α
n : ℕ
z : Sym α (n + 1)
ha : a ∈ z
hz : z ∈ List.sym (n + 1) []
⊢ a ∈ []

Next tactic:
simp [List.sym] at hz
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α (n + 1)
ha : a ∈ z
hz : z ∈ List.sym (n + 1) (x :: xs)
⊢ a ∈ x :: xs

Next tactic:
rw [List.sym, mem_append, mem_map] at hz
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α (n + 1)
ha : a ∈ z
hz : (∃ a ∈ List.sym n (x :: xs), x ::ₛ a = z) ∨ z ∈ List.sym (n + 1) xs
⊢ a ∈ x :: xs

Next tactic:
obtain ⟨z, hz, rfl⟩ | hz := hz
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · 

Proof state:
case inl.intro.intro
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α n
hz : z ∈ List.sym n (x :: xs)
ha : a ∈ x ::ₛ z
⊢ a ∈ x :: xs

Next tactic:
rw [Sym.mem_cons] at ha
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · rw [Sym.mem_cons] at ha
      

Proof state:
case inl.intro.intro
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α n
hz : z ∈ List.sym n (x :: xs)
ha : a = x ∨ a ∈ z
⊢ a ∈ x :: xs

Next tactic:
obtain rfl | ha := ha
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · rw [Sym.mem_cons] at ha
      obtain rfl | ha := ha
      · 

Proof state:
case inl.intro.intro.inl
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
xs : List α
z : Sym α n
hz : z ∈ List.sym n (a :: xs)
⊢ a ∈ a :: xs

Next tactic:
simp
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · rw [Sym.mem_cons] at ha
      obtain rfl | ha := ha
      · simp
      · 

Proof state:
case inl.intro.intro.inr
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α n
hz : z ∈ List.sym n (x :: xs)
ha : a ∈ z
⊢ a ∈ x :: xs

Next tactic:
exact mem_of_mem_of_mem_sym ha hz
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · rw [Sym.mem_cons] at ha
      obtain rfl | ha := ha
      · simp
      · exact mem_of_mem_of_mem_sym ha hz
    · 

Proof state:
case inr
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α (n + 1)
ha : a ∈ z
hz : z ∈ List.sym (n + 1) xs
⊢ a ∈ x :: xs

Next tactic:
rw [mem_cons]
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · rw [Sym.mem_cons] at ha
      obtain rfl | ha := ha
      · simp
      · exact mem_of_mem_of_mem_sym ha hz
    · rw [mem_cons]
      

Proof state:
case inr
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α (n + 1)
ha : a ∈ z
hz : z ∈ List.sym (n + 1) xs
⊢ a = x ∨ a ∈ xs

Next tactic:
right
theorem mem_of_mem_of_mem_sym {n : ℕ} {xs : List α} {a : α} {z : Sym α n}
    (ha : a ∈ z) (hz : z ∈ xs.sym n) : a ∈ xs :=
  match n, xs with
  | 0, xs => by
    cases Sym.eq_nil_of_card_zero z
    simp at ha
  | n + 1, [] => by simp [List.sym] at hz
  | n + 1, x :: xs => by
    rw [List.sym, mem_append, mem_map] at hz
    obtain ⟨z, hz, rfl⟩ | hz := hz
    · rw [Sym.mem_cons] at ha
      obtain rfl | ha := ha
      · simp
      · exact mem_of_mem_of_mem_sym ha hz
    · rw [mem_cons]
      right
      

Proof state:
case inr.h
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
a : α
n : ℕ
x : α
xs : List α
z : Sym α (n + 1)
ha : a ∈ z
hz : z ∈ List.sym (n + 1) xs
⊢ a ∈ xs

Next tactic:
exact mem_of_mem_of_mem_sym ha hz
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝ n : ℕ
xs x✝ : List α
h : Nodup x✝
⊢ Nodup (List.sym 0 x✝)

Next tactic:
simp [List.sym]
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝¹ n✝ : ℕ
xs : List α
n : ℕ
h : Nodup []
⊢ Nodup (List.sym (n + 1) [])

Next tactic:
simp [List.sym]
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Nodup (List.sym (n + 1) (x :: xs))

Next tactic:
rw [List.sym]
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Nodup (map (fun p => x ::ₛ p) (List.sym n (x :: xs)) ++ List.sym (n + 1) xs)

Next tactic:
refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    

Proof state:
case inj
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Function.Injective fun p => x ::ₛ p
case disj
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Disjoint (map (fun p => x ::ₛ p) (List.sym n (x :: xs))) (List.sym (n + 1) xs)

Next tactic:
case inj =>
      intro z z'
      simp
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Function.Injective fun p => x ::ₛ p

Next tactic:
case inj =>
      intro z z'
      simp
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Function.Injective fun p => x ::ₛ p

Next tactic:
intro z z'
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
z z' : Sym α n
⊢ (fun p => x ::ₛ p) z = (fun p => x ::ₛ p) z' → z = z'

Next tactic:
simp
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    

Proof state:
case disj
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Disjoint (map (fun p => x ::ₛ p) (List.sym n (x :: xs))) (List.sym (n + 1) xs)

Next tactic:
case disj =>
      intro z hz hz'
      rw [mem_map] at hz
      obtain ⟨z, _hz, rfl⟩ := hz
      have := first_mem_of_cons_mem_sym hz'
      simp only [nodup_cons, this, not_true_eq_false, false_and] at h
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Disjoint (map (fun p => x ::ₛ p) (List.sym n (x :: xs))) (List.sym (n + 1) xs)

Next tactic:
case disj =>
      intro z hz hz'
      rw [mem_map] at hz
      obtain ⟨z, _hz, rfl⟩ := hz
      have := first_mem_of_cons_mem_sym hz'
      simp only [nodup_cons, this, not_true_eq_false, false_and] at h
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    case disj =>
      

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
⊢ Disjoint (map (fun p => x ::ₛ p) (List.sym n (x :: xs))) (List.sym (n + 1) xs)

Next tactic:
intro z hz hz'
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    case disj =>
      intro z hz hz'
      

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
z : Sym α (n + 1)
hz : z ∈ map (fun p => x ::ₛ p) (List.sym n (x :: xs))
hz' : z ∈ List.sym (n + 1) xs
⊢ False

Next tactic:
rw [mem_map] at hz
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    case disj =>
      intro z hz hz'
      rw [mem_map] at hz
      

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
z : Sym α (n + 1)
hz : ∃ a ∈ List.sym n (x :: xs), x ::ₛ a = z
hz' : z ∈ List.sym (n + 1) xs
⊢ False

Next tactic:
obtain ⟨z, _hz, rfl⟩ := hz
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    case disj =>
      intro z hz hz'
      rw [mem_map] at hz
      obtain ⟨z, _hz, rfl⟩ := hz
      

Proof state:
case intro.intro
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
z : Sym α n
_hz : z ∈ List.sym n (x :: xs)
hz' : x ::ₛ z ∈ List.sym (n + 1) xs
⊢ False

Next tactic:
have := first_mem_of_cons_mem_sym hz'
protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup :=
  match n, xs with
  | 0, _ => by simp [List.sym]
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [List.sym]
    refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
    case inj =>
      intro z z'
      simp
    case disj =>
      intro z hz hz'
      rw [mem_map] at hz
      obtain ⟨z, _hz, rfl⟩ := hz
      have := first_mem_of_cons_mem_sym hz'
      

Proof state:
case intro.intro
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : Nodup (x :: xs)
z : Sym α n
_hz : z ∈ List.sym n (x :: xs)
hz' : x ::ₛ z ∈ List.sym (n + 1) xs
this : x ∈ xs
⊢ False

Next tactic:
simp only [nodup_cons, this, not_true_eq_false, false_and] at h
theorem length_sym {n : ℕ} {xs : List α} :
    (xs.sym n).length = Nat.multichoose xs.length n :=
  match n, xs with
  | 0, _ => by 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝ n : ℕ
xs x✝ : List α
⊢ length (List.sym 0 x✝) = Nat.multichoose (length x✝) 0

Next tactic:
rw [List.sym, Nat.multichoose]
theorem length_sym {n : ℕ} {xs : List α} :
    (xs.sym n).length = Nat.multichoose xs.length n :=
  match n, xs with
  | 0, _ => by rw [List.sym, Nat.multichoose]; 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝ n : ℕ
xs x✝ : List α
⊢ length [Sym.nil] = 1

Next tactic:
rfl
theorem length_sym {n : ℕ} {xs : List α} :
    (xs.sym n).length = Nat.multichoose xs.length n :=
  match n, xs with
  | 0, _ => by rw [List.sym, Nat.multichoose]; rfl
  | n + 1, [] => rfl
  | n + 1, x :: xs => by
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ length (List.sym (n + 1) (x :: xs)) = Nat.multichoose (length (x :: xs)) (n + 1)

Next tactic:
rw [List.sym, length_append, length_map, length_cons]
theorem length_sym {n : ℕ} {xs : List α} :
    (xs.sym n).length = Nat.multichoose xs.length n :=
  match n, xs with
  | 0, _ => by rw [List.sym, Nat.multichoose]; rfl
  | n + 1, [] => rfl
  | n + 1, x :: xs => by
    rw [List.sym, length_append, length_map, length_cons]
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ length (List.sym n (x :: xs)) + length (List.sym (n + 1) xs) = Nat.multichoose (Nat.succ (length xs)) (n + 1)

Next tactic:
rw [@length_sym n (x :: xs), @length_sym (n + 1) xs]
theorem length_sym {n : ℕ} {xs : List α} :
    (xs.sym n).length = Nat.multichoose xs.length n :=
  match n, xs with
  | 0, _ => by rw [List.sym, Nat.multichoose]; rfl
  | n + 1, [] => rfl
  | n + 1, x :: xs => by
    rw [List.sym, length_append, length_map, length_cons]
    rw [@length_sym n (x :: xs), @length_sym (n + 1) xs]
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ Nat.multichoose (length (x :: xs)) n + Nat.multichoose (length xs) (n + 1) =
    Nat.multichoose (Nat.succ (length xs)) (n + 1)

Next tactic:
rw [Nat.multichoose_succ_succ, length_cons, add_comm]
/-- Translation in the domain does not change the derivative. -/
lemma HasDerivAt.comp_const_add {𝕜 : Type*} [NontriviallyNormedField 𝕜] (a x : 𝕜) {𝕜' : Type*}
    [NormedAddCommGroup 𝕜'] [NormedSpace 𝕜 𝕜'] {h : 𝕜 → 𝕜'} {h' : 𝕜'}
    (hh : HasDerivAt h h' (a + x)) :
    HasDerivAt (fun x ↦ h (a + x)) h' x := by
  

Proof state:
𝕜 : Type u_1
inst✝² : NontriviallyNormedField 𝕜
a x : 𝕜
𝕜' : Type u_2
inst✝¹ : NormedAddCommGroup 𝕜'
inst✝ : NormedSpace 𝕜 𝕜'
h : 𝕜 → 𝕜'
h' : 𝕜'
hh : HasDerivAt h h' (a + x)
⊢ HasDerivAt (fun x => h (a + x)) h' x

Next tactic:
simpa [Function.comp_def] using HasDerivAt.scomp (𝕜 := 𝕜) x hh <| hasDerivAt_id' x |>.const_add a
/-- Translation in the domain does not change the derivative. -/
lemma HasDerivAt.comp_add_const {𝕜 : Type*} [NontriviallyNormedField 𝕜] (x a : 𝕜) {𝕜' : Type*}
    [NormedAddCommGroup 𝕜'] [NormedSpace 𝕜 𝕜'] {h : 𝕜 → 𝕜'} {h' : 𝕜'}
    (hh : HasDerivAt h h' (x + a)) :
    HasDerivAt (fun x ↦ h (x + a)) h' x := by
  

Proof state:
𝕜 : Type u_1
inst✝² : NontriviallyNormedField 𝕜
x a : 𝕜
𝕜' : Type u_2
inst✝¹ : NormedAddCommGroup 𝕜'
inst✝ : NormedSpace 𝕜 𝕜'
h : 𝕜 → 𝕜'
h' : 𝕜'
hh : HasDerivAt h h' (x + a)
⊢ HasDerivAt (fun x => h (x + a)) h' x

Next tactic:
simpa [Function.comp_def] using HasDerivAt.scomp (𝕜 := 𝕜) x hh <| hasDerivAt_id' x |>.add_const a
instance ringSeminormClass : RingSeminormClass (RingSeminorm R) R ℝ where
  coe f := f.toFun
  coe_injective' f g h := by
    

Proof state:
F : Type u_1
R : Type u_2
S : Type u_3
x y : R
r : ℝ
inst✝ : NonUnitalRing R
f g : RingSeminorm R
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g

Next tactic:
cases f
instance ringSeminormClass : RingSeminormClass (RingSeminorm R) R ℝ where
  coe f := f.toFun
  coe_injective' f g h := by
    cases f
    

Proof state:
case mk
F : Type u_1
R : Type u_2
S : Type u_3
x y : R
r : ℝ
inst✝ : NonUnitalRing R
g : RingSeminorm R
toAddGroupSeminorm✝ : AddGroupSeminorm R
mul_le'✝ :
  ∀ (x y : R),
    AddGroupSeminorm.toFun toAddGroupSeminorm✝ (x * y) ≤
      AddGroupSeminorm.toFun toAddGroupSeminorm✝ x * AddGroupSeminorm.toFun toAddGroupSeminorm✝ y
h : (fun f => f.toFun) { toAddGroupSeminorm := toAddGroupSeminorm✝, mul_le' := mul_le'✝ } = (fun f => f.toFun) g
⊢ { toAddGroupSeminorm := toAddGroupSeminorm✝, mul_le' := mul_le'✝ } = g

Next tactic:
cases g
instance ringSeminormClass : RingSeminormClass (RingSeminorm R) R ℝ where
  coe f := f.toFun
  coe_injective' f g h := by
    cases f
    cases g
    

Proof state:
case mk.mk
F : Type u_1
R : Type u_2
S : Type u_3
x y : R
r : ℝ
inst✝ : NonUnitalRing R
toAddGroupSeminorm✝¹ : AddGroupSeminorm R
mul_le'✝¹ :
  ∀ (x y : R),
    AddGroupSeminorm.toFun toAddGroupSeminorm✝¹ (x * y) ≤
      AddGroupSeminorm.toFun toAddGroupSeminorm✝¹ x * AddGroupSeminorm.toFun toAddGroupSeminorm✝¹ y
toAddGroupSeminorm✝ : AddGroupSeminorm R
mul_le'✝ :
  ∀ (x y : R),
    AddGroupSeminorm.toFun toAddGroupSeminorm✝ (x * y) ≤
      AddGroupSeminorm.toFun toAddGroupSeminorm✝ x * AddGroupSeminorm.toFun toAddGroupSeminorm✝ y
h :
  (fun f => f.toFun) { toAddGroupSeminorm := toAddGroupSeminorm✝¹, mul_le' := mul_le'✝¹ } =
    (fun f => f.toFun) { toAddGroupSeminorm := toAddGroupSeminorm✝, mul_le' := mul_le'✝ }
⊢ { toAddGroupSeminorm := toAddGroupSeminorm✝¹, mul_le' := mul_le'✝¹ } =
    { toAddGroupSeminorm := toAddGroupSeminorm✝, mul_le' := mul_le'✝ }

Next tactic:
congr
instance ringSeminormClass : RingSeminormClass (RingSeminorm R) R ℝ where
  coe f := f.toFun
  coe_injective' f g h := by
    cases f
    cases g
    congr
    

Proof state:
case mk.mk.e_toAddGroupSeminorm
F : Type u_1
R : Type u_2
S : Type u_3
x y : R
r : ℝ
inst✝ : NonUnitalRing R
toAddGroupSeminorm✝¹ : AddGroupSeminorm R
mul_le'✝¹ :
  ∀ (x y : R),
    AddGroupSeminorm.toFun toAddGroupSeminorm✝¹ (x * y) ≤
      AddGroupSeminorm.toFun toAddGroupSeminorm✝¹ x * AddGroupSeminorm.toFun toAddGroupSeminorm✝¹ y
toAddGroupSeminorm✝ : AddGroupSeminorm R
mul_le'✝ :
  ∀ (x y : R),
    AddGroupSeminorm.toFun toAddGroupSeminorm✝ (x * y) ≤
      AddGroupSeminorm.toFun toAddGroupSeminorm✝ x * AddGroupSeminorm.toFun toAddGroupSeminorm✝ y
h :
  (fun f => f.toFun) { toAddGroupSeminorm := toAddGroupSeminorm✝¹, mul_le' := mul_le'✝¹ } =
    (fun f => f.toFun) { toAddGroupSeminorm := toAddGroupSeminorm✝, mul_le' := mul_le'✝ }
⊢ toAddGroupSeminorm✝¹ = toAddGroupSeminorm✝

Next tactic:
ext x