Theorem: List.nodupKeys_dedupKeys
File: Mathlib/Data/List/Sigma.lean

tactic: dsimp [dedupKeys]
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
⊢ l.dedupKeys.NodupKeys
state_after: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
⊢ (foldr (fun x => kinsert x.fst x.snd) [] l).NodupKeys

tactic: generalize hl : nil = l'
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
⊢ (foldr (fun x => kinsert x.fst x.snd) [] l).NodupKeys
state_after: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
⊢ (foldr (fun x => kinsert x.fst x.snd) l' l).NodupKeys

tactic: have : NodupKeys l' := by
  rw [← hl]
  apply nodup_nil
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
⊢ (foldr (fun x => kinsert x.fst x.snd) l' l).NodupKeys
state_after: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
this : l'.NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' l).NodupKeys

tactic: clear hl
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
this : l'.NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' l).NodupKeys
state_after: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
this : l'.NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' l).NodupKeys

tactic: induction' l with x xs l_ih
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
this : l'.NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' l).NodupKeys
state_after: case nil
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' []).NodupKeys

case cons
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
x : Sigma β
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' (x :: xs)).NodupKeys

tactic: rw [← hl]
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
⊢ l'.NodupKeys
state_after: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
⊢ [].NodupKeys

tactic: apply nodup_nil
state_before: α : Type u
β : α → Type v
l✝ l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l : List (Sigma β)
l' : List (Sigma β)
hl : [] = l'
⊢ [].NodupKeys
state_after: no goals

tactic: apply this
state_before: case nil
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' []).NodupKeys
state_after: no goals

tactic: cases x
state_before: case cons
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
x : Sigma β
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
⊢ (foldr (fun x => kinsert x.fst x.snd) l' (x :: xs)).NodupKeys
state_after: case cons.mk
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ (foldr (fun x => kinsert x.fst x.snd) l' (⟨fst✝, snd✝⟩ :: xs)).NodupKeys

tactic: simp only [foldr_cons, kinsert_def, nodupKeys_cons, ne_eq, not_true]
state_before: case cons.mk
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ (foldr (fun x => kinsert x.fst x.snd) l' (⟨fst✝, snd✝⟩ :: xs)).NodupKeys
state_after: case cons.mk
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ fst✝ ∉ (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).keys ∧
    (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).NodupKeys

tactic: constructor
state_before: case cons.mk
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ fst✝ ∉ (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).keys ∧
    (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).NodupKeys
state_after: case cons.mk.left
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ fst✝ ∉ (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).keys

case cons.mk.right
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).NodupKeys

tactic: simp only [keys_kerase]
state_before: case cons.mk.left
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ fst✝ ∉ (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).keys
state_after: case cons.mk.left
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ fst✝ ∉ (foldr (fun x => kinsert x.fst x.snd) l' xs).keys.erase fst✝

tactic: apply l_ih.not_mem_erase
state_before: case cons.mk.left
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ fst✝ ∉ (foldr (fun x => kinsert x.fst x.snd) l' xs).keys.erase fst✝
state_after: no goals

tactic: exact l_ih.kerase _
state_before: case cons.mk.right
α : Type u
β : α → Type v
l l₁ l₂ : List (Sigma β)
inst✝ : DecidableEq α
l' : List (Sigma β)
this : l'.NodupKeys
xs : List (Sigma β)
l_ih : (foldr (fun x => kinsert x.fst x.snd) l' xs).NodupKeys
fst✝ : α
snd✝ : β fst✝
⊢ (kerase fst✝ (foldr (fun x => kinsert x.fst x.snd) l' xs)).NodupKeys
state_after: no goals