Theorem: AIG.RefStream.fold.denote_go_and (LeanSAT/AIG/RefStreamOperator.lean)

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
⊢ (⟦{ aig := (go aig acc curr len input mkAndCached).aig, ref := (go aig acc curr len input mkAndCached).ref },
        assign⟧ =
      true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
generalize hgo : go aig acc curr len input mkAndCached = res
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
hgo : go aig acc curr len input mkAndCached = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
hgo : go aig acc curr len input mkAndCached = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
unfold go at hgo
State after:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
hgo :
  (if hidx : curr < len then
      let res := aig.mkAndCached { lhs := acc, rhs := input.getRef curr hidx };
      let aig_1 := res.aig;
      let newAcc := res.ref;
      let input := input.cast ⋯;
      go aig_1 newAcc (curr + 1) len input mkAndCached
    else { aig := aig, ref := acc }) =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
hgo :
  (if hidx : curr < len then
      let res := aig.mkAndCached { lhs := acc, rhs := input.getRef curr hidx };
      let aig_1 := res.aig;
      let newAcc := res.ref;
      let input := input.cast ⋯;
      go aig_1 newAcc (curr + 1) len input mkAndCached
    else { aig := aig, ref := acc }) =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
split at hgo
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  (let res := aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ };
    let aig_1 := res.aig;
    let newAcc := res.ref;
    let input := input.cast ⋯;
    go aig_1 newAcc (curr + 1) len input mkAndCached) =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  (let res := aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ };
    let aig_1 := res.aig;
    let newAcc := res.ref;
    let input := input.cast ⋯;
    go aig_1 newAcc (curr + 1) len input mkAndCached) =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
. dsimp at hgo
  rw [← hgo]
  rw [denote_go_and]
  . simp only [denote_projected_entry, denote_mkAndCached, Bool.and_eq_true, getRef_cast,
      eq_iff_iff]
    constructor
    . intro h
      rcases h with ⟨⟨h1, h2⟩, h3⟩
      constructor
      . assumption
      . intro idx hidx1 hidx2
        cases Nat.eq_or_lt_of_le hidx2 with
        | inl heq => simpa [heq] using h2
        | inr hlt =>
          specialize h3 idx hidx1 (by omega)
          rw [← h3]
          rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
          . simp
          . simp [Ref.hgate]
    . simp only [and_imp]
      intro hacc hrest
      constructor
      . simp [hacc, hrest]
      . intro idx hidx1 hidx2
        specialize hrest idx hidx1 (by omega)
        rw [← hrest]
        rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
        . simp
        . simp [Ref.hgate]
  . omega
State after:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
. rw [← hgo]
  simp only [eq_iff_iff, iff_self_and]
  omega
State after:
no goals

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  (let res := aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ };
    let aig_1 := res.aig;
    let newAcc := res.ref;
    let input := input.cast ⋯;
    go aig_1 newAcc (curr + 1) len input mkAndCached) =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
dsimp at hgo
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
rw [← hgo]
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{
          aig :=
            (go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
                (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯)
                mkAndCached).aig,
          ref :=
            (go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
                (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯)
                mkAndCached).ref },
        assign⟧ =
      true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{
          aig :=
            (go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
                (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯)
                mkAndCached).aig,
          ref :=
            (go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
                (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯)
                mkAndCached).ref },
        assign⟧ =
      true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
rw [denote_go_and]
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref },
          assign⟧ =
        true ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.cast ⋯).getRef idx hidx1 },
              assign⟧ =
            true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

case isTrue.hcurr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ curr + 1 ≤ len

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref },
          assign⟧ =
        true ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.cast ⋯).getRef idx hidx1 },
              assign⟧ =
            true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

case isTrue.hcurr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ curr + 1 ≤ len
Tactic:
. simp only [denote_projected_entry, denote_mkAndCached, Bool.and_eq_true, getRef_cast,
    eq_iff_iff]
  constructor
  . intro h
    rcases h with ⟨⟨h1, h2⟩, h3⟩
    constructor
    . assumption
    . intro idx hidx1 hidx2
      cases Nat.eq_or_lt_of_le hidx2 with
      | inl heq => simpa [heq] using h2
      | inr hlt =>
        specialize h3 idx hidx1 (by omega)
        rw [← h3]
        rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
        . simp
        . simp [Ref.hgate]
  . simp only [and_imp]
    intro hacc hrest
    constructor
    . simp [hacc, hrest]
    . intro idx hidx1 hidx2
      specialize hrest idx hidx1 (by omega)
      rw [← hrest]
      rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
      . simp
      . simp [Ref.hgate]
State after:
case isTrue.hcurr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ curr + 1 ≤ len

