Theorem: BVExpr.bitblast.blastConst.go_eq_eval_getLsb (LeanSAT/Reflect/BVExpr/BitBlast/Lemmas/Const.lean)

State before:
α : 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),
    curr ≤ idx →
      ⟦{ aig := (go aig curr s c hcurr).aig, ref := (go aig curr s c hcurr).stream.getRef idx hidx1 }, assign⟧ =
        c.getLsb idx
Tactic:
intro idx hidx1 hidx2
State after:
α : 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
⊢ ⟦{ aig := (go aig curr s c hcurr).aig, ref := (go aig curr s c hcurr).stream.getRef idx hidx1 }, assign⟧ =
    c.getLsb idx

State before:
α : 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
⊢ ⟦{ aig := (go aig curr s c hcurr).aig, ref := (go aig curr s c hcurr).stream.getRef idx hidx1 }, assign⟧ =
    c.getLsb idx
Tactic:
generalize hgo : go aig curr s c hcurr = res
State after:
α : 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
hgo : go aig curr s c hcurr = res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx

State before:
α : 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
hgo : go aig curr s c hcurr = res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
unfold go at hgo
State after:
α : 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
hgo :
  (if hidx : curr < w then
      let res := aig.mkConstCached (c.getLsb curr);
      let aig_1 := res.aig;
      let bitRef := res.ref;
      let s := s.cast ⋯;
      let s := s.pushRef bitRef;
      go aig_1 (curr + 1) s c ⋯
    else
      let_fun hidx := ⋯;
      { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx

State before:
α : 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
hgo :
  (if hidx : curr < w then
      let res := aig.mkConstCached (c.getLsb curr);
      let aig_1 := res.aig;
      let bitRef := res.ref;
      let s := s.cast ⋯;
      let s := s.pushRef bitRef;
      go aig_1 (curr + 1) s c ⋯
    else
      let_fun hidx := ⋯;
      { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
split at hgo
State after:
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 :
  (let res := aig.mkConstCached (c.getLsb curr);
    let aig_1 := res.aig;
    let bitRef := res.ref;
    let s := s.cast ⋯;
    let s := s.pushRef bitRef;
    go aig_1 (curr + 1) s c ⋯) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx

case isFalse
α : 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 :
  (let_fun hidx := ⋯;
    { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx

State before:
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 :
  (let res := aig.mkConstCached (c.getLsb curr);
    let aig_1 := res.aig;
    let bitRef := res.ref;
    let s := s.cast ⋯;
    let s := s.pushRef bitRef;
    go aig_1 (curr + 1) s c ⋯) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx

case isFalse
α : 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 :
  (let_fun hidx := ⋯;
    { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
. dsimp at hgo
  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
State after:
case isFalse
α : 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 :
  (let_fun hidx := ⋯;
    { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx

State before:
case isFalse
α : 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 :
  (let_fun hidx := ⋯;
    { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
. omega
State after:
no goals

State before:
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 :
  (let res := aig.mkConstCached (c.getLsb curr);
    let aig_1 := res.aig;
    let bitRef := res.ref;
    let s := s.cast ⋯;
    let s := s.pushRef bitRef;
    go aig_1 (curr + 1) s c ⋯) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
dsimp at hgo
State after:
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

State before:
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
Tactic:
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
State after:
no goals

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
rw [← hgo]
State after:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
                  ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).stream.getRef
            idx hidx1 },
      assign⟧ =
    c.getLsb idx

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
                  ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).stream.getRef
            idx hidx1 },
      assign⟧ =
    c.getLsb idx
Tactic:
rw [go_getRef]
State after:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref).getRef idx ?isTrue.inl.hidx).cast ⋯ },
      assign⟧ =
    c.getLsb idx

case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx < curr + 1

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref).getRef idx ?isTrue.inl.hidx).cast ⋯ },
      assign⟧ =
    c.getLsb idx

case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx < curr + 1
Tactic:
rw [AIG.RefStream.getRef_push_ref_eq']
State after:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (aig.mkConstCached (c.getLsb curr)).ref.cast ⋯ },
      assign⟧ =
    c.getLsb idx

case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx = curr

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (aig.mkConstCached (c.getLsb curr)).ref.cast ⋯ },
      assign⟧ =
    c.getLsb idx

case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx = curr
Tactic:
. rw [← heq]
  rw [go_denote_mem_prefix]
  . simp
  . simp [Ref.hgate]
State after:
case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx = curr

State before:
case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx = curr
Tactic:
. rw [heq]
State after:
no goals

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (aig.mkConstCached (c.getLsb curr)).ref.cast ⋯ },
      assign⟧ =
    c.getLsb idx
