Theorem: Multiset.cons_eq_cons
File: Mathlib/Data/Multiset/Basic.lean

tactic: haveI : DecidableEq α := Classical.decEq α
state_before: α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
⊢ a ::ₘ as = b ::ₘ bs ↔ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: constructor
state_before: α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
⊢ a ::ₘ as = b ::ₘ bs ↔ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: intro eq
state_before: case mp
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
⊢ a ::ₘ as = b ::ₘ bs → a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: by_cases h : a = b
state_before: case mp
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
⊢ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: subst h
state_before: case pos
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : a = b
⊢ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: simp_all
state_before: case pos
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a : α
as bs : Multiset α
this : DecidableEq α
eq : a ::ₘ as = a ::ₘ bs
⊢ a = a ∧ as = bs ∨ a ≠ a ∧ ∃ cs, as = a ::ₘ cs ∧ bs = a ::ₘ cs

tactic: have : a ∈ b ::ₘ bs := eq ▸ mem_cons_self _ _
state_before: case neg
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
⊢ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: have : a ∈ bs := by simpa [h]
state_before: case neg
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this : a ∈ b ::ₘ bs
⊢ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: rcases exists_cons_of_mem this with ⟨cs, hcs⟩
state_before: case neg
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝¹ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝ : a ∈ b ::ₘ bs
this : a ∈ bs
⊢ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: simp [h, hcs]
state_before: case neg.intro
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝¹ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝ : a ∈ b ::ₘ bs
this : a ∈ bs
cs : Multiset α
hcs : bs = a ::ₘ cs
⊢ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs

tactic: have : a ::ₘ as = b ::ₘ a ::ₘ cs := by simp [eq, hcs]
state_before: case neg.intro
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝¹ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝ : a ∈ b ::ₘ bs
this : a ∈ bs
cs : Multiset α
hcs : bs = a ::ₘ cs
⊢ as = b ::ₘ cs

tactic: have : a ::ₘ as = a ::ₘ b ::ₘ cs := by rwa [cons_swap]
state_before: case neg.intro
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝² : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝¹ : a ∈ b ::ₘ bs
this✝ : a ∈ bs
cs : Multiset α
hcs : bs = a ::ₘ cs
this : a ::ₘ as = b ::ₘ a ::ₘ cs
⊢ as = b ::ₘ cs

tactic: simpa using this
state_before: case neg.intro
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝³ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝² : a ∈ b ::ₘ bs
this✝¹ : a ∈ bs
cs : Multiset α
hcs : bs = a ::ₘ cs
this✝ : a ::ₘ as = b ::ₘ a ::ₘ cs
this : a ::ₘ as = a ::ₘ b ::ₘ cs
⊢ as = b ::ₘ cs

tactic: simpa [h]
state_before: α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this : a ∈ b ::ₘ bs
⊢ a ∈ bs

tactic: simp [eq, hcs]
state_before: α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝¹ : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝ : a ∈ b ::ₘ bs
this : a ∈ bs
cs : Multiset α
hcs : bs = a ::ₘ cs
⊢ a ::ₘ as = b ::ₘ a ::ₘ cs

tactic: rwa [cons_swap]
state_before: α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this✝² : DecidableEq α
eq : a ::ₘ as = b ::ₘ bs
h : ¬a = b
this✝¹ : a ∈ b ::ₘ bs
this✝ : a ∈ bs
cs : Multiset α
hcs : bs = a ::ₘ cs
this : a ::ₘ as = b ::ₘ a ::ₘ cs
⊢ a ::ₘ as = a ::ₘ b ::ₘ cs

tactic: intro h
state_before: case mpr
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
⊢ (a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs) → a ::ₘ as = b ::ₘ bs

tactic: rcases h with (⟨eq₁, eq₂⟩ | ⟨_, cs, eq₁, eq₂⟩)
state_before: case mpr
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
h : a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs
⊢ a ::ₘ as = b ::ₘ bs

tactic: simp [*]
state_before: case mpr.inl.intro
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
eq₁ : a = b
eq₂ : as = bs
⊢ a ::ₘ as = b ::ₘ bs

tactic: simp [*, cons_swap a b]
state_before: case mpr.inr.intro.intro.intro
α : Type u_1
β : Type ?u.21180
γ : Type ?u.21183
a b : α
as bs : Multiset α
this : DecidableEq α
left✝ : a ≠ b
cs : Multiset α
eq₁ : as = b ::ₘ cs
eq₂ : bs = a ::ₘ cs
⊢ a ::ₘ as = b ::ₘ bs