l3lab/ntp-mathlib huggingface dataset:
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · 

Proof state:
case cons.zero.succ.a.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x head✝ : α
xs_tl : List α
tail_ih✝ :
  (∀ (i j : ℕ), 0 < j → i < length xs_tl → sizeOf (dropSlice i j xs_tl) < sizeOf xs_tl) →
    zero < length (x :: xs_tl) → ∀ (n : ℕ), 0 < succ n → sizeOf (drop n xs_tl) ≤ sizeOf xs_tl
xs_ih :
  ∀ (i j : ℕ), 0 < j → i < length (head✝ :: xs_tl) → sizeOf (dropSlice i j (head✝ :: xs_tl)) < sizeOf (head✝ :: xs_tl)
hi : zero < length (x :: head✝ :: xs_tl)
n✝ : ℕ
hj : 0 < succ (succ n✝)
⊢ sizeOf (drop (succ n✝) (head✝ :: xs_tl)) ≤ sizeOf (head✝ :: xs_tl)

Next tactic:
simp [drop]
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · simp [drop]
            

Proof state:
case cons.zero.succ.a.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x head✝ : α
xs_tl : List α
tail_ih✝ :
  (∀ (i j : ℕ), 0 < j → i < length xs_tl → sizeOf (dropSlice i j xs_tl) < sizeOf xs_tl) →
    zero < length (x :: xs_tl) → ∀ (n : ℕ), 0 < succ n → sizeOf (drop n xs_tl) ≤ sizeOf xs_tl
xs_ih :
  ∀ (i j : ℕ), 0 < j → i < length (head✝ :: xs_tl) → sizeOf (dropSlice i j (head✝ :: xs_tl)) < sizeOf (head✝ :: xs_tl)
hi : zero < length (x :: head✝ :: xs_tl)
n✝ : ℕ
hj : 0 < succ (succ n✝)
⊢ sizeOf (drop n✝ xs_tl) ≤ 1 + sizeOf head✝ + sizeOf xs_tl

Next tactic:
rw [← Nat.zero_add (sizeOf (drop _ xs_tl))]
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · simp [drop]
            rw [← Nat.zero_add (sizeOf (drop _ xs_tl))]
            

Proof state:
case cons.zero.succ.a.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x head✝ : α
xs_tl : List α
tail_ih✝ :
  (∀ (i j : ℕ), 0 < j → i < length xs_tl → sizeOf (dropSlice i j xs_tl) < sizeOf xs_tl) →
    zero < length (x :: xs_tl) → ∀ (n : ℕ), 0 < succ n → sizeOf (drop n xs_tl) ≤ sizeOf xs_tl
xs_ih :
  ∀ (i j : ℕ), 0 < j → i < length (head✝ :: xs_tl) → sizeOf (dropSlice i j (head✝ :: xs_tl)) < sizeOf (head✝ :: xs_tl)
hi : zero < length (x :: head✝ :: xs_tl)
n✝ : ℕ
hj : 0 < succ (succ n✝)
⊢ 0 + sizeOf (drop n✝ xs_tl) ≤ 1 + sizeOf head✝ + sizeOf xs_tl

Next tactic:
exact Nat.add_le_add (Nat.zero_le _) (drop_sizeOf_le xs_tl _)
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · simp [drop]
            rw [← Nat.zero_add (sizeOf (drop _ xs_tl))]
            exact Nat.add_le_add (Nat.zero_le _) (drop_sizeOf_le xs_tl _)
        · 

Proof state:
case cons.zero.succ.a
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x : α
xs : List α
xs_ih : ∀ (i j : ℕ), 0 < j → i < length xs → sizeOf (dropSlice i j xs) < sizeOf xs
hi : zero < length (x :: xs)
n : ℕ
hj : 0 < succ n
⊢ sizeOf xs < sizeOf (x :: xs)

