-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/Bitblast/BVExpr/Circuit/Lemmas/Operations/ZeroExtend.lean
theorem go_get_aux (aig : AIG α) (w : Nat) (input : AIG.RefVec aig w) (newWidth curr : Nat)
    (hcurr : curr ≤ newWidth) (s : AIG.RefVec aig curr) :
    ∀ (idx : Nat) (hidx : idx < curr) (hfoo),
        (go aig w input newWidth curr hcurr s).vec.get idx (by omega)
          =
        (s.get idx hidx).cast hfoo

Proof state:
case isTrue.isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ ((s.cast ⋯).get idx ?isTrue.isFalse.hidx).gate = (s.get idx hidx).gate

Tactic:
rw [AIG.RefVec.get_cast]

Result:
case isTrue.isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ ((s.get idx ?isTrue.isFalse.hidx).cast ⋯).gate = (s.get idx hidx).gate

case isTrue.isFalse.hidx
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ idx < curr

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
hfoo : aig.decls.size ≤ (go aig w input newWidth curr hcurr s).aig.decls.size
⊢ idx < newWidth

Tactic:
omega

Result:
no goals

Proof state:
case isTrue.isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ (((s.cast ⋯).push (aig.mkConstCached false).ref).get idx ?isTrue.isFalse.hidx).cast ?isTrue.isFalse.hfoo =
    (s.get idx hidx).cast hfoo✝

case isTrue.isFalse.hidx
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ idx < curr + 1

case isTrue.isFalse.hfoo
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ (aig.mkConstCached false).aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size

Tactic:
rw [AIG.RefVec.get_push_ref_lt]

Result:
case isTrue.isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ ((s.cast ⋯).get idx ?isTrue.isFalse.hidx).cast ?isTrue.isFalse.hfoo = (s.get idx hidx).cast hfoo✝

case isTrue.isFalse.hidx
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ idx < curr

case isTrue.isFalse.hfoo
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ (aig.mkConstCached false).aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size

Proof state:
case isTrue.isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
w : Nat
input : aig.RefVec w
newWidth curr : Nat
hcurr : curr ≤ newWidth
s : aig.RefVec curr
idx : Nat
hidx : idx < curr
res : RefVecEntry α newWidth
h✝¹ : curr < newWidth
h✝ : ¬curr < w
hgo :
  go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
      ((s.cast ⋯).push (aig.mkConstCached false).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).push (aig.mkConstCached false).ref)).aig.decls.size
⊢ ((s.get idx ?isTrue.isFalse.hidx).cast ⋯).gate = (s.get idx hidx).gate

Tactic:
simp

Result:
no goals