Theorem: suffixLevenshtein_length
File: Mathlib/Data/List/EditDistance/Defs.lean

tactic: induction ys with
| nil =>
  dsimp [suffixLevenshtein]
  induction xs with
  | nil => rfl
  | cons _ xs ih =>
    simp_all
| cons y ys ih =>
  dsimp [suffixLevenshtein]
  rw [impl_length]
  exact ih
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
ys : List β
⊢ (suffixLevenshtein C xs ys).val.length = xs.length + 1
state_after: no goals

tactic: dsimp [suffixLevenshtein]
state_before: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
⊢ (suffixLevenshtein C xs []).val.length = xs.length + 1
state_after: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
⊢ (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs).val.length =
    xs.length + 1

tactic: induction xs with
| nil => rfl
| cons _ xs ih =>
  simp_all
state_before: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
⊢ (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs).val.length =
    xs.length + 1
state_after: no goals

tactic: rfl
state_before: case nil.nil
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
⊢ (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ []).val.length =
    [].length + 1
state_after: no goals

tactic: simp_all
state_before: case nil.cons
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
head✝ : α
xs : List α
ih :
  (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs).val.length =
    xs.length + 1
⊢ (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩
          (head✝ :: xs)).val.length =
    (head✝ :: xs).length + 1
state_after: no goals

tactic: dsimp [suffixLevenshtein]
state_before: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
y : β
ys : List β
ih : (suffixLevenshtein C xs ys).val.length = xs.length + 1
⊢ (suffixLevenshtein C xs (y :: ys)).val.length = xs.length + 1
state_after: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
y : β
ys : List β
ih : (suffixLevenshtein C xs ys).val.length = xs.length + 1
⊢ (impl C xs y
          (List.foldr (impl C xs)
            (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs)
            ys)).val.length =
    xs.length + 1

tactic: rw [impl_length]
state_before: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
y : β
ys : List β
ih : (suffixLevenshtein C xs ys).val.length = xs.length + 1
⊢ (impl C xs y
          (List.foldr (impl C xs)
            (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs)
            ys)).val.length =
    xs.length + 1
state_after: case cons.w
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
y : β
ys : List β
ih : (suffixLevenshtein C xs ys).val.length = xs.length + 1
⊢ (List.foldr (impl C xs)
          (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs)
          ys).val.length =
    xs.length + 1

tactic: exact ih
state_before: case cons.w
α : Type u_1
β : Type u_2
δ : Type u_3
inst✝¹ : AddZeroClass δ
inst✝ : Min δ
C : Cost α β δ
xs : List α
y : β
ys : List β
ih : (suffixLevenshtein C xs ys).val.length = xs.length + 1
⊢ (List.foldr (impl C xs)
          (List.foldr (fun a x => ⟨(C.delete a + x.val[0]) :: x.val, ⋯⟩) ⟨[0], suffixLevenshtein.proof_2⟩ xs)
          ys).val.length =
    xs.length + 1
state_after: no goals