Next tactic:
simp
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · simp [drop]
            rw [← Nat.zero_add (sizeOf (drop _ xs_tl))]
            exact Nat.add_le_add (Nat.zero_le _) (drop_sizeOf_le xs_tl _)
        · simp
    · 

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x : α
xs : List α
xs_ih : ∀ (i j : ℕ), 0 < j → i < length xs → sizeOf (dropSlice i j xs) < sizeOf xs
j : ℕ
hj : 0 < j
n✝ : ℕ
hi : succ n✝ < length (x :: xs)
⊢ sizeOf (x :: dropSlice n✝ j xs) < sizeOf (x :: xs)

Next tactic:
simp
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · simp [drop]
            rw [← Nat.zero_add (sizeOf (drop _ xs_tl))]
            exact Nat.add_le_add (Nat.zero_le _) (drop_sizeOf_le xs_tl _)
        · simp
    · simp
      

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x : α
xs : List α
xs_ih : ∀ (i j : ℕ), 0 < j → i < length xs → sizeOf (dropSlice i j xs) < sizeOf xs
j : ℕ
hj : 0 < j
n✝ : ℕ
hi : succ n✝ < length (x :: xs)
⊢ sizeOf (dropSlice n✝ j xs) < sizeOf xs

Next tactic:
apply xs_ih _ j hj
theorem sizeOf_dropSlice_lt [SizeOf α] (i j : ℕ) (hj : 0 < j) (xs : List α) (hi : i < xs.length) :
    SizeOf.sizeOf (List.dropSlice i j xs) < SizeOf.sizeOf xs := by
  induction xs generalizing i j hj with
  | nil => cases hi
  | cons x xs xs_ih =>
    cases i <;> simp only [List.dropSlice]
    · cases j with
      | zero => contradiction
      | succ n =>
        dsimp only [drop]; apply @lt_of_le_of_lt _ _ _ (sizeOf xs)
        induction xs generalizing n with
        | nil => rw [drop_nil]
        | cons _ xs_tl =>
          cases n
          · simp
          · simp [drop]
            rw [← Nat.zero_add (sizeOf (drop _ xs_tl))]
            exact Nat.add_le_add (Nat.zero_le _) (drop_sizeOf_le xs_tl _)
        · simp
    · simp
      apply xs_ih _ j hj
      

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
inst✝ : SizeOf α
x : α
xs : List α
xs_ih : ∀ (i j : ℕ), 0 < j → i < length xs → sizeOf (dropSlice i j xs) < sizeOf xs
j : ℕ
hj : 0 < j
n✝ : ℕ
hi : succ n✝ < length (x :: xs)
⊢ n✝ < length xs

Next tactic:
apply lt_of_succ_lt_succ hi
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
hn : n < length l
⊢ getD l n d = get l { val := n, isLt := hn }

Next tactic:
induction l generalizing n with
  | nil => exact absurd hn (not_lt_of_ge (Nat.zero_le _))
  | cons head tail ih =>
    cases n
    · exact getD_cons_zero _ _ _
    · exact ih _
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  induction l generalizing n with
  

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
hn : n < length []
⊢ getD [] n d = get [] { val := n, isLt := hn }

Next tactic:
| nil => exact absurd hn (not_lt_of_ge (Nat.zero_le _))
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  induction l generalizing n with
  | nil => 

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
hn : n < length []
⊢ getD [] n d = get [] { val := n, isLt := hn }

Next tactic:
exact absurd hn (not_lt_of_ge (Nat.zero_le _))
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  induction l generalizing n with
  | nil => exact absurd hn (not_lt_of_ge (Nat.zero_le _))
  

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ} (hn : n < length tail), getD tail n d = get tail { val := n, isLt := hn }
n : ℕ
hn : n < length (head :: tail)
⊢ getD (head :: tail) n d = get (head :: tail) { val := n, isLt := hn }

Next tactic:
| cons head tail ih =>
    cases n
    · exact getD_cons_zero _ _ _
    · exact ih _
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  induction l generalizing n with
  | nil => exact absurd hn (not_lt_of_ge (Nat.zero_le _))
  | cons head tail ih =>
    

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ} (hn : n < length tail), getD tail n d = get tail { val := n, isLt := hn }
n : ℕ
hn : n < length (head :: tail)
⊢ getD (head :: tail) n d = get (head :: tail) { val := n, isLt := hn }

