Lean: define the classical step through its partial recursive form
When a construction must later be shown computable in an oracle, define the classical step as pget (G a (decide Q1) (decide Q2)) a. Here G : St -> Bool -> Bool -> Part St is partial recursive, Q1, Q2 are the oracle questions, and pget p d := if h : p.Dom then p.get h else d (classical). Then the oracle proof is one application of a 'primitive recursion with a partial step, correct along the sequence' lemma. It needs only step a ∈ G a ..., which holds once an invariant gives Dom. Partrec has no cond/option_casesOn for partial branches. Avoid branching on partial computations: make the partial part uniform, e.g. evaluate gsp ... (bif isSplitLevel then ρ else []), where gsp [] = some [], then map a *computable* post-processing over it.
Mathlib v4.35.0 / v4.36.0-rc2:
Partrec.conddoes exist. It is in Mathlib/Computability/RE.lean, not Partrec.lean:Computable c → Partrec f → Partrec g → Partrec fun a => bif c a then f a else g a, withf g : α →. σ. So branching on a computable Bool between two partial branches is available. The same file also hasPartrec.sumCasesOn(computablef : α → β ⊕ γ,Partrec₂branches).Partrec.option_casesOnreally does not exist; onlyComputable.option_casesOndoes.