Theorem: Multiset.powersetCardAux_perm
File: Mathlib/Data/Multiset/Powerset.lean

tactic: induction' n with n IHn generalizing l₁ l₂
state_before: α : Type u_1
n : ℕ
l₁ l₂ : List α
p : l₁ ~ l₂
⊢ powersetCardAux n l₁ ~ powersetCardAux n l₂
state_after: case zero
α : Type u_1
l₁ l₂ : List α
p : l₁ ~ l₂
⊢ powersetCardAux 0 l₁ ~ powersetCardAux 0 l₂

case succ
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
p : l₁ ~ l₂
⊢ powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂

tactic: induction' p with a l₁ l₂ p IH a b l l₁ l₂ l₃ _ _ IH₁ IH₂
state_before: case succ
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
p : l₁ ~ l₂
⊢ powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
state_after: case succ.nil
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
⊢ powersetCardAux (n + 1) [] ~ powersetCardAux (n + 1) []

case succ.cons
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁✝ l₂✝ : List α
a : α
l₁ l₂ : List α
p : l₁ ~ l₂
IH : powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
⊢ powersetCardAux (n + 1) (a :: l₁) ~ powersetCardAux (n + 1) (a :: l₂)

case succ.swap
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
a b : α
l : List α
⊢ powersetCardAux (n + 1) (b :: a :: l) ~ powersetCardAux (n + 1) (a :: b :: l)

case succ.trans
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁✝ l₂✝ l₁ l₂ l₃ : List α
a✝¹ : l₁ ~ l₂
a✝ : l₂ ~ l₃
IH₁ : powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
IH₂ : powersetCardAux (n + 1) l₂ ~ powersetCardAux (n + 1) l₃
⊢ powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₃

tactic: simp
state_before: case zero
α : Type u_1
l₁ l₂ : List α
p : l₁ ~ l₂
⊢ powersetCardAux 0 l₁ ~ powersetCardAux 0 l₂
state_after: no goals

tactic: rfl
state_before: case succ.nil
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
⊢ powersetCardAux (n + 1) [] ~ powersetCardAux (n + 1) []
state_after: no goals

tactic: simp only [powersetCardAux_cons]
state_before: case succ.cons
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁✝ l₂✝ : List α
a : α
l₁ l₂ : List α
p : l₁ ~ l₂
IH : powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
⊢ powersetCardAux (n + 1) (a :: l₁) ~ powersetCardAux (n + 1) (a :: l₂)
state_after: case succ.cons
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁✝ l₂✝ : List α
a : α
l₁ l₂ : List α
p : l₁ ~ l₂
IH : powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
⊢ powersetCardAux (n + 1) l₁ ++ List.map (cons a) (powersetCardAux n l₁) ~
    powersetCardAux (n + 1) l₂ ++ List.map (cons a) (powersetCardAux n l₂)

tactic: exact IH.append ((IHn p).map _)
state_before: case succ.cons
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁✝ l₂✝ : List α
a : α
l₁ l₂ : List α
p : l₁ ~ l₂
IH : powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
⊢ powersetCardAux (n + 1) l₁ ++ List.map (cons a) (powersetCardAux n l₁) ~
    powersetCardAux (n + 1) l₂ ++ List.map (cons a) (powersetCardAux n l₂)
state_after: no goals

tactic: simp only [powersetCardAux_cons, append_assoc]
state_before: case succ.swap
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
a b : α
l : List α
⊢ powersetCardAux (n + 1) (b :: a :: l) ~ powersetCardAux (n + 1) (a :: b :: l)
state_after: case succ.swap
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
a b : α
l : List α
⊢ powersetCardAux (n + 1) l ++
      (List.map (cons a) (powersetCardAux n l) ++ List.map (cons b) (powersetCardAux n (a :: l))) ~
    powersetCardAux (n + 1) l ++
      (List.map (cons b) (powersetCardAux n l) ++ List.map (cons a) (powersetCardAux n (b :: l)))

tactic: apply Perm.append_left
state_before: case succ.swap
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
a b : α
l : List α
⊢ powersetCardAux (n + 1) l ++
      (List.map (cons a) (powersetCardAux n l) ++ List.map (cons b) (powersetCardAux n (a :: l))) ~
    powersetCardAux (n + 1) l ++
      (List.map (cons b) (powersetCardAux n l) ++ List.map (cons a) (powersetCardAux n (b :: l)))
state_after: case succ.swap.a
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
a b : α
l : List α
⊢ List.map (cons a) (powersetCardAux n l) ++ List.map (cons b) (powersetCardAux n (a :: l)) ~
    List.map (cons b) (powersetCardAux n l) ++ List.map (cons a) (powersetCardAux n (b :: l))

