-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/CachedGatesLemmas.lean
theorem mkNotCached_decl_eq idx (aig : AIG α) (gate : Ref aig) {h : idx < aig.decls.size} {h2} :
    (aig.mkNotCached gate).aig.decls[idx]'h2 = aig.decls[idx]

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ ((aig.mkConstCached true).aig.mkGateCached
            { lhs := { ref := (aig.mkConstCached true).ref, inv := false },
              rhs := { ref := gate.cast ⋯, inv := true } }).aig.decls[idx] =
    aig.decls[idx]

Tactic:
rw [AIG.LawfulOperator.decl_eq (f := mkGateCached)]

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ (aig.mkConstCached true).aig.decls[idx] = aig.decls[idx]

case h1
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ idx < (aig.mkConstCached true).aig.decls.size

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ (aig.mkConstCached true).aig.decls[idx] = aig.decls[idx]

case h1
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ idx < (aig.mkConstCached true).aig.decls.size

Tactic:
rw [AIG.LawfulOperator.decl_eq (f := mkConstCached)]

Result:
case h2
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ idx < (aig.mkConstCached true).aig.decls.size

Proof state:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ (aig.mkNotCached gate).aig.decls[idx] = aig.decls[idx]

Tactic:
simp only [mkNotCached]

Result:
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ ((aig.mkConstCached true).aig.mkGateCached
            { lhs := { ref := (aig.mkConstCached true).ref, inv := false },
              rhs := { ref := gate.cast ⋯, inv := true } }).aig.decls[idx] =
    aig.decls[idx]

Proof state:
case h2
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ idx < (aig.mkConstCached true).aig.decls.size

Tactic:
apply LawfulOperator.lt_size_of_lt_aig_size (f := mkConstCached)

Result:
case h2.h
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ idx < aig.decls.size

Proof state:
case h2.h
α : Type
inst✝¹ : Hashable α
inst✝ : DecidableEq α
idx : Nat
aig : AIG α
gate : aig.Ref
h : idx < aig.decls.size
h2 : idx < (aig.mkNotCached gate).aig.decls.size
⊢ idx < aig.decls.size

Tactic:
assumption

Result:
no goals