apply list_casesOn (fst.comp snd) (Primrec.const _)
  (by apply to₂'; simp[Function.uncurry]; rw[casesOn_eq_uncurry]
      apply list_casesOn (snd.comp $ snd.comp fst) (const _)
        (by unfold Function.uncurry
            apply option_map (list_get?.comp (snd.comp $ fst.comp $ fst.comp fst)
              (Primrec₂.natPair.comp
                (snd.comp $ unpair.comp $ pred.comp $ fst.comp $ unpair.comp $ snd.comp $ fst.comp $ fst.comp $ fst.comp fst)
                (snd.comp $ unpair.comp $ pred.comp $ snd.comp $ unpair.comp $ snd.comp $ fst.comp $ fst.comp $ fst.comp fst)))
              (list_cons.comp₂
                (hf.comp₂
                  (fst.comp₂ $ fst.comp₂ $ fst.comp₂ $ fst.comp₂ $ fst.comp₂ $ Primrec₂.left)
                  (Primrec₂.pair.comp₂
                    (fst.comp₂ $ snd.comp₂ $ fst.comp₂ Primrec₂.left)
                    (fst.comp₂ $ snd.comp₂ Primrec₂.left)))
                (option_iget.comp₂ Primrec₂.right))))
case hf
α : Type u_1
α₁ : Type u_2
α₂ : Type u_3
β : Type u_4
γ : Type u_5
σ : Type u_6
τ : Type u_7
inst✝⁶ : Primcodable α
inst✝⁵ : Primcodable α₁
inst✝⁴ : Primcodable α₂
inst✝³ : Primcodable β
inst✝² : Primcodable γ
inst✝¹ : Primcodable σ
inst✝ : Primcodable τ
f : σ → α × β → γ
hf : Primrec₂ f
⊢ Primrec fun x =>
    List.casesOn x.2.1 (some []) fun a as =>
      Function.uncurry
        (fun head tail =>
          (fun a x_1 =>
              List.casesOn x.2.2 (some []) fun b x_2 =>
                Option.map (fun cs => f x.1.1.1 (a, b) :: cs.iget)
                  (x.1.2.get? (encode (x.1.1.2.unpair.1.pred.unpair.2, x.1.1.2.unpair.2.pred.unpair.2))))
            head tail)
        (a, as)
no goals