cases Nat.eq_or_lt_of_le hidx2 with
| inl heq =>
  rw [← hgo]
  rw [go_getRef]
  rw [AIG.RefStream.getRef_push_ref_eq']
  . rw [← heq]
    rw [go_denote_mem_prefix]
    . simp
    . simp [Ref.hgate]
  . rw [heq]
| inr =>
  rw [← hgo]
  rw [go_eq_eval_getLsb]
  omega
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
c : BitVec w
assign : α → Bool
curr : Nat
hcurr : curr ≤ w
s : aig.RefStream curr
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1) ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c
      ⋯ =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
no goals