internlm/Lean-Github huggingface dataset:
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := aig, ref := lhs.getRef idx hidx1 }, assign⟧.xor
      (⟦{ aig := aig, ref := rhs.getRef idx hidx1 }, assign⟧.xor (BitVec.carry idx lhsExpr rhsExpr false))
Tactic:
next hlt =>
cases Nat.eq_or_lt_of_le hidx2 with
| inl heq =>
  rw [← hgo]
  rw [go_getRef (hidx := by omega)]
  rw [AIG.RefStream.getRef_push_ref_eq' (hidx := by rw [heq])]
  simp only [← heq]
  rw [go_denote_mem_prefix]
  . unfold mkFullAdder
    simp [hcin]
  . simp only [Ref_cast']
    apply Ref.hgate
| inr hlt =>
  rw [← hgo]
  rw [go_eq_eval_getLsb (lhsExpr := lhsExpr) (rhsExpr := rhsExpr) (curr := curr + 1)]
  . rw [mkFullAdder_denote_mem_prefix]
    rw [mkFullAdder_denote_mem_prefix]
    . simp
    . simp [Ref.hgate]
    . simp [Ref.hgate]
  . intro idx hidx
    rw [mkFullAdder_denote_mem_prefix]
    rw [← hleft idx hidx]
    . simp
    . simp [Ref.hgate]
  . intro idx hidx
    rw [mkFullAdder_denote_mem_prefix]
    rw [← hright idx hidx]
    . simp
    . simp [Ref.hgate]
  . unfold mkFullAdder
    simp only [Ref_cast', id_eq, Int.reduceNeg, denote_projected_entry, denote_mkFullAdderCarry,
      FullAdderInput.lhs_cast, FullAdderInput.rhs_cast, FullAdderInput.cin_cast,
      BitVec.carry_succ]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := mkFullAdderOut)]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := mkFullAdderOut)]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := mkFullAdderOut)]
    rw [hleft, hright, hcin]
    simp [_root_.Bool.atLeastTwo_eq_halfAdder]
  . omega
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
⊢ ⟦{ aig := res.aig, ref := res.stream.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := aig, ref := lhs.getRef idx hidx1 }, assign⟧.xor
      (⟦{ aig := aig, ref := rhs.getRef idx hidx1 }, assign⟧.xor (BitVec.carry idx lhsExpr rhsExpr false))
