l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
instance [SMul N X] [SMulCommClass M N X] [UniformContinuousConstSMul M X]
    [UniformContinuousConstSMul N X] : SMulCommClass M N (Completion X) :=
  ⟨fun m n x => by
    have hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x := rfl
    have hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x := rfl
    rw [hmn, hnm, map_comp, map_comp]
    exact congr_arg (fun f => Completion.map f x) (funext (smul_comm _ _))
    repeat' 

Proof state:
case hg
R : Type u
M : Type v
N : Type w
X : Type x
Y : Type y
inst✝⁶ : UniformSpace X
inst✝⁵ : UniformSpace Y
inst✝⁴ : SMul M X
inst✝³ : SMul N X
inst✝² : SMulCommClass M N X
inst✝¹ : UniformContinuousConstSMul M X
inst✝ : UniformContinuousConstSMul N X
m : M
n : N
x : Completion X
hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x
hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x
⊢ UniformContinuous (SMul.smul n)

Next tactic:
exact uniformContinuous_const_smul _
@[to_additive]
instance [SMul N X] [SMulCommClass M N X] [UniformContinuousConstSMul M X]
    [UniformContinuousConstSMul N X] : SMulCommClass M N (Completion X) :=
  ⟨fun m n x => by
    have hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x := rfl
    have hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x := rfl
    rw [hmn, hnm, map_comp, map_comp]
    exact congr_arg (fun f => Completion.map f x) (funext (smul_comm _ _))
    repeat' 

Proof state:
case hf
R : Type u
M : Type v
N : Type w
X : Type x
Y : Type y
inst✝⁶ : UniformSpace X
inst✝⁵ : UniformSpace Y
inst✝⁴ : SMul M X
inst✝³ : SMul N X
inst✝² : SMulCommClass M N X
inst✝¹ : UniformContinuousConstSMul M X
inst✝ : UniformContinuousConstSMul N X
m : M
n : N
x : Completion X
hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x
hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x
⊢ UniformContinuous (SMul.smul m)

Next tactic:
exact uniformContinuous_const_smul _
@[to_additive]
instance [SMul N X] [SMulCommClass M N X] [UniformContinuousConstSMul M X]
    [UniformContinuousConstSMul N X] : SMulCommClass M N (Completion X) :=
  ⟨fun m n x => by
    have hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x := rfl
    have hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x := rfl
    rw [hmn, hnm, map_comp, map_comp]
    exact congr_arg (fun f => Completion.map f x) (funext (smul_comm _ _))
    repeat' 

Proof state:
case hg
R : Type u
M : Type v
N : Type w
X : Type x
Y : Type y
inst✝⁶ : UniformSpace X
inst✝⁵ : UniformSpace Y
inst✝⁴ : SMul M X
inst✝³ : SMul N X
inst✝² : SMulCommClass M N X
inst✝¹ : UniformContinuousConstSMul M X
inst✝ : UniformContinuousConstSMul N X
m : M
n : N
x : Completion X
hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x
hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x
⊢ UniformContinuous (SMul.smul m)

Next tactic:
exact uniformContinuous_const_smul _
@[to_additive]
instance [SMul N X] [SMulCommClass M N X] [UniformContinuousConstSMul M X]
    [UniformContinuousConstSMul N X] : SMulCommClass M N (Completion X) :=
  ⟨fun m n x => by
    have hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x := rfl
    have hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x := rfl
    rw [hmn, hnm, map_comp, map_comp]
    exact congr_arg (fun f => Completion.map f x) (funext (smul_comm _ _))
    repeat' 

Proof state:
case hf
R : Type u
M : Type v
N : Type w
X : Type x
Y : Type y
inst✝⁶ : UniformSpace X
inst✝⁵ : UniformSpace Y
inst✝⁴ : SMul M X
inst✝³ : SMul N X
inst✝² : SMulCommClass M N X
inst✝¹ : UniformContinuousConstSMul M X
inst✝ : UniformContinuousConstSMul N X
m : M
n : N
x : Completion X
hmn : m • n • x = (Completion.map (SMul.smul m) ∘ Completion.map (SMul.smul n)) x
hnm : n • m • x = (Completion.map (SMul.smul n) ∘ Completion.map (SMul.smul m)) x
⊢ UniformContinuous (SMul.smul n)

Next tactic:
exact uniformContinuous_const_smul _
@[to_additive]
noncomputable instance [Monoid M] [MulAction M X] [UniformContinuousConstSMul M X] :
    MulAction M (Completion X) where
  smul := (· • ·)
  one_smul := ext' (continuous_const_smul _) continuous_id fun a => by 

