-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/CachedLemmas.lean
theorem denote_mkAtom_cached {aig : AIG α} {hit} :
    aig.cache.get? (.atom v) = some hit
      →
    ⟦aig, ⟨hit.idx, hit.hbound⟩, assign⟧ = ⟦aig.mkAtom v, assign⟧

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
⊢ aig.cache.get? (Decl.atom v) = some hit →
    ⟦assign, { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }⟧ = ⟦assign, aig.mkAtom v⟧

Tactic:
have := hit.hvalid

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
this : aig.decls[hit.idx] = Decl.atom v
⊢ aig.cache.get? (Decl.atom v) = some hit →
    ⟦assign, { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }⟧ = ⟦assign, aig.mkAtom v⟧

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
this : aig.decls[hit.idx] = Decl.atom v
⊢ aig.cache.get? (Decl.atom v) = some hit →
    ⟦assign, { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }⟧ = ⟦assign, aig.mkAtom v⟧

Tactic:
simp only [denote_mkAtom]

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
this : aig.decls[hit.idx] = Decl.atom v
⊢ aig.cache.get? (Decl.atom v) = some hit → ⟦assign, { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }⟧ = assign v

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
this : aig.decls[hit.idx] = Decl.atom v
⊢ aig.cache.get? (Decl.atom v) = some hit →
    (match elem :
        { aig := aig,
                ref :=
                  { gate := hit.idx,
                    hgate := ⋯ } }.aig.decls[{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.ref.gate] with
      | Decl.const b => b
      | Decl.atom v_1 => assign v_1
      | Decl.gate lhs rhs linv rinv =>
        let_fun this := ⋯;
        let lval := denote.go lhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        let rval := denote.go rhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        (lval ^^ linv) && (rval ^^ rinv)) =
      assign v

Tactic:
split <;> simp_all

Result:
no goals

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
this : aig.decls[hit.idx] = Decl.atom v
⊢ aig.cache.get? (Decl.atom v) = some hit → ⟦assign, { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }⟧ = assign v

Tactic:
unfold denote denote.go

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
v : α
assign : α → Bool
aig : AIG α
hit : CacheHit aig.decls (Decl.atom v)
this : aig.decls[hit.idx] = Decl.atom v
⊢ aig.cache.get? (Decl.atom v) = some hit →
    (match elem :
        { aig := aig,
                ref :=
                  { gate := hit.idx,
                    hgate := ⋯ } }.aig.decls[{ aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.ref.gate] with
      | Decl.const b => b
      | Decl.atom v_1 => assign v_1
      | Decl.gate lhs rhs linv rinv =>
        let_fun this := ⋯;
        let lval := denote.go lhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        let rval := denote.go rhs { aig := aig, ref := { gate := hit.idx, hgate := ⋯ } }.aig.decls assign ⋯ ⋯;
        (lval ^^ linv) && (rval ^^ rinv)) =
      assign v