State before:
case isTrue.hcurr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ curr + 1 ≤ len
Tactic:
. omega
State after:
no goals

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref },
          assign⟧ =
        true ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.cast ⋯).getRef idx hidx1 },
              assign⟧ =
            true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
simp only [denote_projected_entry, denote_mkAndCached, Bool.and_eq_true, getRef_cast,
  eq_iff_iff]
State after:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ((⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true) ↔
    ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ((⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true) ↔
    ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
constructor
State after:
case isTrue.mp
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ((⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true) →
    ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true

State before:
case isTrue.mp
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ((⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true) →
    ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true
Tactic:
. intro h
  rcases h with ⟨⟨h1, h2⟩, h3⟩
  constructor
  . assumption
  . intro idx hidx1 hidx2
    cases Nat.eq_or_lt_of_le hidx2 with
    | inl heq => simpa [heq] using h2
    | inr hlt =>
      specialize h3 idx hidx1 (by omega)
      rw [← h3]
      rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
      . simp
      . simp [Ref.hgate]
State after:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true

State before:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true
Tactic:
. simp only [and_imp]
  intro hacc hrest
  constructor
  . simp [hacc, hrest]
  . intro idx hidx1 hidx2
    specialize hrest idx hidx1 (by omega)
    rw [← hrest]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
    . simp
    . simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.mp
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ((⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true) →
    ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
intro h
State after:
case isTrue.mp
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h :
  (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
    ∀ (idx : Nat) (hidx1 : idx < len),
      curr + 1 ≤ idx →
        ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
              ref := (input.getRef idx hidx1).cast ⋯ },
            assign⟧ =
          true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
    ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue.mp
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h :
  (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
    ∀ (idx : Nat) (hidx1 : idx < len),
      curr + 1 ≤ idx →
        ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
              ref := (input.getRef idx hidx1).cast ⋯ },
            assign⟧ =
          true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
    ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
rcases h with ⟨⟨h1, h2⟩, h3⟩
State after:
case isTrue.mp.intro.intro
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
    ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue.mp.intro.intro
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
    ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
constructor
State after:
case isTrue.mp.intro.intro.left
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true

case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue.mp.intro.intro.left
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true

case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
. assumption
State after:
case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
. intro idx hidx1 hidx2
  cases Nat.eq_or_lt_of_le hidx2 with
  | inl heq => simpa [heq] using h2
  | inr hlt =>
    specialize h3 idx hidx1 (by omega)
    rw [← h3]
    rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
    . simp
    . simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.mp.intro.intro.left
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true
Tactic:
assumption
State after:
no goals

State before:
case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
intro idx hidx1 hidx2
State after:
case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue.mp.intro.intro.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
cases Nat.eq_or_lt_of_le hidx2 with
| inl heq => simpa [heq] using h2
| inr hlt =>
  specialize h3 idx hidx1 (by omega)
  rw [← h3]
  rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
  . simp
  . simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.mp.intro.intro.right.inl
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
heq : curr = idx
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
simpa [heq] using h2
State after:
no goals

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
specialize h3 idx hidx1 (by omega)
State after:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
rw [← h3]
State after:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
        ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
        ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧
Tactic:
rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
State after:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := aig,
        ref := { gate := ((input.getRef idx hidx1).cast ⋯).gate, hgate := ?isTrue.mp.intro.intro.right.inr } },
      assign⟧

case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := aig,
        ref := { gate := ((input.getRef idx hidx1).cast ⋯).gate, hgate := ?isTrue.mp.intro.intro.right.inr } },
      assign⟧

case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size
Tactic:
. simp
State after:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size
Tactic:
. simp [Ref.hgate]
State after:
no goals

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h3 :
  ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
⊢ curr + 1 ≤ idx
Tactic:
omega
State after:
no goals

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ =
    ⟦{ aig := aig,
        ref := { gate := ((input.getRef idx hidx1).cast ⋯).gate, hgate := ?isTrue.mp.intro.intro.right.inr } },
      assign⟧
Tactic:
simp
State after:
no goals

State before:
case isTrue.mp.intro.intro.right.inr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
h1 : ⟦{ aig := aig, ref := acc }, assign⟧ = true
h2 : ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr ≤ idx
hlt : curr < idx
h3 :
  ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size
Tactic:
simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
      ∀ (idx : Nat) (hidx1 : idx < len),
        curr + 1 ≤ idx →
          ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                ref := (input.getRef idx hidx1).cast ⋯ },
              assign⟧ =
            true
Tactic:
simp only [and_imp]
State after:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true →
    (∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
      (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
        ∀ (idx : Nat) (hidx1 : idx < len),
          curr + 1 ≤ idx →
            ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                  ref := (input.getRef idx hidx1).cast ⋯ },
                assign⟧ =
              true

State before:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true →
    (∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true) →
      (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
        ∀ (idx : Nat) (hidx1 : idx < len),
          curr + 1 ≤ idx →
            ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
                  ref := (input.getRef idx hidx1).cast ⋯ },
                assign⟧ =
              true
Tactic:
intro hacc hrest
State after:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
    ∀ (idx : Nat) (hidx1 : idx < len),
      curr + 1 ≤ idx →
        ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
              ref := (input.getRef idx hidx1).cast ⋯ },
            assign⟧ =
          true

State before:
case isTrue.mpr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true) ∧
    ∀ (idx : Nat) (hidx1 : idx < len),
      curr + 1 ≤ idx →
        ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
              ref := (input.getRef idx hidx1).cast ⋯ },
            assign⟧ =
          true
