α : Type uu
β : Type vv
l₁ l₂ l : List α
p q : α → Bool
⊢ countp p l = countp p (filter q l ++ filter (fun a => decide ¬q a = true) l)
α : Type uu
β : Type vv
l₁ l₂ l : List α
p q : α → Bool
⊢ countp p l = countp p (filter q l) + countp p (filter (fun a => decide ¬q a = true) l)
rw [← countp_append]
no goals
α : Type uu
β : Type vv
l₁ l₂ l : List α
p q : α → Bool
⊢ countp p l = countp p (filter q l ++ filter (fun a => decide ¬q a = true) l)
exact Perm.countp_eq _ (filter_append_perm _ _).symm