Proof state:
R : Type u
M : Type v
N : Type w
X : Type x
Y : Type y
inst✝⁴ : UniformSpace X
inst✝³ : UniformSpace Y
inst✝² : Monoid M
inst✝¹ : MulAction M X
inst✝ : UniformContinuousConstSMul M X
a : X
⊢ 1 • ↑X a = ↑X a

Next tactic:
rw [← coe_smul, one_smul]
@[to_additive]
noncomputable instance [Monoid M] [MulAction M X] [UniformContinuousConstSMul M X] :
    MulAction M (Completion X) where
  smul := (· • ·)
  one_smul := ext' (continuous_const_smul _) continuous_id fun a => by rw [← coe_smul, one_smul]
  mul_smul x y :=
    ext' (continuous_const_smul _) ((continuous_const_smul _).const_smul _) fun a => by
      

Proof state:
R : Type u
M : Type v
N : Type w
X : Type x
Y : Type y
inst✝⁴ : UniformSpace X
inst✝³ : UniformSpace Y
inst✝² : Monoid M
inst✝¹ : MulAction M X
inst✝ : UniformContinuousConstSMul M X
x y : M
a : X
⊢ (x * y) • ↑X a = x • y • ↑X a

Next tactic:
simp only [← coe_smul, mul_smul]
@[simp]
theorem nodup_cons {a : α} {l : List α} : Nodup (a :: l) ↔ a ∉ l ∧ Nodup l := by
  

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a✝ b a : α
l : List α
⊢ Nodup (a :: l) ↔ a ∉ l ∧ Nodup l

Next tactic:
simp only [Nodup, pairwise_cons, forall_mem_ne]
theorem rel_nodup {r : α → β → Prop} (hr : Relator.BiUnique r) : (Forall₂ r ⇒ (· ↔ ·)) Nodup Nodup
  | _, _, Forall₂.nil => by 

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r✝ : α → α → Prop
a b : α
r : α → β → Prop
hr : Relator.BiUnique r
⊢ (fun x x_1 => x ↔ x_1) (Nodup []) (Nodup [])

Next tactic:
simp only [nodup_nil]
theorem rel_nodup {r : α → β → Prop} (hr : Relator.BiUnique r) : (Forall₂ r ⇒ (· ↔ ·)) Nodup Nodup
  | _, _, Forall₂.nil => by simp only [nodup_nil]
  | _, _, Forall₂.cons hab h => by
    

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r✝ : α → α → Prop
a b : α
r : α → β → Prop
hr : Relator.BiUnique r
a✝ : α
b✝ : β
l₁✝ : List α
l₂✝ : List β
hab : r a✝ b✝
h : Forall₂ r l₁✝ l₂✝
⊢ (fun x x_1 => x ↔ x_1) (Nodup (a✝ :: l₁✝)) (Nodup (b✝ :: l₂✝))

Next tactic:
simpa only [nodup_cons] using
      Relator.rel_and (Relator.rel_not (rel_mem hr hab h)) (rel_nodup hr h)
theorem nodup_iff_sublist {l : List α} : Nodup l ↔ ∀ a, ¬[a, a] <+ l :=
  ⟨fun d a h => not_nodup_pair a (d.sublist h),
    by
      

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
⊢ (∀ (a : α), ¬[a, a] <+ l) → Nodup l

Next tactic:
induction' l with a l IH
theorem nodup_iff_sublist {l : List α} : Nodup l ↔ ∀ a, ¬[a, a] <+ l :=
  ⟨fun d a h => not_nodup_pair a (d.sublist h),
    by
      induction' l with a l IH <;> 

Proof state:
case nil
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b : α
⊢ (∀ (a : α), ¬[a, a] <+ []) → Nodup []

Next tactic:
intro h
theorem nodup_iff_sublist {l : List α} : Nodup l ↔ ∀ a, ¬[a, a] <+ l :=
  ⟨fun d a h => not_nodup_pair a (d.sublist h),
    by
      induction' l with a l IH <;> 

Proof state:
case cons
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a✝ b a : α
l : List α
IH : (∀ (a : α), ¬[a, a] <+ l) → Nodup l
⊢ (∀ (a_1 : α), ¬[a_1, a_1] <+ a :: l) → Nodup (a :: l)

Next tactic:
intro h
theorem nodup_iff_sublist {l : List α} : Nodup l ↔ ∀ a, ¬[a, a] <+ l :=
  ⟨fun d a h => not_nodup_pair a (d.sublist h),
    by
      induction' l with a l IH <;> intro h; · 

