l3lab/ntp-mathlib huggingface dataset:
theorem mul_le_nmul (a b : Ordinal.{u}) : a * b ≤ a ⨳ b := by
  refine b.limitRecOn ?_ ?_ ?_
  · simp
  · intro c h
    rw [mul_succ, nmul_succ]
    exact (add_le_nadd _ a).trans (nadd_le_nadd_right h a)
  · intro c hc H
    rcases eq_zero_or_pos a with (rfl | ha)
    · 

Proof state:
case refine_3.inl
b c : Ordinal.{u}
hc : IsLimit c
H : ∀ o' < c, 0 * o' ≤ 0 ⨳ o'
⊢ 0 * c ≤ 0 ⨳ c

Next tactic:
simp
theorem mul_le_nmul (a b : Ordinal.{u}) : a * b ≤ a ⨳ b := by
  refine b.limitRecOn ?_ ?_ ?_
  · simp
  · intro c h
    rw [mul_succ, nmul_succ]
    exact (add_le_nadd _ a).trans (nadd_le_nadd_right h a)
  · intro c hc H
    rcases eq_zero_or_pos a with (rfl | ha)
    · simp
    · 

Proof state:
case refine_3.inr
a b c : Ordinal.{u}
hc : IsLimit c
H : ∀ o' < c, a * o' ≤ a ⨳ o'
ha : 0 < a
⊢ a * c ≤ a ⨳ c

Next tactic:
rw [← IsNormal.blsub_eq.{u, u} (mul_isNormal ha) hc, blsub_le_iff]
theorem mul_le_nmul (a b : Ordinal.{u}) : a * b ≤ a ⨳ b := by
  refine b.limitRecOn ?_ ?_ ?_
  · simp
  · intro c h
    rw [mul_succ, nmul_succ]
    exact (add_le_nadd _ a).trans (nadd_le_nadd_right h a)
  · intro c hc H
    rcases eq_zero_or_pos a with (rfl | ha)
    · simp
    · rw [← IsNormal.blsub_eq.{u, u} (mul_isNormal ha) hc, blsub_le_iff]
      

Proof state:
case refine_3.inr
a b c : Ordinal.{u}
hc : IsLimit c
H : ∀ o' < c, a * o' ≤ a ⨳ o'
ha : 0 < a
⊢ ∀ i < c, a * i < a ⨳ c

Next tactic:
exact fun i hi => (H i hi).trans_lt (nmul_lt_nmul_of_pos_left hi ha)
/-- `f : α →+* β` has a trivial codomain iff its range is `{0}`. -/
theorem codomain_trivial_iff_range_eq_singleton_zero : (0 : β) = 1 ↔ Set.range f = {0} :=
  f.codomain_trivial_iff_range_trivial.trans
    ⟨fun h =>
      Set.ext fun y => ⟨fun ⟨x, hx⟩ => by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝³ : NonAssocSemiring α
x✝² : NonAssocSemiring β
f : α →+* β
x✝¹ y✝ : α
h : ∀ (x : α), f x = 0
y : β
x✝ : y ∈ Set.range ⇑f
x : α
hx : f x = y
⊢ y ∈ {0}

Next tactic:
simp [← hx, h x]
/-- `f : α →+* β` has a trivial codomain iff its range is `{0}`. -/
theorem codomain_trivial_iff_range_eq_singleton_zero : (0 : β) = 1 ↔ Set.range f = {0} :=
  f.codomain_trivial_iff_range_trivial.trans
    ⟨fun h =>
      Set.ext fun y => ⟨fun ⟨x, hx⟩ => by simp [← hx, h x], fun hy => ⟨0, by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
x✝¹ : NonAssocSemiring α
x✝ : NonAssocSemiring β
f : α →+* β
x y✝ : α
h : ∀ (x : α), f x = 0
y : β
hy : y ∈ {0}
⊢ f 0 = y

Next tactic:
simpa using hy.symm
/-- Pullback `IsDomain` instance along an injective function. -/
protected theorem Function.Injective.isDomain [Ring α] [IsDomain α] [Ring β] (f : β →+* α)
    (hf : Injective f) : IsDomain β := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ⇑f
⊢ IsDomain β

Next tactic:
haveI := pullback_nonzero f f.map_zero f.map_one
/-- Pullback `IsDomain` instance along an injective function. -/
protected theorem Function.Injective.isDomain [Ring α] [IsDomain α] [Ring β] (f : β →+* α)
    (hf : Injective f) : IsDomain β := by
  haveI := pullback_nonzero f f.map_zero f.map_one
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ⇑f
this : Nontrivial β
⊢ IsDomain β

Next tactic:
haveI := IsRightCancelMulZero.to_noZeroDivisors α
/-- Pullback `IsDomain` instance along an injective function. -/
protected theorem Function.Injective.isDomain [Ring α] [IsDomain α] [Ring β] (f : β →+* α)
    (hf : Injective f) : IsDomain β := by
  haveI := pullback_nonzero f f.map_zero f.map_one
  haveI := IsRightCancelMulZero.to_noZeroDivisors α
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ⇑f
this✝ : Nontrivial β
this : NoZeroDivisors α
⊢ IsDomain β

