Theorem: BVExpr.bitblast.blastZeroExtend.go_le_size (LeanSAT/Reflect/BVExpr/BitBlast/Impl/ZeroExtend.lean)

State before:
α : 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
⊢ aig.decls.size ≤ (go aig w input newWidth curr hcurr s).aig.decls.size
Tactic:
unfold go
State after:
α : 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
⊢ aig.decls.size ≤
    (if hcurr1 : curr < newWidth then
            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
          else
            let_fun hcurr := ⋯;
            { aig := aig, stream := hcurr ▸ s }).aig.decls.size

State before:
α : 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
⊢ aig.decls.size ≤
    (if hcurr1 : curr < newWidth then
            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
          else
            let_fun hcurr := ⋯;
            { aig := aig, stream := hcurr ▸ s }).aig.decls.size
Tactic:
split
State after:
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

State before:
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
Tactic:
. 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)
State after:
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

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

State before:
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
Tactic:
dsimp
State after:
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 go aig w input newWidth (curr + 1) ⋯ (s.pushRef (input.getRef curr hcurr2))
          else
            go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
              ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size

State before:
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 go aig w input newWidth (curr + 1) ⋯ (s.pushRef (input.getRef curr hcurr2))
          else
            go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
              ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size
Tactic:
split
State after:
case isTrue.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
h✝ : curr < w
⊢ aig.decls.size ≤ (go aig w input newWidth (curr + 1) ⋯ (s.pushRef (input.getRef curr h✝))).aig.decls.size

case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size

State before:
case isTrue.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
h✝ : curr < w
⊢ aig.decls.size ≤ (go aig w input newWidth (curr + 1) ⋯ (s.pushRef (input.getRef curr h✝))).aig.decls.size

case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size
Tactic:
. refine Nat.le_trans ?_ (by apply go_le_size)
  omega
State after:
case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size

State before:
case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size
Tactic:
. refine Nat.le_trans ?_ (by apply go_le_size)
  apply AIG.LawfulOperator.le_size (f := AIG.mkConstCached)
State after:
no goals

State before:
case isTrue.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
h✝ : curr < w
⊢ aig.decls.size ≤ (go aig w input newWidth (curr + 1) ⋯ (s.pushRef (input.getRef curr h✝))).aig.decls.size
Tactic:
refine Nat.le_trans ?_ (by apply go_le_size)
State after:
case isTrue.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
h✝ : curr < w
⊢ aig.decls.size ≤ aig.decls.size

State before:
case isTrue.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
h✝ : curr < w
⊢ aig.decls.size ≤ aig.decls.size
Tactic:
omega
State after:
no goals

State before:
α : 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
h✝ : curr < w
⊢ ?m.16246 ≤ (go aig w input newWidth (curr + 1) ⋯ (s.pushRef (input.getRef curr h✝))).aig.decls.size
Tactic:
apply go_le_size
State after:
no goals

State before:
case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size
Tactic:
refine Nat.le_trans ?_ (by apply go_le_size)
State after:
case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤ (aig.mkConstCached false).aig.decls.size

State before:
case isTrue.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
h✝ : ¬curr < w
⊢ aig.decls.size ≤ (aig.mkConstCached false).aig.decls.size
Tactic:
apply AIG.LawfulOperator.le_size (f := AIG.mkConstCached)
State after:
no goals

State before:
α : 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
h✝ : ¬curr < w
⊢ ?m.16374 ≤
    (go (aig.mkConstCached false).aig w (input.cast ⋯) newWidth (curr + 1) ⋯
            ((s.cast ⋯).pushRef (aig.mkConstCached false).ref)).aig.decls.size
Tactic:
apply go_le_size
State after:
no goals

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