. dsimp
  split
  . refine Nat.le_trans ?_ (by apply go_le_size)
    omega
  . refine Nat.le_trans ?_ (by apply go_le_size)
    apply AIG.LawfulOperator.le_size (f := AIG.mkConstCached)
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefStream w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefStream curr
h✝ : curr < newWidth
⊢ aig.decls.size ≤
    (if hcurr2 : curr < w then
            let s := s.pushRef (input.getRef curr hcurr2);
            go aig w input newWidth (curr + 1) ⋯ s
          else
            let res := aig.mkConstCached false;
            let aig_1 := res.aig;
            let zeroRef := res.ref;
            let_fun hcast := ⋯;
            let input := input.cast hcast;
            let s := s.cast hcast;
            let s := s.pushRef zeroRef;
            go aig_1 w input newWidth (curr + 1) ⋯ s).aig.decls.size

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefStream w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefStream curr
h✝ : ¬curr < newWidth
⊢ aig.decls.size ≤
    (let_fun hcurr := ⋯;
          { aig := aig, stream := hcurr ▸ s }).aig.decls.size
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefStream w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefStream curr
h✝ : ¬curr < newWidth
⊢ aig.decls.size ≤
    (let_fun hcurr := ⋯;
          { aig := aig, stream := hcurr ▸ s }).aig.decls.size