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.24410
l l₁ l₂ l₃ : List α
a b : α
m n : ℕ
L : List (List (Option α))
hm : m < length L
⊢ take m L <+: 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 => exact (not_lt_bot hm).elim
  | cons l ls =>
    cases n with
    | zero =>
      refine' iff_of_false _ (zero_lt_succ _).not_le
      rw [take_zero, take_nil]
      simp only [take]
    | succ n =>
      simp only [length] at hm
      have specializedIH := @IH n ls (Nat.lt_of_succ_lt_succ hm)
      simp only [le_of_lt (Nat.lt_of_succ_lt_succ hm), min_eq_left] at specializedIH
      simp [le_of_lt hm, specializedIH, true_and_iff, min_eq_left, eq_self_iff_true, length, take]
      exact ⟨Nat.succ_le_succ, Nat.le_of_succ_le_succ⟩
state_before: α : Type u_1
β : Type ?u.24410
l l₁ l₂ l₃ : List α
a b : α
m n : ℕ
L : List (List (Option α))
hm : m < length L
⊢ take m L = take (min m (length L)) (take n L) ↔ m ≤ n

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

tactic: cases L with
| nil => exact (not_lt_bot hm).elim
| cons l ls =>
  cases n with
  | zero =>
    refine' iff_of_false _ (zero_lt_succ _).not_le
    rw [take_zero, take_nil]
    simp only [take]
  | succ n =>
    simp only [length] at hm
    have specializedIH := @IH n ls (Nat.lt_of_succ_lt_succ hm)
    simp only [le_of_lt (Nat.lt_of_succ_lt_succ hm), min_eq_left] at specializedIH
    simp [le_of_lt hm, specializedIH, true_and_iff, min_eq_left, eq_self_iff_true, length, take]
    exact ⟨Nat.succ_le_succ, Nat.le_of_succ_le_succ⟩
state_before: case succ
α : Type u_1
β : Type ?u.24410
l l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
n : ℕ
L : List (List (Option α))
hm : succ m < length L
⊢ take (succ m) L = take (min (succ m) (length L)) (take n L) ↔ succ m ≤ n

tactic: exact (not_lt_bot hm).elim
state_before: case succ.nil
α : Type u_1
β : Type ?u.24410
l l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
n : ℕ
hm : succ m < length []
⊢ take (succ m) [] = take (min (succ m) (length [])) (take n []) ↔ succ m ≤ n

tactic: cases n with
| zero =>
  refine' iff_of_false _ (zero_lt_succ _).not_le
  rw [take_zero, take_nil]
  simp only [take]
| succ n =>
  simp only [length] at hm
  have specializedIH := @IH n ls (Nat.lt_of_succ_lt_succ hm)
  simp only [le_of_lt (Nat.lt_of_succ_lt_succ hm), min_eq_left] at specializedIH
  simp [le_of_lt hm, specializedIH, true_and_iff, min_eq_left, eq_self_iff_true, length, take]
  exact ⟨Nat.succ_le_succ, Nat.le_of_succ_le_succ⟩
state_before: case succ.cons
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
n : ℕ
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length (l :: ls)
⊢ take (succ m) (l :: ls) = take (min (succ m) (length (l :: ls))) (take n (l :: ls)) ↔ succ m ≤ n

tactic: refine' iff_of_false _ (zero_lt_succ _).not_le
state_before: case succ.cons.zero
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length (l :: ls)
⊢ take (succ m) (l :: ls) = take (min (succ m) (length (l :: ls))) (take zero (l :: ls)) ↔ succ m ≤ zero

tactic: rw [take_zero, take_nil]
state_before: case succ.cons.zero
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length (l :: ls)
⊢ ¬take (succ m) (l :: ls) = take (min (succ m) (length (l :: ls))) (take zero (l :: ls))

tactic: simp only [take]
state_before: case succ.cons.zero
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length (l :: ls)
⊢ ¬take (succ m) (l :: ls) = []

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

tactic: have specializedIH := @IH n ls (Nat.lt_of_succ_lt_succ hm)
state_before: case succ.cons.succ
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length ls + 1
n : ℕ
⊢ take (succ m) (l :: ls) = take (min (succ m) (length (l :: ls))) (take (succ n) (l :: ls)) ↔ succ m ≤ succ n

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

tactic: simp [le_of_lt hm, specializedIH, true_and_iff, min_eq_left, eq_self_iff_true, length, take]
state_before: case succ.cons.succ
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length ls + 1
n : ℕ
specializedIH : take m ls = take m (take n ls) ↔ m ≤ n
⊢ take (succ m) (l :: ls) = take (min (succ m) (length (l :: ls))) (take (succ n) (l :: ls)) ↔ succ m ≤ succ n

tactic: exact ⟨Nat.succ_le_succ, Nat.le_of_succ_le_succ⟩
state_before: case succ.cons.succ
α : Type u_1
β : Type ?u.24410
l✝ l₁ l₂ l₃ : List α
a b : α
m : ℕ
IH : ∀ {n : ℕ} {L : List (List (Option α))}, m < length L → (take m L = take (min m (length L)) (take n L) ↔ m ≤ n)
l : List (Option α)
ls : List (List (Option α))
hm : succ m < length ls + 1
n : ℕ
specializedIH : take m ls = take m (take n ls) ↔ m ≤ n
⊢ m ≤ n ↔ succ m ≤ succ n