. simp only [Array.range, Nat.fold, flip, Array.get_push]
  split
  . next x_lt_n =>
    exfalso
    have h_range_size : (Array.range n).size = n := Array.range_size
    simp only [Array.range, Array.mkEmpty_eq] at h_range_size
    simp only [x_eq_n, Array.mkEmpty_eq, h_range_size, Nat.lt_irrefl] at x_lt_n
  . rw [x_eq_n]
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
no goals