Theorem: List.pairwise_filterMap
File: .lake/packages/batteries/Batteries/Data/List/Pairwise.lean

tactic: let _S (a a' : β) := ∀ b ∈ f a, ∀ b' ∈ f a', R b b'
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
l : List β
⊢ Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b') l
state_after: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
l : List β
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
⊢ Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b') l

tactic: simp only [Option.mem_def]
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
l : List β
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
⊢ Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b') l
state_after: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
l : List β
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
⊢ Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l

tactic: induction l with
| nil => simp only [filterMap, Pairwise.nil]
| cons a l IH => ?_
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
l : List β
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
⊢ Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
state_after: case cons
β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
⊢ Pairwise R (filterMap f (a :: l)) ↔
    Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') (a :: l)

tactic: match e : f a with
| none =>
  rw [filterMap_cons_none _ _ e, pairwise_cons]
  simp only [e, false_implies, implies_true, true_and, IH]
| some b =>
  rw [filterMap_cons_some _ _ _ e]
  simpa [IH, e] using fun _ =>
    ⟨fun h a ha b hab => h _ _ ha hab, fun h a b ha hab => h _ ha _ hab⟩
state_before: case cons
β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
⊢ Pairwise R (filterMap f (a :: l)) ↔
    Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') (a :: l)
state_after: no goals

tactic: simp only [filterMap, Pairwise.nil]
state_before: case nil
β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
⊢ Pairwise R (filterMap f []) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') []
state_after: no goals

tactic: rw [filterMap_cons_none _ _ e, pairwise_cons]
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
e : f a = none
⊢ Pairwise R (filterMap f (a :: l)) ↔
    Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') (a :: l)
state_after: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
e : f a = none
⊢ Pairwise R (filterMap f l) ↔
    (∀ (a' : β), a' ∈ l → ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') ∧
      Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l

tactic: simp only [e, false_implies, implies_true, true_and, IH]
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
e : f a = none
⊢ Pairwise R (filterMap f l) ↔
    (∀ (a' : β), a' ∈ l → ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') ∧
      Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
state_after: no goals

tactic: rw [filterMap_cons_some _ _ _ e]
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
b : α
e : f a = some b
⊢ Pairwise R (filterMap f (a :: l)) ↔
    Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') (a :: l)
state_after: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
b : α
e : f a = some b
⊢ Pairwise R (b :: filterMap f l) ↔
    Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') (a :: l)

tactic: simpa [IH, e] using fun _ =>
  ⟨fun h a ha b hab => h _ _ ha hab, fun h a b ha hab => h _ ha _ hab⟩
state_before: β : Type u_1
α : Type u_2
R : α → α → Prop
f : β → Option α
_S : β → β → Prop := fun a a' => ∀ (b : α), b ∈ f a → ∀ (b' : α), b' ∈ f a' → R b b'
a : β
l : List β
IH : Pairwise R (filterMap f l) ↔ Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') l
b : α
e : f a = some b
⊢ Pairwise R (b :: filterMap f l) ↔
    Pairwise (fun a a' => ∀ (b : α), f a = some b → ∀ (b' : α), f a' = some b' → R b b') (a :: l)
state_after: no goals