Next tactic:
haveI := hf.noZeroDivisors f f.map_zero f.map_mul
/-- Pullback `IsDomain` instance along an injective function. -/
protected theorem Function.Injective.isDomain [Ring α] [IsDomain α] [Ring β] (f : β →+* α)
    (hf : Injective f) : IsDomain β := by
  haveI := pullback_nonzero f f.map_zero f.map_one
  haveI := IsRightCancelMulZero.to_noZeroDivisors α
  haveI := hf.noZeroDivisors f f.map_zero f.map_mul
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Ring α
inst✝¹ : IsDomain α
inst✝ : Ring β
f : β →+* α
hf : Injective ⇑f
this✝¹ : Nontrivial β
this✝ : NoZeroDivisors α
this : NoZeroDivisors β
⊢ IsDomain β

Next tactic:
exact NoZeroDivisors.to_isDomain β
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by 

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
⊢ foldl (argAux r) o [] = none ↔ [] = [] ∧ o = none

Next tactic:
simp
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd : α
⊢ (foldl (argAux r) o tl = none ↔ tl = [] ∧ o = none) →
    (foldl (argAux r) o (tl ++ [hd]) = none ↔ tl ++ [hd] = [] ∧ o = none)

Next tactic:
simp [argAux]
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; 

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd : α
⊢ (foldl (argAux r) o tl = none ↔ tl = [] ∧ o = none) →
    ¬Option.rec (some hd) (fun val => if r hd val then some hd else some val) (foldl (argAux r) o tl) = none

Next tactic:
cases foldl (argAux r) o tl
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; cases foldl (argAux r) o tl <;> 

Proof state:
case none
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd : α
⊢ (none = none ↔ tl = [] ∧ o = none) →
    ¬Option.rec (some hd) (fun val => if r hd val then some hd else some val) none = none

Next tactic:
simp
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; cases foldl (argAux r) o tl <;> 

Proof state:
case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd val✝ : α
⊢ (some val✝ = none ↔ tl = [] ∧ o = none) →
    ¬Option.rec (some hd) (fun val => if r hd val then some hd else some val) (some val✝) = none

Next tactic:
simp
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; cases foldl (argAux r) o tl <;> simp; 

Proof state:
case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd val✝ : α
⊢ (tl = [] → ¬o = none) → ¬(if r hd val✝ then some hd else some val✝) = none

Next tactic:
try split_ifs <;> simp
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; cases foldl (argAux r) o tl <;> simp; try 

Proof state:
case some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd val✝ : α
⊢ (tl = [] → ¬o = none) → ¬(if r hd val✝ then some hd else some val✝) = none

Next tactic:
split_ifs
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; cases foldl (argAux r) o tl <;> simp; try split_ifs <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd val✝ : α
h✝ : r hd val✝
⊢ (tl = [] → ¬o = none) → ¬False

Next tactic:
simp
@[simp]
theorem foldl_argAux_eq_none : l.foldl (argAux r) o = none ↔ l = [] ∧ o = none :=
  List.reverseRecOn l (by simp) fun tl hd => by
    simp [argAux]; cases foldl (argAux r) o tl <;> simp; try split_ifs <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
tl : List α
hd val✝ : α
h✝ : ¬r hd val✝
⊢ (tl = [] → ¬o = none) → ¬False

Next tactic:
simp
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by 

Proof state:
α : 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]

Next tactic:
simp [eq_comm]
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      

Proof state:
α : 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])

Next tactic:
intro tl hd ih a m
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      

Proof state:
α : 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])

Next tactic:
simp only [foldl_append, foldl_cons, foldl_nil, argAux]
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      

Proof state:
α : 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])

Next tactic:
cases hf : foldl (argAux r) (some a) tl
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · 

Proof state:
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])

Next tactic:
simp (config := { contextual := true })
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · 

Proof state:
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])

Next tactic:
dsimp only
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · dsimp only
        

Proof state:
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])

Next tactic:
split_ifs
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · dsimp only
        split_ifs
        · 

Proof state:
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])

Next tactic:
simp (config := { contextual := true })
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · dsimp only
        split_ifs
        · simp (config := { contextual := true })
        · -- `finish [ih _ _ hf]` closes this goal
          

Proof state:
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])

Next tactic:
simp only [List.mem_cons] at ih
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · dsimp only
        split_ifs
        · simp (config := { contextual := true })
        · -- `finish [ih _ _ hf]` closes this goal
          simp only [List.mem_cons] at ih
          

Proof state:
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])

Next tactic:
rcases ih _ _ hf with rfl | H
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · dsimp only
        split_ifs
        · simp (config := { contextual := true })
        · -- `finish [ih _ _ hf]` closes this goal
          simp only [List.mem_cons] at ih
          rcases ih _ _ hf with rfl | H
          · 

Proof state:
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])

