Theorem: List.Perm.eraseP
File: .lake/packages/batteries/Batteries/Data/List/Perm.lean

tactic: simp
state_before: case nil
α : Type u_1
f : α → Bool
l₁ l₂ : List α
H : Pairwise (fun a b => f a = true → f b = true → False) []
⊢ List.eraseP f [] ~ List.eraseP f []
state_after: no goals

tactic: if h : f a then simp [h, p]
else simp [h]; exact IH (pairwise_cons.1 H).2
state_before: case cons
α : Type u_1
f : α → Bool
l₁ l₂ : List α
a : α
l₁✝ l₂✝ : List α
p : l₁✝ ~ l₂✝
IH : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
H : Pairwise (fun a b => f a = true → f b = true → False) (a :: l₁✝)
⊢ List.eraseP f (a :: l₁✝) ~ List.eraseP f (a :: l₂✝)
state_after: no goals

tactic: simp [h, p]
state_before: α : Type u_1
f : α → Bool
l₁ l₂ : List α
a : α
l₁✝ l₂✝ : List α
p : l₁✝ ~ l₂✝
IH : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
H : Pairwise (fun a b => f a = true → f b = true → False) (a :: l₁✝)
h : f a = true
⊢ List.eraseP f (a :: l₁✝) ~ List.eraseP f (a :: l₂✝)
state_after: no goals

tactic: simp [h]
state_before: α : Type u_1
f : α → Bool
l₁ l₂ : List α
a : α
l₁✝ l₂✝ : List α
p : l₁✝ ~ l₂✝
IH : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
H : Pairwise (fun a b => f a = true → f b = true → False) (a :: l₁✝)
h : ¬f a = true
⊢ List.eraseP f (a :: l₁✝) ~ List.eraseP f (a :: l₂✝)
state_after: α : Type u_1
f : α → Bool
l₁ l₂ : List α
a : α
l₁✝ l₂✝ : List α
p : l₁✝ ~ l₂✝
IH : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
H : Pairwise (fun a b => f a = true → f b = true → False) (a :: l₁✝)
h : ¬f a = true
⊢ List.eraseP f l₁✝ ~ List.eraseP f l₂✝

tactic: exact IH (pairwise_cons.1 H).2
state_before: α : Type u_1
f : α → Bool
l₁ l₂ : List α
a : α
l₁✝ l₂✝ : List α
p : l₁✝ ~ l₂✝
IH : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
H : Pairwise (fun a b => f a = true → f b = true → False) (a :: l₁✝)
h : ¬f a = true
⊢ List.eraseP f l₁✝ ~ List.eraseP f l₂✝
state_after: no goals

tactic: by_cases h₁ : f a <;> by_cases h₂ : f b <;> simp [h₁, h₂]
state_before: case swap
α : Type u_1
f : α → Bool
l₁ l₂ : List α
a b : α
l : List α
H : Pairwise (fun a b => f a = true → f b = true → False) (b :: a :: l)
⊢ List.eraseP f (b :: a :: l) ~ List.eraseP f (a :: b :: l)
state_after: case pos
α : Type u_1
f : α → Bool
l₁ l₂ : List α
a b : α
l : List α
H : Pairwise (fun a b => f a = true → f b = true → False) (b :: a :: l)
h₁ : f a = true
h₂ : f b = true
⊢ a :: l ~ b :: l

case neg
α : Type u_1
f : α → Bool
l₁ l₂ : List α
a b : α
l : List α
H : Pairwise (fun a b => f a = true → f b = true → False) (b :: a :: l)
h₁ : ¬f a = true
h₂ : ¬f b = true
⊢ b :: a :: List.eraseP f l ~ a :: b :: List.eraseP f l

tactic: cases (pairwise_cons.1 H).1 _ (mem_cons.2 (Or.inl rfl)) h₂ h₁
state_before: case pos
α : Type u_1
f : α → Bool
l₁ l₂ : List α
a b : α
l : List α
H : Pairwise (fun a b => f a = true → f b = true → False) (b :: a :: l)
h₁ : f a = true
h₂ : f b = true
⊢ a :: l ~ b :: l
state_after: no goals

tactic: apply swap
state_before: case neg
α : Type u_1
f : α → Bool
l₁ l₂ : List α
a b : α
l : List α
H : Pairwise (fun a b => f a = true → f b = true → False) (b :: a :: l)
h₁ : ¬f a = true
h₂ : ¬f b = true
⊢ b :: a :: List.eraseP f l ~ a :: b :: List.eraseP f l
state_after: no goals

tactic: refine (IH₁ H).trans (IH₂ ((p₁.pairwise_iff ?_).1 H))
state_before: case trans
α : Type u_1
f : α → Bool
l₁ l₂ l₁✝ l₂✝ l₃✝ : List α
p₁ : l₁✝ ~ l₂✝
a✝ : l₂✝ ~ l₃✝
IH₁ : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
IH₂ : Pairwise (fun a b => f a = true → f b = true → False) l₂✝ → List.eraseP f l₂✝ ~ List.eraseP f l₃✝
H : Pairwise (fun a b => f a = true → f b = true → False) l₁✝
⊢ List.eraseP f l₁✝ ~ List.eraseP f l₃✝
state_after: case trans
α : Type u_1
f : α → Bool
l₁ l₂ l₁✝ l₂✝ l₃✝ : List α
p₁ : l₁✝ ~ l₂✝
a✝ : l₂✝ ~ l₃✝
IH₁ : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
IH₂ : Pairwise (fun a b => f a = true → f b = true → False) l₂✝ → List.eraseP f l₂✝ ~ List.eraseP f l₃✝
H : Pairwise (fun a b => f a = true → f b = true → False) l₁✝
⊢ ∀ {x y : α}, (f x = true → f y = true → False) → f y = true → f x = true → False

tactic: exact fun h h₁ h₂ => h h₂ h₁
state_before: case trans
α : Type u_1
f : α → Bool
l₁ l₂ l₁✝ l₂✝ l₃✝ : List α
p₁ : l₁✝ ~ l₂✝
a✝ : l₂✝ ~ l₃✝
IH₁ : Pairwise (fun a b => f a = true → f b = true → False) l₁✝ → List.eraseP f l₁✝ ~ List.eraseP f l₂✝
IH₂ : Pairwise (fun a b => f a = true → f b = true → False) l₂✝ → List.eraseP f l₂✝ ~ List.eraseP f l₃✝
H : Pairwise (fun a b => f a = true → f b = true → False) l₁✝
⊢ ∀ {x y : α}, (f x = true → f y = true → False) → f y = true → f x = true → False
state_after: no goals