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

Proof steps:
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ (↑(suffixLevenshtein C xs ys)).minimum ≤ (↑(suffixLevenshtein C xs (y :: ys))).minimum
state_after: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ ∀ (a : δ), a ∈ ↑(suffixLevenshtein C xs (y :: ys)) → (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑a
tactic: apply List.le_minimum_of_forall_le
state_before: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ ∀ (a : δ), a ∈ ↑(suffixLevenshtein C xs (y :: ys)) → (↑(suffixLevenshtein C xs ys)).minimum ≤ ↑a
state_after: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ ∀ (a : δ),
    a ∈ List.map (fun xs' => levenshtein C xs' (y :: ys)) xs.tails →
      (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑a
tactic: simp only [suffixLevenshtein_eq_tails_map]
state_before: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ ∀ (a : δ),
    a ∈ List.map (fun xs' => levenshtein C xs' (y :: ys)) xs.tails →
      (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑a
state_after: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ ∀ (a : List α),
    a <:+ xs → (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑(levenshtein C a (y :: ys))
tactic: simp only [List.mem_map, List.mem_tails, forall_exists_index, and_imp, forall_apply_eq_imp_iff₂]
state_before: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
⊢ ∀ (a : List α),
    a <:+ xs → (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑(levenshtein C a (y :: ys))
state_after: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑(levenshtein C a (y :: ys))
tactic: intro a suff
state_before: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑(levenshtein C a (y :: ys))
state_after: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ (↑(suffixLevenshtein C a ys)).minimum
tactic: refine (?_ : _ ≤ _).trans (suffixLevenshtein_minimum_le_levenshtein_cons _ _ _)
state_before: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ (↑(suffixLevenshtein C a ys)).minimum
state_after: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤
    (List.map (fun xs' => levenshtein C xs' ys) a.tails).minimum
tactic: simp only [suffixLevenshtein_eq_tails_map]
state_before: case h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤
    (List.map (fun xs' => levenshtein C xs' ys) a.tails).minimum
state_after: case h.h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ ∀ (a_1 : δ),
    a_1 ∈ List.map (fun xs' => levenshtein C xs' ys) a.tails →
      (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑a_1
tactic: apply List.le_minimum_of_forall_le
state_before: case h.h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
⊢ ∀ (a_1 : δ),
    a_1 ∈ List.map (fun xs' => levenshtein C xs' ys) a.tails →
      (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑a_1
state_after: case h.h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
b : δ
m : b ∈ List.map (fun xs' => levenshtein C xs' ys) a.tails
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑b
tactic: intro b m
state_before: case h.h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
b : δ
m : b ∈ List.map (fun xs' => levenshtein C xs' ys) a.tails
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑b
state_after: case h.h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
b : δ
m : ∃ a_1, a_1 <:+ a ∧ levenshtein C a_1 ys = b
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑b
tactic: replace m : ∃ a_1, a_1 <:+ a ∧ levenshtein C a_1 ys = b := by simpa using m
state_before: case h.h
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
b : δ
m : ∃ a_1, a_1 <:+ a ∧ levenshtein C a_1 ys = b
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑b
state_after: case h.h.intro.intro
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑(levenshtein C a' ys)
tactic: obtain ⟨a', suff', rfl⟩ := m
state_before: case h.h.intro.intro
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
⊢ (List.map (fun xs' => levenshtein C xs' ys) xs.tails).minimum ≤ ↑(levenshtein C a' ys)
state_after: case h.h.intro.intro.ha
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
⊢ levenshtein C a' ys ∈ List.map (fun xs' => levenshtein C xs' ys) xs.tails
tactic: apply List.minimum_le_of_mem'
state_before: case h.h.intro.intro.ha
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
⊢ levenshtein C a' ys ∈ List.map (fun xs' => levenshtein C xs' ys) xs.tails
state_after: case h.h.intro.intro.ha
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
⊢ ∃ a, a <:+ xs ∧ levenshtein C a ys = levenshtein C a' ys
tactic: simp only [List.mem_map, List.mem_tails]
state_before: α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
this : ∃ a, a <:+ xs ∧ levenshtein C a ys = levenshtein C a' ys
⊢ ∃ a, a <:+ xs ∧ levenshtein C a ys = levenshtein C a' ys
state_after: no goals
tactic: simpa
state_before: case h.h.intro.intro.ha
α : Type u_1
β : Type u_2
δ : Type u_3
C : Levenshtein.Cost α β δ
inst✝ : CanonicallyLinearOrderedAddCommMonoid δ
xs : List α
y : β
ys : List β
a : List α
suff : a <:+ xs
a' : List α
suff' : a' <:+ a
⊢ ∃ a, a <:+ xs ∧ levenshtein C a ys = levenshtein C a' ys
state_after: no goals
tactic: exact ⟨a', suff'.trans suff, rfl⟩