Next tactic:
cases n
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  induction l generalizing n with
  | nil => exact absurd hn (not_lt_of_ge (Nat.zero_le _))
  | cons head tail ih =>
    cases n
    · 

Proof state:
case cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ} (hn : n < length tail), getD tail n d = get tail { val := n, isLt := hn }
hn : zero < length (head :: tail)
⊢ getD (head :: tail) zero d = get (head :: tail) { val := zero, isLt := hn }

Next tactic:
exact getD_cons_zero _ _ _
theorem getD_eq_get {n : ℕ} (hn : n < l.length) : l.getD n d = l.get ⟨n, hn⟩ := by
  induction l generalizing n with
  | nil => exact absurd hn (not_lt_of_ge (Nat.zero_le _))
  | cons head tail ih =>
    cases n
    · exact getD_cons_zero _ _ _
    · 

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ} (hn : n < length tail), getD tail n d = get tail { val := n, isLt := hn }
n✝ : ℕ
hn : succ n✝ < length (head :: tail)
⊢ getD (head :: tail) (succ n✝) d = get (head :: tail) { val := succ n✝, isLt := hn }

Next tactic:
exact ih _
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
f : α → β
⊢ getD (map f l) n (f d) = f (getD l n d)

Next tactic:
induction l generalizing n with
  | nil => rfl
  | cons head tail ih =>
    cases n
    · rfl
    · simp [ih]
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  induction l generalizing n with
  

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
f : α → β
n : ℕ
⊢ getD (map f []) n (f d) = f (getD [] n d)

Next tactic:
| nil => rfl
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  induction l generalizing n with
  | nil => 

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
f : α → β
n : ℕ
⊢ getD (map f []) n (f d) = f (getD [] n d)

Next tactic:
rfl
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  induction l generalizing n with
  | nil => rfl
  

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
f : α → β
head : α
tail : List α
ih : ∀ {n : ℕ}, getD (map f tail) n (f d) = f (getD tail n d)
n : ℕ
⊢ getD (map f (head :: tail)) n (f d) = f (getD (head :: tail) n d)

Next tactic:
| cons head tail ih =>
    cases n
    · rfl
    · simp [ih]
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  induction l generalizing n with
  | nil => rfl
  | cons head tail ih =>
    

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
f : α → β
head : α
tail : List α
ih : ∀ {n : ℕ}, getD (map f tail) n (f d) = f (getD tail n d)
n : ℕ
⊢ getD (map f (head :: tail)) n (f d) = f (getD (head :: tail) n d)

Next tactic:
cases n
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  induction l generalizing n with
  | nil => rfl
  | cons head tail ih =>
    cases n
    · 

Proof state:
case cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
f : α → β
head : α
tail : List α
ih : ∀ {n : ℕ}, getD (map f tail) n (f d) = f (getD tail n d)
⊢ getD (map f (head :: tail)) zero (f d) = f (getD (head :: tail) zero d)

Next tactic:
rfl
@[simp]
theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d) := by
  induction l generalizing n with
  | nil => rfl
  | cons head tail ih =>
    cases n
    · rfl
    · 

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
f : α → β
head : α
tail : List α
ih : ∀ {n : ℕ}, getD (map f tail) n (f d) = f (getD tail n d)
n✝ : ℕ
⊢ getD (map f (head :: tail)) (succ n✝) (f d) = f (getD (head :: tail) (succ n✝) d)

Next tactic:
simp [ih]
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
hn : length l ≤ n
⊢ getD l n d = d

Next tactic:
induction l generalizing n with
  | nil => exact getD_nil _ _
  | cons head tail ih =>
    cases n
    · refine' absurd (Nat.zero_lt_succ _) (not_lt_of_ge hn)
    · exact ih (Nat.le_of_succ_le_succ hn)
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  induction l generalizing n with
  

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
hn : length [] ≤ n
⊢ getD [] n d = d

Next tactic:
| nil => exact getD_nil _ _
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  induction l generalizing n with
  | nil => 

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
hn : length [] ≤ n
⊢ getD [] n d = d

