Theorem: List.rel_filter
File: Mathlib/Data/List/Forall2.lean

tactic: dsimp [LiftFun] at hpq
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : (R ⇒ fun x x_1 => x ↔ x_1) (fun x => p x = true) fun x => q x = true
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
⊢ Forall₂ R (filter p (a :: as)) (filter q (b :: bs))

tactic: by_cases h : p a
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
⊢ Forall₂ R (filter p (a :: as)) (filter q (b :: bs))

tactic: have : q b := by rwa [← hpq h₁]
state_before: case pos
α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
h : p a = true
⊢ Forall₂ R (filter p (a :: as)) (filter q (b :: bs))

tactic: simp only [filter_cons_of_pos _ h, filter_cons_of_pos _ this, forall₂_cons, h₁, true_and_iff,
  rel_filter hpq h₂]
state_before: case pos
α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
h : p a = true
this : q b = true
⊢ Forall₂ R (filter p (a :: as)) (filter q (b :: bs))

tactic: rwa [← hpq h₁]
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
h : p a = true
⊢ q b = true

tactic: have : ¬q b := by rwa [← hpq h₁]
state_before: case neg
α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
h : ¬p a = true
⊢ Forall₂ R (filter p (a :: as)) (filter q (b :: bs))

tactic: simp only [filter_cons_of_neg _ h, filter_cons_of_neg _ this, rel_filter hpq h₂]
state_before: case neg
α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
h : ¬p a = true
this : ¬q b = true
⊢ Forall₂ R (filter p (a :: as)) (filter q (b :: bs))

tactic: rwa [← hpq h₁]
state_before: α : Type u_1
β : Type u_2
γ : Type ?u.148999
δ : Type ?u.149002
R S : α → β → Prop
P : γ → δ → Prop
Rₐ : α → α → Prop
p : α → Bool
q : β → Bool
hpq : ∀ ⦃a : α⦄ ⦃b : β⦄, R a b → (p a = true ↔ q b = true)
a : α
as : List α
b : β
bs : List β
h₁ : R a b
h₂ : Forall₂ R as bs
h : ¬p a = true
⊢ ¬q b = true