Theorem: BVExpr.bitblast.mkOverflowBit.go_le_size (LeanSAT/Reflect/BVExpr/BitBlast/Impl/Carry.lean)

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
⊢ aig.decls.size ≤ (go aig curr hcurr cin lhs rhs).aig.decls.size
Tactic:
unfold go
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
⊢ aig.decls.size ≤
    (if hidx : curr < a✝ then
            let lin := lhs.getRef curr hidx;
            let rin := rhs.getRef curr hidx;
            let res := mkFullAdderCarry aig { lhs := lin, rhs := rin, cin := cin };
            let_fun this := ⋯;
            let aig_1 := res.aig;
            let carryRef := res.ref;
            let lhs_1 := lhs.cast this;
            let rhs_1 := rhs.cast this;
            go aig_1 (curr + 1) ⋯ carryRef lhs_1 rhs_1
          else { aig := aig, ref := cin }).aig.decls.size

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
⊢ aig.decls.size ≤
    (if hidx : curr < a✝ then
            let lin := lhs.getRef curr hidx;
            let rin := rhs.getRef curr hidx;
            let res := mkFullAdderCarry aig { lhs := lin, rhs := rin, cin := cin };
            let_fun this := ⋯;
            let aig_1 := res.aig;
            let carryRef := res.ref;
            let lhs_1 := lhs.cast this;
            let rhs_1 := rhs.cast this;
            go aig_1 (curr + 1) ⋯ carryRef lhs_1 rhs_1
          else { aig := aig, ref := cin }).aig.decls.size
Tactic:
dsimp
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
⊢ aig.decls.size ≤
    (if hidx : curr < a✝ then
            go (mkFullAdderCarry aig { lhs := lhs.getRef curr hidx, rhs := rhs.getRef curr hidx, cin := cin }).aig
              (curr + 1) ⋯
              (mkFullAdderCarry aig { lhs := lhs.getRef curr hidx, rhs := rhs.getRef curr hidx, cin := cin }).ref
              (lhs.cast ⋯) (rhs.cast ⋯)
          else { aig := aig, ref := cin }).aig.decls.size

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
⊢ aig.decls.size ≤
    (if hidx : curr < a✝ then
            go (mkFullAdderCarry aig { lhs := lhs.getRef curr hidx, rhs := rhs.getRef curr hidx, cin := cin }).aig
              (curr + 1) ⋯
              (mkFullAdderCarry aig { lhs := lhs.getRef curr hidx, rhs := rhs.getRef curr hidx, cin := cin }).ref
              (lhs.cast ⋯) (rhs.cast ⋯)
          else { aig := aig, ref := cin }).aig.decls.size
Tactic:
split
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : curr < a✝
⊢ aig.decls.size ≤
    (go (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig (curr + 1) ⋯
            (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).ref (lhs.cast ⋯)
            (rhs.cast ⋯)).aig.decls.size

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ { aig := aig, ref := cin }.aig.decls.size

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : curr < a✝
⊢ aig.decls.size ≤
    (go (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig (curr + 1) ⋯
            (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).ref (lhs.cast ⋯)
            (rhs.cast ⋯)).aig.decls.size

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ { aig := aig, ref := cin }.aig.decls.size
Tactic:
. refine Nat.le_trans ?_ (by apply go_le_size)
  apply AIG.LawfulOperator.le_size (f := mkFullAdderCarry)
State after:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ { aig := aig, ref := cin }.aig.decls.size

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ { aig := aig, ref := cin }.aig.decls.size
Tactic:
. dsimp
  omega
State after:
no goals

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : curr < a✝
⊢ aig.decls.size ≤
    (go (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig (curr + 1) ⋯
            (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).ref (lhs.cast ⋯)
            (rhs.cast ⋯)).aig.decls.size
Tactic:
refine Nat.le_trans ?_ (by apply go_le_size)
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : curr < a✝
⊢ aig.decls.size ≤
    (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig.decls.size

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : curr < a✝
⊢ aig.decls.size ≤
    (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig.decls.size
Tactic:
apply AIG.LawfulOperator.le_size (f := mkFullAdderCarry)
State after:
no goals

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : curr < a✝
⊢ ?m.8987 ≤
    (go (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig (curr + 1) ⋯
            (mkFullAdderCarry aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).ref (lhs.cast ⋯)
            (rhs.cast ⋯)).aig.decls.size
Tactic:
apply go_le_size
State after:
no goals

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ { aig := aig, ref := cin }.aig.decls.size
Tactic:
dsimp
State after:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ aig.decls.size

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
curr a✝ : Nat
hcurr : curr ≤ a✝
aig : AIG α
cin : aig.Ref
lhs rhs : aig.RefStream a✝
h✝ : ¬curr < a✝
⊢ aig.decls.size ≤ aig.decls.size
Tactic:
omega
State after:
no goals