Tactic:
rw [← heq]
State after:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (aig.mkConstCached (c.getLsb curr)).ref.cast ⋯ },
      assign⟧ =
    c.getLsb curr

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref := (aig.mkConstCached (c.getLsb curr)).ref.cast ⋯ },
      assign⟧ =
    c.getLsb curr
Tactic:
rw [go_denote_mem_prefix]
State after:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{ aig := (aig.mkConstCached (c.getLsb curr)).aig,
        ref := { gate := ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate, hgate := ?isTrue.inl.hstart } },
      assign⟧ =
    c.getLsb curr

case isTrue.inl.hstart
α : 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
heq : curr = idx
⊢ ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate < (aig.mkConstCached (c.getLsb curr)).aig.decls.size

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{ aig := (aig.mkConstCached (c.getLsb curr)).aig,
        ref := { gate := ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate, hgate := ?isTrue.inl.hstart } },
      assign⟧ =
    c.getLsb curr

case isTrue.inl.hstart
α : 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
heq : curr = idx
⊢ ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate < (aig.mkConstCached (c.getLsb curr)).aig.decls.size
Tactic:
. simp
State after:
case isTrue.inl.hstart
α : 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
heq : curr = idx
⊢ ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate < (aig.mkConstCached (c.getLsb curr)).aig.decls.size

State before:
case isTrue.inl.hstart
α : 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
heq : curr = idx
⊢ ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate < (aig.mkConstCached (c.getLsb curr)).aig.decls.size
Tactic:
. simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.inl
α : 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
heq : curr = idx
⊢ ⟦{ aig := (aig.mkConstCached (c.getLsb curr)).aig,
        ref := { gate := ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate, hgate := ?isTrue.inl.hstart } },
      assign⟧ =
    c.getLsb curr
Tactic:
simp
State after:
no goals

State before:
case isTrue.inl.hstart
α : 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
heq : curr = idx
⊢ ((aig.mkConstCached (c.getLsb curr)).ref.cast ⋯).gate < (aig.mkConstCached (c.getLsb curr)).aig.decls.size
Tactic:
simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.inl.hidx
α : 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
heq : curr = idx
⊢ idx = curr
Tactic:
rw [heq]
State after:
no goals

State before:
case isTrue.inr
α : 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
h✝ : curr < idx
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
rw [← hgo]
State after:
case isTrue.inr
α : 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
h✝ : curr < idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
                  ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).stream.getRef
            idx hidx1 },
      assign⟧ =
    c.getLsb idx

State before:
case isTrue.inr
α : 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
h✝ : curr < idx
⊢ ⟦{
        aig :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
              ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).aig,
        ref :=
          (go (aig.mkConstCached (c.getLsb curr)).aig (curr + 1)
                  ((s.cast ⋯).pushRef (aig.mkConstCached (c.getLsb curr)).ref) c ⋯).stream.getRef
            idx hidx1 },
      assign⟧ =
    c.getLsb idx
Tactic:
rw [go_eq_eval_getLsb]
State after:
case isTrue.inr.a
α : 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
h✝ : curr < idx
⊢ curr + 1 ≤ idx

State before:
case isTrue.inr.a
α : 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
h✝ : curr < idx
⊢ curr + 1 ≤ idx
Tactic:
omega
State after:
no goals

State before:
case isFalse
α : 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 :
  (let_fun hidx := ⋯;
    { aig := aig, stream := hidx ▸ s }) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ = c.getLsb idx
Tactic:
omega
State after:
no goals