-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/CachedLemmas.lean
theorem mkAtomCached_decl_eq (aig : AIG α) (var : α) (idx : Nat) {h : idx < aig.decls.size}
    {hbound} :
    (aig.mkAtomCached var).aig.decls[idx]'hbound = aig.decls[idx]

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
⊢ (aig.mkAtomCached var).aig.decls[idx] = aig.decls[idx]

Tactic:
have := mkAtomCached_miss_aig aig hcache

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
⊢ (aig.mkAtomCached var).aig.decls[idx] = aig.decls[idx]

Proof state:
case isTrue
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
h✝ : idx < aig.decls.size
⊢ aig.decls[idx] = aig.decls[idx]

Tactic:
rfl

Result:
no goals

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
⊢ (if h : idx < aig.decls.size then aig.decls[idx] else Decl.atom var) = aig.decls[idx]

Tactic:
split

Result:
case isTrue
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
h✝ : idx < aig.decls.size
⊢ aig.decls[idx] = aig.decls[idx]

case isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
h✝ : ¬idx < aig.decls.size
⊢ aig.decls[idx] = aig.decls[idx]

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
gate : CacheHit aig.decls (Decl.atom var)
hcache : aig.cache.get? (Decl.atom var) = some gate
this : (aig.mkAtomCached var).aig = aig
⊢ (aig.mkAtomCached var).aig.decls[idx] = aig.decls[idx]

Tactic:
simp [this]

Result:
no goals

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
⊢ (aig.mkAtomCached var).aig.decls[idx] = aig.decls[idx]

Tactic:
simp only [this, Array.getElem_push]

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
⊢ (if h : idx < aig.decls.size then aig.decls[idx] else Decl.atom var) = aig.decls[idx]

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
gate : CacheHit aig.decls (Decl.atom var)
hcache : aig.cache.get? (Decl.atom var) = some gate
⊢ (aig.mkAtomCached var).aig.decls[idx] = aig.decls[idx]

Tactic:
have := mkAtomCached_hit_aig aig hcache

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
gate : CacheHit aig.decls (Decl.atom var)
hcache : aig.cache.get? (Decl.atom var) = some gate
this : (aig.mkAtomCached var).aig = aig
⊢ (aig.mkAtomCached var).aig.decls[idx] = aig.decls[idx]

Proof state:
case isFalse
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
var : α
idx : Nat
h : idx < aig.decls.size
hbound : idx < (aig.mkAtomCached var).aig.decls.size
hcache : aig.cache.get? (Decl.atom var) = none
this : (aig.mkAtomCached var).aig.decls = aig.decls.push (Decl.atom var)
h✝ : ¬idx < aig.decls.size
⊢ aig.decls[idx] = aig.decls[idx]

Tactic:
contradiction

Result:
no goals