-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/CachedLemmas.lean
theorem mkGateCached.go_decl_eq (aig : AIG α) (input : GateInput aig) :
    ∀ (idx : Nat) (h1) (h2), (go aig input).aig.decls[idx]'h1 = aig.decls[idx]'h2

Proof state:
case h_2.h_9.isTrue
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
input : aig.GateInput
res : Entrypoint α
x✝¹⁰ : Option (CacheHit aig.decls (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv))
heq✝ : aig.cache.get? (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv) = none
x✝⁹ x✝⁸ : Decl α
linv✝ rinv✝ : Bool
x✝⁷ : aig.decls[input.lhs.ref.gate] = Decl.const true → input.lhs.inv = true → False
x✝⁶ : aig.decls[input.lhs.ref.gate] = Decl.const false → input.lhs.inv = false → False
x✝⁵ : aig.decls[input.rhs.ref.gate] = Decl.const true → input.rhs.inv = true → False
x✝⁴ : aig.decls[input.rhs.ref.gate] = Decl.const false → input.rhs.inv = false → False
x✝³ : aig.decls[input.lhs.ref.gate] = Decl.const true → input.lhs.inv = false → input.rhs.inv = false → False
x✝² : aig.decls[input.lhs.ref.gate] = Decl.const false → input.lhs.inv = true → input.rhs.inv = false → False
x✝¹ : aig.decls[input.rhs.ref.gate] = Decl.const true → input.lhs.inv = false → input.rhs.inv = false → False
x✝ : aig.decls[input.rhs.ref.gate] = Decl.const false → input.lhs.inv = false → input.rhs.inv = true → False
h✝ : (input.lhs.ref.gate == input.rhs.ref.gate && input.lhs.inv == false && input.rhs.inv == false) = true
hres :
  { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
      ref := { gate := input.lhs.ref.gate, hgate := ⋯ } } =
    res
idx✝ : Nat
h1✝ :
  idx✝ <
    { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
            ref := { gate := input.lhs.ref.gate, hgate := ⋯ } }.aig.decls.size
h2✝ : idx✝ < aig.decls.size
⊢ { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
            ref := { gate := input.lhs.ref.gate, hgate := ⋯ } }.aig.decls[idx✝] =
    aig.decls[idx✝]

Tactic:
simp

Result:
no goals

Proof state:
case h_2.h_4
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
input : aig.GateInput
res : Entrypoint α
x✝⁴ : Option (CacheHit aig.decls (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv))
heq✝² : aig.cache.get? (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv) = none
x✝³ x✝² : Decl α
linv✝ rinv✝ : Bool
heq✝¹ : aig.decls[input.rhs.ref.gate] = Decl.const false
heq✝ : input.rhs.inv = false
x✝¹ : aig.decls[input.lhs.ref.gate] = Decl.const true → input.lhs.inv = true → False
x✝ : aig.decls[input.lhs.ref.gate] = Decl.const false → input.lhs.inv = false → False
hres : { decls := aig.decls, cache := aig.cache, invariant := ⋯ }.mkConstCached false = res
⊢ ∀ (idx : Nat) (h1 : idx < res.aig.decls.size) (h2 : idx < aig.decls.size), res.aig.decls[idx] = aig.decls[idx]

Tactic:
rw [← hres]

Result:
case h_2.h_4
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
input : aig.GateInput
res : Entrypoint α
x✝⁴ : Option (CacheHit aig.decls (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv))
heq✝² : aig.cache.get? (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv) = none
x✝³ x✝² : Decl α
linv✝ rinv✝ : Bool
heq✝¹ : aig.decls[input.rhs.ref.gate] = Decl.const false
heq✝ : input.rhs.inv = false
x✝¹ : aig.decls[input.lhs.ref.gate] = Decl.const true → input.lhs.inv = true → False
x✝ : aig.decls[input.lhs.ref.gate] = Decl.const false → input.lhs.inv = false → False
hres : { decls := aig.decls, cache := aig.cache, invariant := ⋯ }.mkConstCached false = res
⊢ ∀ (idx : Nat)
    (h1 : idx < ({ decls := aig.decls, cache := aig.cache, invariant := ⋯ }.mkConstCached false).aig.decls.size)
    (h2 : idx < aig.decls.size),
    ({ decls := aig.decls, cache := aig.cache, invariant := ⋯ }.mkConstCached false).aig.decls[idx] = aig.decls[idx]

Proof state:
case h_2.h_7
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
input : aig.GateInput
res : Entrypoint α
x✝⁴ : Option (CacheHit aig.decls (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv))
heq✝³ : aig.cache.get? (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv) = none
x✝³ x✝² : Decl α
linv✝ rinv✝ : Bool
heq✝² : aig.decls[input.rhs.ref.gate] = Decl.const true
heq✝¹ : input.lhs.inv = false
heq✝ : input.rhs.inv = false
x✝¹ : aig.decls[input.lhs.ref.gate] = Decl.const false → False
x✝ : aig.decls[input.lhs.ref.gate] = Decl.const true → False
hres :
  { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
      ref := { gate := input.lhs.ref.gate, hgate := ⋯ } } =
    res
⊢ ∀ (idx : Nat)
    (h1 :
      idx <
        { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
                ref := { gate := input.lhs.ref.gate, hgate := ⋯ } }.aig.decls.size)
    (h2 : idx < aig.decls.size),
    { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
              ref := { gate := input.lhs.ref.gate, hgate := ⋯ } }.aig.decls[idx] =
      aig.decls[idx]

Tactic:
intros

Result:
case h_2.h_7
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig : AIG α
input : aig.GateInput
res : Entrypoint α
x✝⁴ : Option (CacheHit aig.decls (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv))
heq✝³ : aig.cache.get? (Decl.gate input.lhs.ref.gate input.rhs.ref.gate input.lhs.inv input.rhs.inv) = none
x✝³ x✝² : Decl α
linv✝ rinv✝ : Bool
heq✝² : aig.decls[input.rhs.ref.gate] = Decl.const true
heq✝¹ : input.lhs.inv = false
heq✝ : input.rhs.inv = false
x✝¹ : aig.decls[input.lhs.ref.gate] = Decl.const false → False
x✝ : aig.decls[input.lhs.ref.gate] = Decl.const true → False
hres :
  { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
      ref := { gate := input.lhs.ref.gate, hgate := ⋯ } } =
    res
idx✝ : Nat
h1✝ :
  idx✝ <
    { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
            ref := { gate := input.lhs.ref.gate, hgate := ⋯ } }.aig.decls.size
h2✝ : idx✝ < aig.decls.size
⊢ { aig := { decls := aig.decls, cache := aig.cache, invariant := ⋯ },
            ref := { gate := input.lhs.ref.gate, hgate := ⋯ } }.aig.decls[idx✝] =
    aig.decls[idx✝]