have : count p = count (fun i => p (succ i)) + 1 := by
  simp_arith only [count, sum_succ, if_pos h0]; rfl
n : Nat
ih :
  ∀ (p : Fin n → Prop) [inst : DecidablePred p] (k : Fin (count p)) (i : { i // p i }),
    decodeSubtype p k = i ↔ encodeSubtype p i = k
p : Fin (n + 1) → Prop
inst : DecidablePred p
k : Fin (count p)
i : { i // p i }
h : encodeSubtype p i = k
h0 : p 0
⊢ (match ↑k, ⋯ with
    | 0, hk => ⟨0, ⋯⟩
    | k.succ, hk => ⟨⟨↑(decodeSubtype (fun i => p i.succ) ⟨k, ⋯⟩).1 + 1, ⋯⟩, ⋯⟩) =
    i
n : Nat
ih :
  ∀ (p : Fin n → Prop) [inst : DecidablePred p] (k : Fin (count p)) (i : { i // p i }),
    decodeSubtype p k = i ↔ encodeSubtype p i = k
p : Fin (n + 1) → Prop
inst : DecidablePred p
k : Fin (count p)
i : { i // p i }
h : encodeSubtype p i = k
h0 : p 0
this : count p = (count fun i => p i.succ) + 1
⊢ (match ↑k, ⋯ with
    | 0, hk => ⟨0, ⋯⟩
    | k.succ, hk => ⟨⟨↑(decodeSubtype (fun i => p i.succ) ⟨k, ⋯⟩).1 + 1, ⋯⟩, ⋯⟩) =
    i