Next 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]
private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l :=
  List.reverseRecOn l (by simp [eq_comm])
    (by
      intro tl hd ih a m
      simp only [foldl_append, foldl_cons, foldl_nil, argAux]
      cases hf : foldl (argAux r) (some a) tl
      · simp (config := { contextual := true })
      · dsimp only
        split_ifs
        · simp (config := { contextual := true })
        · -- `finish [ih _ _ hf]` closes this goal
          simp only [List.mem_cons] at ih
          rcases ih _ _ hf with rfl | H
          · simp (config := { contextual := true }) only [Option.mem_def, Option.some.injEq,
              find?, eq_comm, mem_cons, mem_append, mem_singleton, true_or, implies_true]
          · 

Proof state:
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])

Next tactic:
simp (config := { contextual := true }) [@eq_comm _ _ m, H]
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  

Proof state:
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
hr₀ : Irreflexive r
hr₁ : Transitive r
⊢ ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m

Next tactic:
induction' l using List.reverseRecOn with tl a ih
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · 

Proof state:
case H0
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a m : α
hr₀ : Irreflexive r
hr₁ : Transitive r
⊢ ∀ {a m : α} {o : Option α}, a ∈ [] → m ∈ foldl (argAux r) o [] → ¬r a m

Next tactic:
simp
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  

Proof state:
case H1
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o : Option α
a✝ m : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
⊢ ∀ {a_1 m : α} {o : Option α}, a_1 ∈ tl ++ [a] → m ∈ foldl (argAux r) o (tl ++ [a]) → ¬r a_1 m

Next tactic:
intro b m o hb ho
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  intro b m o hb ho
  

Proof state:
case H1
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o✝ : Option α
a✝ m✝ : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
b m : α
o : Option α
hb : b ∈ tl ++ [a]
ho : m ∈ foldl (argAux r) o (tl ++ [a])
⊢ ¬r b m

Next tactic:
rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  intro b m o hb ho
  rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
  

Proof state:
case H1
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o✝ : Option α
a✝ m✝ : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
b m : α
o : Option α
hb : b ∈ tl ++ [a]
ho : m ∈ Option.casesOn (foldl (argAux r) o tl) (some a) fun c => if r a c then some a else some c
⊢ ¬r b m

Next tactic:
cases' hf : foldl (argAux r) o tl with c
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  intro b m o hb ho
  rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
  cases' hf : foldl (argAux r) o tl with c
  · 

Proof state:
case H1.none
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o✝ : Option α
a✝ m✝ : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
b m : α
o : Option α
hb : b ∈ tl ++ [a]
ho : m ∈ Option.casesOn (foldl (argAux r) o tl) (some a) fun c => if r a c then some a else some c
hf : foldl (argAux r) o tl = none
⊢ ¬r b m

Next tactic:
rw [hf] at ho
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  intro b m o hb ho
  rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
  cases' hf : foldl (argAux r) o tl with c
  · rw [hf] at ho
    

Proof state:
case H1.none
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o✝ : Option α
a✝ m✝ : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
b m : α
o : Option α
hb : b ∈ tl ++ [a]
ho : m ∈ Option.casesOn none (some a) fun c => if r a c then some a else some c
hf : foldl (argAux r) o tl = none
⊢ ¬r b m

Next tactic:
rw [foldl_argAux_eq_none] at hf
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  intro b m o hb ho
  rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
  cases' hf : foldl (argAux r) o tl with c
  · rw [hf] at ho
    rw [foldl_argAux_eq_none] at hf
    

Proof state:
case H1.none
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o✝ : Option α
a✝ m✝ : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
b m : α
o : Option α
hb : b ∈ tl ++ [a]
ho : m ∈ Option.casesOn none (some a) fun c => if r a c then some a else some c
hf : tl = [] ∧ o = none
⊢ ¬r b m

Next tactic:
simp_all [hf.1, hf.2, hr₀ _]
theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m := by
  induction' l using List.reverseRecOn with tl a ih
  · simp
  intro b m o hb ho
  rw [foldl_append, foldl_cons, foldl_nil, argAux] at ho
  cases' hf : foldl (argAux r) o tl with c
  · rw [hf] at ho
    rw [foldl_argAux_eq_none] at hf
    simp_all [hf.1, hf.2, hr₀ _]
  

Proof state:
case H1.some
α : Type u_1
β : Type u_2
r : α → α → Prop
inst✝ : DecidableRel r
l : List α
o✝ : Option α
a✝ m✝ : α
hr₀ : Irreflexive r
hr₁ : Transitive r
tl : List α
a : α
ih : ∀ {a m : α} {o : Option α}, a ∈ tl → m ∈ foldl (argAux r) o tl → ¬r a m
b m : α
o : Option α
hb : b ∈ tl ++ [a]
ho : m ∈ Option.casesOn (foldl (argAux r) o tl) (some a) fun c => if r a c then some a else some c
c : α
hf : foldl (argAux r) o tl = some c
⊢ ¬r b m

Next tactic:
rw [hf, Option.mem_def] at ho