Theorem: List.prefix_take_le_iff
File: Mathlib/Data/List/Infix.lean

tactic: simp only [prefix_iff_eq_take, length_take]
state_before: α : Type u_1
β : Type u_2
l l₁ l₂ l₃ : List α
a b : α
m n : ℕ
L : List (List (Option α))
hm : m < L.length
⊢ take m L <+: take n L ↔ m ≤ n
state_after: α : Type u_1
β : Type u_2
l l₁ l₂ l₃ : List α
a b : α
m n : ℕ
L : List (List (Option α))
hm : m < L.length
⊢ take m L = take (min m L.length) (take n L) ↔ m ≤ n

tactic: induction m generalizing L n with
| zero => simp [min_eq_left, eq_self_iff_true, Nat.zero_le, take]
| succ m IH =>
  cases L with
  | nil => simp_all
  | cons l ls =>
    cases n with
    | zero =>
      simp
    | succ n =>
      simp only [length_cons, succ_eq_add_one, Nat.add_lt_add_iff_right] at hm
      simp [← @IH n ls hm, Nat.min_eq_left, Nat.le_of_lt hm]
state_before: α : Type u_1
β : Type u_2
l l₁ l₂ l₃ : List α
a b : α
m n : ℕ
L : List (List (Option α))
hm : m < L.length
⊢ take m L = take (min m L.length) (take n L) ↔ m ≤ n
state_after: no goals

tactic: simp [min_eq_left, eq_self_iff_true, Nat.zero_le, take]
state_before: case zero
α : Type u_1
β : Type u_2
l l₁ l₂ l₃ : List α
a b : α
n : ℕ
L : List (List (Option α))
hm : 0 < L.length
⊢ take 0 L = take (min 0 L.length) (take n L) ↔ 0 ≤ n
state_after: no goals

tactic: cases L with
| nil => simp_all
| cons l ls =>
  cases n with
  | zero =>
    simp
  | succ n =>
    simp only [length_cons, succ_eq_add_one, Nat.add_lt_add_iff_right] at hm
    simp [← @IH n ls hm, Nat.min_eq_left, Nat.le_of_lt hm]
state_before: case succ
α : Type u_1
β : Type u_2
l l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
n : ℕ
L : List (List (Option α))
hm : m + 1 < L.length
⊢ take (m + 1) L = take (min (m + 1) L.length) (take n L) ↔ m + 1 ≤ n
state_after: no goals

tactic: simp_all
state_before: case succ.nil
α : Type u_1
β : Type u_2
l l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
n : ℕ
hm : m + 1 < [].length
⊢ take (m + 1) [] = take (min (m + 1) [].length) (take n []) ↔ m + 1 ≤ n
state_after: no goals

tactic: cases n with
| zero =>
  simp
| succ n =>
  simp only [length_cons, succ_eq_add_one, Nat.add_lt_add_iff_right] at hm
  simp [← @IH n ls hm, Nat.min_eq_left, Nat.le_of_lt hm]
state_before: case succ.cons
α : Type u_1
β : Type u_2
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
n : ℕ
l : List (Option α)
ls : List (List (Option α))
hm : m + 1 < (l :: ls).length
⊢ take (m + 1) (l :: ls) = take (min (m + 1) (l :: ls).length) (take n (l :: ls)) ↔ m + 1 ≤ n
state_after: no goals

tactic: simp
state_before: case succ.cons.zero
α : Type u_1
β : Type u_2
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : m + 1 < (l :: ls).length
⊢ take (m + 1) (l :: ls) = take (min (m + 1) (l :: ls).length) (take 0 (l :: ls)) ↔ m + 1 ≤ 0
state_after: no goals

tactic: simp only [length_cons, succ_eq_add_one, Nat.add_lt_add_iff_right] at hm
state_before: case succ.cons.succ
α : Type u_1
β : Type u_2
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : m + 1 < (l :: ls).length
n : ℕ
⊢ take (m + 1) (l :: ls) = take (min (m + 1) (l :: ls).length) (take (n + 1) (l :: ls)) ↔ m + 1 ≤ n + 1
state_after: case succ.cons.succ
α : Type u_1
β : Type u_2
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
n : ℕ
hm : m < ls.length
⊢ take (m + 1) (l :: ls) = take (min (m + 1) (l :: ls).length) (take (n + 1) (l :: ls)) ↔ m + 1 ≤ n + 1

tactic: simp [← @IH n ls hm, Nat.min_eq_left, Nat.le_of_lt hm]
state_before: case succ.cons.succ
α : Type u_1
β : Type u_2
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < L.length → (take m L = take (min m L.length) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
n : ℕ
hm : m < ls.length
⊢ take (m + 1) (l :: ls) = take (min (m + 1) (l :: ls).length) (take (n + 1) (l :: ls)) ↔ m + 1 ≤ n + 1
state_after: no goals