. specialize ih x_lt_n
  simp only [Array.range, Nat.fold, flip, Array.get_push]
  simp only [Array.range, flip] at ih
  split
  . exact ih
  . next x_ge_n =>
    exfalso
    have h_range_size : (Array.range n).size = n := Array.range_size
    simp only [Array.mkEmpty_eq, Array.range, flip] at h_range_size
    simp only [Array.mkEmpty_eq, h_range_size] at x_ge_n
    exact x_ge_n x_lt_n
case inl
x n : Nat
ih : ∀ (h : x < n), (Array.range n)[x] = x
h : x < n + 1
x_lt_n : x < n
⊢ (Array.range (n + 1))[x] = x

case inr
x n : Nat
ih : ∀ (h : x < n), (Array.range n)[x] = x
h : x < n + 1
x_eq_n : x = n
⊢ (Array.range (n + 1))[x] = x
case inr
x n : Nat
ih : ∀ (h : x < n), (Array.range n)[x] = x
h : x < n + 1
x_eq_n : x = n
⊢ (Array.range (n + 1))[x] = x