Theorem: List.sublistsLen_sublist_of_sublist
File: Mathlib/Data/List/Sublists.lean

tactic: induction' n with n IHn generalizing l₁ l₂
state_before: α : Type u
β : Type v
γ : Type w
n : ℕ
l₁ l₂ : List α
h : l₁ <+ l₂
⊢ sublistsLen n l₁ <+ sublistsLen n l₂
state_after: case zero
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : l₁ <+ l₂
⊢ sublistsLen 0 l₁ <+ sublistsLen 0 l₂

case succ
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁ l₂ : List α
h : l₁ <+ l₂
⊢ sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂

tactic: induction' h with l₁ l₂ a _ IH l₁ l₂ a s IH
state_before: case succ
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁ l₂ : List α
h : l₁ <+ l₂
⊢ sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
state_after: case succ.slnil
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁ l₂ : List α
⊢ sublistsLen (n + 1) [] <+ sublistsLen (n + 1) []

case succ.cons
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
a✝ : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) (a :: l₂)

case succ.cons₂
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
s : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) (a :: l₁) <+ sublistsLen (n + 1) (a :: l₂)

tactic: simp
state_before: case zero
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : l₁ <+ l₂
⊢ sublistsLen 0 l₁ <+ sublistsLen 0 l₂
state_after: no goals

tactic: rfl
state_before: case succ.slnil
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁ l₂ : List α
⊢ sublistsLen (n + 1) [] <+ sublistsLen (n + 1) []
state_after: no goals

tactic: refine IH.trans ?_
state_before: case succ.cons
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
a✝ : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) (a :: l₂)
state_after: case succ.cons
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
a✝ : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) l₂ <+ sublistsLen (n + 1) (a :: l₂)

tactic: rw [sublistsLen_succ_cons]
state_before: case succ.cons
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
a✝ : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) l₂ <+ sublistsLen (n + 1) (a :: l₂)
state_after: case succ.cons
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
a✝ : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) l₂ <+ sublistsLen (n + 1) l₂ ++ map (cons a) (sublistsLen n l₂)

tactic: apply sublist_append_left
state_before: case succ.cons
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
a✝ : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) l₂ <+ sublistsLen (n + 1) l₂ ++ map (cons a) (sublistsLen n l₂)
state_after: no goals

tactic: simpa only [sublistsLen_succ_cons] using IH.append ((IHn s).map _)
state_before: case succ.cons₂
α : Type u
β : Type v
γ : Type w
n : ℕ
IHn : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → sublistsLen n l₁ <+ sublistsLen n l₂
l₁✝ l₂✝ l₁ l₂ : List α
a : α
s : l₁ <+ l₂
IH : sublistsLen (n + 1) l₁ <+ sublistsLen (n + 1) l₂
⊢ sublistsLen (n + 1) (a :: l₁) <+ sublistsLen (n + 1) (a :: l₂)
state_after: no goals