Theorem: List.isSublist_iff_sublist
File: .lake/packages/batteries/Batteries/Data/List/Lemmas.lean

tactic: cases l₁ <;> cases l₂ <;> simp [isSublist]
state_before: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
l₁ l₂ : List α
⊢ l₁.isSublist l₂ = true ↔ l₁ <+ l₂
state_after: case cons.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head✝¹ : α
tail✝¹ : List α
head✝ : α
tail✝ : List α
⊢ (if (head✝¹ == head✝) = true then tail✝¹.isSublist tail✝ = true else (head✝¹ :: tail✝¹).isSublist tail✝ = true) ↔
    head✝¹ :: tail✝¹ <+ head✝ :: tail✝

tactic: simp [h_eq, cons_sublist_cons, isSublist_iff_sublist]
state_before: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : hd₁ = hd₂
⊢ (if (hd₁ == hd₂) = true then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true) ↔
    hd₁ :: tl₁ <+ hd₂ :: tl₂
state_after: no goals

tactic: simp only [beq_iff_eq, h_eq]
state_before: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ (if (hd₁ == hd₂) = true then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true) ↔
    hd₁ :: tl₁ <+ hd₂ :: tl₂
state_after: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ (if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true) ↔ hd₁ :: tl₁ <+ hd₂ :: tl₂

tactic: constructor
state_before: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ (if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true) ↔ hd₁ :: tl₁ <+ hd₂ :: tl₂
state_after: case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ (if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true) → hd₁ :: tl₁ <+ hd₂ :: tl₂

case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ hd₁ :: tl₁ <+ hd₂ :: tl₂ → if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true

tactic: intro h_sub
state_before: case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ (if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true) → hd₁ :: tl₁ <+ hd₂ :: tl₂
state_after: case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
⊢ hd₁ :: tl₁ <+ hd₂ :: tl₂

tactic: apply Sublist.cons
state_before: case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
⊢ hd₁ :: tl₁ <+ hd₂ :: tl₂
state_after: case mp.a
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
⊢ hd₁ :: tl₁ <+ tl₂

tactic: exact isSublist_iff_sublist.mp h_sub
state_before: case mp.a
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
⊢ hd₁ :: tl₁ <+ tl₂
state_after: no goals

tactic: intro h_sub
state_before: case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
⊢ hd₁ :: tl₁ <+ hd₂ :: tl₂ → if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
state_after: case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : hd₁ :: tl₁ <+ hd₂ :: tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true

tactic: cases h_sub
state_before: case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : hd₁ :: tl₁ <+ hd₂ :: tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
state_after: case mpr.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
a✝ : hd₁ :: tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true

case mpr.cons₂
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ tl₂ : List α
h_eq : ¬hd₁ = hd₁
a✝ : tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true

tactic: case cons h_sub =>
  exact isSublist_iff_sublist.mpr h_sub
state_before: case mpr.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
a✝ : hd₁ :: tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true

case mpr.cons₂
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ tl₂ : List α
h_eq : ¬hd₁ = hd₁
a✝ : tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
state_after: case mpr.cons₂
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ tl₂ : List α
h_eq : ¬hd₁ = hd₁
a✝ : tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true

tactic: case cons₂ =>
  contradiction
state_before: case mpr.cons₂
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ tl₂ : List α
h_eq : ¬hd₁ = hd₁
a✝ : tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
state_after: no goals

tactic: exact isSublist_iff_sublist.mpr h_sub
state_before: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ : List α
hd₂ : α
tl₂ : List α
h_eq : ¬hd₁ = hd₂
h_sub : hd₁ :: tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
state_after: no goals

tactic: contradiction
state_before: α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
hd₁ : α
tl₁ tl₂ : List α
h_eq : ¬hd₁ = hd₁
a✝ : tl₁ <+ tl₂
⊢ if False then tl₁.isSublist tl₂ = true else (hd₁ :: tl₁).isSublist tl₂ = true
state_after: no goals