Theorem: nodup_permsOfList
File: Mathlib/Data/Fintype/Perm.lean

tactic: simp [permsOfList]
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
x✝ : Nodup []
⊢ Nodup (permsOfList [])

tactic: have hl' : l.Nodup := hl.of_cons
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
⊢ Nodup (permsOfList (a :: l))

tactic: have hln' : (permsOfList l).Nodup := nodup_permsOfList hl'
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
⊢ Nodup (permsOfList (a :: l))

tactic: have hmeml : ∀ {f : Perm α}, f ∈ permsOfList l → f a = a := fun {f} hf =>
  not_not.1 (mt (mem_of_mem_permsOfList hf _) (nodup_cons.1 hl).1)
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
⊢ Nodup (permsOfList (a :: l))

tactic: rw [permsOfList, List.nodup_append, List.nodup_bind, pairwise_iff_get]
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
⊢ Nodup (permsOfList (a :: l))

tactic: refine ⟨?_, ⟨⟨?_,?_ ⟩, ?_⟩⟩
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
⊢ Nodup (permsOfList l) ∧
    ((∀ (x : α), x ∈ l → Nodup (List.map (fun f => Equiv.swap a x * f) (permsOfList l))) ∧
        ∀ (i j : Fin (length l)),
          i < j →
            List.Disjoint (List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l))
              (List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l))) ∧
      List.Disjoint (permsOfList l) (List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l))

tactic: exact hln'
state_before: case refine_1
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
⊢ Nodup (permsOfList l)

tactic: exact fun _ _ => hln'.map fun _ _ => mul_left_cancel
state_before: case refine_2
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
⊢ ∀ (x : α), x ∈ l → Nodup (List.map (fun f => Equiv.swap a x * f) (permsOfList l))

tactic: intros i j hij x hx₁ hx₂
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
⊢ ∀ (i j : Fin (length l)),
    i < j →
      List.Disjoint (List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l))
        (List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l))

tactic: let ⟨f, hf⟩ := List.mem_map.1 hx₁
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
⊢ False

tactic: let ⟨g, hg⟩ := List.mem_map.1 hx₂
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
⊢ False

tactic: have hix : x a = List.get l i := by
  rw [← hf.2, mul_apply, hmeml hf.1, swap_apply_left]
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a (List.get l j) * g = x
⊢ False

tactic: have hiy : x a = List.get l j := by
  rw [← hg.2, mul_apply, hmeml hg.1, swap_apply_left]
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a (List.get l j) * g = x
hix : ↑x a = List.get l i
⊢ False

tactic: have hieqj : i = j := nodup_iff_injective_get.1 hl' (hix.symm.trans hiy)
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a (List.get l j) * g = x
hix : ↑x a = List.get l i
hiy : ↑x a = List.get l j
⊢ False

tactic: exact absurd hieqj (_root_.ne_of_lt hij)
state_before: case refine_3
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a (List.get l j) * g = x
hix : ↑x a = List.get l i
hiy : ↑x a = List.get l j
hieqj : i = j
⊢ False

tactic: rw [← hf.2, mul_apply, hmeml hf.1, swap_apply_left]
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a (List.get l j) * g = x
⊢ ↑x a = List.get l i

tactic: rw [← hg.2, mul_apply, hmeml hg.1, swap_apply_left]
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
i j : Fin (length l)
hij : i < j
x : Equiv.Perm α
hx₁ : x ∈ List.map (fun f => Equiv.swap a (List.get l i) * f) (permsOfList l)
hx₂ : x ∈ List.map (fun f => Equiv.swap a (List.get l j) * f) (permsOfList l)
f : Equiv.Perm α
hf : f ∈ permsOfList l ∧ Equiv.swap a (List.get l i) * f = x
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a (List.get l j) * g = x
hix : ↑x a = List.get l i
⊢ ↑x a = List.get l j

tactic: intros f hf₁ hf₂
state_before: case refine_4
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
⊢ List.Disjoint (permsOfList l) (List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l))

tactic: let ⟨x, hx, hx'⟩ := List.mem_bind.1 hf₂
state_before: case refine_4
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
⊢ False

tactic: let ⟨g, hg⟩ := List.mem_map.1 hx'
state_before: case refine_4
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
⊢ False

tactic: have hgxa : g⁻¹ x = a := f.injective <| by rw [hmeml hf₁, ← hg.2]; simp
state_before: case refine_4
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a x * g = f
⊢ False

tactic: have hxa : x ≠ a := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx)
state_before: case refine_4
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a x * g = f
hgxa : ↑g⁻¹ x = a
⊢ False

tactic: exact  (List.nodup_cons.1 hl).1 <|
    hgxa ▸ mem_of_mem_permsOfList hg.1 _ (by rwa [apply_inv_self, hgxa])
state_before: case refine_4
α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a x * g = f
hgxa : ↑g⁻¹ x = a
hxa : x ≠ a
⊢ False

tactic: rw [hmeml hf₁, ← hg.2]
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a x * g = f
⊢ ↑f (↑g⁻¹ x) = ↑f a

tactic: simp
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a x * g = f
⊢ ↑(Equiv.swap a x * g) (↑g⁻¹ x) = a

tactic: rwa [apply_inv_self, hgxa]
state_before: α : Type u_1
β : Type ?u.36858
γ : Type ?u.36861
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
l : List α
hl : Nodup (a :: l)
hl' : Nodup l
hln' : Nodup (permsOfList l)
hmeml : ∀ {f : Equiv.Perm α}, f ∈ permsOfList l → ↑f a = a
f : Equiv.Perm α
hf₁ : f ∈ permsOfList l
hf₂ : f ∈ List.bind l fun b => List.map (fun f => Equiv.swap a b * f) (permsOfList l)
x : α
hx : x ∈ l
hx' : f ∈ List.map (fun f => Equiv.swap a x * f) (permsOfList l)
g : Equiv.Perm α
hg : g ∈ permsOfList l ∧ Equiv.swap a x * g = f
hgxa : ↑g⁻¹ x = a
hxa : x ≠ a
⊢ ↑g (↑g⁻¹ x) ≠ ↑g⁻¹ x