Theorem: BVExpr.bitblast.blastVar.go_le_size (LeanSAT/Reflect/BVExpr/BitBlast/Impl/Var.lean)

State before:
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
⊢ aig.decls.size ≤ (go w aig idx s a hidx).aig.decls.size
Tactic:
unfold go
State after:
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
⊢ aig.decls.size ≤
    (if hidx : idx < w then
            let res := aig.mkAtomCached (BVBit.mk a ⟨idx, hidx⟩);
            let aig_1 := res.aig;
            let bitRef := res.ref;
            let s := s.cast ⋯;
            let s := s.pushRef bitRef;
            go w aig_1 (idx + 1) s a ⋯
          else
            let_fun hidx := ⋯;
            { aig := aig, stream := hidx ▸ s }).aig.decls.size

State before:
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
⊢ aig.decls.size ≤
    (if hidx : idx < w then
            let res := aig.mkAtomCached (BVBit.mk a ⟨idx, hidx⟩);
            let aig_1 := res.aig;
            let bitRef := res.ref;
            let s := s.cast ⋯;
            let s := s.pushRef bitRef;
            go w aig_1 (idx + 1) s a ⋯
          else
            let_fun hidx := ⋯;
            { aig := aig, stream := hidx ▸ s }).aig.decls.size
Tactic:
split
State after:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤
    (let res := aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩);
          let aig_1 := res.aig;
          let bitRef := res.ref;
          let s := s.cast ⋯;
          let s := s.pushRef bitRef;
          go w aig_1 (idx + 1) s a ⋯).aig.decls.size

case isFalse
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : ¬idx < w
⊢ aig.decls.size ≤
    (let_fun hidx := ⋯;
          { aig := aig, stream := hidx ▸ s }).aig.decls.size

State before:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤
    (let res := aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩);
          let aig_1 := res.aig;
          let bitRef := res.ref;
          let s := s.cast ⋯;
          let s := s.pushRef bitRef;
          go w aig_1 (idx + 1) s a ⋯).aig.decls.size

case isFalse
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : ¬idx < w
⊢ aig.decls.size ≤
    (let_fun hidx := ⋯;
          { aig := aig, stream := hidx ▸ s }).aig.decls.size
Tactic:
. dsimp
  refine Nat.le_trans ?_ (by apply go_le_size)
  apply AIG.LawfulOperator.le_size
State after:
case isFalse
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : ¬idx < w
⊢ aig.decls.size ≤
    (let_fun hidx := ⋯;
          { aig := aig, stream := hidx ▸ s }).aig.decls.size

State before:
case isFalse
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : ¬idx < w
⊢ aig.decls.size ≤
    (let_fun hidx := ⋯;
          { aig := aig, stream := hidx ▸ s }).aig.decls.size
Tactic:
. simp
State after:
no goals

State before:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤
    (let res := aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩);
          let aig_1 := res.aig;
          let bitRef := res.ref;
          let s := s.cast ⋯;
          let s := s.pushRef bitRef;
          go w aig_1 (idx + 1) s a ⋯).aig.decls.size
Tactic:
dsimp
State after:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤
    (go w (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).aig (idx + 1)
            ((s.cast ⋯).pushRef (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).ref) a ⋯).aig.decls.size

State before:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤
    (go w (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).aig (idx + 1)
            ((s.cast ⋯).pushRef (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).ref) a ⋯).aig.decls.size
Tactic:
refine Nat.le_trans ?_ (by apply go_le_size)
State after:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤ (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).aig.decls.size

State before:
case isTrue
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ aig.decls.size ≤ (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).aig.decls.size
Tactic:
apply AIG.LawfulOperator.le_size
State after:
no goals

State before:
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : idx < w
⊢ ?m.9293 ≤
    (go w (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).aig (idx + 1)
            ((s.cast ⋯).pushRef (aig.mkAtomCached (BVBit.mk a ⟨idx, h✝⟩)).ref) a ⋯).aig.decls.size
Tactic:
apply go_le_size
State after:
no goals

State before:
case isFalse
w : Nat
aig : AIG BVBit
idx : Nat
s : aig.RefStream idx
a : Nat
hidx : idx ≤ w
h✝ : ¬idx < w
⊢ aig.decls.size ≤
    (let_fun hidx := ⋯;
          { aig := aig, stream := hidx ▸ s }).aig.decls.size
Tactic:
simp
State after:
no goals