Proof state:
case nil
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b : α
h : ∀ (a : α), ¬[a, a] <+ []
⊢ Nodup []

Next tactic:
exact nodup_nil
theorem nodup_iff_sublist {l : List α} : Nodup l ↔ ∀ a, ¬[a, a] <+ l :=
  ⟨fun d a h => not_nodup_pair a (d.sublist h),
    by
      induction' l with a l IH <;> intro h; · exact nodup_nil
      

Proof state:
case cons
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a✝ b a : α
l : List α
IH : (∀ (a : α), ¬[a, a] <+ l) → Nodup l
h : ∀ (a_1 : α), ¬[a_1, a_1] <+ a :: l
⊢ Nodup (a :: l)

Next tactic:
exact (IH fun a s => h a <| sublist_cons_of_sublist _ s).cons fun al =>
        h a <| (singleton_sublist.2 al).cons_cons _
theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get :=
  pairwise_iff_get.trans
    ⟨fun h i j hg => by
      

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i j : Fin (length l)
hg : get l i = get l j
⊢ i = j

Next tactic:
cases' i with i hi
theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get :=
  pairwise_iff_get.trans
    ⟨fun h i j hg => by
      cases' i with i hi; 

Proof state:
case mk
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
j : Fin (length l)
i : ℕ
hi : i < length l
hg : get l { val := i, isLt := hi } = get l j
⊢ { val := i, isLt := hi } = j

Next tactic:
cases' j with j hj
theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get :=
  pairwise_iff_get.trans
    ⟨fun h i j hg => by
      cases' i with i hi; cases' j with j hj
      

Proof state:
case mk.mk
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i : ℕ
hi : i < length l
j : ℕ
hj : j < length l
hg : get l { val := i, isLt := hi } = get l { val := j, isLt := hj }
⊢ { val := i, isLt := hi } = { val := j, isLt := hj }

Next tactic:
rcases lt_trichotomy i j with (hij | rfl | hji)
theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get :=
  pairwise_iff_get.trans
    ⟨fun h i j hg => by
      cases' i with i hi; cases' j with j hj
      rcases lt_trichotomy i j with (hij | rfl | hji)
      · 

Proof state:
case mk.mk.inl
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i : ℕ
hi : i < length l
j : ℕ
hj : j < length l
hg : get l { val := i, isLt := hi } = get l { val := j, isLt := hj }
hij : i < j
⊢ { val := i, isLt := hi } = { val := j, isLt := hj }

Next tactic:
exact (h ⟨i, hi⟩ ⟨j, hj⟩ hij hg).elim
theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get :=
  pairwise_iff_get.trans
    ⟨fun h i j hg => by
      cases' i with i hi; cases' j with j hj
      rcases lt_trichotomy i j with (hij | rfl | hji)
      · exact (h ⟨i, hi⟩ ⟨j, hj⟩ hij hg).elim
      · 

Proof state:
case mk.mk.inr.inl
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i : ℕ
hi hj : i < length l
hg : get l { val := i, isLt := hi } = get l { val := i, isLt := hj }
⊢ { val := i, isLt := hi } = { val := i, isLt := hj }

Next tactic:
rfl
theorem nodup_iff_injective_get {l : List α} :
    Nodup l ↔ Function.Injective l.get :=
  pairwise_iff_get.trans
    ⟨fun h i j hg => by
      cases' i with i hi; cases' j with j hj
      rcases lt_trichotomy i j with (hij | rfl | hji)
      · exact (h ⟨i, hi⟩ ⟨j, hj⟩ hij hg).elim
      · rfl
      · 

Proof state:
case mk.mk.inr.inr
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i : ℕ
hi : i < length l
j : ℕ
hj : j < length l
hg : get l { val := i, isLt := hi } = get l { val := j, isLt := hj }
hji : j < i
⊢ { val := i, isLt := hi } = { val := j, isLt := hj }

Next tactic:
exact (h ⟨j, hj⟩ ⟨i, hi⟩ hji hg.symm).elim
set_option linter.deprecated false in
@[deprecated Nodup.get_inj_iff]
theorem Nodup.nthLe_inj_iff {l : List α} (h : Nodup l) {i j : ℕ} (hi : i < l.length)
    (hj : j < l.length) : l.nthLe i hi = l.nthLe j hj ↔ i = j :=
  ⟨nodup_iff_nthLe_inj.mp h _ _ _ _, by 

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : Nodup l
i j : ℕ
hi : i < length l
hj : j < length l
⊢ i = j → nthLe l i hi = nthLe l j hj

