-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/CachedLemmas.lean
theorem mkConstCached_eval_eq_mkConst_eval {aig : AIG α} :
    ⟦aig.mkConstCached val, assign⟧ = ⟦aig.mkConst val, assign⟧

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
⊢ ⟦assign, aig.mkConstCached val⟧ = ⟦assign, aig.mkConst val⟧

Tactic:
simp only [mkConstCached]

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
⊢ ⟦assign,
      match aig.cache.get? (Decl.const val) with
      | some hit =>
        { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ }, ref := { gate := hit.idx, hgate := ⋯ } }
      | none =>
        {
          aig :=
            { decls := aig.decls.push (Decl.const val), cache := Cache.insert aig.decls aig.cache (Decl.const val),
              invariant := ⋯ },
          ref := { gate := aig.decls.size, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

Proof state:
case h_1
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
x✝ : Option (CacheHit aig.decls (Decl.const val))
hit✝ : CacheHit aig.decls (Decl.const val)
heq✝ : aig.cache.get? (Decl.const val) = some hit✝
⊢ ⟦assign,
      { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ }, ref := { gate := hit✝.idx, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

Tactic:
next heq1 =>
rw [denote_mkConst_cached heq1]

Result:
no goals

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
x✝ : Option (CacheHit aig.decls (Decl.const val))
hit✝ : CacheHit aig.decls (Decl.const val)
heq1 : aig.cache.get? (Decl.const val) = some hit✝
⊢ ⟦assign,
      { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ }, ref := { gate := hit✝.idx, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

Tactic:
rw [denote_mkConst_cached heq1]

Result:
no goals

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
⊢ ⟦assign,
      match aig.cache.get? (Decl.const val) with
      | some hit =>
        { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ }, ref := { gate := hit.idx, hgate := ⋯ } }
      | none =>
        {
          aig :=
            { decls := aig.decls.push (Decl.const val), cache := Cache.insert aig.decls aig.cache (Decl.const val),
              invariant := ⋯ },
          ref := { gate := aig.decls.size, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

Tactic:
split

Result:
case h_1
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
x✝ : Option (CacheHit aig.decls (Decl.const val))
hit✝ : CacheHit aig.decls (Decl.const val)
heq✝ : aig.cache.get? (Decl.const val) = some hit✝
⊢ ⟦assign,
      { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ }, ref := { gate := hit✝.idx, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

case h_2
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
x✝ : Option (CacheHit aig.decls (Decl.const val))
heq✝ : aig.cache.get? (Decl.const val) = none
⊢ ⟦assign,
      {
        aig :=
          { decls := aig.decls.push (Decl.const val), cache := Cache.insert aig.decls aig.cache (Decl.const val),
            invariant := ⋯ },
        ref := { gate := aig.decls.size, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

Proof state:
case h_2
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
assign : α → Bool
val : Bool
aig : AIG α
x✝ : Option (CacheHit aig.decls (Decl.const val))
heq✝ : aig.cache.get? (Decl.const val) = none
⊢ ⟦assign,
      {
        aig :=
          { decls := aig.decls.push (Decl.const val), cache := Cache.insert aig.decls aig.cache (Decl.const val),
            invariant := ⋯ },
        ref := { gate := aig.decls.size, hgate := ⋯ } }⟧ =
    ⟦assign, aig.mkConst val⟧

Tactic:
simp [mkConst, denote]

Result:
no goals