Theorem: List.monotone_filter_right
File: Mathlib/Data/List/Basic.lean

tactic: induction' l with hd tl IH
state_before: ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ : α → Bool
l : List α
p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
⊢ filter p l <+ filter q l

tactic: rfl
state_before: case nil
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
⊢ filter p [] <+ filter q []

tactic: by_cases hp : p hd
state_before: case cons
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
⊢ filter p (hd :: tl) <+ filter q (hd :: tl)

tactic: rw [filter_cons_of_pos _ hp, filter_cons_of_pos _ (h _ hp)]
state_before: case pos
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : p hd = true
⊢ filter p (hd :: tl) <+ filter q (hd :: tl)

tactic: exact IH.cons_cons hd
state_before: case pos
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : p hd = true
⊢ hd :: filter p tl <+ hd :: filter q tl

tactic: rw [filter_cons_of_neg _ hp]
state_before: case neg
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : ¬p hd = true
⊢ filter p (hd :: tl) <+ filter q (hd :: tl)

tactic: by_cases hq : q hd
state_before: case neg
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : ¬p hd = true
⊢ filter p tl <+ filter q (hd :: tl)

tactic: rw [filter_cons_of_pos _ hq]
state_before: case pos
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : ¬p hd = true
hq : q hd = true
⊢ filter p tl <+ filter q (hd :: tl)

tactic: exact sublist_cons_of_sublist hd IH
state_before: case pos
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : ¬p hd = true
hq : q hd = true
⊢ filter p tl <+ hd :: filter q tl

tactic: rw [filter_cons_of_neg _ hq]
state_before: case neg
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : ¬p hd = true
hq : ¬q hd = true
⊢ filter p tl <+ filter q (hd :: tl)

tactic: exact IH
state_before: case neg
ι : Type ?u.380416
α : Type u
β : Type v
γ : Type w
δ : Type x
l₁ l₂ : List α
p✝ p q : α → Bool
h : ∀ (a : α), p a = true → q a = true
hd : α
tl : List α
IH : filter p tl <+ filter q tl
hp : ¬p hd = true
hq : ¬q hd = true
⊢ filter p tl <+ filter q tl