Tactic:
constructor
State after:
case isTrue.mpr.left
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true

case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true

State before:
case isTrue.mpr.left
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true

case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
Tactic:
. simp [hacc, hrest]
State after:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
Tactic:
. intro idx hidx1 hidx2
  specialize hrest idx hidx1 (by omega)
  rw [← hrest]
  rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
  . simp
  . simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.mpr.left
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true ∧ ⟦{ aig := aig, ref := input.getRef curr h✝ }, assign⟧ = true
Tactic:
simp [hacc, hrest]
State after:
no goals

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ∀ (idx : Nat) (hidx1 : idx < len),
    curr + 1 ≤ idx →
      ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig,
            ref := (input.getRef idx hidx1).cast ⋯ },
          assign⟧ =
        true
Tactic:
intro idx hidx1 hidx2
State after:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
⊢ ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
⊢ ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
Tactic:
specialize hrest idx hidx1 (by omega)
State after:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    true
Tactic:
rw [← hrest]
State after:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig, ref := (input.getRef idx hidx1).cast ⋯ },
      assign⟧ =
    ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧
Tactic:
rw [AIG.LawfulOperator.denote_mem_prefix (f := AIG.mkAndCached)]
State after:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := { gate := ((input.getRef idx hidx1).cast ⋯).gate, hgate := ?isTrue.mpr.right } }, assign⟧ =
    ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧

case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := { gate := ((input.getRef idx hidx1).cast ⋯).gate, hgate := ?isTrue.mpr.right } }, assign⟧ =
    ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧

case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size
Tactic:
. simp
State after:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size
Tactic:
. simp [Ref.hgate]
State after:
no goals

State before:
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
hrest : ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
⊢ curr ≤ idx
Tactic:
omega
State after:
no goals

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ⟦{ aig := aig, ref := { gate := ((input.getRef idx hidx1).cast ⋯).gate, hgate := ?isTrue.mpr.right } }, assign⟧ =
    ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧
Tactic:
simp
State after:
no goals

State before:
case isTrue.mpr.right
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
hacc : ⟦{ aig := aig, ref := acc }, assign⟧ = true
idx : Nat
hidx1 : idx < len
hidx2 : curr + 1 ≤ idx
hrest : ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
⊢ ((input.getRef idx hidx1).cast ⋯).gate < aig.decls.size
Tactic:
simp [Ref.hgate]
State after:
no goals

State before:
case isTrue.hcurr
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : curr < len
hgo :
  go (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).aig
      (aig.mkAndCached { lhs := acc, rhs := input.getRef curr h✝ }).ref (curr + 1) len (input.cast ⋯) mkAndCached =
    res
⊢ curr + 1 ≤ len
Tactic:
omega
State after:
no goals

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := res.aig, ref := res.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
rw [← hgo]
State after:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := { aig := aig, ref := acc }.aig, ref := { aig := aig, ref := acc }.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ (⟦{ aig := { aig := aig, ref := acc }.aig, ref := { aig := aig, ref := acc }.ref }, assign⟧ = true) =
    (⟦{ aig := aig, ref := acc }, assign⟧ = true ∧
      ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true)
Tactic:
simp only [eq_iff_iff, iff_self_and]
State after:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true →
    ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true

State before:
case isFalse
α : Type
inst✝² : BEq α
inst✝¹ : Hashable α
inst✝ : DecidableEq α
aig✝ : AIG α
len : Nat
assign : α → Bool
aig : AIG α
acc : aig.Ref
curr : Nat
hcurr : curr ≤ len
input : aig.RefStream len
res : Entrypoint α
h✝ : ¬curr < len
hgo : { aig := aig, ref := acc } = res
⊢ ⟦{ aig := aig, ref := acc }, assign⟧ = true →
    ∀ (idx : Nat) (hidx1 : idx < len), curr ≤ idx → ⟦{ aig := aig, ref := input.getRef idx hidx1 }, assign⟧ = true
Tactic:
omega
State after:
no goals