Tactic:
cases Nat.eq_or_lt_of_le hidx2 with
| inl heq =>
  rw [← hgo]
  rw [go_getRef (hidx := by omega)]
  rw [AIG.RefStream.getRef_push_ref_eq' (hidx := by rw [heq])]
  simp only [← heq]
  rw [go_denote_mem_prefix]
  . unfold mkFullAdder
    simp [hcin]
  . simp only [Ref_cast']
    apply Ref.hgate
| inr hlt =>
  rw [← hgo]
  rw [go_eq_eval_getLsb (lhsExpr := lhsExpr) (rhsExpr := rhsExpr) (curr := curr + 1)]
  . rw [mkFullAdder_denote_mem_prefix]
    rw [mkFullAdder_denote_mem_prefix]
    . simp
    . simp [Ref.hgate]
    . simp [Ref.hgate]
  . intro idx hidx
    rw [mkFullAdder_denote_mem_prefix]
    rw [← hleft idx hidx]
    . simp
    . simp [Ref.hgate]
  . intro idx hidx
    rw [mkFullAdder_denote_mem_prefix]
    rw [← hright idx hidx]
    . simp
    . simp [Ref.hgate]
  . unfold mkFullAdder
    simp only [Ref_cast', id_eq, Int.reduceNeg, denote_projected_entry, denote_mkFullAdderCarry,
      FullAdderInput.lhs_cast, FullAdderInput.rhs_cast, FullAdderInput.cin_cast,
      BitVec.carry_succ]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := mkFullAdderOut)]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := mkFullAdderOut)]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := mkFullAdderOut)]
    rw [hleft, hright, hcin]
    simp [_root_.Bool.atLeastTwo_eq_halfAdder]
  . omega
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inl.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
heq : curr = idx
⊢ ((mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out.cast ⋯).gate <
    (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig.decls.size
Tactic:
. simp only [Ref_cast']
  apply Ref.hgate
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig✝ : AIG α
curr : Nat
hcurr✝ : curr ≤ w
cin✝ : aig✝.Ref
s✝ : aig✝.RefStream curr
lhs✝ rhs✝ : aig✝.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig✝, ref := lhs✝.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig✝, ref := rhs✝.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig✝, ref := cin✝ }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig✝ { lhs := lhs✝.getRef curr hlt, rhs := rhs✝.getRef curr hlt, cin := cin✝ }).aig (curr + 1) ⋯
      (mkFullAdder aig✝ { lhs := lhs✝.getRef curr hlt, rhs := rhs✝.getRef curr hlt, cin := cin✝ }).cout
      ((s✝.cast ⋯).pushRef
        (mkFullAdder aig✝ { lhs := lhs✝.getRef curr hlt, rhs := rhs✝.getRef curr hlt, cin := cin✝ }).out)
      (lhs✝.cast ⋯) (rhs✝.cast ⋯) =
    res
heq : curr = idx
aig : AIG α
hcurr : curr + 1 ≤ w
cin : aig.Ref
s : aig.RefStream (curr + 1)
lhs rhs : aig.RefStream w
⊢ idx < curr + 1
Tactic:
omega
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s✝ : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s✝.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
heq : curr = idx
s : (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig.RefStream curr
ref : (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig.Ref
⊢ idx = curr
Tactic:
rw [heq]
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inl
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
heq : curr = idx
⊢ ⟦{
        aig :=
          (let res := mkFullAdderOut aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin };
            let aig_1 := res.aig;
            let outRef := res.ref;
            let_fun haig1 := ⋯;
            let input := { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }.cast haig1;
            let res_1 := mkFullAdderCarry aig_1 input;
            let aig_2 := res_1.aig;
            let carryRef := res_1.ref;
            let_fun haig2 := ⋯;
            let outRef := outRef.cast haig2;
            let_fun hle := ⋯;
            { aig := aig_2, out := outRef, cout := carryRef, hle := hle }).aig,
        ref :=
          {
            gate :=
              ((let res := mkFullAdderOut aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin };
                      let aig_1 := res.aig;
                      let outRef := res.ref;
                      let_fun haig1 := ⋯;
                      let input := { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }.cast haig1;
                      let res_1 := mkFullAdderCarry aig_1 input;
                      let aig_2 := res_1.aig;
                      let carryRef := res_1.ref;
                      let_fun haig2 := ⋯;
                      let outRef := outRef.cast haig2;
                      let_fun hle := ⋯;
                      { aig := aig_2, out := outRef, cout := carryRef, hle := hle }).out.cast
                  ⋯).gate,
            hgate := ?inl.hstart } },
      assign⟧ =
    ⟦{ aig := aig, ref := lhs.getRef curr ⋯ }, assign⟧.xor
      (⟦{ aig := aig, ref := rhs.getRef curr ⋯ }, assign⟧.xor (BitVec.carry curr lhsExpr rhsExpr false))
Tactic:
simp [hcin]
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inl.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
heq : curr = idx
⊢ ((mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out.cast ⋯).gate <
    (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig.decls.size
Tactic:
simp only [Ref_cast']
Proof state after:
case inl.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
heq : curr = idx
⊢ (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out.gate <
    (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig.decls.size
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inl.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).cout
      ((s.cast ⋯).pushRef (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
heq : curr = idx
⊢ (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).out.gate <
    (mkFullAdder aig { lhs := lhs.getRef curr hlt, rhs := rhs.getRef curr hlt, cin := cin }).aig.decls.size
Tactic:
apply Ref.hgate
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inr.a
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).cout
      ((s.cast ⋯).pushRef
        (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
hlt : curr < idx
⊢ curr + 1 ≤ idx
Tactic:
. omega
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inr.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).cout
      ((s.cast ⋯).pushRef
        (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
hlt : curr < idx
⊢ ((lhs.cast ⋯).getRef idx hidx1).gate < aig.decls.size

case inr.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).cout
      ((s.cast ⋯).pushRef
        (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
hlt : curr < idx
⊢ ((lhs.cast ⋯).getRef idx hidx1).gate < aig.decls.size
Tactic:
. simp [Ref.hgate]
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).cout
      ((s.cast ⋯).pushRef
        (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
hlt : curr < idx
⊢ ⟦{ aig := aig, ref := { gate := ((lhs.cast ⋯).getRef idx hidx1).gate, hgate := ?inr.hstart } }, assign⟧.xor
      (⟦{ aig := aig, ref := { gate := ((rhs.cast ⋯).getRef idx hidx1).gate, hgate := ?inr.hstart } }, assign⟧.xor
        (BitVec.carry idx lhsExpr rhsExpr false)) =
    ⟦{ aig := aig, ref := lhs.getRef idx hidx1 }, assign⟧.xor
      (⟦{ aig := aig, ref := rhs.getRef idx hidx1 }, assign⟧.xor (BitVec.carry idx lhsExpr rhsExpr false))
Tactic:
simp
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inr.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).cout
      ((s.cast ⋯).pushRef
        (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
hlt : curr < idx
⊢ ((rhs.cast ⋯).getRef idx hidx1).gate < aig.decls.size
Tactic:
simp [Ref.hgate]
Proof state after:
no goals
Theorem: BVExpr.bitblast.blastAdd.go_eq_eval_getLsb
Proof state before:
case inr.hstart
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
cin : aig.Ref
s : aig.RefStream curr
lhs rhs : aig.RefStream w
assign : α → Bool
lhsExpr rhsExpr : BitVec w
hleft : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := lhs.getRef idx hidx }, assign⟧ = lhsExpr.getLsb idx
hright : ∀ (idx : Nat) (hidx : idx < w), ⟦{ aig := aig, ref := rhs.getRef idx hidx }, assign⟧ = rhsExpr.getLsb idx
hcin : ⟦{ aig := aig, ref := cin }, assign⟧ = BitVec.carry curr lhsExpr rhsExpr false
idx : Nat
hidx1 : idx < w
hidx2 : curr ≤ idx
res : RefStreamEntry α w
hlt✝ : curr < w
hgo :
  go (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).aig (curr + 1) ⋯
      (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).cout
      ((s.cast ⋯).pushRef
        (mkFullAdder aig { lhs := lhs.getRef curr hlt✝, rhs := rhs.getRef curr hlt✝, cin := cin }).out)
      (lhs.cast ⋯) (rhs.cast ⋯) =
    res
hlt : curr < idx
⊢ ((lhs.cast ⋯).getRef idx hidx1).gate < aig.decls.size
Tactic:
simp [Ref.hgate]
Proof state after:
no goals