Theorem: List.Nodup.sym
File: Mathlib/Data/List/Sym.lean

tactic: simp [List.sym]
state_before: α : Type u_1
xs✝ ys : List α
n✝ n : ℕ
xs x✝ : List α
h : x✝.Nodup
⊢ (List.sym 0 x✝).Nodup
state_after: no goals

tactic: simp [List.sym]
state_before: α : Type u_1
xs✝ ys : List α
n✝¹ n✝ : ℕ
xs : List α
n : ℕ
h : [].Nodup
⊢ (List.sym (n + 1) []).Nodup
state_after: no goals

tactic: rw [List.sym]
state_before: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ (List.sym (n + 1) (x :: xs)).Nodup
state_after: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ (map (fun p => x ::ₛ p) (List.sym n (x :: xs)) ++ List.sym (n + 1) xs).Nodup

tactic: refine Nodup.append (Nodup.map ?inj (Nodup.sym n h)) (Nodup.sym (n + 1) h.of_cons) ?disj
state_before: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ (map (fun p => x ::ₛ p) (List.sym n (x :: xs)) ++ List.sym (n + 1) xs).Nodup
state_after: case inj
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ Function.Injective fun p => x ::ₛ p

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

tactic: case inj =>
  intro z z'
  simp
state_before: case inj
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ Function.Injective fun p => x ::ₛ p

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

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
state_before: case disj
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ (map (fun p => x ::ₛ p) (List.sym n (x :: xs))).Disjoint (List.sym (n + 1) xs)
state_after: no goals

tactic: intro z z'
state_before: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
⊢ Function.Injective fun p => x ::ₛ p
state_after: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z z' : Sym α n
⊢ (fun p => x ::ₛ p) z = (fun p => x ::ₛ p) z' → z = z'

tactic: simp
state_before: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z z' : Sym α n
⊢ (fun p => x ::ₛ p) z = (fun p => x ::ₛ p) z' → z = z'
state_after: no goals

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

tactic: rw [mem_map] at hz
state_before: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z : Sym α (n + 1)
hz : z ∈ map (fun p => x ::ₛ p) (List.sym n (x :: xs))
hz' : z ∈ List.sym (n + 1) xs
⊢ False
state_after: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z : Sym α (n + 1)
hz : ∃ a ∈ List.sym n (x :: xs), x ::ₛ a = z
hz' : z ∈ List.sym (n + 1) xs
⊢ False

tactic: obtain ⟨z, _hz, rfl⟩ := hz
state_before: α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z : Sym α (n + 1)
hz : ∃ a ∈ List.sym n (x :: xs), x ::ₛ a = z
hz' : z ∈ List.sym (n + 1) xs
⊢ False
state_after: case intro.intro
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z : Sym α n
_hz : z ∈ List.sym n (x :: xs)
hz' : x ::ₛ z ∈ List.sym (n + 1) xs
⊢ False

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

tactic: simp only [nodup_cons, this, not_true_eq_false, false_and] at h
state_before: case intro.intro
α : Type u_1
xs✝¹ ys : List α
n✝¹ n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
h : (x :: xs).Nodup
z : Sym α n
_hz : z ∈ List.sym n (x :: xs)
hz' : x ::ₛ z ∈ List.sym (n + 1) xs
this : x ∈ xs
⊢ False
state_after: no goals