-- Mathlib/.lake/packages/lean4/src/lean/Std/Sat/AIG/RefVecOperator/Map.lean
theorem go_denote_mem_prefix {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]
    (start : Nat) (hstart) :
    ⟦
      (go aig curr hcurr s input f).aig,
      ⟨start, by apply Nat.lt_of_lt_of_le; exact hstart; apply go_le_size⟩,
      assign
    ⟧
      =
    ⟦aig, ⟨start, hstart⟩, assign⟧

Proof state:
case hprefix.idx_eq
α : 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
start : Nat
hstart : start < aig.decls.size
idx✝ : Nat
h✝ : idx✝ < { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls.size
⊢ (go aig curr hcurr s input f).aig.decls[idx✝] =
    { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls[idx✝]

Tactic:
apply go_decl_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
start : Nat
hstart : start < aig.decls.size
⊢ ⟦assign, { aig := (go aig curr hcurr s input f).aig, ref := { gate := start, hgate := ⋯ } }⟧ =
    ⟦assign, { aig := aig, ref := { gate := start, hgate := hstart } }⟧

Tactic:
apply denote.eq_of_isPrefix (entry := ⟨aig, start,hstart⟩)

Result:
case hprefix
α : 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
start : Nat
hstart : start < aig.decls.size
⊢ IsPrefix { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls (go aig curr hcurr s input f).aig.decls

Proof state:
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
aig✝ : AIG α
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
start : Nat
hstart : start < aig.decls.size
⊢ start < (go aig curr hcurr s input f).aig.decls.size

Tactic:
apply Nat.lt_of_lt_of_le

Result:
case a
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
aig✝ : AIG α
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
start : Nat
hstart : start < aig.decls.size
⊢ start < ?m

case a
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
aig✝ : AIG α
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
start : Nat
hstart : start < aig.decls.size
⊢ ?m ≤ (go aig curr hcurr s input f).aig.decls.size

case m
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
aig✝ : AIG α
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
start : Nat
hstart : start < aig.decls.size
⊢ Nat

Proof state:
case hprefix.size_le
α : 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
start : Nat
hstart : start < aig.decls.size
⊢ { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls.size ≤
    (go aig curr hcurr s input f).aig.decls.size

Tactic:
apply go_le_size

Result:
no goals

Proof state:
case hprefix
α : 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
start : Nat
hstart : start < aig.decls.size
⊢ IsPrefix { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls (go aig curr hcurr s input f).aig.decls

Tactic:
apply IsPrefix.of

Result:
case hprefix.idx_eq
α : 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
start : Nat
hstart : start < aig.decls.size
⊢ ∀ (idx : Nat) (h : idx < { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls.size),
    (go aig curr hcurr s input f).aig.decls[idx] =
      { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls[idx]

case hprefix.size_le
α : 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
start : Nat
hstart : start < aig.decls.size
⊢ { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls.size ≤
    (go aig curr hcurr s input f).aig.decls.size

Proof state:
case a
α : Type
inst✝³ : Hashable α
inst✝² : DecidableEq α
aig✝ : AIG α
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
start : Nat
hstart : start < aig.decls.size
⊢ aig.decls.size ≤ (go aig curr hcurr s input f).aig.decls.size

Tactic:
apply go_le_size

Result:
no goals

Proof state:
case hprefix.idx_eq
α : 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
start : Nat
hstart : start < aig.decls.size
⊢ ∀ (idx : Nat) (h : idx < { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls.size),
    (go aig curr hcurr s input f).aig.decls[idx] =
      { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls[idx]

Tactic:
intros

Result:
case hprefix.idx_eq
α : 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
start : Nat
hstart : start < aig.decls.size
idx✝ : Nat
h✝ : idx✝ < { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls.size
⊢ (go aig curr hcurr s input f).aig.decls[idx✝] =
    { aig := aig, ref := { gate := start, hgate := hstart } }.aig.decls[idx✝]