Theorem: suffixLevenshtein_cons₁
File: Mathlib/Data/List/EditDistance/Defs.lean

tactic: simp
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
ys : List β
⊢ 0 < (levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val).length
state_after: no goals

tactic: dsimp [levenshtein, suffixLevenshtein]
state_before: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
⊢ suffixLevenshtein C (x :: xs) [] = ⟨levenshtein C (x :: xs) [] :: (suffixLevenshtein C xs []).val, ⋯⟩
state_after: no goals

tactic: apply suffixLevenshtein_cons₁_aux
state_before: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ suffixLevenshtein C (x :: xs) (y :: ys) =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩
state_after: case cons.w₀
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ (suffixLevenshtein C (x :: xs) (y :: ys)).val[0] =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩.val[0]

case cons.w
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ (suffixLevenshtein C (x :: xs) (y :: ys)).val.tail =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩.val.tail

tactic: rfl
state_before: case cons.w₀
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ (suffixLevenshtein C (x :: xs) (y :: ys)).val[0] =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩.val[0]
state_after: no goals

tactic: rw [suffixLevenshtein_cons₂ (x :: xs), ih, impl_cons]
state_before: case cons.w
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ (suffixLevenshtein C (x :: xs) (y :: ys)).val.tail =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩.val.tail
state_after: case cons.w
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ (match impl C xs y ⟨(suffixLevenshtein C xs ys).val, ?cons.w.w'⟩ with
        | ⟨r, w⟩ =>
          ⟨min (C.delete x + r[0])
                (min (C.insert y + levenshtein C (x :: xs) ys)
                  (C.substitute x y + (suffixLevenshtein C xs ys).val[0])) ::
              r,
            ⋯⟩).val.tail =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩.val.tail

case cons.w.w'
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ 0 < (suffixLevenshtein C xs ys).val.length

tactic: rfl
state_before: case cons.w
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ (match impl C xs y ⟨(suffixLevenshtein C xs ys).val, ?cons.w.w'⟩ with
        | ⟨r, w⟩ =>
          ⟨min (C.delete x + r[0])
                (min (C.insert y + levenshtein C (x :: xs) ys)
                  (C.substitute x y + (suffixLevenshtein C xs ys).val[0])) ::
              r,
            ⋯⟩).val.tail =
    ⟨levenshtein C (x :: xs) (y :: ys) :: (suffixLevenshtein C xs (y :: ys)).val, ⋯⟩.val.tail
state_after: no goals

tactic: simp [suffixLevenshtein_length]
state_before: case cons.w.w'
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
x : α
xs : List α
y : β
ys : List β
ih : suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩
⊢ 0 < (suffixLevenshtein C xs ys).val.length
state_after: no goals