Next tactic:
simp (config := { contextual := true })
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
⊢ Nodup l ↔ ∀ (i j : ℕ), i < j → j < length l → get? l i ≠ get? l j

Next tactic:
rw [Nodup, pairwise_iff_get]
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
⊢ (∀ (i j : Fin (length l)), i < j → get l i ≠ get l j) ↔ ∀ (i j : ℕ), i < j → j < length l → get? l i ≠ get? l j

Next tactic:
constructor
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  constructor
  · 

Proof state:
case mp
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
⊢ (∀ (i j : Fin (length l)), i < j → get l i ≠ get l j) → ∀ (i j : ℕ), i < j → j < length l → get? l i ≠ get? l j

Next tactic:
intro h i j hij hj
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  constructor
  · intro h i j hij hj
    

Proof state:
case mp
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i j : ℕ
hij : i < j
hj : j < length l
⊢ get? l i ≠ get? l j

Next tactic:
rw [get?_eq_get (lt_trans hij hj), get?_eq_get hj, Ne.def, Option.some_inj]
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  constructor
  · intro h i j hij hj
    rw [get?_eq_get (lt_trans hij hj), get?_eq_get hj, Ne.def, Option.some_inj]
    

Proof state:
case mp
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j
i j : ℕ
hij : i < j
hj : j < length l
⊢ ¬get l { val := i, isLt := (_ : i < length l) } = get l { val := j, isLt := hj }

Next tactic:
exact h _ _ hij
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  constructor
  · intro h i j hij hj
    rw [get?_eq_get (lt_trans hij hj), get?_eq_get hj, Ne.def, Option.some_inj]
    exact h _ _ hij
  · 

Proof state:
case mpr
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
⊢ (∀ (i j : ℕ), i < j → j < length l → get? l i ≠ get? l j) → ∀ (i j : Fin (length l)), i < j → get l i ≠ get l j

Next tactic:
intro h i j hij
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  constructor
  · intro h i j hij hj
    rw [get?_eq_get (lt_trans hij hj), get?_eq_get hj, Ne.def, Option.some_inj]
    exact h _ _ hij
  · intro h i j hij
    

Proof state:
case mpr
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : ℕ), i < j → j < length l → get? l i ≠ get? l j
i j : Fin (length l)
hij : i < j
⊢ get l i ≠ get l j

Next tactic:
rw [Ne.def, ← Option.some_inj, ← get?_eq_get, ← get?_eq_get]
theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j := by
  rw [Nodup, pairwise_iff_get]
  constructor
  · intro h i j hij hj
    rw [get?_eq_get (lt_trans hij hj), get?_eq_get hj, Ne.def, Option.some_inj]
    exact h _ _ hij
  · intro h i j hij
    rw [Ne.def, ← Option.some_inj, ← get?_eq_get, ← get?_eq_get]
    

Proof state:
case mpr
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : ∀ (i j : ℕ), i < j → j < length l → get? l i ≠ get? l j
i j : Fin (length l)
hij : i < j
⊢ ¬get? l ↑i = get? l ↑j

Next tactic:
exact h i j hij j.2
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  

Proof state:
α : Type u
β : Type v
l✝ l₁ l₂ : List α
r : α → α → Prop
a b : α
l : List α
h : Nodup l
x : α
⊢ l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x

Next tactic:
induction' l with hd tl hl
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · 

Proof state:
case nil
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x : α
h : Nodup []
⊢ [] ≠ [x] ↔ [] = [] ∨ ∃ y ∈ [], y ≠ x

Next tactic:
simp
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · 

Proof state:
case cons
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
hl : Nodup tl → (tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x)
h : Nodup (hd :: tl)
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
specialize hl h.of_cons
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    

Proof state:
case cons
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
by_cases hx : tl = [x]
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · 

Proof state:
case pos
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
hx : tl = [x]
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
simpa [hx, and_comm, and_or_left] using h
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · simpa [hx, and_comm, and_or_left] using h
    · 

Proof state:
case neg
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
hx : ¬tl = [x]
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
rw [← Ne.def, hl] at hx
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · simpa [hx, and_comm, and_or_left] using h
    · rw [← Ne.def, hl] at hx
      

Proof state:
case neg
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
hx : tl = [] ∨ ∃ y ∈ tl, y ≠ x
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
rcases hx with (rfl | ⟨y, hy, hx⟩)
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · simpa [hx, and_comm, and_or_left] using h
    · rw [← Ne.def, hl] at hx
      rcases hx with (rfl | ⟨y, hy, hx⟩)
      · 

