Theorem: List.nodup_permutations
File: Mathlib/Data/List/Perm.lean

tactic: rw [(permutations_perm_permutations' s).nodup_iff]
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
hs : Nodup s
⊢ Nodup (permutations s)

tactic: induction' hs with x l h h' IH
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
hs : Nodup s
⊢ Nodup (permutations' s)

tactic: simp
state_before: case nil
α : Type uu
β : Type vv
l₁ l₂ s : List α
⊢ Nodup (permutations' [])

tactic: rw [permutations']
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
⊢ Nodup (permutations' (x :: l))

tactic: rw [nodup_bind]
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
⊢ Nodup (List.bind (permutations' l) (permutations'Aux x))

tactic: constructor
state_before: case cons
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
⊢ (∀ (x_1 : List α), x_1 ∈ permutations' l → Nodup (permutations'Aux x x_1)) ∧
    Pairwise (fun a b => Disjoint (permutations'Aux x a) (permutations'Aux x b)) (permutations' l)

tactic: intro ys hy
state_before: case cons.left
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
⊢ ∀ (x_1 : List α), x_1 ∈ permutations' l → Nodup (permutations'Aux x x_1)

tactic: rw [mem_permutations'] at hy
state_before: case cons.left
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
ys : List α
hy : ys ∈ permutations' l
⊢ Nodup (permutations'Aux x ys)

tactic: rw [nodup_permutations'Aux_iff, hy.mem_iff]
state_before: case cons.left
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
ys : List α
hy : ys ~ l
⊢ Nodup (permutations'Aux x ys)

tactic: exact fun H => h x H rfl
state_before: case cons.left
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
ys : List α
hy : ys ~ l
⊢ ¬x ∈ l

tactic: refine' IH.pairwise_of_forall_ne fun as ha bs hb H => _
state_before: case cons.right
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
⊢ Pairwise (fun a b => Disjoint (permutations'Aux x a) (permutations'Aux x b)) (permutations' l)

tactic: rw [disjoint_iff_ne]
state_before: case cons.right
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ∈ permutations' l
bs : List α
hb : bs ∈ permutations' l
H : as ≠ bs
⊢ Disjoint (permutations'Aux x as) (permutations'Aux x bs)

tactic: rintro a ha' b hb' rfl
state_before: case cons.right
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ∈ permutations' l
bs : List α
hb : bs ∈ permutations' l
H : as ≠ bs
⊢ ∀ (a : List α), a ∈ permutations'Aux x as → ∀ (b : List α), b ∈ permutations'Aux x bs → a ≠ b

tactic: obtain ⟨⟨n, hn⟩, hn'⟩ := get_of_mem ha'
state_before: case cons.right
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ∈ permutations' l
bs : List α
hb : bs ∈ permutations' l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
⊢ False

tactic: obtain ⟨⟨m, hm⟩, hm'⟩ := get_of_mem hb'
state_before: case cons.right.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ∈ permutations' l
bs : List α
hb : bs ∈ permutations' l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn : n < length (permutations'Aux x as)
hn' : get (permutations'Aux x as) { val := n, isLt := hn } = a
⊢ False

tactic: rw [mem_permutations'] at ha hb
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ∈ permutations' l
bs : List α
hb : bs ∈ permutations' l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn : n < length (permutations'Aux x as)
hn' : get (permutations'Aux x as) { val := n, isLt := hn } = a
m : ℕ
hm : m < length (permutations'Aux x bs)
hm' : get (permutations'Aux x bs) { val := m, isLt := hm } = a
⊢ False

tactic: have hl : as.length = bs.length := (ha.trans hb.symm).length_eq
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn : n < length (permutations'Aux x as)
hn' : get (permutations'Aux x as) { val := n, isLt := hn } = a
m : ℕ
hm : m < length (permutations'Aux x bs)
hm' : get (permutations'Aux x bs) { val := m, isLt := hm } = a
⊢ False

tactic: simp only [Nat.lt_succ_iff, length_permutations'Aux] at hn hm
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn : n < length (permutations'Aux x as)
hn' : get (permutations'Aux x as) { val := n, isLt := hn } = a
m : ℕ
hm : m < length (permutations'Aux x bs)
hm' : get (permutations'Aux x bs) { val := m, isLt := hm } = a
hl : length as = length bs
⊢ False

tactic: rw [← nthLe, nthLe_permutations'Aux] at hn' hm'
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : get (permutations'Aux x as) { val := n, isLt := hn✝ } = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : get (permutations'Aux x bs) { val := m, isLt := hm✝ } = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
⊢ False

tactic: have hx :
  nthLe (insertNth n x as) m (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff, hl]) = x :=
  by simp [hn', ← hm', hm]
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
⊢ False

tactic: have hx' :
  nthLe (insertNth m x bs) n (by rwa [length_insertNth _ _ hm, Nat.lt_succ_iff, ← hl]) =
    x :=
  by simp [hm', ← hn', hn]
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
⊢ False

tactic: rcases lt_trichotomy n m with (ht | ht | ht)
state_before: case cons.right.intro.mk.intro.mk
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
⊢ False

tactic: rwa [length_insertNth _ _ hn, Nat.lt_succ_iff, hl]
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
⊢ m < length (insertNth n x as)

tactic: simp [hn', ← hm', hm]
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
⊢ nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x

tactic: rwa [length_insertNth _ _ hm, Nat.lt_succ_iff, ← hl]
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
⊢ n < length (insertNth m x bs)

tactic: simp [hm', ← hn', hn]
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
⊢ nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x

tactic: suffices x ∈ bs by exact h x (hb.subset this) rfl
state_before: case cons.right.intro.mk.intro.mk.inl
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n < m
⊢ False

tactic: rw [← hx', nthLe_insertNth_of_lt _ _ _ _ ht (ht.trans_le hm)]
state_before: case cons.right.intro.mk.intro.mk.inl
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n < m
⊢ x ∈ bs

tactic: exact nthLe_mem _ _ _
state_before: case cons.right.intro.mk.intro.mk.inl
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n < m
⊢ nthLe bs n (_ : n < length bs) ∈ bs

tactic: exact h x (hb.subset this) rfl
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n < m
this : x ∈ bs
⊢ False

tactic: simp only [ht] at hm' hn'
state_before: case cons.right.intro.mk.intro.mk.inr.inl
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n = m
⊢ False

tactic: rw [← hm'] at hn'
state_before: case cons.right.intro.mk.intro.mk.inr.inl
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n = m
hn' : insertNth m x as = a
⊢ False

tactic: exact H (insertNth_injective _ _ hn')
state_before: case cons.right.intro.mk.intro.mk.inr.inl
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : n = m
hn' : insertNth m x as = insertNth m x bs
⊢ False

tactic: suffices x ∈ as by exact h x (ha.subset this) rfl
state_before: case cons.right.intro.mk.intro.mk.inr.inr
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : m < n
⊢ False

tactic: rw [← hx, nthLe_insertNth_of_lt _ _ _ _ ht (ht.trans_le hn)]
state_before: case cons.right.intro.mk.intro.mk.inr.inr
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : m < n
⊢ x ∈ as

tactic: exact nthLe_mem _ _ _
state_before: case cons.right.intro.mk.intro.mk.inr.inr
α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : m < n
⊢ nthLe as m (_ : m < length as) ∈ as

tactic: exact h x (ha.subset this) rfl
state_before: α : Type uu
β : Type vv
l₁ l₂ s : List α
x : α
l : List α
h : ∀ (a' : α), a' ∈ l → x ≠ a'
h' : Pairwise (fun x x_1 => x ≠ x_1) l
IH : Nodup (permutations' l)
as : List α
ha : as ~ l
bs : List α
hb : bs ~ l
H : as ≠ bs
a : List α
ha' : a ∈ permutations'Aux x as
hb' : a ∈ permutations'Aux x bs
n : ℕ
hn✝ : n < length (permutations'Aux x as)
hn' : insertNth n x as = a
m : ℕ
hm✝ : m < length (permutations'Aux x bs)
hm' : insertNth m x bs = a
hl : length as = length bs
hn : n ≤ length as
hm : m ≤ length bs
hx : nthLe (insertNth n x as) m (_ : m < length (insertNth n x as)) = x
hx' : nthLe (insertNth m x bs) n (_ : n < length (insertNth m x bs)) = x
ht : m < n
this : x ∈ as
⊢ False