-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/LawfulOperator.lean
theorem denote.go_eq_of_isPrefix (decls1 decls2 : Array (Decl α)) (start : Nat) {hdag1} {hdag2}
    {hbounds1} {hbounds2} (hprefix : IsPrefix decls1 decls2) :
    denote.go start decls2 assign hbounds2 hdag2
      =
    denote.go start decls1 assign hbounds1 hdag1

Proof state:
α : Type
assign : α → Bool
decls1 decls2 : Array (Decl α)
start : Nat
hdag1 : IsDAG α decls1
hdag2 : IsDAG α decls2
hbounds1 : start < decls1.size
hbounds2 : start < decls2.size
hprefix : IsPrefix decls1 decls2
hidx1 : decls2[start] = decls1[start]
lhs rhs : Nat
linv rinv : Bool
heq✝ : decls2[start] = Decl.gate lhs rhs linv rinv
heq : decls1[start] = Decl.gate lhs rhs linv rinv
this : lhs < start ∧ rhs < start
hidx2 : decls2[lhs] = decls1[lhs]
hidx3 : decls2[rhs] = decls1[rhs]
⊢ (let_fun this := ⋯;
    let lval := go lhs decls2 assign ⋯ ⋯;
    let rval := go rhs decls2 assign ⋯ ⋯;
    (lval ^^ linv) && (rval ^^ rinv)) =
    match elem : decls1[start] with
    | Decl.const b => b
    | Decl.atom v => assign v
    | Decl.gate lhs rhs linv rinv =>
      let_fun this := ⋯;
      let lval := go lhs decls1 assign ⋯ ⋯;
      let rval := go rhs decls1 assign ⋯ ⋯;
      (lval ^^ linv) && (rval ^^ rinv)

Tactic:
split

Result:
case h_1
α : Type
assign : α → Bool
decls1 decls2 : Array (Decl α)
start : Nat
hdag1 : IsDAG α decls1
hdag2 : IsDAG α decls2
hbounds1 : start < decls1.size
hbounds2 : start < decls2.size
hprefix : IsPrefix decls1 decls2
hidx1 : decls2[start] = decls1[start]
lhs rhs : Nat
linv rinv : Bool
heq✝¹ : decls2[start] = Decl.gate lhs rhs linv rinv
heq : decls1[start] = Decl.gate lhs rhs linv rinv
this : lhs < start ∧ rhs < start
hidx2 : decls2[lhs] = decls1[lhs]
hidx3 : decls2[rhs] = decls1[rhs]
b✝ : Bool
heq✝ : decls1[start] = Decl.const b✝
⊢ (let_fun this := ⋯;
    let lval := go lhs decls2 assign ⋯ ⋯;
    let rval := go rhs decls2 assign ⋯ ⋯;
    (lval ^^ linv) && (rval ^^ rinv)) =
    b✝

case h_2
α : Type
assign : α → Bool
decls1 decls2 : Array (Decl α)
start : Nat
hdag1 : IsDAG α decls1
hdag2 : IsDAG α decls2
hbounds1 : start < decls1.size
hbounds2 : start < decls2.size
hprefix : IsPrefix decls1 decls2
hidx1 : decls2[start] = decls1[start]
lhs rhs : Nat
linv rinv : Bool
heq✝¹ : decls2[start] = Decl.gate lhs rhs linv rinv
heq : decls1[start] = Decl.gate lhs rhs linv rinv
this : lhs < start ∧ rhs < start
hidx2 : decls2[lhs] = decls1[lhs]
hidx3 : decls2[rhs] = decls1[rhs]
idx✝ : α
heq✝ : decls1[start] = Decl.atom idx✝
⊢ (let_fun this := ⋯;
    let lval := go lhs decls2 assign ⋯ ⋯;
    let rval := go rhs decls2 assign ⋯ ⋯;
    (lval ^^ linv) && (rval ^^ rinv)) =
    assign idx✝

case h_3
α : Type
assign : α → Bool
decls1 decls2 : Array (Decl α)
start : Nat
hdag1 : IsDAG α decls1
hdag2 : IsDAG α decls2
hbounds1 : start < decls1.size
hbounds2 : start < decls2.size
hprefix : IsPrefix decls1 decls2
hidx1 : decls2[start] = decls1[start]
lhs rhs : Nat
linv rinv : Bool
heq✝¹ : decls2[start] = Decl.gate lhs rhs linv rinv
heq : decls1[start] = Decl.gate lhs rhs linv rinv
this : lhs < start ∧ rhs < start
hidx2 : decls2[lhs] = decls1[lhs]
hidx3 : decls2[rhs] = decls1[rhs]
lidx✝ ridx✝ : Nat
linv✝ rinv✝ : Bool
heq✝ : decls1[start] = Decl.gate lidx✝ ridx✝ linv✝ rinv✝
⊢ (let_fun this := ⋯;
    let lval := go lhs decls2 assign ⋯ ⋯;
    let rval := go rhs decls2 assign ⋯ ⋯;
    (lval ^^ linv) && (rval ^^ rinv)) =
    let_fun this := ⋯;
    let lval := go lidx✝ decls1 assign ⋯ ⋯;
    let rval := go ridx✝ decls1 assign ⋯ ⋯;
    (lval ^^ linv✝) && (rval ^^ rinv✝)

Proof state:
α : Type
assign : α → Bool
decls1 decls2 : Array (Decl α)
start : Nat
hdag1 : IsDAG α decls1
hdag2 : IsDAG α decls2
hbounds1 : start < decls1.size
hbounds2 : start < decls2.size
hprefix : IsPrefix decls1 decls2
hidx1 : decls2[start] = decls1[start]
lhs rhs : Nat
linv rinv : Bool
heq : decls2[start] = Decl.gate lhs rhs linv rinv
⊢ (let_fun this := ⋯;
    let lval := go lhs decls2 assign ⋯ ⋯;
    let rval := go rhs decls2 assign ⋯ ⋯;
    (lval ^^ linv) && (rval ^^ rinv)) =
    match elem : decls1[start] with
    | Decl.const b => b
    | Decl.atom v => assign v
    | Decl.gate lhs rhs linv rinv =>
      let_fun this := ⋯;
      let lval := go lhs decls1 assign ⋯ ⋯;
      let rval := go rhs decls1 assign ⋯ ⋯;
      (lval ^^ linv) && (rval ^^ rinv)

Tactic:
rw [hidx1] at heq

Result:
α : Type
assign : α → Bool
decls1 decls2 : Array (Decl α)
start : Nat
hdag1 : IsDAG α decls1
hdag2 : IsDAG α decls2
hbounds1 : start < decls1.size
hbounds2 : start < decls2.size
hprefix : IsPrefix decls1 decls2
hidx1 : decls2[start] = decls1[start]
lhs rhs : Nat
linv rinv : Bool
heq✝ : decls2[start] = Decl.gate lhs rhs linv rinv
heq : decls1[start] = Decl.gate lhs rhs linv rinv
⊢ (let_fun this := ⋯;
    let lval := go lhs decls2 assign ⋯ ⋯;
    let rval := go rhs decls2 assign ⋯ ⋯;
    (lval ^^ linv) && (rval ^^ rinv)) =
    match elem : decls1[start] with
    | Decl.const b => b
    | Decl.atom v => assign v
    | Decl.gate lhs rhs linv rinv =>
      let_fun this := ⋯;
      let lval := go lhs decls1 assign ⋯ ⋯;
      let rval := go rhs decls1 assign ⋯ ⋯;
      (lval ^^ linv) && (rval ^^ rinv)