Next tactic:
exact getD_nil _ _
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  induction l generalizing n with
  | nil => exact getD_nil _ _
  

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ}, length tail ≤ n → getD tail n d = d
n : ℕ
hn : length (head :: tail) ≤ n
⊢ getD (head :: tail) n d = d

Next tactic:
| cons head tail ih =>
    cases n
    · refine' absurd (Nat.zero_lt_succ _) (not_lt_of_ge hn)
    · exact ih (Nat.le_of_succ_le_succ hn)
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  induction l generalizing n with
  | nil => exact getD_nil _ _
  | cons head tail ih =>
    

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ}, length tail ≤ n → getD tail n d = d
n : ℕ
hn : length (head :: tail) ≤ n
⊢ getD (head :: tail) n d = d

Next tactic:
cases n
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  induction l generalizing n with
  | nil => exact getD_nil _ _
  | cons head tail ih =>
    cases n
    · 

Proof state:
case cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ}, length tail ≤ n → getD tail n d = d
hn : length (head :: tail) ≤ zero
⊢ getD (head :: tail) zero d = d

Next tactic:
refine' absurd (Nat.zero_lt_succ _) (not_lt_of_ge hn)
theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d := by
  induction l generalizing n with
  | nil => exact getD_nil _ _
  | cons head tail ih =>
    cases n
    · refine' absurd (Nat.zero_lt_succ _) (not_lt_of_ge hn)
    · 

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
head : α
tail : List α
ih : ∀ {n : ℕ}, length tail ≤ n → getD tail n d = d
n✝ : ℕ
hn : length (head :: tail) ≤ succ n✝
⊢ getD (head :: tail) (succ n✝) d = d

Next tactic:
exact ih (Nat.le_of_succ_le_succ hn)
@[simp]
theorem getD_singleton_default_eq (n : ℕ) : [d].getD n d = d := by 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
⊢ getD [d] n d = d

Next tactic:
cases n
@[simp]
theorem getD_singleton_default_eq (n : ℕ) : [d].getD n d = d := by cases n <;> 

Proof state:
case zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n : ℕ
⊢ getD [d] zero d = d

Next tactic:
simp
@[simp]
theorem getD_singleton_default_eq (n : ℕ) : [d].getD n d = d := by cases n <;> 

Proof state:
case succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n n✝ : ℕ
⊢ getD [d] (succ n✝) d = d

Next tactic:
simp
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ r n : ℕ
⊢ getD (replicate r d) n d = d

Next tactic:
induction r generalizing n with
  | zero => simp
  | succ n ih => cases n <;> simp [ih]
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  induction r generalizing n with
  

Proof state:
case zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
⊢ getD (replicate zero d) n d = d

Next tactic:
| zero => simp
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  induction r generalizing n with
  | zero => 

Proof state:
case zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
⊢ getD (replicate zero d) n d = d

Next tactic:
simp
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  induction r generalizing n with
  | zero => simp
  

Proof state:
case succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝¹ n✝ : ℕ
ih : ∀ (n : ℕ), getD (replicate n✝ d) n d = d
n : ℕ
⊢ getD (replicate (succ n✝) d) n d = d

Next tactic:
| succ n ih => cases n <;> simp [ih]
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  induction r generalizing n with
  | zero => simp
  | succ n ih => 

Proof state:
case succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝¹ n✝ : ℕ
ih : ∀ (n : ℕ), getD (replicate n✝ d) n d = d
n : ℕ
⊢ getD (replicate (succ n✝) d) n d = d

Next tactic:
cases n
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  induction r generalizing n with
  | zero => simp
  | succ n ih => cases n <;> 

Proof state:
case succ.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝ n : ℕ
ih : ∀ (n_1 : ℕ), getD (replicate n d) n_1 d = d
⊢ getD (replicate (succ n) d) zero d = d

Next tactic:
simp [ih]
@[simp]
theorem getD_replicate_default_eq (r n : ℕ) : (replicate r d).getD n d = d := by
  induction r generalizing n with
  | zero => simp
  | succ n ih => cases n <;> 