Proof state:
case neg.inl
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
h : Nodup [hd]
hl : [] ≠ [x] ↔ [] = [] ∨ ∃ y ∈ [], y ≠ x
⊢ [hd] ≠ [x] ↔ [hd] = [] ∨ ∃ y ∈ [hd], y ≠ x

Next tactic:
simp
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · simpa [hx, and_comm, and_or_left] using h
    · rw [← Ne.def, hl] at hx
      rcases hx with (rfl | ⟨y, hy, hx⟩)
      · simp
      · 

Proof state:
case neg.inr.intro.intro
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
y : α
hy : y ∈ tl
hx : y ≠ x
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
suffices ∃ y ∈ hd :: tl, y ≠ x by simpa [ne_nil_of_mem hy]
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · simpa [hx, and_comm, and_or_left] using h
    · rw [← Ne.def, hl] at hx
      rcases hx with (rfl | ⟨y, hy, hx⟩)
      · simp
      · suffices ∃ y ∈ hd :: tl, y ≠ x by 

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
y : α
hy : y ∈ tl
hx : y ≠ x
this : ∃ y ∈ hd :: tl, y ≠ x
⊢ hd :: tl ≠ [x] ↔ hd :: tl = [] ∨ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
simpa [ne_nil_of_mem hy]
theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x := by
  induction' l with hd tl hl
  · simp
  · specialize hl h.of_cons
    by_cases hx : tl = [x]
    · simpa [hx, and_comm, and_or_left] using h
    · rw [← Ne.def, hl] at hx
      rcases hx with (rfl | ⟨y, hy, hx⟩)
      · simp
      · suffices ∃ y ∈ hd :: tl, y ≠ x by simpa [ne_nil_of_mem hy]
        

Proof state:
case neg.inr.intro.intro
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b x hd : α
tl : List α
h : Nodup (hd :: tl)
hl : tl ≠ [x] ↔ tl = [] ∨ ∃ y ∈ tl, y ≠ x
y : α
hy : y ∈ tl
hx : y ≠ x
⊢ ∃ y ∈ hd :: tl, y ≠ x

Next tactic:
exact ⟨y, mem_cons_of_mem _ hy, hx⟩
theorem not_nodup_of_get_eq_of_ne (xs : List α) (n m : Fin xs.length)
    (h : xs.get n = xs.get m) (hne : n ≠ m) : ¬Nodup xs := by
  

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b : α
xs : List α
n m : Fin (length xs)
h : get xs n = get xs m
hne : n ≠ m
⊢ ¬Nodup xs

Next tactic:
rw [nodup_iff_injective_get]
theorem not_nodup_of_get_eq_of_ne (xs : List α) (n m : Fin xs.length)
    (h : xs.get n = xs.get m) (hne : n ≠ m) : ¬Nodup xs := by
  rw [nodup_iff_injective_get]
  

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b : α
xs : List α
n m : Fin (length xs)
h : get xs n = get xs m
hne : n ≠ m
⊢ ¬Injective (get xs)

Next tactic:
exact fun hinj => hne (hinj h)
set_option linter.deprecated false in
@[deprecated not_nodup_of_get_eq_of_ne]
theorem nthLe_eq_of_ne_imp_not_nodup (xs : List α) (n m : ℕ) (hn : n < xs.length)
    (hm : m < xs.length) (h : xs.nthLe n hn = xs.nthLe m hm) (hne : n ≠ m) : ¬Nodup xs := by
  

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b : α
xs : List α
n m : ℕ
hn : n < length xs
hm : m < length xs
h : nthLe xs n hn = nthLe xs m hm
hne : n ≠ m
⊢ ¬Nodup xs

Next tactic:
rw [nodup_iff_nthLe_inj]
set_option linter.deprecated false in
@[deprecated not_nodup_of_get_eq_of_ne]
theorem nthLe_eq_of_ne_imp_not_nodup (xs : List α) (n m : ℕ) (hn : n < xs.length)
    (hm : m < xs.length) (h : xs.nthLe n hn = xs.nthLe m hm) (hne : n ≠ m) : ¬Nodup xs := by
  rw [nodup_iff_nthLe_inj]
  

Proof state:
α : Type u
β : Type v
l l₁ l₂ : List α
r : α → α → Prop
a b : α
xs : List α
n m : ℕ
hn : n < length xs
hm : m < length xs
h : nthLe xs n hn = nthLe xs m hm
hne : n ≠ m
⊢ ¬∀ (i j : ℕ) (h₁ : i < length xs) (h₂ : j < length xs), nthLe xs i h₁ = nthLe xs j h₂ → i = j

Next tactic:
simp only [exists_prop, exists_and_right, not_forall]