-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/RefVecOperator/Map.lean
theorem denote_go {aig : AIG α} (curr : Nat) (hcurr : curr ≤ len) (s : RefVec aig curr)
    (input : RefVec aig len) (f : (aig : AIG α) → Ref aig → Entrypoint α)
    [LawfulOperator α Ref f] [LawfulMapOperator α f] :
    ∀ (idx : Nat) (hidx1 : idx < len),
      curr ≤ idx
        →
      ⟦(go aig curr hcurr s input f).aig, (go aig curr hcurr s input f).vec.get idx hidx1, assign⟧
        =
      ⟦f aig (input.get idx hidx1), assign⟧

Proof state:
case isTrue.inr
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
hlt : curr < idx
⊢ ⟦assign, f (f aig (input.get curr h✝)).aig ((input.cast ⋯).get idx hidx1)⟧ = ⟦assign, f aig (input.get idx hidx1)⟧

Tactic:
simp [get_cast, -Ref.cast_eq]

Result:
no goals

Proof state:
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
⊢ ∀ (idx : Nat) (hidx1 : idx < len),
    curr ≤ idx →
      ⟦assign, { aig := (go aig curr hcurr s input f).aig, ref := (go aig curr hcurr s input f).vec.get idx hidx1 }⟧ =
        ⟦assign, f aig (input.get idx hidx1)⟧

Tactic:
intro idx hidx1 hidx2

Result:
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
⊢ ⟦assign, { aig := (go aig curr hcurr s input f).aig, ref := (go aig curr hcurr s input f).vec.get idx hidx1 }⟧ =
    ⟦assign, f aig (input.get idx hidx1)⟧

Proof state:
case isTrue.inr.a
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
hlt : curr < idx
⊢ curr + 1 ≤ idx

Tactic:
omega

Result:
no goals

Proof state:
case isTrue.inl
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
heq : curr = idx
⊢ ⟦assign,
      {
        aig :=
          (go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref)
              (input.cast ⋯) f).aig,
        ref := (f aig (input.get curr h✝)).ref.cast ⋯ }⟧ =
    ⟦assign, f aig (input.get idx hidx1)⟧

Tactic:
simp only [← heq]

Result:
case isTrue.inl
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
heq : curr = idx
⊢ ⟦assign,
      {
        aig :=
          (go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref)
              (input.cast ⋯) f).aig,
        ref := (f aig (input.get curr h✝)).ref.cast ⋯ }⟧ =
    ⟦assign, f aig (input.get curr ⋯)⟧

Proof state:
case isTrue.inl
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
heq : curr = idx
⊢ ⟦assign,
      {
        aig :=
          (go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref)
              (input.cast ⋯) f).aig,
        ref := (((s.cast ⋯).push (f aig (input.get curr h✝)).ref).get idx ?isTrue.inl.hidx).cast ⋯ }⟧ =
    ⟦assign, f aig (input.get idx hidx1)⟧

case isTrue.inl.hidx
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
heq : curr = idx
⊢ idx < curr + 1

Tactic:
rw [AIG.RefVec.get_push_ref_eq']

Result:
case isTrue.inl
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
heq : curr = idx
⊢ ⟦assign,
      {
        aig :=
          (go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref)
              (input.cast ⋯) f).aig,
        ref := (f aig (input.get curr h✝)).ref.cast ⋯ }⟧ =
    ⟦assign, f aig (input.get idx hidx1)⟧

case isTrue.inl.hidx
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
len : Nat
assign : α → Bool
aig : AIG α
curr : Nat
hcurr : curr ≤ len
s : aig.RefVec curr
input : aig.RefVec len
f : (aig : AIG α) → aig.Ref → Entrypoint α
inst✝¹ : LawfulOperator α Ref f
inst✝ : LawfulMapOperator α f
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
res : RefVecEntry α len
h✝ : curr < len
hgo :
  go (f aig (input.get curr h✝)).aig (curr + 1) ⋯ ((s.cast ⋯).push (f aig (input.get curr h✝)).ref) (input.cast ⋯) f =
    res
heq : curr = idx
⊢ idx = curr