Theorem: List.foldl_argAux_mem
File: Mathlib/Data/List/MinMax.lean

tactic: simp [eq_comm]
state_before: α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a m : α
l : List α
⊢ ∀ (a m : α), m ∈ foldl (argAux r) (some a) [] → m ∈ [a]
state_after: no goals

tactic: intro tl hd ih a m
state_before: α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a m : α
l : List α
⊢ ∀ (l : List α) (a : α),
    (∀ (a m : α), m ∈ foldl (argAux r) (some a) l → m ∈ a :: l) →
      ∀ (a_2 m : α), m ∈ foldl (argAux r) (some a_2) (l ++ [a]) → m ∈ a_2 :: (l ++ [a])
state_after: α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m : α
⊢ m ∈ foldl (argAux r) (some a) (tl ++ [hd]) → m ∈ a :: (tl ++ [hd])

tactic: simp only [foldl_append, foldl_cons, foldl_nil, argAux]
state_before: α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m : α
⊢ m ∈ foldl (argAux r) (some a) (tl ++ [hd]) → m ∈ a :: (tl ++ [hd])
state_after: α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m : α
⊢ m ∈ Option.rec (some hd) (fun val => if r hd val then some hd else some val) (foldl (argAux r) (some a) tl) →
    m ∈ a :: (tl ++ [hd])

tactic: cases hf : foldl (argAux r) (some a) tl
state_before: α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m : α
⊢ m ∈ Option.rec (some hd) (fun val => if r hd val then some hd else some val) (foldl (argAux r) (some a) tl) →
    m ∈ a :: (tl ++ [hd])
state_after: case none
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m : α
hf : foldl (argAux r) (some a) tl = none
⊢ m ∈ Option.rec (some hd) (fun val => if r hd val then some hd else some val) none → m ∈ a :: (tl ++ [hd])

case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
⊢ m ∈ Option.rec (some hd) (fun val => if r hd val then some hd else some val) (some val✝) → m ∈ a :: (tl ++ [hd])

tactic: simp (config := { contextual := true })
state_before: case none
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m : α
hf : foldl (argAux r) (some a) tl = none
⊢ m ∈ Option.rec (some hd) (fun val => if r hd val then some hd else some val) none → m ∈ a :: (tl ++ [hd])
state_after: no goals

tactic: dsimp only
state_before: case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
⊢ m ∈ Option.rec (some hd) (fun val => if r hd val then some hd else some val) (some val✝) → m ∈ a :: (tl ++ [hd])
state_after: case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
⊢ (m ∈ if r hd val✝ then some hd else some val✝) → m ∈ a :: (tl ++ [hd])

tactic: split_ifs
state_before: case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
⊢ (m ∈ if r hd val✝ then some hd else some val✝) → m ∈ a :: (tl ++ [hd])
state_after: case pos
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : r hd val✝
⊢ m ∈ some hd → m ∈ a :: (tl ++ [hd])

case neg
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : ¬r hd val✝
⊢ m ∈ some val✝ → m ∈ a :: (tl ++ [hd])

tactic: simp (config := { contextual := true })
state_before: case pos
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : r hd val✝
⊢ m ∈ some hd → m ∈ a :: (tl ++ [hd])
state_after: no goals

tactic: simp only [List.mem_cons] at ih
state_before: case neg
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd : α
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m ∈ a :: tl
a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : ¬r hd val✝
⊢ m ∈ some val✝ → m ∈ a :: (tl ++ [hd])
state_after: case neg
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : ¬r hd val✝
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m = a ∨ m ∈ tl
⊢ m ∈ some val✝ → m ∈ a :: (tl ++ [hd])

tactic: rcases ih _ _ hf with rfl | H
state_before: case neg
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : ¬r hd val✝
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m = a ∨ m ∈ tl
⊢ m ∈ some val✝ → m ∈ a :: (tl ++ [hd])
state_after: case neg.inl
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a m✝ : α
l tl : List α
hd m val✝ : α
h✝ : ¬r hd val✝
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m = a ∨ m ∈ tl
hf : foldl (argAux r) (some val✝) tl = some val✝
⊢ m ∈ some val✝ → m ∈ val✝ :: (tl ++ [hd])

case neg.inr
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : ¬r hd val✝
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m = a ∨ m ∈ tl
H : val✝ ∈ tl
⊢ m ∈ some val✝ → m ∈ a :: (tl ++ [hd])

tactic: simp (config := { contextual := true }) only [Option.mem_def, Option.some.injEq,
  find?, eq_comm, mem_cons, mem_append, mem_singleton, true_or, implies_true]
state_before: case neg.inl
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a m✝ : α
l tl : List α
hd m val✝ : α
h✝ : ¬r hd val✝
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m = a ∨ m ∈ tl
hf : foldl (argAux r) (some val✝) tl = some val✝
⊢ m ∈ some val✝ → m ∈ val✝ :: (tl ++ [hd])
state_after: no goals

tactic: simp (config := { contextual := true }) [@eq_comm _ _ m, H]
state_before: case neg.inr
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l✝ : List α
o : Option α
a✝ m✝ : α
l tl : List α
hd a m val✝ : α
hf : foldl (argAux r) (some a) tl = some val✝
h✝ : ¬r hd val✝
ih : ∀ (a m : α), m ∈ foldl (argAux r) (some a) tl → m = a ∨ m ∈ tl
H : val✝ ∈ tl
⊢ m ∈ some val✝ → m ∈ a :: (tl ++ [hd])
state_after: no goals