tactic: cases n
state_before: case succ.swap.a
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁ l₂ : List α
a b : α
l : List α
⊢ List.map (cons a) (powersetCardAux n l) ++ List.map (cons b) (powersetCardAux n (a :: l)) ~
    List.map (cons b) (powersetCardAux n l) ++ List.map (cons a) (powersetCardAux n (b :: l))
state_after: case succ.swap.a.zero
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux 0 l₁ ~ powersetCardAux 0 l₂
⊢ List.map (cons a) (powersetCardAux 0 l) ++ List.map (cons b) (powersetCardAux 0 (a :: l)) ~
    List.map (cons b) (powersetCardAux 0 l) ++ List.map (cons a) (powersetCardAux 0 (b :: l))

case succ.swap.a.succ
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++ List.map (cons b) (powersetCardAux (n✝ + 1) (a :: l)) ~
    List.map (cons b) (powersetCardAux (n✝ + 1) l) ++ List.map (cons a) (powersetCardAux (n✝ + 1) (b :: l))

tactic: simp only [powersetCardAux_cons, map_append, List.map_map]
state_before: case succ.swap.a.succ
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++ List.map (cons b) (powersetCardAux (n✝ + 1) (a :: l)) ~
    List.map (cons b) (powersetCardAux (n✝ + 1) l) ++ List.map (cons a) (powersetCardAux (n✝ + 1) (b :: l))
state_after: case succ.swap.a.succ
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++
      (List.map (cons b) (powersetCardAux (n✝ + 1) l) ++ List.map (cons b ∘ cons a) (powersetCardAux n✝ l)) ~
    List.map (cons b) (powersetCardAux (n✝ + 1) l) ++
      (List.map (cons a) (powersetCardAux (n✝ + 1) l) ++ List.map (cons a ∘ cons b) (powersetCardAux n✝ l))

tactic: rw [← append_assoc, ← append_assoc,
  (by funext s; simp [cons_swap] : cons b ∘ cons a = cons a ∘ cons b)]
state_before: case succ.swap.a.succ
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++
      (List.map (cons b) (powersetCardAux (n✝ + 1) l) ++ List.map (cons b ∘ cons a) (powersetCardAux n✝ l)) ~
    List.map (cons b) (powersetCardAux (n✝ + 1) l) ++
      (List.map (cons a) (powersetCardAux (n✝ + 1) l) ++ List.map (cons a ∘ cons b) (powersetCardAux n✝ l))
state_after: case succ.swap.a.succ
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++ List.map (cons b) (powersetCardAux (n✝ + 1) l) ++
      List.map (cons a ∘ cons b) (powersetCardAux n✝ l) ~
    List.map (cons b) (powersetCardAux (n✝ + 1) l) ++ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++
      List.map (cons a ∘ cons b) (powersetCardAux n✝ l)

tactic: exact perm_append_comm.append_right _
state_before: case succ.swap.a.succ
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++ List.map (cons b) (powersetCardAux (n✝ + 1) l) ++
      List.map (cons a ∘ cons b) (powersetCardAux n✝ l) ~
    List.map (cons b) (powersetCardAux (n✝ + 1) l) ++ List.map (cons a) (powersetCardAux (n✝ + 1) l) ++
      List.map (cons a ∘ cons b) (powersetCardAux n✝ l)
state_after: no goals

tactic: simp [Perm.swap]
state_before: case succ.swap.a.zero
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux 0 l₁ ~ powersetCardAux 0 l₂
⊢ List.map (cons a) (powersetCardAux 0 l) ++ List.map (cons b) (powersetCardAux 0 (a :: l)) ~
    List.map (cons b) (powersetCardAux 0 l) ++ List.map (cons a) (powersetCardAux 0 (b :: l))
state_after: no goals

tactic: funext s
state_before: α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
⊢ cons b ∘ cons a = cons a ∘ cons b
state_after: case h
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
s : Multiset α
⊢ (cons b ∘ cons a) s = (cons a ∘ cons b) s

tactic: simp [cons_swap]
state_before: case h
α : Type u_1
l₁ l₂ : List α
a b : α
l : List α
n✝ : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux (n✝ + 1) l₁ ~ powersetCardAux (n✝ + 1) l₂
s : Multiset α
⊢ (cons b ∘ cons a) s = (cons a ∘ cons b) s
state_after: no goals

tactic: exact IH₁.trans IH₂
state_before: case succ.trans
α : Type u_1
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ ~ l₂ → powersetCardAux n l₁ ~ powersetCardAux n l₂
l₁✝ l₂✝ l₁ l₂ l₃ : List α
a✝¹ : l₁ ~ l₂
a✝ : l₂ ~ l₃
IH₁ : powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₂
IH₂ : powersetCardAux (n + 1) l₂ ~ powersetCardAux (n + 1) l₃
⊢ powersetCardAux (n + 1) l₁ ~ powersetCardAux (n + 1) l₃
state_after: no goals