l3lab/ntp-mathlib huggingface dataset:
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    

Proof state:
case cons
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
⊢ (b ∈ if a = a' then remove a as else a' :: remove a as) ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      | inl h1' => exact Or.inl h1'
      | inr h1' => exact Or.inr ⟨h1', h2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    

Proof state:
case cons
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
x✝ : a = a' ∨ ¬a = a'
⊢ (b ∈ if a = a' then remove a as else a' :: remove a as) ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      | inl h1' => exact Or.inl h1'
      | inr h1' => exact Or.inr ⟨h1', h2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    

Proof state:
case cons.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : a = a'
⊢ (b ∈ if a = a' then remove a as else a' :: remove a as) ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
| inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      

Proof state:
case cons.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : a = a'
⊢ (b ∈ if a = a' then remove a as else a' :: remove a as) ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
simp only [if_pos h, ih]
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      

Proof state:
case cons.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : a = a'
⊢ b ∈ as ∧ b ≠ a ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    

Proof state:
case cons.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ (b ∈ if a = a' then remove a as else a' :: remove a as) ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
| inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      | inl h1' => exact Or.inl h1'
      | inr h1' => exact Or.inr ⟨h1', h2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      

Proof state:
case cons.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ (b ∈ if a = a' then remove a as else a' :: remove a as) ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      

Proof state:
case cons.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ b = a' ∨ b ∈ as ∧ ¬b = a ↔ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
constructor
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      