Proof state:
case succ.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
x : α
xs : List α
d : α
n✝¹ n : ℕ
ih : ∀ (n_1 : ℕ), getD (replicate n d) n_1 d = d
n✝ : ℕ
⊢ getD (replicate (succ n) d) (succ n✝) d = d

Next tactic:
simp [ih]
theorem getD_append (l l' : List α) (d : α) (n : ℕ) (h : n < l.length)
    (h' : n < (l ++ l').length := h.trans_le ((length_append l l').symm ▸ le_self_add)) :
    (l ++ l').getD n d = l.getD n d := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l✝ : List α
x : α
xs : List α
d✝ : α
n✝ : ℕ
l l' : List α
d : α
n : ℕ
h : n < length l
h' : optParam (n < length (l ++ l')) (_ : n < length (l ++ l'))
⊢ getD (l ++ l') n d = getD l n d

Next tactic:
rw [getD_eq_get _ _ h', get_append _ h, getD_eq_get]
theorem getD_append_right (l l' : List α) (d : α) (n : ℕ) (h : l.length ≤ n) :
    (l ++ l').getD n d = l'.getD (n - l.length) d := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l✝ : List α
x : α
xs : List α
d✝ : α
n✝ : ℕ
l l' : List α
d : α
n : ℕ
h : length l ≤ n
⊢ getD (l ++ l') n d = getD l' (n - length l) d

Next tactic:
cases lt_or_le n (l ++ l').length with
  | inl h' =>
    rw [getD_eq_get (l ++ l') d h', get_append_right, getD_eq_get]
    · rw [length_append] at h'
      exact Nat.sub_lt_left_of_lt_add h h'
    · exact not_lt_of_le h
  | inr h' =>
    rw [getD_eq_default _ _ h', getD_eq_default]
    rwa [le_tsub_iff_left h, ← length_append]
theorem getD_append_right (l l' : List α) (d : α) (n : ℕ) (h : l.length ≤ n) :
    (l ++ l').getD n d = l'.getD (n - l.length) d := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l✝ : List α
x : α
xs : List α
d✝ : α
n✝ : ℕ
l l' : List α
d : α
n : ℕ
h : length l ≤ n
x✝ : n < length (l ++ l') ∨ length (l ++ l') ≤ n
⊢ getD (l ++ l') n d = getD l' (n - length l) d

Next tactic:
cases lt_or_le n (l ++ l').length with
  | inl h' =>
    rw [getD_eq_get (l ++ l') d h', get_append_right, getD_eq_get]
    · rw [length_append] at h'
      exact Nat.sub_lt_left_of_lt_add h h'
    · exact not_lt_of_le h
  | inr h' =>
    rw [getD_eq_default _ _ h', getD_eq_default]
    rwa [le_tsub_iff_left h, ← length_append]
theorem getD_append_right (l l' : List α) (d : α) (n : ℕ) (h : l.length ≤ n) :
    (l ++ l').getD n d = l'.getD (n - l.length) d := by
  cases lt_or_le n (l ++ l').length with
  

Proof state:
case inl
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l✝ : List α
x : α
xs : List α
d✝ : α
n✝ : ℕ
l l' : List α
d : α
n : ℕ
h : length l ≤ n
h' : n < length (l ++ l')
⊢ getD (l ++ l') n d = getD l' (n - length l) d

Next tactic:
| inl h' =>
    rw [getD_eq_get (l ++ l') d h', get_append_right, getD_eq_get]
    · rw [length_append] at h'
      exact Nat.sub_lt_left_of_lt_add h h'
    · exact not_lt_of_le h
theorem getD_append_right (l l' : List α) (d : α) (n : ℕ) (h : l.length ≤ n) :
    (l ++ l').getD n d = l'.getD (n - l.length) d := by
  cases lt_or_le n (l ++ l').length with
  | inl h' =>
    

Proof state:
case inl
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l✝ : List α
x : α
xs : List α
d✝ : α
n✝ : ℕ
l l' : List α
d : α
n : ℕ
h : length l ≤ n
h' : n < length (l ++ l')
⊢ getD (l ++ l') n d = getD l' (n - length l) d

Next tactic:
rw [getD_eq_get (l ++ l') d h', get_append_right, getD_eq_get]