Theorem: List.drop_take_succ_eq_cons_nthLe
File: Mathlib/Data/List/Join.lean

tactic: induction' L with head tail generalizing i
state_before: α : Type u_1
β : Type u_2
L : List α
i : ℕ
hi : i < L.length
⊢ drop i (take (i + 1) L) = [L.nthLe i hi]
state_after: case nil
α : Type u_1
β : Type u_2
i : ℕ
hi : i < [].length
⊢ drop i (take (i + 1) []) = [[].nthLe i hi]

case cons
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i < (head :: tail).length
⊢ drop i (take (i + 1) (head :: tail)) = [(head :: tail).nthLe i hi]

tactic: cases' i with i hi
state_before: case cons
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i < (head :: tail).length
⊢ drop i (take (i + 1) (head :: tail)) = [(head :: tail).nthLe i hi]
state_after: case cons.zero
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
hi : 0 < (head :: tail).length
⊢ drop 0 (take (0 + 1) (head :: tail)) = [(head :: tail).nthLe 0 hi]

case cons.succ
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
⊢ drop (i + 1) (take (i + 1 + 1) (head :: tail)) = [(head :: tail).nthLe (i + 1) hi]

tactic: have : i < tail.length := by simpa using hi
state_before: case cons.succ
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
⊢ drop (i + 1) (take (i + 1 + 1) (head :: tail)) = [(head :: tail).nthLe (i + 1) hi]
state_after: case cons.succ
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
this : i < tail.length
⊢ drop (i + 1) (take (i + 1 + 1) (head :: tail)) = [(head :: tail).nthLe (i + 1) hi]

tactic: simp [*]
state_before: case cons.succ
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
this : i < tail.length
⊢ drop (i + 1) (take (i + 1 + 1) (head :: tail)) = [(head :: tail).nthLe (i + 1) hi]
state_after: case cons.succ
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
this : i < tail.length
⊢ tail.nthLe i ⋯ = (head :: tail).nthLe (i + 1) hi

tactic: rfl
state_before: case cons.succ
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
this : i < tail.length
⊢ tail.nthLe i ⋯ = (head :: tail).nthLe (i + 1) hi
state_after: no goals

tactic: simp only [length] at hi
state_before: case nil
α : Type u_1
β : Type u_2
i : ℕ
hi : i < [].length
⊢ drop i (take (i + 1) []) = [[].nthLe i hi]
state_after: case nil
α : Type u_1
β : Type u_2
i : ℕ
hi : i < 0
⊢ drop i (take (i + 1) []) = [[].nthLe i hi]

tactic: exact (Nat.not_succ_le_zero i hi).elim
state_before: case nil
α : Type u_1
β : Type u_2
i : ℕ
hi : i < 0
⊢ drop i (take (i + 1) []) = [[].nthLe i hi]
state_after: no goals

tactic: simp
state_before: case cons.zero
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
hi : 0 < (head :: tail).length
⊢ drop 0 (take (0 + 1) (head :: tail)) = [(head :: tail).nthLe 0 hi]
state_after: case cons.zero
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
hi : 0 < (head :: tail).length
⊢ head = (head :: tail).nthLe 0 hi

tactic: rfl
state_before: case cons.zero
α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
hi : 0 < (head :: tail).length
⊢ head = (head :: tail).nthLe 0 hi
state_after: no goals

tactic: simpa using hi
state_before: α : Type u_1
β : Type u_2
head : α
tail : List α
tail_ih✝ : ∀ {i : ℕ} (hi : i < tail.length), drop i (take (i + 1) tail) = [tail.nthLe i hi]
i : ℕ
hi : i + 1 < (head :: tail).length
⊢ i < tail.length
state_after: no goals