Theorem: suffixLevenshtein_minimum_le_levenshtein_cons
File: Mathlib/Data/List/EditDistance/Bounds.lean

tactic: simp only [suffixLevenshtein_nil', levenshtein_nil_cons,
  List.minimum_singleton, WithTop.coe_le_coe]
state_before: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
⊢ (↑(suffixLevenshtein C [] ys)).minimum ≤ ↑(levenshtein C [] (y :: ys))
state_after: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
⊢ levenshtein C [] ys ≤ C.insert y + levenshtein C [] ys

tactic: exact le_add_of_nonneg_left (by simp)
state_before: case nil
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
⊢ levenshtein C [] ys ≤ C.insert y + levenshtein C [] ys
state_after: no goals

tactic: simp
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
⊢ 0 ≤ C.insert y
state_after: no goals

tactic: suffices
  (suffixLevenshtein C (x :: xs) ys).1.minimum ≤ (C.delete x + levenshtein C xs (y :: ys)) ∧
    (suffixLevenshtein C (x :: xs) ys).1.minimum ≤ (C.insert y + levenshtein C (x :: xs) ys) ∧
    (suffixLevenshtein C (x :: xs) ys).1.minimum ≤ (C.substitute x y + levenshtein C xs ys) by
  simpa [suffixLevenshtein_eq_tails_map]
state_before: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(levenshtein C (x :: xs) (y :: ys))
state_after: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.delete x + levenshtein C xs (y :: ys)) ∧
    (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.insert y + levenshtein C (x :: xs) ys) ∧
      (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.substitute x y + levenshtein C xs ys)

tactic: refine ⟨?_, ?_, ?_⟩
state_before: case cons
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.delete x + levenshtein C xs (y :: ys)) ∧
    (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.insert y + levenshtein C (x :: xs) ys) ∧
      (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.substitute x y + levenshtein C xs ys)
state_after: case cons.refine_1
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.delete x + levenshtein C xs (y :: ys))

case cons.refine_2
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.insert y + levenshtein C (x :: xs) ys)

case cons.refine_3
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.substitute x y + levenshtein C xs ys)

tactic: simpa [suffixLevenshtein_eq_tails_map]
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
this :
  (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.delete x + levenshtein C xs (y :: ys)) ∧
    (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.insert y + levenshtein C (x :: xs) ys) ∧
      (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.substitute x y + levenshtein C xs ys)
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(levenshtein C (x :: xs) (y :: ys))
state_after: no goals

tactic: calc
  _ ≤ (suffixLevenshtein C xs ys).1.minimum := by
      simp [suffixLevenshtein_cons₁_fst, List.minimum_cons]
  _ ≤ ↑(levenshtein C xs (y :: ys)) := ih
  _ ≤ _ := by simp
state_before: case cons.refine_1
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.delete x + levenshtein C xs (y :: ys))
state_after: no goals

tactic: simp [suffixLevenshtein_cons₁_fst, List.minimum_cons]
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ (↑(suffixLevenshtein C xs ys)).minimum
state_after: no goals

tactic: simp
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ ↑(levenshtein C xs (y :: ys)) ≤ ↑(C.delete x + levenshtein C xs (y :: ys))
state_after: no goals

tactic: calc
  (suffixLevenshtein C (x :: xs) ys).1.minimum ≤ (levenshtein C (x :: xs) ys) := by
      simp [suffixLevenshtein_cons₁_fst, List.minimum_cons]
  _ ≤ _ := by simp
state_before: case cons.refine_2
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(C.insert y + levenshtein C (x :: xs) ys)
state_after: no goals

tactic: simp [suffixLevenshtein_cons₁_fst, List.minimum_cons]
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(levenshtein C (x :: xs) ys)
state_after: no goals

tactic: simp
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ ↑(levenshtein C (x :: xs) ys) ≤ ↑(C.insert y + levenshtein C (x :: xs) ys)
state_after: no goals

tactic: simp only [suffixLevenshtein_cons₁_fst, List.minimum_cons]
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C (x :: xs) ys)).minimum ≤ ↑(levenshtein C xs ys)
state_after: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ min (↑(levenshtein C (x :: xs) ys)) (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs ys)

tactic: apply min_le_of_right_le
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ min (↑(levenshtein C (x :: xs) ys)) (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs ys)
state_after: case a
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs ys)

tactic: cases xs
state_before: case a
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs ys)
state_after: case a.nil
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
ih : (↑(suffixLevenshtein C [] ys)).minimum ≤ ↑(levenshtein C [] (y :: ys))
⊢ (↑(suffixLevenshtein C [] ys)).minimum ≤ ↑(levenshtein C [] ys)

case a.cons
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x head✝ : α
tail✝ : List α
ih : (↑(suffixLevenshtein C (head✝ :: tail✝) ys)).minimum ≤ ↑(levenshtein C (head✝ :: tail✝) (y :: ys))
⊢ (↑(suffixLevenshtein C (head✝ :: tail✝) ys)).minimum ≤ ↑(levenshtein C (head✝ :: tail✝) ys)

tactic: simp [suffixLevenshtein_nil']
state_before: case a.nil
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
ih : (↑(suffixLevenshtein C [] ys)).minimum ≤ ↑(levenshtein C [] (y :: ys))
⊢ (↑(suffixLevenshtein C [] ys)).minimum ≤ ↑(levenshtein C [] ys)
state_after: no goals

tactic: simp [suffixLevenshtein_cons₁, List.minimum_cons]
state_before: case a.cons
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x head✝ : α
tail✝ : List α
ih : (↑(suffixLevenshtein C (head✝ :: tail✝) ys)).minimum ≤ ↑(levenshtein C (head✝ :: tail✝) (y :: ys))
⊢ (↑(suffixLevenshtein C (head✝ :: tail✝) ys)).minimum ≤ ↑(levenshtein C (head✝ :: tail✝) ys)
state_after: no goals

tactic: simp
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
y : β
ys : List β
x : α
xs : List α
ih : (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑(levenshtein C xs (y :: ys))
⊢ ↑(levenshtein C xs ys) ≤ ↑(C.substitute x y + levenshtein C xs ys)
state_after: no goals