case nil
α : Type u_1
l l₁✝ : List α
p : α → Prop
a : α
inst✝ : DecidableEq α
l₁ : List α
h : a ∈ []
⊢ List.bagInter (a :: l₁) [] = a :: List.bagInter l₁ (List.erase [] a)

case cons
α : Type u_1
l l₁✝ : List α
p : α → Prop
a : α
inst✝ : DecidableEq α
l₁ : List α
head✝ : α
tail✝ : List α
h : a ∈ head✝ :: tail✝
⊢ List.bagInter (a :: l₁) (head✝ :: tail✝) = a :: List.bagInter l₁ (List.erase (head✝ :: tail✝) a)
α : Type u_1
l l₁✝ l₂ : List α
p : α → Prop
a : α
inst✝ : DecidableEq α
l₁ : List α
h : a ∈ l₂
⊢ List.bagInter (a :: l₁) l₂ = a :: List.bagInter l₁ (List.erase l₂ a)
cases l₂
no goals
case nil
α : Type u_1
l l₁✝ : List α
p : α → Prop
a : α
inst✝ : DecidableEq α
l₁ : List α
h : a ∈ []
⊢ List.bagInter (a :: l₁) [] = a :: List.bagInter l₁ (List.erase [] a)
exact if_pos h
no goals
case cons
α : Type u_1
l l₁✝ : List α
p : α → Prop
a : α
inst✝ : DecidableEq α
l₁ : List α
head✝ : α
tail✝ : List α
h : a ∈ head✝ :: tail✝
⊢ List.bagInter (a :: l₁) (head✝ :: tail✝) = a :: List.bagInter l₁ (List.erase (head✝ :: tail✝) a)
simp only [List.bagInter, if_pos (elem_eq_true_of_mem h)]