internlm/Lean-Github huggingface dataset:
Theorem: AIG.RefStream.ite.go_decl_eq
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀ (idx : Nat) (h1 : idx < aig.decls.size) (h2 : idx < res.aig.decls.size), res.aig.decls[idx] = aig.decls[idx]
Tactic:
rw [← hgo]
Proof state after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀ (idx : Nat) (h1 : idx < aig.decls.size)
    (h2 :
      idx <
        (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
                { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
                ((s.cast ⋯).pushRef
                  (aig.mkIfCached
                      { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size),
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
              { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
              ((s.cast ⋯).pushRef
                (aig.mkIfCached
                    { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls[idx] =
      aig.decls[idx]
Theorem: AIG.RefStream.ite.go_decl_eq
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀ (idx : Nat) (h1 : idx < aig.decls.size)
    (h2 :
      idx <
        (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
                { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
                ((s.cast ⋯).pushRef
                  (aig.mkIfCached
                      { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size),
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
              { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
              ((s.cast ⋯).pushRef
                (aig.mkIfCached
                    { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls[idx] =
      aig.decls[idx]
Tactic:
intro idx h1 h2
Proof state after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
idx : Nat
h1 : idx < aig.decls.size
h2 :
  idx <
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size
⊢ (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls[idx] =
    aig.decls[idx]
Theorem: AIG.RefStream.ite.go_decl_eq
Proof state before:
case isTrue.h2
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
idx : Nat
h1 : idx < aig.decls.size
h2 :
  idx <
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size
⊢ idx < (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig.decls.size
Tactic:
apply AIG.LawfulOperator.lt_size_of_lt_aig_size (f := AIG.mkIfCached)
Proof state after:
case isTrue.h2.h
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
idx : Nat
h1 : idx < aig.decls.size
h2 :
  idx <
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size
⊢ idx < aig.decls.size
Theorem: AIG.RefStream.ite.go_decl_eq
Proof state before:
case isTrue.h2.h
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
idx : Nat
h1 : idx < aig.decls.size
h2 :
  idx <
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size
⊢ idx < aig.decls.size
Tactic:
assumption
Proof state after:
no goals
Theorem: AIG.RefStream.ite.go_decl_eq
Proof state before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
res : RefStreamEntry α w
h✝ : ¬curr < w
hgo :
  (let_fun this := ⋯;
    { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (idx : Nat) (h1 : idx < aig.decls.size) (h2 : idx < res.aig.decls.size), res.aig.decls[idx] = aig.decls[idx]
Tactic:
simp [← hgo]
Proof state after:
no goals
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
hfoo : aig.decls.size ≤ (go aig curr hcurr discr lhs rhs s).aig.decls.size
⊢ idx < w
Tactic:
omega
Proof state after:
no goals
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
⊢ ∀ (idx : Nat) (hidx : idx < curr) (hfoo : aig.decls.size ≤ (go aig curr hcurr discr lhs rhs s).aig.decls.size),
    (go aig curr hcurr discr lhs rhs s).stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
intro idx hidx
Proof state after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
⊢ ∀ (hfoo : aig.decls.size ≤ (go aig curr hcurr discr lhs rhs s).aig.decls.size),
    (go aig curr hcurr discr lhs rhs s).stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
⊢ ∀ (hfoo : aig.decls.size ≤ (go aig curr hcurr discr lhs rhs s).aig.decls.size),
    (go aig curr hcurr discr lhs rhs s).stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
generalize hgo : go aig curr hcurr discr lhs rhs s = res
Proof state after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
hgo : go aig curr hcurr discr lhs rhs s = res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
hgo : go aig curr hcurr discr lhs rhs s = res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
unfold go at hgo
Proof state after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
hgo :
  (if hcurr : curr < w then
      let input := { discr := discr, lhs := lhs.getRef curr hcurr, rhs := rhs.getRef curr hcurr };
      let res := aig.mkIfCached input;
      let aig_1 := res.aig;
      let ref := res.ref;
      let_fun this := ⋯;
      let discr_1 := discr.cast this;
      let lhs_1 := lhs.cast this;
      let rhs_1 := rhs.cast this;
      let s := s.cast this;
      let s := s.pushRef ref;
      go aig_1 (curr + 1) ⋯ discr_1 lhs_1 rhs_1 s
    else
      let_fun this := ⋯;
      { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
hgo :
  (if hcurr : curr < w then
      let input := { discr := discr, lhs := lhs.getRef curr hcurr, rhs := rhs.getRef curr hcurr };
      let res := aig.mkIfCached input;
      let aig_1 := res.aig;
      let ref := res.ref;
      let_fun this := ⋯;
      let discr_1 := discr.cast this;
      let lhs_1 := lhs.cast this;
      let rhs_1 := rhs.cast this;
      let s := s.cast this;
      let s := s.pushRef ref;
      go aig_1 (curr + 1) ⋯ discr_1 lhs_1 rhs_1 s
    else
      let_fun this := ⋯;
      { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
split at hgo
Proof state after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  (let input := { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ };
    let res := aig.mkIfCached input;
    let aig_1 := res.aig;
    let ref := res.ref;
    let_fun this := ⋯;
    let discr_1 := discr.cast this;
    let lhs_1 := lhs.cast this;
    let rhs_1 := rhs.cast this;
    let s := s.cast this;
    let s := s.pushRef ref;
    go aig_1 (curr + 1) ⋯ discr_1 lhs_1 rhs_1 s) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : ¬curr < w
hgo :
  (let_fun this := ⋯;
    { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  (let input := { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ };
    let res := aig.mkIfCached input;
    let aig_1 := res.aig;
    let ref := res.ref;
    let_fun this := ⋯;
    let discr_1 := discr.cast this;
    let lhs_1 := lhs.cast this;
    let rhs_1 := rhs.cast this;
    let s := s.cast this;
    let s := s.pushRef ref;
    go aig_1 (curr + 1) ⋯ discr_1 lhs_1 rhs_1 s) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : ¬curr < w
hgo :
  (let_fun this := ⋯;
    { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
. dsimp at hgo
  rw [← hgo]
  intros
  rw [go_getRef_aux]
  rw [AIG.RefStream.getRef_push_ref_lt]
  . simp only [Ref.cast, Ref.mk.injEq]
    rw [AIG.RefStream.getRef_cast]
    . simp
    . assumption
  . apply go_le_size
Proof state after:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : ¬curr < w
hgo :
  (let_fun this := ⋯;
    { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : ¬curr < w
hgo :
  (let_fun this := ⋯;
    { aig := aig, stream := this ▸ s }) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
. dsimp at hgo
  rw [← hgo]
  simp only [Nat.le_refl, getRef, Ref_cast', Ref.mk.injEq, true_implies]
  congr
  . omega
  . simp
Proof state after:
no goals
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  (let input := { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ };
    let res := aig.mkIfCached input;
    let aig_1 := res.aig;
    let ref := res.ref;
    let_fun this := ⋯;
    let discr_1 := discr.cast this;
    let lhs_1 := lhs.cast this;
    let rhs_1 := rhs.cast this;
    let s := s.cast this;
    let s := s.pushRef ref;
    go aig_1 (curr + 1) ⋯ discr_1 lhs_1 rhs_1 s) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
dsimp at hgo
Proof state after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀ (hfoo : aig.decls.size ≤ res.aig.decls.size), res.stream.getRef idx ⋯ = (s.getRef idx hidx).cast hfoo
Tactic:
rw [← hgo]
Proof state after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀
    (hfoo :
      aig.decls.size ≤
        (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
                { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
                ((s.cast ⋯).pushRef
                  (aig.mkIfCached
                      { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size),
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
              { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
              ((s.cast ⋯).pushRef
                (aig.mkIfCached
                    { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).stream.getRef
        idx ⋯ =
      (s.getRef idx hidx).cast hfoo
Theorem: AIG.RefStream.ite.go_getRef_aux
Proof state before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
⊢ ∀
    (hfoo :
      aig.decls.size ≤
        (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
                { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
                ((s.cast ⋯).pushRef
                  (aig.mkIfCached
                      { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size),
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
              { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
              ((s.cast ⋯).pushRef
                (aig.mkIfCached
                    { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).stream.getRef
        idx ⋯ =
      (s.getRef idx hidx).cast hfoo
Tactic:
intros
Proof state after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
w : Nat
aig : AIG α
curr : Nat
hcurr : curr ≤ w
discr : aig.Ref
lhs rhs : aig.RefStream w
s : aig.RefStream curr
idx : Nat
hidx : idx < curr
res : RefStreamEntry α w
h✝ : curr < w
hgo :
  go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
      { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
      ((s.cast ⋯).pushRef
        (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref) =
    res
hfoo✝ :
  aig.decls.size ≤
    (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).aig.decls.size
⊢ (go (aig.mkIfCached { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).aig (curr + 1) ⋯
            { gate := discr.gate, hgate := ⋯ } (lhs.cast ⋯) (rhs.cast ⋯)
            ((s.cast ⋯).pushRef
              (aig.mkIfCached
                  { discr := discr, lhs := lhs.getRef curr h✝, rhs := rhs.getRef curr h✝ }).ref)).stream.getRef
      idx ⋯ =
    (s.getRef idx hidx).cast hfoo✝