funext ⟨i, hi⟩
case mpr
n m : Nat
ih : ∀ (k : Fin (n ^ m)) (x : Fin m → Fin n), k.decodeFun = x ↔ encodeFun x = k
k✝ : Fin (n ^ (m + 1))
x : Fin (m + 1) → Fin n
ih1 : (encodeFun fun k => x k.succ).decodeFun = fun k => x k.succ
k : Nat
hk : k < n ^ (m + 1)
hnpos : n > 0
h : n * ↑(encodeFun fun k => x k.succ) + ↑(x 0) = k
⊢ (let_fun hn := ⋯;
    fun x =>
    match x with
    | ⟨0, isLt⟩ => ⟨k % n, ⋯⟩
    | ⟨i.succ, hi⟩ =>
      let_fun h := ⋯;
      ⟨k / n, h⟩.decodeFun ⟨i, ⋯⟩) =
    x
case mpr.h
n m : Nat
ih : ∀ (k : Fin (n ^ m)) (x : Fin m → Fin n), k.decodeFun = x ↔ encodeFun x = k
k✝ : Fin (n ^ (m + 1))
x : Fin (m + 1) → Fin n
ih1 : (encodeFun fun k => x k.succ).decodeFun = fun k => x k.succ
k : Nat
hk : k < n ^ (m + 1)
hnpos : n > 0
h : n * ↑(encodeFun fun k => x k.succ) + ↑(x 0) = k
i : Nat
hi : i < m + 1
⊢ (let_fun hn := ⋯;
      fun x =>
      match x with
      | ⟨0, isLt⟩ => ⟨k % n, ⋯⟩
      | ⟨i.succ, hi⟩ =>
        let_fun h := ⋯;
        ⟨k / n, h⟩.decodeFun ⟨i, ⋯⟩)
      ⟨i, hi⟩ =
    x ⟨i, hi⟩