unfold go
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
distance : Nat
input : aig.RefStream w
curr : Nat
hcurr : curr ≤ w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
⊢ (go input distance curr hcurr s).getRef idx ⋯ = s.getRef idx hidx
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
distance : Nat
input : aig.RefStream w
curr : Nat
hcurr : curr ≤ w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
⊢ (if hcurr1 : curr < w then
          if hcurr2 : curr < distance % w then
            let ref := input.getRef (w - distance % w + curr) ⋯;
            let s := s.pushRef ref;
            go input distance (curr + 1) ⋯ s
          else
            let ref := input.getRef (curr - distance % w) ⋯;
            let s := s.pushRef ref;
            go input distance (curr + 1) ⋯ s
        else
          let_fun hcurr := ⋯;
          hcurr ▸ s).getRef
      idx ⋯ =
    s.getRef idx hidx