Proof state:
case cons.inr.mp
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ b = a' ∨ b ∈ as ∧ ¬b = a → (b = a' ∨ b ∈ as) ∧ ¬b = a
case cons.inr.mpr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a → b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
{ focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { 

Proof state:
case cons.inr.mp
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ b = a' ∨ b ∈ as ∧ ¬b = a → (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        

Proof state:
case cons.inr.mp
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ b = a' ∨ b ∈ as ∧ ¬b = a → (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
intro h'
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        

Proof state:
case cons.inr.mp
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h' : b = a' ∨ b ∈ as ∧ ¬b = a
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        

Proof state:
case cons.inr.mp.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h₁ : b = a'
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
| inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => 

Proof state:
case cons.inr.mp.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h₁ : b = a'
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        

Proof state:
case cons.inr.mp.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h₁ : b ∈ as ∧ ¬b = a
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
| inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => 

Proof state:
case cons.inr.mp.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h₁ : b ∈ as ∧ ¬b = a
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a

Next tactic:
exact ⟨Or.inr h₁.1, h₁.2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      

Proof state:
case cons.inr.mpr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
⊢ (b = a' ∨ b ∈ as) ∧ ¬b = a → b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
intro ⟨h1, h2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      

Proof state:
case cons.inr.mpr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h1 : b = a' ∨ b ∈ as
h2 : ¬b = a
⊢ b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
cases h1 with
      | inl h1' => exact Or.inl h1'
      | inr h1' => exact Or.inr ⟨h1', h2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      

Proof state:
case cons.inr.mpr.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h2 : ¬b = a
h1' : b = a'
⊢ b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
| inl h1' => exact Or.inl h1'
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      | inl h1' => 

Proof state:
case cons.inr.mpr.inl
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h2 : ¬b = a
h1' : b = a'
⊢ b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
exact Or.inl h1'
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      | inl h1' => exact Or.inl h1'
      

Proof state:
case cons.inr.mpr.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h2 : ¬b = a
h1' : b ∈ as
⊢ b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
| inr h1' => exact Or.inr ⟨h1', h2⟩
theorem mem_remove_iff {a b : α} {as : List α} : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a := by
  induction as with
  | nil => simp [remove]
  | cons a' as ih =>
    simp only [remove, Bool.not_eq_true, mem_cons, ne_eq]
    cases Decidable.em (a = a') with
    | inl h =>
      simp only [if_pos h, ih]
      exact ⟨fun ⟨h1, h2⟩ ↦ ⟨Or.inr h1, h2⟩, fun ⟨h1, h2⟩ ↦ ⟨Or.resolve_left h1 (h ▸ h2), h2⟩⟩
    | inr h =>
      simp only [if_neg h, Bool.not_eq_true, mem_cons, ih, ne_eq]
      constructor
      { focus
        intro h'
        cases h' with
        | inl h₁ => exact ⟨Or.inl h₁, h₁.symm ▸ (Ne.symm h)⟩
        | inr h₁ => exact ⟨Or.inr h₁.1, h₁.2⟩ }
      intro ⟨h1, h2⟩
      cases h1 with
      | inl h1' => exact Or.inl h1'
      | inr h1' => 

Proof state:
case cons.inr.mpr.inr
α : Type u_1
β : Sort ?u.7899
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b a' : α
as : List α
ih : b ∈ remove a as ↔ b ∈ as ∧ b ≠ a
h : ¬a = a'
h2 : ¬b = a
h1' : b ∈ as
⊢ b = a' ∨ b ∈ as ∧ ¬b = a

Next tactic:
exact Or.inr ⟨h1', h2⟩
theorem remove_eq_of_not_mem {a : α} : ∀ {as : List α}, (a ∉ as) → remove a as = as
  | [], _ => by 

Proof state:
α : Type u_1
β : Sort ?u.10487
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
x✝ : ¬a ∈ []
⊢ remove a [] = []

Next tactic:
simp [remove]
theorem remove_eq_of_not_mem {a : α} : ∀ {as : List α}, (a ∉ as) → remove a as = as
  | [], _ => by simp [remove]
  | a' :: as, h => by
    

Proof state:
α : Type u_1
β : Sort ?u.10487
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a a' : α
as : List α
h : ¬a ∈ a' :: as
⊢ remove a (a' :: as) = a' :: as

Next tactic:
have h1 : a ≠ a' := fun h' ↦ h (by rw [h']; apply mem_cons_self)
theorem remove_eq_of_not_mem {a : α} : ∀ {as : List α}, (a ∉ as) → remove a as = as
  | [], _ => by simp [remove]
  | a' :: as, h => by
    have h1 : a ≠ a' := fun h' ↦ h (by 

Proof state:
α : Type u_1
β : Sort ?u.10487
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a a' : α
as : List α
h : ¬a ∈ a' :: as
h' : a = a'
⊢ a ∈ a' :: as

Next tactic:
rw [h']
theorem remove_eq_of_not_mem {a : α} : ∀ {as : List α}, (a ∉ as) → remove a as = as
  | [], _ => by simp [remove]
  | a' :: as, h => by
    have h1 : a ≠ a' := fun h' ↦ h (by rw [h']; 

Proof state:
α : Type u_1
β : Sort ?u.10487
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a a' : α
as : List α
h : ¬a ∈ a' :: as
h' : a = a'
⊢ a' ∈ a' :: as

Next tactic:
apply mem_cons_self
theorem remove_eq_of_not_mem {a : α} : ∀ {as : List α}, (a ∉ as) → remove a as = as
  | [], _ => by simp [remove]
  | a' :: as, h => by
    have h1 : a ≠ a' := fun h' ↦ h (by rw [h']; apply mem_cons_self)
    

Proof state:
α : Type u_1
β : Sort ?u.10487
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a a' : α
as : List α
h : ¬a ∈ a' :: as
h1 : a ≠ a'
⊢ remove a (a' :: as) = a' :: as

Next tactic:
have h2 : a ∉ as := fun h' ↦ h (mem_cons_of_mem _ h')
theorem remove_eq_of_not_mem {a : α} : ∀ {as : List α}, (a ∉ as) → remove a as = as
  | [], _ => by simp [remove]
  | a' :: as, h => by
    have h1 : a ≠ a' := fun h' ↦ h (by rw [h']; apply mem_cons_self)
    have h2 : a ∉ as := fun h' ↦ h (mem_cons_of_mem _ h')
    

Proof state:
α : Type u_1
β : Sort ?u.10487
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a a' : α
as : List α
h : ¬a ∈ a' :: as
h1 : a ≠ a'
h2 : ¬a ∈ as
⊢ remove a (a' :: as) = a' :: as

Next tactic:
simp [remove, h1, remove_eq_of_not_mem h2]
theorem mem_of_mem_remove {a b : α} {as : List α} (h : b ∈ remove a as) : b ∈ as := by
  

Proof state:
α : Type u_1
β : Sort ?u.11117
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b : α
as : List α
h : b ∈ remove a as
⊢ b ∈ as

Next tactic:
rw [mem_remove_iff] at h
theorem mem_of_mem_remove {a b : α} {as : List α} (h : b ∈ remove a as) : b ∈ as := by
  rw [mem_remove_iff] at h; 

Proof state:
α : Type u_1
β : Sort ?u.11117
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a b : α
as : List α
h : b ∈ as ∧ b ≠ a
⊢ b ∈ as

Next tactic:
exact h.1
@[simp] theorem card_cons_of_mem {a : α} {as : List α} (h : a ∈ as) :
    card (a :: as) = card as := by 

Proof state:
α : Type u_1
β : Sort ?u.12262
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
as : List α
h : a ∈ as
⊢ card (a :: as) = card as

Next tactic:
simp [card, h]
@[simp] theorem card_cons_of_not_mem {a : α} {as : List α} (h : a ∉ as) :
    card (a :: as) = card as + 1 := by 

Proof state:
α : Type u_1
β : Sort ?u.13346
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
as : List α
h : ¬a ∈ as
⊢ card (a :: as) = card as + 1

Next tactic:
simp [card, h]
theorem card_le_card_cons (a : α) (as : List α) : card as ≤ card (a :: as) := by
  

Proof state:
α : Type u_1
β : Sort ?u.14075
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
as : List α
⊢ card as ≤ card (a :: as)

Next tactic:
cases Decidable.em (a ∈ as) with
  | inl h => simp [h, Nat.le_refl]
  | inr h => simp [h, Nat.le_succ]
theorem card_le_card_cons (a : α) (as : List α) : card as ≤ card (a :: as) := by
  

Proof state:
α : Type u_1
β : Sort ?u.14075
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
as : List α
x✝ : a ∈ as ∨ ¬a ∈ as
⊢ card as ≤ card (a :: as)

Next tactic:
cases Decidable.em (a ∈ as) with
  | inl h => simp [h, Nat.le_refl]
  | inr h => simp [h, Nat.le_succ]
theorem card_le_card_cons (a : α) (as : List α) : card as ≤ card (a :: as) := by
  cases Decidable.em (a ∈ as) with
  

Proof state:
case inl
α : Type u_1
β : Sort ?u.14075
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
as : List α
h : a ∈ as
⊢ card as ≤ card (a :: as)

Next tactic:
| inl h => simp [h, Nat.le_refl]
theorem card_le_card_cons (a : α) (as : List α) : card as ≤ card (a :: as) := by
  cases Decidable.em (a ∈ as) with
  | inl h => 

Proof state:
case inl
α : Type u_1
β : Sort ?u.14075
inst✝¹ : DecidableEq α
inst✝ : DecidableEq β
a : α
as : List α
h : a ∈ as
⊢ card as ≤ card (a :: as)

Next tactic:
simp [h, Nat.le_refl]